var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value2) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value2 }) : obj[key] = value2;
var __spreadValues = (a, b) => {
  for (var prop in b || (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 __publicField = (obj, key, value2) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value2);
  return value2;
};
(function(global2, factory) {
  typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory(require("vue"), require("@element-plus/icons-vue")) : typeof define === "function" && define.amd ? define(["vue", "@element-plus/icons-vue"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.VFormDesigner = factory(global2.Vue, global2.ElementPlusIconsVue));
})(this, function(require$$0$1, ElementPlusIconsVue) {
  "use strict";
  function _interopDefaultLegacy(e) {
    return e && typeof e === "object" && "default" in e ? e : { "default": e };
  }
  function _interopNamespace(e) {
    if (e && e.__esModule)
      return e;
    var n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
    if (e) {
      Object.keys(e).forEach(function(k) {
        if (k !== "default") {
          var d = Object.getOwnPropertyDescriptor(e, k);
          Object.defineProperty(n, k, d.get ? d : {
            enumerable: true,
            get: function() {
              return e[k];
            }
          });
        }
      });
    }
    n["default"] = e;
    return Object.freeze(n);
  }
  var require$$0__default = /* @__PURE__ */ _interopDefaultLegacy(require$$0$1);
  var ElementPlusIconsVue__namespace = /* @__PURE__ */ _interopNamespace(ElementPlusIconsVue);
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  function getDefaultExportFromCjs(x) {
    return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
  }
  var axios$2 = { exports: {} };
  var bind$2 = function bind2(fn, thisArg) {
    return function wrap() {
      var args = new Array(arguments.length);
      for (var i2 = 0; i2 < args.length; i2++) {
        args[i2] = arguments[i2];
      }
      return fn.apply(thisArg, args);
    };
  };
  var bind$1 = bind$2;
  var toString = Object.prototype.toString;
  function isArray(val) {
    return toString.call(val) === "[object Array]";
  }
  function isUndefined(val) {
    return typeof val === "undefined";
  }
  function isBuffer(val) {
    return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === "function" && val.constructor.isBuffer(val);
  }
  function isArrayBuffer(val) {
    return toString.call(val) === "[object ArrayBuffer]";
  }
  function isFormData(val) {
    return typeof FormData !== "undefined" && val instanceof FormData;
  }
  function isArrayBufferView(val) {
    var result;
    if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
      result = ArrayBuffer.isView(val);
    } else {
      result = val && val.buffer && val.buffer instanceof ArrayBuffer;
    }
    return result;
  }
  function isString(val) {
    return typeof val === "string";
  }
  function isNumber(val) {
    return typeof val === "number";
  }
  function isObject(val) {
    return val !== null && typeof val === "object";
  }
  function isPlainObject(val) {
    if (toString.call(val) !== "[object Object]") {
      return false;
    }
    var prototype = Object.getPrototypeOf(val);
    return prototype === null || prototype === Object.prototype;
  }
  function isDate(val) {
    return toString.call(val) === "[object Date]";
  }
  function isFile(val) {
    return toString.call(val) === "[object File]";
  }
  function isBlob(val) {
    return toString.call(val) === "[object Blob]";
  }
  function isFunction(val) {
    return toString.call(val) === "[object Function]";
  }
  function isStream(val) {
    return isObject(val) && isFunction(val.pipe);
  }
  function isURLSearchParams(val) {
    return typeof URLSearchParams !== "undefined" && val instanceof URLSearchParams;
  }
  function trim(str) {
    return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, "");
  }
  function isStandardBrowserEnv() {
    if (typeof navigator !== "undefined" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS")) {
      return false;
    }
    return typeof window !== "undefined" && typeof document !== "undefined";
  }
  function forEach(obj, fn) {
    if (obj === null || typeof obj === "undefined") {
      return;
    }
    if (typeof obj !== "object") {
      obj = [obj];
    }
    if (isArray(obj)) {
      for (var i2 = 0, l = obj.length; i2 < l; i2++) {
        fn.call(null, obj[i2], i2, obj);
      }
    } else {
      for (var key in obj) {
        if (Object.prototype.hasOwnProperty.call(obj, key)) {
          fn.call(null, obj[key], key, obj);
        }
      }
    }
  }
  function merge() {
    var result = {};
    function assignValue(val, key) {
      if (isPlainObject(result[key]) && isPlainObject(val)) {
        result[key] = merge(result[key], val);
      } else if (isPlainObject(val)) {
        result[key] = merge({}, val);
      } else if (isArray(val)) {
        result[key] = val.slice();
      } else {
        result[key] = val;
      }
    }
    for (var i2 = 0, l = arguments.length; i2 < l; i2++) {
      forEach(arguments[i2], assignValue);
    }
    return result;
  }
  function extend$2(a, b, thisArg) {
    forEach(b, function assignValue(val, key) {
      if (thisArg && typeof val === "function") {
        a[key] = bind$1(val, thisArg);
      } else {
        a[key] = val;
      }
    });
    return a;
  }
  function stripBOM(content2) {
    if (content2.charCodeAt(0) === 65279) {
      content2 = content2.slice(1);
    }
    return content2;
  }
  var utils$e = {
    isArray,
    isArrayBuffer,
    isBuffer,
    isFormData,
    isArrayBufferView,
    isString,
    isNumber,
    isObject,
    isPlainObject,
    isUndefined,
    isDate,
    isFile,
    isBlob,
    isFunction,
    isStream,
    isURLSearchParams,
    isStandardBrowserEnv,
    forEach,
    merge,
    extend: extend$2,
    trim,
    stripBOM
  };
  var utils$d = utils$e;
  function encode(val) {
    return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
  }
  var buildURL$2 = function buildURL2(url, params, paramsSerializer) {
    if (!params) {
      return url;
    }
    var serializedParams;
    if (paramsSerializer) {
      serializedParams = paramsSerializer(params);
    } else if (utils$d.isURLSearchParams(params)) {
      serializedParams = params.toString();
    } else {
      var parts = [];
      utils$d.forEach(params, function serialize(val, key) {
        if (val === null || typeof val === "undefined") {
          return;
        }
        if (utils$d.isArray(val)) {
          key = key + "[]";
        } else {
          val = [val];
        }
        utils$d.forEach(val, function parseValue(v) {
          if (utils$d.isDate(v)) {
            v = v.toISOString();
          } else if (utils$d.isObject(v)) {
            v = JSON.stringify(v);
          }
          parts.push(encode(key) + "=" + encode(v));
        });
      });
      serializedParams = parts.join("&");
    }
    if (serializedParams) {
      var hashmarkIndex = url.indexOf("#");
      if (hashmarkIndex !== -1) {
        url = url.slice(0, hashmarkIndex);
      }
      url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
    }
    return url;
  };
  var utils$c = utils$e;
  function InterceptorManager$1() {
    this.handlers = [];
  }
  InterceptorManager$1.prototype.use = function use(fulfilled, rejected, options) {
    this.handlers.push({
      fulfilled,
      rejected,
      synchronous: options ? options.synchronous : false,
      runWhen: options ? options.runWhen : null
    });
    return this.handlers.length - 1;
  };
  InterceptorManager$1.prototype.eject = function eject(id2) {
    if (this.handlers[id2]) {
      this.handlers[id2] = null;
    }
  };
  InterceptorManager$1.prototype.forEach = function forEach2(fn) {
    utils$c.forEach(this.handlers, function forEachHandler(h) {
      if (h !== null) {
        fn(h);
      }
    });
  };
  var InterceptorManager_1 = InterceptorManager$1;
  var utils$b = utils$e;
  var normalizeHeaderName$1 = function normalizeHeaderName2(headers, normalizedName) {
    utils$b.forEach(headers, function processHeader(value2, name2) {
      if (name2 !== normalizedName && name2.toUpperCase() === normalizedName.toUpperCase()) {
        headers[normalizedName] = value2;
        delete headers[name2];
      }
    });
  };
  var enhanceError$2 = function enhanceError2(error2, config2, code2, request, response) {
    error2.config = config2;
    if (code2) {
      error2.code = code2;
    }
    error2.request = request;
    error2.response = response;
    error2.isAxiosError = true;
    error2.toJSON = function toJSON() {
      return {
        message: this.message,
        name: this.name,
        description: this.description,
        number: this.number,
        fileName: this.fileName,
        lineNumber: this.lineNumber,
        columnNumber: this.columnNumber,
        stack: this.stack,
        config: this.config,
        code: this.code,
        status: this.response && this.response.status ? this.response.status : null
      };
    };
    return error2;
  };
  var enhanceError$1 = enhanceError$2;
  var createError$2 = function createError2(message, config2, code2, request, response) {
    var error2 = new Error(message);
    return enhanceError$1(error2, config2, code2, request, response);
  };
  var createError$1 = createError$2;
  var settle$1 = function settle2(resolve, reject, response) {
    var validateStatus = response.config.validateStatus;
    if (!response.status || !validateStatus || validateStatus(response.status)) {
      resolve(response);
    } else {
      reject(createError$1("Request failed with status code " + response.status, response.config, null, response.request, response));
    }
  };
  var utils$a = utils$e;
  var cookies$1 = utils$a.isStandardBrowserEnv() ? function standardBrowserEnv() {
    return {
      write: function write(name2, value2, expires, path, domain, secure) {
        var cookie = [];
        cookie.push(name2 + "=" + encodeURIComponent(value2));
        if (utils$a.isNumber(expires)) {
          cookie.push("expires=" + new Date(expires).toGMTString());
        }
        if (utils$a.isString(path)) {
          cookie.push("path=" + path);
        }
        if (utils$a.isString(domain)) {
          cookie.push("domain=" + domain);
        }
        if (secure === true) {
          cookie.push("secure");
        }
        document.cookie = cookie.join("; ");
      },
      read: function read(name2) {
        var match = document.cookie.match(new RegExp("(^|;\\s*)(" + name2 + ")=([^;]*)"));
        return match ? decodeURIComponent(match[3]) : null;
      },
      remove: function remove2(name2) {
        this.write(name2, "", Date.now() - 864e5);
      }
    };
  }() : function nonStandardBrowserEnv() {
    return {
      write: function write() {
      },
      read: function read() {
        return null;
      },
      remove: function remove2() {
      }
    };
  }();
  var isAbsoluteURL$1 = function isAbsoluteURL2(url) {
    return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  };
  var combineURLs$1 = function combineURLs2(baseURL, relativeURL) {
    return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
  };
  var isAbsoluteURL = isAbsoluteURL$1;
  var combineURLs = combineURLs$1;
  var buildFullPath$1 = function buildFullPath2(baseURL, requestedURL) {
    if (baseURL && !isAbsoluteURL(requestedURL)) {
      return combineURLs(baseURL, requestedURL);
    }
    return requestedURL;
  };
  var utils$9 = utils$e;
  var ignoreDuplicateOf = [
    "age",
    "authorization",
    "content-length",
    "content-type",
    "etag",
    "expires",
    "from",
    "host",
    "if-modified-since",
    "if-unmodified-since",
    "last-modified",
    "location",
    "max-forwards",
    "proxy-authorization",
    "referer",
    "retry-after",
    "user-agent"
  ];
  var parseHeaders$1 = function parseHeaders2(headers) {
    var parsed = {};
    var key;
    var val;
    var i2;
    if (!headers) {
      return parsed;
    }
    utils$9.forEach(headers.split("\n"), function parser2(line) {
      i2 = line.indexOf(":");
      key = utils$9.trim(line.substr(0, i2)).toLowerCase();
      val = utils$9.trim(line.substr(i2 + 1));
      if (key) {
        if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
          return;
        }
        if (key === "set-cookie") {
          parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
        } else {
          parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
        }
      }
    });
    return parsed;
  };
  var utils$8 = utils$e;
  var isURLSameOrigin$1 = utils$8.isStandardBrowserEnv() ? function standardBrowserEnv() {
    var msie = /(msie|trident)/i.test(navigator.userAgent);
    var urlParsingNode = document.createElement("a");
    var originURL;
    function resolveURL(url) {
      var href = url;
      if (msie) {
        urlParsingNode.setAttribute("href", href);
        href = urlParsingNode.href;
      }
      urlParsingNode.setAttribute("href", href);
      return {
        href: urlParsingNode.href,
        protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
        host: urlParsingNode.host,
        search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
        hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
        hostname: urlParsingNode.hostname,
        port: urlParsingNode.port,
        pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
      };
    }
    originURL = resolveURL(window.location.href);
    return function isURLSameOrigin2(requestURL) {
      var parsed = utils$8.isString(requestURL) ? resolveURL(requestURL) : requestURL;
      return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
    };
  }() : function nonStandardBrowserEnv() {
    return function isURLSameOrigin2() {
      return true;
    };
  }();
  function Cancel$3(message) {
    this.message = message;
  }
  Cancel$3.prototype.toString = function toString2() {
    return "Cancel" + (this.message ? ": " + this.message : "");
  };
  Cancel$3.prototype.__CANCEL__ = true;
  var Cancel_1 = Cancel$3;
  var utils$7 = utils$e;
  var settle = settle$1;
  var cookies = cookies$1;
  var buildURL$1 = buildURL$2;
  var buildFullPath = buildFullPath$1;
  var parseHeaders = parseHeaders$1;
  var isURLSameOrigin = isURLSameOrigin$1;
  var createError = createError$2;
  var defaults$7 = defaults_1;
  var Cancel$2 = Cancel_1;
  var xhr = function xhrAdapter(config2) {
    return new Promise(function dispatchXhrRequest(resolve, reject) {
      var requestData = config2.data;
      var requestHeaders = config2.headers;
      var responseType = config2.responseType;
      var onCanceled;
      function done() {
        if (config2.cancelToken) {
          config2.cancelToken.unsubscribe(onCanceled);
        }
        if (config2.signal) {
          config2.signal.removeEventListener("abort", onCanceled);
        }
      }
      if (utils$7.isFormData(requestData)) {
        delete requestHeaders["Content-Type"];
      }
      var request = new XMLHttpRequest();
      if (config2.auth) {
        var username = config2.auth.username || "";
        var password = config2.auth.password ? unescape(encodeURIComponent(config2.auth.password)) : "";
        requestHeaders.Authorization = "Basic " + btoa(username + ":" + password);
      }
      var fullPath = buildFullPath(config2.baseURL, config2.url);
      request.open(config2.method.toUpperCase(), buildURL$1(fullPath, config2.params, config2.paramsSerializer), true);
      request.timeout = config2.timeout;
      function onloadend() {
        if (!request) {
          return;
        }
        var responseHeaders = "getAllResponseHeaders" in request ? parseHeaders(request.getAllResponseHeaders()) : null;
        var responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
        var response = {
          data: responseData,
          status: request.status,
          statusText: request.statusText,
          headers: responseHeaders,
          config: config2,
          request
        };
        settle(function _resolve(value2) {
          resolve(value2);
          done();
        }, function _reject(err) {
          reject(err);
          done();
        }, response);
        request = null;
      }
      if ("onloadend" in request) {
        request.onloadend = onloadend;
      } else {
        request.onreadystatechange = function handleLoad() {
          if (!request || request.readyState !== 4) {
            return;
          }
          if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
            return;
          }
          setTimeout(onloadend);
        };
      }
      request.onabort = function handleAbort() {
        if (!request) {
          return;
        }
        reject(createError("Request aborted", config2, "ECONNABORTED", request));
        request = null;
      };
      request.onerror = function handleError() {
        reject(createError("Network Error", config2, null, request));
        request = null;
      };
      request.ontimeout = function handleTimeout() {
        var timeoutErrorMessage = config2.timeout ? "timeout of " + config2.timeout + "ms exceeded" : "timeout exceeded";
        var transitional = config2.transitional || defaults$7.transitional;
        if (config2.timeoutErrorMessage) {
          timeoutErrorMessage = config2.timeoutErrorMessage;
        }
        reject(createError(timeoutErrorMessage, config2, transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED", request));
        request = null;
      };
      if (utils$7.isStandardBrowserEnv()) {
        var xsrfValue = (config2.withCredentials || isURLSameOrigin(fullPath)) && config2.xsrfCookieName ? cookies.read(config2.xsrfCookieName) : void 0;
        if (xsrfValue) {
          requestHeaders[config2.xsrfHeaderName] = xsrfValue;
        }
      }
      if ("setRequestHeader" in request) {
        utils$7.forEach(requestHeaders, function setRequestHeader(val, key) {
          if (typeof requestData === "undefined" && key.toLowerCase() === "content-type") {
            delete requestHeaders[key];
          } else {
            request.setRequestHeader(key, val);
          }
        });
      }
      if (!utils$7.isUndefined(config2.withCredentials)) {
        request.withCredentials = !!config2.withCredentials;
      }
      if (responseType && responseType !== "json") {
        request.responseType = config2.responseType;
      }
      if (typeof config2.onDownloadProgress === "function") {
        request.addEventListener("progress", config2.onDownloadProgress);
      }
      if (typeof config2.onUploadProgress === "function" && request.upload) {
        request.upload.addEventListener("progress", config2.onUploadProgress);
      }
      if (config2.cancelToken || config2.signal) {
        onCanceled = function(cancel) {
          if (!request) {
            return;
          }
          reject(!cancel || cancel && cancel.type ? new Cancel$2("canceled") : cancel);
          request.abort();
          request = null;
        };
        config2.cancelToken && config2.cancelToken.subscribe(onCanceled);
        if (config2.signal) {
          config2.signal.aborted ? onCanceled() : config2.signal.addEventListener("abort", onCanceled);
        }
      }
      if (!requestData) {
        requestData = null;
      }
      request.send(requestData);
    });
  };
  var utils$6 = utils$e;
  var normalizeHeaderName = normalizeHeaderName$1;
  var enhanceError = enhanceError$2;
  var DEFAULT_CONTENT_TYPE = {
    "Content-Type": "application/x-www-form-urlencoded"
  };
  function setContentTypeIfUnset(headers, value2) {
    if (!utils$6.isUndefined(headers) && utils$6.isUndefined(headers["Content-Type"])) {
      headers["Content-Type"] = value2;
    }
  }
  function getDefaultAdapter() {
    var adapter;
    if (typeof XMLHttpRequest !== "undefined") {
      adapter = xhr;
    } else if (typeof process !== "undefined" && Object.prototype.toString.call(process) === "[object process]") {
      adapter = xhr;
    }
    return adapter;
  }
  function stringifySafely(rawValue, parser2, encoder) {
    if (utils$6.isString(rawValue)) {
      try {
        (parser2 || JSON.parse)(rawValue);
        return utils$6.trim(rawValue);
      } catch (e) {
        if (e.name !== "SyntaxError") {
          throw e;
        }
      }
    }
    return (encoder || JSON.stringify)(rawValue);
  }
  var defaults$6 = {
    transitional: {
      silentJSONParsing: true,
      forcedJSONParsing: true,
      clarifyTimeoutError: false
    },
    adapter: getDefaultAdapter(),
    transformRequest: [function transformRequest(data2, headers) {
      normalizeHeaderName(headers, "Accept");
      normalizeHeaderName(headers, "Content-Type");
      if (utils$6.isFormData(data2) || utils$6.isArrayBuffer(data2) || utils$6.isBuffer(data2) || utils$6.isStream(data2) || utils$6.isFile(data2) || utils$6.isBlob(data2)) {
        return data2;
      }
      if (utils$6.isArrayBufferView(data2)) {
        return data2.buffer;
      }
      if (utils$6.isURLSearchParams(data2)) {
        setContentTypeIfUnset(headers, "application/x-www-form-urlencoded;charset=utf-8");
        return data2.toString();
      }
      if (utils$6.isObject(data2) || headers && headers["Content-Type"] === "application/json") {
        setContentTypeIfUnset(headers, "application/json");
        return stringifySafely(data2);
      }
      return data2;
    }],
    transformResponse: [function transformResponse(data2) {
      var transitional = this.transitional || defaults$6.transitional;
      var silentJSONParsing = transitional && transitional.silentJSONParsing;
      var forcedJSONParsing = transitional && transitional.forcedJSONParsing;
      var strictJSONParsing = !silentJSONParsing && this.responseType === "json";
      if (strictJSONParsing || forcedJSONParsing && utils$6.isString(data2) && data2.length) {
        try {
          return JSON.parse(data2);
        } catch (e) {
          if (strictJSONParsing) {
            if (e.name === "SyntaxError") {
              throw enhanceError(e, this, "E_JSON_PARSE");
            }
            throw e;
          }
        }
      }
      return data2;
    }],
    timeout: 0,
    xsrfCookieName: "XSRF-TOKEN",
    xsrfHeaderName: "X-XSRF-TOKEN",
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: function validateStatus(status) {
      return status >= 200 && status < 300;
    },
    headers: {
      common: {
        "Accept": "application/json, text/plain, */*"
      }
    }
  };
  utils$6.forEach(["delete", "get", "head"], function forEachMethodNoData(method) {
    defaults$6.headers[method] = {};
  });
  utils$6.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
    defaults$6.headers[method] = utils$6.merge(DEFAULT_CONTENT_TYPE);
  });
  var defaults_1 = defaults$6;
  var utils$5 = utils$e;
  var defaults$5 = defaults_1;
  var transformData$1 = function transformData2(data2, headers, fns) {
    var context = this || defaults$5;
    utils$5.forEach(fns, function transform(fn) {
      data2 = fn.call(context, data2, headers);
    });
    return data2;
  };
  var isCancel$1 = function isCancel2(value2) {
    return !!(value2 && value2.__CANCEL__);
  };
  var utils$4 = utils$e;
  var transformData = transformData$1;
  var isCancel = isCancel$1;
  var defaults$4 = defaults_1;
  var Cancel$1 = Cancel_1;
  function throwIfCancellationRequested(config2) {
    if (config2.cancelToken) {
      config2.cancelToken.throwIfRequested();
    }
    if (config2.signal && config2.signal.aborted) {
      throw new Cancel$1("canceled");
    }
  }
  var dispatchRequest$1 = function dispatchRequest2(config2) {
    throwIfCancellationRequested(config2);
    config2.headers = config2.headers || {};
    config2.data = transformData.call(config2, config2.data, config2.headers, config2.transformRequest);
    config2.headers = utils$4.merge(config2.headers.common || {}, config2.headers[config2.method] || {}, config2.headers);
    utils$4.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function cleanHeaderConfig(method) {
      delete config2.headers[method];
    });
    var adapter = config2.adapter || defaults$4.adapter;
    return adapter(config2).then(function onAdapterResolution(response) {
      throwIfCancellationRequested(config2);
      response.data = transformData.call(config2, response.data, response.headers, config2.transformResponse);
      return response;
    }, function onAdapterRejection(reason) {
      if (!isCancel(reason)) {
        throwIfCancellationRequested(config2);
        if (reason && reason.response) {
          reason.response.data = transformData.call(config2, reason.response.data, reason.response.headers, config2.transformResponse);
        }
      }
      return Promise.reject(reason);
    });
  };
  var utils$3 = utils$e;
  var mergeConfig$2 = function mergeConfig2(config1, config2) {
    config2 = config2 || {};
    var config3 = {};
    function getMergedValue(target, source) {
      if (utils$3.isPlainObject(target) && utils$3.isPlainObject(source)) {
        return utils$3.merge(target, source);
      } else if (utils$3.isPlainObject(source)) {
        return utils$3.merge({}, source);
      } else if (utils$3.isArray(source)) {
        return source.slice();
      }
      return source;
    }
    function mergeDeepProperties(prop) {
      if (!utils$3.isUndefined(config2[prop])) {
        return getMergedValue(config1[prop], config2[prop]);
      } else if (!utils$3.isUndefined(config1[prop])) {
        return getMergedValue(void 0, config1[prop]);
      }
    }
    function valueFromConfig2(prop) {
      if (!utils$3.isUndefined(config2[prop])) {
        return getMergedValue(void 0, config2[prop]);
      }
    }
    function defaultToConfig2(prop) {
      if (!utils$3.isUndefined(config2[prop])) {
        return getMergedValue(void 0, config2[prop]);
      } else if (!utils$3.isUndefined(config1[prop])) {
        return getMergedValue(void 0, config1[prop]);
      }
    }
    function mergeDirectKeys(prop) {
      if (prop in config2) {
        return getMergedValue(config1[prop], config2[prop]);
      } else if (prop in config1) {
        return getMergedValue(void 0, config1[prop]);
      }
    }
    var mergeMap = {
      "url": valueFromConfig2,
      "method": valueFromConfig2,
      "data": valueFromConfig2,
      "baseURL": defaultToConfig2,
      "transformRequest": defaultToConfig2,
      "transformResponse": defaultToConfig2,
      "paramsSerializer": defaultToConfig2,
      "timeout": defaultToConfig2,
      "timeoutMessage": defaultToConfig2,
      "withCredentials": defaultToConfig2,
      "adapter": defaultToConfig2,
      "responseType": defaultToConfig2,
      "xsrfCookieName": defaultToConfig2,
      "xsrfHeaderName": defaultToConfig2,
      "onUploadProgress": defaultToConfig2,
      "onDownloadProgress": defaultToConfig2,
      "decompress": defaultToConfig2,
      "maxContentLength": defaultToConfig2,
      "maxBodyLength": defaultToConfig2,
      "transport": defaultToConfig2,
      "httpAgent": defaultToConfig2,
      "httpsAgent": defaultToConfig2,
      "cancelToken": defaultToConfig2,
      "socketPath": defaultToConfig2,
      "responseEncoding": defaultToConfig2,
      "validateStatus": mergeDirectKeys
    };
    utils$3.forEach(Object.keys(config1).concat(Object.keys(config2)), function computeConfigValue(prop) {
      var merge2 = mergeMap[prop] || mergeDeepProperties;
      var configValue = merge2(prop);
      utils$3.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config3[prop] = configValue);
    });
    return config3;
  };
  var data$1 = {
    "version": "0.24.0"
  };
  var VERSION = data$1.version;
  var validators$1 = {};
  ["object", "boolean", "number", "function", "string", "symbol"].forEach(function(type, i2) {
    validators$1[type] = function validator2(thing) {
      return typeof thing === type || "a" + (i2 < 1 ? "n " : " ") + type;
    };
  });
  var deprecatedWarnings = {};
  validators$1.transitional = function transitional(validator2, version2, message) {
    function formatMessage(opt, desc) {
      return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
    }
    return function(value2, opt, opts) {
      if (validator2 === false) {
        throw new Error(formatMessage(opt, " has been removed" + (version2 ? " in " + version2 : "")));
      }
      if (version2 && !deprecatedWarnings[opt]) {
        deprecatedWarnings[opt] = true;
        console.warn(formatMessage(opt, " has been deprecated since v" + version2 + " and will be removed in the near future"));
      }
      return validator2 ? validator2(value2, opt, opts) : true;
    };
  };
  function assertOptions(options, schema, allowUnknown) {
    if (typeof options !== "object") {
      throw new TypeError("options must be an object");
    }
    var keys2 = Object.keys(options);
    var i2 = keys2.length;
    while (i2-- > 0) {
      var opt = keys2[i2];
      var validator2 = schema[opt];
      if (validator2) {
        var value2 = options[opt];
        var result = value2 === void 0 || validator2(value2, opt, options);
        if (result !== true) {
          throw new TypeError("option " + opt + " must be " + result);
        }
        continue;
      }
      if (allowUnknown !== true) {
        throw Error("Unknown option " + opt);
      }
    }
  }
  var validator$1 = {
    assertOptions,
    validators: validators$1
  };
  var utils$2 = utils$e;
  var buildURL = buildURL$2;
  var InterceptorManager = InterceptorManager_1;
  var dispatchRequest = dispatchRequest$1;
  var mergeConfig$1 = mergeConfig$2;
  var validator = validator$1;
  var validators = validator.validators;
  function Axios$1(instanceConfig) {
    this.defaults = instanceConfig;
    this.interceptors = {
      request: new InterceptorManager(),
      response: new InterceptorManager()
    };
  }
  Axios$1.prototype.request = function request(config2) {
    if (typeof config2 === "string") {
      config2 = arguments[1] || {};
      config2.url = arguments[0];
    } else {
      config2 = config2 || {};
    }
    config2 = mergeConfig$1(this.defaults, config2);
    if (config2.method) {
      config2.method = config2.method.toLowerCase();
    } else if (this.defaults.method) {
      config2.method = this.defaults.method.toLowerCase();
    } else {
      config2.method = "get";
    }
    var transitional = config2.transitional;
    if (transitional !== void 0) {
      validator.assertOptions(transitional, {
        silentJSONParsing: validators.transitional(validators.boolean),
        forcedJSONParsing: validators.transitional(validators.boolean),
        clarifyTimeoutError: validators.transitional(validators.boolean)
      }, false);
    }
    var requestInterceptorChain = [];
    var synchronousRequestInterceptors = true;
    this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
      if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config2) === false) {
        return;
      }
      synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
      requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
    });
    var responseInterceptorChain = [];
    this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
      responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
    });
    var promise;
    if (!synchronousRequestInterceptors) {
      var chain = [dispatchRequest, void 0];
      Array.prototype.unshift.apply(chain, requestInterceptorChain);
      chain = chain.concat(responseInterceptorChain);
      promise = Promise.resolve(config2);
      while (chain.length) {
        promise = promise.then(chain.shift(), chain.shift());
      }
      return promise;
    }
    var newConfig = config2;
    while (requestInterceptorChain.length) {
      var onFulfilled = requestInterceptorChain.shift();
      var onRejected = requestInterceptorChain.shift();
      try {
        newConfig = onFulfilled(newConfig);
      } catch (error2) {
        onRejected(error2);
        break;
      }
    }
    try {
      promise = dispatchRequest(newConfig);
    } catch (error2) {
      return Promise.reject(error2);
    }
    while (responseInterceptorChain.length) {
      promise = promise.then(responseInterceptorChain.shift(), responseInterceptorChain.shift());
    }
    return promise;
  };
  Axios$1.prototype.getUri = function getUri(config2) {
    config2 = mergeConfig$1(this.defaults, config2);
    return buildURL(config2.url, config2.params, config2.paramsSerializer).replace(/^\?/, "");
  };
  utils$2.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
    Axios$1.prototype[method] = function(url, config2) {
      return this.request(mergeConfig$1(config2 || {}, {
        method,
        url,
        data: (config2 || {}).data
      }));
    };
  });
  utils$2.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
    Axios$1.prototype[method] = function(url, data2, config2) {
      return this.request(mergeConfig$1(config2 || {}, {
        method,
        url,
        data: data2
      }));
    };
  });
  var Axios_1 = Axios$1;
  var Cancel = Cancel_1;
  function CancelToken(executor) {
    if (typeof executor !== "function") {
      throw new TypeError("executor must be a function.");
    }
    var resolvePromise;
    this.promise = new Promise(function promiseExecutor(resolve) {
      resolvePromise = resolve;
    });
    var token = this;
    this.promise.then(function(cancel) {
      if (!token._listeners)
        return;
      var i2;
      var l = token._listeners.length;
      for (i2 = 0; i2 < l; i2++) {
        token._listeners[i2](cancel);
      }
      token._listeners = null;
    });
    this.promise.then = function(onfulfilled) {
      var _resolve;
      var promise = new Promise(function(resolve) {
        token.subscribe(resolve);
        _resolve = resolve;
      }).then(onfulfilled);
      promise.cancel = function reject() {
        token.unsubscribe(_resolve);
      };
      return promise;
    };
    executor(function cancel(message) {
      if (token.reason) {
        return;
      }
      token.reason = new Cancel(message);
      resolvePromise(token.reason);
    });
  }
  CancelToken.prototype.throwIfRequested = function throwIfRequested() {
    if (this.reason) {
      throw this.reason;
    }
  };
  CancelToken.prototype.subscribe = function subscribe(listener) {
    if (this.reason) {
      listener(this.reason);
      return;
    }
    if (this._listeners) {
      this._listeners.push(listener);
    } else {
      this._listeners = [listener];
    }
  };
  CancelToken.prototype.unsubscribe = function unsubscribe(listener) {
    if (!this._listeners) {
      return;
    }
    var index2 = this._listeners.indexOf(listener);
    if (index2 !== -1) {
      this._listeners.splice(index2, 1);
    }
  };
  CancelToken.source = function source() {
    var cancel;
    var token = new CancelToken(function executor(c) {
      cancel = c;
    });
    return {
      token,
      cancel
    };
  };
  var CancelToken_1 = CancelToken;
  var spread = function spread2(callback) {
    return function wrap(arr) {
      return callback.apply(null, arr);
    };
  };
  var isAxiosError = function isAxiosError2(payload) {
    return typeof payload === "object" && payload.isAxiosError === true;
  };
  var utils$1 = utils$e;
  var bind = bind$2;
  var Axios = Axios_1;
  var mergeConfig = mergeConfig$2;
  var defaults$3 = defaults_1;
  function createInstance(defaultConfig2) {
    var context = new Axios(defaultConfig2);
    var instance2 = bind(Axios.prototype.request, context);
    utils$1.extend(instance2, Axios.prototype, context);
    utils$1.extend(instance2, context);
    instance2.create = function create(instanceConfig) {
      return createInstance(mergeConfig(defaultConfig2, instanceConfig));
    };
    return instance2;
  }
  var axios$1 = createInstance(defaults$3);
  axios$1.Axios = Axios;
  axios$1.Cancel = Cancel_1;
  axios$1.CancelToken = CancelToken_1;
  axios$1.isCancel = isCancel$1;
  axios$1.VERSION = data$1.version;
  axios$1.all = function all(promises) {
    return Promise.all(promises);
  };
  axios$1.spread = spread;
  axios$1.isAxiosError = isAxiosError;
  axios$2.exports = axios$1;
  axios$2.exports.default = axios$1;
  var require$$0 = axios$2.exports;
  var axios = require$$0;
  var index_vue_vue_type_style_index_0_scoped_true_lang$8 = "";
  var _export_sfc = (sfc, props) => {
    const target = sfc.__vccOpts || sfc;
    for (const [key, val] of props) {
      target[key] = val;
    }
    return target;
  };
  const _sfc_main$4u = {
    name: "SvgIcon",
    props: {
      iconClass: {
        type: String,
        required: true
      },
      className: {
        type: String
      },
      title: {
        type: String,
        default: ""
      }
    },
    computed: {
      iconName() {
        return `#icon-${this.iconClass}`;
      },
      svgClass() {
        if (this.className) {
          return "svg-icon " + this.className;
        } else {
          return "svg-icon";
        }
      }
    }
  };
  const _hoisted_1$10 = ["xlink:href"];
  const _hoisted_2$s = { key: 0 };
  function _sfc_render$4u(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("svg", {
      class: require$$0$1.normalizeClass($options.svgClass),
      "aria-hidden": "true"
    }, [
      require$$0$1.createElementVNode("use", { "xlink:href": $options.iconName }, null, 8, _hoisted_1$10),
      !!$props.title ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("title", _hoisted_2$s, require$$0$1.toDisplayString($props.title), 1)) : require$$0$1.createCommentVNode("", true)
    ], 2);
  }
  var SvgIcon = /* @__PURE__ */ _export_sfc(_sfc_main$4u, [["render", _sfc_render$4u], ["__scopeId", "data-v-2a03d21b"]]);
  const containers = [
    {
      type: "grid",
      alias: "column-1-grid",
      category: "container",
      icon: "column-1-grid",
      commonFlag: true,
      cols: [],
      options: {
        name: "",
        hidden: false,
        gutter: 12,
        colHeight: null,
        customClass: ""
      }
    },
    {
      type: "grid",
      alias: "column-2-grid",
      category: "container",
      icon: "column-2-grid",
      commonFlag: true,
      cols: [],
      options: {
        name: "",
        hidden: false,
        gutter: 12,
        colHeight: null,
        customClass: ""
      }
    },
    {
      type: "grid",
      alias: "column-3-grid",
      category: "container",
      icon: "column-3-grid",
      commonFlag: true,
      cols: [],
      options: {
        name: "",
        hidden: false,
        gutter: 12,
        colHeight: null,
        customClass: ""
      }
    },
    {
      type: "grid",
      alias: "column-4-grid",
      category: "container",
      icon: "column-4-grid",
      commonFlag: true,
      cols: [],
      options: {
        name: "",
        hidden: false,
        gutter: 12,
        colHeight: null,
        customClass: ""
      }
    },
    {
      type: "table",
      category: "container",
      icon: "table",
      rows: [],
      options: {
        name: "",
        hidden: false,
        customClass: ""
      }
    },
    {
      type: "tab",
      category: "container",
      icon: "tab",
      commonFlag: true,
      tabs: [],
      options: {
        name: "",
        tabType: "border-card",
        tabPosition: "top",
        hidden: false,
        customClass: "",
        onTabClick: ""
      }
    },
    {
      type: "sub-form",
      category: "container",
      icon: "sub-form",
      commonFlag: true,
      widgetList: [],
      options: {
        name: "",
        showBlankRow: true,
        showRowNumber: true,
        labelAlign: "label-center-align",
        hidden: false,
        disabled: false,
        actionColumnPosition: "left",
        customClass: "",
        onSubFormRowAdd: "",
        onSubFormRowInsert: "",
        onSubFormRowDelete: "",
        onSubFormRowChange: ""
      }
    },
    {
      type: "grid-sub-form",
      category: "container",
      icon: "grid-sub-form",
      commonFlag: true,
      widgetList: [],
      options: {
        name: "",
        showBlankRow: true,
        showRowNumber: true,
        hidden: false,
        disabled: false,
        actionColumnPosition: "left",
        customClass: "",
        onSubFormRowAdd: "",
        onSubFormRowInsert: "",
        onSubFormRowDelete: "",
        onSubFormRowChange: ""
      }
    },
    {
      type: "grid-col",
      category: "container",
      icon: "grid-col",
      internal: true,
      widgetList: [],
      options: {
        name: "",
        hidden: false,
        span: 12,
        offset: 0,
        push: 0,
        pull: 0,
        responsive: false,
        md: 12,
        sm: 12,
        xs: 12,
        customClass: ""
      }
    },
    {
      type: "table-cell",
      category: "container",
      icon: "table-cell",
      internal: true,
      widgetList: [],
      merged: false,
      options: {
        name: "",
        cellWidth: "",
        cellHeight: "",
        colspan: 1,
        rowspan: 1,
        wordBreak: false,
        customClass: ""
      }
    },
    {
      type: "tab-pane",
      category: "container",
      icon: "tab-pane",
      internal: true,
      widgetList: [],
      options: {
        name: "",
        label: "",
        hidden: false,
        active: false,
        disabled: false,
        customClass: ""
      }
    },
    {
      type: "data-table",
      category: "container",
      icon: "data-table",
      widgetList: [],
      options: {
        name: "",
        label: "data-table",
        hidden: false,
        rowSpacing: 8,
        tableHeight: "300px",
        tableWidth: "100%",
        customClass: "",
        stripe: true,
        showIndex: false,
        showCheckBox: true,
        showPagination: true,
        paginationAlign: "left",
        smallPagination: false,
        showSummary: false,
        border: true,
        tableSize: "default",
        autoColumnWidthDisabled: false,
        tableColumns: [
          { columnId: 1, prop: "name", label: "\u59D3\u540D", width: "100", show: true, align: "left", fixed: "left", sortable: true },
          { columnId: 2, prop: "date", label: "\u65E5\u671F1", width: "160", show: true, align: "left", formatS: "d1" },
          { columnId: 3, prop: "date2", label: "\u65E5\u671F2", width: "160", show: true, align: "left", formatS: "d4" },
          { columnId: 4, prop: "date3", label: "\u65E5\u671F3", width: "160", show: true, align: "left", formatS: "d5" },
          { columnId: 5, prop: "f1", label: "\u57FA\u91D1", width: "150", show: true, align: "right", sortable: true, formatS: "n1" },
          { columnId: 6, prop: "f2", label: "\u80A1\u7968", width: "150", show: true, align: "right", sortable: true, formatS: "n2" },
          { columnId: 7, prop: "f3", label: "\u5B58\u6B3E", width: "150", show: true, align: "right", sortable: true, formatS: "n3" },
          { columnId: 8, prop: "f4", label: "\u57FA\u91D12", width: "150", show: true, align: "right", sortable: true, formatS: "n4" },
          { columnId: 9, prop: "f5", label: "\u80A1\u79682", width: "150", show: true, align: "right", sortable: true, formatS: "n5" },
          { columnId: 10, prop: "f6", label: "\u5B58\u6B3E2", width: "150", show: true, align: "right", sortable: true, formatS: "n6" },
          { columnId: 11, prop: "f7", label: "\u6210\u529F\u7387", width: "140", show: true, align: "right", sortable: true, formatS: "n7" },
          { columnId: 12, prop: "add", label: "\u5730\u5740", width: "250", show: true, render: "" },
          { columnId: 13, prop: "ss", label: "\u79D8\u5BC6", width: "100", show: false },
          { columnId: 14, prop: "~", headerFlag: true, label: "\u8868\u59341", align: "center", children: [
            {
              columnId: 15,
              prop: "~",
              headerFlag: true,
              label: "\u8868\u59342",
              align: "center",
              children: [
                {
                  columnId: 16,
                  prop: "~",
                  headerFlag: true,
                  label: "\u8868\u59343",
                  align: "center",
                  children: []
                }
              ]
            }
          ] }
        ],
        showButtonsColumn: false,
        buttonsColumnFixed: "right",
        buttonsColumnTitle: "\u64CD\u4F5C",
        buttonsColumnWidth: 120,
        operationButtons: [
          {
            name: "detail",
            label: "\u8BE6\u60C5",
            type: "text",
            size: "small",
            round: false,
            hidden: true,
            disabled: false
          },
          {
            name: "edit",
            label: "\u7F16\u8F91",
            type: "text",
            size: "small",
            round: false,
            hidden: false,
            disabled: false
          },
          {
            name: "delete",
            label: "\u5220\u9664",
            type: "text",
            size: "small",
            round: false,
            hidden: false,
            disabled: false
          }
        ],
        pagination: {
          currentPage: 1,
          pageSizes: [10, 15, 20, 30, 50, 100, 200],
          pageSize: 20,
          total: 366
        },
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        treeDataEnabled: false,
        rowKey: "id",
        childrenKey: "children",
        tableData: [
          {
            date: "2016-05-02",
            date2: "2016-05-02 23:12:12",
            date3: "2016-05-02 9:11:12",
            name: "\u5C0F\u4E8C",
            f1: 100010002e-1,
            f2: 10001000239567e-6,
            f3: 10001000239567e-6,
            f4: 10001000239567e-6,
            f5: 10001000239567e-6,
            f6: 10001000239567e-6,
            f7: 0.25,
            add: "\u4E0A\u6D77\u5E02\u666E\u9640\u533A\u91D1\u6C99\u6C5F\u8DEF 1518 \u5F04",
            ss: 100
          },
          {
            date: "2016-05-04",
            date2: "2016-05-02 11:12:12",
            date3: "2016-05-02 9:11:12",
            name: "\u738B\u5C0F\u864E2",
            f1: 1000100023e-2,
            f2: 1000100023e-2,
            f3: 10001000239567e-6,
            f4: 10001000239567e-6,
            f5: 10001000239567e-6,
            f6: 10001000239567e-6,
            f7: 0.256,
            add: "\u4E0A\u6D77\u5E02\u666E\u9640\u533A\u91D1\u6C99\u6C5F\u8DEF 1518 \u5F04",
            ss: 100
          },
          {
            date: "2016-05-01",
            date2: "2016-05-02 12:12:12",
            date3: "2016-05-02 9:11:12",
            name: "\u738B\u5C0F\u864E3",
            f1: 10001000239e-3,
            f2: 10001000239e-3,
            f3: 10001000239567e-6,
            f4: 10001000239567e-6,
            f5: 10001000239567e-6,
            f6: 10001000239567e-6,
            f7: 0.2569,
            add: "\u4E0A\u6D77\u5E02\u666E\u9640\u533A\u91D1\u6C99\u6C5F\u8DEF 1518 \u5F04",
            ss: 100
          },
          {
            date: "2016-05-03",
            date2: "2016-05-02 12:12:12",
            date3: "2016-05-02 9:11:12",
            name: "\u738B\u5C0F\u864E4",
            f1: 10001000239567e-6,
            f2: 10001000239567e-6,
            f3: 10001000239567e-6,
            f4: 10001000239567e-6,
            f5: 10001000239567e-6,
            f6: 10001000239567e-6,
            f7: 1.9527102,
            add: "\u4E0A\u6D77\u5E02\u666E\u9640\u533A\u91D1\u6C99\u6C5F\u8DEF 1518 \u5F04",
            ss: 100
          }
        ],
        onCreated: "",
        onMounted: "",
        onPageSizeChange: "",
        onCurrentPageChange: "",
        onSortChange: "",
        onSelectionChange: "",
        onHideOperationButton: "",
        onDisableOperationButton: "",
        onGetOperationButtonLabel: "",
        onOperationButtonClick: "",
        onHeaderClick: "",
        onRowClick: "",
        onRowDoubleClick: "",
        onCellClick: "",
        onCellDoubleClick: "",
        onGetRowClassName: "",
        onGetSpanMethod: ""
      }
    },
    {
      type: "tree",
      icon: "tree",
      category: "container",
      widgetList: [],
      options: {
        name: "tree",
        label: "",
        filter: true,
        draggable: false,
        defaultExpandAllNode: true,
        selectClearAllNode: true,
        expandRetractAllNode: true,
        showCheckBox: true,
        expandOnClickNode: true,
        lazy: false,
        treeDataEdit: true,
        checkStrictly: false,
        nodeEdit: true,
        size: "default",
        disabled: false,
        hidden: false,
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        customClass: "",
        onCreated: "",
        onMounted: "",
        onNodeClick: "",
        onNodeCheck: "",
        onNodeContextmenu: "",
        onCheckChange: "",
        treeData: [
          {
            label: "\u4E00\u7EA7 1",
            children: [{
              label: "\u4E8C\u7EA7 1-1",
              children: [{
                label: "\u4E09\u7EA7 1-1-1"
              }]
            }]
          },
          {
            label: "\u4E00\u7EA7 2",
            children: [{
              label: "\u4E8C\u7EA7 2-1",
              children: [{
                label: "\u4E09\u7EA7 2-1-1"
              }]
            }, {
              label: "\u4E8C\u7EA7 2-2",
              children: [{
                label: "\u4E09\u7EA7 2-2-1"
              }]
            }]
          },
          {
            label: "\u4E00\u7EA7 3",
            children: [{
              label: "\u4E8C\u7EA7 3-1",
              children: [{
                label: "\u4E09\u7EA7 3-1-1"
              }]
            }, {
              label: "\u4E8C\u7EA7 3-2",
              children: [{
                label: "\u4E09\u7EA7 3-2-1"
              }]
            }]
          }
        ]
      }
    },
    {
      type: "button-group",
      icon: "button-group",
      category: "container",
      widgetList: [],
      options: {
        name: "",
        size: "default",
        hidden: false,
        disabled: false,
        customClass: "",
        buttons: [
          {
            name: "detail",
            label: "\u8BE6\u60C5",
            icon: "",
            type: "",
            round: false,
            hidden: true,
            disabled: false
          },
          {
            name: "edit",
            label: "\u7F16\u8F91",
            icon: "",
            type: "",
            round: false,
            hidden: false,
            disabled: false
          },
          {
            name: "delete",
            label: "\u5220\u9664",
            icon: "",
            type: "",
            round: false,
            hidden: false,
            disabled: false
          }
        ],
        onCreated: "",
        onMounted: "",
        onButtonGroupClick: ""
      }
    },
    {
      type: "object-group",
      category: "container",
      icon: "object-group",
      widgetList: [],
      options: {
        name: "",
        objectName: "testObj",
        hidden: false,
        customClass: "",
        onCreated: "",
        onMounted: ""
      }
    },
    {
      type: "vf-dialog",
      category: "container",
      icon: "vf-dialog",
      widgetList: [],
      options: {
        name: "",
        title: "",
        width: "50%",
        fullscreen: false,
        showModal: true,
        showClose: true,
        closeOnClickModal: false,
        closeOnPressEscape: false,
        center: false,
        readMode: false,
        disabledMode: false,
        okButtonLabel: "",
        okButtonHidden: false,
        cancelButtonLabel: "",
        cancelButtonHidden: false,
        onOkButtonClick: "",
        onCancelButtonClick: "",
        onDialogOpened: "",
        onDialogBeforeClose: ""
      }
    },
    {
      type: "vf-drawer",
      category: "container",
      icon: "vf-drawer",
      widgetList: [],
      options: {
        name: "",
        title: "",
        size: "50%",
        showModal: true,
        showClose: true,
        closeOnClickModal: false,
        closeOnPressEscape: false,
        direction: "rtl",
        readMode: false,
        disabledMode: false,
        okButtonLabel: "",
        okButtonHidden: false,
        cancelButtonLabel: "",
        cancelButtonHidden: false,
        onOkButtonClick: "",
        onCancelButtonClick: "",
        onDrawerOpened: "",
        onDrawerBeforeClose: ""
      }
    }
  ];
  const basicFields = [
    {
      type: "input",
      alias: "",
      icon: "text-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        type: "text",
        defaultValue: "",
        placeholder: "",
        columnWidth: "200px",
        size: "",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        clearable: true,
        showPassword: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        minLength: null,
        maxLength: null,
        showWordLimit: false,
        prefixIcon: "",
        suffixIcon: "",
        appendButton: false,
        appendButtonDisabled: false,
        buttonIcon: "custom-search",
        onCreated: "",
        onMounted: "",
        onInput: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: "",
        onAppendButtonClick: ""
      }
    },
    {
      type: "textarea",
      icon: "textarea-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        rows: 3,
        autosize: false,
        defaultValue: "",
        placeholder: "",
        columnWidth: "200px",
        size: "",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        minLength: null,
        maxLength: null,
        showWordLimit: false,
        onCreated: "",
        onMounted: "",
        onInput: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "number",
      icon: "number-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: 0,
        placeholder: "",
        columnWidth: "200px",
        size: "",
        controls: true,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        formulaEnabled: false,
        formula: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        min: -1e11,
        max: 1e11,
        precision: 0,
        step: 1,
        controlsPosition: "right",
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "radio",
      icon: "radio-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        columnWidth: "200px",
        size: "",
        displayStyle: "inline",
        buttonStyle: false,
        border: false,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        labelKey: "label",
        valueKey: "value",
        optionValueType: "",
        eboDictCode: "",
        eboDisabledKey: "",
        optionItems: [
          { label: "radio 1", value: 1 },
          { label: "radio 2", value: 2 },
          { label: "radio 3", value: 3 }
        ],
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "checkbox",
      icon: "checkbox-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: [],
        columnWidth: "200px",
        size: "",
        displayStyle: "inline",
        buttonStyle: false,
        border: false,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        labelKey: "label",
        valueKey: "value",
        optionValueType: "",
        eboDictCode: "",
        eboDisabledKey: "",
        optionItems: [
          { label: "check 1", value: 1 },
          { label: "check 2", value: 2 },
          { label: "check 3", value: 3 }
        ],
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "select",
      icon: "select-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: "",
        placeholder: "",
        columnWidth: "200px",
        size: "",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        clearable: true,
        filterable: false,
        allowCreate: false,
        remote: false,
        automaticDropdown: false,
        multiple: false,
        multipleLimit: 0,
        collapseTags: false,
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        labelKey: "label",
        valueKey: "value",
        optionValueType: "",
        eboDictCode: "",
        eboDisabledKey: "",
        optionItems: [
          { label: "select 1", value: 1 },
          { label: "select 2", value: 2 },
          { label: "select 3", value: 3 }
        ],
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onRemoteQuery: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "time",
      icon: "time-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        placeholder: "",
        columnWidth: "200px",
        size: "",
        autoFullWidth: true,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        clearable: true,
        editable: false,
        format: "HH:mm:ss",
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "time-range",
      icon: "time-range-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        startPlaceholder: "",
        endPlaceholder: "",
        columnWidth: "200px",
        size: "",
        autoFullWidth: true,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        clearable: true,
        editable: false,
        format: "HH:mm:ss",
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "date",
      icon: "date-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        type: "date",
        defaultValue: null,
        placeholder: "",
        columnWidth: "200px",
        size: "",
        autoFullWidth: true,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        clearable: true,
        editable: false,
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "date-range",
      icon: "date-range-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        type: "daterange",
        defaultValue: null,
        startPlaceholder: "",
        endPlaceholder: "",
        columnWidth: "200px",
        size: "",
        autoFullWidth: true,
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        readonly: false,
        disabled: false,
        hidden: false,
        clearable: true,
        editable: false,
        format: "YYYY-MM-DD",
        valueFormat: "YYYY-MM-DD",
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "switch",
      icon: "switch-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        columnWidth: "200px",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        switchWidth: 40,
        activeText: "",
        inactiveText: "",
        activeColor: null,
        inactiveColor: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "rate",
      icon: "rate-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        columnWidth: "200px",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        max: 5,
        lowThreshold: 2,
        highThreshold: 4,
        allowHalf: false,
        showText: false,
        showScore: false,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "color",
      icon: "color-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: null,
        columnWidth: "200px",
        size: "",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "slider",
      icon: "slider-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        columnWidth: "200px",
        showStops: true,
        size: "",
        labelWidth: null,
        labelHidden: false,
        labelWrap: false,
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        validation: "",
        validationHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        min: 0,
        max: 100,
        step: 10,
        range: false,
        height: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onValidate: ""
      }
    },
    {
      type: "static-text",
      icon: "static-text",
      formItemFlag: false,
      options: {
        name: "",
        columnWidth: "200px",
        hidden: false,
        textContent: "static text",
        textAlign: "left",
        fontSize: "13px",
        preWrap: false,
        customClass: "",
        onCreated: "",
        onMounted: ""
      }
    },
    {
      type: "html-text",
      icon: "html-text",
      formItemFlag: false,
      options: {
        name: "",
        columnWidth: "200px",
        hidden: false,
        htmlContent: "<b>html text</b>",
        customClass: "",
        onCreated: "",
        onMounted: ""
      }
    },
    {
      type: "button",
      icon: "button",
      formItemFlag: false,
      options: {
        name: "",
        label: "",
        columnWidth: "200px",
        size: "",
        displayStyle: "block",
        disabled: false,
        hidden: false,
        type: "",
        plain: false,
        round: false,
        circle: false,
        icon: null,
        customClass: "",
        onCreated: "",
        onMounted: "",
        onClick: ""
      }
    },
    {
      type: "divider",
      icon: "divider",
      formItemFlag: false,
      options: {
        name: "",
        label: "",
        columnWidth: "200px",
        direction: "horizontal",
        contentPosition: "center",
        hidden: false,
        customClass: "",
        onCreated: "",
        onMounted: ""
      }
    }
  ];
  const advancedFields = [
    {
      type: "picture-upload",
      icon: "picture-upload-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        labelWidth: null,
        labelHidden: false,
        columnWidth: "200px",
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        customRule: "",
        customRuleHint: "",
        uploadURL: "",
        uploadTip: "",
        withCredentials: false,
        multipleSelect: false,
        showFileList: true,
        limit: 3,
        fileMaxSize: 5,
        fileTypes: ["jpg", "jpeg", "png"],
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onBeforeUpload: "",
        onUploadSuccess: "",
        onUploadError: "",
        onFileRemove: "",
        onValidate: ""
      }
    },
    {
      type: "file-upload",
      icon: "file-upload-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        labelWidth: null,
        labelHidden: false,
        columnWidth: "200px",
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        customRule: "",
        customRuleHint: "",
        uploadURL: "",
        uploadTip: "",
        withCredentials: false,
        multipleSelect: false,
        showFileList: true,
        limit: 3,
        fileMaxSize: 5,
        fileTypes: ["doc", "docx", "xls", "xlsx"],
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onBeforeUpload: "",
        onUploadSuccess: "",
        onUploadError: "",
        onFileRemove: "",
        onValidate: ""
      }
    },
    {
      type: "rich-editor",
      icon: "rich-editor-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        placeholder: "",
        labelWidth: null,
        labelHidden: false,
        columnWidth: "200px",
        contentHeight: "200px",
        disabled: false,
        hidden: false,
        required: false,
        requiredHint: "",
        customRule: "",
        customRuleHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        minLength: null,
        maxLength: null,
        onCreated: "",
        onMounted: "",
        onValidate: ""
      }
    },
    {
      type: "cascader",
      icon: "cascader-field",
      formItemFlag: true,
      options: {
        name: "",
        keyNameEnabled: false,
        keyName: "",
        label: "",
        labelAlign: "",
        defaultValue: "",
        placeholder: "",
        size: "",
        labelWidth: null,
        labelHidden: false,
        columnWidth: "200px",
        disabled: false,
        hidden: false,
        clearable: true,
        filterable: false,
        multiple: false,
        checkStrictly: false,
        showAllLevels: true,
        dsEnabled: false,
        dsName: "",
        dataSetName: "",
        labelKey: "label",
        valueKey: "value",
        childrenKey: "children",
        optionItems: [
          { label: "select 1", value: 1, children: [{ label: "child 1", value: 11 }] },
          { label: "select 2", value: 2 },
          { label: "select 3", value: 3 }
        ],
        required: false,
        requiredHint: "",
        customRule: "",
        customRuleHint: "",
        customClass: "",
        labelIconClass: null,
        labelIconPosition: "rear",
        labelTooltip: null,
        onCreated: "",
        onMounted: "",
        onChange: "",
        onFocus: "",
        onBlur: "",
        onValidate: ""
      }
    },
    {
      type: "slot",
      icon: "slot-field",
      formItemFlag: false,
      options: {
        name: "",
        label: "",
        customClass: ""
      }
    }
  ];
  const customFields = [];
  const chartContainers = [];
  const chartWidgets = [];
  function addContainerWidgetSchema(containerSchema) {
    containers.push(containerSchema);
  }
  function addBasicFieldSchema(fieldSchema) {
    basicFields.push(fieldSchema);
  }
  function addAdvancedFieldSchema(fieldSchema) {
    advancedFields.push(fieldSchema);
  }
  function addCustomWidgetSchema(widgetSchema) {
    customFields.push(widgetSchema);
  }
  function addChartContainerSchema(chartContainerSchema) {
    chartContainers.push(chartContainerSchema);
  }
  function addChartSchema(chartSchema) {
    chartWidgets.push(chartSchema);
  }
  const formTemplates = [
    {
      title: "\u5355\u5217\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t1.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json1.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u591A\u5217\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t2.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json2.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u5206\u7EC4\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t3.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json3.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u6807\u7B7E\u9875\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t4.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json4.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u4E3B\u4ECE\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t5.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json5.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u54CD\u5E94\u5F0F\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t6.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json6.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u95EE\u5377\u8C03\u67E5\u8868",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t7.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json7.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    },
    {
      title: "\u56FA\u5B9A\u8868\u683C\u8868\u5355",
      imgUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/t8.png",
      jsonUrl: "https://ks3-cn-beijing.ksyuncs.com/vform-static/form-samples/json8.txt",
      description: "\u8868\u5355\u6A21\u677F\u8BE6\u7EC6\u8BF4\u660E..."
    }
  ];
  function clearFormTemplates() {
    formTemplates.splice(0, formTemplates.length);
  }
  function addFormTemplate(newFormTemplate) {
    formTemplates.push(newFormTemplate);
  }
  function getAllFormTemplates() {
    return formTemplates;
  }
  var clipboard = { exports: {} };
  /*!
   * clipboard.js v2.0.11
   * https://clipboardjs.com/
   *
   * Licensed MIT © Zeno Rocha
   */
  (function(module2, exports2) {
    (function webpackUniversalModuleDefinition(root, factory) {
      module2.exports = factory();
    })(commonjsGlobal, function() {
      return function() {
        var __webpack_modules__ = {
          686: function(__unused_webpack_module, __webpack_exports__, __webpack_require__2) {
            __webpack_require__2.d(__webpack_exports__, {
              "default": function() {
                return clipboard2;
              }
            });
            var tiny_emitter = __webpack_require__2(279);
            var tiny_emitter_default = /* @__PURE__ */ __webpack_require__2.n(tiny_emitter);
            var listen = __webpack_require__2(370);
            var listen_default = /* @__PURE__ */ __webpack_require__2.n(listen);
            var src_select = __webpack_require__2(817);
            var select_default = /* @__PURE__ */ __webpack_require__2.n(src_select);
            function command2(type) {
              try {
                return document.execCommand(type);
              } catch (err) {
                return false;
              }
            }
            var ClipboardActionCut = function ClipboardActionCut2(target) {
              var selectedText = select_default()(target);
              command2("cut");
              return selectedText;
            };
            var actions_cut = ClipboardActionCut;
            function createFakeElement(value2) {
              var isRTL = document.documentElement.getAttribute("dir") === "rtl";
              var fakeElement = document.createElement("textarea");
              fakeElement.style.fontSize = "12pt";
              fakeElement.style.border = "0";
              fakeElement.style.padding = "0";
              fakeElement.style.margin = "0";
              fakeElement.style.position = "absolute";
              fakeElement.style[isRTL ? "right" : "left"] = "-9999px";
              var yPosition = window.pageYOffset || document.documentElement.scrollTop;
              fakeElement.style.top = "".concat(yPosition, "px");
              fakeElement.setAttribute("readonly", "");
              fakeElement.value = value2;
              return fakeElement;
            }
            var fakeCopyAction = function fakeCopyAction2(value2, options) {
              var fakeElement = createFakeElement(value2);
              options.container.appendChild(fakeElement);
              var selectedText = select_default()(fakeElement);
              command2("copy");
              fakeElement.remove();
              return selectedText;
            };
            var ClipboardActionCopy = function ClipboardActionCopy2(target) {
              var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
                container: document.body
              };
              var selectedText = "";
              if (typeof target === "string") {
                selectedText = fakeCopyAction(target, options);
              } else if (target instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(target === null || target === void 0 ? void 0 : target.type)) {
                selectedText = fakeCopyAction(target.value, options);
              } else {
                selectedText = select_default()(target);
                command2("copy");
              }
              return selectedText;
            };
            var actions_copy = ClipboardActionCopy;
            function _typeof2(obj) {
              "@babel/helpers - typeof";
              if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                _typeof2 = function _typeof3(obj2) {
                  return typeof obj2;
                };
              } else {
                _typeof2 = function _typeof3(obj2) {
                  return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
                };
              }
              return _typeof2(obj);
            }
            var ClipboardActionDefault = function ClipboardActionDefault2() {
              var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
              var _options$action = options.action, action = _options$action === void 0 ? "copy" : _options$action, container = options.container, target = options.target, text = options.text;
              if (action !== "copy" && action !== "cut") {
                throw new Error('Invalid "action" value, use either "copy" or "cut"');
              }
              if (target !== void 0) {
                if (target && _typeof2(target) === "object" && target.nodeType === 1) {
                  if (action === "copy" && target.hasAttribute("disabled")) {
                    throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
                  }
                  if (action === "cut" && (target.hasAttribute("readonly") || target.hasAttribute("disabled"))) {
                    throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
                  }
                } else {
                  throw new Error('Invalid "target" value, use a valid Element');
                }
              }
              if (text) {
                return actions_copy(text, {
                  container
                });
              }
              if (target) {
                return action === "cut" ? actions_cut(target) : actions_copy(target, {
                  container
                });
              }
            };
            var actions_default = ClipboardActionDefault;
            function clipboard_typeof(obj) {
              "@babel/helpers - typeof";
              if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
                clipboard_typeof = function _typeof3(obj2) {
                  return typeof obj2;
                };
              } else {
                clipboard_typeof = function _typeof3(obj2) {
                  return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
                };
              }
              return clipboard_typeof(obj);
            }
            function _classCallCheck(instance2, Constructor) {
              if (!(instance2 instanceof Constructor)) {
                throw new TypeError("Cannot call a class as a function");
              }
            }
            function _defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            function _createClass(Constructor, protoProps, staticProps) {
              if (protoProps)
                _defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                _defineProperties(Constructor, staticProps);
              return Constructor;
            }
            function _inherits(subClass, superClass) {
              if (typeof superClass !== "function" && superClass !== null) {
                throw new TypeError("Super expression must either be null or a function");
              }
              subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
              if (superClass)
                _setPrototypeOf(subClass, superClass);
            }
            function _setPrototypeOf(o, p) {
              _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
                o2.__proto__ = p2;
                return o2;
              };
              return _setPrototypeOf(o, p);
            }
            function _createSuper(Derived) {
              var hasNativeReflectConstruct = _isNativeReflectConstruct();
              return function _createSuperInternal() {
                var Super = _getPrototypeOf(Derived), result;
                if (hasNativeReflectConstruct) {
                  var NewTarget = _getPrototypeOf(this).constructor;
                  result = Reflect.construct(Super, arguments, NewTarget);
                } else {
                  result = Super.apply(this, arguments);
                }
                return _possibleConstructorReturn(this, result);
              };
            }
            function _possibleConstructorReturn(self2, call) {
              if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) {
                return call;
              }
              return _assertThisInitialized(self2);
            }
            function _assertThisInitialized(self2) {
              if (self2 === void 0) {
                throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
              }
              return self2;
            }
            function _isNativeReflectConstruct() {
              if (typeof Reflect === "undefined" || !Reflect.construct)
                return false;
              if (Reflect.construct.sham)
                return false;
              if (typeof Proxy === "function")
                return true;
              try {
                Date.prototype.toString.call(Reflect.construct(Date, [], function() {
                }));
                return true;
              } catch (e) {
                return false;
              }
            }
            function _getPrototypeOf(o) {
              _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
                return o2.__proto__ || Object.getPrototypeOf(o2);
              };
              return _getPrototypeOf(o);
            }
            function getAttributeValue(suffix, element) {
              var attribute = "data-clipboard-".concat(suffix);
              if (!element.hasAttribute(attribute)) {
                return;
              }
              return element.getAttribute(attribute);
            }
            var Clipboard2 = /* @__PURE__ */ function(_Emitter) {
              _inherits(Clipboard3, _Emitter);
              var _super = _createSuper(Clipboard3);
              function Clipboard3(trigger, options) {
                var _this;
                _classCallCheck(this, Clipboard3);
                _this = _super.call(this);
                _this.resolveOptions(options);
                _this.listenClick(trigger);
                return _this;
              }
              _createClass(Clipboard3, [{
                key: "resolveOptions",
                value: function resolveOptions() {
                  var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
                  this.action = typeof options.action === "function" ? options.action : this.defaultAction;
                  this.target = typeof options.target === "function" ? options.target : this.defaultTarget;
                  this.text = typeof options.text === "function" ? options.text : this.defaultText;
                  this.container = clipboard_typeof(options.container) === "object" ? options.container : document.body;
                }
              }, {
                key: "listenClick",
                value: function listenClick(trigger) {
                  var _this2 = this;
                  this.listener = listen_default()(trigger, "click", function(e) {
                    return _this2.onClick(e);
                  });
                }
              }, {
                key: "onClick",
                value: function onClick(e) {
                  var trigger = e.delegateTarget || e.currentTarget;
                  var action = this.action(trigger) || "copy";
                  var text = actions_default({
                    action,
                    container: this.container,
                    target: this.target(trigger),
                    text: this.text(trigger)
                  });
                  this.emit(text ? "success" : "error", {
                    action,
                    text,
                    trigger,
                    clearSelection: function clearSelection() {
                      if (trigger) {
                        trigger.focus();
                      }
                      window.getSelection().removeAllRanges();
                    }
                  });
                }
              }, {
                key: "defaultAction",
                value: function defaultAction(trigger) {
                  return getAttributeValue("action", trigger);
                }
              }, {
                key: "defaultTarget",
                value: function defaultTarget(trigger) {
                  var selector = getAttributeValue("target", trigger);
                  if (selector) {
                    return document.querySelector(selector);
                  }
                }
              }, {
                key: "defaultText",
                value: function defaultText(trigger) {
                  return getAttributeValue("text", trigger);
                }
              }, {
                key: "destroy",
                value: function destroy() {
                  this.listener.destroy();
                }
              }], [{
                key: "copy",
                value: function copy(target) {
                  var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
                    container: document.body
                  };
                  return actions_copy(target, options);
                }
              }, {
                key: "cut",
                value: function cut(target) {
                  return actions_cut(target);
                }
              }, {
                key: "isSupported",
                value: function isSupported() {
                  var action = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"];
                  var actions = typeof action === "string" ? [action] : action;
                  var support = !!document.queryCommandSupported;
                  actions.forEach(function(action2) {
                    support = support && !!document.queryCommandSupported(action2);
                  });
                  return support;
                }
              }]);
              return Clipboard3;
            }(tiny_emitter_default());
            var clipboard2 = Clipboard2;
          },
          828: function(module3) {
            var DOCUMENT_NODE_TYPE = 9;
            if (typeof Element !== "undefined" && !Element.prototype.matches) {
              var proto = Element.prototype;
              proto.matches = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || proto.oMatchesSelector || proto.webkitMatchesSelector;
            }
            function closest2(element, selector) {
              while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
                if (typeof element.matches === "function" && element.matches(selector)) {
                  return element;
                }
                element = element.parentNode;
              }
            }
            module3.exports = closest2;
          },
          438: function(module3, __unused_webpack_exports, __webpack_require__2) {
            var closest2 = __webpack_require__2(828);
            function _delegate(element, selector, type, callback, useCapture) {
              var listenerFn = listener.apply(this, arguments);
              element.addEventListener(type, listenerFn, useCapture);
              return {
                destroy: function() {
                  element.removeEventListener(type, listenerFn, useCapture);
                }
              };
            }
            function delegate(elements, selector, type, callback, useCapture) {
              if (typeof elements.addEventListener === "function") {
                return _delegate.apply(null, arguments);
              }
              if (typeof type === "function") {
                return _delegate.bind(null, document).apply(null, arguments);
              }
              if (typeof elements === "string") {
                elements = document.querySelectorAll(elements);
              }
              return Array.prototype.map.call(elements, function(element) {
                return _delegate(element, selector, type, callback, useCapture);
              });
            }
            function listener(element, selector, type, callback) {
              return function(e) {
                e.delegateTarget = closest2(e.target, selector);
                if (e.delegateTarget) {
                  callback.call(element, e);
                }
              };
            }
            module3.exports = delegate;
          },
          879: function(__unused_webpack_module, exports3) {
            exports3.node = function(value2) {
              return value2 !== void 0 && value2 instanceof HTMLElement && value2.nodeType === 1;
            };
            exports3.nodeList = function(value2) {
              var type = Object.prototype.toString.call(value2);
              return value2 !== void 0 && (type === "[object NodeList]" || type === "[object HTMLCollection]") && "length" in value2 && (value2.length === 0 || exports3.node(value2[0]));
            };
            exports3.string = function(value2) {
              return typeof value2 === "string" || value2 instanceof String;
            };
            exports3.fn = function(value2) {
              var type = Object.prototype.toString.call(value2);
              return type === "[object Function]";
            };
          },
          370: function(module3, __unused_webpack_exports, __webpack_require__2) {
            var is = __webpack_require__2(879);
            var delegate = __webpack_require__2(438);
            function listen(target, type, callback) {
              if (!target && !type && !callback) {
                throw new Error("Missing required arguments");
              }
              if (!is.string(type)) {
                throw new TypeError("Second argument must be a String");
              }
              if (!is.fn(callback)) {
                throw new TypeError("Third argument must be a Function");
              }
              if (is.node(target)) {
                return listenNode(target, type, callback);
              } else if (is.nodeList(target)) {
                return listenNodeList(target, type, callback);
              } else if (is.string(target)) {
                return listenSelector(target, type, callback);
              } else {
                throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");
              }
            }
            function listenNode(node, type, callback) {
              node.addEventListener(type, callback);
              return {
                destroy: function() {
                  node.removeEventListener(type, callback);
                }
              };
            }
            function listenNodeList(nodeList, type, callback) {
              Array.prototype.forEach.call(nodeList, function(node) {
                node.addEventListener(type, callback);
              });
              return {
                destroy: function() {
                  Array.prototype.forEach.call(nodeList, function(node) {
                    node.removeEventListener(type, callback);
                  });
                }
              };
            }
            function listenSelector(selector, type, callback) {
              return delegate(document.body, selector, type, callback);
            }
            module3.exports = listen;
          },
          817: function(module3) {
            function select(element) {
              var selectedText;
              if (element.nodeName === "SELECT") {
                element.focus();
                selectedText = element.value;
              } else if (element.nodeName === "INPUT" || element.nodeName === "TEXTAREA") {
                var isReadOnly = element.hasAttribute("readonly");
                if (!isReadOnly) {
                  element.setAttribute("readonly", "");
                }
                element.select();
                element.setSelectionRange(0, element.value.length);
                if (!isReadOnly) {
                  element.removeAttribute("readonly");
                }
                selectedText = element.value;
              } else {
                if (element.hasAttribute("contenteditable")) {
                  element.focus();
                }
                var selection = window.getSelection();
                var range = document.createRange();
                range.selectNodeContents(element);
                selection.removeAllRanges();
                selection.addRange(range);
                selectedText = selection.toString();
              }
              return selectedText;
            }
            module3.exports = select;
          },
          279: function(module3) {
            function E() {
            }
            E.prototype = {
              on: function(name2, callback, ctx) {
                var e = this.e || (this.e = {});
                (e[name2] || (e[name2] = [])).push({
                  fn: callback,
                  ctx
                });
                return this;
              },
              once: function(name2, callback, ctx) {
                var self2 = this;
                function listener() {
                  self2.off(name2, listener);
                  callback.apply(ctx, arguments);
                }
                listener._ = callback;
                return this.on(name2, listener, ctx);
              },
              emit: function(name2) {
                var data2 = [].slice.call(arguments, 1);
                var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
                var i2 = 0;
                var len = evtArr.length;
                for (i2; i2 < len; i2++) {
                  evtArr[i2].fn.apply(evtArr[i2].ctx, data2);
                }
                return this;
              },
              off: function(name2, callback) {
                var e = this.e || (this.e = {});
                var evts = e[name2];
                var liveEvents = [];
                if (evts && callback) {
                  for (var i2 = 0, len = evts.length; i2 < len; i2++) {
                    if (evts[i2].fn !== callback && evts[i2].fn._ !== callback)
                      liveEvents.push(evts[i2]);
                  }
                }
                liveEvents.length ? e[name2] = liveEvents : delete e[name2];
                return this;
              }
            };
            module3.exports = E;
            module3.exports.TinyEmitter = E;
          }
        };
        var __webpack_module_cache__ = {};
        function __webpack_require__(moduleId) {
          if (__webpack_module_cache__[moduleId]) {
            return __webpack_module_cache__[moduleId].exports;
          }
          var module3 = __webpack_module_cache__[moduleId] = {
            exports: {}
          };
          __webpack_modules__[moduleId](module3, module3.exports, __webpack_require__);
          return module3.exports;
        }
        !function() {
          __webpack_require__.n = function(module3) {
            var getter = module3 && module3.__esModule ? function() {
              return module3["default"];
            } : function() {
              return module3;
            };
            __webpack_require__.d(getter, { a: getter });
            return getter;
          };
        }();
        !function() {
          __webpack_require__.d = function(exports3, definition) {
            for (var key in definition) {
              if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports3, key)) {
                Object.defineProperty(exports3, key, { enumerable: true, get: definition[key] });
              }
            }
          };
        }();
        !function() {
          __webpack_require__.o = function(obj, prop) {
            return Object.prototype.hasOwnProperty.call(obj, prop);
          };
        }();
        return __webpack_require__(686);
      }().default;
    });
  })(clipboard);
  var Clipboard = /* @__PURE__ */ getDefaultExportFromCjs(clipboard.exports);
  function isDef$1(value2) {
    return value2 !== void 0 && value2 !== null;
  }
  function get(object, path) {
    const keys2 = path.split(".");
    let result = object;
    keys2.forEach((key) => {
      result = isDef$1(result) && isDef$1(result[key]) ? result[key] : null;
    });
    return result;
  }
  let locale = require$$0$1.reactive({
    lang: localStorage.getItem("v_form_locale") || "zh-CN"
  });
  function createI18n(options) {
    return {
      messages: options.messages,
      $st(path, ...args) {
        const message = get(this.messages[locale.lang], path);
        return typeof message === "function" ? message(...args) : message !== null ? message : path;
      },
      $st2(path, path2) {
        let messages = this.messages[locale.lang];
        const message = get(messages, path);
        return message !== null ? message : get(messages, path2);
      },
      setLang(lang) {
        locale.lang = lang;
      }
    };
  }
  var enLocale = {
    application: {
      "zh-CN": "\u7B80\u4F53\u4E2D\u6587",
      "en-US": "English",
      productTitle: "Online Form Designer",
      github: "GitHub",
      document: "Docs",
      qqGroup: "WeChat Group",
      deployment: "Deployment",
      subscription: "Subscription"
    },
    designer: {
      chartLib: "Charts",
      metadataLib: "Data Module",
      componentLib: "Components",
      formLib: "Templates",
      containerTitle: "Container",
      dragHandlerHint: "drag container or field to layout center",
      dragAction: "drag",
      basicFieldTitle: "Basic Field",
      advancedFieldTitle: "Advanced Field",
      customFieldTitle: "Customized Field",
      chartTitle: "Chart Widget",
      noWidgetHint: "Please select a widget from the left list, drag and drop to this container.",
      widgetLabel: {
        grid: "Grid",
        "column-1-grid": "1-Col-Grid",
        "column-2-grid": "2-Col-Grid",
        "column-3-grid": "3-Col-Grid",
        "column-4-grid": "4-Col-Grid",
        table: "Table",
        tab: "Tab",
        section: "Section",
        "sub-form": "SubForm",
        "grid-sub-form": "GridSubForm",
        "grid-col": "GridCol",
        "table-cell": "TableCell",
        "tab-pane": "TabPane",
        "data-table": "DataTable",
        tree: "Tree",
        "button-group": "ButtonGroup",
        "object-group": "ObjectGroup",
        "vf-dialog": "Dialog",
        "vf-drawer": "Drawer",
        input: "Input",
        textarea: "Textarea",
        number: "InputNumber",
        radio: "Radio",
        checkbox: "Checkbox",
        select: "Select",
        time: "Time",
        "time-range": "Time range",
        date: "Date",
        "date-range": "Date range",
        switch: "Switch",
        rate: "Rate",
        color: "ColorPicker",
        slider: "Slider",
        "static-text": "Text",
        "html-text": "HTML",
        button: "Button",
        divider: "Divider",
        "picture-upload": "Picture",
        "file-upload": "File",
        "rich-editor": "Rich Editor",
        cascader: "Cascader",
        slot: "Slot",
        custom: "Custom Component"
      },
      hint: {
        formulaSetting: "Formula Setting",
        formulaModel: "Model",
        formulaModelView: "View",
        formulaModelEdit: "Edit",
        formulaSize: "Size",
        formulaSizeLarge: "Large",
        formulaSizeMedium: "Medium",
        formulaSizeSmall: "Small",
        formulaSizeMini: "Mini",
        formulaClear: "Clear",
        formulaNum: "Number",
        formulaStr: "String",
        formulaOK: "OK",
        formulaSearch: "Search...",
        formulaWidgetList: "Widget List",
        formulaFunctionList: "Function List",
        formulaFunctionExplain: "Function Explain",
        formulaFunctionMaths: "Maths",
        formulaFunctionLogic: "Logic",
        formulaFunctionTime: "Time",
        formulaFunctionString: "String",
        formulaNumber: "Number",
        formulaObject: "Object",
        formulaDate: "Date",
        formulaChar: "Char",
        formulaPleaseSelect: "Please select a widget name and function",
        formulaSample: "Sample",
        formulaPara: "parameter",
        formulaINT: "Remove decimals from numerical values, for example: INT (-8.9)=-9",
        formulaSUM: "Returns the sum of a set of data, for example: SUM (1,2,3,...)=6",
        formulaAVERAGE: "Returns the average of a set of data, for example: AVERAGE (1,2,3,...)=2",
        formulaMAX: "Returns the maximum value in a set of numbers, for example: MAX (1,2,3,...)=3",
        formulaMIN: "Returns the minimum value in a set of numbers, for example: MIN (1,2,3,...)=1",
        formulaABS: "Find the absolute value of a number, for example: ABS (-5)=5",
        formulaROUND: "Keep the numerical value to the specified decimal place, for example: ROUND (8.999,2)=9.00",
        formulaCEILING: "Round a number up, for example: CEILING (8.9)=9",
        formulaLOG: "Returns the logarithm of parameter 1 based on parameter 2, for example: LOG (8,2)=3, and the logarithm of parameter 8 based on 2 is 3",
        formulaMOD: "Find the remainder of dividing two numbers, for example: MOD (2,6)=2",
        formulaPOWER: "Find the nth power of a number, for example: POWER (5, 3)=125",
        formulaAND: "Returns true when all conditions are met, otherwise returns false. For example, AND (1>0,2>1,...)=TRUE",
        formulaIF: "Determine whether a condition can be met. If it is met, return one value. If it is not met, return another value. For example: IF (1>2,1,0)=0",
        formulaIFS: "Example\uFF1AIFS(false, 'Hello!', true, 'Goodbye!')=Goodbye!",
        formulaIFERROR: "Example\uFF1AIFERROR('#DIV/0!', 'Error')",
        formulaIFNA: "Example\uFF1AIFNA('#N/A', 'Error')",
        formulaNOT: "Example\uFF1ANOT(true)=false",
        formulaOR: "Example: OR (true, false, true)=true",
        formulaSWITCH: "SWITCH (parameter value, condition 1, 'condition value 1  ', condition 2, 'condition value 2 ' [, condition N, 'condition value N  ',]), for example: SWITCH (7, 9, 'Nine ', 7, 'Seven  ')=Seven",
        formulaXOR: "Example\uFF1AXOR(true, false, true)=false",
        formulaYEAR: 'Example\uFF1AYEAR("2022-10-1")=2022',
        formulaMONTH: 'Example\uFF1AMONTH("2022-10-1")=10',
        formulaDAY: 'Example\uFF1ADAY("2022-10-11")=11',
        formulaTODAY: 'Example: TODAY()="2022-10-11"',
        formulaNOW: 'Example: NOW="2022-10-11 17:04:33"',
        formulaEMONTH: "Example: EMONTH ('2022-12-13  ', -1)='2022-11-13 '",
        formulaEDAY: "Example: EMONTH ('2022-12-13  ', -1)='2022-12-12 '",
        formulaFIND: "Find a string (parameters:  n1, Find Handle 2, Find Target String 3, Start Find Subscript),  n Example: FIND ('M  ', 'Miriam McGovern ', 3)=8",
        formulaLEFT: "Obtain N characters on the left side of the string, Left (string, truncation length), for example: Left ('Sale Price  ', 4)=Sale",
        formulaRIGHT: "Obtain the N characters on the right side of the string, right (string, truncation length), for example: Right ('Sale Price ', 5)=Price",
        formulaLEN: "Count the length of a string, for example: LEN ('abcdefgh ')=8",
        formulaLOWER: "Convert a string to lowercase, for example: POWER ('E. E. Cummings ')=e e. cummings",
        formulaUPPER: "Convert string to uppercase, for example: UPPER ('total ')=Total",
        formulaMID: "Truncate the string MID (string, starting index, truncation length), for example: MID ('Fluid Flow ', 7, 20)=Flow",
        formulaTRIM: "Remove excess spaces from the string TRIM (string), for example: TRIM ('First Quarter ')=First Quarter",
        formulaDateError: "Incorrect date format",
        formulaDateErrorMsg: "Date conversion error details",
        selectParentWidget: "Select parent of this widget",
        moveUpWidget: "Move up this widget",
        moveDownWidget: "Move down this widget",
        cloneWidget: "Clone this widget",
        insertRow: "Insert new row",
        insertColumn: "Insert new column",
        remove: "Remove this widget",
        cellSetting: "Cell setting",
        dragHandler: "Drag handler",
        copyField: "Copy field widget",
        onlyFieldWidgetAcceptable: "Only field widget can be dragged into sub-form",
        moveUpFirstChildHint: "First child can not be move up",
        moveDownLastChildHint: "Last child can not be move down",
        closePreview: "Close",
        copyJson: "Copy",
        saveFormJson: "Save As File",
        copyVueCode: "Copy Vue Code",
        copyHtmlCode: "Copy HTML Code",
        copyJsonSuccess: "Copy succeed",
        importJsonSuccess: "Import succeed",
        invalidJsonFormat: "Invalid JSON format",
        jsonVersionMismatch: "Version of JSON mismatch",
        copyJsonFail: "Copy failed",
        copyVueCodeSuccess: "Copy succeed",
        copyVueCodeFail: "Copy failed",
        copyHtmlCodeSuccess: "Copy succeed",
        copyHtmlCodeFail: "Copy failed",
        saveVueCode: "Save Vue File",
        saveHtmlCode: "Save Html File",
        getFormData: "Get Data",
        resetForm: "Reset",
        disableForm: "Disable",
        enableForm: "Enable",
        switchReadMode: "Read Mode",
        exportFormData: "Form Data",
        copyFormData: "Copy",
        saveFormData: "Save As File",
        copyVue2SFC: "Copy Vue2",
        copyVue3SFC: "Copy Vue3",
        copySFCFail: "Copy failed",
        copySFCSuccess: "Copy succeed",
        saveVue2SFC: "Save As Vue2",
        saveVue3SFC: "Save As Vue3",
        fileNameForSave: "File name:",
        saveFileTitle: "Save as File",
        fileNameInputPlaceholder: "Enter the file name",
        sampleLoadedSuccess: "Example loaded successfully",
        sampleLoadedFail: "Sample load failed",
        loadFormTemplate: "Load This",
        loadFormTemplateHint: "Are you sure to load this template?",
        loadFormTemplateSuccess: "Load form template success!",
        loadFormTemplateFailed: "Load form template failed.",
        currentNodeCannotBeSelected: "The current node cannot be selected.",
        noSelectedWidgetHint: "No selected widget.",
        widgetSetting: "Widget Prop",
        formSetting: "Form Prop",
        prompt: "Prompt",
        confirm: "OK",
        cancel: "Cancel",
        import: "Import",
        importJsonHint: "The code to be imported should have the following JSON format.",
        importDSHint: "The format of the imported datasource must be valid.",
        invalidOptionsData: "Invalid data of options:",
        lastPaneCannotBeDeleted: "The last pane cannot be deleted.",
        duplicateName: "Duplicate name: ",
        nameRequired: "Name required.",
        objectNameRequired: "Object name required.",
        numberValidator: "Number",
        letterValidator: "Letter",
        letterAndNumberValidator: "LetterAndNumber",
        mobilePhoneValidator: "MobilePhone",
        emailValidator: "Email",
        urlValidator: "URL",
        noChineseValidator: "Non-Chinese",
        chineseValidator: "Chinese",
        rowspanNotConsistentForMergeEntireRow: "Cells in this row don't have the same rowspan, operation failed.",
        colspanNotConsistentForMergeEntireColumn: "Cells in this column don't have the same colspan, operation failed.",
        rowspanNotConsistentForDeleteEntireRow: "Cells in this row don't have the same rowspan, operation failed.",
        colspanNotConsistentForDeleteEntireColumn: "Cells in this column don't have the same colspan, operation failed.",
        lastColCannotBeDeleted: "The last col cannot be deleted.",
        lastRowCannotBeDeleted: "The last row cannot be deleted."
      },
      toolbar: {
        undoHint: "Undo",
        redoHint: "Redo",
        pcLayout: "PC",
        padLayout: "Pad",
        mobileLayout: "H5",
        nodeTreeHint: "Tree View Of Component Hierarchy",
        nodeTreeTitle: "Tree View Of Component Hierarchy",
        clear: "Clear",
        preview: "Preview",
        importJson: "Import",
        exportJson: "Export",
        exportCode: "Codes",
        generateCode: "Generate Code",
        generateSFC: "Generate SFC"
      },
      setting: {
        formulaEnabled: "Enable Formula",
        formula: "Formula",
        basicSetting: "Basic Setting",
        attributeSetting: "Attribute Setting",
        commonSetting: "Common Setting",
        advancedSetting: "Advanced Setting",
        eventSetting: "Event Setting",
        uniqueName: "Unique Name",
        editNameHelp: "Press enter to confirm the modification",
        keyNameEnabled: "Enable Key Name",
        keyName: "Key Name of Data",
        keyNameHelp: "It is the name of key in form-data object",
        objectName: "Object Name",
        objectNameHelp: "For example\uFF1Afoo, foo.bar, foo.bar.one",
        label: "Label",
        displayType: "Type",
        defaultValue: "Default Value",
        placeholder: "Placeholder",
        startPlaceholder: "Start Placeholder",
        endPlaceholder: "End Placeholder",
        widgetColumnWidth: "Width",
        widgetSize: "Size",
        fontSize: "Font Size",
        textAlign: "Text Align",
        autoFullWidth: "Auto Full Width",
        showStops: "Show Stops",
        displayStyle: "Display Style",
        inlineLayout: "inline",
        blockLayout: "block",
        buttonStyle: "Show As Button",
        border: "Show Border",
        labelWidth: "Width Of Label",
        rows: "Rows",
        autosize: "Autosize",
        labelHidden: "Hide Label",
        labelWrap: "Label Wrap",
        required: "Required",
        requiredHint: "Failure Hint",
        validation: "Validation",
        validationHelp: "Regular expressions supported",
        validationHint: "Validation Hint",
        readonly: "Readonly",
        disabled: "Disabled",
        hidden: "Hidden",
        textContent: "Text",
        preWrap: "Line Wrap",
        htmlContent: "HTML",
        clearable: "Clearable",
        editable: "Editable",
        format: "Format",
        valueFormat: "Value Format",
        showPassword: "Show Reveal",
        filterable: "Filterable",
        allowCreate: "Allow Create",
        remote: "Remote Query",
        automaticDropdown: "Automatic Dropdown",
        multiple: "Multiple",
        multipleLimit: "Multiple Limit",
        collapseTags: "Collapse Tags",
        checkStrictly: "Any Level Selectable",
        showAllLevels: "Show All Levels",
        contentPosition: "Content Position",
        dividerDirection: "Direction",
        plain: "Plain",
        round: "Round",
        circle: "Circle",
        icon: "Icon",
        optionsSetting: "Options Setting",
        optionValueType: "Value Type",
        addOption: "Add Option",
        importOptions: "Import Options",
        resetDefault: "Reset Default",
        uploadSetting: "Upload Setting",
        uploadURL: "Upload URL",
        uploadTip: "Tip Content",
        withCredentials: "Send Cookie",
        multipleSelect: "File Multi-select",
        showFileList: "Show File List",
        limit: "Max Upload Number",
        fileMaxSize: "Max Size(MB)",
        fileTypes: "Upload File Types",
        fileTypesHelp: "Allows to add more file types",
        headers: "Request Headers",
        cellWidth: "Width",
        cellHeight: "Height",
        wordBreak: "Line Wrap",
        gridColHeight: "Height Of Col(px)",
        gutter: "Gutter(px)",
        columnSetting: "Cols Setting",
        colsOfGrid: "Cols Of Grid:",
        colSpanTitle: "Spans Of Col",
        colOffsetTitle: "Offset Of Col",
        colPushTitle: "Push Of Col",
        colPullTitle: "Pull Of Col",
        addColumn: "Add Column",
        responsive: "Responsive",
        tabType: "Tab Style",
        tabPosition: "Position Of Tab",
        tabPaneSetting: "Tab Panes",
        addTabPane: "Add Tab Pane",
        paneActive: "Active",
        customLabelIcon: "Custom Label",
        labelIconClass: "Label Icon Class",
        labelIconPosition: "Label Icon Position",
        labelTooltip: "Label Tooltip",
        minValue: "Min Value",
        maxValue: "Max Value",
        precision: "Precision",
        step: "Step",
        showControls: "Show Controls",
        controlsPosition: "Controls Position",
        minLength: "Min Length",
        maxLength: "Max Length",
        showWordLimit: "Show Word Limit",
        prefixIcon: "Prefix Icon",
        suffixIcon: "Suffix Icon",
        inputButton: "Input Button Setting",
        appendButton: "Append Button",
        appendButtonDisabled: "Button Disabled",
        appendButtonIcon: "Append Button Icon",
        buttonIcon: "Button Icon",
        switchWidth: "Width of Switch(px)",
        activeText: "Active Text",
        inactiveText: "Inactive Text",
        activeColor: "Active Color",
        inactiveColor: "Inactive Color",
        maxStars: "Stars Max Number",
        lowThreshold: "Low Threshold",
        highThreshold: "High Threshold",
        allowHalf: "Allow Half",
        showText: "Show Text",
        showScore: "Show Score",
        range: "Range",
        vertical: "Vertical",
        showBlankRow: "Show Blank Row",
        showRowNumber: "Show Row Number",
        actionColumnPosition: "Position Of Buttons Column",
        contentHeight: "Content Area Height",
        groupButtonsEdit: "Edit Buttons",
        insertColumnToLeft: "insert column to left",
        insertColumnToRight: "insert column to right",
        insertRowAbove: "insert row above",
        insertRowBelow: "insert row below",
        mergeLeftColumn: "merge left cell",
        mergeRightColumn: "merge right cell",
        mergeEntireRow: "merge entire row",
        mergeRowAbove: "merge cell above",
        mergeRowBelow: "merge cell below",
        mergeEntireColumn: "merge entire column",
        undoMergeCol: "undo merge column",
        undoMergeRow: "undo merge row",
        deleteEntireCol: "delete entire column",
        deleteEntireRow: "delete entire row",
        widgetName: "Unique Name",
        formSize: "Size",
        labelPosition: "Position Of Label",
        topPosition: "Top",
        leftPosition: "Left",
        labelAlign: "Label Align",
        leftAlign: "Left",
        centerAlign: "Center",
        rightAlign: "Right",
        formCss: "Form CSS",
        addCss: "Edit",
        customClass: "Custom Class",
        globalFunctions: "Global Functions",
        addEventHandler: "Edit",
        editWidgetEventHandler: "Edit Widget Event Handler",
        editFormEventHandler: "Edit Form Event Handler",
        formSFCSetting: "SFC Setting",
        formModelName: "Model Name",
        formRefName: "Ref Name",
        formRulesName: "Rules Name",
        syntaxCheckWarning: "Syntax error in the javascript codes, please check again!",
        title: "Title",
        dialogWidth: "Width\uFF08px/%\uFF09",
        fullscreen: "Full Screen",
        showModal: "Show Modal",
        showClose: "Show Close",
        closeOnClickModal: "Click Modal To Close ",
        closeOnPressEscape: "Press Esc To Close",
        center: "Center Header And Footer",
        readMode: "Form Readonly",
        disabledMode: "Form Disabled",
        okButtonLabel: "Label Of OK Btn",
        okButtonHidden: "Hide OK Btn",
        cancelButtonLabel: "Label Of Cancel Btn",
        cancelButtonHidden: "Hide Cancel Btn",
        drawSize: "Size(px/%)",
        drawDirection: "Direction",
        tableWidth: "Width(px/%)",
        tableHeight: "Height(px/%)",
        showCheckBox: "Show CheckBox",
        showIndex: "Show Row Number",
        showPagination: "Show Pagination",
        paginationAlign: "Align Of Pagination",
        smallPagination: "Small Pagination",
        autoColumnWidthDisabled: "Disable Auto Adjust Width Of Col",
        tableColEdit: "Edit Cols",
        tableDataEdit: "Edit Data",
        stripe: "Stripe",
        showSummary: "Show Summary",
        rowSpacing: "Row Spacing(px)",
        editAction: "Edit...",
        columnName: "Name",
        columnLabel: "Label",
        columnWidth: "Width(px)",
        visibleColumn: "Visible",
        sortableColumn: "Sortable",
        customSortColumn: "Custom Sort",
        fixedColumn: "Fixed",
        alignTypeOfColumn: "Align",
        formatOfColumn: "Format",
        customRenderGroup: "Custom Render",
        renderFunction: "Render",
        actionColumn: "Action",
        addTableColumn: "Add New Column",
        deleteTableColumn: "Delete This Column",
        onlyOneColumnCannotBeDeleted: "The last column cannot be deleted.",
        treeDataEnabled: "Enable Tree Data",
        rowKeyOfTreeData: "Row Key Of Data",
        childrenKeyOfTreeData: "Children Of Data",
        showButtonsColumn: "Buttons Column",
        buttonsColumnEdit: "Edit Buttons",
        buttonsColumnTitle: "Title",
        buttonsColumnWidth: "Width(px)",
        operationButtonsSetting: "Buttons Setting",
        operationButtonName: "Name",
        operationButtonLabel: "Text",
        operationButtonType: "Type",
        operationButtonSize: "Size",
        operationButtonRound: "Round",
        operationButtonHidden: "Hidden",
        operationButtonDisabled: "Disabled",
        addOperationButton: "Add New Button",
        deleteOperationButtonHint: "Delete this button?",
        operationButtonDuplicatedNameError: "Duplicate button name.",
        tableHeader: "Header",
        insertTableHeader: "Insert Header",
        insertTableSubHeader: "Insert Sub Header",
        tableDataColumn: "Data Col",
        insertTableDataColumn: "Insert DataColumn",
        insertTableSubDataColumn: "Insert Sub DataColumn",
        onlyDragBetweenSiblingNodes: "You can only drag between sibling nodes!",
        getHeaderLevelTitle: function(level) {
          return "Level " + level + " Header";
        },
        lineNumber: "Line Num",
        dsEnabled: "Use Datasource",
        dsName: "Datasource Name",
        dataSetName: "Dataset Name",
        labelKeyName: "Label Key",
        valueKeyName: "Value Key",
        childrenKeyName: "Children Key",
        dataSource: "Datasource",
        noDataSource: "No datasource.",
        addDataSource: "Add Datasource",
        importDataSource: "Import Datasource",
        clearExistingDataSource: "Empty the existing datasource",
        remainExistingDataSource: "Append to the existing datasource",
        exportDataSource: "Export Datasource",
        selectDataSourceForExport: "Select Datasource",
        dataSourceChecked: "Checked",
        previewDataSourceExportResult: "Preview Result",
        dataSourceSetting: "Datasource Setting",
        deleteDataSourceHint: "Delete this datasource\uFF1F",
        fieldValueRequired: "Value can not be null",
        dsUniqueName: "Unique Name",
        dsRequestURL: "Request URL",
        dsRequestURLType: "Request URL Type",
        dsURLStringType: "String",
        dsURLVariableType: "Expression",
        dsDescription: "Description",
        dsRequestMethod: "Request Method",
        dsRequestHeaders: "Headers",
        addRequestHeader: "Add Header",
        dsRequestParams: "Params",
        addRequestParam: "Add Param",
        dsRequestData: "Data",
        addRequestData: "Add Data",
        addDataSet: "Add Dataset",
        dsRequestValueStringType: "String",
        dsRequestValueNumberType: "Number",
        dsRequestValueBooleanType: "Boolean",
        dsRequestValueVariableType: "Variable",
        dsRequestNameInputPlaceholder: "Name",
        dsRequestTypeInputPlaceholder: "Type",
        dsRequestValueInputPlaceholder: "Value",
        dataSetRemarkInputPlaceholder: "Note",
        dsConfigHandlerTitle: "1. Config Handler",
        dsDataHandlerTitle: "2. Data Handler",
        dsErrorHandlerTitle: "3. Error Handler",
        dataSetSettingTitle: "4. Dataset Setting",
        dataSetEnabled: "Multiple Datasets Enabled",
        dataSetSetting: "List Of Datasets",
        testDataSource: "Test Datasource",
        dsvTitle: "Datasource Variable",
        dsRequestResult: "Result Data",
        executeDataSource: "Run Test",
        clearRequestResult: "Clear Result",
        dsRequestNumberTypeError: "Number value error",
        dsRequestBooleanTypeError: "Boolean value error",
        dsValidationError: "Datasource check failure.",
        dsDuplicatedNameError: "Duplicate datasource name.",
        showTreeCheckBox: "Show CheckBox",
        lazy: "Lazy",
        treeDataEdit: "Tree Data Edit",
        defaultExpandAllNode: "Default Expand All",
        expandRetractAllNode: "Expand/Retract All",
        selectClearAllNode: "Check/Uncheck All",
        nodeEdit: "Show Node Action",
        expandAllNode: "Expand All",
        retractAllNode: "Retract All",
        selectAllNode: "Check All",
        clearAllNode: "Uncheck All",
        draggable: "Node Draggable",
        filter: "Filter",
        expandOnClickNode: "Expand On Click",
        treeNodeCheckStrictly: "Check Node Strictly",
        inputNodeName: "Input Name Of Node",
        deleteNode: "Delete this node?",
        nodeDeleted: "Node deleted",
        tips: "Tips",
        onNodeCheckRemark: "On Node Check",
        onNodeClickRemark: "On Node Click",
        onNodeContextmenuRemark: "ON Node Contextmenu",
        enterForQuery: "Enter For Query",
        add: "Add",
        delete: "Delete"
      }
    }
  };
  var zhLocale = {
    application: {
      "zh-CN": "\u7B80\u4F53\u4E2D\u6587",
      "en-US": "English",
      productTitle: "\u8868\u5355\u8BBE\u8BA1\u5668",
      github: "GitHub",
      document: "\u6587\u6863",
      qqGroup: "\u6280\u672FWX\u7FA4",
      deployment: "\u79C1\u6709\u90E8\u7F72",
      subscription: "\u8BA2\u9605Pro"
    },
    designer: {
      chartLib: "\u56FE\u8868",
      metadataLib: "\u5143\u6570\u636E",
      componentLib: "\u7EC4\u4EF6\u5E93",
      formLib: "\u8868\u5355\u6A21\u677F",
      containerTitle: "\u5BB9\u5668",
      dragHandlerHint: "\u9F20\u6807\u62D6\u62FD\u5BB9\u5668\u7EC4\u4EF6\u6216\u5B57\u6BB5\u7EC4\u4EF6\u5E76\u653E\u7F6E\u4E8E\u8868\u5355\u4E2D",
      dragAction: "\u62D6\u52A8",
      basicFieldTitle: "\u57FA\u7840\u5B57\u6BB5",
      advancedFieldTitle: "\u9AD8\u7EA7\u5B57\u6BB5",
      customFieldTitle: "\u81EA\u5B9A\u4E49\u6269\u5C55\u5B57\u6BB5",
      chartTitle: "\u56FE\u8868\u7EC4\u4EF6",
      noWidgetHint: "\u8BF7\u4ECE\u5DE6\u4FA7\u5217\u8868\u4E2D\u9009\u62E9\u4E00\u4E2A\u7EC4\u4EF6, \u7136\u540E\u7528\u9F20\u6807\u62D6\u52A8\u7EC4\u4EF6\u653E\u7F6E\u4E8E\u6B64\u5904.",
      widgetLabel: {
        grid: "\u6805\u683C",
        "column-1-grid": "\u5355\u5217\u6805\u683C",
        "column-2-grid": "\u53CC\u5217\u6805\u683C",
        "column-3-grid": "\u4E09\u5217\u6805\u683C",
        "column-4-grid": "\u56DB\u5217\u6805\u683C",
        table: "\u8868\u683C",
        tab: "\u6807\u7B7E\u9875",
        section: "\u533A\u5757",
        "sub-form": "\u5355\u884C\u5B50\u8868\u5355",
        "grid-sub-form": "\u591A\u884C\u5B50\u8868\u5355",
        "grid-col": "\u6805\u683C\u5217",
        "table-cell": "\u5355\u5143\u683C",
        "tab-pane": "\u9009\u9879\u5361\u9875",
        "data-table": "\u6570\u636E\u8868\u683C",
        tree: "\u6811\u5F62",
        "button-group": "\u6309\u94AE\u7EC4",
        "object-group": "\u5BF9\u8C61\u5BB9\u5668",
        "vf-dialog": "\u5F39\u51FA\u7A97\u53E3",
        "vf-drawer": "\u4FA7\u6ED1\u62BD\u5C49",
        input: "\u5355\u884C\u8F93\u5165",
        textarea: "\u591A\u884C\u8F93\u5165",
        number: "\u8BA1\u6570\u5668",
        radio: "\u5355\u9009\u9879",
        checkbox: "\u591A\u9009\u9879",
        select: "\u4E0B\u62C9\u9009\u9879",
        time: "\u65F6\u95F4",
        "time-range": "\u65F6\u95F4\u8303\u56F4",
        date: "\u65E5\u671F",
        "date-range": "\u65E5\u671F\u8303\u56F4",
        switch: "\u5F00\u5173",
        rate: "\u8BC4\u5206",
        color: "\u989C\u8272\u9009\u62E9\u5668",
        slider: "\u6ED1\u5757",
        "static-text": "\u9759\u6001\u6587\u5B57",
        "html-text": "HTML",
        button: "\u6309\u94AE",
        divider: "\u5206\u9694\u7EBF",
        "picture-upload": "\u56FE\u7247",
        "file-upload": "\u6587\u4EF6",
        "rich-editor": "\u5BCC\u6587\u672C",
        cascader: "\u7EA7\u8054\u9009\u62E9",
        slot: "\u63D2\u69FD",
        custom: "Custom Component"
      },
      hint: {
        formulaSetting: "\u516C\u5F0F\u8BBE\u7F6E",
        formulaModel: "\u6A21\u5F0F",
        formulaModelView: "\u67E5\u770B",
        formulaModelEdit: "\u7F16\u8F91",
        formulaSize: "\u5927\u5C0F",
        formulaSizeLarge: "\u5927",
        formulaSizeMedium: "\u4E2D",
        formulaSizeSmall: "\u5C0F",
        formulaSizeMini: "\u8FF7\u4F60",
        formulaClear: "\u6E05\u9664",
        formulaNum: "\u6570\u5B57",
        formulaStr: "\u5B57\u7B26",
        formulaOK: "\u786E\u5B9A",
        formulaSearch: "\u641C\u7D22...",
        formulaWidgetList: "\u7EC4\u4EF6\u5217\u8868",
        formulaFunctionList: "\u51FD\u6570\u5217\u8868",
        formulaFunctionExplain: "\u51FD\u6570\u8BF4\u660E",
        formulaFunctionMaths: "\u6570\u5B66\u51FD\u6570",
        formulaFunctionLogic: "\u903B\u8F91\u51FD\u6570",
        formulaFunctionTime: "\u65F6\u95F4\u51FD\u6570",
        formulaFunctionString: "\u5B57\u7B26\u4E32\u51FD\u6570",
        formulaNumber: "\u6570\u5B57",
        formulaObject: "\u5BF9\u8C61",
        formulaDate: "\u65E5\u671F",
        formulaChar: "\u6587\u5B57",
        formulaPleaseSelect: "\u8BF7\u9009\u62E9\u7EC4\u4EF6\u540D\u548C\u51FD\u6570",
        formulaSample: "\u516C\u5F0F\u7F16\u8F91\u4E3E\u4F8B",
        formulaPara: "\u53C2\u6570",
        formulaINT: "\u5C06\u6570\u503C\u53BB\u6389\u5C0F\u6570\uFF0C\u4E3E\u4F8B\uFF1AINT(-8.9)=-9",
        formulaSUM: "\u8FD4\u56DE\u4E00\u7EC4\u6570\u636E\u7684\u548C\uFF0C\u4E3E\u4F8B\uFF1ASUM(1,2,3,...)=6",
        formulaAVERAGE: "\u8FD4\u56DE\u4E00\u7EC4\u6570\u636E\u7684\u5E73\u5747\u6570\uFF0C\u4E3E\u4F8B\uFF1AAVERAGE(1,2,3,...)=2",
        formulaMAX: "\u8FD4\u56DE\u4E00\u7EC4\u6570\u4E2D\u7684\u6700\u5927\u503C\uFF0C\u4E3E\u4F8B\uFF1AMAX(1,2,3,...)=3",
        formulaMIN: "\u8FD4\u56DE\u4E00\u7EC4\u6570\u4E2D\u7684\u6700\u5C0F\u503C\uFF0C\u4E3E\u4F8B\uFF1AMIN(1,2,3,...)=1",
        formulaABS: "\u6C42\u4E00\u4E2A\u6570\u7684\u7EDD\u5BF9\u503C\uFF0C\u4E3E\u4F8B\uFF1AABS(-5)=5",
        formulaROUND: "\u5C06\u6570\u503C\u4FDD\u7559\u6307\u5B9A\u5C0F\u6570\u4F4D\uFF0C\u4E3E\u4F8B\uFF1AROUND(8.999,2)=9.00",
        formulaCEILING: "\u5C06\u4E00\u4E2A\u6570\u5411\u4E0A\u53D6\u6574\uFF0C\u4E3E\u4F8B\uFF1ACEILING(8.9)=9",
        formulaLOG: "\u8FD4\u56DE\u4EE5\u53C2\u65702\u4E3A\u5E95\u53C2\u65701\u7684\u5BF9\u6570\uFF0C\u4E3E\u4F8B\uFF1ALOG(8,2)=3\uFF0C\u4EE52\u4E3A\u5E958\u7684\u5BF9\u6570\u4E3A3",
        formulaMOD: "\u6C42\u4E24\u6570\u76F8\u9664\u7684\u4F59\u6570\uFF0C\u4E3E\u4F8B\uFF1AMOD(2,6)=2",
        formulaPOWER: "\u6C42\u6570\u5B57\u7684N\u6B21\u65B9\uFF0C\u4E3E\u4F8B\uFF1APOWER(5, 3)=125",
        formulaAND: "\u5F53\u6240\u6709\u6761\u4EF6\u90FD\u7B26\u5408\u65F6\uFF0C\u8FD4\u56DEtrue\uFF0C\u5426\u5219\u8FD4\u56DEfalse\uFF0C\u4E3E\u4F8B\uFF1AAND(1>0,2>1,...)=TRUE",
        formulaIF: "\u5224\u65AD\u4E00\u4E2A\u6761\u4EF6\u80FD\u5426\u6EE1\u8DB3\uFF0C\u5982\u679C\u6EE1\u8DB3\u5219\u8FD4\u56DE\u4E00\u4E2A\u503C\uFF0C\u5982\u679C\u4E0D\u6EE1\u8DB3\u5219\u8FD4\u56DE\u53E6\u4E00\u4E2A\u503C\uFF0C\u4E3E\u4F8B\uFF1AIF(1>2,1,0)=0",
        formulaIFS: "\u4E3E\u4F8B\uFF1AIFS(false, 'Hello!', true, 'Goodbye!')=Goodbye!",
        formulaIFERROR: "\u4E3E\u4F8B\uFF1AIFERROR('#DIV/0!', 'Error')",
        formulaIFNA: "\u4E3E\u4F8B\uFF1AIFNA('#N/A', 'Error')",
        formulaNOT: "\u4E3E\u4F8B\uFF1ANOT(true)=false",
        formulaOR: "\u4E3E\u4F8B: OR (true, false, true)=true",
        formulaSWITCH: "SWITCH(\u53C2\u6570\u503C,\u6761\u4EF61,'\u6761\u4EF6\u503C1',\u6761\u4EF62,'\u6761\u4EF6\u503C2'[,\u6761\u4EF6N,'\u6761\u4EF6\u503CN',])\uFF0C\u4E3E\u4F8B\uFF1ASWITCH(7, 9, 'Nine', 7, 'Seven')=Seven",
        formulaXOR: "\u4E3E\u4F8B\uFF1AXOR(true, false, true)=false",
        formulaYEAR: '\u4E3E\u4F8B\uFF1AYEAR("2022-10-1")=2022',
        formulaMONTH: '\u4E3E\u4F8B\uFF1AMONTH("2022-10-1")=10',
        formulaDAY: '\u4E3E\u4F8B\uFF1ADAY("2022-10-11")=11',
        formulaTODAY: '\u4E3E\u4F8B: TODAY()="2022-10-11"',
        formulaNOW: '\u4E3E\u4F8B: NOW="2022-10-11 17:04:33"',
        formulaEMONTH: "\u4E3E\u4F8B: EMONTH ('2022-12-13  ', -1)='2022-11-13 '",
        formulaEDAY: "\u4E3E\u4F8B: EMONTH ('2022-12-13  ', -1)='2022-12-12 '",
        formulaFIND: "\u67E5\u627E\u5B57\u7B26\u4E32(\u53C2\u6570\uFF1A\n1\u3001\u67E5\u627E\u53E5\u67C4 2\u3001\u67E5\u627E\u76EE\u6807\u5B57\u7B26\u4E32 3\u3001\u5F00\u59CB\u67E5\u627E\u4E0B\u6807)\uFF0C\n\u4E3E\u4F8B\uFF1AFIND('M', 'Miriam McGovern', 3)=8",
        formulaLEFT: "\u83B7\u53D6\u5B57\u7B26\u4E32\u5DE6\u4FA7N\u4E2A\u5B57\u7B26\uFF0CLEFT(\u5B57\u7B26\u4E32,\u622A\u53D6\u957F\u5EA6)\uFF0C\u4E3E\u4F8B\uFF1ALEFT('Sale Price', 4)=Sale",
        formulaRIGHT: "\u83B7\u53D6\u5B57\u7B26\u4E32\u53F3\u4FA7N\u4E2A\u5B57\u7B26 RIGHT(\u5B57\u7B26\u4E32,\u622A\u53D6\u957F\u5EA6)\uFF0C\u4E3E\u4F8B\uFF1ARIGHT('Sale Price', 5)=Price",
        formulaLEN: "\u7EDF\u8BA1\u5B57\u7B26\u4E32\u957F\u5EA6\uFF0C\u4E3E\u4F8B\uFF1ALEN('abcdefgh')=8",
        formulaLOWER: "\u5B57\u7B26\u4E32\u8F6C\u5C0F\u5199\uFF0C\u4E3E\u4F8B\uFF1ALOWER('E. E. Cummings')=e. e. cummings",
        formulaUPPER: "\u5B57\u7B26\u4E32\u8F6C\u5927\u5199\uFF0C\u4E3E\u4F8B\uFF1AUPPER('total')=TOTAL",
        formulaMID: "\u622A\u53D6\u5B57\u7B26\u4E32 MID(\u5B57\u7B26\u4E32,\u5F00\u59CB\u4E0B\u6807,\u622A\u53D6\u957F\u5EA6)\uFF0C\u4E3E\u4F8B\uFF1AMID('Fluid Flow', 7, 20)=Flow",
        formulaTRIM: "\u5B57\u7B26\u4E32\u53BB\u9664\u591A\u4F59\u7A7A\u683C TRIM(\u5B57\u7B26\u4E32)\uFF0C\u4E3E\u4F8B\uFF1ATRIM('     First     Quarter  ')=First Quarter",
        formulaDateError: "\u65E5\u671F\u683C\u5F0F\u4E0D\u6B63\u786E",
        formulaDateErrorMsg: "\u65E5\u671F\u8F6C\u6362\u9519\u8BEF\u660E\u7EC6",
        selectParentWidget: "\u9009\u4E2D\u7236\u7EC4\u4EF6",
        moveUpWidget: "\u4E0A\u79FB\u7EC4\u4EF6",
        moveDownWidget: "\u4E0B\u79FB\u7EC4\u4EF6",
        cloneWidget: "\u590D\u5236\u7EC4\u4EF6",
        insertRow: "\u63D2\u5165\u65B0\u884C",
        insertColumn: "\u63D2\u5165\u65B0\u5217",
        remove: "\u79FB\u9664\u7EC4\u4EF6",
        cellSetting: "\u5355\u5143\u683C\u64CD\u4F5C",
        dragHandler: "\u62D6\u62FD\u624B\u67C4",
        copyField: "\u590D\u5236\u5B57\u6BB5\u7EC4\u4EF6",
        onlyFieldWidgetAcceptable: "\u5B50\u8868\u5355\u53EA\u80FD\u63A5\u6536\u5B57\u6BB5\u7EC4\u4EF6",
        moveUpFirstChildHint: "\u5DF2\u7ECF\u79FB\u52A8\u5230\u6700\u4E0A\u9762",
        moveDownLastChildHint: "\u5DF2\u7ECF\u79FB\u52A8\u5230\u6700\u4E0B\u9762",
        closePreview: "\u5173\u95ED",
        copyJson: "\u590D\u5236JSON",
        saveFormJson: "\u4FDD\u5B58\u4E3A\u6587\u4EF6",
        copyVueCode: "\u590D\u5236Vue\u4EE3\u7801",
        copyHtmlCode: "\u590D\u5236HTML\u4EE3\u7801",
        copyJsonSuccess: "\u590D\u5236JSON\u6210\u529F",
        importJsonSuccess: "\u5BFC\u5165JSON\u6210\u529F",
        invalidJsonFormat: "\u65E0\u6548\u7684\u8868\u5355JSON\u683C\u5F0F",
        jsonVersionMismatch: "\u8868\u5355JSON\u7248\u672C\u53F7\u4E0D\u5339\u914D",
        copyJsonFail: "\u590D\u5236JSON\u5931\u8D25",
        copyVueCodeSuccess: "\u590D\u5236Vue\u4EE3\u7801\u6210\u529F",
        copyVueCodeFail: "\u590D\u5236Vue\u4EE3\u7801\u5931\u8D25",
        copyHtmlCodeSuccess: "\u590D\u5236HTML\u4EE3\u7801\u6210\u529F",
        copyHtmlCodeFail: "\u590D\u5236HTML\u4EE3\u7801\u5931\u8D25",
        saveVueCode: "\u4FDD\u5B58Vue\u6587\u4EF6",
        saveHtmlCode: "\u4FDD\u5B58Html\u6587\u4EF6",
        getFormData: "\u83B7\u53D6\u6570\u636E",
        resetForm: "\u91CD\u7F6E\u8868\u5355",
        disableForm: "\u7981\u7528\u7F16\u8F91",
        enableForm: "\u6062\u590D\u7F16\u8F91",
        switchReadMode: "\u53EA\u8BFB\u67E5\u770B",
        exportFormData: "\u8868\u5355\u6570\u636E",
        copyFormData: "\u590D\u5236JSON",
        saveFormData: "\u4FDD\u5B58\u4E3A\u6587\u4EF6",
        copyVue2SFC: "\u590D\u5236Vue2\u4EE3\u7801",
        copyVue3SFC: "\u590D\u5236Vue3\u4EE3\u7801",
        copySFCFail: "\u590D\u5236SFC\u4EE3\u7801\u5931\u8D25",
        copySFCSuccess: "\u590D\u5236SFC\u4EE3\u7801\u6210\u529F",
        saveVue2SFC: "\u4FDD\u5B58\u4E3AVue2\u7EC4\u4EF6",
        saveVue3SFC: "\u4FDD\u5B58\u4E3AVue3\u7EC4\u4EF6",
        fileNameForSave: "\u6587\u4EF6\u540D\uFF1A",
        saveFileTitle: "\u4FDD\u5B58\u4E3A\u6587\u4EF6",
        fileNameInputPlaceholder: "\u8BF7\u8F93\u5165\u6587\u4EF6\u540D",
        sampleLoadedSuccess: "\u8868\u5355\u793A\u4F8B\u52A0\u8F7D\u6210\u529F",
        sampleLoadedFail: "\u8868\u5355\u793A\u4F8B\u52A0\u8F7D\u5931\u8D25",
        loadFormTemplate: "\u52A0\u8F7D\u6B64\u6A21\u677F",
        loadFormTemplateHint: "\u662F\u5426\u52A0\u8F7D\u8FD9\u4E2A\u6A21\u677F\uFF1F\u52A0\u8F7D\u540E\u4F1A\u8986\u76D6\u8BBE\u8BA1\u5668\u5F53\u524D\u8868\u5355\uFF0C\u4F60\u53EF\u4EE5\u4F7F\u7528\u201C\u64A4\u9500\u201D\u529F\u80FD\u6062\u590D\u3002",
        loadFormTemplateSuccess: "\u8868\u5355\u6A21\u677F\u52A0\u8F7D\u6210\u529F",
        loadFormTemplateFailed: "\u8868\u5355\u6A21\u677F\u52A0\u8F7D\u5931\u8D25",
        currentNodeCannotBeSelected: "\u5F53\u524D\u7EC4\u4EF6\u8282\u70B9\u4E0D\u53EF\u9009\u62E9",
        noSelectedWidgetHint: "\u5F53\u524D\u6CA1\u6709\u9009\u4E2D\u8BBE\u7F6E\u7684\u7EC4\u4EF6",
        widgetSetting: "\u7EC4\u4EF6\u8BBE\u7F6E",
        formSetting: "\u5168\u5C40\u8BBE\u7F6E",
        prompt: "\u63D0\u793A",
        confirm: "\u786E\u5B9A",
        cancel: "\u53D6\u6D88",
        import: "\u5BFC\u5165",
        importJsonHint: "\u5BFC\u5165\u7684JSON\u5185\u5BB9\u987B\u7B26\u5408\u4E0B\u8FF0\u683C\u5F0F\uFF0C\u4EE5\u4FDD\u8BC1\u987A\u5229\u5BFC\u5165.",
        importDSHint: "\u5BFC\u5165\u7684\u6570\u636E\u6E90\u683C\u5F0F\u987B\u7B26\u5408\u89C4\u8303\uFF0C\u4EE5\u4FDD\u8BC1\u987A\u5229\u5BFC\u5165.",
        invalidOptionsData: "\u65E0\u6548\u7684\u9009\u9879\u6570\u636E:",
        lastPaneCannotBeDeleted: "\u4EC5\u5269\u4E00\u4E2A\u9009\u9879\u5361\u9875\u4E0D\u53EF\u5220\u9664.",
        duplicateName: "\u7EC4\u4EF6\u540D\u79F0\u5DF2\u5B58\u5728: ",
        nameRequired: "\u7EC4\u4EF6\u540D\u79F0\u4E0D\u53EF\u4E3A\u7A7A",
        objectNameRequired: "\u5BF9\u8C61\u540D\u79F0\u4E0D\u53EF\u4E3A\u7A7A",
        numberValidator: "\u6570\u5B57",
        letterValidator: "\u5B57\u6BCD",
        letterAndNumberValidator: "\u6570\u5B57\u5B57\u6BCD",
        mobilePhoneValidator: "\u624B\u673A\u53F7\u7801",
        emailValidator: "\u90AE\u7BB1",
        urlValidator: "\u7F51\u5740",
        noChineseValidator: "\u975E\u4E2D\u6587\u5B57\u7B26",
        chineseValidator: "\u4EC5\u4E2D\u6587\u5B57\u7B26",
        rowspanNotConsistentForMergeEntireRow: "\u5B58\u5728\u884C\u9AD8\u4E0D\u4E00\u81F4\u7684\u5355\u5143\u683C, \u65E0\u6CD5\u5408\u5E76\u6574\u884C.",
        colspanNotConsistentForMergeEntireColumn: "\u5B58\u5728\u5217\u5BBD\u4E0D\u4E00\u81F4\u7684\u5355\u5143\u683C, \u65E0\u6CD5\u5408\u5E76\u6574\u5217.",
        rowspanNotConsistentForDeleteEntireRow: "\u5B58\u5728\u884C\u9AD8\u4E0D\u4E00\u81F4\u7684\u5355\u5143\u683C, \u4E0D\u53EF\u5220\u9664\u6574\u884C.",
        colspanNotConsistentForDeleteEntireColumn: "\u5B58\u5728\u5217\u5BBD\u4E0D\u4E00\u81F4\u7684\u5355\u5143\u683C, \u4E0D\u53EF\u5220\u9664\u6574\u5217.",
        lastColCannotBeDeleted: "\u6700\u540E\u4E00\u5217\u4E0D\u53EF\u5220\u9664.",
        lastRowCannotBeDeleted: "\u6700\u540E\u4E00\u884C\u4E0D\u53EF\u5220\u9664."
      },
      toolbar: {
        undoHint: "\u64A4\u9500",
        redoHint: "\u91CD\u505A",
        pcLayout: "PC",
        padLayout: "Pad",
        mobileLayout: "H5",
        nodeTreeHint: "\u7EC4\u4EF6\u5C42\u6B21\u7ED3\u6784\u6811",
        nodeTreeTitle: "\u7EC4\u4EF6\u5C42\u6B21\u7ED3\u6784\u6811",
        clear: "\u6E05\u7A7A",
        preview: "\u9884\u89C8",
        importJson: "\u5BFC\u5165JSON",
        exportJson: "\u5BFC\u51FAJSON",
        exportCode: "\u5BFC\u51FA\u4EE3\u7801",
        generateCode: "\u751F\u6210\u4EE3\u7801",
        generateSFC: "\u751F\u6210SFC"
      },
      setting: {
        formulaEnabled: "\u542F\u7528\u8BA1\u7B97\u516C\u5F0F",
        formula: "\u8BA1\u7B97\u516C\u5F0F",
        basicSetting: "\u57FA\u672C\u5C5E\u6027",
        attributeSetting: "\u5C5E\u6027\u8BBE\u7F6E",
        commonSetting: "\u5E38\u89C1\u5C5E\u6027",
        advancedSetting: "\u9AD8\u7EA7\u5C5E\u6027",
        eventSetting: "\u4E8B\u4EF6\u5C5E\u6027",
        uniqueName: "\u552F\u4E00\u540D\u79F0",
        editNameHelp: "\u4FEE\u6539\u540D\u79F0\u540E\u9700\u6309\u56DE\u8F66\u786E\u8BA4",
        keyNameEnabled: "\u4FEE\u6539\u6570\u636E\u5C5E\u6027\u540D\u79F0",
        keyName: "\u6570\u636E\u5C5E\u6027\u540D\u79F0",
        keyNameHelp: "\u6570\u636E\u5C5E\u6027\u540D\u79F0\u662F\u6307form-data\u5BF9\u8C61\u4E2D\u5B57\u6BB5\u7EC4\u4EF6\u6240\u5BF9\u5E94\u7684\u5C5E\u6027\u540D\u79F0",
        objectName: "\u5BF9\u8C61\u540D\u79F0",
        objectNameHelp: "\u5BF9\u8C61\u540D\u79F0\u683C\u5F0F\uFF1Aaa\u3001aa.bb\u6216aa.bb.cc",
        label: "\u6807\u7B7E",
        displayType: "\u663E\u793A\u7C7B\u578B",
        defaultValue: "\u9ED8\u8BA4\u503C",
        placeholder: "\u5360\u4F4D\u5185\u5BB9",
        startPlaceholder: "\u8D77\u59CB\u5360\u4F4D\u5185\u5BB9",
        endPlaceholder: "\u622A\u6B62\u5360\u4F4D\u5185\u5BB9",
        widgetColumnWidth: "\u7EC4\u4EF6\u5217\u5BBD",
        widgetSize: "\u7EC4\u4EF6\u5927\u5C0F",
        fontSize: "\u5B57\u4F53\u5927\u5C0F",
        textAlign: "\u6587\u5B57\u5BF9\u9F50",
        autoFullWidth: "\u81EA\u52A8\u62C9\u4F38\u5BBD\u5EA6",
        showStops: "\u663E\u793A\u95F4\u65AD\u70B9",
        displayStyle: "\u663E\u793A\u6837\u5F0F",
        inlineLayout: "\u884C\u5185",
        blockLayout: "\u5757",
        buttonStyle: "\u663E\u793A\u4E3A\u6309\u94AE",
        border: "\u5E26\u6709\u8FB9\u6846",
        labelWidth: "\u6807\u7B7E\u5BBD\u5EA6",
        rows: "\u884C\u6570",
        autosize: "\u81EA\u52A8\u9002\u5E94\u9AD8\u5EA6",
        labelHidden: "\u9690\u85CF\u5B57\u6BB5\u6807\u7B7E",
        labelWrap: "\u6807\u7B7E\u8D85\u957F\u6362\u884C",
        required: "\u5FC5\u586B\u5B57\u6BB5",
        requiredHint: "\u5FC5\u586B\u6821\u9A8C\u63D0\u793A",
        validation: "\u5B57\u6BB5\u6821\u9A8C",
        validationHelp: "\u652F\u6301\u8F93\u5165\u6B63\u5219\u8868\u8FBE\u5F0F",
        validationHint: "\u6821\u9A8C\u5931\u8D25\u63D0\u793A",
        readonly: "\u53EA\u8BFB",
        disabled: "\u7981\u7528",
        hidden: "\u9690\u85CF",
        textContent: "\u9759\u6001\u6587\u5B57",
        preWrap: "\u81EA\u52A8\u6362\u884C",
        htmlContent: "HTML",
        clearable: "\u53EF\u6E05\u9664",
        editable: "\u53EF\u8F93\u5165",
        format: "\u663E\u793A\u683C\u5F0F",
        valueFormat: "\u7ED1\u5B9A\u503C\u683C\u5F0F",
        showPassword: "\u53EF\u663E\u793A\u5BC6\u7801",
        filterable: "\u53EF\u641C\u7D22\u9009\u9879",
        allowCreate: "\u5141\u8BB8\u521B\u5EFA\u9009\u9879",
        remote: "\u53EF\u8FDC\u7A0B\u641C\u7D22",
        automaticDropdown: "\u81EA\u52A8\u5F39\u51FA\u9009\u9879",
        multiple: "\u9009\u9879\u53EF\u591A\u9009",
        multipleLimit: "\u591A\u9009\u6570\u91CF\u9650\u5236",
        collapseTags: "\u6298\u53E0\u5DF2\u9009\u9879",
        checkStrictly: "\u4EFB\u610F\u7EA7\u8282\u70B9\u53EF\u9009",
        showAllLevels: "\u663E\u793A\u5B8C\u6574\u8DEF\u5F84",
        contentPosition: "\u6587\u5B57\u4F4D\u7F6E",
        dividerDirection: "\u5206\u5272\u7EBF\u65B9\u5411",
        plain: "\u6734\u7D20\u6309\u94AE",
        round: "\u5706\u89D2\u6309\u94AE",
        circle: "\u5706\u5F62\u6309\u94AE",
        icon: "\u56FE\u6807",
        optionsSetting: "\u9009\u9879\u8BBE\u7F6E",
        optionValueType: "\u9009\u9879\u503C\u7C7B\u578B",
        addOption: "\u589E\u52A0\u9009\u9879",
        importOptions: "\u5BFC\u5165\u9009\u9879",
        resetDefault: "\u91CD\u8BBE\u9009\u4E2D\u9879",
        uploadSetting: "\u4E0A\u4F20\u53C2\u6570\u8BBE\u7F6E",
        uploadURL: "\u4E0A\u4F20\u5730\u5740",
        uploadTip: "\u4E0A\u4F20\u63D0\u793A\u5185\u5BB9",
        withCredentials: "\u53D1\u9001cookie\u51ED\u8BC1",
        multipleSelect: "\u6587\u4EF6\u53EF\u591A\u9009",
        showFileList: "\u663E\u793A\u6587\u4EF6\u5217\u8868",
        limit: "\u6700\u5927\u4E0A\u4F20\u6570\u91CF",
        fileMaxSize: "\u6587\u4EF6\u5927\u5C0F\u9650\u5236(MB)",
        fileTypes: "\u4E0A\u4F20\u6587\u4EF6\u7C7B\u578B",
        fileTypesHelp: "\u652F\u6301\u6DFB\u52A0\u5176\u4ED6\u6587\u4EF6\u7C7B\u578B",
        headers: "\u4E0A\u4F20\u8BF7\u6C42\u5934",
        cellWidth: "\u5BBD\u5EA6",
        cellHeight: "\u9AD8\u5EA6",
        wordBreak: "\u6587\u5B57\u81EA\u52A8\u6362\u884C",
        gridColHeight: "\u6805\u683C\u5217\u7EDF\u4E00\u9AD8\u5EA6(px)",
        gutter: "\u6805\u683C\u95F4\u9694(px)",
        columnSetting: "\u6805\u683C\u5C5E\u6027\u8BBE\u7F6E",
        colsOfGrid: "\u5F53\u524D\u6805\u683C\u5217:",
        colSpanTitle: "\u6805\u683C\u5BBD\u5EA6",
        colOffsetTitle: "\u5DE6\u4FA7\u95F4\u9694\u683C\u6570",
        colPushTitle: "\u53F3\u79FB\u6805\u683C\u6570",
        colPullTitle: "\u5DE6\u79FB\u6805\u683C\u6570",
        addColumn: "\u589E\u52A0\u6805\u683C",
        responsive: "\u54CD\u5E94\u5F0F\u5E03\u5C40",
        tabType: "\u6807\u7B7E\u6837\u5F0F",
        tabPosition: "\u6807\u7B7E\u4F4D\u7F6E ",
        tabPaneSetting: "\u9009\u9879\u5361\u8BBE\u7F6E",
        addTabPane: "\u589E\u52A0\u9009\u9879\u5361\u9875",
        paneActive: "\u6FC0\u6D3B",
        customLabelIcon: "\u5B9A\u5236\u5B57\u6BB5\u6807\u7B7E",
        labelIconClass: "\u6807\u7B7EIcon\u6837\u5F0F",
        labelIconPosition: "\u6807\u7B7EIcon\u4F4D\u7F6E",
        labelTooltip: "\u6807\u7B7E\u6587\u5B57\u63D0\u793A",
        minValue: "\u6700\u5C0F\u503C",
        maxValue: "\u6700\u5927\u503C",
        precision: "\u7CBE\u5EA6",
        step: "\u589E\u51CF\u6B65\u957F",
        showControls: "\u663E\u793A\u63A7\u5236\u6309\u94AE",
        controlsPosition: "\u63A7\u5236\u6309\u94AE\u4F4D\u7F6E",
        minLength: "\u6700\u5C0F\u957F\u5EA6",
        maxLength: "\u6700\u5927\u957F\u5EA6",
        showWordLimit: "\u663E\u793A\u5B57\u6570\u7EDF\u8BA1",
        prefixIcon: "\u5934\u90E8Icon",
        suffixIcon: "\u5C3E\u90E8Icon",
        inputButton: "\u8F93\u5165\u6846\u6309\u94AE\u8BBE\u7F6E",
        appendButton: "\u6DFB\u52A0\u540E\u7F6E\u6309\u94AE",
        appendButtonDisabled: "\u540E\u7F6E\u6309\u94AE\u7981\u7528",
        appendButtonIcon: "\u540E\u7F6E\u6309\u94AEIcon",
        buttonIcon: "\u6309\u94AEIcon",
        switchWidth: "\u5F00\u5173\u5BBD\u5EA6\uFF08\u50CF\u7D20\uFF09",
        activeText: "\u5F00\u542F\u65F6\u6587\u5B57\u63CF\u8FF0",
        inactiveText: "\u5173\u95ED\u65F6\u6587\u5B57\u63CF\u8FF0",
        activeColor: "\u5F00\u542F\u65F6\u80CC\u666F\u8272",
        inactiveColor: "\u5173\u95ED\u65F6\u80CC\u666F\u8272",
        maxStars: "\u6700\u5927\u8BC4\u5206\u503C",
        lowThreshold: "\u4F4E\u5206\u754C\u9650\u503C",
        highThreshold: "\u9AD8\u5206\u754C\u9650\u503C",
        allowHalf: "\u5141\u8BB8\u534A\u9009",
        showText: "\u663E\u793A\u8F85\u52A9\u6587\u5B57",
        showScore: "\u663E\u793A\u5F53\u524D\u5206\u6570",
        range: "\u662F\u5426\u4E3A\u8303\u56F4\u9009\u62E9",
        vertical: "\u662F\u5426\u7AD6\u5411\u663E\u793A",
        showBlankRow: "\u9ED8\u8BA4\u663E\u793A\u65B0\u884C",
        showRowNumber: "\u663E\u793A\u884C\u53F7",
        actionColumnPosition: "\u64CD\u4F5C\u5217\u4F4D\u7F6E",
        contentHeight: "\u5185\u5BB9\u533A\u9AD8\u5EA6",
        groupButtonsEdit: "\u6309\u94AE\u7F16\u8F91",
        insertColumnToLeft: "\u63D2\u5165\u5DE6\u4FA7\u5217",
        insertColumnToRight: "\u63D2\u5165\u53F3\u4FA7\u5217",
        insertRowAbove: "\u63D2\u5165\u4E0A\u65B9\u884C",
        insertRowBelow: "\u63D2\u5165\u4E0B\u65B9\u884C",
        mergeLeftColumn: "\u5408\u5E76\u5DE6\u4FA7\u5355\u5143\u683C",
        mergeRightColumn: "\u5408\u5E76\u53F3\u4FA7\u5355\u5143\u683C",
        mergeEntireRow: "\u5408\u5E76\u6574\u884C",
        mergeRowAbove: "\u5408\u5E76\u4E0A\u65B9\u5355\u5143\u683C",
        mergeRowBelow: "\u5408\u5E76\u4E0B\u65B9\u5355\u5143\u683C",
        mergeEntireColumn: "\u5408\u5E76\u6574\u5217",
        undoMergeCol: "\u64A4\u9500\u5217\u5408\u5E76",
        undoMergeRow: "\u64A4\u9500\u884C\u5408\u5E76",
        deleteEntireCol: "\u5220\u9664\u6574\u5217",
        deleteEntireRow: "\u5220\u9664\u6574\u884C",
        widgetName: "\u7EC4\u4EF6\u552F\u4E00\u540D\u79F0",
        formSize: "\u5168\u5C40\u7EC4\u4EF6\u5927\u5C0F",
        labelPosition: "\u5B57\u6BB5\u6807\u7B7E\u4F4D\u7F6E",
        topPosition: "\u9876\u90E8",
        leftPosition: "\u5DE6\u8FB9",
        labelAlign: "\u5B57\u6BB5\u6807\u7B7E\u5BF9\u9F50",
        leftAlign: "\u5C45\u5DE6",
        centerAlign: "\u5C45\u4E2D",
        rightAlign: "\u5C45\u53F3",
        formCss: "\u8868\u5355\u5168\u5C40CSS",
        addCss: "\u7F16\u5199CSS",
        customClass: "\u81EA\u5B9A\u4E49CSS\u6837\u5F0F",
        globalFunctions: "\u8868\u5355\u5168\u5C40\u51FD\u6570",
        addEventHandler: "\u7F16\u5199\u4EE3\u7801",
        editWidgetEventHandler: "\u7EC4\u4EF6\u4E8B\u4EF6\u5904\u7406",
        editFormEventHandler: "\u8868\u5355\u4E8B\u4EF6\u5904\u7406",
        formSFCSetting: "\u751F\u6210SFC\u8BBE\u7F6E",
        formModelName: "\u6570\u636E\u5BF9\u8C61\u540D\u79F0",
        formRefName: "\u5F15\u7528\u540D\u79F0",
        formRulesName: "\u9A8C\u8BC1\u89C4\u5219\u540D\u79F0",
        syntaxCheckWarning: "JS\u4EE3\u7801\u5B58\u5728\u8BED\u6CD5\u9519\u8BEF\uFF0C\u8BF7\u4ED4\u7EC6\u68C0\u67E5\uFF01",
        title: "\u6807\u9898",
        dialogWidth: "\u5F39\u7A97\u5BBD\u5EA6\uFF08px/%\uFF09",
        fullscreen: "\u5168\u5C4F\u663E\u793A\u5F39\u7A97",
        showModal: "\u663E\u793A\u906E\u7F69\u5C42",
        showClose: "\u663E\u793A\u5173\u95ED\u6309\u94AE",
        closeOnClickModal: "\u70B9\u51FB\u906E\u7F69\u5C42\u5173\u95ED",
        closeOnPressEscape: "\u6309Esc\u952E\u5173\u95ED",
        center: "\u5934\u90E8\u5E95\u90E8\u5C45\u4E2D",
        readMode: "\u5F39\u7A97\u8868\u5355\u53EA\u8BFB",
        disabledMode: "\u5F39\u7A97\u8868\u5355\u7981\u7528",
        okButtonLabel: "\u786E\u8BA4\u6309\u94AE\u6587\u5B57",
        okButtonHidden: "\u9690\u85CF\u786E\u8BA4\u6309\u94AE",
        cancelButtonLabel: "\u53D6\u6D88\u6309\u94AE\u6587\u5B57",
        cancelButtonHidden: "\u9690\u85CF\u53D6\u6D88\u6309\u94AE",
        drawSize: "\u62BD\u5C49\u5927\u5C0F\uFF08px/%\uFF09",
        drawDirection: "\u62BD\u5C49\u6ED1\u51FA\u65B9\u5411",
        tableWidth: "\u5BBD\u5EA6(px/%)",
        tableHeight: "\u9AD8\u5EA6(px/%)",
        showCheckBox: "\u662F\u5426\u663E\u793A\u590D\u9009\u6846\u5217",
        showIndex: "\u662F\u5426\u663E\u793A\u884C\u53F7",
        showPagination: "\u662F\u5426\u663E\u793A\u5206\u9875",
        smallPagination: "\u5C0F\u578B\u5206\u9875",
        paginationAlign: "\u5206\u9875\u6C34\u5E73\u5BF9\u9F50",
        autoColumnWidthDisabled: "\u7981\u7528\u5217\u5BBD\u81EA\u52A8\u5145\u6EE1",
        tableColEdit: "\u8868\u683C\u5217\u7F16\u8F91",
        tableDataEdit: "\u8868\u683C\u6570\u636E\u7F16\u8F91",
        showSummary: "\u662F\u5426\u5408\u8BA1",
        stripe: "\u662F\u5426\u6591\u9A6C\u7EBF",
        rowSpacing: "\u884C\u8DDD\uFF08px\uFF09",
        editAction: "\u7F16\u8F91...",
        columnName: "\u5B57\u6BB5\u540D\u79F0",
        columnLabel: "\u663E\u793A\u540D\u79F0",
        columnWidth: "\u5217\u5BBD(px)",
        visibleColumn: "\u662F\u5426\u663E\u793A",
        sortableColumn: "\u662F\u5426\u6392\u5E8F",
        customSortColumn: "\u540E\u7AEF\u6392\u5E8F",
        fixedColumn: "\u662F\u5426\u56FA\u5B9A",
        alignTypeOfColumn: "\u5BF9\u9F50\u65B9\u5F0F",
        formatOfColumn: "\u683C\u5F0F\u5316",
        customRenderGroup: "\u52A8\u6001\u6E32\u67D3",
        renderFunction: "\u6E32\u67D3\u51FD\u6570",
        actionColumn: "\u64CD\u4F5C",
        addTableColumn: "\u589E\u52A0\u5217",
        deleteTableColumn: "\u5220\u9664\u5217",
        onlyOneColumnCannotBeDeleted: "\u8868\u683C\u53EA\u6709\u4E00\u5217\u65F6\u4E0D\u53EF\u5220\u9664.",
        treeDataEnabled: "\u5141\u8BB8\u52A0\u8F7D\u6811\u5F62\u6570\u636E",
        rowKeyOfTreeData: "\u884C\u6570\u636EKey",
        childrenKeyOfTreeData: "\u6811\u5F62\u6570\u636E\u5B50\u8282\u70B9\u952E",
        showButtonsColumn: "\u663E\u793A\u64CD\u4F5C\u6309\u94AE\u5217",
        buttonsColumnEdit: "\u64CD\u4F5C\u6309\u94AE\u7F16\u8F91",
        buttonsColumnTitle: "\u5217\u6807\u9898",
        buttonsColumnWidth: "\u5217\u5BBD\u5EA6\uFF08px\uFF09",
        operationButtonsSetting: "\u64CD\u4F5C\u6309\u94AE\u8BBE\u7F6E",
        operationButtonName: "\u540D\u79F0",
        operationButtonLabel: "\u6587\u5B57",
        operationButtonType: "\u7C7B\u578B",
        operationButtonSize: "\u5927\u5C0F",
        operationButtonRound: "\u5706\u89D2",
        operationButtonHidden: "\u9690\u85CF",
        operationButtonDisabled: "\u7981\u7528",
        addOperationButton: "\u589E\u52A0\u6309\u94AE",
        deleteOperationButtonHint: "\u786E\u5B9A\u5220\u9664\u8BE5\u6309\u94AE\uFF1F",
        operationButtonDuplicatedNameError: "\u6309\u94AE\u540D\u79F0\u4E0D\u53EF\u91CD\u590D",
        tableHeader: "\u8868\u5934",
        insertTableHeader: "\u63D2\u5165\u8868\u5934",
        insertTableSubHeader: "\u63D2\u5165\u4E0B\u7EA7\u8868\u5934",
        tableDataColumn: "\u6570\u636E\u5217",
        insertTableDataColumn: "\u63D2\u5165\u6570\u636E\u5217",
        insertTableSubDataColumn: "\u63D2\u5165\u4E0B\u7EA7\u6570\u636E\u5217",
        onlyDragBetweenSiblingNodes: "\u53EA\u80FD\u5728\u540C\u7EA7\u8282\u70B9\u4E4B\u95F4\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F\uFF01",
        getHeaderLevelTitle: function(level) {
          return level + "\u7EA7\u8868\u5934";
        },
        lineNumber: "\u5E8F\u53F7",
        dsEnabled: "\u4F7F\u7528\u6570\u636E\u6E90",
        dsName: "\u6307\u5B9A\u6570\u636E\u6E90",
        dataSetName: "\u6307\u5B9A\u6570\u636E\u96C6",
        labelKeyName: "\u9009\u9879\u6807\u7B7E\u540D",
        valueKeyName: "\u9009\u9879\u503C\u540D",
        childrenKeyName: "\u5B50\u8282\u70B9\u5C5E\u6027\u540D\u79F0",
        dataSource: "\u6570\u636E\u6E90",
        noDataSource: "\u6682\u65E0\u6570\u636E\u6E90",
        addDataSource: "\u65B0\u589E\u6570\u636E\u6E90",
        importDataSource: "\u5BFC\u5165\u6570\u636E\u6E90",
        clearExistingDataSource: "\u5BFC\u5165\u540E\u6E05\u7A7A\u539F\u6709\u6570\u636E\u6E90",
        remainExistingDataSource: "\u8FFD\u52A0\u5230\u5DF2\u6709\u6570\u636E\u6E90\u4E4B\u540E",
        exportDataSource: "\u5BFC\u51FA\u6570\u636E\u6E90",
        selectDataSourceForExport: "\u9009\u62E9\u5BFC\u51FA\u6570\u636E\u6E90",
        dataSourceChecked: "\u9009\u4E2D\u5BFC\u51FA",
        previewDataSourceExportResult: "\u5BFC\u51FA\u7ED3\u679C\u9884\u89C8",
        dataSourceSetting: "\u6570\u636E\u6E90\u8BBE\u7F6E",
        deleteDataSourceHint: "\u786E\u8BA4\u5220\u9664\u8BE5\u6570\u636E\u6E90\uFF1F",
        fieldValueRequired: "\u8F93\u5165\u5185\u5BB9\u4E0D\u53EF\u4E3A\u7A7A",
        dsUniqueName: "\u552F\u4E00\u540D\u79F0",
        dsRequestURL: "\u8BF7\u6C42\u5730\u5740",
        dsRequestURLType: "\u8BF7\u6C42URL\u7C7B\u578B",
        dsURLStringType: "\u56FA\u5B9A\u5B57\u7B26\u4E32",
        dsURLVariableType: "\u53D8\u91CF\u6216\u8868\u8FBE\u5F0F",
        dsDescription: "\u63CF\u8FF0\u4FE1\u606F",
        dsRequestMethod: "\u8BF7\u6C42\u65B9\u6CD5",
        dsRequestHeaders: "\u8BF7\u6C42\u5934\uFF08headers\uFF09",
        addRequestHeader: "\u65B0\u589E\u8BF7\u6C42\u5934",
        dsRequestParams: "\u53C2\u6570\uFF08params\uFF09",
        addRequestParam: "\u65B0\u589E\u8BF7\u6C42\u53C2\u6570",
        dsRequestData: "\u53D1\u9001\u6570\u636E\uFF08data\uFF09",
        addRequestData: "\u65B0\u589E\u53D1\u9001\u6570\u636E",
        addDataSet: "\u65B0\u589E\u6570\u636E\u96C6",
        dsRequestValueStringType: "\u5B57\u7B26\u4E32\u7C7B\u578B",
        dsRequestValueNumberType: "\u6570\u503C\u7C7B\u578B",
        dsRequestValueBooleanType: "\u5E03\u5C14\u7C7B\u578B",
        dsRequestValueVariableType: "\u53D8\u91CF\u6216\u8868\u8FBE\u5F0F",
        dsRequestNameInputPlaceholder: "\u540D\u79F0",
        dsRequestTypeInputPlaceholder: "\u7C7B\u578B",
        dsRequestValueInputPlaceholder: "\u503C",
        dataSetRemarkInputPlaceholder: "\u5907\u6CE8\u8BF4\u660E",
        dsConfigHandlerTitle: "1. \u8BF7\u6C42\u914D\u7F6E",
        dsDataHandlerTitle: "2. \u6570\u636E\u5904\u7406",
        dsErrorHandlerTitle: "3. \u9519\u8BEF\u5904\u7406",
        dataSetSettingTitle: "4. \u591A\u6570\u636E\u96C6\u914D\u7F6E",
        dataSetEnabled: "\u5F00\u542F\u591A\u6570\u636E\u96C6\u8FD4\u56DE",
        dataSetSetting: "\u8FD4\u56DE\u6570\u636E\u96C6\u7BA1\u7406",
        testDataSource: "\u6D4B\u8BD5\u6570\u636E\u6E90",
        dsvTitle: "DSV\u6570\u636E\u6E90\u53D8\u91CF",
        dsRequestResult: "\u8FD4\u56DE\u6570\u636E",
        executeDataSource: "\u7ACB\u5373\u6267\u884C",
        clearRequestResult: "\u6E05\u7A7A\u7ED3\u679C",
        dsRequestNumberTypeError: "\u6570\u636E\u7C7B\u578B\u503C\u9519\u8BEF",
        dsRequestBooleanTypeError: "\u5E03\u5C14\u7C7B\u578B\u503C\u9519\u8BEF",
        dsValidationError: "\u6570\u636E\u6E90\u8BBE\u7F6E\u5B58\u5728\u9519\u8BEF\uFF0C\u8BF7\u4FEE\u6539",
        dsDuplicatedNameError: "\u6570\u636E\u6E90\u540D\u79F0\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\uFF01",
        showTreeCheckBox: "\u663E\u793A\u590D\u9009\u6846",
        lazy: "\u61D2\u52A0\u8F7D",
        treeDataEdit: "\u6811\u6570\u636E\u7F16\u8F91",
        defaultExpandAllNode: "\u9ED8\u8BA4\u5C55\u5F00\u6240\u6709\u8282\u70B9",
        expandRetractAllNode: "\u5C55\u5F00/\u6536\u7F29",
        selectClearAllNode: "\u9009\u4E2D/\u53D6\u6D88\u9009\u4E2D",
        nodeEdit: "\u5141\u8BB8\u6DFB\u52A0\u5220\u9664\u8282\u70B9",
        expandAllNode: "\u5C55\u5F00\u6240\u6709",
        retractAllNode: "\u6536\u7F29\u6240\u6709",
        selectAllNode: "\u9009\u62E9\u6240\u6709",
        clearAllNode: "\u6E05\u9664\u6240\u6709",
        draggable: "\u5141\u8BB8\u62D6\u62FD\u8282\u70B9",
        filter: "\u663E\u793A\u8FC7\u6EE4\u6846",
        expandOnClickNode: "\u70B9\u51FB\u8282\u70B9\u53EF\u6536\u7F29",
        treeNodeCheckStrictly: "\u7981\u6B62\u7236\u5B50\u8282\u70B9\u8054\u52A8",
        inputNodeName: "\u8BF7\u8F93\u5165\u8282\u70B9\u540D",
        deleteNode: "\u786E\u5B9A\u5220\u9664\u8282\u70B9?",
        nodeDeleted: "\u8282\u70B9\u5DF2\u5220\u9664",
        tips: "\u63D0\u793A",
        onNodeCheckRemark: "\u6811\u8282\u70B9\u9009\u62E9\u4E8B\u4EF6",
        onNodeClickRemark: "\u6811\u8282\u70B9\u70B9\u51FB\u4E8B\u4EF6",
        onNodeContextmenuRemark: "\u6811\u8282\u70B9\u53F3\u51FB\u4E8B\u4EF6",
        enterForQuery: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
        add: "\u6DFB\u52A0",
        delete: "\u5220\u9664"
      }
    }
  };
  var enLocale_render = {
    render: {
      hint: {
        prompt: "Prompt",
        confirm: "OK",
        cancel: "Cancel",
        defaultActiveText: "True",
        defaultInactiveText: "False",
        selectPlaceholder: "Pick some item",
        timePlaceholder: "Select time",
        startTimePlaceholder: "Start time",
        endTimePlaceholder: "End time",
        datePlaceholder: "Select date",
        startDatePlaceholder: "Start date",
        endDatePlaceholder: "End date",
        blankCellContent: "--",
        uploadError: "Upload error: ",
        uploadExceed: "The maximum number(${uploadLimit}) of file uploads has been exceeded.",
        unsupportedFileType: "Unsupported format: ",
        fileSizeExceed: "File size out of limit: ",
        refNotFound: "Ref not found: ",
        fieldRequired: "Input value should be not null.",
        invalidNumber: "Invalid number format",
        selectFile: " File...",
        downloadFile: "Download",
        removeFile: "Remove",
        validationFailed: "Form validation failed",
        subFormAction: "Action",
        subFormAddAction: "Add",
        subFormRowNo: "#",
        subFormAddActionHint: "add new row",
        insertSubFormRow: "insert new row",
        deleteSubFormRow: "delete this row",
        nonSubFormType: "The type of widget don't match sub-form"
      }
    }
  };
  var zhLocale_render = {
    render: {
      hint: {
        prompt: "\u63D0\u793A",
        confirm: "\u786E\u5B9A",
        cancel: "\u53D6\u6D88",
        defaultActiveText: "\u662F",
        defaultInactiveText: "\u5426",
        selectPlaceholder: "\u8BF7\u9009\u62E9",
        timePlaceholder: "\u9009\u62E9\u65F6\u95F4",
        startTimePlaceholder: "\u8D77\u59CB\u65F6\u95F4",
        endTimePlaceholder: "\u622A\u6B62\u65F6\u95F4",
        datePlaceholder: "\u9009\u62E9\u65E5\u671F",
        startDatePlaceholder: "\u8D77\u59CB\u65E5\u671F",
        endDatePlaceholder: "\u622A\u6B62\u65E5\u671F",
        blankCellContent: "--",
        uploadError: "\u4E0A\u4F20\u9519\u8BEF: ",
        uploadExceed: "\u6700\u5927\u4E0A\u4F20\u6570\u91CF(${uploadLimit})\u5DF2\u8D85\u51FA.",
        unsupportedFileType: "\u4E0D\u652F\u6301\u683C\u5F0F: ",
        fileSizeExceed: "\u6587\u4EF6\u5927\u5C0F\u5DF2\u8D85\u51FA: ",
        refNotFound: "\u7EC4\u4EF6\u672A\u627E\u5230: ",
        fieldRequired: "\u5B57\u6BB5\u503C\u4E0D\u53EF\u4E3A\u7A7A",
        invalidNumber: "\u6570\u636E\u683C\u5F0F\u9519\u8BEF",
        selectFile: " \u9009\u62E9\u6587\u4EF6",
        downloadFile: "\u4E0B\u8F7D",
        removeFile: "\u79FB\u9664",
        validationFailed: "\u8868\u5355\u6570\u636E\u6821\u9A8C\u5931\u8D25",
        subFormAction: "\u64CD\u4F5C",
        subFormAddAction: "\u65B0\u589E",
        subFormRowNo: "\u884C\u53F7",
        subFormAddActionHint: "\u65B0\u589E\u884C",
        insertSubFormRow: "\u63D2\u5165\u884C",
        deleteSubFormRow: "\u5220\u9664\u884C",
        nonSubFormType: "\u7EC4\u4EF6\u7C7B\u578B\u4E0D\u662F\u5B50\u8868\u5355"
      }
    }
  };
  var enLocale_extension = {
    extension: {
      widgetLabel: {
        card: "Card",
        alert: "Alert"
      },
      setting: {
        headerHidden: "Header Hidden",
        cardFolded: "Folded",
        cardShowFold: "Show Fold",
        cardWidth: "Width Of Card",
        cardShadow: "Shadow",
        alertTitle: "Title",
        alertType: "Type",
        description: "Description",
        closable: "Closable",
        closeText: "Text On Close Btn",
        center: "Center",
        showIcon: "Show Icon",
        effect: "Effect"
      }
    }
  };
  var zhLocale_extension = {
    extension: {
      widgetLabel: {
        card: "\u5361\u7247",
        alert: "\u63D0\u793A"
      },
      setting: {
        headerHidden: "\u9690\u85CF\u6807\u9898\u533A",
        cardFolded: "\u662F\u5426\u6536\u8D77",
        cardShowFold: "\u663E\u793A\u6298\u53E0\u6309\u94AE",
        cardWidth: "\u5361\u7247\u5BBD\u5EA6",
        cardShadow: "\u663E\u793A\u9634\u5F71",
        alertTitle: "\u6807\u9898",
        alertType: "\u7C7B\u578B",
        description: "\u8F85\u52A9\u6027\u6587\u5B57",
        closable: "\u662F\u5426\u53EF\u5173\u95ED",
        closeText: "\u5173\u95ED\u6309\u94AE\u6587\u5B57",
        center: "\u6587\u5B57\u5C45\u4E2D",
        showIcon: "\u663E\u793A\u56FE\u6807",
        effect: "\u663E\u793A\u6548\u679C"
      }
    }
  };
  const langResources = {
    "en-US": __spreadValues(__spreadValues(__spreadValues({
      something: {}
    }, enLocale), enLocale_render), enLocale_extension),
    "zh-CN": __spreadValues(__spreadValues(__spreadValues({
      something: {}
    }, zhLocale), zhLocale_render), zhLocale_extension)
  };
  const i18n = createI18n({
    locale: localStorage.getItem("v_form_locale") || "zh-CN",
    messages: langResources
  });
  const changeLocale = function(langName) {
    i18n.setLang(langName);
    localStorage.setItem("v_form_locale", langName);
  };
  const getLocale = function() {
    return localStorage.getItem("v_form_locale");
  };
  const translate = function(key) {
    return i18n.$st(key);
  };
  const addZHExtensionLang = (zhLang) => {
    if (!!zhLang.extension && !!zhLang.extension.widgetLabel) {
      overwriteObj(zhLocale_extension.extension.widgetLabel, zhLang.extension.widgetLabel);
    }
    if (!!zhLang.extension && !!zhLang.extension.setting) {
      overwriteObj(zhLocale_extension.extension.setting, zhLang.extension.setting);
    }
  };
  const addENExtensionLang = (enLang) => {
    if (!!enLang.extension && !!enLang.extension.widgetLabel) {
      overwriteObj(enLocale_extension.extension.widgetLabel, enLang.extension.widgetLabel);
    }
    if (!!enLang.extension && !!enLang.extension.setting) {
      overwriteObj(enLocale_extension.extension.setting, enLang.extension.setting);
    }
  };
  var i18n$1 = {
    methods: {
      i18nt(key) {
        return i18n.$st(key);
      },
      i18ntp(key, params) {
        return i18n.$st(key, params);
      },
      i18n2t(key1, key2) {
        return i18n.$st2(key1, key2);
      }
    }
  };
  function isNull(value2) {
    return value2 === null || value2 === void 0;
  }
  function isNotNull(value2) {
    return value2 !== null && value2 !== void 0;
  }
  function isEmptyStr(str) {
    return str === void 0 || !str && str !== 0 && str !== "0" || !/[^\s]/.test(str);
  }
  const generateId = function() {
    return Math.floor(Math.random() * 1e5 + Math.random() * 2e4 + Math.random() * 5e3);
  };
  const deepClone = function(origin) {
    if (origin === void 0) {
      return void 0;
    }
    return JSON.parse(JSON.stringify(origin));
  };
  const overwriteObj = function(obj1, obj2) {
    Object.keys(obj2).forEach((prop) => {
      obj1[prop] = obj2[prop];
    });
  };
  const evalFn = function(fn, DSV = null, VFR = null, formulaJs = null) {
    let f = new Function("DSV", "VFR", "LS", "formulaJs", "return " + fn);
    return f(DSV, VFR, localStorage, formulaJs);
  };
  const trimEx = function(str, char, type) {
    if (char) {
      if (type === "left") {
        return str.replace(new RegExp("^\\" + char + "+", "g"), "");
      } else if (type === "right") {
        return str.replace(new RegExp("\\" + char + "+$", "g"), "");
      }
      return str.replace(new RegExp("^\\" + char + "+|\\" + char + "+$", "g"), "");
    }
    return str.replace(/^\s+|\s+$/g, "");
  };
  const hasPropertyOfObject = function(obj, propPath) {
    const keys2 = propPath.split(".");
    let tmpObj = obj;
    let result = true;
    for (const key of keys2) {
      if (!tmpObj.hasOwnProperty(key)) {
        result = false;
        break;
      } else {
        tmpObj = tmpObj[key];
      }
    }
    return result;
  };
  function isDef(value2) {
    return value2 !== void 0 && value2 !== null;
  }
  const getObjectValue = function(obj, propPath) {
    const keys2 = propPath.split(".");
    let result = obj;
    keys2.forEach((key) => {
      result = isDef(result) && isDef(result[key]) ? result[key] : null;
    });
    return result;
  };
  const setObjectValue = function(obj, objectName, value2) {
    const objectChains = objectName.split(".");
    let objectModel = obj;
    objectChains.forEach((key, idx) => {
      if (!key)
        return;
      if (idx === objectChains.length - 1) {
        objectModel[key] = value2;
        return;
      }
      if (objectModel[key] === void 0) {
        objectModel[key] = {};
      }
      objectModel = objectModel[key];
    });
  };
  const addWindowResizeHandler = function(handler) {
    let oldHandler = window.onresize;
    if (typeof window.onresize != "function") {
      window.onresize = handler;
    } else {
      window.onresize = function() {
        oldHandler();
        handler();
      };
    }
  };
  const insertCustomCssToHead = function(cssCode, formId = "") {
    const head = document.getElementsByTagName("head")[0];
    let oldStyle = document.getElementById("vform-custom-css");
    if (!!oldStyle) {
      head.removeChild(oldStyle);
    }
    if (!!formId) {
      oldStyle = document.getElementById("vform-custom-css-" + formId);
      !!oldStyle && head.removeChild(oldStyle);
    }
    let newStyle = document.createElement("style");
    newStyle.type = "text/css";
    newStyle.rel = "stylesheet";
    newStyle.id = !!formId ? "vform-custom-css-" + formId : "vform-custom-css";
    try {
      newStyle.appendChild(document.createTextNode(cssCode));
    } catch (ex) {
      newStyle.styleSheet.cssText = cssCode;
    }
    head.appendChild(newStyle);
  };
  const insertGlobalFunctionsToHtml = function(functionsCode, formId = "") {
    const bodyEle = document.getElementsByTagName("body")[0];
    let oldScriptEle = document.getElementById("v_form_global_functions");
    !!oldScriptEle && bodyEle.removeChild(oldScriptEle);
    if (!!formId) {
      oldScriptEle = document.getElementById("v_form_global_functions-" + formId);
      !!oldScriptEle && bodyEle.removeChild(oldScriptEle);
    }
    let newScriptEle = document.createElement("script");
    newScriptEle.id = !!formId ? "v_form_global_functions-" + formId : "v_form_global_functions";
    newScriptEle.type = "text/javascript";
    newScriptEle.innerHTML = functionsCode;
    bodyEle.appendChild(newScriptEle);
  };
  const deleteCustomStyleAndScriptNode = function(previewState, formId) {
    const head = document.getElementsByTagName("head")[0];
    let oldStyle = document.getElementById("vform-custom-css-" + formId);
    if (previewState) {
      oldStyle = document.getElementById("vform-custom-css");
    }
    if (!!oldStyle) {
      head.removeChild(oldStyle);
    }
    const bodyEle = document.getElementsByTagName("body")[0];
    let oldScriptEle = document.getElementById("v_form_global_functions-" + formId);
    if (previewState) {
      oldScriptEle = document.getElementById("v_form_global_functions");
    }
    if (!!oldScriptEle) {
      bodyEle.removeChild(oldScriptEle);
    }
  };
  const optionExists = function(optionsObj, optionName) {
    if (!optionsObj) {
      return false;
    }
    return Object.keys(optionsObj).indexOf(optionName) > -1;
  };
  const loadRemoteScript = function(srcPath, callback) {
    let sid = encodeURIComponent(srcPath);
    let oldScriptEle = document.getElementById(sid);
    if (!oldScriptEle) {
      let s = document.createElement("script");
      s.src = srcPath;
      s.id = sid;
      document.body.appendChild(s);
      s.onload = s.onreadystatechange = function(_, isAbort) {
        if (isAbort || !s.readyState || s.readyState === "loaded" || s.readyState === "complete") {
          s = s.onload = s.onreadystatechange = null;
          if (!isAbort) {
            callback();
          }
        }
      };
    }
  };
  function traverseFieldWidgets(widgetList2, handler, parent = null, staticWidgetsIncluded = false) {
    if (!widgetList2) {
      return;
    }
    widgetList2.map((w) => {
      if (w.formItemFlag || w.formItemFlag === false && staticWidgetsIncluded) {
        handler(w, parent);
      } else if (w.type === "grid") {
        w.cols.map((col) => {
          traverseFieldWidgets(col.widgetList, handler, w, staticWidgetsIncluded);
        });
      } else if (w.type === "table") {
        w.rows.map((row) => {
          row.cols.map((cell) => {
            traverseFieldWidgets(cell.widgetList, handler, w, staticWidgetsIncluded);
          });
        });
      } else if (w.type === "tab") {
        w.tabs.map((tab) => {
          traverseFieldWidgets(tab.widgetList, handler, w, staticWidgetsIncluded);
        });
      } else if (w.type === "sub-form" || w.type === "grid-sub-form") {
        traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);
      } else if (w.category === "container") {
        traverseFieldWidgets(w.widgetList, handler, w, staticWidgetsIncluded);
      }
    });
  }
  function traverseContainerWidgets(widgetList2, handler) {
    if (!widgetList2) {
      return;
    }
    widgetList2.map((w) => {
      if (w.category === "container") {
        handler(w);
      }
      if (w.type === "grid") {
        w.cols.map((col) => {
          traverseContainerWidgets(col.widgetList, handler);
        });
      } else if (w.type === "table") {
        w.rows.map((row) => {
          row.cols.map((cell) => {
            traverseContainerWidgets(cell.widgetList, handler);
          });
        });
      } else if (w.type === "tab") {
        w.tabs.map((tab) => {
          traverseContainerWidgets(tab.widgetList, handler);
        });
      } else if (w.type === "sub-form" || w.type === "grid-sub-form") {
        traverseContainerWidgets(w.widgetList, handler);
      } else if (w.category === "container") {
        traverseContainerWidgets(w.widgetList, handler);
      }
    });
  }
  function traverseAllWidgets(widgetList2, handler) {
    if (!widgetList2) {
      return;
    }
    widgetList2.map((w) => {
      handler(w);
      if (w.type === "grid") {
        w.cols.map((col) => {
          handler(col);
          traverseAllWidgets(col.widgetList, handler);
        });
      } else if (w.type === "table") {
        w.rows.map((row) => {
          row.cols.map((cell) => {
            handler(cell);
            traverseAllWidgets(cell.widgetList, handler);
          });
        });
      } else if (w.type === "tab") {
        w.tabs.map((tab) => {
          traverseAllWidgets(tab.widgetList, handler);
        });
      } else if (w.type === "sub-form" || w.type === "grid-sub-form") {
        traverseAllWidgets(w.widgetList, handler);
      } else if (w.category === "container") {
        traverseAllWidgets(w.widgetList, handler);
      }
    });
  }
  function handleWidgetForTraverse(widget, handler) {
    if (!!widget.category && widget.category === "container") {
      traverseFieldWidgetsOfContainer(widget, handler);
    } else if (widget.formItemFlag) {
      handler(widget);
    }
  }
  function traverseFieldWidgetsOfContainer(con, handler) {
    if (con.type === "grid") {
      con.cols.forEach((col) => {
        col.widgetList.forEach((cw) => {
          handleWidgetForTraverse(cw, handler);
        });
      });
    } else if (con.type === "table") {
      con.rows.forEach((row) => {
        row.cols.forEach((cell) => {
          cell.widgetList.forEach((cw) => {
            handleWidgetForTraverse(cw, handler);
          });
        });
      });
    } else if (con.type === "tab") {
      con.tabs.forEach((tab) => {
        tab.widgetList.forEach((cw) => {
          handleWidgetForTraverse(cw, handler);
        });
      });
    } else if (con.type === "sub-form" || con.type === "grid-sub-form") {
      con.widgetList.forEach((cw) => {
        handleWidgetForTraverse(cw, handler);
      });
    } else if (con.category === "container") {
      con.widgetList.forEach((cw) => {
        handleWidgetForTraverse(cw, handler);
      });
    }
  }
  function handleContainerTraverse(widget, fieldHandler, containerHandler) {
    if (!!widget.category && widget.category === "container") {
      traverseWidgetsOfContainer(widget, fieldHandler, containerHandler);
    } else if (widget.formItemFlag) {
      fieldHandler(widget);
    }
  }
  function traverseWidgetsOfContainer(con, fieldHandler, containerHandler) {
    if (con.category === "container") {
      containerHandler(con);
    }
    if (con.type === "grid") {
      con.cols.forEach((col) => {
        col.widgetList.forEach((cw) => {
          handleContainerTraverse(cw, fieldHandler, containerHandler);
        });
      });
    } else if (con.type === "table") {
      con.rows.forEach((row) => {
        row.cols.forEach((cell) => {
          cell.widgetList.forEach((cw) => {
            handleContainerTraverse(cw, fieldHandler, containerHandler);
          });
        });
      });
    } else if (con.type === "tab") {
      con.tabs.forEach((tab) => {
        tab.widgetList.forEach((cw) => {
          handleContainerTraverse(cw, fieldHandler, containerHandler);
        });
      });
    } else if (con.type === "sub-form" || con.type === "grid-sub-form") {
      con.widgetList.forEach((cw) => {
        handleContainerTraverse(cw, fieldHandler, containerHandler);
      });
    } else if (con.category === "container") {
      con.widgetList.forEach((cw) => {
        handleContainerTraverse(cw, fieldHandler, containerHandler);
      });
    }
  }
  function getAllFieldWidgets(widgetList2, staticWidgetsIncluded = false) {
    if (!widgetList2) {
      return [];
    }
    let result = [];
    let handlerFn = (w) => {
      result.push({
        type: w.type,
        name: w.options.name,
        field: w
      });
    };
    traverseFieldWidgets(widgetList2, handlerFn, null, staticWidgetsIncluded);
    return result;
  }
  function getAllContainerWidgets(widgetList2) {
    if (!widgetList2) {
      return [];
    }
    let result = [];
    let handlerFn = (w) => {
      result.push({
        type: w.type,
        name: w.options.name,
        container: w
      });
    };
    traverseContainerWidgets(widgetList2, handlerFn);
    return result;
  }
  function getFieldWidgetByName(widgetList2, fieldName, staticWidgetsIncluded) {
    if (!widgetList2) {
      return null;
    }
    let foundWidget = null;
    let handlerFn = (widget) => {
      if (widget.options.name === fieldName) {
        foundWidget = widget;
      }
    };
    traverseFieldWidgets(widgetList2, handlerFn, null, staticWidgetsIncluded);
    return foundWidget;
  }
  function getFieldWidgetById(widgetList2, fieldId, staticWidgetsIncluded) {
    if (!widgetList2) {
      return null;
    }
    let foundWidget = null;
    let handlerFn = (widget) => {
      if (widget.id === fieldId) {
        foundWidget = widget;
      }
    };
    traverseFieldWidgets(widgetList2, handlerFn, null, staticWidgetsIncluded);
    return foundWidget;
  }
  function getContainerWidgetByName(widgetList2, containerName) {
    if (!widgetList2) {
      return null;
    }
    let foundContainer = null;
    let handlerFn = (con) => {
      if (con.options.name === containerName) {
        foundContainer = con;
      }
    };
    traverseContainerWidgets(widgetList2, handlerFn);
    return foundContainer;
  }
  function getContainerWidgetById(widgetList2, containerId) {
    if (!widgetList2) {
      return null;
    }
    let foundContainer = null;
    let handlerFn = (con) => {
      if (con.id === containerId) {
        foundContainer = con;
      }
    };
    traverseContainerWidgets(widgetList2, handlerFn);
    return foundContainer;
  }
  function copyToClipboard(content2, clickEvent, $message, successMsg, errorMsg) {
    const clipboard2 = new Clipboard(clickEvent.target, {
      text: () => content2
    });
    clipboard2.on("success", () => {
      $message.success(successMsg);
      clipboard2.destroy();
    });
    clipboard2.on("error", () => {
      $message.error(errorMsg);
      clipboard2.destroy();
    });
    clipboard2.onClick(clickEvent);
  }
  function getQueryParam(variable) {
    let query = window.location.search.substring(1);
    let vars = query.split("&");
    for (let i2 = 0; i2 < vars.length; i2++) {
      let pair2 = vars[i2].split("=");
      if (pair2[0] == variable) {
        return pair2[1];
      }
    }
    return void 0;
  }
  function getDefaultFormConfig() {
    return {
      modelName: "formData",
      refName: "vForm",
      rulesName: "rules",
      labelWidth: 80,
      labelPosition: "left",
      size: "",
      labelAlign: "label-left-align",
      cssCode: "",
      customClass: [],
      functions: "",
      layoutType: "PC",
      jsonVersion: 3,
      dataSources: [],
      onFormCreated: "",
      onFormMounted: "",
      onFormDataChange: "",
      onFormValidate: ""
    };
  }
  function buildDefaultFormJson() {
    return {
      widgetList: [],
      formConfig: deepClone(getDefaultFormConfig())
    };
  }
  function cloneFormConfigWithoutEventHandler(formConfig2) {
    let newFC = deepClone(formConfig2);
    newFC.onFormCreated = "";
    newFC.onFormMounted = "";
    newFC.onFormDataChange = "";
    newFC.onFormValidate = "";
    return newFC;
  }
  function translateOptionItems(rawData, widgetType, labelKey, valueKey) {
    if (widgetType === "cascader") {
      return deepClone(rawData);
    }
    let result = [];
    if (!!rawData && rawData.length > 0) {
      rawData.forEach((ri) => {
        if (ri.hasOwnProperty("disabled")) {
          result.push({
            label: ri[labelKey],
            value: ri[valueKey],
            disabled: ri["disabled"]
          });
        } else {
          result.push({
            label: ri[labelKey],
            value: ri[valueKey]
          });
        }
      });
    }
    return result;
  }
  function assembleAxiosConfig(arrayObj, DSV, VFR) {
    let result = {};
    if (!arrayObj || arrayObj.length <= 0) {
      return result;
    }
    arrayObj.map((ai) => {
      if (ai.type === "String") {
        result[ai.name] = String(ai.value);
      } else if (ai.type === "Number") {
        result[ai.name] = Number(ai.value);
      } else if (ai.type === "Boolean") {
        if (ai.value.toLowerCase() === "false" || ai.value === "0") {
          result[ai.name] = false;
        } else if (ai.value.toLowerCase() === "true" || ai.value === "1") {
          result[ai.name] = true;
        } else {
          result[ai.name] = null;
        }
      } else if (ai.type === "Variable") {
        result[ai.name] = evalFn(ai.value, DSV, VFR);
      }
    });
    console.log("test DSV: ", DSV);
    console.log("test VFR: ", VFR);
    return result;
  }
  function buildRequestConfig(dataSource, DSV, VFR, isSandbox) {
    let config2 = {};
    if (dataSource.requestURLType === "String") {
      config2.url = dataSource.requestURL;
    } else {
      config2.url = evalFn(dataSource.requestURL, DSV, VFR);
    }
    config2.method = dataSource.requestMethod;
    config2.headers = assembleAxiosConfig(dataSource.headers, DSV, VFR);
    config2.params = assembleAxiosConfig(dataSource.params, DSV, VFR);
    config2.data = assembleAxiosConfig(dataSource.data, DSV, VFR);
    let chFn = new Function("config", "isSandbox", "DSV", "VFR", dataSource.configHandlerCode);
    return chFn.call(null, config2, isSandbox, DSV, VFR);
  }
  async function runDataSourceRequest(dataSource, DSV, VFR, isSandbox, $message) {
    try {
      let requestConfig = buildRequestConfig(dataSource, DSV, VFR, isSandbox);
      let result = await axios.request(requestConfig);
      let dhFn = new Function("result", "isSandbox", "DSV", "VFR", dataSource.dataHandlerCode);
      return dhFn.call(null, result, isSandbox, DSV, VFR);
    } catch (err) {
      let ehFn = new Function("error", "isSandbox", "DSV", "$message", "VFR", dataSource.errorHandlerCode);
      console.error(err);
      return ehFn.call(null, err, isSandbox, DSV, $message, VFR);
    }
  }
  function getDSByName(formConfig2, dsName) {
    let resultDS = null;
    if (!!dsName && !!formConfig2.dataSources) {
      formConfig2.dataSources.forEach((ds) => {
        if (ds.uniqueName === dsName) {
          resultDS = ds;
        }
      });
    }
    if (!resultDS) {
      console.error("DS not found: " + dsName);
    }
    return resultDS;
  }
  var Utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    isNull,
    isNotNull,
    isEmptyStr,
    generateId,
    deepClone,
    overwriteObj,
    evalFn,
    trimEx,
    hasPropertyOfObject,
    getObjectValue,
    setObjectValue,
    addWindowResizeHandler,
    insertCustomCssToHead,
    insertGlobalFunctionsToHtml,
    deleteCustomStyleAndScriptNode,
    optionExists,
    loadRemoteScript,
    traverseFieldWidgets,
    traverseContainerWidgets,
    traverseAllWidgets,
    traverseFieldWidgetsOfContainer,
    traverseWidgetsOfContainer,
    getAllFieldWidgets,
    getAllContainerWidgets,
    getFieldWidgetByName,
    getFieldWidgetById,
    getContainerWidgetByName,
    getContainerWidgetById,
    copyToClipboard,
    getQueryParam,
    getDefaultFormConfig,
    buildDefaultFormJson,
    cloneFormConfigWithoutEventHandler,
    translateOptionItems,
    assembleAxiosConfig,
    runDataSourceRequest,
    getDSByName
  }, Symbol.toStringTag, { value: "Module" }));
  var index_vue_vue_type_style_index_0_scoped_true_lang$7 = "";
  var index_vue_vue_type_style_index_1_lang$1 = "";
  const _sfc_main$4t = {
    name: "FieldPanel",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object
    },
    inject: ["getBannedWidgets", "getDesignerConfig", "getServerFieldList"],
    data() {
      return {
        designerConfig: this.getDesignerConfig(),
        firstTab: "componentLib",
        activeNames: ["1", "2", "3", "4"],
        metadataActiveNames: ["0", "1", "2", "3", "4"],
        containers: [],
        commonContainers: [],
        basicFields: [],
        advancedFields: [],
        customFields: [],
        chartContainers: [],
        chartWidgets: [],
        tableFields: [],
        serverFieldList: [],
        metaFields: {
          main: {
            entityName: "",
            entityLabel: "",
            fieldList: [
              {
                type: "",
                icon: "",
                displayName: "",
                options: {}
              }
            ]
          },
          detail: [
            {
              entityName: "",
              entityLabel: "",
              fieldList: [
                {
                  type: "",
                  icon: "",
                  displayName: "",
                  options: {}
                }
              ]
            }
          ]
        },
        formTemplates
      };
    },
    computed: {
      showComponentLib() {
        if (this.designerConfig["componentLib"] === void 0) {
          return true;
        }
        return !!this.designerConfig["componentLib"];
      },
      showFormTemplates() {
        if (this.designerConfig["formTemplates"] === void 0) {
          return true;
        }
        return !!this.designerConfig["formTemplates"];
      },
      showChartLib() {
        if (this.designerConfig["chartLib"] === void 0) {
          return false;
        }
        return !!this.designerConfig["chartLib"];
      },
      showMetadataLib() {
        if (this.designerConfig["metadataLib"] === void 0) {
          return false;
        }
        return !!this.designerConfig["metadataLib"];
      }
    },
    created() {
      if (!!this.designerConfig["chartLib"]) {
        this.firstTab = "chartLib";
      }
      if (!!this.designerConfig["metadataLib"]) {
        this.firstTab = "metadataLib";
      }
      this.loadWidgets();
    },
    mounted() {
    },
    methods: {
      showTableColumn(tab, event) {
        if (tab.props.name == "tableColumn") {
          this.tableFields = [];
          this.serverFieldList = this.getServerFieldList();
          var input_def = {
            type: "input",
            alias: "",
            icon: "text-field",
            formItemFlag: true,
            options: {
              name: "",
              keyNameEnabled: false,
              keyName: "",
              label: "",
              labelAlign: "",
              type: "text",
              defaultValue: "",
              placeholder: "",
              columnWidth: "200px",
              size: "",
              labelWidth: null,
              labelHidden: false,
              labelWrap: false,
              readonly: false,
              disabled: false,
              hidden: false,
              clearable: true,
              showPassword: false,
              required: false,
              requiredHint: "",
              validation: "",
              validationHint: "",
              customClass: "",
              labelIconClass: null,
              labelIconPosition: "rear",
              labelTooltip: null,
              minLength: null,
              maxLength: null,
              showWordLimit: false,
              prefixIcon: "",
              suffixIcon: "",
              appendButton: false,
              appendButtonDisabled: false,
              buttonIcon: "custom-search",
              onCreated: "",
              onMounted: "",
              onInput: "",
              onChange: "",
              onFocus: "",
              onBlur: "",
              onValidate: "",
              onAppendButtonClick: ""
            }
          };
          for (var i2 = 0; i2 < this.serverFieldList.length; i2++) {
            var c = deepClone(input_def);
            if (this.serverFieldList[i2].elType == "sub-form") {
              c = deepClone(this.containers[3]);
            } else {
              this.basicFields.forEach((item) => {
                if (item.type == this.serverFieldList[i2].elType) {
                  c = deepClone(item);
                }
              });
            }
            c.options.label = this.serverFieldList[i2].label;
            c.options.tablAndLabelColumn = this.serverFieldList[i2].tablAndLabelColumn;
            c.options.name = this.serverFieldList[i2].name;
            c.id = c.name;
            c.sourceTable = true;
            this.tableFields.push(c);
          }
          console.log("=====this.tableFields===", this.tableFields);
        }
      },
      getMetaFieldLabel(widget) {
        const dName = widget.displayName;
        return dName.substring(dName.indexOf(".") + 1, dName.length);
      },
      getWidgetLabel(widget) {
        if (!!widget.alias) {
          return this.i18n2t(`designer.widgetLabel.${widget.alias}`, `extension.widgetLabel.${widget.alias}`);
        }
        return this.i18n2t(`designer.widgetLabel.${widget.type}`, `extension.widgetLabel.${widget.type}`);
      },
      isBanned(wName) {
        return this.getBannedWidgets().indexOf(wName) > -1;
      },
      getFTTitle(ft) {
        const langName = getLocale();
        if (!!ft.i18n && !!ft.i18n[langName]) {
          return ft.i18n[langName].title || ft.title;
        } else {
          return ft.title;
        }
      },
      loadWidgets() {
        this.containers = containers.map((con) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, con), {
            displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
          });
        }).filter((con) => {
          return !con.internal && !this.isBanned(con.type);
        });
        this.commonContainers = this.containers.filter((con) => !!con.commonFlag);
        this.basicFields = basicFields.map((fld) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, fld), {
            displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
          });
        }).filter((fld) => {
          return !this.isBanned(fld.type);
        });
        this.advancedFields = advancedFields.map((fld) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, fld), {
            displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
          });
        }).filter((fld) => {
          return !this.isBanned(fld.type);
        });
        this.customFields = customFields.map((fld) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, fld), {
            displayName: this.i18n2t(`designer.widgetLabel.${fld.type}`, `extension.widgetLabel.${fld.type}`)
          });
        }).filter((fld) => {
          return !this.isBanned(fld.type);
        });
        this.chartContainers = chartContainers.map((con) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, con), {
            displayName: this.i18n2t(`designer.widgetLabel.${con.type}`, `extension.widgetLabel.${con.type}`)
          });
        }).filter((con) => {
          return !con.internal && !this.isBanned(con.type);
        });
        this.chartWidgets = chartWidgets.map((wgt) => {
          return __spreadProps(__spreadValues({
            key: generateId()
          }, wgt), {
            displayName: this.i18n2t(`designer.widgetLabel.${wgt.type}`, `extension.widgetLabel.${wgt.type}`)
          });
        }).filter((wgt) => {
          return !this.isBanned(wgt.type);
        });
      },
      handleContainerWidgetClone(origin) {
        return this.designer.copyNewContainerWidget(origin);
      },
      handleFieldWidgetClone(origin) {
        return this.designer.copyNewFieldWidget(origin);
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      checkFieldMove(evt) {
        return this.designer.checkFieldMove(evt);
      },
      onContainerDragEnd(evt) {
      },
      addContainerByDbClick(container) {
        this.designer.addContainerByDbClick(container);
      },
      addFieldByDbClick(widget) {
        this.designer.addFieldByDbClick(widget);
      },
      addChartContainerByDbClick(container) {
        this.designer.addChartContainerByDbClick(container);
      },
      addChartByDbClick(chart) {
        this.designer.addChartByDbClick(chart);
      },
      loadFormTemplate(jsonUrl, jsonStr) {
        this.$confirm(this.i18nt("designer.hint.loadFormTemplateHint"), this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          if (!!jsonStr) {
            this.designer.loadFormJson(JSON.parse(jsonStr));
            this.$message.success(this.i18nt("designer.hint.loadFormTemplateSuccess"));
            return;
          }
          axios.get(jsonUrl).then((res) => {
            let modifiedFlag = false;
            if (typeof res.data === "string") {
              modifiedFlag = this.designer.loadFormJson(JSON.parse(res.data));
            } else if (res.data.constructor === Object) {
              modifiedFlag = this.designer.loadFormJson(res.data);
            }
            if (modifiedFlag) {
              this.designer.emitHistoryChange();
            }
            this.$message.success(this.i18nt("designer.hint.loadFormTemplateSuccess"));
          }).catch((error2) => {
            this.$message.error(this.i18nt("designer.hint.loadFormTemplateFailed") + ":" + error2);
          });
        }).catch((error2) => {
          console.error(error2);
        });
      },
      setMetaFields(metaFields) {
        this.metaFields = metaFields;
      }
    }
  };
  const _hoisted_1$$ = { class: "panel-container" };
  const _hoisted_2$r = ["title", "onDblclick"];
  const _hoisted_3$j = ["title", "onDblclick"];
  const _hoisted_4$i = { class: "svg-icon-label" };
  const _hoisted_5$f = { class: "chart-widget-item__label" };
  const _hoisted_6$f = ["title", "onDblclick"];
  const _hoisted_7$c = ["title", "onDblclick"];
  const _hoisted_8$b = ["title", "onDblclick"];
  const _hoisted_9$a = ["title", "onDblclick"];
  const _hoisted_10$9 = ["title", "onDblclick"];
  const _hoisted_11$7 = ["title", "onDblclick"];
  const _hoisted_12$5 = ["title", "onDblclick"];
  const _hoisted_13$5 = ["title", "onDblclick"];
  const _hoisted_14$4 = ["src"];
  const _hoisted_15$2 = ["src"];
  const _hoisted_16$2 = { class: "bottom clear-fix" };
  const _hoisted_17$2 = { class: "ft-title" };
  function _sfc_render$4t(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_collapse_item = require$$0$1.resolveComponent("el-collapse-item");
    const _component_el_collapse = require$$0$1.resolveComponent("el-collapse");
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_el_popover = require$$0$1.resolveComponent("el-popover");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_card = require$$0$1.resolveComponent("el-card");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _component_el_scrollbar = require$$0$1.resolveComponent("el-scrollbar");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_scrollbar, { class: "side-scroll-bar" }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", _hoisted_1$$, [
          require$$0$1.createVNode(_component_el_tabs, {
            modelValue: $data.firstTab,
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.firstTab = $event),
            onTabClick: $options.showTableColumn,
            class: "no-bottom-margin indent-left-margin"
          }, {
            default: require$$0$1.withCtx(() => [
              $options.showChartLib ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                key: 0,
                name: "chartLib"
              }, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", null, [
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-chart" }),
                    require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(_ctx.i18nt("designer.chartLib")), 1)
                  ])
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_collapse, {
                    modelValue: $data.activeNames,
                    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.activeNames = $event),
                    class: "widget-collapse"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "1",
                        title: _ctx.i18nt("designer.containerTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.chartContainers,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            clone: $options.handleContainerWidgetClone,
                            "ghost-class": "ghost",
                            sort: false,
                            disabled: true,
                            move: $options.checkContainerMove,
                            onEnd: $options.onContainerDragEnd
                          }, {
                            item: require$$0$1.withCtx(({ element: ctn }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "chart-container-widget-item",
                                title: ctn.displayName,
                                onDblclick: ($event) => $options.addChartContainerByDbClick(ctn)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": ctn.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(ctn)), 1)
                                ])
                              ], 40, _hoisted_2$r)
                            ]),
                            _: 1
                          }, 8, ["list", "clone", "move", "onEnd"])
                        ]),
                        _: 1
                      }, 8, ["title"]),
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "2",
                        title: _ctx.i18nt("designer.chartTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.chartWidgets,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            disabled: true,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: chart }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "chart-widget-item",
                                title: chart.displayName,
                                onDblclick: ($event) => $options.addChartByDbClick(chart)
                              }, [
                                require$$0$1.createElementVNode("div", _hoisted_4$i, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": chart.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createElementVNode("span", _hoisted_5$f, require$$0$1.toDisplayString($options.getWidgetLabel(chart)), 1)
                                ])
                              ], 40, _hoisted_3$j)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      }, 8, ["title"])
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              })) : require$$0$1.createCommentVNode("", true),
              $options.showMetadataLib ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                key: 1,
                name: "metadataLib"
              }, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", null, [
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-module" }),
                    require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(_ctx.i18nt("designer.metadataLib")), 1)
                  ])
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_collapse, {
                    modelValue: $data.metadataActiveNames,
                    "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.metadataActiveNames = $event),
                    class: "widget-collapse"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "0",
                        title: _ctx.i18nt("designer.containerTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.commonContainers,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            clone: $options.handleContainerWidgetClone,
                            "ghost-class": "ghost",
                            sort: false,
                            move: $options.checkContainerMove,
                            onEnd: $options.onContainerDragEnd
                          }, {
                            item: require$$0$1.withCtx(({ element: ctn }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "container-widget-item",
                                title: ctn.displayName,
                                onDblclick: ($event) => $options.addContainerByDbClick(ctn)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": ctn.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(ctn)), 1)
                                ])
                              ], 40, _hoisted_6$f)
                            ]),
                            _: 1
                          }, 8, ["list", "clone", "move", "onEnd"])
                        ]),
                        _: 1
                      }, 8, ["title"]),
                      $data.metaFields.main.entityName ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                        key: 0,
                        name: "1",
                        title: $data.metaFields.main.entityLabel
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.metaFields.main.fieldList,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: fld }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "field-widget-item",
                                title: fld.displayName,
                                onDblclick: ($event) => $options.addFieldByDbClick(fld)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": fld.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getMetaFieldLabel(fld)), 1)
                                ])
                              ], 40, _hoisted_7$c)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      }, 8, ["title"])) : require$$0$1.createCommentVNode("", true),
                      $data.metaFields.detail && $data.metaFields.detail.length > 0 ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, require$$0$1.renderList($data.metaFields.detail, (de, index2) => {
                        return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                          name: "index + 2 + ''",
                          title: de.entityLabel
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_draggable, {
                              tag: "ul",
                              list: de.fieldList,
                              "item-key": "key",
                              group: { name: "dragGroup", pull: "clone", put: false },
                              move: $options.checkFieldMove,
                              clone: $options.handleFieldWidgetClone,
                              "ghost-class": "ghost",
                              sort: false
                            }, {
                              item: require$$0$1.withCtx(({ element: fld }) => [
                                require$$0$1.createElementVNode("li", {
                                  class: "field-widget-item",
                                  title: fld.displayName,
                                  onDblclick: ($event) => $options.addFieldByDbClick(fld)
                                }, [
                                  require$$0$1.createElementVNode("span", null, [
                                    require$$0$1.createVNode(_component_svg_icon, {
                                      "icon-class": fld.icon,
                                      "class-name": "color-svg-icon"
                                    }, null, 8, ["icon-class"]),
                                    require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getMetaFieldLabel(fld)), 1)
                                  ])
                                ], 40, _hoisted_8$b)
                              ]),
                              _: 2
                            }, 1032, ["list", "move", "clone"])
                          ]),
                          _: 2
                        }, 1032, ["title"]);
                      }), 256)) : require$$0$1.createCommentVNode("", true)
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              })) : require$$0$1.createCommentVNode("", true),
              $options.showComponentLib ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                key: 2,
                name: "componentLib"
              }, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", null, [
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-set-up" }),
                    require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(_ctx.i18nt("designer.componentLib")), 1)
                  ])
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_collapse, {
                    modelValue: $data.activeNames,
                    "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.activeNames = $event),
                    class: "widget-collapse"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "1",
                        title: _ctx.i18nt("designer.containerTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.containers,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            clone: $options.handleContainerWidgetClone,
                            "ghost-class": "ghost",
                            sort: false,
                            move: $options.checkContainerMove,
                            onEnd: $options.onContainerDragEnd
                          }, {
                            item: require$$0$1.withCtx(({ element: ctn }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "container-widget-item",
                                title: ctn.displayName,
                                onDblclick: ($event) => $options.addContainerByDbClick(ctn)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": ctn.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(ctn)), 1)
                                ])
                              ], 40, _hoisted_9$a)
                            ]),
                            _: 1
                          }, 8, ["list", "clone", "move", "onEnd"])
                        ]),
                        _: 1
                      }, 8, ["title"]),
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "2",
                        title: _ctx.i18nt("designer.basicFieldTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.basicFields,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: fld }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "field-widget-item",
                                title: fld.displayName,
                                onDblclick: ($event) => $options.addFieldByDbClick(fld)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": fld.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(fld)), 1)
                                ])
                              ], 40, _hoisted_10$9)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      }, 8, ["title"]),
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "3",
                        title: _ctx.i18nt("designer.advancedFieldTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.advancedFields,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: fld }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "field-widget-item",
                                title: fld.displayName,
                                onDblclick: ($event) => $options.addFieldByDbClick(fld)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": fld.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(fld)), 1)
                                ])
                              ], 40, _hoisted_11$7)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      }, 8, ["title"]),
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "4",
                        title: _ctx.i18nt("designer.customFieldTitle")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.customFields,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: fld }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "field-widget-item",
                                title: fld.displayName,
                                onDblclick: ($event) => $options.addFieldByDbClick(fld)
                              }, [
                                require$$0$1.createElementVNode("span", null, [
                                  require$$0$1.createVNode(_component_svg_icon, {
                                    "icon-class": fld.icon,
                                    "class-name": "color-svg-icon"
                                  }, null, 8, ["icon-class"]),
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getWidgetLabel(fld)), 1)
                                ])
                              ], 40, _hoisted_12$5)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      }, 8, ["title"])
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              })) : require$$0$1.createCommentVNode("", true),
              require$$0$1.createVNode(_component_el_tab_pane, {
                name: "tableColumn",
                style: { "padding": "8px", "height": "400px", "overflow": "auto" }
              }, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", null, [
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-form-template" }),
                    require$$0$1.createTextVNode(" \u8868\u5B57\u6BB5")
                  ])
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_collapse, {
                    modelValue: $data.activeNames,
                    "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.activeNames = $event),
                    class: "widget-column"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_collapse_item, {
                        name: "1",
                        title: "\u5B57\u6BB5\u5217\u8868"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_draggable, {
                            tag: "ul",
                            list: $data.tableFields,
                            "item-key": "key",
                            group: { name: "dragGroup", pull: "clone", put: false },
                            move: $options.checkFieldMove,
                            clone: $options.handleFieldWidgetClone,
                            "ghost-class": "ghost",
                            sort: false
                          }, {
                            item: require$$0$1.withCtx(({ element: fld }) => [
                              require$$0$1.createElementVNode("li", {
                                class: "field-widget-item",
                                title: fld.options.tablAndLabelColumn,
                                onDblclick: ($event) => $options.addFieldByDbClick(fld)
                              }, [
                                require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(fld.options.tablAndLabelColumn), 1)
                              ], 40, _hoisted_13$5)
                            ]),
                            _: 1
                          }, 8, ["list", "move", "clone"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              }),
              $options.showFormTemplates ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                key: 3,
                name: "formLib",
                style: { "padding": "8px" }
              }, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", null, [
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-form-template" }),
                    require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(_ctx.i18nt("designer.formLib")), 1)
                  ])
                ]),
                default: require$$0$1.withCtx(() => [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.formTemplates, (ft, idx) => {
                    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_card, {
                      "bord-style": { padding: "0" },
                      shadow: "hover",
                      class: "ft-card"
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_popover, {
                          placement: "right",
                          trigger: "hover",
                          "popper-class": "image-popover"
                        }, {
                          reference: require$$0$1.withCtx(() => [
                            require$$0$1.createElementVNode("img", {
                              src: ft.imgUrl,
                              style: { "width": "200px" }
                            }, null, 8, _hoisted_14$4)
                          ]),
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createElementVNode("img", {
                              src: ft.imgUrl,
                              style: { "height": "600px", "width": "720px" }
                            }, null, 8, _hoisted_15$2)
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createElementVNode("div", _hoisted_16$2, [
                          require$$0$1.createElementVNode("span", _hoisted_17$2, "#" + require$$0$1.toDisplayString(idx + 1) + " " + require$$0$1.toDisplayString($options.getFTTitle(ft)), 1),
                          require$$0$1.createVNode(_component_el_button, {
                            link: "",
                            type: "primary",
                            class: "right-button",
                            onClick: ($event) => $options.loadFormTemplate(ft.jsonUrl, ft.jsonStr)
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.loadFormTemplate")), 1)
                            ]),
                            _: 2
                          }, 1032, ["onClick"])
                        ])
                      ]),
                      _: 2
                    }, 1024);
                  }), 256))
                ]),
                _: 1
              })) : require$$0$1.createCommentVNode("", true)
            ]),
            _: 1
          }, 8, ["modelValue", "onTabClick"])
        ])
      ]),
      _: 1
    });
  }
  var WidgetPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4t, [["render", _sfc_render$4t], ["__scopeId", "data-v-5560b31a"]]);
  var emitter = {
    data() {
      return {
        vfEvents: {}
      };
    },
    methods: {
      emit$(eventName, data2) {
        if (this.vfEvents[eventName]) {
          this.vfEvents[eventName].forEach((fn) => {
            fn(data2);
          });
        }
      },
      on$(eventName, fn) {
        this.vfEvents[eventName] = this.vfEvents[eventName] || [];
        this.vfEvents[eventName].push(fn);
      },
      off$(eventName, fn) {
        if (this.vfEvents[eventName]) {
          if (fn === void 0 || fn === null) {
            this.vfEvents[eventName].length = 0;
            return;
          }
          for (let i2 = 0; i2 < this.vfEvents[eventName].length; i2++) {
            if (this.vfEvents[eventName][i2] === fn) {
              this.vfEvents[eventName].splice(i2, 1);
              break;
            }
          }
        }
      },
      dispatch: function dispatch(componentName, eventName, params) {
        let parent = this.$parent || this.$root;
        let name2 = parent.$options.componentName;
        while (parent && (!name2 || name2 !== componentName)) {
          parent = parent.$parent;
          if (parent) {
            name2 = parent.$options.componentName;
          }
        }
        if (parent) {
          if (!!parent.emit$) {
            parent.emit$.call(parent, eventName, params);
            if (componentName === "VFormRender") {
              parent.$emit(eventName, ...params);
            }
          }
        }
      },
      broadcast: function broadcast(componentName, eventName, params) {
        if (!!this.widgetRefList) {
          Object.keys(this.widgetRefList).forEach((refName) => {
            let cmpName = this.widgetRefList[refName].$options.componentName;
            if (cmpName === componentName) {
              let foundRef = this.widgetRefList[refName];
              foundRef.emit$.call(foundRef, eventName, params);
            }
          });
        }
        if (!!this.refList) {
          Object.keys(this.refList).forEach((refName) => {
            let cmpName = this.refList[refName].$options.componentName;
            if (cmpName === componentName) {
              let foundRef = this.refList[refName];
              foundRef.emit$.call(foundRef, eventName, params);
            }
          });
        }
      }
    }
  };
  const _sfc_main$4s = {
    name: "container-item-wrapper",
    props: {
      widget: Object
    },
    computed: {
      customClass() {
        return !!this.widget.options.customClass ? this.widget.options.customClass.join(" ") : "";
      }
    }
  };
  function _sfc_render$4s(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
      class: require$$0$1.normalizeClass(["container-wrapper", [$options.customClass]])
    }, [
      require$$0$1.renderSlot(_ctx.$slots, "default")
    ], 2);
  }
  var ContainerItemWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$4s, [["render", _sfc_render$4s]]);
  var __glob_0_1$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": ContainerItemWrapper
  }, Symbol.toStringTag, { value: "Module" }));
  var refMixin = {
    methods: {
      initRefList() {
        if (this.subFormRowIndex === -1 || this.subFormRowIndex === void 0) {
          if (this.refList !== null && !!this.widget.options.name) {
            this.refList[this.widget.options.name] = this;
          }
        } else {
          if (this.refList !== null && !!this.widget.options.name) {
            this.refList[this.widget.options.name + "@row" + this.subFormRowId] = this;
          }
        }
      },
      getWidgetRef(widgetName, showError) {
        let foundRef = this.refList[widgetName];
        if (!foundRef && !!showError) {
          this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
        }
        return foundRef;
      },
      getFormRef() {
        return this.refList["v_form_ref"];
      },
      getComponentByContainer(con) {
        if (con.type === "grid") {
          return "vf-grid-item";
        }
        return con.type + "-item";
      }
    }
  };
  var containerItemMixin = {
    inject: ["getFormConfig", "getGlobalDsv"],
    computed: {
      customClass() {
        return this.widget.options.customClass || "";
      },
      formModel: {
        cache: false,
        get() {
          return this.globalModel.formModel;
        }
      }
    },
    mounted() {
      this.callSetHidden();
    },
    methods: {
      cloneWidgetSchema(widget) {
        return deepClone(widget);
      },
      unregisterFromRefList() {
        if (this.refList !== null && !!this.widget.options.name) {
          let oldRefName = this.widget.options.name;
          delete this.refList[oldRefName];
        }
      },
      callSetHidden() {
        if (this.widget.options.hidden === true) {
          this.setHidden(true);
        }
      },
      setHidden(flag) {
        this.widget.options.hidden = flag;
        const fwHandler = (fw) => {
          let fwName = fw.options.name;
          let fwRef = this.getWidgetRef(fwName);
          if (flag && !!fwRef && !!fwRef.clearFieldRules) {
            fwRef.clearFieldRules();
          }
          if (!flag && !!fwRef && !!fwRef.buildFieldRules) {
            fwRef.buildFieldRules();
          }
        };
        let sfArray = [];
        const cwHandler = (cw) => {
          if (cw.type === "sub-form" || cw.type === "grid-sub-form") {
            sfArray.push(cw);
          }
        };
        traverseWidgetsOfContainer(this.widget, fwHandler, cwHandler);
        sfArray.forEach((sf) => {
          const sfRef = this.getWidgetRef(sf.options.name);
          if (!!sfRef) {
            const rowIds = sfRef.getRowIdData();
            const sfwHandler = (sfw) => {
              if (!!rowIds && rowIds.length > 0) {
                rowIds.forEach((rid) => {
                  const sfwName = sfw.options.name + "@row" + rid;
                  const sfwRef = this.getWidgetRef(sfwName);
                  if (flag && !!sfwRef && !!sfwRef.clearFieldRules) {
                    sfwRef.clearFieldRules();
                  }
                  if (!flag && !!sfwRef && !!sfwRef.buildFieldRules) {
                    sfwRef.buildFieldRules();
                  }
                });
              }
            };
            traverseFieldWidgetsOfContainer(sfRef.widget, sfwHandler);
          }
        });
      },
      setDisabled(flag) {
        const fwHandler = (fw) => {
          const fwName = fw.options.name;
          const fwRef = this.getWidgetRef(fwName);
          if (!!fwRef && !!fwRef.setDisabled) {
            fwRef.setDisabled(flag);
          }
        };
        const cwHandler = (cw) => {
          if (cw.id === this.widget.id) {
            return;
          }
          const cwName = cw.options.name;
          const cwRef = this.getWidgetRef(cwName);
          if (!!cwRef && !!cwRef.setDisabled) {
            cwRef.setDisabled(flag);
          }
        };
        traverseWidgetsOfContainer(this.widget, fwHandler, cwHandler);
      },
      activeTab(tabIndex) {
        if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
          this.widget.tabs.forEach((tp, idx) => {
            tp.options.active = idx === tabIndex;
            if (idx === tabIndex) {
              this.activeTabName = tp.options.name;
            }
          });
        }
      },
      disableTab(tabIndex) {
        if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
          this.widget.tabs[tabIndex].options.disabled = true;
        }
      },
      enableTab(tabIndex) {
        if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
          this.widget.tabs[tabIndex].options.disabled = false;
        }
      },
      hideTab(tabIndex) {
        if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
          this.widget.tabs[tabIndex].options.hidden = true;
        }
      },
      showTab(tabIndex) {
        if (tabIndex >= 0 && tabIndex < this.widget.tabs.length) {
          this.widget.tabs[tabIndex].options.hidden = false;
        }
      },
      setWidgetOption(optionName, optionValue) {
        if (this.widget.options.hasOwnProperty(optionName)) {
          this.widget.options[optionName] = optionValue;
        }
      },
      getSubFormRowCount() {
        return !this.rowIdData ? 0 : this.rowIdData.length;
      },
      setGridSubFormRowDisabled(rowId2, disabledFlag) {
        const fwHandler = (fw) => {
          const fwName = fw.options.name + "@row" + rowId2;
          const fwRef = this.getWidgetRef(fwName);
          if (!!fwRef && !!fwRef.setDisabled) {
            fwRef.setDisabled(disabledFlag);
          }
        };
        const cwHandler = (cw) => {
          const cwName = cw.options.name + "@row" + rowId2;
          const cwRef = this.getWidgetRef(cwName);
          if (!!cwRef && !!cwRef.setDisabled) {
            cwRef.setDisabled(disabledFlag);
          }
        };
        traverseWidgetsOfContainer(this.widget, fwHandler, cwHandler);
      },
      disableSubFormRow(rowIndex) {
        if (this.widget.type === "sub-form") {
          this.widget.widgetList.forEach((subWidget) => {
            let swRefName = subWidget.options.name + "@row" + this.rowIdData[rowIndex];
            let foundSW = this.getWidgetRef(swRefName);
            if (!!foundSW && !!foundSW.setDisabled) {
              foundSW.setDisabled(true);
            }
          });
        } else if (this.widget.type === "grid-sub-form") {
          this.setGridSubFormRowDisabled(this.rowIdData[rowIndex], true);
        }
      },
      enableSubFormRow(rowIndex) {
        if (this.widget.type === "sub-form") {
          this.widget.widgetList.forEach((subWidget) => {
            let swRefName = subWidget.options.name + "@row" + this.rowIdData[rowIndex];
            let foundSW = this.getWidgetRef(swRefName);
            if (!!foundSW && !!foundSW.setDisabled) {
              foundSW.setDisabled(false);
            }
          });
        } else if (this.widget.type === "grid-sub-form") {
          this.setGridSubFormRowDisabled(this.rowIdData[rowIndex], false);
        }
      },
      disableSubForm() {
        this.widget.options.disabled = true;
        this.widget.widgetList.forEach((subWidget) => {
          subWidget.options.disabled = true;
        });
        if (this.rowIdData.length > 0) {
          this.rowIdData.forEach((dataRow, rIdx) => {
            this.disableSubFormRow(rIdx);
          });
        }
        this.actionDisabled = true;
      },
      enableSubForm() {
        this.widget.options.disabled = false;
        this.widget.widgetList.forEach((subWidget) => {
          subWidget.options.disabled = false;
        });
        if (this.rowIdData.length > 0) {
          this.rowIdData.forEach((dataRow, rIdx) => {
            this.enableSubFormRow(rIdx);
          });
        }
        this.actionDisabled = false;
      },
      disableGridSubFormRow(rowIndex) {
        let gsfFWList = [];
        let fieldListFn = (fw) => {
          gsfFWList.push(fw);
        };
        traverseFieldWidgetsOfContainer(this.widget, fieldListFn);
        gsfFWList.forEach((fw) => {
          let swRefName = fw.options.name + "@row" + this.rowIdData[rowIndex];
          let foundSW = this.getWidgetRef(swRefName);
          if (!!foundSW && !!foundSW.setDisabled) {
            foundSW.setDisabled(true);
          }
        });
      },
      enableGridSubFormRow(rowIndex) {
        let gsfFWList = [];
        let fieldListFn = (fw) => {
          gsfFWList.push(fw);
        };
        traverseFieldWidgetsOfContainer(this.widget, fieldListFn);
        gsfFWList.forEach((fw) => {
          let swRefName = fw.options.name + "@row" + this.rowIdData[rowIndex];
          let foundSW = this.getWidgetRef(swRefName);
          if (!!foundSW && !!foundSW.setDisabled) {
            foundSW.setDisabled(false);
          }
        });
      },
      disableGridSubForm() {
        traverseFieldWidgetsOfContainer(this.widget, (fw) => {
          fw.options.disabled = true;
        });
        if (this.rowIdData.length > 0) {
          this.rowIdData.forEach((dataRow, rIdx) => {
            this.disableGridSubFormRow(rIdx);
          });
        }
        this.actionDisabled = true;
      },
      enableGridSubForm() {
        traverseFieldWidgetsOfContainer(this.widget, (fw) => {
          fw.options.disabled = false;
        });
        if (this.rowIdData.length > 0) {
          this.rowIdData.forEach((dataRow, rIdx) => {
            this.enableGridSubFormRow(rIdx);
          });
        }
        this.actionDisabled = false;
      },
      resetSubForm() {
        if (this.widget.type === "sub-form" || this.widget.type === "grid-sub-form") {
          let subFormModel = this.formModel[this.widget.options.name];
          if (!!subFormModel) {
            subFormModel.splice(0, subFormModel.length);
            this.rowIdData.splice(0, this.rowIdData.length);
          }
          if (this.widget.options.showBlankRow) {
            this.addSubFormRow();
          }
        }
      },
      getSubFormValues(needValidation = true) {
        if (this.widget.type === "sub-form" || this.widget.type === "grid-sub-form") {
          return this.formModel[this.widget.options.name];
        } else {
          this.$message.error(this.i18nt("render.hint.nonSubFormType"));
        }
      },
      setSubFormValues(subFormValues) {
      },
      addCssClass(className) {
        if (!this.widget.options.customClass) {
          this.widget.options.customClass = [className];
        } else {
          this.widget.options.customClass.push(className);
        }
      },
      removeCssClass(className) {
        if (!this.widget.options.customClass) {
          return;
        }
        let foundIdx = -1;
        this.widget.options.customClass.map((cc, idx) => {
          if (cc === className) {
            foundIdx = idx;
          }
        });
        if (foundIdx > -1) {
          this.widget.options.customClass.splice(foundIdx, 1);
        }
      }
    }
  };
  const _sfc_main$4r = {
    name: "button-group-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    inject: ["refList", "sfRefList", "globalModel", "getFormConfig", "getGlobalDsv"],
    components: {
      ContainerItemWrapper
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    data() {
      return {};
    },
    created() {
      this.initRefList();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeDestroy() {
      this.unregisterFromRefList();
    },
    methods: {
      handleOnCreated() {
        if (!!this.widget.options.onCreated) {
          let customFunc = new Function(this.widget.options.onCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.widget.options.onMounted) {
          let customFunc = new Function(this.widget.options.onMounted);
          customFunc.call(this);
        }
      },
      handleGroupButtonClick(buttonConfig) {
        if (!!this.widget.options.onButtonGroupClick) {
          let customFn = new Function("buttonConfig", this.widget.options.onButtonGroupClick);
          customFn.call(this, buttonConfig);
        } else {
          this.dispatch("VFormRender", "onButtonGroupClick", [buttonConfig]);
        }
      },
      setHidden(hiddenFlag) {
        this.widget.options.hidden = hiddenFlag;
      },
      setDisabled(disabledFlag) {
        this.widget.options.disabled = disabledFlag;
      },
      setButtonHidden(buttonName, hiddenFlag) {
        let foundButton = this.widget.options.buttons.find((btn) => btn.name === buttonName);
        if (!foundButton) {
          foundButton.hidden = hiddenFlag;
        }
      },
      setButtonDisabled(buttonName, disabledFlag) {
        let foundButton = this.widget.options.buttons.find((btn) => btn.name === buttonName);
        if (!foundButton) {
          foundButton.disabled = disabledFlag;
        }
      }
    }
  };
  function _sfc_render$4r(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button_group, null, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.buttons, (btn, idx) => {
              return require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                disabled: btn.disabled || $props.widget.options.disabled,
                size: $props.widget.options.size,
                type: btn.type,
                round: btn.round,
                icon: btn.icon,
                onClick: ($event) => $options.handleGroupButtonClick(btn),
                class: require$$0$1.normalizeClass(["data-table-" + btn.name + "-button"])
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(btn.label), 1)
                ]),
                _: 2
              }, 1032, ["disabled", "size", "type", "round", "icon", "onClick", "class"])), [
                [require$$0$1.vShow, !btn.hidden && !$props.widget.options.hidden]
              ]);
            }), 256))
          ]),
          _: 1
        }, 512), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 1
    }, 8, ["widget"]);
  }
  var buttonGroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$4r, [["render", _sfc_render$4r]]);
  var __glob_0_0$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonGroupItem
  }, Symbol.toStringTag, { value: "Module" }));
  var dayjs_min = { exports: {} };
  (function(module2, exports2) {
    !function(t2, e) {
      module2.exports = e();
    }(commonjsGlobal, function() {
      var t2 = 1e3, e = 6e4, n = 36e5, r = "millisecond", i2 = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t3) {
        var e2 = ["th", "st", "nd", "rd"], n2 = t3 % 100;
        return "[" + t3 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
      } }, m = function(t3, e2, n2) {
        var r2 = String(t3);
        return !r2 || r2.length >= e2 ? t3 : "" + Array(e2 + 1 - r2.length).join(n2) + t3;
      }, v = { s: m, z: function(t3) {
        var e2 = -t3.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i3 = n2 % 60;
        return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i3, 2, "0");
      }, m: function t3(e2, n2) {
        if (e2.date() < n2.date())
          return -t3(n2, e2);
        var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i3 = e2.clone().add(r2, c), s2 = n2 - i3 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
        return +(-(r2 + (n2 - i3) / (s2 ? i3 - u2 : u2 - i3)) || 0);
      }, a: function(t3) {
        return t3 < 0 ? Math.ceil(t3) || 0 : Math.floor(t3);
      }, p: function(t3) {
        return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i2, ms: r, Q: f }[t3] || String(t3 || "").toLowerCase().replace(/s$/, "");
      }, u: function(t3) {
        return t3 === void 0;
      } }, g = "en", D = {};
      D[g] = M;
      var p = "$isDayjsObject", S = function(t3) {
        return t3 instanceof _ || !(!t3 || !t3[p]);
      }, w = function t3(e2, n2, r2) {
        var i3;
        if (!e2)
          return g;
        if (typeof e2 == "string") {
          var s2 = e2.toLowerCase();
          D[s2] && (i3 = s2), n2 && (D[s2] = n2, i3 = s2);
          var u2 = e2.split("-");
          if (!i3 && u2.length > 1)
            return t3(u2[0]);
        } else {
          var a2 = e2.name;
          D[a2] = e2, i3 = a2;
        }
        return !r2 && i3 && (g = i3), i3 || !r2 && g;
      }, O = function(t3, e2) {
        if (S(t3))
          return t3.clone();
        var n2 = typeof e2 == "object" ? e2 : {};
        return n2.date = t3, n2.args = arguments, new _(n2);
      }, b = v;
      b.l = w, b.i = S, b.w = function(t3, e2) {
        return O(t3, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
      };
      var _ = function() {
        function M2(t3) {
          this.$L = w(t3.locale, null, true), this.parse(t3), this.$x = this.$x || t3.x || {}, this[p] = true;
        }
        var m2 = M2.prototype;
        return m2.parse = function(t3) {
          this.$d = function(t4) {
            var e2 = t4.date, n2 = t4.utc;
            if (e2 === null)
              return new Date(NaN);
            if (b.u(e2))
              return new Date();
            if (e2 instanceof Date)
              return new Date(e2);
            if (typeof e2 == "string" && !/Z$/i.test(e2)) {
              var r2 = e2.match($);
              if (r2) {
                var i3 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
                return n2 ? new Date(Date.UTC(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i3, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
              }
            }
            return new Date(e2);
          }(t3), this.init();
        }, m2.init = function() {
          var t3 = this.$d;
          this.$y = t3.getFullYear(), this.$M = t3.getMonth(), this.$D = t3.getDate(), this.$W = t3.getDay(), this.$H = t3.getHours(), this.$m = t3.getMinutes(), this.$s = t3.getSeconds(), this.$ms = t3.getMilliseconds();
        }, m2.$utils = function() {
          return b;
        }, m2.isValid = function() {
          return !(this.$d.toString() === l);
        }, m2.isSame = function(t3, e2) {
          var n2 = O(t3);
          return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
        }, m2.isAfter = function(t3, e2) {
          return O(t3) < this.startOf(e2);
        }, m2.isBefore = function(t3, e2) {
          return this.endOf(e2) < O(t3);
        }, m2.$g = function(t3, e2, n2) {
          return b.u(t3) ? this[e2] : this.set(n2, t3);
        }, m2.unix = function() {
          return Math.floor(this.valueOf() / 1e3);
        }, m2.valueOf = function() {
          return this.$d.getTime();
        }, m2.startOf = function(t3, e2) {
          var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t3), l2 = function(t4, e3) {
            var i3 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t4) : new Date(n2.$y, e3, t4), n2);
            return r2 ? i3 : i3.endOf(a);
          }, $2 = function(t4, e3) {
            return b.w(n2.toDate()[t4].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
          }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
          switch (f2) {
            case h:
              return r2 ? l2(1, 0) : l2(31, 11);
            case c:
              return r2 ? l2(1, M3) : l2(0, M3 + 1);
            case o:
              var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
              return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
            case a:
            case d:
              return $2(v2 + "Hours", 0);
            case u:
              return $2(v2 + "Minutes", 1);
            case s:
              return $2(v2 + "Seconds", 2);
            case i2:
              return $2(v2 + "Milliseconds", 3);
            default:
              return this.clone();
          }
        }, m2.endOf = function(t3) {
          return this.startOf(t3, false);
        }, m2.$set = function(t3, e2) {
          var n2, o2 = b.p(t3), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i2] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
          if (o2 === c || o2 === h) {
            var y2 = this.clone().set(d, 1);
            y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
          } else
            l2 && this.$d[l2]($2);
          return this.init(), this;
        }, m2.set = function(t3, e2) {
          return this.clone().$set(t3, e2);
        }, m2.get = function(t3) {
          return this[b.p(t3)]();
        }, m2.add = function(r2, f2) {
          var d2, l2 = this;
          r2 = Number(r2);
          var $2 = b.p(f2), y2 = function(t3) {
            var e2 = O(l2);
            return b.w(e2.date(e2.date() + Math.round(t3 * r2)), l2);
          };
          if ($2 === c)
            return this.set(c, this.$M + r2);
          if ($2 === h)
            return this.set(h, this.$y + r2);
          if ($2 === a)
            return y2(1);
          if ($2 === o)
            return y2(7);
          var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i2] = t2, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
          return b.w(m3, this);
        }, m2.subtract = function(t3, e2) {
          return this.add(-1 * t3, e2);
        }, m2.format = function(t3) {
          var e2 = this, n2 = this.$locale();
          if (!this.isValid())
            return n2.invalidDate || l;
          var r2 = t3 || "YYYY-MM-DDTHH:mm:ssZ", i3 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t4, n3, i4, s3) {
            return t4 && (t4[n3] || t4(e2, r2)) || i4[n3].slice(0, s3);
          }, d2 = function(t4) {
            return b.s(s2 % 12 || 12, t4, "0");
          }, $2 = f2 || function(t4, e3, n3) {
            var r3 = t4 < 12 ? "AM" : "PM";
            return n3 ? r3.toLowerCase() : r3;
          };
          return r2.replace(y, function(t4, r3) {
            return r3 || function(t5) {
              switch (t5) {
                case "YY":
                  return String(e2.$y).slice(-2);
                case "YYYY":
                  return b.s(e2.$y, 4, "0");
                case "M":
                  return a2 + 1;
                case "MM":
                  return b.s(a2 + 1, 2, "0");
                case "MMM":
                  return h2(n2.monthsShort, a2, c2, 3);
                case "MMMM":
                  return h2(c2, a2);
                case "D":
                  return e2.$D;
                case "DD":
                  return b.s(e2.$D, 2, "0");
                case "d":
                  return String(e2.$W);
                case "dd":
                  return h2(n2.weekdaysMin, e2.$W, o2, 2);
                case "ddd":
                  return h2(n2.weekdaysShort, e2.$W, o2, 3);
                case "dddd":
                  return o2[e2.$W];
                case "H":
                  return String(s2);
                case "HH":
                  return b.s(s2, 2, "0");
                case "h":
                  return d2(1);
                case "hh":
                  return d2(2);
                case "a":
                  return $2(s2, u2, true);
                case "A":
                  return $2(s2, u2, false);
                case "m":
                  return String(u2);
                case "mm":
                  return b.s(u2, 2, "0");
                case "s":
                  return String(e2.$s);
                case "ss":
                  return b.s(e2.$s, 2, "0");
                case "SSS":
                  return b.s(e2.$ms, 3, "0");
                case "Z":
                  return i3;
              }
              return null;
            }(t4) || i3.replace(":", "");
          });
        }, m2.utcOffset = function() {
          return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
        }, m2.diff = function(r2, d2, l2) {
          var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
            return b.m(y2, m3);
          };
          switch (M3) {
            case h:
              $2 = D2() / 12;
              break;
            case c:
              $2 = D2();
              break;
            case f:
              $2 = D2() / 3;
              break;
            case o:
              $2 = (g2 - v2) / 6048e5;
              break;
            case a:
              $2 = (g2 - v2) / 864e5;
              break;
            case u:
              $2 = g2 / n;
              break;
            case s:
              $2 = g2 / e;
              break;
            case i2:
              $2 = g2 / t2;
              break;
            default:
              $2 = g2;
          }
          return l2 ? $2 : b.a($2);
        }, m2.daysInMonth = function() {
          return this.endOf(c).$D;
        }, m2.$locale = function() {
          return D[this.$L];
        }, m2.locale = function(t3, e2) {
          if (!t3)
            return this.$L;
          var n2 = this.clone(), r2 = w(t3, e2, true);
          return r2 && (n2.$L = r2), n2;
        }, m2.clone = function() {
          return b.w(this.$d, this);
        }, m2.toDate = function() {
          return new Date(this.valueOf());
        }, m2.toJSON = function() {
          return this.isValid() ? this.toISOString() : null;
        }, m2.toISOString = function() {
          return this.$d.toISOString();
        }, m2.toString = function() {
          return this.$d.toUTCString();
        }, M2;
      }(), k = _.prototype;
      return O.prototype = k, [["$ms", r], ["$s", i2], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach(function(t3) {
        k[t3[1]] = function(e2) {
          return this.$g(e2, t3[0], t3[1]);
        };
      }), O.extend = function(t3, e2) {
        return t3.$i || (t3(e2, _, O), t3.$i = true), O;
      }, O.locale = w, O.isDayjs = S, O.unix = function(t3) {
        return O(1e3 * t3);
      }, O.en = D[g], O.Ls = D, O.p = {}, O;
    });
  })(dayjs_min);
  var dayjs = dayjs_min.exports;
  function validateDate(dateStr) {
    let date = new Date(Date.parse(dateStr));
    return date instanceof Date && !isNaN(date.getTime());
  }
  function formatDate1(date) {
    if (!validateDate(date)) {
      return date;
    }
    return dayjs(date).format("YYYY-MM-DD");
  }
  function formatDate2(date) {
    if (!validateDate(date)) {
      return date;
    }
    return dayjs(date).format("YYYY/MM/DD");
  }
  function formatDate3(date) {
    if (!validateDate(date)) {
      return date;
    }
    return dayjs(date).format("YYYY\u5E74MM\u6708DD\u65E5");
  }
  function formatDate4(date) {
    if (!validateDate(date)) {
      return date;
    }
    return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
  }
  function formatDate5(date) {
    if (!validateDate(date)) {
      return date;
    }
    return dayjs(date).format("YYYY-MM-DD hh:mm:ss");
  }
  function formatNumber1(v) {
    if (typeof v != "number") {
      return v;
    }
    let length = v.toString().split(".")[1].length;
    switch (length) {
      case 0:
        v = v.toFixed(0);
        break;
      case 1:
        v = v.toFixed(1);
        break;
      case 2:
        v = v.toFixed(2);
        break;
      case 3:
        v = v.toFixed(3);
        break;
      case 4:
        v = v.toFixed(4);
        break;
      case 5:
        v = v.toFixed(5);
        break;
      default:
        v = v.toFixed(6);
    }
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber2(v) {
    if (typeof v != "number") {
      return v;
    }
    let length = v.toString().split(".")[1].length;
    switch (length) {
      case 0:
      case 1:
      case 2:
        v = v.toFixed(2);
        break;
      case 3:
        v = v.toFixed(3);
        break;
      case 4:
        v = v.toFixed(4);
        break;
      case 5:
        v = v.toFixed(5);
        break;
      default:
        v = v.toFixed(6);
    }
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber3(v) {
    if (typeof v != "number") {
      return v;
    }
    v = v.toFixed(6);
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber4(v) {
    if (typeof v != "number") {
      return v;
    }
    v = v.toFixed(3);
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber5(v) {
    if (typeof v != "number") {
      return v;
    }
    v = v.toFixed(2);
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber6(v) {
    if (typeof v != "number") {
      return v;
    }
    v = v.toFixed(0);
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res;
  }
  function formatNumber7(v) {
    if (typeof v != "number") {
      return v;
    }
    let length = v.toString().split(".")[1].length;
    v = v * 100;
    switch (length) {
      case 0:
      case 1:
      case 2:
        v = v.toFixed(2);
        break;
      case 3:
        v = v.toFixed(3);
        break;
      default:
        v = v.toFixed(4);
    }
    let res = v.toString().replace(/\d+/, function(n) {
      return n.replace(/(\d)(?=(\d{3})+$)/g, function($1) {
        return $1 + ",";
      });
    });
    return res + "%";
  }
  var staticContentWrapper_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4q = {
    name: "static-content-wrapper",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      field: Object,
      designer: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designState: {
        type: Boolean,
        default: false
      },
      displayStyle: {
        type: String,
        default: "block"
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    computed: {
      selected() {
        return !!this.designer && this.field.id === this.designer.selectedId;
      },
      customClass() {
        return !!this.field.options.customClass ? this.field.options.customClass.join(" ") : "";
      }
    },
    methods: {
      selectField(field) {
        if (!!this.designer) {
          this.designer.setSelected(field);
          this.designer.emitEvent("field-selected", this.parentWidget);
        }
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      cloneField(field) {
        this.designer.cloneFieldWidget(field, this.parentList);
        this.designer.emitHistoryChange();
      },
      removeFieldWidget() {
        if (!!this.parentList) {
          const fieldRefName = this.designer.selectedWidgetName;
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.formWidget.deleteWidgetRef(fieldRefName);
            this.designer.emitHistoryChange();
          });
        }
      }
    }
  };
  const _hoisted_1$_ = {
    key: 0,
    class: "field-action"
  };
  const _hoisted_2$q = ["title"];
  const _hoisted_3$i = ["title"];
  const _hoisted_4$h = ["title"];
  const _hoisted_5$e = ["title"];
  const _hoisted_6$e = ["title"];
  const _hoisted_7$b = {
    key: 1,
    class: "drag-handler background-opacity"
  };
  const _hoisted_8$a = ["title"];
  const _hoisted_9$9 = { key: 0 };
  function _sfc_render$4q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
      class: require$$0$1.normalizeClass(["field-wrapper", { "design-time-bottom-margin": !!this.designer }]),
      style: require$$0$1.normalizeStyle({ display: $props.displayStyle })
    }, [
      !$props.field.options.hidden || $props.designState === true ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
        key: 0,
        class: require$$0$1.normalizeClass(["static-content-item", [$options.selected ? "selected" : "", $options.customClass]]),
        style: require$$0$1.normalizeStyle({ display: $props.displayStyle }),
        onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => $options.selectField($props.field), ["stop"]))
      }, [
        require$$0$1.renderSlot(_ctx.$slots, "default", {}, void 0, true)
      ], 6)) : require$$0$1.createCommentVNode("", true),
      !!this.designer ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
        $props.designer.selectedId === $props.field.id ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$_, [
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.selectParentWidget"),
            onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => $options.selectParentWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-back" })
          ], 8, _hoisted_2$q),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 0,
            title: _ctx.i18nt("designer.hint.moveUpWidget"),
            onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.moveUpWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-up" })
          ], 8, _hoisted_3$i)) : require$$0$1.createCommentVNode("", true),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 1,
            title: _ctx.i18nt("designer.hint.moveDownWidget"),
            onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => $options.moveDownWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-down" })
          ], 8, _hoisted_4$h)) : require$$0$1.createCommentVNode("", true),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.cloneWidget"),
            onClick: _cache[4] || (_cache[4] = require$$0$1.withModifiers(($event) => $options.cloneField($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-clone" })
          ], 8, _hoisted_5$e),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.remove"),
            onClick: _cache[5] || (_cache[5] = require$$0$1.withModifiers((...args) => $options.removeFieldWidget && $options.removeFieldWidget(...args), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
          ], 8, _hoisted_6$e)
        ])) : require$$0$1.createCommentVNode("", true),
        $props.designer.selectedId === $props.field.id ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_7$b, [
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.dragHandler")
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-drag-move" })
          ], 8, _hoisted_8$a),
          require$$0$1.createElementVNode("i", null, require$$0$1.toDisplayString(_ctx.i18n2t(`designer.widgetLabel.${$props.field.type}`, `extension.widgetLabel.${$props.field.type}`)), 1),
          $props.field.options.hidden === true ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", _hoisted_9$9, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-hide" })
          ])) : require$$0$1.createCommentVNode("", true)
        ])) : require$$0$1.createCommentVNode("", true)
      ], 64)) : require$$0$1.createCommentVNode("", true)
    ], 6);
  }
  var StaticContentWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$4q, [["render", _sfc_render$4q], ["__scopeId", "data-v-25f78db2"]]);
  var __glob_0_19$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": StaticContentWrapper
  }, Symbol.toStringTag, { value: "Module" }));
  const getRegExp = function(validatorName) {
    const commonRegExp = {
      number: "/^[-]?\\d+(\\.\\d+)?$/",
      letter: "/^[A-Za-z]+$/",
      letterAndNumber: "/^[A-Za-z0-9]+$/",
      mobilePhone: "/^[1][3-9][0-9]{9}$/",
      letterStartNumberIncluded: "/^[A-Za-z]+[A-Za-z\\d]*$/",
      noChinese: "/^[^\u4E00-\u9FA5]+$/",
      chinese: "/^[\u4E00-\u9FA5]+$/",
      email: "/^([-_A-Za-z0-9.]+)@([_A-Za-z0-9]+\\.)+[A-Za-z0-9]{2,3}$/",
      url: "/^([hH][tT]{2}[pP]:\\/\\/|[hH][tT]{2}[pP][sS]:\\/\\/)(([A-Za-z0-9-~]+)\\.)+([A-Za-z0-9-~\\/])+$/"
    };
    return commonRegExp[validatorName];
  };
  const validateFn = function(validatorName, rule, value2, callback, defaultErrorMsg) {
    if (isNull(value2) || value2.length <= 0) {
      callback();
      return;
    }
    const reg = evalFn(getRegExp(validatorName));
    if (!reg.test(value2)) {
      let errTxt = rule.errorMsg || defaultErrorMsg;
      callback(new Error(errTxt));
    } else {
      callback();
    }
  };
  const FormValidators = {
    number(rule, value2, callback) {
      validateFn("number", rule, value2, callback, "[" + rule.label + "]\u5305\u542B\u975E\u6570\u5B57\u5B57\u7B26");
    },
    letter(rule, value2, callback) {
      validateFn("letter", rule, value2, callback, "[" + rule.label + "]\u5305\u542B\u975E\u5B57\u6BCD\u5B57\u7B26");
    },
    letterAndNumber(rule, value2, callback) {
      validateFn("letterAndNumber", rule, value2, callback, "[" + rule.label + "]\u53EA\u80FD\u8F93\u5165\u5B57\u6BCD\u6216\u6570\u5B57");
    },
    mobilePhone(rule, value2, callback) {
      validateFn("mobilePhone", rule, value2, callback, "[" + rule.label + "]\u624B\u673A\u53F7\u7801\u683C\u5F0F\u6709\u8BEF");
    },
    noBlankStart(rule, value2, callback) {
    },
    noBlankEnd(rule, value2, callback) {
    },
    letterStartNumberIncluded(rule, value2, callback) {
      validateFn("letterStartNumberIncluded", rule, value2, callback, "[" + rule.label + "]\u5FC5\u987B\u4EE5\u5B57\u6BCD\u5F00\u5934\uFF0C\u53EF\u5305\u542B\u6570\u5B57");
    },
    noChinese(rule, value2, callback) {
      validateFn("noChinese", rule, value2, callback, "[" + rule.label + "]\u4E0D\u53EF\u8F93\u5165\u4E2D\u6587\u5B57\u7B26");
    },
    chinese(rule, value2, callback) {
      validateFn("chinese", rule, value2, callback, "[" + rule.label + "]\u53EA\u80FD\u8F93\u5165\u4E2D\u6587\u5B57\u7B26");
    },
    email(rule, value2, callback) {
      validateFn("email", rule, value2, callback, "[" + rule.label + "]\u90AE\u7BB1\u683C\u5F0F\u6709\u8BEF");
    },
    url(rule, value2, callback) {
      validateFn("url", rule, value2, callback, "[" + rule.label + "]URL\u683C\u5F0F\u6709\u8BEF");
    },
    regExp(rule, value2, callback) {
      if (isNull(value2) || value2.length <= 0) {
        callback();
        return;
      }
      if (rule.regExp.length > 0 && rule.regExp[0] !== "/") {
        rule.regExp = "/" + rule.regExp;
      }
      if (rule.regExp.length > 0 && rule.regExp[rule.regExp.length - 1] !== "/") {
        rule.regExp = rule.regExp + "/";
      }
      const pattern = evalFn(rule.regExp);
      if (!pattern.test(value2)) {
        let errTxt = rule.errorMsg || "[" + rule.label + "]invalid value";
        callback(new Error(errTxt));
      } else {
        callback();
      }
    }
  };
  var jstat = { exports: {} };
  (function(module2, exports2) {
    (function(window2, factory) {
      {
        module2.exports = factory();
      }
    })(commonjsGlobal, function() {
      var jStat2 = function(Math2, undefined$1) {
        var concat = Array.prototype.concat;
        var slice = Array.prototype.slice;
        var toString2 = Object.prototype.toString;
        function calcRdx(n, m) {
          var val = n > m ? n : m;
          return Math2.pow(10, 17 - ~~(Math2.log(val > 0 ? val : -val) * Math2.LOG10E));
        }
        var isArray2 = Array.isArray || function isArray3(arg) {
          return toString2.call(arg) === "[object Array]";
        };
        function isFunction2(arg) {
          return toString2.call(arg) === "[object Function]";
        }
        function isNumber2(num2) {
          return typeof num2 === "number" ? num2 - num2 === 0 : false;
        }
        function toVector(arr) {
          return concat.apply([], arr);
        }
        function jStat3() {
          return new jStat3._init(arguments);
        }
        jStat3.fn = jStat3.prototype;
        jStat3._init = function _init(args) {
          if (isArray2(args[0])) {
            if (isArray2(args[0][0])) {
              if (isFunction2(args[1]))
                args[0] = jStat3.map(args[0], args[1]);
              for (var i2 = 0; i2 < args[0].length; i2++)
                this[i2] = args[0][i2];
              this.length = args[0].length;
            } else {
              this[0] = isFunction2(args[1]) ? jStat3.map(args[0], args[1]) : args[0];
              this.length = 1;
            }
          } else if (isNumber2(args[0])) {
            this[0] = jStat3.seq.apply(null, args);
            this.length = 1;
          } else if (args[0] instanceof jStat3) {
            return jStat3(args[0].toArray());
          } else {
            this[0] = [];
            this.length = 1;
          }
          return this;
        };
        jStat3._init.prototype = jStat3.prototype;
        jStat3._init.constructor = jStat3;
        jStat3.utils = {
          calcRdx,
          isArray: isArray2,
          isFunction: isFunction2,
          isNumber: isNumber2,
          toVector
        };
        jStat3._random_fn = Math2.random;
        jStat3.setRandom = function setRandom(fn) {
          if (typeof fn !== "function")
            throw new TypeError("fn is not a function");
          jStat3._random_fn = fn;
        };
        jStat3.extend = function extend2(obj) {
          var i2, j;
          if (arguments.length === 1) {
            for (j in obj)
              jStat3[j] = obj[j];
            return this;
          }
          for (i2 = 1; i2 < arguments.length; i2++) {
            for (j in arguments[i2])
              obj[j] = arguments[i2][j];
          }
          return obj;
        };
        jStat3.rows = function rows(arr) {
          return arr.length || 1;
        };
        jStat3.cols = function cols(arr) {
          return arr[0].length || 1;
        };
        jStat3.dimensions = function dimensions(arr) {
          return {
            rows: jStat3.rows(arr),
            cols: jStat3.cols(arr)
          };
        };
        jStat3.row = function row(arr, index2) {
          if (isArray2(index2)) {
            return index2.map(function(i2) {
              return jStat3.row(arr, i2);
            });
          }
          return arr[index2];
        };
        jStat3.rowa = function rowa(arr, i2) {
          return jStat3.row(arr, i2);
        };
        jStat3.col = function col(arr, index2) {
          if (isArray2(index2)) {
            var submat = jStat3.arange(arr.length).map(function() {
              return new Array(index2.length);
            });
            index2.forEach(function(ind, i3) {
              jStat3.arange(arr.length).forEach(function(j) {
                submat[j][i3] = arr[j][ind];
              });
            });
            return submat;
          }
          var column = new Array(arr.length);
          for (var i2 = 0; i2 < arr.length; i2++)
            column[i2] = [arr[i2][index2]];
          return column;
        };
        jStat3.cola = function cola(arr, i2) {
          return jStat3.col(arr, i2).map(function(a) {
            return a[0];
          });
        };
        jStat3.diag = function diag(arr) {
          var nrow = jStat3.rows(arr);
          var res = new Array(nrow);
          for (var row = 0; row < nrow; row++)
            res[row] = [arr[row][row]];
          return res;
        };
        jStat3.antidiag = function antidiag(arr) {
          var nrow = jStat3.rows(arr) - 1;
          var res = new Array(nrow);
          for (var i2 = 0; nrow >= 0; nrow--, i2++)
            res[i2] = [arr[i2][nrow]];
          return res;
        };
        jStat3.transpose = function transpose2(arr) {
          var obj = [];
          var objArr, rows, cols, j, i2;
          if (!isArray2(arr[0]))
            arr = [arr];
          rows = arr.length;
          cols = arr[0].length;
          for (i2 = 0; i2 < cols; i2++) {
            objArr = new Array(rows);
            for (j = 0; j < rows; j++)
              objArr[j] = arr[j][i2];
            obj.push(objArr);
          }
          return obj.length === 1 ? obj[0] : obj;
        };
        jStat3.map = function map(arr, func, toAlter) {
          var row, nrow, ncol, res, col;
          if (!isArray2(arr[0]))
            arr = [arr];
          nrow = arr.length;
          ncol = arr[0].length;
          res = toAlter ? arr : new Array(nrow);
          for (row = 0; row < nrow; row++) {
            if (!res[row])
              res[row] = new Array(ncol);
            for (col = 0; col < ncol; col++)
              res[row][col] = func(arr[row][col], row, col);
          }
          return res.length === 1 ? res[0] : res;
        };
        jStat3.cumreduce = function cumreduce(arr, func, toAlter) {
          var row, nrow, ncol, res, col;
          if (!isArray2(arr[0]))
            arr = [arr];
          nrow = arr.length;
          ncol = arr[0].length;
          res = toAlter ? arr : new Array(nrow);
          for (row = 0; row < nrow; row++) {
            if (!res[row])
              res[row] = new Array(ncol);
            if (ncol > 0)
              res[row][0] = arr[row][0];
            for (col = 1; col < ncol; col++)
              res[row][col] = func(res[row][col - 1], arr[row][col]);
          }
          return res.length === 1 ? res[0] : res;
        };
        jStat3.alter = function alter(arr, func) {
          return jStat3.map(arr, func, true);
        };
        jStat3.create = function create(rows, cols, func) {
          var res = new Array(rows);
          var i2, j;
          if (isFunction2(cols)) {
            func = cols;
            cols = rows;
          }
          for (i2 = 0; i2 < rows; i2++) {
            res[i2] = new Array(cols);
            for (j = 0; j < cols; j++)
              res[i2][j] = func(i2, j);
          }
          return res;
        };
        function retZero() {
          return 0;
        }
        jStat3.zeros = function zeros(rows, cols) {
          if (!isNumber2(cols))
            cols = rows;
          return jStat3.create(rows, cols, retZero);
        };
        function retOne() {
          return 1;
        }
        jStat3.ones = function ones(rows, cols) {
          if (!isNumber2(cols))
            cols = rows;
          return jStat3.create(rows, cols, retOne);
        };
        jStat3.rand = function rand(rows, cols) {
          if (!isNumber2(cols))
            cols = rows;
          return jStat3.create(rows, cols, jStat3._random_fn);
        };
        function retIdent(i2, j) {
          return i2 === j ? 1 : 0;
        }
        jStat3.identity = function identity(rows, cols) {
          if (!isNumber2(cols))
            cols = rows;
          return jStat3.create(rows, cols, retIdent);
        };
        jStat3.symmetric = function symmetric(arr) {
          var size = arr.length;
          var row, col;
          if (arr.length !== arr[0].length)
            return false;
          for (row = 0; row < size; row++) {
            for (col = 0; col < size; col++)
              if (arr[col][row] !== arr[row][col])
                return false;
          }
          return true;
        };
        jStat3.clear = function clear(arr) {
          return jStat3.alter(arr, retZero);
        };
        jStat3.seq = function seq(min, max, length, func) {
          if (!isFunction2(func))
            func = false;
          var arr = [];
          var hival = calcRdx(min, max);
          var step = (max * hival - min * hival) / ((length - 1) * hival);
          var current = min;
          var cnt;
          for (cnt = 0; current <= max && cnt < length; cnt++, current = (min * hival + step * hival * cnt) / hival) {
            arr.push(func ? func(current, cnt) : current);
          }
          return arr;
        };
        jStat3.arange = function arange(start, end, step) {
          var rl = [];
          var i2;
          step = step || 1;
          if (end === undefined$1) {
            end = start;
            start = 0;
          }
          if (start === end || step === 0) {
            return [];
          }
          if (start < end && step < 0) {
            return [];
          }
          if (start > end && step > 0) {
            return [];
          }
          if (step > 0) {
            for (i2 = start; i2 < end; i2 += step) {
              rl.push(i2);
            }
          } else {
            for (i2 = start; i2 > end; i2 += step) {
              rl.push(i2);
            }
          }
          return rl;
        };
        jStat3.slice = function() {
          function _slice(list, start, end, step) {
            var i2;
            var rl = [];
            var length = list.length;
            if (start === undefined$1 && end === undefined$1 && step === undefined$1) {
              return jStat3.copy(list);
            }
            start = start || 0;
            end = end || list.length;
            start = start >= 0 ? start : length + start;
            end = end >= 0 ? end : length + end;
            step = step || 1;
            if (start === end || step === 0) {
              return [];
            }
            if (start < end && step < 0) {
              return [];
            }
            if (start > end && step > 0) {
              return [];
            }
            if (step > 0) {
              for (i2 = start; i2 < end; i2 += step) {
                rl.push(list[i2]);
              }
            } else {
              for (i2 = start; i2 > end; i2 += step) {
                rl.push(list[i2]);
              }
            }
            return rl;
          }
          function slice2(list, rcSlice) {
            var colSlice, rowSlice;
            rcSlice = rcSlice || {};
            if (isNumber2(rcSlice.row)) {
              if (isNumber2(rcSlice.col))
                return list[rcSlice.row][rcSlice.col];
              var row = jStat3.rowa(list, rcSlice.row);
              colSlice = rcSlice.col || {};
              return _slice(row, colSlice.start, colSlice.end, colSlice.step);
            }
            if (isNumber2(rcSlice.col)) {
              var col = jStat3.cola(list, rcSlice.col);
              rowSlice = rcSlice.row || {};
              return _slice(col, rowSlice.start, rowSlice.end, rowSlice.step);
            }
            rowSlice = rcSlice.row || {};
            colSlice = rcSlice.col || {};
            var rows = _slice(list, rowSlice.start, rowSlice.end, rowSlice.step);
            return rows.map(function(row2) {
              return _slice(row2, colSlice.start, colSlice.end, colSlice.step);
            });
          }
          return slice2;
        }();
        jStat3.sliceAssign = function sliceAssign(A, rcSlice, B) {
          var nl, ml;
          if (isNumber2(rcSlice.row)) {
            if (isNumber2(rcSlice.col))
              return A[rcSlice.row][rcSlice.col] = B;
            rcSlice.col = rcSlice.col || {};
            rcSlice.col.start = rcSlice.col.start || 0;
            rcSlice.col.end = rcSlice.col.end || A[0].length;
            rcSlice.col.step = rcSlice.col.step || 1;
            nl = jStat3.arange(rcSlice.col.start, Math2.min(A.length, rcSlice.col.end), rcSlice.col.step);
            var m = rcSlice.row;
            nl.forEach(function(n2, i2) {
              A[m][n2] = B[i2];
            });
            return A;
          }
          if (isNumber2(rcSlice.col)) {
            rcSlice.row = rcSlice.row || {};
            rcSlice.row.start = rcSlice.row.start || 0;
            rcSlice.row.end = rcSlice.row.end || A.length;
            rcSlice.row.step = rcSlice.row.step || 1;
            ml = jStat3.arange(rcSlice.row.start, Math2.min(A[0].length, rcSlice.row.end), rcSlice.row.step);
            var n = rcSlice.col;
            ml.forEach(function(m2, j) {
              A[m2][n] = B[j];
            });
            return A;
          }
          if (B[0].length === undefined$1) {
            B = [B];
          }
          rcSlice.row.start = rcSlice.row.start || 0;
          rcSlice.row.end = rcSlice.row.end || A.length;
          rcSlice.row.step = rcSlice.row.step || 1;
          rcSlice.col.start = rcSlice.col.start || 0;
          rcSlice.col.end = rcSlice.col.end || A[0].length;
          rcSlice.col.step = rcSlice.col.step || 1;
          ml = jStat3.arange(rcSlice.row.start, Math2.min(A.length, rcSlice.row.end), rcSlice.row.step);
          nl = jStat3.arange(rcSlice.col.start, Math2.min(A[0].length, rcSlice.col.end), rcSlice.col.step);
          ml.forEach(function(m2, i2) {
            nl.forEach(function(n2, j) {
              A[m2][n2] = B[i2][j];
            });
          });
          return A;
        };
        jStat3.diagonal = function diagonal(diagArray) {
          var mat = jStat3.zeros(diagArray.length, diagArray.length);
          diagArray.forEach(function(t2, i2) {
            mat[i2][i2] = t2;
          });
          return mat;
        };
        jStat3.copy = function copy(A) {
          return A.map(function(row) {
            if (isNumber2(row))
              return row;
            return row.map(function(t2) {
              return t2;
            });
          });
        };
        var jProto = jStat3.prototype;
        jProto.length = 0;
        jProto.push = Array.prototype.push;
        jProto.sort = Array.prototype.sort;
        jProto.splice = Array.prototype.splice;
        jProto.slice = Array.prototype.slice;
        jProto.toArray = function toArray() {
          return this.length > 1 ? slice.call(this) : slice.call(this)[0];
        };
        jProto.map = function map(func, toAlter) {
          return jStat3(jStat3.map(this, func, toAlter));
        };
        jProto.cumreduce = function cumreduce(func, toAlter) {
          return jStat3(jStat3.cumreduce(this, func, toAlter));
        };
        jProto.alter = function alter(func) {
          jStat3.alter(this, func);
          return this;
        };
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function(func) {
                var self2 = this, results;
                if (func) {
                  setTimeout(function() {
                    func.call(self2, jProto[passfunc].call(self2));
                  });
                  return this;
                }
                results = jStat3[passfunc](this);
                return isArray2(results) ? jStat3(results) : results;
              };
            })(funcs[i2]);
        })("transpose clear symmetric rows cols dimensions diag antidiag".split(" "));
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function(index2, func) {
                var self2 = this;
                if (func) {
                  setTimeout(function() {
                    func.call(self2, jProto[passfunc].call(self2, index2));
                  });
                  return this;
                }
                return jStat3(jStat3[passfunc](this, index2));
              };
            })(funcs[i2]);
        })("row col".split(" "));
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function() {
                return jStat3(jStat3[passfunc].apply(null, arguments));
              };
            })(funcs[i2]);
        })("create zeros ones rand identity".split(" "));
        return jStat3;
      }(Math);
      (function(jStat3, Math2) {
        var isFunction2 = jStat3.utils.isFunction;
        function ascNum(a, b) {
          return a - b;
        }
        function clip(arg, min, max) {
          return Math2.max(min, Math2.min(arg, max));
        }
        jStat3.sum = function sum(arr) {
          var sum2 = 0;
          var i2 = arr.length;
          while (--i2 >= 0)
            sum2 += arr[i2];
          return sum2;
        };
        jStat3.sumsqrd = function sumsqrd(arr) {
          var sum = 0;
          var i2 = arr.length;
          while (--i2 >= 0)
            sum += arr[i2] * arr[i2];
          return sum;
        };
        jStat3.sumsqerr = function sumsqerr(arr) {
          var mean = jStat3.mean(arr);
          var sum = 0;
          var i2 = arr.length;
          var tmp;
          while (--i2 >= 0) {
            tmp = arr[i2] - mean;
            sum += tmp * tmp;
          }
          return sum;
        };
        jStat3.sumrow = function sumrow(arr) {
          var sum = 0;
          var i2 = arr.length;
          while (--i2 >= 0)
            sum += arr[i2];
          return sum;
        };
        jStat3.product = function product(arr) {
          var prod = 1;
          var i2 = arr.length;
          while (--i2 >= 0)
            prod *= arr[i2];
          return prod;
        };
        jStat3.min = function min(arr) {
          var low = arr[0];
          var i2 = 0;
          while (++i2 < arr.length)
            if (arr[i2] < low)
              low = arr[i2];
          return low;
        };
        jStat3.max = function max(arr) {
          var high = arr[0];
          var i2 = 0;
          while (++i2 < arr.length)
            if (arr[i2] > high)
              high = arr[i2];
          return high;
        };
        jStat3.unique = function unique(arr) {
          var hash = {}, _arr = [];
          for (var i2 = 0; i2 < arr.length; i2++) {
            if (!hash[arr[i2]]) {
              hash[arr[i2]] = true;
              _arr.push(arr[i2]);
            }
          }
          return _arr;
        };
        jStat3.mean = function mean(arr) {
          return jStat3.sum(arr) / arr.length;
        };
        jStat3.meansqerr = function meansqerr(arr) {
          return jStat3.sumsqerr(arr) / arr.length;
        };
        jStat3.geomean = function geomean(arr) {
          var logs = arr.map(Math2.log);
          var meanOfLogs = jStat3.mean(logs);
          return Math2.exp(meanOfLogs);
        };
        jStat3.median = function median(arr) {
          var arrlen = arr.length;
          var _arr = arr.slice().sort(ascNum);
          return !(arrlen & 1) ? (_arr[arrlen / 2 - 1] + _arr[arrlen / 2]) / 2 : _arr[arrlen / 2 | 0];
        };
        jStat3.cumsum = function cumsum(arr) {
          return jStat3.cumreduce(arr, function(a, b) {
            return a + b;
          });
        };
        jStat3.cumprod = function cumprod(arr) {
          return jStat3.cumreduce(arr, function(a, b) {
            return a * b;
          });
        };
        jStat3.diff = function diff(arr) {
          var diffs = [];
          var arrLen = arr.length;
          var i2;
          for (i2 = 1; i2 < arrLen; i2++)
            diffs.push(arr[i2] - arr[i2 - 1]);
          return diffs;
        };
        jStat3.rank = function(arr) {
          var i2;
          var distinctNumbers = [];
          var numberCounts = {};
          for (i2 = 0; i2 < arr.length; i2++) {
            var number2 = arr[i2];
            if (numberCounts[number2]) {
              numberCounts[number2]++;
            } else {
              numberCounts[number2] = 1;
              distinctNumbers.push(number2);
            }
          }
          var sortedDistinctNumbers = distinctNumbers.sort(ascNum);
          var numberRanks = {};
          var currentRank = 1;
          for (i2 = 0; i2 < sortedDistinctNumbers.length; i2++) {
            var number2 = sortedDistinctNumbers[i2];
            var count = numberCounts[number2];
            var first = currentRank;
            var last = currentRank + count - 1;
            var rank = (first + last) / 2;
            numberRanks[number2] = rank;
            currentRank += count;
          }
          return arr.map(function(number3) {
            return numberRanks[number3];
          });
        };
        jStat3.mode = function mode(arr) {
          var arrLen = arr.length;
          var _arr = arr.slice().sort(ascNum);
          var count = 1;
          var maxCount = 0;
          var numMaxCount = 0;
          var mode_arr = [];
          var i2;
          for (i2 = 0; i2 < arrLen; i2++) {
            if (_arr[i2] === _arr[i2 + 1]) {
              count++;
            } else {
              if (count > maxCount) {
                mode_arr = [_arr[i2]];
                maxCount = count;
                numMaxCount = 0;
              } else if (count === maxCount) {
                mode_arr.push(_arr[i2]);
                numMaxCount++;
              }
              count = 1;
            }
          }
          return numMaxCount === 0 ? mode_arr[0] : mode_arr;
        };
        jStat3.range = function range(arr) {
          return jStat3.max(arr) - jStat3.min(arr);
        };
        jStat3.variance = function variance(arr, flag) {
          return jStat3.sumsqerr(arr) / (arr.length - (flag ? 1 : 0));
        };
        jStat3.pooledvariance = function pooledvariance(arr) {
          var sumsqerr = arr.reduce(function(a, samples) {
            return a + jStat3.sumsqerr(samples);
          }, 0);
          var count = arr.reduce(function(a, samples) {
            return a + samples.length;
          }, 0);
          return sumsqerr / (count - arr.length);
        };
        jStat3.deviation = function(arr) {
          var mean = jStat3.mean(arr);
          var arrlen = arr.length;
          var dev = new Array(arrlen);
          for (var i2 = 0; i2 < arrlen; i2++) {
            dev[i2] = arr[i2] - mean;
          }
          return dev;
        };
        jStat3.stdev = function stdev(arr, flag) {
          return Math2.sqrt(jStat3.variance(arr, flag));
        };
        jStat3.pooledstdev = function pooledstdev(arr) {
          return Math2.sqrt(jStat3.pooledvariance(arr));
        };
        jStat3.meandev = function meandev(arr) {
          var mean = jStat3.mean(arr);
          var a = [];
          for (var i2 = arr.length - 1; i2 >= 0; i2--) {
            a.push(Math2.abs(arr[i2] - mean));
          }
          return jStat3.mean(a);
        };
        jStat3.meddev = function meddev(arr) {
          var median = jStat3.median(arr);
          var a = [];
          for (var i2 = arr.length - 1; i2 >= 0; i2--) {
            a.push(Math2.abs(arr[i2] - median));
          }
          return jStat3.median(a);
        };
        jStat3.coeffvar = function coeffvar(arr) {
          return jStat3.stdev(arr) / jStat3.mean(arr);
        };
        jStat3.quartiles = function quartiles(arr) {
          var arrlen = arr.length;
          var _arr = arr.slice().sort(ascNum);
          return [
            _arr[Math2.round(arrlen / 4) - 1],
            _arr[Math2.round(arrlen / 2) - 1],
            _arr[Math2.round(arrlen * 3 / 4) - 1]
          ];
        };
        jStat3.quantiles = function quantiles(arr, quantilesArray, alphap, betap) {
          var sortedArray = arr.slice().sort(ascNum);
          var quantileVals = [quantilesArray.length];
          var n = arr.length;
          var i2, p, m, aleph, k, gamma;
          if (typeof alphap === "undefined")
            alphap = 3 / 8;
          if (typeof betap === "undefined")
            betap = 3 / 8;
          for (i2 = 0; i2 < quantilesArray.length; i2++) {
            p = quantilesArray[i2];
            m = alphap + p * (1 - alphap - betap);
            aleph = n * p + m;
            k = Math2.floor(clip(aleph, 1, n - 1));
            gamma = clip(aleph - k, 0, 1);
            quantileVals[i2] = (1 - gamma) * sortedArray[k - 1] + gamma * sortedArray[k];
          }
          return quantileVals;
        };
        jStat3.percentile = function percentile(arr, k, exclusive) {
          var _arr = arr.slice().sort(ascNum);
          var realIndex = k * (_arr.length + (exclusive ? 1 : -1)) + (exclusive ? 0 : 1);
          var index2 = parseInt(realIndex);
          var frac = realIndex - index2;
          if (index2 + 1 < _arr.length) {
            return _arr[index2 - 1] + frac * (_arr[index2] - _arr[index2 - 1]);
          } else {
            return _arr[index2 - 1];
          }
        };
        jStat3.percentileOfScore = function percentileOfScore(arr, score2, kind) {
          var counter = 0;
          var len = arr.length;
          var strict = false;
          var value2, i2;
          if (kind === "strict")
            strict = true;
          for (i2 = 0; i2 < len; i2++) {
            value2 = arr[i2];
            if (strict && value2 < score2 || !strict && value2 <= score2) {
              counter++;
            }
          }
          return counter / len;
        };
        jStat3.histogram = function histogram(arr, binCnt) {
          binCnt = binCnt || 4;
          var first = jStat3.min(arr);
          var binWidth = (jStat3.max(arr) - first) / binCnt;
          var len = arr.length;
          var bins = [];
          var i2;
          for (i2 = 0; i2 < binCnt; i2++)
            bins[i2] = 0;
          for (i2 = 0; i2 < len; i2++)
            bins[Math2.min(Math2.floor((arr[i2] - first) / binWidth), binCnt - 1)] += 1;
          return bins;
        };
        jStat3.covariance = function covariance(arr1, arr2) {
          var u = jStat3.mean(arr1);
          var v = jStat3.mean(arr2);
          var arr1Len = arr1.length;
          var sq_dev = new Array(arr1Len);
          var i2;
          for (i2 = 0; i2 < arr1Len; i2++)
            sq_dev[i2] = (arr1[i2] - u) * (arr2[i2] - v);
          return jStat3.sum(sq_dev) / (arr1Len - 1);
        };
        jStat3.corrcoeff = function corrcoeff(arr1, arr2) {
          return jStat3.covariance(arr1, arr2) / jStat3.stdev(arr1, 1) / jStat3.stdev(arr2, 1);
        };
        jStat3.spearmancoeff = function(arr1, arr2) {
          arr1 = jStat3.rank(arr1);
          arr2 = jStat3.rank(arr2);
          return jStat3.corrcoeff(arr1, arr2);
        };
        jStat3.stanMoment = function stanMoment(arr, n) {
          var mu = jStat3.mean(arr);
          var sigma = jStat3.stdev(arr);
          var len = arr.length;
          var skewSum = 0;
          for (var i2 = 0; i2 < len; i2++)
            skewSum += Math2.pow((arr[i2] - mu) / sigma, n);
          return skewSum / arr.length;
        };
        jStat3.skewness = function skewness(arr) {
          return jStat3.stanMoment(arr, 3);
        };
        jStat3.kurtosis = function kurtosis(arr) {
          return jStat3.stanMoment(arr, 4) - 3;
        };
        var jProto = jStat3.prototype;
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function(fullbool, func) {
                var arr = [];
                var i3 = 0;
                var tmpthis = this;
                if (isFunction2(fullbool)) {
                  func = fullbool;
                  fullbool = false;
                }
                if (func) {
                  setTimeout(function() {
                    func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));
                  });
                  return this;
                }
                if (this.length > 1) {
                  tmpthis = fullbool === true ? this : this.transpose();
                  for (; i3 < tmpthis.length; i3++)
                    arr[i3] = jStat3[passfunc](tmpthis[i3]);
                  return arr;
                }
                return jStat3[passfunc](this[0], fullbool);
              };
            })(funcs[i2]);
        })("cumsum cumprod".split(" "));
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function(fullbool, func) {
                var arr = [];
                var i3 = 0;
                var tmpthis = this;
                if (isFunction2(fullbool)) {
                  func = fullbool;
                  fullbool = false;
                }
                if (func) {
                  setTimeout(function() {
                    func.call(tmpthis, jProto[passfunc].call(tmpthis, fullbool));
                  });
                  return this;
                }
                if (this.length > 1) {
                  if (passfunc !== "sumrow")
                    tmpthis = fullbool === true ? this : this.transpose();
                  for (; i3 < tmpthis.length; i3++)
                    arr[i3] = jStat3[passfunc](tmpthis[i3]);
                  return fullbool === true ? jStat3[passfunc](jStat3.utils.toVector(arr)) : arr;
                }
                return jStat3[passfunc](this[0], fullbool);
              };
            })(funcs[i2]);
        })("sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis".split(" "));
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jProto[passfunc] = function() {
                var arr = [];
                var i3 = 0;
                var tmpthis = this;
                var args = Array.prototype.slice.call(arguments);
                var callbackFunction;
                if (isFunction2(args[args.length - 1])) {
                  callbackFunction = args[args.length - 1];
                  var argsToPass = args.slice(0, args.length - 1);
                  setTimeout(function() {
                    callbackFunction.call(tmpthis, jProto[passfunc].apply(tmpthis, argsToPass));
                  });
                  return this;
                } else {
                  callbackFunction = void 0;
                  var curriedFunction = function curriedFunction2(vector) {
                    return jStat3[passfunc].apply(tmpthis, [vector].concat(args));
                  };
                }
                if (this.length > 1) {
                  tmpthis = tmpthis.transpose();
                  for (; i3 < tmpthis.length; i3++)
                    arr[i3] = curriedFunction(tmpthis[i3]);
                  return arr;
                }
                return curriedFunction(this[0]);
              };
            })(funcs[i2]);
        })("quantiles percentileOfScore".split(" "));
      })(jStat2, Math);
      (function(jStat3, Math2) {
        jStat3.gammaln = function gammaln(x) {
          var j = 0;
          var cof = [
            76.18009172947146,
            -86.50532032941678,
            24.01409824083091,
            -1.231739572450155,
            0.001208650973866179,
            -5395239384953e-18
          ];
          var ser = 1.000000000190015;
          var xx, y, tmp;
          tmp = (y = xx = x) + 5.5;
          tmp -= (xx + 0.5) * Math2.log(tmp);
          for (; j < 6; j++)
            ser += cof[j] / ++y;
          return Math2.log(2.5066282746310007 * ser / xx) - tmp;
        };
        jStat3.loggam = function loggam(x) {
          var x0, x2, xp, gl, gl0;
          var k, n;
          var a = [
            0.08333333333333333,
            -0.002777777777777778,
            7936507936507937e-19,
            -5952380952380952e-19,
            8417508417508418e-19,
            -0.001917526917526918,
            0.00641025641025641,
            -0.02955065359477124,
            0.1796443723688307,
            -1.3924322169059
          ];
          x0 = x;
          n = 0;
          if (x == 1 || x == 2) {
            return 0;
          }
          if (x <= 7) {
            n = Math2.floor(7 - x);
            x0 = x + n;
          }
          x2 = 1 / (x0 * x0);
          xp = 2 * Math2.PI;
          gl0 = a[9];
          for (k = 8; k >= 0; k--) {
            gl0 *= x2;
            gl0 += a[k];
          }
          gl = gl0 / x0 + 0.5 * Math2.log(xp) + (x0 - 0.5) * Math2.log(x0) - x0;
          if (x <= 7) {
            for (k = 1; k <= n; k++) {
              gl -= Math2.log(x0 - 1);
              x0 -= 1;
            }
          }
          return gl;
        };
        jStat3.gammafn = function gammafn(x) {
          var p = [
            -1.716185138865495,
            24.76565080557592,
            -379.80425647094563,
            629.3311553128184,
            866.9662027904133,
            -31451.272968848367,
            -36144.413418691176,
            66456.14382024054
          ];
          var q = [
            -30.8402300119739,
            315.35062697960416,
            -1015.1563674902192,
            -3107.771671572311,
            22538.11842098015,
            4755.846277527881,
            -134659.9598649693,
            -115132.2596755535
          ];
          var fact = false;
          var n = 0;
          var xden = 0;
          var xnum = 0;
          var y = x;
          var i2, z, yi, res;
          if (x > 171.6243769536076) {
            return Infinity;
          }
          if (y <= 0) {
            res = y % 1 + 36e-17;
            if (res) {
              fact = (!(y & 1) ? 1 : -1) * Math2.PI / Math2.sin(Math2.PI * res);
              y = 1 - y;
            } else {
              return Infinity;
            }
          }
          yi = y;
          if (y < 1) {
            z = y++;
          } else {
            z = (y -= n = (y | 0) - 1) - 1;
          }
          for (i2 = 0; i2 < 8; ++i2) {
            xnum = (xnum + p[i2]) * z;
            xden = xden * z + q[i2];
          }
          res = xnum / xden + 1;
          if (yi < y) {
            res /= yi;
          } else if (yi > y) {
            for (i2 = 0; i2 < n; ++i2) {
              res *= y;
              y++;
            }
          }
          if (fact) {
            res = fact / res;
          }
          return res;
        };
        jStat3.gammap = function gammap(a, x) {
          return jStat3.lowRegGamma(a, x) * jStat3.gammafn(a);
        };
        jStat3.lowRegGamma = function lowRegGamma(a, x) {
          var aln = jStat3.gammaln(a);
          var ap = a;
          var sum = 1 / a;
          var del = sum;
          var b = x + 1 - a;
          var c = 1 / 1e-30;
          var d = 1 / b;
          var h = d;
          var i2 = 1;
          var ITMAX = -~(Math2.log(a >= 1 ? a : 1 / a) * 8.5 + a * 0.4 + 17);
          var an;
          if (x < 0 || a <= 0) {
            return NaN;
          } else if (x < a + 1) {
            for (; i2 <= ITMAX; i2++) {
              sum += del *= x / ++ap;
            }
            return sum * Math2.exp(-x + a * Math2.log(x) - aln);
          }
          for (; i2 <= ITMAX; i2++) {
            an = -i2 * (i2 - a);
            b += 2;
            d = an * d + b;
            c = b + an / c;
            d = 1 / d;
            h *= d * c;
          }
          return 1 - h * Math2.exp(-x + a * Math2.log(x) - aln);
        };
        jStat3.factorialln = function factorialln(n) {
          return n < 0 ? NaN : jStat3.gammaln(n + 1);
        };
        jStat3.factorial = function factorial(n) {
          return n < 0 ? NaN : jStat3.gammafn(n + 1);
        };
        jStat3.combination = function combination(n, m) {
          return n > 170 || m > 170 ? Math2.exp(jStat3.combinationln(n, m)) : jStat3.factorial(n) / jStat3.factorial(m) / jStat3.factorial(n - m);
        };
        jStat3.combinationln = function combinationln(n, m) {
          return jStat3.factorialln(n) - jStat3.factorialln(m) - jStat3.factorialln(n - m);
        };
        jStat3.permutation = function permutation(n, m) {
          return jStat3.factorial(n) / jStat3.factorial(n - m);
        };
        jStat3.betafn = function betafn(x, y) {
          if (x <= 0 || y <= 0)
            return void 0;
          return x + y > 170 ? Math2.exp(jStat3.betaln(x, y)) : jStat3.gammafn(x) * jStat3.gammafn(y) / jStat3.gammafn(x + y);
        };
        jStat3.betaln = function betaln(x, y) {
          return jStat3.gammaln(x) + jStat3.gammaln(y) - jStat3.gammaln(x + y);
        };
        jStat3.betacf = function betacf(x, a, b) {
          var fpmin = 1e-30;
          var m = 1;
          var qab = a + b;
          var qap = a + 1;
          var qam = a - 1;
          var c = 1;
          var d = 1 - qab * x / qap;
          var m2, aa, del, h;
          if (Math2.abs(d) < fpmin)
            d = fpmin;
          d = 1 / d;
          h = d;
          for (; m <= 100; m++) {
            m2 = 2 * m;
            aa = m * (b - m) * x / ((qam + m2) * (a + m2));
            d = 1 + aa * d;
            if (Math2.abs(d) < fpmin)
              d = fpmin;
            c = 1 + aa / c;
            if (Math2.abs(c) < fpmin)
              c = fpmin;
            d = 1 / d;
            h *= d * c;
            aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));
            d = 1 + aa * d;
            if (Math2.abs(d) < fpmin)
              d = fpmin;
            c = 1 + aa / c;
            if (Math2.abs(c) < fpmin)
              c = fpmin;
            d = 1 / d;
            del = d * c;
            h *= del;
            if (Math2.abs(del - 1) < 3e-7)
              break;
          }
          return h;
        };
        jStat3.gammapinv = function gammapinv(p, a) {
          var j = 0;
          var a1 = a - 1;
          var EPS = 1e-8;
          var gln = jStat3.gammaln(a);
          var x, err, t2, u, pp, lna1, afac;
          if (p >= 1)
            return Math2.max(100, a + 100 * Math2.sqrt(a));
          if (p <= 0)
            return 0;
          if (a > 1) {
            lna1 = Math2.log(a1);
            afac = Math2.exp(a1 * (lna1 - 1) - gln);
            pp = p < 0.5 ? p : 1 - p;
            t2 = Math2.sqrt(-2 * Math2.log(pp));
            x = (2.30753 + t2 * 0.27061) / (1 + t2 * (0.99229 + t2 * 0.04481)) - t2;
            if (p < 0.5)
              x = -x;
            x = Math2.max(1e-3, a * Math2.pow(1 - 1 / (9 * a) - x / (3 * Math2.sqrt(a)), 3));
          } else {
            t2 = 1 - a * (0.253 + a * 0.12);
            if (p < t2)
              x = Math2.pow(p / t2, 1 / a);
            else
              x = 1 - Math2.log(1 - (p - t2) / (1 - t2));
          }
          for (; j < 12; j++) {
            if (x <= 0)
              return 0;
            err = jStat3.lowRegGamma(a, x) - p;
            if (a > 1)
              t2 = afac * Math2.exp(-(x - a1) + a1 * (Math2.log(x) - lna1));
            else
              t2 = Math2.exp(-x + a1 * Math2.log(x) - gln);
            u = err / t2;
            x -= t2 = u / (1 - 0.5 * Math2.min(1, u * ((a - 1) / x - 1)));
            if (x <= 0)
              x = 0.5 * (x + t2);
            if (Math2.abs(t2) < EPS * x)
              break;
          }
          return x;
        };
        jStat3.erf = function erf(x) {
          var cof = [
            -1.3026537197817094,
            0.6419697923564902,
            0.019476473204185836,
            -0.00956151478680863,
            -946595344482036e-18,
            366839497852761e-18,
            42523324806907e-18,
            -20278578112534e-18,
            -1624290004647e-18,
            130365583558e-17,
            15626441722e-18,
            -85238095915e-18,
            6529054439e-18,
            5059343495e-18,
            -991364156e-18,
            -227365122e-18,
            96467911e-18,
            2394038e-18,
            -6886027e-18,
            894487e-18,
            313092e-18,
            -112708e-18,
            381e-18,
            7106e-18,
            -1523e-18,
            -94e-18,
            121e-18,
            -28e-18
          ];
          var j = cof.length - 1;
          var isneg = false;
          var d = 0;
          var dd = 0;
          var t2, ty, tmp, res;
          if (x < 0) {
            x = -x;
            isneg = true;
          }
          t2 = 2 / (2 + x);
          ty = 4 * t2 - 2;
          for (; j > 0; j--) {
            tmp = d;
            d = ty * d - dd + cof[j];
            dd = tmp;
          }
          res = t2 * Math2.exp(-x * x + 0.5 * (cof[0] + ty * d) - dd);
          return isneg ? res - 1 : 1 - res;
        };
        jStat3.erfc = function erfc(x) {
          return 1 - jStat3.erf(x);
        };
        jStat3.erfcinv = function erfcinv(p) {
          var j = 0;
          var x, err, t2, pp;
          if (p >= 2)
            return -100;
          if (p <= 0)
            return 100;
          pp = p < 1 ? p : 2 - p;
          t2 = Math2.sqrt(-2 * Math2.log(pp / 2));
          x = -0.70711 * ((2.30753 + t2 * 0.27061) / (1 + t2 * (0.99229 + t2 * 0.04481)) - t2);
          for (; j < 2; j++) {
            err = jStat3.erfc(x) - pp;
            x += err / (1.1283791670955126 * Math2.exp(-x * x) - x * err);
          }
          return p < 1 ? x : -x;
        };
        jStat3.ibetainv = function ibetainv(p, a, b) {
          var EPS = 1e-8;
          var a1 = a - 1;
          var b1 = b - 1;
          var j = 0;
          var lna, lnb, pp, t2, u, err, x, al, h, w, afac;
          if (p <= 0)
            return 0;
          if (p >= 1)
            return 1;
          if (a >= 1 && b >= 1) {
            pp = p < 0.5 ? p : 1 - p;
            t2 = Math2.sqrt(-2 * Math2.log(pp));
            x = (2.30753 + t2 * 0.27061) / (1 + t2 * (0.99229 + t2 * 0.04481)) - t2;
            if (p < 0.5)
              x = -x;
            al = (x * x - 3) / 6;
            h = 2 / (1 / (2 * a - 1) + 1 / (2 * b - 1));
            w = x * Math2.sqrt(al + h) / h - (1 / (2 * b - 1) - 1 / (2 * a - 1)) * (al + 5 / 6 - 2 / (3 * h));
            x = a / (a + b * Math2.exp(2 * w));
          } else {
            lna = Math2.log(a / (a + b));
            lnb = Math2.log(b / (a + b));
            t2 = Math2.exp(a * lna) / a;
            u = Math2.exp(b * lnb) / b;
            w = t2 + u;
            if (p < t2 / w)
              x = Math2.pow(a * w * p, 1 / a);
            else
              x = 1 - Math2.pow(b * w * (1 - p), 1 / b);
          }
          afac = -jStat3.gammaln(a) - jStat3.gammaln(b) + jStat3.gammaln(a + b);
          for (; j < 10; j++) {
            if (x === 0 || x === 1)
              return x;
            err = jStat3.ibeta(x, a, b) - p;
            t2 = Math2.exp(a1 * Math2.log(x) + b1 * Math2.log(1 - x) + afac);
            u = err / t2;
            x -= t2 = u / (1 - 0.5 * Math2.min(1, u * (a1 / x - b1 / (1 - x))));
            if (x <= 0)
              x = 0.5 * (x + t2);
            if (x >= 1)
              x = 0.5 * (x + t2 + 1);
            if (Math2.abs(t2) < EPS * x && j > 0)
              break;
          }
          return x;
        };
        jStat3.ibeta = function ibeta(x, a, b) {
          var bt = x === 0 || x === 1 ? 0 : Math2.exp(jStat3.gammaln(a + b) - jStat3.gammaln(a) - jStat3.gammaln(b) + a * Math2.log(x) + b * Math2.log(1 - x));
          if (x < 0 || x > 1)
            return false;
          if (x < (a + 1) / (a + b + 2))
            return bt * jStat3.betacf(x, a, b) / a;
          return 1 - bt * jStat3.betacf(1 - x, b, a) / b;
        };
        jStat3.randn = function randn(n, m) {
          var u, v, x, y, q;
          if (!m)
            m = n;
          if (n)
            return jStat3.create(n, m, function() {
              return jStat3.randn();
            });
          do {
            u = jStat3._random_fn();
            v = 1.7156 * (jStat3._random_fn() - 0.5);
            x = u - 0.449871;
            y = Math2.abs(v) + 0.386595;
            q = x * x + y * (0.196 * y - 0.25472 * x);
          } while (q > 0.27597 && (q > 0.27846 || v * v > -4 * Math2.log(u) * u * u));
          return v / u;
        };
        jStat3.randg = function randg(shape, n, m) {
          var oalph = shape;
          var a1, a2, u, v, x, mat;
          if (!m)
            m = n;
          if (!shape)
            shape = 1;
          if (n) {
            mat = jStat3.zeros(n, m);
            mat.alter(function() {
              return jStat3.randg(shape);
            });
            return mat;
          }
          if (shape < 1)
            shape += 1;
          a1 = shape - 1 / 3;
          a2 = 1 / Math2.sqrt(9 * a1);
          do {
            do {
              x = jStat3.randn();
              v = 1 + a2 * x;
            } while (v <= 0);
            v = v * v * v;
            u = jStat3._random_fn();
          } while (u > 1 - 0.331 * Math2.pow(x, 4) && Math2.log(u) > 0.5 * x * x + a1 * (1 - v + Math2.log(v)));
          if (shape == oalph)
            return a1 * v;
          do {
            u = jStat3._random_fn();
          } while (u === 0);
          return Math2.pow(u, 1 / oalph) * a1 * v;
        };
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jStat3.fn[passfunc] = function() {
                return jStat3(jStat3.map(this, function(value2) {
                  return jStat3[passfunc](value2);
                }));
              };
            })(funcs[i2]);
        })("gammaln gammafn factorial factorialln".split(" "));
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jStat3.fn[passfunc] = function() {
                return jStat3(jStat3[passfunc].apply(null, arguments));
              };
            })(funcs[i2]);
        })("randn".split(" "));
      })(jStat2, Math);
      (function(jStat3, Math2) {
        (function(list) {
          for (var i2 = 0; i2 < list.length; i2++)
            (function(func) {
              jStat3[func] = function f(a, b, c) {
                if (!(this instanceof f))
                  return new f(a, b, c);
                this._a = a;
                this._b = b;
                this._c = c;
                return this;
              };
              jStat3.fn[func] = function(a, b, c) {
                var newthis = jStat3[func](a, b, c);
                newthis.data = this;
                return newthis;
              };
              jStat3[func].prototype.sample = function(arr) {
                var a = this._a;
                var b = this._b;
                var c = this._c;
                if (arr)
                  return jStat3.alter(arr, function() {
                    return jStat3[func].sample(a, b, c);
                  });
                else
                  return jStat3[func].sample(a, b, c);
              };
              (function(vals) {
                for (var i3 = 0; i3 < vals.length; i3++)
                  (function(fnfunc) {
                    jStat3[func].prototype[fnfunc] = function(x) {
                      var a = this._a;
                      var b = this._b;
                      var c = this._c;
                      if (!x && x !== 0)
                        x = this.data;
                      if (typeof x !== "number") {
                        return jStat3.fn.map.call(x, function(x2) {
                          return jStat3[func][fnfunc](x2, a, b, c);
                        });
                      }
                      return jStat3[func][fnfunc](x, a, b, c);
                    };
                  })(vals[i3]);
              })("pdf cdf inv".split(" "));
              (function(vals) {
                for (var i3 = 0; i3 < vals.length; i3++)
                  (function(fnfunc) {
                    jStat3[func].prototype[fnfunc] = function() {
                      return jStat3[func][fnfunc](this._a, this._b, this._c);
                    };
                  })(vals[i3]);
              })("mean median mode variance".split(" "));
            })(list[i2]);
        })("beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine".split(" "));
        jStat3.extend(jStat3.beta, {
          pdf: function pdf(x, alpha, beta) {
            if (x > 1 || x < 0)
              return 0;
            if (alpha == 1 && beta == 1)
              return 1;
            if (alpha < 512 && beta < 512) {
              return Math2.pow(x, alpha - 1) * Math2.pow(1 - x, beta - 1) / jStat3.betafn(alpha, beta);
            } else {
              return Math2.exp((alpha - 1) * Math2.log(x) + (beta - 1) * Math2.log(1 - x) - jStat3.betaln(alpha, beta));
            }
          },
          cdf: function cdf(x, alpha, beta) {
            return x > 1 || x < 0 ? (x > 1) * 1 : jStat3.ibeta(x, alpha, beta);
          },
          inv: function inv(x, alpha, beta) {
            return jStat3.ibetainv(x, alpha, beta);
          },
          mean: function mean(alpha, beta) {
            return alpha / (alpha + beta);
          },
          median: function median(alpha, beta) {
            return jStat3.ibetainv(0.5, alpha, beta);
          },
          mode: function mode(alpha, beta) {
            return (alpha - 1) / (alpha + beta - 2);
          },
          sample: function sample(alpha, beta) {
            var u = jStat3.randg(alpha);
            return u / (u + jStat3.randg(beta));
          },
          variance: function variance(alpha, beta) {
            return alpha * beta / (Math2.pow(alpha + beta, 2) * (alpha + beta + 1));
          }
        });
        jStat3.extend(jStat3.centralF, {
          pdf: function pdf(x, df1, df2) {
            var p, q, f;
            if (x < 0)
              return 0;
            if (df1 <= 2) {
              if (x === 0 && df1 < 2) {
                return Infinity;
              }
              if (x === 0 && df1 === 2) {
                return 1;
              }
              return 1 / jStat3.betafn(df1 / 2, df2 / 2) * Math2.pow(df1 / df2, df1 / 2) * Math2.pow(x, df1 / 2 - 1) * Math2.pow(1 + df1 / df2 * x, -(df1 + df2) / 2);
            }
            p = df1 * x / (df2 + x * df1);
            q = df2 / (df2 + x * df1);
            f = df1 * q / 2;
            return f * jStat3.binomial.pdf((df1 - 2) / 2, (df1 + df2 - 2) / 2, p);
          },
          cdf: function cdf(x, df1, df2) {
            if (x < 0)
              return 0;
            return jStat3.ibeta(df1 * x / (df1 * x + df2), df1 / 2, df2 / 2);
          },
          inv: function inv(x, df1, df2) {
            return df2 / (df1 * (1 / jStat3.ibetainv(x, df1 / 2, df2 / 2) - 1));
          },
          mean: function mean(df1, df2) {
            return df2 > 2 ? df2 / (df2 - 2) : void 0;
          },
          mode: function mode(df1, df2) {
            return df1 > 2 ? df2 * (df1 - 2) / (df1 * (df2 + 2)) : void 0;
          },
          sample: function sample(df1, df2) {
            var x1 = jStat3.randg(df1 / 2) * 2;
            var x2 = jStat3.randg(df2 / 2) * 2;
            return x1 / df1 / (x2 / df2);
          },
          variance: function variance(df1, df2) {
            if (df2 <= 4)
              return void 0;
            return 2 * df2 * df2 * (df1 + df2 - 2) / (df1 * (df2 - 2) * (df2 - 2) * (df2 - 4));
          }
        });
        jStat3.extend(jStat3.cauchy, {
          pdf: function pdf(x, local, scale) {
            if (scale < 0) {
              return 0;
            }
            return scale / (Math2.pow(x - local, 2) + Math2.pow(scale, 2)) / Math2.PI;
          },
          cdf: function cdf(x, local, scale) {
            return Math2.atan((x - local) / scale) / Math2.PI + 0.5;
          },
          inv: function(p, local, scale) {
            return local + scale * Math2.tan(Math2.PI * (p - 0.5));
          },
          median: function median(local) {
            return local;
          },
          mode: function mode(local) {
            return local;
          },
          sample: function sample(local, scale) {
            return jStat3.randn() * Math2.sqrt(1 / (2 * jStat3.randg(0.5))) * scale + local;
          }
        });
        jStat3.extend(jStat3.chisquare, {
          pdf: function pdf(x, dof) {
            if (x < 0)
              return 0;
            return x === 0 && dof === 2 ? 0.5 : Math2.exp((dof / 2 - 1) * Math2.log(x) - x / 2 - dof / 2 * Math2.log(2) - jStat3.gammaln(dof / 2));
          },
          cdf: function cdf(x, dof) {
            if (x < 0)
              return 0;
            return jStat3.lowRegGamma(dof / 2, x / 2);
          },
          inv: function(p, dof) {
            return 2 * jStat3.gammapinv(p, 0.5 * dof);
          },
          mean: function(dof) {
            return dof;
          },
          median: function median(dof) {
            return dof * Math2.pow(1 - 2 / (9 * dof), 3);
          },
          mode: function mode(dof) {
            return dof - 2 > 0 ? dof - 2 : 0;
          },
          sample: function sample(dof) {
            return jStat3.randg(dof / 2) * 2;
          },
          variance: function variance(dof) {
            return 2 * dof;
          }
        });
        jStat3.extend(jStat3.exponential, {
          pdf: function pdf(x, rate) {
            return x < 0 ? 0 : rate * Math2.exp(-rate * x);
          },
          cdf: function cdf(x, rate) {
            return x < 0 ? 0 : 1 - Math2.exp(-rate * x);
          },
          inv: function(p, rate) {
            return -Math2.log(1 - p) / rate;
          },
          mean: function(rate) {
            return 1 / rate;
          },
          median: function(rate) {
            return 1 / rate * Math2.log(2);
          },
          mode: function mode() {
            return 0;
          },
          sample: function sample(rate) {
            return -1 / rate * Math2.log(jStat3._random_fn());
          },
          variance: function(rate) {
            return Math2.pow(rate, -2);
          }
        });
        jStat3.extend(jStat3.gamma, {
          pdf: function pdf(x, shape, scale) {
            if (x < 0)
              return 0;
            return x === 0 && shape === 1 ? 1 / scale : Math2.exp((shape - 1) * Math2.log(x) - x / scale - jStat3.gammaln(shape) - shape * Math2.log(scale));
          },
          cdf: function cdf(x, shape, scale) {
            if (x < 0)
              return 0;
            return jStat3.lowRegGamma(shape, x / scale);
          },
          inv: function(p, shape, scale) {
            return jStat3.gammapinv(p, shape) * scale;
          },
          mean: function(shape, scale) {
            return shape * scale;
          },
          mode: function mode(shape, scale) {
            if (shape > 1)
              return (shape - 1) * scale;
            return void 0;
          },
          sample: function sample(shape, scale) {
            return jStat3.randg(shape) * scale;
          },
          variance: function variance(shape, scale) {
            return shape * scale * scale;
          }
        });
        jStat3.extend(jStat3.invgamma, {
          pdf: function pdf(x, shape, scale) {
            if (x <= 0)
              return 0;
            return Math2.exp(-(shape + 1) * Math2.log(x) - scale / x - jStat3.gammaln(shape) + shape * Math2.log(scale));
          },
          cdf: function cdf(x, shape, scale) {
            if (x <= 0)
              return 0;
            return 1 - jStat3.lowRegGamma(shape, scale / x);
          },
          inv: function(p, shape, scale) {
            return scale / jStat3.gammapinv(1 - p, shape);
          },
          mean: function(shape, scale) {
            return shape > 1 ? scale / (shape - 1) : void 0;
          },
          mode: function mode(shape, scale) {
            return scale / (shape + 1);
          },
          sample: function sample(shape, scale) {
            return scale / jStat3.randg(shape);
          },
          variance: function variance(shape, scale) {
            if (shape <= 2)
              return void 0;
            return scale * scale / ((shape - 1) * (shape - 1) * (shape - 2));
          }
        });
        jStat3.extend(jStat3.kumaraswamy, {
          pdf: function pdf(x, alpha, beta) {
            if (x === 0 && alpha === 1)
              return beta;
            else if (x === 1 && beta === 1)
              return alpha;
            return Math2.exp(Math2.log(alpha) + Math2.log(beta) + (alpha - 1) * Math2.log(x) + (beta - 1) * Math2.log(1 - Math2.pow(x, alpha)));
          },
          cdf: function cdf(x, alpha, beta) {
            if (x < 0)
              return 0;
            else if (x > 1)
              return 1;
            return 1 - Math2.pow(1 - Math2.pow(x, alpha), beta);
          },
          inv: function inv(p, alpha, beta) {
            return Math2.pow(1 - Math2.pow(1 - p, 1 / beta), 1 / alpha);
          },
          mean: function(alpha, beta) {
            return beta * jStat3.gammafn(1 + 1 / alpha) * jStat3.gammafn(beta) / jStat3.gammafn(1 + 1 / alpha + beta);
          },
          median: function median(alpha, beta) {
            return Math2.pow(1 - Math2.pow(2, -1 / beta), 1 / alpha);
          },
          mode: function mode(alpha, beta) {
            if (!(alpha >= 1 && beta >= 1 && (alpha !== 1 && beta !== 1)))
              return void 0;
            return Math2.pow((alpha - 1) / (alpha * beta - 1), 1 / alpha);
          },
          variance: function variance() {
            throw new Error("variance not yet implemented");
          }
        });
        jStat3.extend(jStat3.lognormal, {
          pdf: function pdf(x, mu, sigma) {
            if (x <= 0)
              return 0;
            return Math2.exp(-Math2.log(x) - 0.5 * Math2.log(2 * Math2.PI) - Math2.log(sigma) - Math2.pow(Math2.log(x) - mu, 2) / (2 * sigma * sigma));
          },
          cdf: function cdf(x, mu, sigma) {
            if (x < 0)
              return 0;
            return 0.5 + 0.5 * jStat3.erf((Math2.log(x) - mu) / Math2.sqrt(2 * sigma * sigma));
          },
          inv: function(p, mu, sigma) {
            return Math2.exp(-1.4142135623730951 * sigma * jStat3.erfcinv(2 * p) + mu);
          },
          mean: function mean(mu, sigma) {
            return Math2.exp(mu + sigma * sigma / 2);
          },
          median: function median(mu) {
            return Math2.exp(mu);
          },
          mode: function mode(mu, sigma) {
            return Math2.exp(mu - sigma * sigma);
          },
          sample: function sample(mu, sigma) {
            return Math2.exp(jStat3.randn() * sigma + mu);
          },
          variance: function variance(mu, sigma) {
            return (Math2.exp(sigma * sigma) - 1) * Math2.exp(2 * mu + sigma * sigma);
          }
        });
        jStat3.extend(jStat3.noncentralt, {
          pdf: function pdf(x, dof, ncp) {
            var tol = 1e-14;
            if (Math2.abs(ncp) < tol)
              return jStat3.studentt.pdf(x, dof);
            if (Math2.abs(x) < tol) {
              return Math2.exp(jStat3.gammaln((dof + 1) / 2) - ncp * ncp / 2 - 0.5 * Math2.log(Math2.PI * dof) - jStat3.gammaln(dof / 2));
            }
            return dof / x * (jStat3.noncentralt.cdf(x * Math2.sqrt(1 + 2 / dof), dof + 2, ncp) - jStat3.noncentralt.cdf(x, dof, ncp));
          },
          cdf: function cdf(x, dof, ncp) {
            var tol = 1e-14;
            var min_iterations = 200;
            if (Math2.abs(ncp) < tol)
              return jStat3.studentt.cdf(x, dof);
            var flip = false;
            if (x < 0) {
              flip = true;
              ncp = -ncp;
            }
            var prob = jStat3.normal.cdf(-ncp, 0, 1);
            var value2 = tol + 1;
            var lastvalue = value2;
            var y = x * x / (x * x + dof);
            var j = 0;
            var p = Math2.exp(-ncp * ncp / 2);
            var q = Math2.exp(-ncp * ncp / 2 - 0.5 * Math2.log(2) - jStat3.gammaln(3 / 2)) * ncp;
            while (j < min_iterations || lastvalue > tol || value2 > tol) {
              lastvalue = value2;
              if (j > 0) {
                p *= ncp * ncp / (2 * j);
                q *= ncp * ncp / (2 * (j + 1 / 2));
              }
              value2 = p * jStat3.beta.cdf(y, j + 0.5, dof / 2) + q * jStat3.beta.cdf(y, j + 1, dof / 2);
              prob += 0.5 * value2;
              j++;
            }
            return flip ? 1 - prob : prob;
          }
        });
        jStat3.extend(jStat3.normal, {
          pdf: function pdf(x, mean, std) {
            return Math2.exp(-0.5 * Math2.log(2 * Math2.PI) - Math2.log(std) - Math2.pow(x - mean, 2) / (2 * std * std));
          },
          cdf: function cdf(x, mean, std) {
            return 0.5 * (1 + jStat3.erf((x - mean) / Math2.sqrt(2 * std * std)));
          },
          inv: function(p, mean, std) {
            return -1.4142135623730951 * std * jStat3.erfcinv(2 * p) + mean;
          },
          mean: function(mean) {
            return mean;
          },
          median: function median(mean) {
            return mean;
          },
          mode: function(mean) {
            return mean;
          },
          sample: function sample(mean, std) {
            return jStat3.randn() * std + mean;
          },
          variance: function(mean, std) {
            return std * std;
          }
        });
        jStat3.extend(jStat3.pareto, {
          pdf: function pdf(x, scale, shape) {
            if (x < scale)
              return 0;
            return shape * Math2.pow(scale, shape) / Math2.pow(x, shape + 1);
          },
          cdf: function cdf(x, scale, shape) {
            if (x < scale)
              return 0;
            return 1 - Math2.pow(scale / x, shape);
          },
          inv: function inv(p, scale, shape) {
            return scale / Math2.pow(1 - p, 1 / shape);
          },
          mean: function mean(scale, shape) {
            if (shape <= 1)
              return void 0;
            return shape * Math2.pow(scale, shape) / (shape - 1);
          },
          median: function median(scale, shape) {
            return scale * (shape * Math2.SQRT2);
          },
          mode: function mode(scale) {
            return scale;
          },
          variance: function(scale, shape) {
            if (shape <= 2)
              return void 0;
            return scale * scale * shape / (Math2.pow(shape - 1, 2) * (shape - 2));
          }
        });
        jStat3.extend(jStat3.studentt, {
          pdf: function pdf(x, dof) {
            dof = dof > 1e100 ? 1e100 : dof;
            return 1 / (Math2.sqrt(dof) * jStat3.betafn(0.5, dof / 2)) * Math2.pow(1 + x * x / dof, -((dof + 1) / 2));
          },
          cdf: function cdf(x, dof) {
            var dof2 = dof / 2;
            return jStat3.ibeta((x + Math2.sqrt(x * x + dof)) / (2 * Math2.sqrt(x * x + dof)), dof2, dof2);
          },
          inv: function(p, dof) {
            var x = jStat3.ibetainv(2 * Math2.min(p, 1 - p), 0.5 * dof, 0.5);
            x = Math2.sqrt(dof * (1 - x) / x);
            return p > 0.5 ? x : -x;
          },
          mean: function mean(dof) {
            return dof > 1 ? 0 : void 0;
          },
          median: function median() {
            return 0;
          },
          mode: function mode() {
            return 0;
          },
          sample: function sample(dof) {
            return jStat3.randn() * Math2.sqrt(dof / (2 * jStat3.randg(dof / 2)));
          },
          variance: function variance(dof) {
            return dof > 2 ? dof / (dof - 2) : dof > 1 ? Infinity : void 0;
          }
        });
        jStat3.extend(jStat3.weibull, {
          pdf: function pdf(x, scale, shape) {
            if (x < 0 || scale < 0 || shape < 0)
              return 0;
            return shape / scale * Math2.pow(x / scale, shape - 1) * Math2.exp(-Math2.pow(x / scale, shape));
          },
          cdf: function cdf(x, scale, shape) {
            return x < 0 ? 0 : 1 - Math2.exp(-Math2.pow(x / scale, shape));
          },
          inv: function(p, scale, shape) {
            return scale * Math2.pow(-Math2.log(1 - p), 1 / shape);
          },
          mean: function(scale, shape) {
            return scale * jStat3.gammafn(1 + 1 / shape);
          },
          median: function median(scale, shape) {
            return scale * Math2.pow(Math2.log(2), 1 / shape);
          },
          mode: function mode(scale, shape) {
            if (shape <= 1)
              return 0;
            return scale * Math2.pow((shape - 1) / shape, 1 / shape);
          },
          sample: function sample(scale, shape) {
            return scale * Math2.pow(-Math2.log(jStat3._random_fn()), 1 / shape);
          },
          variance: function variance(scale, shape) {
            return scale * scale * jStat3.gammafn(1 + 2 / shape) - Math2.pow(jStat3.weibull.mean(scale, shape), 2);
          }
        });
        jStat3.extend(jStat3.uniform, {
          pdf: function pdf(x, a, b) {
            return x < a || x > b ? 0 : 1 / (b - a);
          },
          cdf: function cdf(x, a, b) {
            if (x < a)
              return 0;
            else if (x < b)
              return (x - a) / (b - a);
            return 1;
          },
          inv: function(p, a, b) {
            return a + p * (b - a);
          },
          mean: function mean(a, b) {
            return 0.5 * (a + b);
          },
          median: function median(a, b) {
            return jStat3.mean(a, b);
          },
          mode: function mode() {
            throw new Error("mode is not yet implemented");
          },
          sample: function sample(a, b) {
            return a / 2 + b / 2 + (b / 2 - a / 2) * (2 * jStat3._random_fn() - 1);
          },
          variance: function variance(a, b) {
            return Math2.pow(b - a, 2) / 12;
          }
        });
        function betinc(x, a, b, eps) {
          var a0 = 0;
          var b0 = 1;
          var a1 = 1;
          var b1 = 1;
          var m9 = 0;
          var a2 = 0;
          var c9;
          while (Math2.abs((a1 - a2) / a1) > eps) {
            a2 = a1;
            c9 = -(a + m9) * (a + b + m9) * x / (a + 2 * m9) / (a + 2 * m9 + 1);
            a0 = a1 + c9 * a0;
            b0 = b1 + c9 * b0;
            m9 = m9 + 1;
            c9 = m9 * (b - m9) * x / (a + 2 * m9 - 1) / (a + 2 * m9);
            a1 = a0 + c9 * a1;
            b1 = b0 + c9 * b1;
            a0 = a0 / b1;
            b0 = b0 / b1;
            a1 = a1 / b1;
            b1 = 1;
          }
          return a1 / a;
        }
        jStat3.extend(jStat3.binomial, {
          pdf: function pdf(k, n, p) {
            return p === 0 || p === 1 ? n * p === k ? 1 : 0 : jStat3.combination(n, k) * Math2.pow(p, k) * Math2.pow(1 - p, n - k);
          },
          cdf: function cdf(x, n, p) {
            var betacdf;
            var eps = 1e-10;
            if (x < 0)
              return 0;
            if (x >= n)
              return 1;
            if (p < 0 || p > 1 || n <= 0)
              return NaN;
            x = Math2.floor(x);
            var z = p;
            var a = x + 1;
            var b = n - x;
            var s = a + b;
            var bt = Math2.exp(jStat3.gammaln(s) - jStat3.gammaln(b) - jStat3.gammaln(a) + a * Math2.log(z) + b * Math2.log(1 - z));
            if (z < (a + 1) / (s + 2))
              betacdf = bt * betinc(z, a, b, eps);
            else
              betacdf = 1 - bt * betinc(1 - z, b, a, eps);
            return Math2.round((1 - betacdf) * (1 / eps)) / (1 / eps);
          }
        });
        jStat3.extend(jStat3.negbin, {
          pdf: function pdf(k, r, p) {
            if (k !== k >>> 0)
              return false;
            if (k < 0)
              return 0;
            return jStat3.combination(k + r - 1, r - 1) * Math2.pow(1 - p, k) * Math2.pow(p, r);
          },
          cdf: function cdf(x, r, p) {
            var sum = 0, k = 0;
            if (x < 0)
              return 0;
            for (; k <= x; k++) {
              sum += jStat3.negbin.pdf(k, r, p);
            }
            return sum;
          }
        });
        jStat3.extend(jStat3.hypgeom, {
          pdf: function pdf(k, N2, m, n) {
            if (k !== k | 0) {
              return false;
            } else if (k < 0 || k < m - (N2 - n)) {
              return 0;
            } else if (k > n || k > m) {
              return 0;
            } else if (m * 2 > N2) {
              if (n * 2 > N2) {
                return jStat3.hypgeom.pdf(N2 - m - n + k, N2, N2 - m, N2 - n);
              } else {
                return jStat3.hypgeom.pdf(n - k, N2, N2 - m, n);
              }
            } else if (n * 2 > N2) {
              return jStat3.hypgeom.pdf(m - k, N2, m, N2 - n);
            } else if (m < n) {
              return jStat3.hypgeom.pdf(k, N2, n, m);
            } else {
              var scaledPDF = 1;
              var samplesDone = 0;
              for (var i2 = 0; i2 < k; i2++) {
                while (scaledPDF > 1 && samplesDone < n) {
                  scaledPDF *= 1 - m / (N2 - samplesDone);
                  samplesDone++;
                }
                scaledPDF *= (n - i2) * (m - i2) / ((i2 + 1) * (N2 - m - n + i2 + 1));
              }
              for (; samplesDone < n; samplesDone++) {
                scaledPDF *= 1 - m / (N2 - samplesDone);
              }
              return Math2.min(1, Math2.max(0, scaledPDF));
            }
          },
          cdf: function cdf(x, N2, m, n) {
            if (x < 0 || x < m - (N2 - n)) {
              return 0;
            } else if (x >= n || x >= m) {
              return 1;
            } else if (m * 2 > N2) {
              if (n * 2 > N2) {
                return jStat3.hypgeom.cdf(N2 - m - n + x, N2, N2 - m, N2 - n);
              } else {
                return 1 - jStat3.hypgeom.cdf(n - x - 1, N2, N2 - m, n);
              }
            } else if (n * 2 > N2) {
              return 1 - jStat3.hypgeom.cdf(m - x - 1, N2, m, N2 - n);
            } else if (m < n) {
              return jStat3.hypgeom.cdf(x, N2, n, m);
            } else {
              var scaledCDF = 1;
              var scaledPDF = 1;
              var samplesDone = 0;
              for (var i2 = 0; i2 < x; i2++) {
                while (scaledCDF > 1 && samplesDone < n) {
                  var factor = 1 - m / (N2 - samplesDone);
                  scaledPDF *= factor;
                  scaledCDF *= factor;
                  samplesDone++;
                }
                scaledPDF *= (n - i2) * (m - i2) / ((i2 + 1) * (N2 - m - n + i2 + 1));
                scaledCDF += scaledPDF;
              }
              for (; samplesDone < n; samplesDone++) {
                scaledCDF *= 1 - m / (N2 - samplesDone);
              }
              return Math2.min(1, Math2.max(0, scaledCDF));
            }
          }
        });
        jStat3.extend(jStat3.poisson, {
          pdf: function pdf(k, l) {
            if (l < 0 || k % 1 !== 0 || k < 0) {
              return 0;
            }
            return Math2.pow(l, k) * Math2.exp(-l) / jStat3.factorial(k);
          },
          cdf: function cdf(x, l) {
            var sumarr = [], k = 0;
            if (x < 0)
              return 0;
            for (; k <= x; k++) {
              sumarr.push(jStat3.poisson.pdf(k, l));
            }
            return jStat3.sum(sumarr);
          },
          mean: function(l) {
            return l;
          },
          variance: function(l) {
            return l;
          },
          sampleSmall: function sampleSmall(l) {
            var p = 1, k = 0, L = Math2.exp(-l);
            do {
              k++;
              p *= jStat3._random_fn();
            } while (p > L);
            return k - 1;
          },
          sampleLarge: function sampleLarge(l) {
            var lam = l;
            var k;
            var U, V, slam, loglam, a, b, invalpha, vr, us;
            slam = Math2.sqrt(lam);
            loglam = Math2.log(lam);
            b = 0.931 + 2.53 * slam;
            a = -0.059 + 0.02483 * b;
            invalpha = 1.1239 + 1.1328 / (b - 3.4);
            vr = 0.9277 - 3.6224 / (b - 2);
            while (1) {
              U = Math2.random() - 0.5;
              V = Math2.random();
              us = 0.5 - Math2.abs(U);
              k = Math2.floor((2 * a / us + b) * U + lam + 0.43);
              if (us >= 0.07 && V <= vr) {
                return k;
              }
              if (k < 0 || us < 0.013 && V > us) {
                continue;
              }
              if (Math2.log(V) + Math2.log(invalpha) - Math2.log(a / (us * us) + b) <= -lam + k * loglam - jStat3.loggam(k + 1)) {
                return k;
              }
            }
          },
          sample: function sample(l) {
            if (l < 10)
              return this.sampleSmall(l);
            else
              return this.sampleLarge(l);
          }
        });
        jStat3.extend(jStat3.triangular, {
          pdf: function pdf(x, a, b, c) {
            if (b <= a || c < a || c > b) {
              return NaN;
            } else {
              if (x < a || x > b) {
                return 0;
              } else if (x < c) {
                return 2 * (x - a) / ((b - a) * (c - a));
              } else if (x === c) {
                return 2 / (b - a);
              } else {
                return 2 * (b - x) / ((b - a) * (b - c));
              }
            }
          },
          cdf: function cdf(x, a, b, c) {
            if (b <= a || c < a || c > b)
              return NaN;
            if (x <= a)
              return 0;
            else if (x >= b)
              return 1;
            if (x <= c)
              return Math2.pow(x - a, 2) / ((b - a) * (c - a));
            else
              return 1 - Math2.pow(b - x, 2) / ((b - a) * (b - c));
          },
          inv: function inv(p, a, b, c) {
            if (b <= a || c < a || c > b) {
              return NaN;
            } else {
              if (p <= (c - a) / (b - a)) {
                return a + (b - a) * Math2.sqrt(p * ((c - a) / (b - a)));
              } else {
                return a + (b - a) * (1 - Math2.sqrt((1 - p) * (1 - (c - a) / (b - a))));
              }
            }
          },
          mean: function mean(a, b, c) {
            return (a + b + c) / 3;
          },
          median: function median(a, b, c) {
            if (c <= (a + b) / 2) {
              return b - Math2.sqrt((b - a) * (b - c)) / Math2.sqrt(2);
            } else if (c > (a + b) / 2) {
              return a + Math2.sqrt((b - a) * (c - a)) / Math2.sqrt(2);
            }
          },
          mode: function mode(a, b, c) {
            return c;
          },
          sample: function sample(a, b, c) {
            var u = jStat3._random_fn();
            if (u < (c - a) / (b - a))
              return a + Math2.sqrt(u * (b - a) * (c - a));
            return b - Math2.sqrt((1 - u) * (b - a) * (b - c));
          },
          variance: function variance(a, b, c) {
            return (a * a + b * b + c * c - a * b - a * c - b * c) / 18;
          }
        });
        jStat3.extend(jStat3.arcsine, {
          pdf: function pdf(x, a, b) {
            if (b <= a)
              return NaN;
            return x <= a || x >= b ? 0 : 2 / Math2.PI * Math2.pow(Math2.pow(b - a, 2) - Math2.pow(2 * x - a - b, 2), -0.5);
          },
          cdf: function cdf(x, a, b) {
            if (x < a)
              return 0;
            else if (x < b)
              return 2 / Math2.PI * Math2.asin(Math2.sqrt((x - a) / (b - a)));
            return 1;
          },
          inv: function(p, a, b) {
            return a + (0.5 - 0.5 * Math2.cos(Math2.PI * p)) * (b - a);
          },
          mean: function mean(a, b) {
            if (b <= a)
              return NaN;
            return (a + b) / 2;
          },
          median: function median(a, b) {
            if (b <= a)
              return NaN;
            return (a + b) / 2;
          },
          mode: function mode() {
            throw new Error("mode is not yet implemented");
          },
          sample: function sample(a, b) {
            return (a + b) / 2 + (b - a) / 2 * Math2.sin(2 * Math2.PI * jStat3.uniform.sample(0, 1));
          },
          variance: function variance(a, b) {
            if (b <= a)
              return NaN;
            return Math2.pow(b - a, 2) / 8;
          }
        });
        function laplaceSign(x) {
          return x / Math2.abs(x);
        }
        jStat3.extend(jStat3.laplace, {
          pdf: function pdf(x, mu, b) {
            return b <= 0 ? 0 : Math2.exp(-Math2.abs(x - mu) / b) / (2 * b);
          },
          cdf: function cdf(x, mu, b) {
            if (b <= 0) {
              return 0;
            }
            if (x < mu) {
              return 0.5 * Math2.exp((x - mu) / b);
            } else {
              return 1 - 0.5 * Math2.exp(-(x - mu) / b);
            }
          },
          mean: function(mu) {
            return mu;
          },
          median: function(mu) {
            return mu;
          },
          mode: function(mu) {
            return mu;
          },
          variance: function(mu, b) {
            return 2 * b * b;
          },
          sample: function sample(mu, b) {
            var u = jStat3._random_fn() - 0.5;
            return mu - b * laplaceSign(u) * Math2.log(1 - 2 * Math2.abs(u));
          }
        });
        function tukeyWprob(w, rr, cc) {
          var nleg = 12;
          var ihalf = 6;
          var C1 = -30;
          var C2 = -50;
          var C3 = 60;
          var bb = 8;
          var wlar = 3;
          var wincr1 = 2;
          var wincr2 = 3;
          var xleg = [
            0.9815606342467192,
            0.9041172563704749,
            0.7699026741943047,
            0.5873179542866175,
            0.3678314989981802,
            0.1252334085114689
          ];
          var aleg = [
            0.04717533638651183,
            0.10693932599531843,
            0.16007832854334622,
            0.20316742672306592,
            0.2334925365383548,
            0.24914704581340277
          ];
          var qsqz = w * 0.5;
          if (qsqz >= bb)
            return 1;
          var pr_w = 2 * jStat3.normal.cdf(qsqz, 0, 1, 1, 0) - 1;
          if (pr_w >= Math2.exp(C2 / cc))
            pr_w = Math2.pow(pr_w, cc);
          else
            pr_w = 0;
          var wincr;
          if (w > wlar)
            wincr = wincr1;
          else
            wincr = wincr2;
          var blb = qsqz;
          var binc = (bb - qsqz) / wincr;
          var bub = blb + binc;
          var einsum = 0;
          var cc1 = cc - 1;
          for (var wi = 1; wi <= wincr; wi++) {
            var elsum = 0;
            var a = 0.5 * (bub + blb);
            var b = 0.5 * (bub - blb);
            for (var jj = 1; jj <= nleg; jj++) {
              var j, xx;
              if (ihalf < jj) {
                j = nleg - jj + 1;
                xx = xleg[j - 1];
              } else {
                j = jj;
                xx = -xleg[j - 1];
              }
              var c = b * xx;
              var ac = a + c;
              var qexpo = ac * ac;
              if (qexpo > C3)
                break;
              var pplus = 2 * jStat3.normal.cdf(ac, 0, 1, 1, 0);
              var pminus = 2 * jStat3.normal.cdf(ac, w, 1, 1, 0);
              var rinsum = pplus * 0.5 - pminus * 0.5;
              if (rinsum >= Math2.exp(C1 / cc1)) {
                rinsum = aleg[j - 1] * Math2.exp(-(0.5 * qexpo)) * Math2.pow(rinsum, cc1);
                elsum += rinsum;
              }
            }
            elsum *= 2 * b * cc / Math2.sqrt(2 * Math2.PI);
            einsum += elsum;
            blb = bub;
            bub += binc;
          }
          pr_w += einsum;
          if (pr_w <= Math2.exp(C1 / rr))
            return 0;
          pr_w = Math2.pow(pr_w, rr);
          if (pr_w >= 1)
            return 1;
          return pr_w;
        }
        function tukeyQinv(p, c, v) {
          var p0 = 0.322232421088;
          var q0 = 0.099348462606;
          var p1 = -1;
          var q1 = 0.588581570495;
          var p2 = -0.342242088547;
          var q2 = 0.531103462366;
          var p3 = -0.204231210125;
          var q3 = 0.10353775285;
          var p4 = -453642210148e-16;
          var q4 = 0.0038560700634;
          var c1 = 0.8832;
          var c2 = 0.2368;
          var c3 = 1.214;
          var c4 = 1.208;
          var c5 = 1.4142;
          var vmax = 120;
          var ps = 0.5 - 0.5 * p;
          var yi = Math2.sqrt(Math2.log(1 / (ps * ps)));
          var t2 = yi + ((((yi * p4 + p3) * yi + p2) * yi + p1) * yi + p0) / ((((yi * q4 + q3) * yi + q2) * yi + q1) * yi + q0);
          if (v < vmax)
            t2 += (t2 * t2 * t2 + t2) / v / 4;
          var q = c1 - c2 * t2;
          if (v < vmax)
            q += -c3 / v + c4 * t2 / v;
          return t2 * (q * Math2.log(c - 1) + c5);
        }
        jStat3.extend(jStat3.tukey, {
          cdf: function cdf(q, nmeans, df) {
            var rr = 1;
            var cc = nmeans;
            var nlegq = 16;
            var ihalfq = 8;
            var eps1 = -30;
            var eps2 = 1e-14;
            var dhaf = 100;
            var dquar = 800;
            var deigh = 5e3;
            var dlarg = 25e3;
            var ulen1 = 1;
            var ulen2 = 0.5;
            var ulen3 = 0.25;
            var ulen4 = 0.125;
            var xlegq = [
              0.9894009349916499,
              0.9445750230732326,
              0.8656312023878318,
              0.755404408355003,
              0.6178762444026438,
              0.45801677765722737,
              0.2816035507792589,
              0.09501250983763744
            ];
            var alegq = [
              0.027152459411754096,
              0.062253523938647894,
              0.09515851168249279,
              0.12462897125553388,
              0.14959598881657674,
              0.16915651939500254,
              0.18260341504492358,
              0.1894506104550685
            ];
            if (q <= 0)
              return 0;
            if (df < 2 || rr < 1 || cc < 2)
              return NaN;
            if (!Number.isFinite(q))
              return 1;
            if (df > dlarg)
              return tukeyWprob(q, rr, cc);
            var f2 = df * 0.5;
            var f2lf = f2 * Math2.log(df) - df * Math2.log(2) - jStat3.gammaln(f2);
            var f21 = f2 - 1;
            var ff4 = df * 0.25;
            var ulen;
            if (df <= dhaf)
              ulen = ulen1;
            else if (df <= dquar)
              ulen = ulen2;
            else if (df <= deigh)
              ulen = ulen3;
            else
              ulen = ulen4;
            f2lf += Math2.log(ulen);
            var ans = 0;
            for (var i2 = 1; i2 <= 50; i2++) {
              var otsum = 0;
              var twa1 = (2 * i2 - 1) * ulen;
              for (var jj = 1; jj <= nlegq; jj++) {
                var j, t1;
                if (ihalfq < jj) {
                  j = jj - ihalfq - 1;
                  t1 = f2lf + f21 * Math2.log(twa1 + xlegq[j] * ulen) - (xlegq[j] * ulen + twa1) * ff4;
                } else {
                  j = jj - 1;
                  t1 = f2lf + f21 * Math2.log(twa1 - xlegq[j] * ulen) + (xlegq[j] * ulen - twa1) * ff4;
                }
                var qsqz;
                if (t1 >= eps1) {
                  if (ihalfq < jj) {
                    qsqz = q * Math2.sqrt((xlegq[j] * ulen + twa1) * 0.5);
                  } else {
                    qsqz = q * Math2.sqrt((-(xlegq[j] * ulen) + twa1) * 0.5);
                  }
                  var wprb = tukeyWprob(qsqz, rr, cc);
                  var rotsum = wprb * alegq[j] * Math2.exp(t1);
                  otsum += rotsum;
                }
              }
              if (i2 * ulen >= 1 && otsum <= eps2)
                break;
              ans += otsum;
            }
            if (otsum > eps2) {
              throw new Error("tukey.cdf failed to converge");
            }
            if (ans > 1)
              ans = 1;
            return ans;
          },
          inv: function(p, nmeans, df) {
            var rr = 1;
            var cc = nmeans;
            var eps = 1e-4;
            var maxiter = 50;
            if (df < 2 || rr < 1 || cc < 2)
              return NaN;
            if (p < 0 || p > 1)
              return NaN;
            if (p === 0)
              return 0;
            if (p === 1)
              return Infinity;
            var x0 = tukeyQinv(p, cc, df);
            var valx0 = jStat3.tukey.cdf(x0, nmeans, df) - p;
            var x1;
            if (valx0 > 0)
              x1 = Math2.max(0, x0 - 1);
            else
              x1 = x0 + 1;
            var valx1 = jStat3.tukey.cdf(x1, nmeans, df) - p;
            var ans;
            for (var iter = 1; iter < maxiter; iter++) {
              ans = x1 - valx1 * (x1 - x0) / (valx1 - valx0);
              valx0 = valx1;
              x0 = x1;
              if (ans < 0) {
                ans = 0;
                valx1 = -p;
              }
              valx1 = jStat3.tukey.cdf(ans, nmeans, df) - p;
              x1 = ans;
              var xabs = Math2.abs(x1 - x0);
              if (xabs < eps)
                return ans;
            }
            throw new Error("tukey.inv failed to converge");
          }
        });
      })(jStat2, Math);
      (function(jStat3, Math2) {
        var push = Array.prototype.push;
        var isArray2 = jStat3.utils.isArray;
        function isUsable(arg) {
          return isArray2(arg) || arg instanceof jStat3;
        }
        jStat3.extend({
          add: function add2(arr, arg) {
            if (isUsable(arg)) {
              if (!isUsable(arg[0]))
                arg = [arg];
              return jStat3.map(arr, function(value2, row, col) {
                return value2 + arg[row][col];
              });
            }
            return jStat3.map(arr, function(value2) {
              return value2 + arg;
            });
          },
          subtract: function subtract(arr, arg) {
            if (isUsable(arg)) {
              if (!isUsable(arg[0]))
                arg = [arg];
              return jStat3.map(arr, function(value2, row, col) {
                return value2 - arg[row][col] || 0;
              });
            }
            return jStat3.map(arr, function(value2) {
              return value2 - arg;
            });
          },
          divide: function divide(arr, arg) {
            if (isUsable(arg)) {
              if (!isUsable(arg[0]))
                arg = [arg];
              return jStat3.multiply(arr, jStat3.inv(arg));
            }
            return jStat3.map(arr, function(value2) {
              return value2 / arg;
            });
          },
          multiply: function multiply(arr, arg) {
            var row, col, nrescols, sum, nrow, ncol, res, rescols;
            if (arr.length === void 0 && arg.length === void 0) {
              return arr * arg;
            }
            nrow = arr.length, ncol = arr[0].length, res = jStat3.zeros(nrow, nrescols = isUsable(arg) ? arg[0].length : ncol), rescols = 0;
            if (isUsable(arg)) {
              for (; rescols < nrescols; rescols++) {
                for (row = 0; row < nrow; row++) {
                  sum = 0;
                  for (col = 0; col < ncol; col++)
                    sum += arr[row][col] * arg[col][rescols];
                  res[row][rescols] = sum;
                }
              }
              return nrow === 1 && rescols === 1 ? res[0][0] : res;
            }
            return jStat3.map(arr, function(value2) {
              return value2 * arg;
            });
          },
          outer: function outer(A, B) {
            return jStat3.multiply(A.map(function(t2) {
              return [t2];
            }), [B]);
          },
          dot: function dot(arr, arg) {
            if (!isUsable(arr[0]))
              arr = [arr];
            if (!isUsable(arg[0]))
              arg = [arg];
            var left = arr[0].length === 1 && arr.length !== 1 ? jStat3.transpose(arr) : arr, right = arg[0].length === 1 && arg.length !== 1 ? jStat3.transpose(arg) : arg, res = [], row = 0, nrow = left.length, ncol = left[0].length, sum, col;
            for (; row < nrow; row++) {
              res[row] = [];
              sum = 0;
              for (col = 0; col < ncol; col++)
                sum += left[row][col] * right[row][col];
              res[row] = sum;
            }
            return res.length === 1 ? res[0] : res;
          },
          pow: function pow(arr, arg) {
            return jStat3.map(arr, function(value2) {
              return Math2.pow(value2, arg);
            });
          },
          exp: function exp(arr) {
            return jStat3.map(arr, function(value2) {
              return Math2.exp(value2);
            });
          },
          log: function exp(arr) {
            return jStat3.map(arr, function(value2) {
              return Math2.log(value2);
            });
          },
          abs: function abs(arr) {
            return jStat3.map(arr, function(value2) {
              return Math2.abs(value2);
            });
          },
          norm: function norm(arr, p) {
            var nnorm = 0, i2 = 0;
            if (isNaN(p))
              p = 2;
            if (isUsable(arr[0]))
              arr = arr[0];
            for (; i2 < arr.length; i2++) {
              nnorm += Math2.pow(Math2.abs(arr[i2]), p);
            }
            return Math2.pow(nnorm, 1 / p);
          },
          angle: function angle(arr, arg) {
            return Math2.acos(jStat3.dot(arr, arg) / (jStat3.norm(arr) * jStat3.norm(arg)));
          },
          aug: function aug(a, b) {
            var newarr = [];
            var i2;
            for (i2 = 0; i2 < a.length; i2++) {
              newarr.push(a[i2].slice());
            }
            for (i2 = 0; i2 < newarr.length; i2++) {
              push.apply(newarr[i2], b[i2]);
            }
            return newarr;
          },
          inv: function inv(a) {
            var rows = a.length;
            var cols = a[0].length;
            var b = jStat3.identity(rows, cols);
            var c = jStat3.gauss_jordan(a, b);
            var result = [];
            var i2 = 0;
            var j;
            for (; i2 < rows; i2++) {
              result[i2] = [];
              for (j = cols; j < c[0].length; j++)
                result[i2][j - cols] = c[i2][j];
            }
            return result;
          },
          det: function det(a) {
            if (a.length === 2) {
              return a[0][0] * a[1][1] - a[0][1] * a[1][0];
            }
            var determinant = 0;
            for (var i2 = 0; i2 < a.length; i2++) {
              var submatrix = [];
              for (var row = 1; row < a.length; row++) {
                submatrix[row - 1] = [];
                for (var col = 0; col < a.length; col++) {
                  if (col < i2) {
                    submatrix[row - 1][col] = a[row][col];
                  } else if (col > i2) {
                    submatrix[row - 1][col - 1] = a[row][col];
                  }
                }
              }
              var sign = i2 % 2 ? -1 : 1;
              determinant += det(submatrix) * a[0][i2] * sign;
            }
            return determinant;
          },
          gauss_elimination: function gauss_elimination(a, b) {
            var i2 = 0, j = 0, n = a.length, m = a[0].length, factor = 1, sum = 0, x = [], maug, pivot, temp, k;
            a = jStat3.aug(a, b);
            maug = a[0].length;
            for (i2 = 0; i2 < n; i2++) {
              pivot = a[i2][i2];
              j = i2;
              for (k = i2 + 1; k < m; k++) {
                if (pivot < Math2.abs(a[k][i2])) {
                  pivot = a[k][i2];
                  j = k;
                }
              }
              if (j != i2) {
                for (k = 0; k < maug; k++) {
                  temp = a[i2][k];
                  a[i2][k] = a[j][k];
                  a[j][k] = temp;
                }
              }
              for (j = i2 + 1; j < n; j++) {
                factor = a[j][i2] / a[i2][i2];
                for (k = i2; k < maug; k++) {
                  a[j][k] = a[j][k] - factor * a[i2][k];
                }
              }
            }
            for (i2 = n - 1; i2 >= 0; i2--) {
              sum = 0;
              for (j = i2 + 1; j <= n - 1; j++) {
                sum = sum + x[j] * a[i2][j];
              }
              x[i2] = (a[i2][maug - 1] - sum) / a[i2][i2];
            }
            return x;
          },
          gauss_jordan: function gauss_jordan(a, b) {
            var m = jStat3.aug(a, b);
            var h = m.length;
            var w = m[0].length;
            var c = 0;
            var x, y, y2;
            for (y = 0; y < h; y++) {
              var maxrow = y;
              for (y2 = y + 1; y2 < h; y2++) {
                if (Math2.abs(m[y2][y]) > Math2.abs(m[maxrow][y]))
                  maxrow = y2;
              }
              var tmp = m[y];
              m[y] = m[maxrow];
              m[maxrow] = tmp;
              for (y2 = y + 1; y2 < h; y2++) {
                c = m[y2][y] / m[y][y];
                for (x = y; x < w; x++) {
                  m[y2][x] -= m[y][x] * c;
                }
              }
            }
            for (y = h - 1; y >= 0; y--) {
              c = m[y][y];
              for (y2 = 0; y2 < y; y2++) {
                for (x = w - 1; x > y - 1; x--) {
                  m[y2][x] -= m[y][x] * m[y2][y] / c;
                }
              }
              m[y][y] /= c;
              for (x = h; x < w; x++) {
                m[y][x] /= c;
              }
            }
            return m;
          },
          triaUpSolve: function triaUpSolve(A, b) {
            var size = A[0].length;
            var x = jStat3.zeros(1, size)[0];
            var parts;
            var matrix_mode = false;
            if (b[0].length != void 0) {
              b = b.map(function(i2) {
                return i2[0];
              });
              matrix_mode = true;
            }
            jStat3.arange(size - 1, -1, -1).forEach(function(i2) {
              parts = jStat3.arange(i2 + 1, size).map(function(j) {
                return x[j] * A[i2][j];
              });
              x[i2] = (b[i2] - jStat3.sum(parts)) / A[i2][i2];
            });
            if (matrix_mode)
              return x.map(function(i2) {
                return [i2];
              });
            return x;
          },
          triaLowSolve: function triaLowSolve(A, b) {
            var size = A[0].length;
            var x = jStat3.zeros(1, size)[0];
            var parts;
            var matrix_mode = false;
            if (b[0].length != void 0) {
              b = b.map(function(i2) {
                return i2[0];
              });
              matrix_mode = true;
            }
            jStat3.arange(size).forEach(function(i2) {
              parts = jStat3.arange(i2).map(function(j) {
                return A[i2][j] * x[j];
              });
              x[i2] = (b[i2] - jStat3.sum(parts)) / A[i2][i2];
            });
            if (matrix_mode)
              return x.map(function(i2) {
                return [i2];
              });
            return x;
          },
          lu: function lu(A) {
            var size = A.length;
            var L = jStat3.identity(size);
            var R = jStat3.zeros(A.length, A[0].length);
            var parts;
            jStat3.arange(size).forEach(function(t2) {
              R[0][t2] = A[0][t2];
            });
            jStat3.arange(1, size).forEach(function(l) {
              jStat3.arange(l).forEach(function(i2) {
                parts = jStat3.arange(i2).map(function(jj) {
                  return L[l][jj] * R[jj][i2];
                });
                L[l][i2] = (A[l][i2] - jStat3.sum(parts)) / R[i2][i2];
              });
              jStat3.arange(l, size).forEach(function(j) {
                parts = jStat3.arange(l).map(function(jj) {
                  return L[l][jj] * R[jj][j];
                });
                R[l][j] = A[parts.length][j] - jStat3.sum(parts);
              });
            });
            return [L, R];
          },
          cholesky: function cholesky(A) {
            var size = A.length;
            var T2 = jStat3.zeros(A.length, A[0].length);
            var parts;
            jStat3.arange(size).forEach(function(i2) {
              parts = jStat3.arange(i2).map(function(t2) {
                return Math2.pow(T2[i2][t2], 2);
              });
              T2[i2][i2] = Math2.sqrt(A[i2][i2] - jStat3.sum(parts));
              jStat3.arange(i2 + 1, size).forEach(function(j) {
                parts = jStat3.arange(i2).map(function(t2) {
                  return T2[i2][t2] * T2[j][t2];
                });
                T2[j][i2] = (A[i2][j] - jStat3.sum(parts)) / T2[i2][i2];
              });
            });
            return T2;
          },
          gauss_jacobi: function gauss_jacobi(a, b, x, r) {
            var i2 = 0;
            var j = 0;
            var n = a.length;
            var l = [];
            var u = [];
            var d = [];
            var xv, c, h, xk;
            for (; i2 < n; i2++) {
              l[i2] = [];
              u[i2] = [];
              d[i2] = [];
              for (j = 0; j < n; j++) {
                if (i2 > j) {
                  l[i2][j] = a[i2][j];
                  u[i2][j] = d[i2][j] = 0;
                } else if (i2 < j) {
                  u[i2][j] = a[i2][j];
                  l[i2][j] = d[i2][j] = 0;
                } else {
                  d[i2][j] = a[i2][j];
                  l[i2][j] = u[i2][j] = 0;
                }
              }
            }
            h = jStat3.multiply(jStat3.multiply(jStat3.inv(d), jStat3.add(l, u)), -1);
            c = jStat3.multiply(jStat3.inv(d), b);
            xv = x;
            xk = jStat3.add(jStat3.multiply(h, x), c);
            i2 = 2;
            while (Math2.abs(jStat3.norm(jStat3.subtract(xk, xv))) > r) {
              xv = xk;
              xk = jStat3.add(jStat3.multiply(h, xv), c);
              i2++;
            }
            return xk;
          },
          gauss_seidel: function gauss_seidel(a, b, x, r) {
            var i2 = 0;
            var n = a.length;
            var l = [];
            var u = [];
            var d = [];
            var j, xv, c, h, xk;
            for (; i2 < n; i2++) {
              l[i2] = [];
              u[i2] = [];
              d[i2] = [];
              for (j = 0; j < n; j++) {
                if (i2 > j) {
                  l[i2][j] = a[i2][j];
                  u[i2][j] = d[i2][j] = 0;
                } else if (i2 < j) {
                  u[i2][j] = a[i2][j];
                  l[i2][j] = d[i2][j] = 0;
                } else {
                  d[i2][j] = a[i2][j];
                  l[i2][j] = u[i2][j] = 0;
                }
              }
            }
            h = jStat3.multiply(jStat3.multiply(jStat3.inv(jStat3.add(d, l)), u), -1);
            c = jStat3.multiply(jStat3.inv(jStat3.add(d, l)), b);
            xv = x;
            xk = jStat3.add(jStat3.multiply(h, x), c);
            i2 = 2;
            while (Math2.abs(jStat3.norm(jStat3.subtract(xk, xv))) > r) {
              xv = xk;
              xk = jStat3.add(jStat3.multiply(h, xv), c);
              i2 = i2 + 1;
            }
            return xk;
          },
          SOR: function SOR(a, b, x, r, w) {
            var i2 = 0;
            var n = a.length;
            var l = [];
            var u = [];
            var d = [];
            var j, xv, c, h, xk;
            for (; i2 < n; i2++) {
              l[i2] = [];
              u[i2] = [];
              d[i2] = [];
              for (j = 0; j < n; j++) {
                if (i2 > j) {
                  l[i2][j] = a[i2][j];
                  u[i2][j] = d[i2][j] = 0;
                } else if (i2 < j) {
                  u[i2][j] = a[i2][j];
                  l[i2][j] = d[i2][j] = 0;
                } else {
                  d[i2][j] = a[i2][j];
                  l[i2][j] = u[i2][j] = 0;
                }
              }
            }
            h = jStat3.multiply(jStat3.inv(jStat3.add(d, jStat3.multiply(l, w))), jStat3.subtract(jStat3.multiply(d, 1 - w), jStat3.multiply(u, w)));
            c = jStat3.multiply(jStat3.multiply(jStat3.inv(jStat3.add(d, jStat3.multiply(l, w))), b), w);
            xv = x;
            xk = jStat3.add(jStat3.multiply(h, x), c);
            i2 = 2;
            while (Math2.abs(jStat3.norm(jStat3.subtract(xk, xv))) > r) {
              xv = xk;
              xk = jStat3.add(jStat3.multiply(h, xv), c);
              i2++;
            }
            return xk;
          },
          householder: function householder(a) {
            var m = a.length;
            var n = a[0].length;
            var i2 = 0;
            var w = [];
            var p = [];
            var alpha, r, k, j, factor;
            for (; i2 < m - 1; i2++) {
              alpha = 0;
              for (j = i2 + 1; j < n; j++)
                alpha += a[j][i2] * a[j][i2];
              factor = a[i2 + 1][i2] > 0 ? -1 : 1;
              alpha = factor * Math2.sqrt(alpha);
              r = Math2.sqrt((alpha * alpha - a[i2 + 1][i2] * alpha) / 2);
              w = jStat3.zeros(m, 1);
              w[i2 + 1][0] = (a[i2 + 1][i2] - alpha) / (2 * r);
              for (k = i2 + 2; k < m; k++)
                w[k][0] = a[k][i2] / (2 * r);
              p = jStat3.subtract(jStat3.identity(m, n), jStat3.multiply(jStat3.multiply(w, jStat3.transpose(w)), 2));
              a = jStat3.multiply(p, jStat3.multiply(a, p));
            }
            return a;
          },
          QR: function() {
            var sum = jStat3.sum;
            var range = jStat3.arange;
            function qr2(x) {
              var n = x.length;
              var p = x[0].length;
              var r = jStat3.zeros(p, p);
              x = jStat3.copy(x);
              var i2, j, k;
              for (j = 0; j < p; j++) {
                r[j][j] = Math2.sqrt(sum(range(n).map(function(i3) {
                  return x[i3][j] * x[i3][j];
                })));
                for (i2 = 0; i2 < n; i2++) {
                  x[i2][j] = x[i2][j] / r[j][j];
                }
                for (k = j + 1; k < p; k++) {
                  r[j][k] = sum(range(n).map(function(i3) {
                    return x[i3][j] * x[i3][k];
                  }));
                  for (i2 = 0; i2 < n; i2++) {
                    x[i2][k] = x[i2][k] - x[i2][j] * r[j][k];
                  }
                }
              }
              return [x, r];
            }
            return qr2;
          }(),
          lstsq: function() {
            function R_I(A) {
              A = jStat3.copy(A);
              var size = A.length;
              var I = jStat3.identity(size);
              jStat3.arange(size - 1, -1, -1).forEach(function(i2) {
                jStat3.sliceAssign(I, { row: i2 }, jStat3.divide(jStat3.slice(I, { row: i2 }), A[i2][i2]));
                jStat3.sliceAssign(A, { row: i2 }, jStat3.divide(jStat3.slice(A, { row: i2 }), A[i2][i2]));
                jStat3.arange(i2).forEach(function(j) {
                  var c = jStat3.multiply(A[j][i2], -1);
                  var Aj = jStat3.slice(A, { row: j });
                  var cAi = jStat3.multiply(jStat3.slice(A, { row: i2 }), c);
                  jStat3.sliceAssign(A, { row: j }, jStat3.add(Aj, cAi));
                  var Ij = jStat3.slice(I, { row: j });
                  var cIi = jStat3.multiply(jStat3.slice(I, { row: i2 }), c);
                  jStat3.sliceAssign(I, { row: j }, jStat3.add(Ij, cIi));
                });
              });
              return I;
            }
            function qr_solve(A, b) {
              var array_mode = false;
              if (b[0].length === void 0) {
                b = b.map(function(x2) {
                  return [x2];
                });
                array_mode = true;
              }
              var QR = jStat3.QR(A);
              var Q = QR[0];
              var R = QR[1];
              var attrs = A[0].length;
              var Q1 = jStat3.slice(Q, { col: { end: attrs } });
              var R1 = jStat3.slice(R, { row: { end: attrs } });
              var RI = R_I(R1);
              var Q2 = jStat3.transpose(Q1);
              if (Q2[0].length === void 0) {
                Q2 = [Q2];
              }
              var x = jStat3.multiply(jStat3.multiply(RI, Q2), b);
              if (x.length === void 0) {
                x = [[x]];
              }
              if (array_mode)
                return x.map(function(i2) {
                  return i2[0];
                });
              return x;
            }
            return qr_solve;
          }(),
          jacobi: function jacobi(a) {
            var condition = 1;
            var n = a.length;
            var e = jStat3.identity(n, n);
            var ev = [];
            var b, i2, j, p, q, maxim, theta, s;
            while (condition === 1) {
              maxim = a[0][1];
              p = 0;
              q = 1;
              for (i2 = 0; i2 < n; i2++) {
                for (j = 0; j < n; j++) {
                  if (i2 != j) {
                    if (maxim < Math2.abs(a[i2][j])) {
                      maxim = Math2.abs(a[i2][j]);
                      p = i2;
                      q = j;
                    }
                  }
                }
              }
              if (a[p][p] === a[q][q])
                theta = a[p][q] > 0 ? Math2.PI / 4 : -Math2.PI / 4;
              else
                theta = Math2.atan(2 * a[p][q] / (a[p][p] - a[q][q])) / 2;
              s = jStat3.identity(n, n);
              s[p][p] = Math2.cos(theta);
              s[p][q] = -Math2.sin(theta);
              s[q][p] = Math2.sin(theta);
              s[q][q] = Math2.cos(theta);
              e = jStat3.multiply(e, s);
              b = jStat3.multiply(jStat3.multiply(jStat3.inv(s), a), s);
              a = b;
              condition = 0;
              for (i2 = 1; i2 < n; i2++) {
                for (j = 1; j < n; j++) {
                  if (i2 != j && Math2.abs(a[i2][j]) > 1e-3) {
                    condition = 1;
                  }
                }
              }
            }
            for (i2 = 0; i2 < n; i2++)
              ev.push(a[i2][i2]);
            return [e, ev];
          },
          rungekutta: function rungekutta(f, h, p, t_j, u_j, order) {
            var k1, k2, u_j1, k3, k4;
            if (order === 2) {
              while (t_j <= p) {
                k1 = h * f(t_j, u_j);
                k2 = h * f(t_j + h, u_j + k1);
                u_j1 = u_j + (k1 + k2) / 2;
                u_j = u_j1;
                t_j = t_j + h;
              }
            }
            if (order === 4) {
              while (t_j <= p) {
                k1 = h * f(t_j, u_j);
                k2 = h * f(t_j + h / 2, u_j + k1 / 2);
                k3 = h * f(t_j + h / 2, u_j + k2 / 2);
                k4 = h * f(t_j + h, u_j + k3);
                u_j1 = u_j + (k1 + 2 * k2 + 2 * k3 + k4) / 6;
                u_j = u_j1;
                t_j = t_j + h;
              }
            }
            return u_j;
          },
          romberg: function romberg(f, a, b, order) {
            var i2 = 0;
            var h = (b - a) / 2;
            var x = [];
            var h1 = [];
            var g = [];
            var m, a1, j, k, I;
            while (i2 < order / 2) {
              I = f(a);
              for (j = a, k = 0; j <= b; j = j + h, k++)
                x[k] = j;
              m = x.length;
              for (j = 1; j < m - 1; j++) {
                I += (j % 2 !== 0 ? 4 : 2) * f(x[j]);
              }
              I = h / 3 * (I + f(b));
              g[i2] = I;
              h /= 2;
              i2++;
            }
            a1 = g.length;
            m = 1;
            while (a1 !== 1) {
              for (j = 0; j < a1 - 1; j++)
                h1[j] = (Math2.pow(4, m) * g[j + 1] - g[j]) / (Math2.pow(4, m) - 1);
              a1 = h1.length;
              g = h1;
              h1 = [];
              m++;
            }
            return g;
          },
          richardson: function richardson(X, f, x, h) {
            function pos(X2, x2) {
              var i3 = 0;
              var n = X2.length;
              var p;
              for (; i3 < n; i3++)
                if (X2[i3] === x2)
                  p = i3;
              return p;
            }
            var h_min = Math2.abs(x - X[pos(X, x) + 1]);
            var i2 = 0;
            var g = [];
            var h1 = [];
            var y1, y2, m, a, j;
            while (h >= h_min) {
              y1 = pos(X, x + h);
              y2 = pos(X, x);
              g[i2] = (f[y1] - 2 * f[y2] + f[2 * y2 - y1]) / (h * h);
              h /= 2;
              i2++;
            }
            a = g.length;
            m = 1;
            while (a != 1) {
              for (j = 0; j < a - 1; j++)
                h1[j] = (Math2.pow(4, m) * g[j + 1] - g[j]) / (Math2.pow(4, m) - 1);
              a = h1.length;
              g = h1;
              h1 = [];
              m++;
            }
            return g;
          },
          simpson: function simpson(f, a, b, n) {
            var h = (b - a) / n;
            var I = f(a);
            var x = [];
            var j = a;
            var k = 0;
            var i2 = 1;
            var m;
            for (; j <= b; j = j + h, k++)
              x[k] = j;
            m = x.length;
            for (; i2 < m - 1; i2++) {
              I += (i2 % 2 !== 0 ? 4 : 2) * f(x[i2]);
            }
            return h / 3 * (I + f(b));
          },
          hermite: function hermite(X, F2, dF, value2) {
            var n = X.length;
            var p = 0;
            var i2 = 0;
            var l = [];
            var dl = [];
            var A = [];
            var B = [];
            var j;
            for (; i2 < n; i2++) {
              l[i2] = 1;
              for (j = 0; j < n; j++) {
                if (i2 != j)
                  l[i2] *= (value2 - X[j]) / (X[i2] - X[j]);
              }
              dl[i2] = 0;
              for (j = 0; j < n; j++) {
                if (i2 != j)
                  dl[i2] += 1 / (X[i2] - X[j]);
              }
              A[i2] = (1 - 2 * (value2 - X[i2]) * dl[i2]) * (l[i2] * l[i2]);
              B[i2] = (value2 - X[i2]) * (l[i2] * l[i2]);
              p += A[i2] * F2[i2] + B[i2] * dF[i2];
            }
            return p;
          },
          lagrange: function lagrange(X, F2, value2) {
            var p = 0;
            var i2 = 0;
            var j, l;
            var n = X.length;
            for (; i2 < n; i2++) {
              l = F2[i2];
              for (j = 0; j < n; j++) {
                if (i2 != j)
                  l *= (value2 - X[j]) / (X[i2] - X[j]);
              }
              p += l;
            }
            return p;
          },
          cubic_spline: function cubic_spline(X, F2, value2) {
            var n = X.length;
            var i2 = 0, j;
            var A = [];
            var B = [];
            var alpha = [];
            var c = [];
            var h = [];
            var b = [];
            var d = [];
            for (; i2 < n - 1; i2++)
              h[i2] = X[i2 + 1] - X[i2];
            alpha[0] = 0;
            for (i2 = 1; i2 < n - 1; i2++) {
              alpha[i2] = 3 / h[i2] * (F2[i2 + 1] - F2[i2]) - 3 / h[i2 - 1] * (F2[i2] - F2[i2 - 1]);
            }
            for (i2 = 1; i2 < n - 1; i2++) {
              A[i2] = [];
              B[i2] = [];
              A[i2][i2 - 1] = h[i2 - 1];
              A[i2][i2] = 2 * (h[i2 - 1] + h[i2]);
              A[i2][i2 + 1] = h[i2];
              B[i2][0] = alpha[i2];
            }
            c = jStat3.multiply(jStat3.inv(A), B);
            for (j = 0; j < n - 1; j++) {
              b[j] = (F2[j + 1] - F2[j]) / h[j] - h[j] * (c[j + 1][0] + 2 * c[j][0]) / 3;
              d[j] = (c[j + 1][0] - c[j][0]) / (3 * h[j]);
            }
            for (j = 0; j < n; j++) {
              if (X[j] > value2)
                break;
            }
            j -= 1;
            return F2[j] + (value2 - X[j]) * b[j] + jStat3.sq(value2 - X[j]) * c[j] + (value2 - X[j]) * jStat3.sq(value2 - X[j]) * d[j];
          },
          gauss_quadrature: function gauss_quadrature() {
            throw new Error("gauss_quadrature not yet implemented");
          },
          PCA: function PCA(X) {
            var m = X.length;
            var n = X[0].length;
            var i2 = 0;
            var j, temp1;
            var u = [];
            var D = [];
            var result = [];
            var temp2 = [];
            var Y = [];
            var Bt = [];
            var B = [];
            var C2 = [];
            var V = [];
            var Vt = [];
            for (i2 = 0; i2 < m; i2++) {
              u[i2] = jStat3.sum(X[i2]) / n;
            }
            for (i2 = 0; i2 < n; i2++) {
              B[i2] = [];
              for (j = 0; j < m; j++) {
                B[i2][j] = X[j][i2] - u[j];
              }
            }
            B = jStat3.transpose(B);
            for (i2 = 0; i2 < m; i2++) {
              C2[i2] = [];
              for (j = 0; j < m; j++) {
                C2[i2][j] = jStat3.dot([B[i2]], [B[j]]) / (n - 1);
              }
            }
            result = jStat3.jacobi(C2);
            V = result[0];
            D = result[1];
            Vt = jStat3.transpose(V);
            for (i2 = 0; i2 < D.length; i2++) {
              for (j = i2; j < D.length; j++) {
                if (D[i2] < D[j]) {
                  temp1 = D[i2];
                  D[i2] = D[j];
                  D[j] = temp1;
                  temp2 = Vt[i2];
                  Vt[i2] = Vt[j];
                  Vt[j] = temp2;
                }
              }
            }
            Bt = jStat3.transpose(B);
            for (i2 = 0; i2 < m; i2++) {
              Y[i2] = [];
              for (j = 0; j < Bt.length; j++) {
                Y[i2][j] = jStat3.dot([Vt[i2]], [Bt[j]]);
              }
            }
            return [X, D, Vt, Y];
          }
        });
        (function(funcs) {
          for (var i2 = 0; i2 < funcs.length; i2++)
            (function(passfunc) {
              jStat3.fn[passfunc] = function(arg, func) {
                var tmpthis = this;
                if (func) {
                  setTimeout(function() {
                    func.call(tmpthis, jStat3.fn[passfunc].call(tmpthis, arg));
                  }, 15);
                  return this;
                }
                if (typeof jStat3[passfunc](this, arg) === "number")
                  return jStat3[passfunc](this, arg);
                else
                  return jStat3(jStat3[passfunc](this, arg));
              };
            })(funcs[i2]);
        })("add divide multiply subtract dot pow exp log abs norm angle".split(" "));
      })(jStat2, Math);
      (function(jStat3, Math2) {
        var slice = [].slice;
        var isNumber2 = jStat3.utils.isNumber;
        var isArray2 = jStat3.utils.isArray;
        jStat3.extend({
          zscore: function zscore() {
            var args = slice.call(arguments);
            if (isNumber2(args[1])) {
              return (args[0] - args[1]) / args[2];
            }
            return (args[0] - jStat3.mean(args[1])) / jStat3.stdev(args[1], args[2]);
          },
          ztest: function ztest() {
            var args = slice.call(arguments);
            var z;
            if (isArray2(args[1])) {
              z = jStat3.zscore(args[0], args[1], args[3]);
              return args[2] === 1 ? jStat3.normal.cdf(-Math2.abs(z), 0, 1) : jStat3.normal.cdf(-Math2.abs(z), 0, 1) * 2;
            } else {
              if (args.length > 2) {
                z = jStat3.zscore(args[0], args[1], args[2]);
                return args[3] === 1 ? jStat3.normal.cdf(-Math2.abs(z), 0, 1) : jStat3.normal.cdf(-Math2.abs(z), 0, 1) * 2;
              } else {
                z = args[0];
                return args[1] === 1 ? jStat3.normal.cdf(-Math2.abs(z), 0, 1) : jStat3.normal.cdf(-Math2.abs(z), 0, 1) * 2;
              }
            }
          }
        });
        jStat3.extend(jStat3.fn, {
          zscore: function zscore(value2, flag) {
            return (value2 - this.mean()) / this.stdev(flag);
          },
          ztest: function ztest(value2, sides, flag) {
            var zscore = Math2.abs(this.zscore(value2, flag));
            return sides === 1 ? jStat3.normal.cdf(-zscore, 0, 1) : jStat3.normal.cdf(-zscore, 0, 1) * 2;
          }
        });
        jStat3.extend({
          tscore: function tscore() {
            var args = slice.call(arguments);
            return args.length === 4 ? (args[0] - args[1]) / (args[2] / Math2.sqrt(args[3])) : (args[0] - jStat3.mean(args[1])) / (jStat3.stdev(args[1], true) / Math2.sqrt(args[1].length));
          },
          ttest: function ttest() {
            var args = slice.call(arguments);
            var tscore;
            if (args.length === 5) {
              tscore = Math2.abs(jStat3.tscore(args[0], args[1], args[2], args[3]));
              return args[4] === 1 ? jStat3.studentt.cdf(-tscore, args[3] - 1) : jStat3.studentt.cdf(-tscore, args[3] - 1) * 2;
            }
            if (isNumber2(args[1])) {
              tscore = Math2.abs(args[0]);
              return args[2] == 1 ? jStat3.studentt.cdf(-tscore, args[1] - 1) : jStat3.studentt.cdf(-tscore, args[1] - 1) * 2;
            }
            tscore = Math2.abs(jStat3.tscore(args[0], args[1]));
            return args[2] == 1 ? jStat3.studentt.cdf(-tscore, args[1].length - 1) : jStat3.studentt.cdf(-tscore, args[1].length - 1) * 2;
          }
        });
        jStat3.extend(jStat3.fn, {
          tscore: function tscore(value2) {
            return (value2 - this.mean()) / (this.stdev(true) / Math2.sqrt(this.cols()));
          },
          ttest: function ttest(value2, sides) {
            return sides === 1 ? 1 - jStat3.studentt.cdf(Math2.abs(this.tscore(value2)), this.cols() - 1) : jStat3.studentt.cdf(-Math2.abs(this.tscore(value2)), this.cols() - 1) * 2;
          }
        });
        jStat3.extend({
          anovafscore: function anovafscore() {
            var args = slice.call(arguments), expVar, sample, sampMean, sampSampMean, tmpargs, unexpVar, i2, j;
            if (args.length === 1) {
              tmpargs = new Array(args[0].length);
              for (i2 = 0; i2 < args[0].length; i2++) {
                tmpargs[i2] = args[0][i2];
              }
              args = tmpargs;
            }
            sample = new Array();
            for (i2 = 0; i2 < args.length; i2++) {
              sample = sample.concat(args[i2]);
            }
            sampMean = jStat3.mean(sample);
            expVar = 0;
            for (i2 = 0; i2 < args.length; i2++) {
              expVar = expVar + args[i2].length * Math2.pow(jStat3.mean(args[i2]) - sampMean, 2);
            }
            expVar /= args.length - 1;
            unexpVar = 0;
            for (i2 = 0; i2 < args.length; i2++) {
              sampSampMean = jStat3.mean(args[i2]);
              for (j = 0; j < args[i2].length; j++) {
                unexpVar += Math2.pow(args[i2][j] - sampSampMean, 2);
              }
            }
            unexpVar /= sample.length - args.length;
            return expVar / unexpVar;
          },
          anovaftest: function anovaftest() {
            var args = slice.call(arguments), df1, df2, n, i2;
            if (isNumber2(args[0])) {
              return 1 - jStat3.centralF.cdf(args[0], args[1], args[2]);
            }
            var anovafscore = jStat3.anovafscore(args);
            df1 = args.length - 1;
            n = 0;
            for (i2 = 0; i2 < args.length; i2++) {
              n = n + args[i2].length;
            }
            df2 = n - df1 - 1;
            return 1 - jStat3.centralF.cdf(anovafscore, df1, df2);
          },
          ftest: function ftest(fscore, df1, df2) {
            return 1 - jStat3.centralF.cdf(fscore, df1, df2);
          }
        });
        jStat3.extend(jStat3.fn, {
          anovafscore: function anovafscore() {
            return jStat3.anovafscore(this.toArray());
          },
          anovaftes: function anovaftes() {
            var n = 0;
            var i2;
            for (i2 = 0; i2 < this.length; i2++) {
              n = n + this[i2].length;
            }
            return jStat3.ftest(this.anovafscore(), this.length - 1, n - this.length);
          }
        });
        jStat3.extend({
          qscore: function qscore() {
            var args = slice.call(arguments);
            var mean1, mean2, n1, n2, sd;
            if (isNumber2(args[0])) {
              mean1 = args[0];
              mean2 = args[1];
              n1 = args[2];
              n2 = args[3];
              sd = args[4];
            } else {
              mean1 = jStat3.mean(args[0]);
              mean2 = jStat3.mean(args[1]);
              n1 = args[0].length;
              n2 = args[1].length;
              sd = args[2];
            }
            return Math2.abs(mean1 - mean2) / (sd * Math2.sqrt((1 / n1 + 1 / n2) / 2));
          },
          qtest: function qtest() {
            var args = slice.call(arguments);
            var qscore;
            if (args.length === 3) {
              qscore = args[0];
              args = args.slice(1);
            } else if (args.length === 7) {
              qscore = jStat3.qscore(args[0], args[1], args[2], args[3], args[4]);
              args = args.slice(5);
            } else {
              qscore = jStat3.qscore(args[0], args[1], args[2]);
              args = args.slice(3);
            }
            var n = args[0];
            var k = args[1];
            return 1 - jStat3.tukey.cdf(qscore, k, n - k);
          },
          tukeyhsd: function tukeyhsd(arrays) {
            var sd = jStat3.pooledstdev(arrays);
            var means = arrays.map(function(arr) {
              return jStat3.mean(arr);
            });
            var n = arrays.reduce(function(n2, arr) {
              return n2 + arr.length;
            }, 0);
            var results = [];
            for (var i2 = 0; i2 < arrays.length; ++i2) {
              for (var j = i2 + 1; j < arrays.length; ++j) {
                var p = jStat3.qtest(means[i2], means[j], arrays[i2].length, arrays[j].length, sd, n, arrays.length);
                results.push([[i2, j], p]);
              }
            }
            return results;
          }
        });
        jStat3.extend({
          normalci: function normalci() {
            var args = slice.call(arguments), ans = new Array(2), change;
            if (args.length === 4) {
              change = Math2.abs(jStat3.normal.inv(args[1] / 2, 0, 1) * args[2] / Math2.sqrt(args[3]));
            } else {
              change = Math2.abs(jStat3.normal.inv(args[1] / 2, 0, 1) * jStat3.stdev(args[2]) / Math2.sqrt(args[2].length));
            }
            ans[0] = args[0] - change;
            ans[1] = args[0] + change;
            return ans;
          },
          tci: function tci() {
            var args = slice.call(arguments), ans = new Array(2), change;
            if (args.length === 4) {
              change = Math2.abs(jStat3.studentt.inv(args[1] / 2, args[3] - 1) * args[2] / Math2.sqrt(args[3]));
            } else {
              change = Math2.abs(jStat3.studentt.inv(args[1] / 2, args[2].length - 1) * jStat3.stdev(args[2], true) / Math2.sqrt(args[2].length));
            }
            ans[0] = args[0] - change;
            ans[1] = args[0] + change;
            return ans;
          },
          significant: function significant(pvalue, alpha) {
            return pvalue < alpha;
          }
        });
        jStat3.extend(jStat3.fn, {
          normalci: function normalci(value2, alpha) {
            return jStat3.normalci(value2, alpha, this.toArray());
          },
          tci: function tci(value2, alpha) {
            return jStat3.tci(value2, alpha, this.toArray());
          }
        });
        function differenceOfProportions(p1, n1, p2, n2) {
          if (p1 > 1 || p2 > 1 || p1 <= 0 || p2 <= 0) {
            throw new Error("Proportions should be greater than 0 and less than 1");
          }
          var pooled = (p1 * n1 + p2 * n2) / (n1 + n2);
          var se = Math2.sqrt(pooled * (1 - pooled) * (1 / n1 + 1 / n2));
          return (p1 - p2) / se;
        }
        jStat3.extend(jStat3.fn, {
          oneSidedDifferenceOfProportions: function oneSidedDifferenceOfProportions(p1, n1, p2, n2) {
            var z = differenceOfProportions(p1, n1, p2, n2);
            return jStat3.ztest(z, 1);
          },
          twoSidedDifferenceOfProportions: function twoSidedDifferenceOfProportions(p1, n1, p2, n2) {
            var z = differenceOfProportions(p1, n1, p2, n2);
            return jStat3.ztest(z, 2);
          }
        });
      })(jStat2, Math);
      jStat2.models = function() {
        function sub_regress(exog) {
          var var_count = exog[0].length;
          var modelList = jStat2.arange(var_count).map(function(endog_index) {
            var exog_index = jStat2.arange(var_count).filter(function(i2) {
              return i2 !== endog_index;
            });
            return ols(jStat2.col(exog, endog_index).map(function(x) {
              return x[0];
            }), jStat2.col(exog, exog_index));
          });
          return modelList;
        }
        function ols(endog, exog) {
          var nobs = endog.length;
          var df_model = exog[0].length - 1;
          var df_resid = nobs - df_model - 1;
          var coef = jStat2.lstsq(exog, endog);
          var predict = jStat2.multiply(exog, coef.map(function(x) {
            return [x];
          })).map(function(p) {
            return p[0];
          });
          var resid = jStat2.subtract(endog, predict);
          var ybar = jStat2.mean(endog);
          var SSE = jStat2.sum(predict.map(function(f) {
            return Math.pow(f - ybar, 2);
          }));
          var SSR = jStat2.sum(endog.map(function(y, i2) {
            return Math.pow(y - predict[i2], 2);
          }));
          var SST = SSE + SSR;
          var R2 = SSE / SST;
          return {
            exog,
            endog,
            nobs,
            df_model,
            df_resid,
            coef,
            predict,
            resid,
            ybar,
            SST,
            SSE,
            SSR,
            R2
          };
        }
        function t_test(model) {
          var subModelList = sub_regress(model.exog);
          var sigmaHat = Math.sqrt(model.SSR / model.df_resid);
          var seBetaHat = subModelList.map(function(mod) {
            var SST = mod.SST;
            var R2 = mod.R2;
            return sigmaHat / Math.sqrt(SST * (1 - R2));
          });
          var tStatistic = model.coef.map(function(coef, i2) {
            return (coef - 0) / seBetaHat[i2];
          });
          var pValue = tStatistic.map(function(t2) {
            var leftppf = jStat2.studentt.cdf(t2, model.df_resid);
            return (leftppf > 0.5 ? 1 - leftppf : leftppf) * 2;
          });
          var c = jStat2.studentt.inv(0.975, model.df_resid);
          var interval95 = model.coef.map(function(coef, i2) {
            var d = c * seBetaHat[i2];
            return [coef - d, coef + d];
          });
          return {
            se: seBetaHat,
            t: tStatistic,
            p: pValue,
            sigmaHat,
            interval95
          };
        }
        function F_test(model) {
          var F_statistic = model.R2 / model.df_model / ((1 - model.R2) / model.df_resid);
          var fcdf = function(x, n1, n2) {
            return jStat2.beta.cdf(x / (n2 / n1 + x), n1 / 2, n2 / 2);
          };
          var pvalue = 1 - fcdf(F_statistic, model.df_model, model.df_resid);
          return { F_statistic, pvalue };
        }
        function ols_wrap(endog, exog) {
          var model = ols(endog, exog);
          var ttest = t_test(model);
          var ftest = F_test(model);
          var adjust_R2 = 1 - (1 - model.R2) * ((model.nobs - 1) / model.df_resid);
          model.t = ttest;
          model.f = ftest;
          model.adjust_R2 = adjust_R2;
          return model;
        }
        return { ols: ols_wrap };
      }();
      jStat2.extend({
        buildxmatrix: function buildxmatrix() {
          var matrixRows = new Array(arguments.length);
          for (var i2 = 0; i2 < arguments.length; i2++) {
            var array = [1];
            matrixRows[i2] = array.concat(arguments[i2]);
          }
          return jStat2(matrixRows);
        },
        builddxmatrix: function builddxmatrix() {
          var matrixRows = new Array(arguments[0].length);
          for (var i2 = 0; i2 < arguments[0].length; i2++) {
            var array = [1];
            matrixRows[i2] = array.concat(arguments[0][i2]);
          }
          return jStat2(matrixRows);
        },
        buildjxmatrix: function buildjxmatrix(jMat) {
          var pass = new Array(jMat.length);
          for (var i2 = 0; i2 < jMat.length; i2++) {
            pass[i2] = jMat[i2];
          }
          return jStat2.builddxmatrix(pass);
        },
        buildymatrix: function buildymatrix(array) {
          return jStat2(array).transpose();
        },
        buildjymatrix: function buildjymatrix(jMat) {
          return jMat.transpose();
        },
        matrixmult: function matrixmult(A, B) {
          var i2, j, k, result, sum;
          if (A.cols() == B.rows()) {
            if (B.rows() > 1) {
              result = [];
              for (i2 = 0; i2 < A.rows(); i2++) {
                result[i2] = [];
                for (j = 0; j < B.cols(); j++) {
                  sum = 0;
                  for (k = 0; k < A.cols(); k++) {
                    sum += A.toArray()[i2][k] * B.toArray()[k][j];
                  }
                  result[i2][j] = sum;
                }
              }
              return jStat2(result);
            }
            result = [];
            for (i2 = 0; i2 < A.rows(); i2++) {
              result[i2] = [];
              for (j = 0; j < B.cols(); j++) {
                sum = 0;
                for (k = 0; k < A.cols(); k++) {
                  sum += A.toArray()[i2][k] * B.toArray()[j];
                }
                result[i2][j] = sum;
              }
            }
            return jStat2(result);
          }
        },
        regress: function regress(jMatX, jMatY) {
          var innerinv = jStat2.xtranspxinv(jMatX);
          var xtransp = jMatX.transpose();
          var next = jStat2.matrixmult(jStat2(innerinv), xtransp);
          return jStat2.matrixmult(next, jMatY);
        },
        regresst: function regresst(jMatX, jMatY, sides) {
          var beta = jStat2.regress(jMatX, jMatY);
          var compile = {};
          compile.anova = {};
          var jMatYBar = jStat2.jMatYBar(jMatX, beta);
          compile.yBar = jMatYBar;
          var yAverage = jMatY.mean();
          compile.anova.residuals = jStat2.residuals(jMatY, jMatYBar);
          compile.anova.ssr = jStat2.ssr(jMatYBar, yAverage);
          compile.anova.msr = compile.anova.ssr / (jMatX[0].length - 1);
          compile.anova.sse = jStat2.sse(jMatY, jMatYBar);
          compile.anova.mse = compile.anova.sse / (jMatY.length - (jMatX[0].length - 1) - 1);
          compile.anova.sst = jStat2.sst(jMatY, yAverage);
          compile.anova.mst = compile.anova.sst / (jMatY.length - 1);
          compile.anova.r2 = 1 - compile.anova.sse / compile.anova.sst;
          if (compile.anova.r2 < 0)
            compile.anova.r2 = 0;
          compile.anova.fratio = compile.anova.msr / compile.anova.mse;
          compile.anova.pvalue = jStat2.anovaftest(compile.anova.fratio, jMatX[0].length - 1, jMatY.length - (jMatX[0].length - 1) - 1);
          compile.anova.rmse = Math.sqrt(compile.anova.mse);
          compile.anova.r2adj = 1 - compile.anova.mse / compile.anova.mst;
          if (compile.anova.r2adj < 0)
            compile.anova.r2adj = 0;
          compile.stats = new Array(jMatX[0].length);
          var covar = jStat2.xtranspxinv(jMatX);
          var sds, ts, ps;
          for (var i2 = 0; i2 < beta.length; i2++) {
            sds = Math.sqrt(compile.anova.mse * Math.abs(covar[i2][i2]));
            ts = Math.abs(beta[i2] / sds);
            ps = jStat2.ttest(ts, jMatY.length - jMatX[0].length - 1, sides);
            compile.stats[i2] = [beta[i2], sds, ts, ps];
          }
          compile.regress = beta;
          return compile;
        },
        xtranspx: function xtranspx(jMatX) {
          return jStat2.matrixmult(jMatX.transpose(), jMatX);
        },
        xtranspxinv: function xtranspxinv(jMatX) {
          var inner = jStat2.matrixmult(jMatX.transpose(), jMatX);
          var innerinv = jStat2.inv(inner);
          return innerinv;
        },
        jMatYBar: function jMatYBar(jMatX, beta) {
          var yBar = jStat2.matrixmult(jMatX, beta);
          return new jStat2(yBar);
        },
        residuals: function residuals(jMatY, jMatYBar) {
          return jStat2.matrixsubtract(jMatY, jMatYBar);
        },
        ssr: function ssr(jMatYBar, yAverage) {
          var ssr2 = 0;
          for (var i2 = 0; i2 < jMatYBar.length; i2++) {
            ssr2 += Math.pow(jMatYBar[i2] - yAverage, 2);
          }
          return ssr2;
        },
        sse: function sse(jMatY, jMatYBar) {
          var sse2 = 0;
          for (var i2 = 0; i2 < jMatY.length; i2++) {
            sse2 += Math.pow(jMatY[i2] - jMatYBar[i2], 2);
          }
          return sse2;
        },
        sst: function sst(jMatY, yAverage) {
          var sst2 = 0;
          for (var i2 = 0; i2 < jMatY.length; i2++) {
            sst2 += Math.pow(jMatY[i2] - yAverage, 2);
          }
          return sst2;
        },
        matrixsubtract: function matrixsubtract(A, B) {
          var ans = new Array(A.length);
          for (var i2 = 0; i2 < A.length; i2++) {
            ans[i2] = new Array(A[i2].length);
            for (var j = 0; j < A[i2].length; j++) {
              ans[i2][j] = A[i2][j] - B[i2][j];
            }
          }
          return jStat2(ans);
        }
      });
      jStat2.jStat = jStat2;
      return jStat2;
    });
  })(jstat);
  var jStat = jstat.exports;
  var bessel = {};
  (function(exports2) {
    (function(factory) {
      if (typeof DO_NOT_EXPORT_BESSEL === "undefined") {
        {
          factory(exports2);
        }
      } else {
        factory({});
      }
    })(function(BESSEL) {
      BESSEL.version = "1.0.2";
      var M = Math;
      function _horner(arr, v) {
        for (var i2 = 0, z = 0; i2 < arr.length; ++i2)
          z = v * z + arr[i2];
        return z;
      }
      function _bessel_iter(x, n, f0, f1, sign) {
        if (n === 0)
          return f0;
        if (n === 1)
          return f1;
        var tdx = 2 / x, f2 = f1;
        for (var o = 1; o < n; ++o) {
          f2 = f1 * o * tdx + sign * f0;
          f0 = f1;
          f1 = f2;
        }
        return f2;
      }
      function _bessel_wrap(bessel0, bessel1, name2, nonzero, sign) {
        return function bessel2(x, n) {
          if (nonzero) {
            if (x === 0)
              return nonzero == 1 ? -Infinity : Infinity;
            else if (x < 0)
              return NaN;
          }
          if (n === 0)
            return bessel0(x);
          if (n === 1)
            return bessel1(x);
          if (n < 0)
            return NaN;
          n |= 0;
          var b0 = bessel0(x), b1 = bessel1(x);
          return _bessel_iter(x, n, b0, b1, sign);
        };
      }
      var besselj = function() {
        var W = 0.636619772;
        var b0_a1a = [57568490574, -13362590354, 6516196407e-1, -1121442418e-2, 77392.33017, -184.9052456].reverse();
        var b0_a2a = [57568490411, 1029532985, 9494680718e-3, 59272.64853, 267.8532712, 1].reverse();
        var b0_a1b = [1, -0.001098628627, 2734510407e-14, -2073370639e-15, 2093887211e-16].reverse();
        var b0_a2b = [-0.01562499995, 1430488765e-13, -6911147651e-15, 7621095161e-16, -934935152e-16].reverse();
        function bessel0(x) {
          var a = 0, a1 = 0, a2 = 0, y = x * x;
          if (x < 8) {
            a1 = _horner(b0_a1a, y);
            a2 = _horner(b0_a2a, y);
            a = a1 / a2;
          } else {
            var xx = x - 0.785398164;
            y = 64 / y;
            a1 = _horner(b0_a1b, y);
            a2 = _horner(b0_a2b, y);
            a = M.sqrt(W / x) * (M.cos(xx) * a1 - M.sin(xx) * a2 * 8 / x);
          }
          return a;
        }
        var b1_a1a = [72362614232, -7895059235, 2423968531e-1, -2972611439e-3, 15704.4826, -30.16036606].reverse();
        var b1_a2a = [144725228442, 2300535178, 1858330474e-2, 99447.43394, 376.9991397, 1].reverse();
        var b1_a1b = [1, 183105e-8, -3516396496e-14, 2457520174e-15, -240337019e-15].reverse();
        var b1_a2b = [0.04687499995, -2002690873e-13, 8449199096e-15, -88228987e-14, 105787412e-15].reverse();
        function bessel1(x) {
          var a = 0, a1 = 0, a2 = 0, y = x * x, xx = M.abs(x) - 2.356194491;
          if (Math.abs(x) < 8) {
            a1 = x * _horner(b1_a1a, y);
            a2 = _horner(b1_a2a, y);
            a = a1 / a2;
          } else {
            y = 64 / y;
            a1 = _horner(b1_a1b, y);
            a2 = _horner(b1_a2b, y);
            a = M.sqrt(W / M.abs(x)) * (M.cos(xx) * a1 - M.sin(xx) * a2 * 8 / M.abs(x));
            if (x < 0)
              a = -a;
          }
          return a;
        }
        return function besselj2(x, n) {
          n = Math.round(n);
          if (!isFinite(x))
            return isNaN(x) ? x : 0;
          if (n < 0)
            return (n % 2 ? -1 : 1) * besselj2(x, -n);
          if (x < 0)
            return (n % 2 ? -1 : 1) * besselj2(-x, n);
          if (n === 0)
            return bessel0(x);
          if (n === 1)
            return bessel1(x);
          if (x === 0)
            return 0;
          var ret = 0;
          if (x > n) {
            ret = _bessel_iter(x, n, bessel0(x), bessel1(x), -1);
          } else {
            var m = 2 * M.floor((n + M.floor(M.sqrt(40 * n))) / 2);
            var jsum = false;
            var bjp = 0, sum = 0;
            var bj = 1, bjm = 0;
            var tox = 2 / x;
            for (var j = m; j > 0; j--) {
              bjm = j * tox * bj - bjp;
              bjp = bj;
              bj = bjm;
              if (M.abs(bj) > 1e10) {
                bj *= 1e-10;
                bjp *= 1e-10;
                ret *= 1e-10;
                sum *= 1e-10;
              }
              if (jsum)
                sum += bj;
              jsum = !jsum;
              if (j == n)
                ret = bjp;
            }
            sum = 2 * sum - bj;
            ret /= sum;
          }
          return ret;
        };
      }();
      var bessely = function() {
        var W = 0.636619772;
        var b0_a1a = [-2957821389, 7062834065, -5123598036e-1, 1087988129e-2, -86327.92757, 228.4622733].reverse();
        var b0_a2a = [40076544269, 7452499648e-1, 7189466438e-3, 47447.2647, 226.1030244, 1].reverse();
        var b0_a1b = [1, -0.001098628627, 2734510407e-14, -2073370639e-15, 2093887211e-16].reverse();
        var b0_a2b = [-0.01562499995, 1430488765e-13, -6911147651e-15, 7621095161e-16, -934945152e-16].reverse();
        function bessel0(x) {
          var a = 0, a1 = 0, a2 = 0, y = x * x, xx = x - 0.785398164;
          if (x < 8) {
            a1 = _horner(b0_a1a, y);
            a2 = _horner(b0_a2a, y);
            a = a1 / a2 + W * besselj(x, 0) * M.log(x);
          } else {
            y = 64 / y;
            a1 = _horner(b0_a1b, y);
            a2 = _horner(b0_a2b, y);
            a = M.sqrt(W / x) * (M.sin(xx) * a1 + M.cos(xx) * a2 * 8 / x);
          }
          return a;
        }
        var b1_a1a = [-4900604943e3, 127527439e4, -51534381390, 7349264551e-1, -4237922726e-3, 8511.937935].reverse();
        var b1_a2a = [249958057e5, 424441966400, 3733650367, 2245904002e-2, 102042.605, 354.9632885, 1].reverse();
        var b1_a1b = [1, 183105e-8, -3516396496e-14, 2457520174e-15, -240337019e-15].reverse();
        var b1_a2b = [0.04687499995, -2002690873e-13, 8449199096e-15, -88228987e-14, 105787412e-15].reverse();
        function bessel1(x) {
          var a = 0, a1 = 0, a2 = 0, y = x * x, xx = x - 2.356194491;
          if (x < 8) {
            a1 = x * _horner(b1_a1a, y);
            a2 = _horner(b1_a2a, y);
            a = a1 / a2 + W * (besselj(x, 1) * M.log(x) - 1 / x);
          } else {
            y = 64 / y;
            a1 = _horner(b1_a1b, y);
            a2 = _horner(b1_a2b, y);
            a = M.sqrt(W / x) * (M.sin(xx) * a1 + M.cos(xx) * a2 * 8 / x);
          }
          return a;
        }
        return _bessel_wrap(bessel0, bessel1, "BESSELY", 1, -1);
      }();
      var besseli = function() {
        var b0_a = [1, 3.5156229, 3.0899424, 1.2067492, 0.2659732, 0.0360768, 45813e-7].reverse();
        var b0_b = [0.39894228, 0.01328592, 225319e-8, -157565e-8, 916281e-8, -0.02057706, 0.02635537, -0.01647633, 392377e-8].reverse();
        function bessel0(x) {
          if (x <= 3.75)
            return _horner(b0_a, x * x / (3.75 * 3.75));
          return M.exp(M.abs(x)) / M.sqrt(M.abs(x)) * _horner(b0_b, 3.75 / M.abs(x));
        }
        var b1_a = [0.5, 0.87890594, 0.51498869, 0.15084934, 0.02658733, 301532e-8, 32411e-8].reverse();
        var b1_b = [0.39894228, -0.03988024, -362018e-8, 163801e-8, -0.01031555, 0.02282967, -0.02895312, 0.01787654, -420059e-8].reverse();
        function bessel1(x) {
          if (x < 3.75)
            return x * _horner(b1_a, x * x / (3.75 * 3.75));
          return (x < 0 ? -1 : 1) * M.exp(M.abs(x)) / M.sqrt(M.abs(x)) * _horner(b1_b, 3.75 / M.abs(x));
        }
        return function besseli2(x, n) {
          n = Math.round(n);
          if (n === 0)
            return bessel0(x);
          if (n === 1)
            return bessel1(x);
          if (n < 0)
            return NaN;
          if (M.abs(x) === 0)
            return 0;
          if (x == Infinity)
            return Infinity;
          var ret = 0, j, tox = 2 / M.abs(x), bip = 0, bi = 1, bim = 0;
          var m = 2 * M.round((n + M.round(M.sqrt(40 * n))) / 2);
          for (j = m; j > 0; j--) {
            bim = j * tox * bi + bip;
            bip = bi;
            bi = bim;
            if (M.abs(bi) > 1e10) {
              bi *= 1e-10;
              bip *= 1e-10;
              ret *= 1e-10;
            }
            if (j == n)
              ret = bip;
          }
          ret *= besseli2(x, 0) / bi;
          return x < 0 && n % 2 ? -ret : ret;
        };
      }();
      var besselk = function() {
        var b0_a = [-0.57721566, 0.4227842, 0.23069756, 0.0348859, 262698e-8, 1075e-7, 74e-7].reverse();
        var b0_b = [1.25331414, -0.07832358, 0.02189568, -0.01062446, 587872e-8, -25154e-7, 53208e-8].reverse();
        function bessel0(x) {
          if (x <= 2)
            return -M.log(x / 2) * besseli(x, 0) + _horner(b0_a, x * x / 4);
          return M.exp(-x) / M.sqrt(x) * _horner(b0_b, 2 / x);
        }
        var b1_a = [1, 0.15443144, -0.67278579, -0.18156897, -0.01919402, -110404e-8, -4686e-8].reverse();
        var b1_b = [1.25331414, 0.23498619, -0.0365562, 0.01504268, -780353e-8, 325614e-8, -68245e-8].reverse();
        function bessel1(x) {
          if (x <= 2)
            return M.log(x / 2) * besseli(x, 1) + 1 / x * _horner(b1_a, x * x / 4);
          return M.exp(-x) / M.sqrt(x) * _horner(b1_b, 2 / x);
        }
        return _bessel_wrap(bessel0, bessel1, "BESSELK", 2, 1);
      }();
      BESSEL.besselj = besselj;
      BESSEL.bessely = bessely;
      BESSEL.besseli = besseli;
      BESSEL.besselk = besselk;
    });
  })(bessel);
  const nil = new Error("#NULL!");
  const div0 = new Error("#DIV/0!");
  const value = new Error("#VALUE!");
  const ref = new Error("#REF!");
  const name$1 = new Error("#NAME?");
  const num = new Error("#NUM!");
  const na = new Error("#N/A");
  const error = new Error("#ERROR!");
  const data = new Error("#GETTING_DATA");
  var errors = /* @__PURE__ */ Object.freeze({
    __proto__: null,
    data,
    div0,
    error,
    na,
    name: name$1,
    nil,
    num,
    ref,
    value
  });
  function argsToArray(args) {
    const result = [];
    arrayEach(args, (value2) => {
      result.push(value2);
    });
    return result;
  }
  function arrayEach(array, iteratee) {
    let index2 = -1;
    const length = array.length;
    while (++index2 < length) {
      if (iteratee(array[index2], index2, array) === false) {
        break;
      }
    }
    return array;
  }
  function arrayValuesToNumbers(arr) {
    let n = arr.length;
    let el;
    while (n--) {
      el = arr[n];
      if (typeof el === "number") {
        continue;
      }
      if (el === true) {
        arr[n] = 1;
        continue;
      }
      if (el === false) {
        arr[n] = 0;
        continue;
      }
      if (typeof el === "string") {
        const number2 = parseNumber(el);
        arr[n] = number2 instanceof Error ? 0 : number2;
      }
    }
    return arr;
  }
  function fillMatrix(matrix2, fill_value) {
    if (!matrix2) {
      return value;
    }
    if (!matrix2.every((el) => Array.isArray(el)) || matrix2.length === 0) {
      matrix2 = [[...matrix2]];
    }
    matrix2.map((arr, i2) => {
      arr.map((a, j) => {
        if (!a) {
          matrix2[i2][j] = 0;
        }
      });
    });
    const longestArrayIndex = matrix2.reduce((acc, arr, i2) => arr.length > matrix2[acc].length ? i2 : acc, 0);
    const longestArrayLength = matrix2[longestArrayIndex].length;
    return matrix2.map((el) => [...el, ...Array(longestArrayLength - el.length).fill(fill_value ? fill_value : 0)]);
  }
  function flatten$1() {
    let result;
    if (arguments.length === 1) {
      const argument = arguments[0];
      result = isArrayLike(argument) ? argsToArray.apply(null, arguments) : [argument];
    } else {
      result = Array.from(arguments);
    }
    while (!isFlat(result)) {
      result = flattenShallow(result);
    }
    return result;
  }
  function flattenShallow(array) {
    if (!array || !array.reduce) {
      return [array];
    }
    return array.reduce((a, b) => {
      const aIsArray = Array.isArray(a);
      const bIsArray = Array.isArray(b);
      if (aIsArray && bIsArray) {
        return a.concat(b);
      }
      if (aIsArray) {
        a.push(b);
        return a;
      }
      if (bIsArray) {
        return [a].concat(b);
      }
      return [a, b];
    });
  }
  function initial(array, idx) {
    idx = idx || 1;
    if (!array || typeof array.slice !== "function") {
      return array;
    }
    return array.slice(0, array.length - idx);
  }
  function isArrayLike(a) {
    return a != null && typeof a.length === "number" && typeof a !== "string";
  }
  function isFlat(array) {
    if (!array) {
      return false;
    }
    for (let i2 = 0; i2 < array.length; ++i2) {
      if (Array.isArray(array[i2])) {
        return false;
      }
    }
    return true;
  }
  function rest(array, idx) {
    idx = idx || 1;
    if (!array || typeof array.slice !== "function") {
      return array;
    }
    return array.slice(idx);
  }
  function transpose(matrix2) {
    if (!matrix2) {
      return value;
    }
    return matrix2[0].map((col, i2) => matrix2.map((row) => row[i2]));
  }
  function findField(database, title) {
    let index2 = null;
    arrayEach(database, (value2, i2) => {
      if (value2[0] === title) {
        index2 = i2;
        return false;
      }
    });
    if (index2 == null) {
      return value;
    }
    return index2;
  }
  function anyError() {
    for (let n = 0; n < arguments.length; n++) {
      if (arguments[n] instanceof Error) {
        return arguments[n];
      }
    }
    return void 0;
  }
  function anyIsError() {
    let n = arguments.length;
    while (n--) {
      if (arguments[n] instanceof Error) {
        return true;
      }
    }
    return false;
  }
  function cleanFloat(number2) {
    const power = 1e14;
    return Math.round(number2 * power) / power;
  }
  function numbers() {
    const possibleNumbers = flatten$1.apply(null, arguments);
    return possibleNumbers.filter((el) => typeof el === "number");
  }
  function serialNumberToDate(serial2) {
    if (serial2 < 60) {
      serial2 += 1;
    }
    const utc_days = Math.floor(serial2 - 25569);
    const utc_value = utc_days * 86400;
    const date_info = new Date(utc_value * 1e3);
    const fractional_day = serial2 - Math.floor(serial2) + 1e-7;
    let total_seconds = Math.floor(86400 * fractional_day);
    const seconds = total_seconds % 60;
    total_seconds -= seconds;
    const hours = Math.floor(total_seconds / (60 * 60));
    const minutes = Math.floor(total_seconds / 60) % 60;
    let days = date_info.getUTCDate();
    let month = date_info.getUTCMonth();
    if (serial2 >= 60 && serial2 < 61) {
      days = 29;
      month = 1;
    }
    return new Date(date_info.getUTCFullYear(), month, days, hours, minutes, seconds);
  }
  function parseBool(bool) {
    if (typeof bool === "boolean") {
      return bool;
    }
    if (bool instanceof Error) {
      return bool;
    }
    if (typeof bool === "number") {
      return bool !== 0;
    }
    if (typeof bool === "string") {
      const up = bool.toUpperCase();
      if (up === "TRUE") {
        return true;
      }
      if (up === "FALSE") {
        return false;
      }
    }
    if (bool instanceof Date && !isNaN(bool)) {
      return true;
    }
    return value;
  }
  function parseDate(date) {
    if (!isNaN(date)) {
      if (date instanceof Date) {
        return new Date(date);
      }
      const d = parseFloat(date);
      if (d < 0 || d >= 2958466) {
        return num;
      }
      return serialNumberToDate(d);
    }
    if (typeof date === "string") {
      date = /(\d{4})-(\d\d?)-(\d\d?)$/.test(date) ? new Date(date + "T00:00:00.000") : new Date(date);
      if (!isNaN(date)) {
        return date;
      }
    }
    return value;
  }
  function parseDateArray(arr) {
    let len = arr.length;
    let parsed;
    while (len--) {
      parsed = parseDate(arr[len]);
      if (parsed === value) {
        return parsed;
      }
      arr[len] = parsed;
    }
    return arr;
  }
  function parseNumber(string2) {
    if (string2 instanceof Error) {
      return string2;
    }
    if (string2 === void 0 || string2 === null) {
      return 0;
    }
    if (typeof string2 === "boolean") {
      string2 = +string2;
    }
    if (!isNaN(string2) && string2 !== "") {
      return parseFloat(string2);
    }
    return value;
  }
  function parseNumberArray(arr) {
    let len;
    if (!arr || (len = arr.length) === 0) {
      return value;
    }
    let parsed;
    while (len--) {
      if (arr[len] instanceof Error) {
        return arr[len];
      }
      parsed = parseNumber(arr[len]);
      if (parsed instanceof Error) {
        return parsed;
      }
      arr[len] = parsed;
    }
    return arr;
  }
  function parseString(string2) {
    if (string2 instanceof Error) {
      return string2;
    }
    if (string2 === void 0 || string2 === null) {
      return "";
    }
    return string2.toString();
  }
  function anyIsString() {
    let n = arguments.length;
    while (n--) {
      if (typeof arguments[n] === "string") {
        return true;
      }
    }
    return false;
  }
  function isDefined(arg) {
    return arg !== void 0 && arg !== null;
  }
  const defaultOperator = "=";
  const validSymbols = [">", ">=", "<", "<=", "=", "<>"];
  const _TOKEN_TYPE_OPERATOR = "operator";
  const _TOKEN_TYPE_LITERAL = "literal";
  const SUPPORTED_TOKENS = [_TOKEN_TYPE_OPERATOR, _TOKEN_TYPE_LITERAL];
  const TOKEN_TYPE_OPERATOR = _TOKEN_TYPE_OPERATOR;
  const TOKEN_TYPE_LITERAL = _TOKEN_TYPE_LITERAL;
  function createToken(value2, type) {
    if (SUPPORTED_TOKENS.indexOf(type) === -1) {
      throw new Error("Unsupported token type: " + type);
    }
    return {
      value: value2,
      type
    };
  }
  function castValueToCorrectType(value2) {
    if (typeof value2 !== "string") {
      return value2;
    }
    if (/^\d+(\.\d+)?$/.test(value2)) {
      value2 = value2.indexOf(".") === -1 ? parseInt(value2, 10) : parseFloat(value2);
    }
    return value2;
  }
  function tokenizeExpression(expression) {
    const expressionLength = expression.length;
    const tokens = [];
    let cursorIndex = 0;
    let processedValue = "";
    let processedSymbol = "";
    while (cursorIndex < expressionLength) {
      const char = expression.charAt(cursorIndex);
      switch (char) {
        case ">":
        case "<":
        case "=":
          processedSymbol = processedSymbol + char;
          if (processedValue.length > 0) {
            tokens.push(processedValue);
            processedValue = "";
          }
          break;
        default:
          if (processedSymbol.length > 0) {
            tokens.push(processedSymbol);
            processedSymbol = "";
          }
          processedValue = processedValue + char;
          break;
      }
      cursorIndex++;
    }
    if (processedValue.length > 0) {
      tokens.push(processedValue);
    }
    if (processedSymbol.length > 0) {
      tokens.push(processedSymbol);
    }
    return tokens;
  }
  function analyzeTokens(tokens) {
    let literalValue = "";
    const analyzedTokens = [];
    for (let i2 = 0; i2 < tokens.length; i2++) {
      const token = tokens[i2];
      if (i2 === 0 && validSymbols.indexOf(token) >= 0) {
        analyzedTokens.push(createToken(token, TOKEN_TYPE_OPERATOR));
      } else {
        literalValue += token;
      }
    }
    if (literalValue.length > 0) {
      analyzedTokens.push(createToken(castValueToCorrectType(literalValue), TOKEN_TYPE_LITERAL));
    }
    if (analyzedTokens.length > 0 && analyzedTokens[0].type !== TOKEN_TYPE_OPERATOR) {
      analyzedTokens.unshift(createToken(defaultOperator, TOKEN_TYPE_OPERATOR));
    }
    return analyzedTokens;
  }
  function computeExpression(tokens) {
    const values = [];
    let operator2;
    for (let i2 = 0; i2 < tokens.length; i2++) {
      const token = tokens[i2];
      switch (token.type) {
        case TOKEN_TYPE_OPERATOR:
          operator2 = token.value;
          break;
        case TOKEN_TYPE_LITERAL:
          values.push(token.value);
          break;
      }
    }
    return evaluate(values, operator2);
  }
  function evaluate(values, operator2) {
    let result = false;
    switch (operator2) {
      case ">":
        result = values[0] > values[1];
        break;
      case ">=":
        result = values[0] >= values[1];
        break;
      case "<":
        result = values[0] < values[1];
        break;
      case "<=":
        result = values[0] <= values[1];
        break;
      case "=":
        result = values[0] == values[1];
        break;
      case "<>":
        result = values[0] != values[1];
        break;
    }
    return result;
  }
  function parse(expression) {
    return analyzeTokens(tokenizeExpression(expression));
  }
  const compute = computeExpression;
  function CELL() {
    throw new Error("CELL is not implemented");
  }
  const ERROR = {};
  ERROR.TYPE = (error_val) => {
    switch (error_val) {
      case nil:
        return 1;
      case div0:
        return 2;
      case value:
        return 3;
      case ref:
        return 4;
      case name$1:
        return 5;
      case num:
        return 6;
      case na:
        return 7;
      case data:
        return 8;
    }
    return na;
  };
  function INFO() {
    throw new Error("INFO is not implemented");
  }
  function ISBLANK(value2) {
    return value2 === null;
  }
  function ISERR(value$1) {
    return [value, ref, div0, num, name$1, nil].indexOf(value$1) >= 0 || typeof value$1 === "number" && (isNaN(value$1) || !isFinite(value$1));
  }
  function ISERROR(value2) {
    return ISERR(value2) || value2 === na;
  }
  function ISEVEN(number2) {
    return !(Math.floor(Math.abs(number2)) & 1);
  }
  function ISFORMULA() {
    throw new Error("ISFORMULA is not implemented");
  }
  function ISLOGICAL(value2) {
    return value2 === true || value2 === false;
  }
  function ISNA(value2) {
    return value2 === na;
  }
  function ISNONTEXT(value2) {
    return typeof value2 !== "string";
  }
  function ISNUMBER(value2) {
    return typeof value2 === "number" && !isNaN(value2) && isFinite(value2);
  }
  function ISODD(value2) {
    return !!(Math.floor(Math.abs(value2)) & 1);
  }
  function ISREF() {
    throw new Error("ISREF is not implemented");
  }
  function ISTEXT(value2) {
    return typeof value2 === "string";
  }
  function N(value2) {
    if (ISNUMBER(value2)) {
      return value2;
    }
    if (value2 instanceof Date) {
      return value2.getTime();
    }
    if (value2 === true) {
      return 1;
    }
    if (value2 === false) {
      return 0;
    }
    if (ISERROR(value2)) {
      return value2;
    }
    return 0;
  }
  function NA() {
    return na;
  }
  function SHEET() {
    throw new Error("SHEET is not implemented");
  }
  function SHEETS() {
    throw new Error("SHEETS is not implemented");
  }
  function TYPE(value2) {
    if (ISNUMBER(value2)) {
      return 1;
    }
    if (ISTEXT(value2)) {
      return 2;
    }
    if (ISLOGICAL(value2)) {
      return 4;
    }
    if (ISERROR(value2)) {
      return 16;
    }
    if (Array.isArray(value2)) {
      return 64;
    }
  }
  function CHOOSE() {
    if (arguments.length < 2) {
      return na;
    }
    const index2 = arguments[0];
    if (index2 < 1 || index2 > 254) {
      return value;
    }
    if (arguments.length < index2 + 1) {
      return value;
    }
    return arguments[index2];
  }
  function COLUMN(reference, index2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (index2 < 0) {
      return num;
    }
    if (!(reference instanceof Array) || typeof index2 !== "number") {
      return value;
    }
    if (reference.length === 0) {
      return void 0;
    }
    return jStat.col(reference, index2);
  }
  function COLUMNS(array) {
    if (arguments.length !== 1) {
      return na;
    }
    if (!(array instanceof Array)) {
      return value;
    }
    if (array.length === 0) {
      return 0;
    }
    return jStat.cols(array);
  }
  function HLOOKUP(lookup_value, table_array, row_index_num, range_lookup) {
    return VLOOKUP(lookup_value, transpose(table_array), row_index_num, range_lookup);
  }
  function INDEX(array, row_num, column_num) {
    const someError = anyError(array, row_num, column_num);
    if (someError) {
      return someError;
    }
    if (!Array.isArray(array)) {
      return value;
    }
    const isOneDimensionRange = array.length > 0 && !Array.isArray(array[0]);
    if (isOneDimensionRange && !column_num) {
      column_num = row_num;
      row_num = 1;
    } else {
      column_num = column_num || 1;
      row_num = row_num || 1;
    }
    if (column_num < 0 || row_num < 0) {
      return value;
    }
    if (isOneDimensionRange && row_num === 1 && column_num <= array.length) {
      return array[column_num - 1];
    } else if (row_num <= array.length && column_num <= array[row_num - 1].length) {
      return array[row_num - 1][column_num - 1];
    }
    return ref;
  }
  function LOOKUP(lookup_value, array, result_array) {
    array = flatten$1(array);
    result_array = result_array ? flatten$1(result_array) : array;
    const isNumberLookup = typeof lookup_value === "number";
    let result = na;
    for (let i2 = 0; i2 < array.length; i2++) {
      if (array[i2] === lookup_value) {
        return result_array[i2];
      } else if (isNumberLookup && array[i2] <= lookup_value || typeof array[i2] === "string" && array[i2].localeCompare(lookup_value) < 0) {
        result = result_array[i2];
      } else if (isNumberLookup && array[i2] > lookup_value) {
        return result;
      }
    }
    return result;
  }
  function MATCH(lookup_value, lookup_array, match_type) {
    if (!lookup_value || !lookup_array) {
      return na;
    }
    if (arguments.length === 2) {
      match_type = 1;
    }
    lookup_array = flatten$1(lookup_array);
    if (!(lookup_array instanceof Array)) {
      return na;
    }
    if (match_type !== -1 && match_type !== 0 && match_type !== 1) {
      return na;
    }
    let index2;
    let indexValue;
    for (let idx = 0; idx < lookup_array.length; idx++) {
      if (match_type === 1) {
        if (lookup_array[idx] === lookup_value) {
          return idx + 1;
        } else if (lookup_array[idx] < lookup_value) {
          if (!indexValue) {
            index2 = idx + 1;
            indexValue = lookup_array[idx];
          } else if (lookup_array[idx] > indexValue) {
            index2 = idx + 1;
            indexValue = lookup_array[idx];
          }
        }
      } else if (match_type === 0) {
        if (typeof lookup_value === "string" && typeof lookup_array[idx] === "string") {
          const lookupValueStr = lookup_value.toLowerCase().replace(/\?/g, ".").replace(/\*/g, ".*").replace(/~/g, "\\").replace(/\+/g, "\\+").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\[/g, "\\[").replace(/\]/g, "\\]");
          const regex = new RegExp("^" + lookupValueStr + "$");
          if (regex.test(lookup_array[idx].toLowerCase())) {
            return idx + 1;
          }
        } else {
          if (lookup_array[idx] === lookup_value) {
            return idx + 1;
          }
        }
      } else if (match_type === -1) {
        if (lookup_array[idx] === lookup_value) {
          return idx + 1;
        } else if (lookup_array[idx] > lookup_value) {
          if (!indexValue) {
            index2 = idx + 1;
            indexValue = lookup_array[idx];
          } else if (lookup_array[idx] < indexValue) {
            index2 = idx + 1;
            indexValue = lookup_array[idx];
          }
        }
      }
    }
    return index2 || na;
  }
  function ROWS(array) {
    if (arguments.length !== 1) {
      return na;
    }
    if (!(array instanceof Array)) {
      return value;
    }
    if (array.length === 0) {
      return 0;
    }
    return jStat.rows(array);
  }
  function SORT(array, sort_index = 1, sort_order = 1, by_col = false) {
    if (!array || !Array.isArray(array)) {
      return na;
    }
    if (array.length === 0) {
      return 0;
    }
    sort_index = parseNumber(sort_index);
    if (!sort_index || sort_index < 1) {
      return value;
    }
    sort_order = parseNumber(sort_order);
    if (sort_order !== 1 && sort_order !== -1) {
      return value;
    }
    by_col = parseBool(by_col);
    if (typeof by_col !== "boolean") {
      return name$1;
    }
    const sortArray = (arr) => arr.sort((a, b) => {
      a = parseString(a[sort_index - 1]);
      b = parseString(b[sort_index - 1]);
      return sort_order === 1 ? a < b ? sort_order * -1 : sort_order : a > b ? sort_order : sort_order * -1;
    });
    const matrix2 = fillMatrix(array);
    const result = by_col ? transpose(matrix2) : matrix2;
    return sort_index >= 1 && sort_index <= result[0].length ? by_col ? transpose(sortArray(result)) : sortArray(result) : value;
  }
  function TRANSPOSE(array) {
    if (!array) {
      return na;
    }
    const matrix2 = fillMatrix(array);
    return transpose(matrix2);
  }
  function UNIQUE() {
    const result = [];
    for (let i2 = 0; i2 < arguments.length; ++i2) {
      let hasElement = false;
      const element = arguments[i2];
      for (let j = 0; j < result.length; ++j) {
        hasElement = result[j] === element;
        if (hasElement) {
          break;
        }
      }
      if (!hasElement) {
        result.push(element);
      }
    }
    return result;
  }
  function VLOOKUP(lookup_value, table_array, col_index_num, range_lookup) {
    if (!table_array || !col_index_num) {
      return na;
    }
    range_lookup = !(range_lookup === 0 || range_lookup === false);
    let result = na;
    let exactMatchOnly = false;
    const isNumberLookup = typeof lookup_value === "number";
    const lookupValue = typeof lookup_value === "string" ? lookup_value.toLowerCase() : lookup_value;
    for (let i2 = 0; i2 < table_array.length; i2++) {
      const row = table_array[i2];
      const rowValue = typeof row[0] === "string" ? row[0].toLowerCase() : row[0];
      if (rowValue === lookupValue) {
        result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;
        break;
      } else if (!exactMatchOnly && (isNumberLookup && range_lookup && rowValue <= lookup_value || range_lookup && typeof rowValue === "string" && rowValue.localeCompare(lookup_value) < 0)) {
        result = col_index_num < row.length + 1 ? row[col_index_num - 1] : ref;
      }
      if (isNumberLookup && rowValue > lookup_value) {
        exactMatchOnly = true;
      }
    }
    return result;
  }
  const SQRT2PI = 2.5066282746310002;
  function AVEDEV() {
    const flatArguments = flatten$1(arguments);
    const flatArgumentsDefined = flatArguments.filter(isDefined);
    if (flatArgumentsDefined.length === 0) {
      return num;
    }
    const range = parseNumberArray(flatArgumentsDefined);
    if (range instanceof Error) {
      return range;
    }
    return jStat.sum(jStat(range).subtract(jStat.mean(range)).abs()[0]) / range.length;
  }
  function AVERAGE() {
    const flatArguments = flatten$1(arguments);
    const flatArgumentsDefined = flatArguments.filter(isDefined);
    if (flatArgumentsDefined.length === 0) {
      return div0;
    }
    const someError = anyError.apply(void 0, flatArgumentsDefined);
    if (someError) {
      return someError;
    }
    const range = numbers(flatArgumentsDefined);
    const n = range.length;
    let sum = 0;
    let count = 0;
    let result;
    for (let i2 = 0; i2 < n; i2++) {
      sum += range[i2];
      count += 1;
    }
    result = sum / count;
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function AVERAGEA() {
    const flatArguments = flatten$1(arguments);
    const flatArgumentsDefined = flatArguments.filter(isDefined);
    if (flatArgumentsDefined.length === 0) {
      return div0;
    }
    const someError = anyError.apply(void 0, flatArgumentsDefined);
    if (someError) {
      return someError;
    }
    const range = flatArgumentsDefined;
    const n = range.length;
    let sum = 0;
    let count = 0;
    let result;
    for (let i2 = 0; i2 < n; i2++) {
      const el = range[i2];
      if (typeof el === "number") {
        sum += el;
      }
      if (el === true) {
        sum++;
      }
      if (el !== null) {
        count++;
      }
    }
    result = sum / count;
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function AVERAGEIF(range, criteria, average_range) {
    if (arguments.length <= 1) {
      return na;
    }
    average_range = average_range || range;
    const flatAverageRange = flatten$1(average_range);
    const flatAverageRangeDefined = flatAverageRange.filter(isDefined);
    average_range = parseNumberArray(flatAverageRangeDefined);
    range = flatten$1(range);
    if (average_range instanceof Error) {
      return average_range;
    }
    let average_count = 0;
    let result = 0;
    const isWildcard = criteria === void 0 || criteria === "*";
    const tokenizedCriteria = isWildcard ? null : parse(criteria + "");
    for (let i2 = 0; i2 < range.length; i2++) {
      const value2 = range[i2];
      if (isWildcard) {
        result += average_range[i2];
        average_count++;
      } else {
        const tokens = [createToken(value2, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
        if (compute(tokens)) {
          result += average_range[i2];
          average_count++;
        }
      }
    }
    return result / average_count;
  }
  function AVERAGEIFS() {
    const args = argsToArray(arguments);
    const criteriaLength = (args.length - 1) / 2;
    const range = flatten$1(args[0]);
    let count = 0;
    let result = 0;
    for (let i2 = 0; i2 < range.length; i2++) {
      let isMeetCondition = false;
      for (let j = 0; j < criteriaLength; j++) {
        const value2 = args[2 * j + 1][i2];
        const criteria = args[2 * j + 2];
        const isWildcard = criteria === void 0 || criteria === "*";
        let computedResult = false;
        if (isWildcard) {
          computedResult = true;
        } else {
          const tokenizedCriteria = parse(criteria + "");
          const tokens = [createToken(value2, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
          computedResult = compute(tokens);
        }
        if (!computedResult) {
          isMeetCondition = false;
          break;
        }
        isMeetCondition = true;
      }
      if (isMeetCondition) {
        result += range[i2];
        count++;
      }
    }
    const average = result / count;
    return isNaN(average) ? 0 : average;
  }
  const BETA = {};
  BETA.DIST = function(x, alpha, beta, cumulative, a, b) {
    if (arguments.length < 4) {
      return value;
    }
    a = a === void 0 ? 0 : a;
    b = b === void 0 ? 1 : b;
    x = parseNumber(x);
    alpha = parseNumber(alpha);
    beta = parseNumber(beta);
    a = parseNumber(a);
    b = parseNumber(b);
    if (anyIsError(x, alpha, beta, a, b)) {
      return value;
    }
    x = (x - a) / (b - a);
    return cumulative ? jStat.beta.cdf(x, alpha, beta) : jStat.beta.pdf(x, alpha, beta);
  };
  BETA.INV = (probability, alpha, beta, a, b) => {
    a = a === void 0 ? 0 : a;
    b = b === void 0 ? 1 : b;
    probability = parseNumber(probability);
    alpha = parseNumber(alpha);
    beta = parseNumber(beta);
    a = parseNumber(a);
    b = parseNumber(b);
    if (anyIsError(probability, alpha, beta, a, b)) {
      return value;
    }
    return jStat.beta.inv(probability, alpha, beta) * (b - a) + a;
  };
  const BINOM = {};
  BINOM.DIST = (number_s, trials, probability_s, cumulative) => {
    number_s = parseNumber(number_s);
    trials = parseNumber(trials);
    probability_s = parseNumber(probability_s);
    cumulative = parseNumber(cumulative);
    if (anyIsError(number_s, trials, probability_s, cumulative)) {
      return value;
    }
    return cumulative ? jStat.binomial.cdf(number_s, trials, probability_s) : jStat.binomial.pdf(number_s, trials, probability_s);
  };
  BINOM.DIST.RANGE = (trials, probability_s, number_s, number_s2) => {
    number_s2 = number_s2 === void 0 ? number_s : number_s2;
    trials = parseNumber(trials);
    probability_s = parseNumber(probability_s);
    number_s = parseNumber(number_s);
    number_s2 = parseNumber(number_s2);
    if (anyIsError(trials, probability_s, number_s, number_s2)) {
      return value;
    }
    let result = 0;
    for (let i2 = number_s; i2 <= number_s2; i2++) {
      result += COMBIN(trials, i2) * Math.pow(probability_s, i2) * Math.pow(1 - probability_s, trials - i2);
    }
    return result;
  };
  BINOM.INV = (trials, probability_s, alpha) => {
    trials = parseNumber(trials);
    probability_s = parseNumber(probability_s);
    alpha = parseNumber(alpha);
    if (anyIsError(trials, probability_s, alpha)) {
      return value;
    }
    let x = 0;
    while (x <= trials) {
      if (jStat.binomial.cdf(x, trials, probability_s) >= alpha) {
        return x;
      }
      x++;
    }
  };
  const CHISQ = {};
  CHISQ.DIST = (x, deg_freedom, cumulative) => {
    x = parseNumber(x);
    deg_freedom = parseNumber(deg_freedom);
    if (anyIsError(x, deg_freedom)) {
      return value;
    }
    return cumulative ? jStat.chisquare.cdf(x, deg_freedom) : jStat.chisquare.pdf(x, deg_freedom);
  };
  CHISQ.DIST.RT = (x, deg_freedom) => {
    if (!x | !deg_freedom) {
      return na;
    }
    if (x < 1 || deg_freedom > Math.pow(10, 10)) {
      return num;
    }
    if (typeof x !== "number" || typeof deg_freedom !== "number") {
      return value;
    }
    return 1 - jStat.chisquare.cdf(x, deg_freedom);
  };
  CHISQ.INV = (probability, deg_freedom) => {
    probability = parseNumber(probability);
    deg_freedom = parseNumber(deg_freedom);
    if (anyIsError(probability, deg_freedom)) {
      return value;
    }
    return jStat.chisquare.inv(probability, deg_freedom);
  };
  CHISQ.INV.RT = (probability, deg_freedom) => {
    if (!probability | !deg_freedom) {
      return na;
    }
    if (probability < 0 || probability > 1 || deg_freedom < 1 || deg_freedom > Math.pow(10, 10)) {
      return num;
    }
    if (typeof probability !== "number" || typeof deg_freedom !== "number") {
      return value;
    }
    return jStat.chisquare.inv(1 - probability, deg_freedom);
  };
  CHISQ.TEST = function(actual_range, expected_range) {
    if (arguments.length !== 2) {
      return na;
    }
    if (!(actual_range instanceof Array) || !(expected_range instanceof Array)) {
      return value;
    }
    if (actual_range.length !== expected_range.length) {
      return value;
    }
    if (actual_range[0] && expected_range[0] && actual_range[0].length !== expected_range[0].length) {
      return value;
    }
    const row = actual_range.length;
    let tmp, i2, j;
    for (i2 = 0; i2 < row; i2++) {
      if (!(actual_range[i2] instanceof Array)) {
        tmp = actual_range[i2];
        actual_range[i2] = [];
        actual_range[i2].push(tmp);
      }
      if (!(expected_range[i2] instanceof Array)) {
        tmp = expected_range[i2];
        expected_range[i2] = [];
        expected_range[i2].push(tmp);
      }
    }
    const col = actual_range[0].length;
    const dof = col === 1 ? row - 1 : (row - 1) * (col - 1);
    let xsqr = 0;
    const Pi = Math.PI;
    for (i2 = 0; i2 < row; i2++) {
      for (j = 0; j < col; j++) {
        xsqr += Math.pow(actual_range[i2][j] - expected_range[i2][j], 2) / expected_range[i2][j];
      }
    }
    function ChiSq(xsqr2, dof2) {
      let p = Math.exp(-0.5 * xsqr2);
      if (dof2 % 2 === 1) {
        p = p * Math.sqrt(2 * xsqr2 / Pi);
      }
      let k = dof2;
      while (k >= 2) {
        p = p * xsqr2 / k;
        k = k - 2;
      }
      let t2 = p;
      let a = dof2;
      while (t2 > 1e-10 * p) {
        a = a + 2;
        t2 = t2 * xsqr2 / a;
        p = p + t2;
      }
      return 1 - p;
    }
    return Math.round(ChiSq(xsqr, dof) * 1e6) / 1e6;
  };
  const CONFIDENCE = {};
  CONFIDENCE.NORM = (alpha, standard_dev, size) => {
    alpha = parseNumber(alpha);
    standard_dev = parseNumber(standard_dev);
    size = parseNumber(size);
    if (anyIsError(alpha, standard_dev, size)) {
      return value;
    }
    return jStat.normalci(1, alpha, standard_dev, size)[1] - 1;
  };
  CONFIDENCE.T = (alpha, standard_dev, size) => {
    alpha = parseNumber(alpha);
    standard_dev = parseNumber(standard_dev);
    size = parseNumber(size);
    if (anyIsError(alpha, standard_dev, size)) {
      return value;
    }
    return jStat.tci(1, alpha, standard_dev, size)[1] - 1;
  };
  function CORREL(array1, array2) {
    array1 = parseNumberArray(flatten$1(array1));
    array2 = parseNumberArray(flatten$1(array2));
    if (anyIsError(array1, array2)) {
      return value;
    }
    return jStat.corrcoeff(array1, array2);
  }
  function COUNT$1() {
    const flatArguments = flatten$1(arguments);
    return numbers(flatArguments).length;
  }
  function COUNTA() {
    const flatArguments = flatten$1(arguments);
    return flatArguments.length - COUNTBLANK(flatArguments);
  }
  function COUNTBLANK() {
    const range = flatten$1(arguments);
    let blanks = 0;
    let element;
    for (let i2 = 0; i2 < range.length; i2++) {
      element = range[i2];
      if (element === void 0 || element === null || element === "") {
        blanks++;
      }
    }
    return blanks;
  }
  function COUNTIF(range, criteria) {
    range = flatten$1(range);
    const isWildcard = criteria === void 0 || criteria === "*";
    if (isWildcard) {
      return range.length;
    }
    let matches2 = 0;
    const tokenizedCriteria = parse(criteria + "");
    for (let i2 = 0; i2 < range.length; i2++) {
      const value2 = range[i2];
      const tokens = [createToken(value2, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
      if (compute(tokens)) {
        matches2++;
      }
    }
    return matches2;
  }
  function COUNTIFS() {
    const args = argsToArray(arguments);
    const results = new Array(flatten$1(args[0]).length);
    for (let i2 = 0; i2 < results.length; i2++) {
      results[i2] = true;
    }
    for (let i2 = 0; i2 < args.length; i2 += 2) {
      const range = flatten$1(args[i2]);
      const criteria = args[i2 + 1];
      const isWildcard = criteria === void 0 || criteria === "*";
      if (!isWildcard) {
        const tokenizedCriteria = parse(criteria + "");
        for (let j = 0; j < range.length; j++) {
          const value2 = range[j];
          const tokens = [createToken(value2, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
          results[j] = results[j] && compute(tokens);
        }
      }
    }
    let result = 0;
    for (let i2 = 0; i2 < results.length; i2++) {
      if (results[i2]) {
        result++;
      }
    }
    return result;
  }
  const COVARIANCE = {};
  COVARIANCE.P = (array1, array2) => {
    array1 = parseNumberArray(flatten$1(array1));
    array2 = parseNumberArray(flatten$1(array2));
    if (anyIsError(array1, array2)) {
      return value;
    }
    const mean1 = jStat.mean(array1);
    const mean2 = jStat.mean(array2);
    let result = 0;
    const n = array1.length;
    for (let i2 = 0; i2 < n; i2++) {
      result += (array1[i2] - mean1) * (array2[i2] - mean2);
    }
    return result / n;
  };
  COVARIANCE.S = (array1, array2) => {
    array1 = parseNumberArray(flatten$1(array1));
    array2 = parseNumberArray(flatten$1(array2));
    if (anyIsError(array1, array2)) {
      return value;
    }
    return jStat.covariance(array1, array2);
  };
  function DEVSQ() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const mean = jStat.mean(range);
    let result = 0;
    for (let i2 = 0; i2 < range.length; i2++) {
      result += Math.pow(range[i2] - mean, 2);
    }
    return result;
  }
  const EXPON = {};
  EXPON.DIST = (x, lambda, cumulative) => {
    x = parseNumber(x);
    lambda = parseNumber(lambda);
    if (anyIsError(x, lambda)) {
      return value;
    }
    return cumulative ? jStat.exponential.cdf(x, lambda) : jStat.exponential.pdf(x, lambda);
  };
  const F = {};
  F.DIST = (x, deg_freedom1, deg_freedom2, cumulative) => {
    x = parseNumber(x);
    deg_freedom1 = parseNumber(deg_freedom1);
    deg_freedom2 = parseNumber(deg_freedom2);
    if (anyIsError(x, deg_freedom1, deg_freedom2)) {
      return value;
    }
    return cumulative ? jStat.centralF.cdf(x, deg_freedom1, deg_freedom2) : jStat.centralF.pdf(x, deg_freedom1, deg_freedom2);
  };
  F.DIST.RT = function(x, deg_freedom1, deg_freedom2) {
    if (arguments.length !== 3) {
      return na;
    }
    if (x < 0 || deg_freedom1 < 1 || deg_freedom2 < 1) {
      return num;
    }
    if (typeof x !== "number" || typeof deg_freedom1 !== "number" || typeof deg_freedom2 !== "number") {
      return value;
    }
    return 1 - jStat.centralF.cdf(x, deg_freedom1, deg_freedom2);
  };
  F.INV = (probability, deg_freedom1, deg_freedom2) => {
    probability = parseNumber(probability);
    deg_freedom1 = parseNumber(deg_freedom1);
    deg_freedom2 = parseNumber(deg_freedom2);
    if (anyIsError(probability, deg_freedom1, deg_freedom2)) {
      return value;
    }
    if (probability <= 0 || probability > 1) {
      return num;
    }
    return jStat.centralF.inv(probability, deg_freedom1, deg_freedom2);
  };
  F.INV.RT = function(probability, deg_freedom1, deg_freedom2) {
    if (arguments.length !== 3) {
      return na;
    }
    if (probability < 0 || probability > 1 || deg_freedom1 < 1 || deg_freedom1 > Math.pow(10, 10) || deg_freedom2 < 1 || deg_freedom2 > Math.pow(10, 10)) {
      return num;
    }
    if (typeof probability !== "number" || typeof deg_freedom1 !== "number" || typeof deg_freedom2 !== "number") {
      return value;
    }
    return jStat.centralF.inv(1 - probability, deg_freedom1, deg_freedom2);
  };
  F.TEST = (array1, array2) => {
    if (!array1 || !array2) {
      return na;
    }
    if (!(array1 instanceof Array) || !(array2 instanceof Array)) {
      return na;
    }
    if (array1.length < 2 || array2.length < 2) {
      return div0;
    }
    const sumOfSquares = (values, x12) => {
      let sum = 0;
      for (let i2 = 0; i2 < values.length; i2++) {
        sum += Math.pow(values[i2] - x12, 2);
      }
      return sum;
    };
    const x1 = SUM(array1) / array1.length;
    const x2 = SUM(array2) / array2.length;
    const sum1 = sumOfSquares(array1, x1) / (array1.length - 1);
    const sum2 = sumOfSquares(array2, x2) / (array2.length - 1);
    return sum1 / sum2;
  };
  function FISHER(x) {
    x = parseNumber(x);
    if (x instanceof Error) {
      return x;
    }
    return Math.log((1 + x) / (1 - x)) / 2;
  }
  function FISHERINV(y) {
    y = parseNumber(y);
    if (y instanceof Error) {
      return y;
    }
    const e2y = Math.exp(2 * y);
    return (e2y - 1) / (e2y + 1);
  }
  function FORECAST(x, known_ys, known_xs) {
    x = parseNumber(x);
    known_ys = parseNumberArray(flatten$1(known_ys));
    known_xs = parseNumberArray(flatten$1(known_xs));
    if (anyIsError(x, known_ys, known_xs)) {
      return value;
    }
    const xmean = jStat.mean(known_xs);
    const ymean = jStat.mean(known_ys);
    const n = known_xs.length;
    let num2 = 0;
    let den = 0;
    for (let i2 = 0; i2 < n; i2++) {
      num2 += (known_xs[i2] - xmean) * (known_ys[i2] - ymean);
      den += Math.pow(known_xs[i2] - xmean, 2);
    }
    const b = num2 / den;
    const a = ymean - b * xmean;
    return a + b * x;
  }
  function FREQUENCY(data_array, bins_array) {
    data_array = parseNumberArray(flatten$1(data_array));
    bins_array = parseNumberArray(flatten$1(bins_array));
    if (anyIsError(data_array, bins_array)) {
      return value;
    }
    const n = data_array.length;
    const b = bins_array.length;
    const r = [];
    for (let i2 = 0; i2 <= b; i2++) {
      r[i2] = 0;
      for (let j = 0; j < n; j++) {
        if (i2 === 0) {
          if (data_array[j] <= bins_array[0]) {
            r[0] += 1;
          }
        } else if (i2 < b) {
          if (data_array[j] > bins_array[i2 - 1] && data_array[j] <= bins_array[i2]) {
            r[i2] += 1;
          }
        } else if (i2 === b) {
          if (data_array[j] > bins_array[b - 1]) {
            r[b] += 1;
          }
        }
      }
    }
    return r;
  }
  function GAMMA(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return num;
    }
    if (parseInt(number2, 10) === number2 && number2 < 0) {
      return num;
    }
    return jStat.gammafn(number2);
  }
  GAMMA.DIST = function(value$1, alpha, beta, cumulative) {
    if (arguments.length !== 4) {
      return na;
    }
    if (value$1 < 0 || alpha <= 0 || beta <= 0) {
      return value;
    }
    if (typeof value$1 !== "number" || typeof alpha !== "number" || typeof beta !== "number") {
      return value;
    }
    return cumulative ? jStat.gamma.cdf(value$1, alpha, beta, true) : jStat.gamma.pdf(value$1, alpha, beta, false);
  };
  GAMMA.INV = function(probability, alpha, beta) {
    if (arguments.length !== 3) {
      return na;
    }
    if (probability < 0 || probability > 1 || alpha <= 0 || beta <= 0) {
      return num;
    }
    if (typeof probability !== "number" || typeof alpha !== "number" || typeof beta !== "number") {
      return value;
    }
    return jStat.gamma.inv(probability, alpha, beta);
  };
  function GAMMALN(x) {
    x = parseNumber(x);
    if (x instanceof Error) {
      return x;
    }
    return jStat.gammaln(x);
  }
  GAMMALN.PRECISE = function(x) {
    if (arguments.length !== 1) {
      return na;
    }
    if (x <= 0) {
      return num;
    }
    if (typeof x !== "number") {
      return value;
    }
    return jStat.gammaln(x);
  };
  function GAUSS(z) {
    z = parseNumber(z);
    if (z instanceof Error) {
      return z;
    }
    return jStat.normal.cdf(z, 0, 1) - 0.5;
  }
  function GEOMEAN() {
    const args = parseNumberArray(flatten$1(arguments));
    if (args instanceof Error) {
      return args;
    }
    return jStat.geomean(args);
  }
  function GROWTH(known_y, known_x, new_x, use_const) {
    known_y = parseNumberArray(flatten$1(known_y));
    if (known_y instanceof Error) {
      return known_y;
    }
    let i2;
    if (known_x === void 0) {
      known_x = [];
      for (i2 = 1; i2 <= known_y.length; i2++) {
        known_x.push(i2);
      }
    }
    if (new_x === void 0) {
      new_x = known_x;
    }
    known_x = parseNumberArray(flatten$1(known_x));
    new_x = parseNumberArray(flatten$1(new_x));
    if (anyIsError(known_x, new_x)) {
      return value;
    }
    if (use_const === void 0) {
      use_const = true;
    }
    const n = known_y.length;
    let avg_x = 0;
    let avg_y = 0;
    let avg_xy = 0;
    let avg_xx = 0;
    for (i2 = 0; i2 < n; i2++) {
      const x = known_x[i2];
      const y = Math.log(known_y[i2]);
      avg_x += x;
      avg_y += y;
      avg_xy += x * y;
      avg_xx += x * x;
    }
    avg_x /= n;
    avg_y /= n;
    avg_xy /= n;
    avg_xx /= n;
    let beta;
    let alpha;
    if (use_const) {
      beta = (avg_xy - avg_x * avg_y) / (avg_xx - avg_x * avg_x);
      alpha = avg_y - beta * avg_x;
    } else {
      beta = avg_xy / avg_xx;
      alpha = 0;
    }
    const new_y = [];
    for (i2 = 0; i2 < new_x.length; i2++) {
      new_y.push(Math.exp(alpha + beta * new_x[i2]));
    }
    return new_y;
  }
  function HARMEAN() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const n = range.length;
    let den = 0;
    for (let i2 = 0; i2 < n; i2++) {
      den += 1 / range[i2];
    }
    return n / den;
  }
  const HYPGEOM = {};
  HYPGEOM.DIST = (sample_s, number_sample, population_s, number_pop, cumulative) => {
    sample_s = parseNumber(sample_s);
    number_sample = parseNumber(number_sample);
    population_s = parseNumber(population_s);
    number_pop = parseNumber(number_pop);
    if (anyIsError(sample_s, number_sample, population_s, number_pop)) {
      return value;
    }
    function pdf(x, n, M, N2) {
      return COMBIN(M, x) * COMBIN(N2 - M, n - x) / COMBIN(N2, n);
    }
    function cdf(x, n, M, N2) {
      let result = 0;
      for (let i2 = 0; i2 <= x; i2++) {
        result += pdf(i2, n, M, N2);
      }
      return result;
    }
    return cumulative ? cdf(sample_s, number_sample, population_s, number_pop) : pdf(sample_s, number_sample, population_s, number_pop);
  };
  function INTERCEPT(known_y, known_x) {
    known_y = parseNumberArray(known_y);
    known_x = parseNumberArray(known_x);
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    if (known_y.length !== known_x.length) {
      return na;
    }
    return FORECAST(0, known_y, known_x);
  }
  function KURT() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const mean = jStat.mean(range);
    const n = range.length;
    let sigma = 0;
    for (let i2 = 0; i2 < n; i2++) {
      sigma += Math.pow(range[i2] - mean, 4);
    }
    sigma = sigma / Math.pow(jStat.stdev(range, true), 4);
    return n * (n + 1) / ((n - 1) * (n - 2) * (n - 3)) * sigma - 3 * (n - 1) * (n - 1) / ((n - 2) * (n - 3));
  }
  function LARGE(array, k) {
    array = parseNumberArray(flatten$1(array));
    k = parseNumber(k);
    if (anyIsError(array, k)) {
      return array;
    }
    if (k < 0 || array.length < k) {
      return value;
    }
    return array.sort((a, b) => b - a)[k - 1];
  }
  function LINEST(known_y, known_x) {
    known_y = parseNumberArray(flatten$1(known_y));
    known_x = parseNumberArray(flatten$1(known_x));
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    const ymean = jStat.mean(known_y);
    const xmean = jStat.mean(known_x);
    const n = known_x.length;
    let num2 = 0;
    let den = 0;
    for (let i2 = 0; i2 < n; i2++) {
      num2 += (known_x[i2] - xmean) * (known_y[i2] - ymean);
      den += Math.pow(known_x[i2] - xmean, 2);
    }
    const m = num2 / den;
    const b = ymean - m * xmean;
    return [m, b];
  }
  function LOGEST(known_y, known_x) {
    known_y = parseNumberArray(flatten$1(known_y));
    known_x = parseNumberArray(flatten$1(known_x));
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    if (known_y.length !== known_x.length) {
      return value;
    }
    for (let i2 = 0; i2 < known_y.length; i2++) {
      known_y[i2] = Math.log(known_y[i2]);
    }
    const result = LINEST(known_y, known_x);
    result[0] = Math.round(Math.exp(result[0]) * 1e6) / 1e6;
    result[1] = Math.round(Math.exp(result[1]) * 1e6) / 1e6;
    return result;
  }
  const LOGNORM = {};
  LOGNORM.DIST = (x, mean, standard_dev, cumulative) => {
    x = parseNumber(x);
    mean = parseNumber(mean);
    standard_dev = parseNumber(standard_dev);
    if (anyIsError(x, mean, standard_dev)) {
      return value;
    }
    return cumulative ? jStat.lognormal.cdf(x, mean, standard_dev) : jStat.lognormal.pdf(x, mean, standard_dev);
  };
  LOGNORM.INV = (probability, mean, standard_dev) => {
    probability = parseNumber(probability);
    mean = parseNumber(mean);
    standard_dev = parseNumber(standard_dev);
    if (anyIsError(probability, mean, standard_dev)) {
      return value;
    }
    return jStat.lognormal.inv(probability, mean, standard_dev);
  };
  function MAX() {
    const flatArguments = flatten$1(arguments);
    const someError = anyError.apply(void 0, flatArguments);
    if (someError) {
      return someError;
    }
    const range = numbers(flatArguments);
    return range.length === 0 ? 0 : Math.max.apply(Math, range);
  }
  function MAXA() {
    const flatArguments = flatten$1(arguments);
    const someError = anyError.apply(void 0, flatArguments);
    if (someError) {
      return someError;
    }
    let range = arrayValuesToNumbers(flatArguments);
    range = range.map((value2) => value2 === void 0 || value2 === null ? 0 : value2);
    return range.length === 0 ? 0 : Math.max.apply(Math, range);
  }
  function MEDIAN() {
    const flatArguments = flatten$1(arguments);
    const someError = anyError.apply(void 0, flatArguments);
    if (someError) {
      return someError;
    }
    const range = arrayValuesToNumbers(flatArguments);
    let result = jStat.median(range);
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function MIN() {
    const flatArguments = flatten$1(arguments);
    const someError = anyError.apply(void 0, flatArguments);
    if (someError) {
      return someError;
    }
    const range = numbers(flatArguments);
    return range.length === 0 ? 0 : Math.min.apply(Math, range);
  }
  function MINA() {
    const flatArguments = flatten$1(arguments);
    const someError = anyError.apply(void 0, flatArguments);
    if (someError) {
      return someError;
    }
    let range = arrayValuesToNumbers(flatArguments);
    range = range.map((value2) => value2 === void 0 || value2 === null ? 0 : value2);
    return range.length === 0 ? 0 : Math.min.apply(Math, range);
  }
  const MODE = {};
  MODE.MULT = function() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const n = range.length;
    const count = {};
    let maxItems = [];
    let max = 0;
    let currentItem;
    for (let i2 = 0; i2 < n; i2++) {
      currentItem = range[i2];
      count[currentItem] = count[currentItem] ? count[currentItem] + 1 : 1;
      if (count[currentItem] > max) {
        max = count[currentItem];
        maxItems = [];
      }
      if (count[currentItem] === max) {
        maxItems[maxItems.length] = currentItem;
      }
    }
    return maxItems;
  };
  MODE.SNGL = function() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    return MODE.MULT(range).sort((a, b) => a - b)[0];
  };
  const NEGBINOM = {};
  NEGBINOM.DIST = (number_f, number_s, probability_s, cumulative) => {
    number_f = parseNumber(number_f);
    number_s = parseNumber(number_s);
    probability_s = parseNumber(probability_s);
    if (anyIsError(number_f, number_s, probability_s)) {
      return value;
    }
    return cumulative ? jStat.negbin.cdf(number_f, number_s, probability_s) : jStat.negbin.pdf(number_f, number_s, probability_s);
  };
  const NORM = {};
  NORM.DIST = (x, mean, standard_dev, cumulative) => {
    x = parseNumber(x);
    mean = parseNumber(mean);
    standard_dev = parseNumber(standard_dev);
    if (anyIsError(x, mean, standard_dev)) {
      return value;
    }
    if (standard_dev <= 0) {
      return num;
    }
    return cumulative ? jStat.normal.cdf(x, mean, standard_dev) : jStat.normal.pdf(x, mean, standard_dev);
  };
  NORM.INV = (probability, mean, standard_dev) => {
    probability = parseNumber(probability);
    mean = parseNumber(mean);
    standard_dev = parseNumber(standard_dev);
    if (anyIsError(probability, mean, standard_dev)) {
      return value;
    }
    return jStat.normal.inv(probability, mean, standard_dev);
  };
  NORM.S = {};
  NORM.S.DIST = (z, cumulative) => {
    z = parseNumber(z);
    if (z instanceof Error) {
      return value;
    }
    return cumulative ? jStat.normal.cdf(z, 0, 1) : jStat.normal.pdf(z, 0, 1);
  };
  NORM.S.INV = (probability) => {
    probability = parseNumber(probability);
    if (probability instanceof Error) {
      return value;
    }
    return jStat.normal.inv(probability, 0, 1);
  };
  function PEARSON(array1, array2) {
    array2 = parseNumberArray(flatten$1(array2));
    array1 = parseNumberArray(flatten$1(array1));
    if (anyIsError(array2, array1)) {
      return value;
    }
    const xmean = jStat.mean(array1);
    const ymean = jStat.mean(array2);
    const n = array1.length;
    let num2 = 0;
    let den1 = 0;
    let den2 = 0;
    for (let i2 = 0; i2 < n; i2++) {
      num2 += (array1[i2] - xmean) * (array2[i2] - ymean);
      den1 += Math.pow(array1[i2] - xmean, 2);
      den2 += Math.pow(array2[i2] - ymean, 2);
    }
    return num2 / Math.sqrt(den1 * den2);
  }
  const PERCENTILE = {};
  PERCENTILE.EXC = (array, k) => {
    array = parseNumberArray(flatten$1(array));
    k = parseNumber(k);
    if (anyIsError(array, k)) {
      return value;
    }
    array = array.sort((a, b) => a - b);
    const n = array.length;
    if (k < 1 / (n + 1) || k > 1 - 1 / (n + 1)) {
      return num;
    }
    const l = k * (n + 1) - 1;
    const fl = Math.floor(l);
    return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));
  };
  PERCENTILE.INC = (array, k) => {
    array = parseNumberArray(flatten$1(array));
    k = parseNumber(k);
    if (anyIsError(array, k)) {
      return value;
    }
    array = array.sort((a, b) => a - b);
    const n = array.length;
    const l = k * (n - 1);
    const fl = Math.floor(l);
    return cleanFloat(l === fl ? array[l] : array[fl] + (l - fl) * (array[fl + 1] - array[fl]));
  };
  const PERCENTRANK = {};
  PERCENTRANK.EXC = (array, x, significance) => {
    significance = significance === void 0 ? 3 : significance;
    array = parseNumberArray(flatten$1(array));
    x = parseNumber(x);
    significance = parseNumber(significance);
    if (anyIsError(array, x, significance)) {
      return value;
    }
    array = array.sort((a, b) => a - b);
    const uniques = UNIQUE.apply(null, array);
    const n = array.length;
    const m = uniques.length;
    const power = Math.pow(10, significance);
    let result = 0;
    let match = false;
    let i2 = 0;
    while (!match && i2 < m) {
      if (x === uniques[i2]) {
        result = (array.indexOf(uniques[i2]) + 1) / (n + 1);
        match = true;
      } else if (x >= uniques[i2] && (x < uniques[i2 + 1] || i2 === m - 1)) {
        result = (array.indexOf(uniques[i2]) + 1 + (x - uniques[i2]) / (uniques[i2 + 1] - uniques[i2])) / (n + 1);
        match = true;
      }
      i2++;
    }
    return Math.floor(result * power) / power;
  };
  PERCENTRANK.INC = (array, x, significance) => {
    significance = significance === void 0 ? 3 : significance;
    array = parseNumberArray(flatten$1(array));
    x = parseNumber(x);
    significance = parseNumber(significance);
    if (anyIsError(array, x, significance)) {
      return value;
    }
    array = array.sort((a, b) => a - b);
    const uniques = UNIQUE.apply(null, array);
    const n = array.length;
    const m = uniques.length;
    const power = Math.pow(10, significance);
    let result = 0;
    let match = false;
    let i2 = 0;
    while (!match && i2 < m) {
      if (x === uniques[i2]) {
        result = array.indexOf(uniques[i2]) / (n - 1);
        match = true;
      } else if (x >= uniques[i2] && (x < uniques[i2 + 1] || i2 === m - 1)) {
        result = (array.indexOf(uniques[i2]) + (x - uniques[i2]) / (uniques[i2 + 1] - uniques[i2])) / (n - 1);
        match = true;
      }
      i2++;
    }
    return Math.floor(result * power) / power;
  };
  function PERMUT(number2, number_chosen) {
    number2 = parseNumber(number2);
    number_chosen = parseNumber(number_chosen);
    if (anyIsError(number2, number_chosen)) {
      return value;
    }
    return FACT(number2) / FACT(number2 - number_chosen);
  }
  function PERMUTATIONA(number2, number_chosen) {
    number2 = parseNumber(number2);
    number_chosen = parseNumber(number_chosen);
    if (anyIsError(number2, number_chosen)) {
      return value;
    }
    return Math.pow(number2, number_chosen);
  }
  function PHI(x) {
    x = parseNumber(x);
    if (x instanceof Error) {
      return value;
    }
    return Math.exp(-0.5 * x * x) / SQRT2PI;
  }
  const POISSON = {};
  POISSON.DIST = (x, mean, cumulative) => {
    x = parseNumber(x);
    mean = parseNumber(mean);
    if (anyIsError(x, mean)) {
      return value;
    }
    return cumulative ? jStat.poisson.cdf(x, mean) : jStat.poisson.pdf(x, mean);
  };
  function PROB(x_range, prob_range, lower_limit, upper_limit) {
    if (lower_limit === void 0) {
      return 0;
    }
    upper_limit = upper_limit === void 0 ? lower_limit : upper_limit;
    x_range = parseNumberArray(flatten$1(x_range));
    prob_range = parseNumberArray(flatten$1(prob_range));
    lower_limit = parseNumber(lower_limit);
    upper_limit = parseNumber(upper_limit);
    if (anyIsError(x_range, prob_range, lower_limit, upper_limit)) {
      return value;
    }
    if (lower_limit === upper_limit) {
      return x_range.indexOf(lower_limit) >= 0 ? prob_range[x_range.indexOf(lower_limit)] : 0;
    }
    const sorted = x_range.sort((a, b) => a - b);
    const n = sorted.length;
    let result = 0;
    for (let i2 = 0; i2 < n; i2++) {
      if (sorted[i2] >= lower_limit && sorted[i2] <= upper_limit) {
        result += prob_range[x_range.indexOf(sorted[i2])];
      }
    }
    return result;
  }
  const QUARTILE = {};
  QUARTILE.EXC = (range, quart) => {
    range = parseNumberArray(flatten$1(range));
    quart = parseNumber(quart);
    if (anyIsError(range, quart)) {
      return value;
    }
    switch (quart) {
      case 1:
        return PERCENTILE.EXC(range, 0.25);
      case 2:
        return PERCENTILE.EXC(range, 0.5);
      case 3:
        return PERCENTILE.EXC(range, 0.75);
      default:
        return num;
    }
  };
  QUARTILE.INC = (range, quart) => {
    range = parseNumberArray(flatten$1(range));
    quart = parseNumber(quart);
    if (anyIsError(range, quart)) {
      return value;
    }
    switch (quart) {
      case 1:
        return PERCENTILE.INC(range, 0.25);
      case 2:
        return PERCENTILE.INC(range, 0.5);
      case 3:
        return PERCENTILE.INC(range, 0.75);
      default:
        return num;
    }
  };
  const RANK = {};
  RANK.AVG = (number2, ref2, order) => {
    number2 = parseNumber(number2);
    ref2 = parseNumberArray(flatten$1(ref2));
    if (anyIsError(number2, ref2)) {
      return value;
    }
    ref2 = flatten$1(ref2);
    order = order || false;
    const sort = order ? (a, b) => a - b : (a, b) => b - a;
    ref2 = ref2.sort(sort);
    const length = ref2.length;
    let count = 0;
    for (let i2 = 0; i2 < length; i2++) {
      if (ref2[i2] === number2) {
        count++;
      }
    }
    return count > 1 ? (2 * ref2.indexOf(number2) + count + 1) / 2 : ref2.indexOf(number2) + 1;
  };
  RANK.EQ = (number2, ref2, order) => {
    number2 = parseNumber(number2);
    ref2 = parseNumberArray(flatten$1(ref2));
    if (anyIsError(number2, ref2)) {
      return value;
    }
    order = order || false;
    const sort = order ? (a, b) => a - b : (a, b) => b - a;
    ref2 = ref2.sort(sort);
    return ref2.indexOf(number2) + 1;
  };
  function ROW(reference, index2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (index2 < 0) {
      return num;
    }
    if (!(reference instanceof Array) || typeof index2 !== "number") {
      return value;
    }
    if (reference.length === 0) {
      return void 0;
    }
    return jStat.row(reference, index2);
  }
  function RSQ(known_y, known_x) {
    known_y = parseNumberArray(flatten$1(known_y));
    known_x = parseNumberArray(flatten$1(known_x));
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    return Math.pow(PEARSON(known_y, known_x), 2);
  }
  function SKEW() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const mean = jStat.mean(range);
    const n = range.length;
    let sigma = 0;
    for (let i2 = 0; i2 < n; i2++) {
      sigma += Math.pow(range[i2] - mean, 3);
    }
    return n * sigma / ((n - 1) * (n - 2) * Math.pow(jStat.stdev(range, true), 3));
  }
  SKEW.P = function() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const mean = jStat.mean(range);
    const n = range.length;
    let m2 = 0;
    let m3 = 0;
    for (let i2 = 0; i2 < n; i2++) {
      m3 += Math.pow(range[i2] - mean, 3);
      m2 += Math.pow(range[i2] - mean, 2);
    }
    m3 = m3 / n;
    m2 = m2 / n;
    return m3 / Math.pow(m2, 3 / 2);
  };
  function SLOPE(known_y, known_x) {
    known_y = parseNumberArray(flatten$1(known_y));
    known_x = parseNumberArray(flatten$1(known_x));
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    const xmean = jStat.mean(known_x);
    const ymean = jStat.mean(known_y);
    const n = known_x.length;
    let num2 = 0;
    let den = 0;
    for (let i2 = 0; i2 < n; i2++) {
      num2 += (known_x[i2] - xmean) * (known_y[i2] - ymean);
      den += Math.pow(known_x[i2] - xmean, 2);
    }
    return num2 / den;
  }
  function SMALL(array, k) {
    array = parseNumberArray(flatten$1(array));
    k = parseNumber(k);
    if (anyIsError(array, k)) {
      return array;
    }
    return array.sort((a, b) => a - b)[k - 1];
  }
  function STANDARDIZE(x, mean, standard_dev) {
    x = parseNumber(x);
    mean = parseNumber(mean);
    standard_dev = parseNumber(standard_dev);
    if (anyIsError(x, mean, standard_dev)) {
      return value;
    }
    return (x - mean) / standard_dev;
  }
  const STDEV = {};
  STDEV.P = function() {
    const v = VAR.P.apply(this, arguments);
    let result = Math.sqrt(v);
    if (isNaN(result)) {
      result = num;
    }
    return result;
  };
  STDEV.S = function() {
    const v = VAR.S.apply(this, arguments);
    const result = Math.sqrt(v);
    return result;
  };
  function STDEVA() {
    const v = VARA.apply(this, arguments);
    const result = Math.sqrt(v);
    return result;
  }
  function STDEVPA() {
    const v = VARPA.apply(this, arguments);
    let result = Math.sqrt(v);
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function STEYX(known_y, known_x) {
    known_y = parseNumberArray(flatten$1(known_y));
    known_x = parseNumberArray(flatten$1(known_x));
    if (anyIsError(known_y, known_x)) {
      return value;
    }
    const xmean = jStat.mean(known_x);
    const ymean = jStat.mean(known_y);
    const n = known_x.length;
    let lft = 0;
    let num2 = 0;
    let den = 0;
    for (let i2 = 0; i2 < n; i2++) {
      lft += Math.pow(known_y[i2] - ymean, 2);
      num2 += (known_x[i2] - xmean) * (known_y[i2] - ymean);
      den += Math.pow(known_x[i2] - xmean, 2);
    }
    return Math.sqrt((lft - num2 * num2 / den) / (n - 2));
  }
  const T$1 = {};
  T$1.DIST = (x, deg_freedom, cumulative) => {
    if (cumulative !== 1 && cumulative !== 2) {
      return num;
    }
    return cumulative === 1 ? T$1.DIST.RT(x, deg_freedom) : T$1.DIST["2T"](x, deg_freedom);
  };
  T$1.DIST["2T"] = function(x, deg_freedom) {
    if (arguments.length !== 2) {
      return na;
    }
    if (x < 0 || deg_freedom < 1) {
      return num;
    }
    if (typeof x !== "number" || typeof deg_freedom !== "number") {
      return value;
    }
    return (1 - jStat.studentt.cdf(x, deg_freedom)) * 2;
  };
  T$1.DIST.RT = function(x, deg_freedom) {
    if (arguments.length !== 2) {
      return na;
    }
    if (x < 0 || deg_freedom < 1) {
      return num;
    }
    if (typeof x !== "number" || typeof deg_freedom !== "number") {
      return value;
    }
    return 1 - jStat.studentt.cdf(x, deg_freedom);
  };
  T$1.INV = (probability, deg_freedom) => {
    probability = parseNumber(probability);
    deg_freedom = parseNumber(deg_freedom);
    if (anyIsError(probability, deg_freedom)) {
      return value;
    }
    return jStat.studentt.inv(probability, deg_freedom);
  };
  T$1.INV["2T"] = (probability, deg_freedom) => {
    probability = parseNumber(probability);
    deg_freedom = parseNumber(deg_freedom);
    if (probability <= 0 || probability > 1 || deg_freedom < 1) {
      return num;
    }
    if (anyIsError(probability, deg_freedom)) {
      return value;
    }
    return Math.abs(jStat.studentt.inv(probability / 2, deg_freedom));
  };
  T$1.TEST = (array1, array2) => {
    array1 = parseNumberArray(flatten$1(array1));
    array2 = parseNumberArray(flatten$1(array2));
    if (anyIsError(array1, array2)) {
      return value;
    }
    const mean_x = jStat.mean(array1);
    const mean_y = jStat.mean(array2);
    let s_x = 0;
    let s_y = 0;
    let i2;
    for (i2 = 0; i2 < array1.length; i2++) {
      s_x += Math.pow(array1[i2] - mean_x, 2);
    }
    for (i2 = 0; i2 < array2.length; i2++) {
      s_y += Math.pow(array2[i2] - mean_y, 2);
    }
    s_x = s_x / (array1.length - 1);
    s_y = s_y / (array2.length - 1);
    const t2 = Math.abs(mean_x - mean_y) / Math.sqrt(s_x / array1.length + s_y / array2.length);
    return T$1.DIST["2T"](t2, array1.length + array2.length - 2);
  };
  function TREND(known_ys, known_xs, new_xs) {
    known_ys = parseNumberArray(flatten$1(known_ys));
    known_xs = parseNumberArray(flatten$1(known_xs));
    new_xs = parseNumberArray(flatten$1(new_xs));
    if (anyIsError(known_ys, known_xs, new_xs)) {
      return value;
    }
    const linest = LINEST(known_ys, known_xs);
    const m = linest[0];
    const b = linest[1];
    const result = [];
    new_xs.forEach((x) => {
      result.push(m * x + b);
    });
    return result;
  }
  function TRIMMEAN(range, percent) {
    range = parseNumberArray(flatten$1(range));
    percent = parseNumber(percent);
    if (anyIsError(range, percent)) {
      return value;
    }
    const trim2 = FLOOR(range.length * percent, 2) / 2;
    return jStat.mean(initial(rest(range.sort((a, b) => a - b), trim2), trim2));
  }
  const VAR = {};
  VAR.P = function() {
    const range = numbers(flatten$1(arguments));
    const n = range.length;
    let sigma = 0;
    const mean = AVERAGE(range);
    let result;
    for (let i2 = 0; i2 < n; i2++) {
      sigma += Math.pow(range[i2] - mean, 2);
    }
    result = sigma / n;
    if (isNaN(result)) {
      result = num;
    }
    return result;
  };
  VAR.S = function() {
    const range = numbers(flatten$1(arguments));
    const n = range.length;
    let sigma = 0;
    const mean = AVERAGE(range);
    for (let i2 = 0; i2 < n; i2++) {
      sigma += Math.pow(range[i2] - mean, 2);
    }
    return sigma / (n - 1);
  };
  function VARA() {
    const range = flatten$1(arguments);
    const n = range.length;
    let sigma = 0;
    let count = 0;
    const mean = AVERAGEA(range);
    for (let i2 = 0; i2 < n; i2++) {
      const el = range[i2];
      if (typeof el === "number") {
        sigma += Math.pow(el - mean, 2);
      } else if (el === true) {
        sigma += Math.pow(1 - mean, 2);
      } else {
        sigma += Math.pow(0 - mean, 2);
      }
      if (el !== null) {
        count++;
      }
    }
    return sigma / (count - 1);
  }
  function VARPA() {
    const range = flatten$1(arguments);
    const n = range.length;
    let sigma = 0;
    let count = 0;
    const mean = AVERAGEA(range);
    let result;
    for (let i2 = 0; i2 < n; i2++) {
      const el = range[i2];
      if (typeof el === "number") {
        sigma += Math.pow(el - mean, 2);
      } else if (el === true) {
        sigma += Math.pow(1 - mean, 2);
      } else {
        sigma += Math.pow(0 - mean, 2);
      }
      if (el !== null) {
        count++;
      }
    }
    result = sigma / count;
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  const WEIBULL = {};
  WEIBULL.DIST = (x, alpha, beta, cumulative) => {
    x = parseNumber(x);
    alpha = parseNumber(alpha);
    beta = parseNumber(beta);
    if (anyIsError(x, alpha, beta)) {
      return value;
    }
    return cumulative ? 1 - Math.exp(-Math.pow(x / beta, alpha)) : Math.pow(x, alpha - 1) * Math.exp(-Math.pow(x / beta, alpha)) * alpha / Math.pow(beta, alpha);
  };
  const Z = {};
  Z.TEST = (array, x, sigma) => {
    array = parseNumberArray(flatten$1(array));
    x = parseNumber(x);
    if (anyIsError(array, x)) {
      return value;
    }
    sigma = sigma || STDEV.S(array);
    const n = array.length;
    return 1 - NORM.S.DIST((AVERAGE(array) - x) / (sigma / Math.sqrt(n)), true);
  };
  function ABS(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const result = Math.abs(number2);
    return result;
  }
  function ACOS(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let result = Math.acos(number2);
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function ACOSH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let result = Math.log(number2 + Math.sqrt(number2 * number2 - 1));
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function ACOT(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const result = Math.atan(1 / number2);
    return result;
  }
  function ACOTH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let result = 0.5 * Math.log((number2 + 1) / (number2 - 1));
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function AGGREGATE(function_num, options, ref1, ref2) {
    function_num = parseNumber(function_num);
    options = parseNumber(function_num);
    if (anyIsError(function_num, options)) {
      return value;
    }
    switch (function_num) {
      case 1:
        return AVERAGE(ref1);
      case 2:
        return COUNT$1(ref1);
      case 3:
        return COUNTA(ref1);
      case 4:
        return MAX(ref1);
      case 5:
        return MIN(ref1);
      case 6:
        return PRODUCT(ref1);
      case 7:
        return STDEV.S(ref1);
      case 8:
        return STDEV.P(ref1);
      case 9:
        return SUM(ref1);
      case 10:
        return VAR.S(ref1);
      case 11:
        return VAR.P(ref1);
      case 12:
        return MEDIAN(ref1);
      case 13:
        return MODE.SNGL(ref1);
      case 14:
        return LARGE(ref1, ref2);
      case 15:
        return SMALL(ref1, ref2);
      case 16:
        return PERCENTILE.INC(ref1, ref2);
      case 17:
        return QUARTILE.INC(ref1, ref2);
      case 18:
        return PERCENTILE.EXC(ref1, ref2);
      case 19:
        return QUARTILE.EXC(ref1, ref2);
    }
  }
  function ARABIC(text) {
    if (text === void 0 || text === null) {
      return 0;
    }
    if (text instanceof Error) {
      return text;
    }
    if (!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(text)) {
      return value;
    }
    let r = 0;
    text.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g, (i2) => {
      r += {
        M: 1e3,
        CM: 900,
        D: 500,
        CD: 400,
        C: 100,
        XC: 90,
        L: 50,
        XL: 40,
        X: 10,
        IX: 9,
        V: 5,
        IV: 4,
        I: 1
      }[i2];
    });
    return r;
  }
  function ASIN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let result = Math.asin(number2);
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function ASINH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.log(number2 + Math.sqrt(number2 * number2 + 1));
  }
  function ATAN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.atan(number2);
  }
  function ATAN2(x_num, y_num) {
    x_num = parseNumber(x_num);
    y_num = parseNumber(y_num);
    const anyError$1 = anyError(x_num, y_num);
    if (anyError$1) {
      return anyError$1;
    }
    return Math.atan2(x_num, y_num);
  }
  function ATANH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let result = Math.log((1 + number2) / (1 - number2)) / 2;
    if (isNaN(result)) {
      result = num;
    }
    return result;
  }
  function BASE(number2, radix, min_length) {
    number2 = parseNumber(number2);
    radix = parseNumber(radix);
    min_length = parseNumber(min_length);
    const anyError$1 = anyError(number2, radix, min_length);
    if (anyError$1) {
      return anyError$1;
    }
    if (radix === 0) {
      return num;
    }
    const result = number2.toString(radix);
    return new Array(Math.max(min_length + 1 - result.length, 0)).join("0") + result;
  }
  function CEILING(number2, significance, mode) {
    number2 = parseNumber(number2);
    significance = parseNumber(significance);
    mode = parseNumber(mode);
    const anyError$1 = anyError(number2, significance, mode);
    if (anyError$1) {
      return anyError$1;
    }
    if (significance === 0) {
      return 0;
    }
    significance = Math.abs(significance);
    const precision = -Math.floor(Math.log(significance) / Math.log(10));
    if (number2 >= 0) {
      return ROUND(Math.ceil(number2 / significance) * significance, precision);
    } else {
      if (mode === 0) {
        return -ROUND(Math.floor(Math.abs(number2) / significance) * significance, precision);
      } else {
        return -ROUND(Math.ceil(Math.abs(number2) / significance) * significance, precision);
      }
    }
  }
  CEILING.MATH = CEILING;
  CEILING.PRECISE = CEILING;
  function COMBIN(number2, number_chosen) {
    number2 = parseNumber(number2);
    number_chosen = parseNumber(number_chosen);
    const anyError$1 = anyError(number2, number_chosen);
    if (anyError$1) {
      return anyError$1;
    }
    if (number2 < number_chosen) {
      return num;
    }
    return FACT(number2) / (FACT(number_chosen) * FACT(number2 - number_chosen));
  }
  function COMBINA(number2, number_chosen) {
    number2 = parseNumber(number2);
    number_chosen = parseNumber(number_chosen);
    const anyError$1 = anyError(number2, number_chosen);
    if (anyError$1) {
      return anyError$1;
    }
    if (number2 < number_chosen) {
      return num;
    }
    return number2 === 0 && number_chosen === 0 ? 1 : COMBIN(number2 + number_chosen - 1, number2 - 1);
  }
  function COS(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.cos(number2);
  }
  function COSH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return (Math.exp(number2) + Math.exp(-number2)) / 2;
  }
  function COT(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return div0;
    }
    return 1 / Math.tan(number2);
  }
  function COTH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return div0;
    }
    const e2 = Math.exp(2 * number2);
    return (e2 + 1) / (e2 - 1);
  }
  function CSC(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return div0;
    }
    return 1 / Math.sin(number2);
  }
  function CSCH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return div0;
    }
    return 2 / (Math.exp(number2) - Math.exp(-number2));
  }
  function DECIMAL(text, radix) {
    if (arguments.length < 2) {
      return na;
    }
    text = text || "0";
    radix = parseNumber(radix);
    const anyError$1 = anyError(text, radix);
    if (anyError$1) {
      return anyError$1;
    }
    if (radix === 0) {
      return num;
    }
    const result = parseInt(text, radix);
    if (isNaN(result)) {
      return num;
    }
    return result;
  }
  function DEGREES(angle) {
    angle = parseNumber(angle);
    if (angle instanceof Error) {
      return angle;
    }
    return angle * 180 / Math.PI;
  }
  function EVEN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return CEILING(number2, -2, -1);
  }
  function EXP(number2) {
    if (arguments.length < 1) {
      return na;
    }
    if (arguments.length > 1) {
      return error;
    }
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    number2 = Math.exp(number2);
    return number2;
  }
  const MEMOIZED_FACT = [];
  function FACT(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const n = Math.floor(number2);
    if (n === 0 || n === 1) {
      return 1;
    } else if (MEMOIZED_FACT[n] > 0) {
      return MEMOIZED_FACT[n];
    } else {
      MEMOIZED_FACT[n] = FACT(n - 1) * n;
      return MEMOIZED_FACT[n];
    }
  }
  function FACTDOUBLE(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const n = Math.floor(number2);
    return n <= 0 ? 1 : n * FACTDOUBLE(n - 2);
  }
  function FLOOR(number2, significance) {
    number2 = parseNumber(number2);
    significance = parseNumber(significance);
    const anyError$1 = anyError(number2, significance);
    if (anyError$1) {
      return anyError$1;
    }
    if (significance === 0) {
      return 0;
    }
    if (!(number2 >= 0 && significance > 0) && !(number2 <= 0 && significance < 0)) {
      return num;
    }
    significance = Math.abs(significance);
    const precision = -Math.floor(Math.log(significance) / Math.log(10));
    return number2 >= 0 ? ROUND(Math.floor(number2 / significance) * significance, precision) : -ROUND(Math.ceil(Math.abs(number2) / significance), precision);
  }
  FLOOR.MATH = (number2, significance, mode) => {
    if (significance instanceof Error) {
      return significance;
    }
    significance = significance === void 0 ? 0 : significance;
    number2 = parseNumber(number2);
    significance = parseNumber(significance);
    mode = parseNumber(mode);
    const anyError$1 = anyError(number2, significance, mode);
    if (anyError$1) {
      return anyError$1;
    }
    if (significance === 0) {
      return 0;
    }
    significance = significance ? Math.abs(significance) : 1;
    const precision = -Math.floor(Math.log(significance) / Math.log(10));
    if (number2 >= 0) {
      return ROUND(Math.floor(number2 / significance) * significance, precision);
    } else if (mode === 0 || mode === void 0) {
      return -ROUND(Math.ceil(Math.abs(number2) / significance) * significance, precision);
    }
    return -ROUND(Math.floor(Math.abs(number2) / significance) * significance, precision);
  };
  FLOOR.PRECISE = FLOOR["MATH"];
  function GCD() {
    const range = parseNumberArray(flatten$1(arguments));
    if (range instanceof Error) {
      return range;
    }
    const n = range.length;
    const r0 = range[0];
    let x = r0 < 0 ? -r0 : r0;
    for (let i2 = 1; i2 < n; i2++) {
      const ri = range[i2];
      let y = ri < 0 ? -ri : ri;
      while (x && y) {
        if (x > y) {
          x %= y;
        } else {
          y %= x;
        }
      }
      x += y;
    }
    return x;
  }
  function INT(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.floor(number2);
  }
  const ISO = {
    CEILING
  };
  function LCM() {
    const o = parseNumberArray(flatten$1(arguments));
    if (o instanceof Error) {
      return o;
    }
    for (var i2, j, n, d, r = 1; (n = o.pop()) !== void 0; ) {
      if (n === 0) {
        return 0;
      }
      while (n > 1) {
        if (n % 2) {
          for (i2 = 3, j = Math.floor(Math.sqrt(n)); i2 <= j && n % i2; i2 += 2) {
          }
          d = i2 <= j ? i2 : n;
        } else {
          d = 2;
        }
        for (n /= d, r *= d, i2 = o.length; i2; o[--i2] % d === 0 && (o[i2] /= d) === 1 && o.splice(i2, 1)) {
        }
      }
    }
    return r;
  }
  function LN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return num;
    }
    return Math.log(number2);
  }
  function LOG(number2, base2) {
    number2 = parseNumber(number2);
    base2 = parseNumber(base2);
    const anyError$1 = anyError(number2, base2);
    if (anyError$1) {
      return anyError$1;
    }
    if (number2 === 0 || base2 === 0) {
      return num;
    }
    return Math.log(number2) / Math.log(base2);
  }
  function LOG10(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 === 0) {
      return num;
    }
    return Math.log(number2) / Math.log(10);
  }
  function MMULT(array1, array2) {
    if (!Array.isArray(array1) || !Array.isArray(array2) || array1.some((el) => !el.length) || array2.some((el) => !el.length) || flattenShallow(array1).some((el) => typeof el !== "number") || flattenShallow(array2).some((el) => typeof el !== "number") || array1[0].length !== array2.length) {
      return value;
    }
    const matrix2 = Array(array1.length).fill(0).map(() => Array(array2[0].length).fill(0));
    return matrix2.map((row, i2) => row.map((_, j) => array1[i2].reduce((sum, el, k) => sum + el * array2[k][j], 0)));
  }
  function MOD(number2, divisor) {
    number2 = parseNumber(number2);
    divisor = parseNumber(divisor);
    const anyError$1 = anyError(number2, divisor);
    if (anyError$1) {
      return anyError$1;
    }
    if (divisor === 0) {
      return div0;
    }
    let modulus = Math.abs(number2 % divisor);
    modulus = number2 < 0 ? divisor - modulus : modulus;
    return divisor > 0 ? modulus : -modulus;
  }
  function MROUND(number2, multiple) {
    number2 = parseNumber(number2);
    multiple = parseNumber(multiple);
    const anyError$1 = anyError(number2, multiple);
    if (anyError$1) {
      return anyError$1;
    }
    if (number2 * multiple === 0) {
      return 0;
    }
    if (number2 * multiple < 0) {
      return num;
    }
    return Math.round(number2 / multiple) * multiple;
  }
  function MULTINOMIAL() {
    const args = parseNumberArray(flatten$1(arguments));
    if (args instanceof Error) {
      return args;
    }
    let sum = 0;
    let divisor = 1;
    for (let i2 = 0; i2 < args.length; i2++) {
      sum += args[i2];
      divisor *= FACT(args[i2]);
    }
    return FACT(sum) / divisor;
  }
  function MUNIT(dimension) {
    if (arguments.length > 1) {
      return na;
    }
    dimension = parseInt(dimension);
    if (!dimension || dimension <= 0) {
      return value;
    }
    return Array(dimension).fill(0).map(() => Array(dimension).fill(0)).map((el, i2) => {
      el[i2] = 1;
      return el;
    });
  }
  function ODD(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    let temp = Math.ceil(Math.abs(number2));
    temp = temp & 1 ? temp : temp + 1;
    return number2 >= 0 ? temp : -temp;
  }
  function PI() {
    return Math.PI;
  }
  function POWER(number2, power) {
    number2 = parseNumber(number2);
    power = parseNumber(power);
    const anyError$1 = anyError(number2, power);
    if (anyError$1) {
      return anyError$1;
    }
    if (number2 === 0 && power === 0) {
      return num;
    }
    const result = Math.pow(number2, power);
    if (isNaN(result)) {
      return num;
    }
    return result;
  }
  function PRODUCT() {
    const flatArguments = flatten$1(arguments);
    const flatArgumentsDefined = flatArguments.filter((arg) => arg !== void 0 && arg !== null);
    if (flatArgumentsDefined.length === 0) {
      return 0;
    }
    const args = parseNumberArray(flatArgumentsDefined);
    if (args instanceof Error) {
      return args;
    }
    let result = 1;
    for (let i2 = 0; i2 < args.length; i2++) {
      result *= args[i2];
    }
    return result;
  }
  function QUOTIENT(numerator, denominator) {
    numerator = parseNumber(numerator);
    denominator = parseNumber(denominator);
    const anyError$1 = anyError(numerator, denominator);
    if (anyError$1) {
      return anyError$1;
    }
    return parseInt(numerator / denominator, 10);
  }
  function RADIANS(angle) {
    angle = parseNumber(angle);
    if (angle instanceof Error) {
      return angle;
    }
    return angle * Math.PI / 180;
  }
  function RAND() {
    return Math.random();
  }
  function RANDBETWEEN(bottom, top2) {
    bottom = parseNumber(bottom);
    top2 = parseNumber(top2);
    const anyError$1 = anyError(bottom, top2);
    if (anyError$1) {
      return anyError$1;
    }
    return bottom + Math.ceil((top2 - bottom + 1) * Math.random()) - 1;
  }
  function ROMAN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const digits = String(number2).split("");
    const key = [
      "",
      "C",
      "CC",
      "CCC",
      "CD",
      "D",
      "DC",
      "DCC",
      "DCCC",
      "CM",
      "",
      "X",
      "XX",
      "XXX",
      "XL",
      "L",
      "LX",
      "LXX",
      "LXXX",
      "XC",
      "",
      "I",
      "II",
      "III",
      "IV",
      "V",
      "VI",
      "VII",
      "VIII",
      "IX"
    ];
    let roman = "";
    let i2 = 3;
    while (i2--) {
      roman = (key[+digits.pop() + i2 * 10] || "") + roman;
    }
    return new Array(+digits.join("") + 1).join("M") + roman;
  }
  function ROUND(number2, num_digits) {
    number2 = parseNumber(number2);
    num_digits = parseNumber(num_digits);
    const anyError$1 = anyError(number2, num_digits);
    if (anyError$1) {
      return anyError$1;
    }
    return Number(Math.round(Number(number2 + "e" + num_digits)) + "e" + num_digits * -1);
  }
  function ROUNDDOWN(number2, num_digits) {
    number2 = parseNumber(number2);
    num_digits = parseNumber(num_digits);
    const anyError$1 = anyError(number2, num_digits);
    if (anyError$1) {
      return anyError$1;
    }
    const sign = number2 > 0 ? 1 : -1;
    return sign * Math.floor(Math.abs(number2) * Math.pow(10, num_digits)) / Math.pow(10, num_digits);
  }
  function ROUNDUP(number2, num_digits) {
    number2 = parseNumber(number2);
    num_digits = parseNumber(num_digits);
    const anyError$1 = anyError(number2, num_digits);
    if (anyError$1) {
      return anyError$1;
    }
    const sign = number2 > 0 ? 1 : -1;
    return sign * Math.ceil(Math.abs(number2) * Math.pow(10, num_digits)) / Math.pow(10, num_digits);
  }
  function SEC(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return 1 / Math.cos(number2);
  }
  function SECH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return 2 / (Math.exp(number2) + Math.exp(-number2));
  }
  function SERIESSUM(x, n, m, coefficients) {
    x = parseNumber(x);
    n = parseNumber(n);
    m = parseNumber(m);
    coefficients = parseNumberArray(coefficients);
    if (anyIsError(x, n, m, coefficients)) {
      return value;
    }
    let result = coefficients[0] * Math.pow(x, n);
    for (let i2 = 1; i2 < coefficients.length; i2++) {
      result += coefficients[i2] * Math.pow(x, n + i2 * m);
    }
    return result;
  }
  function SIGN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 < 0) {
      return -1;
    } else if (number2 === 0) {
      return 0;
    } else {
      return 1;
    }
  }
  function SIN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.sin(number2);
  }
  function SINH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return (Math.exp(number2) - Math.exp(-number2)) / 2;
  }
  function SQRT(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (number2 < 0) {
      return num;
    }
    return Math.sqrt(number2);
  }
  function SQRTPI(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.sqrt(number2 * Math.PI);
  }
  function SUBTOTAL(function_num, ref1) {
    function_num = parseNumber(function_num);
    if (function_num instanceof Error) {
      return function_num;
    }
    switch (function_num) {
      case 1:
        return AVERAGE(ref1);
      case 2:
        return COUNT$1(ref1);
      case 3:
        return COUNTA(ref1);
      case 4:
        return MAX(ref1);
      case 5:
        return MIN(ref1);
      case 6:
        return PRODUCT(ref1);
      case 7:
        return STDEV.S(ref1);
      case 8:
        return STDEV.P(ref1);
      case 9:
        return SUM(ref1);
      case 10:
        return VAR.S(ref1);
      case 11:
        return VAR.P(ref1);
      case 101:
        return AVERAGE(ref1);
      case 102:
        return COUNT$1(ref1);
      case 103:
        return COUNTA(ref1);
      case 104:
        return MAX(ref1);
      case 105:
        return MIN(ref1);
      case 106:
        return PRODUCT(ref1);
      case 107:
        return STDEV.S(ref1);
      case 108:
        return STDEV.P(ref1);
      case 109:
        return SUM(ref1);
      case 110:
        return VAR.S(ref1);
      case 111:
        return VAR.P(ref1);
    }
  }
  function SUM() {
    let result = 0;
    arrayEach(argsToArray(arguments), (value2) => {
      if (result instanceof Error) {
        return false;
      } else if (value2 instanceof Error) {
        result = value2;
      } else if (typeof value2 === "number") {
        result += value2;
      } else if (typeof value2 === "string") {
        const parsed = parseFloat(value2);
        !isNaN(parsed) && (result += parsed);
      } else if (Array.isArray(value2)) {
        const inner_result = SUM.apply(null, value2);
        if (inner_result instanceof Error) {
          result = inner_result;
        } else {
          result += inner_result;
        }
      }
    });
    return result;
  }
  function SUMIF(range, criteria, sum_range) {
    range = flatten$1(range);
    sum_range = sum_range ? flatten$1(sum_range) : range;
    if (range instanceof Error) {
      return range;
    }
    if (criteria === void 0 || criteria === null || criteria instanceof Error) {
      return 0;
    }
    let result = 0;
    const isWildcard = criteria === "*";
    const tokenizedCriteria = isWildcard ? null : parse(criteria + "");
    for (let i2 = 0; i2 < range.length; i2++) {
      const value2 = range[i2];
      const sumValue = sum_range[i2];
      if (isWildcard) {
        result += value2;
      } else {
        const tokens = [createToken(value2, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
        result += compute(tokens) ? sumValue : 0;
      }
    }
    return result;
  }
  function SUMIFS() {
    const args = argsToArray(arguments);
    const range = parseNumberArray(flatten$1(args.shift()));
    if (range instanceof Error) {
      return range;
    }
    const criterias = args;
    const criteriaLength = criterias.length / 2;
    for (let i2 = 0; i2 < criteriaLength; i2++) {
      criterias[i2 * 2] = flatten$1(criterias[i2 * 2]);
    }
    let result = 0;
    for (let i2 = 0; i2 < range.length; i2++) {
      let isMeetCondition = false;
      for (let j = 0; j < criteriaLength; j++) {
        const valueToTest = criterias[j * 2][i2];
        const criteria = criterias[j * 2 + 1];
        const isWildcard = criteria === void 0 || criteria === "*";
        let computedResult = false;
        if (isWildcard) {
          computedResult = true;
        } else {
          const tokenizedCriteria = parse(criteria + "");
          const tokens = [createToken(valueToTest, TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
          computedResult = compute(tokens);
        }
        if (!computedResult) {
          isMeetCondition = false;
          break;
        }
        isMeetCondition = true;
      }
      if (isMeetCondition) {
        result += range[i2];
      }
    }
    return result;
  }
  function SUMPRODUCT() {
    if (!arguments || arguments.length === 0) {
      return value;
    }
    const arrays = arguments.length + 1;
    let result = 0;
    let product;
    let k;
    let _i;
    let _ij;
    for (let i2 = 0; i2 < arguments[0].length; i2++) {
      if (!(arguments[0][i2] instanceof Array)) {
        product = 1;
        for (k = 1; k < arrays; k++) {
          const _i_arg = arguments[k - 1][i2];
          if (_i_arg instanceof Error) {
            return _i_arg;
          }
          _i = parseNumber(_i_arg);
          if (_i instanceof Error) {
            return _i;
          }
          product *= _i;
        }
        result += product;
      } else {
        for (let j = 0; j < arguments[0][i2].length; j++) {
          product = 1;
          for (k = 1; k < arrays; k++) {
            const _ij_arg = arguments[k - 1][i2][j];
            if (_ij_arg instanceof Error) {
              return _ij_arg;
            }
            _ij = parseNumber(_ij_arg);
            if (_ij instanceof Error) {
              return _ij;
            }
            product *= _ij;
          }
          result += product;
        }
      }
    }
    return result;
  }
  function SUMSQ() {
    const numbers2 = parseNumberArray(flatten$1(arguments));
    if (numbers2 instanceof Error) {
      return numbers2;
    }
    let result = 0;
    const length = numbers2.length;
    for (let i2 = 0; i2 < length; i2++) {
      result += ISNUMBER(numbers2[i2]) ? numbers2[i2] * numbers2[i2] : 0;
    }
    return result;
  }
  function SUMX2MY2(array_x, array_y) {
    array_x = parseNumberArray(flatten$1(array_x));
    array_y = parseNumberArray(flatten$1(array_y));
    if (anyIsError(array_x, array_y)) {
      return value;
    }
    let result = 0;
    for (let i2 = 0; i2 < array_x.length; i2++) {
      result += array_x[i2] * array_x[i2] - array_y[i2] * array_y[i2];
    }
    return result;
  }
  function SUMX2PY2(array_x, array_y) {
    array_x = parseNumberArray(flatten$1(array_x));
    array_y = parseNumberArray(flatten$1(array_y));
    if (anyIsError(array_x, array_y)) {
      return value;
    }
    let result = 0;
    array_x = parseNumberArray(flatten$1(array_x));
    array_y = parseNumberArray(flatten$1(array_y));
    for (let i2 = 0; i2 < array_x.length; i2++) {
      result += array_x[i2] * array_x[i2] + array_y[i2] * array_y[i2];
    }
    return result;
  }
  function SUMXMY2(array_x, array_y) {
    array_x = parseNumberArray(flatten$1(array_x));
    array_y = parseNumberArray(flatten$1(array_y));
    if (anyIsError(array_x, array_y)) {
      return value;
    }
    let result = 0;
    array_x = flatten$1(array_x);
    array_y = flatten$1(array_y);
    for (let i2 = 0; i2 < array_x.length; i2++) {
      result += Math.pow(array_x[i2] - array_y[i2], 2);
    }
    return result;
  }
  function TAN(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    return Math.tan(number2);
  }
  function TANH(number2) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const e2 = Math.exp(2 * number2);
    return (e2 - 1) / (e2 + 1);
  }
  function TRUNC(number2, num_digits) {
    number2 = parseNumber(number2);
    num_digits = parseNumber(num_digits);
    const anyError$1 = anyError(number2, num_digits);
    if (anyError$1) {
      return anyError$1;
    }
    const sign = number2 > 0 ? 1 : -1;
    return sign * Math.floor(Math.abs(number2) * Math.pow(10, num_digits)) / Math.pow(10, num_digits);
  }
  function ADD(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    num1 = parseNumber(num1);
    num2 = parseNumber(num2);
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 + num2;
  }
  function DIVIDE(dividend, divisor) {
    if (arguments.length !== 2) {
      return na;
    }
    dividend = parseNumber(dividend);
    divisor = parseNumber(divisor);
    const anyError$1 = anyError(dividend, divisor);
    if (anyError$1) {
      return anyError$1;
    }
    if (divisor === 0) {
      return div0;
    }
    return dividend / divisor;
  }
  function EQ(value1, value2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (value1 instanceof Error) {
      return value1;
    }
    if (value2 instanceof Error) {
      return value2;
    }
    if (value1 === null) {
      value1 = void 0;
    }
    if (value2 === null) {
      value2 = void 0;
    }
    return value1 === value2;
  }
  function GT(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (num1 instanceof Error) {
      return num1;
    }
    if (num2 instanceof Error) {
      return num2;
    }
    if (anyIsString(num1, num2)) {
      num1 = parseString(num1);
      num2 = parseString(num2);
    } else {
      num1 = parseNumber(num1);
      num2 = parseNumber(num2);
    }
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 > num2;
  }
  function GTE(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (anyIsString(num1, num2)) {
      num1 = parseString(num1);
      num2 = parseString(num2);
    } else {
      num1 = parseNumber(num1);
      num2 = parseNumber(num2);
    }
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 >= num2;
  }
  function LT(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (anyIsString(num1, num2)) {
      num1 = parseString(num1);
      num2 = parseString(num2);
    } else {
      num1 = parseNumber(num1);
      num2 = parseNumber(num2);
    }
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 < num2;
  }
  function LTE(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (anyIsString(num1, num2)) {
      num1 = parseString(num1);
      num2 = parseString(num2);
    } else {
      num1 = parseNumber(num1);
      num2 = parseNumber(num2);
    }
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 <= num2;
  }
  function MINUS(num1, num2) {
    if (arguments.length !== 2) {
      return na;
    }
    num1 = parseNumber(num1);
    num2 = parseNumber(num2);
    const anyError$1 = anyError(num1, num2);
    if (anyError$1) {
      return anyError$1;
    }
    return num1 - num2;
  }
  function MULTIPLY(factor1, factor2) {
    if (arguments.length !== 2) {
      return na;
    }
    factor1 = parseNumber(factor1);
    factor2 = parseNumber(factor2);
    const anyError$1 = anyError(factor1, factor2);
    if (anyError$1) {
      return anyError$1;
    }
    return factor1 * factor2;
  }
  function NE(value1, value2) {
    if (arguments.length !== 2) {
      return na;
    }
    if (value1 instanceof Error) {
      return value1;
    }
    if (value2 instanceof Error) {
      return value2;
    }
    if (value1 === null) {
      value1 = void 0;
    }
    if (value2 === null) {
      value2 = void 0;
    }
    return value1 !== value2;
  }
  function POW(base2, exponent) {
    if (arguments.length !== 2) {
      return na;
    }
    return POWER(base2, exponent);
  }
  var symbols = /* @__PURE__ */ Object.freeze({
    __proto__: null,
    ADD,
    DIVIDE,
    EQ,
    GT,
    GTE,
    LT,
    LTE,
    MINUS,
    MULTIPLY,
    NE,
    POW
  });
  const d1900 = new Date(Date.UTC(1900, 0, 1));
  const WEEK_STARTS = [
    void 0,
    0,
    1,
    void 0,
    void 0,
    void 0,
    void 0,
    void 0,
    void 0,
    void 0,
    void 0,
    void 0,
    1,
    2,
    3,
    4,
    5,
    6,
    0
  ];
  const WEEK_TYPES = [
    [],
    [1, 2, 3, 4, 5, 6, 7],
    [7, 1, 2, 3, 4, 5, 6],
    [6, 0, 1, 2, 3, 4, 5],
    [],
    [],
    [],
    [],
    [],
    [],
    [],
    [7, 1, 2, 3, 4, 5, 6],
    [6, 7, 1, 2, 3, 4, 5],
    [5, 6, 7, 1, 2, 3, 4],
    [4, 5, 6, 7, 1, 2, 3],
    [3, 4, 5, 6, 7, 1, 2],
    [2, 3, 4, 5, 6, 7, 1],
    [1, 2, 3, 4, 5, 6, 7]
  ];
  const WEEKEND_TYPES = [
    [],
    [6, 0],
    [0, 1],
    [1, 2],
    [2, 3],
    [3, 4],
    [4, 5],
    [5, 6],
    void 0,
    void 0,
    void 0,
    [0, 0],
    [1, 1],
    [2, 2],
    [3, 3],
    [4, 4],
    [5, 5],
    [6, 6]
  ];
  function DATE(year, month, day) {
    let result;
    year = parseNumber(year);
    month = parseNumber(month);
    day = parseNumber(day);
    if (anyIsError(year, month, day)) {
      result = value;
    } else {
      result = new Date(year, month - 1, day);
      if (result.getFullYear() < 0) {
        result = num;
      }
    }
    return result;
  }
  function DATEDIF(start_date, end_date, unit) {
    unit = unit.toUpperCase();
    start_date = parseDate(start_date);
    end_date = parseDate(end_date);
    const start_date_year = start_date.getFullYear();
    const start_date_month = start_date.getMonth();
    const start_date_day = start_date.getDate();
    const end_date_year = end_date.getFullYear();
    const end_date_month = end_date.getMonth();
    const end_date_day = end_date.getDate();
    let result;
    switch (unit) {
      case "Y":
        result = Math.floor(YEARFRAC(start_date, end_date));
        break;
      case "D":
        result = DAYS(end_date, start_date);
        break;
      case "M":
        result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);
        if (end_date_day < start_date_day) {
          result--;
        }
        break;
      case "MD":
        if (start_date_day <= end_date_day) {
          result = end_date_day - start_date_day;
        } else {
          if (end_date_month === 0) {
            start_date.setFullYear(end_date_year - 1);
            start_date.setMonth(12);
          } else {
            start_date.setFullYear(end_date_year);
            start_date.setMonth(end_date_month - 1);
          }
          result = DAYS(end_date, start_date);
        }
        break;
      case "YM":
        result = end_date_month - start_date_month + 12 * (end_date_year - start_date_year);
        if (end_date_day < start_date_day) {
          result--;
        }
        result = result % 12;
        break;
      case "YD":
        if (end_date_month > start_date_month || end_date_month === start_date_month && end_date_day < start_date_day) {
          start_date.setFullYear(end_date_year);
        } else {
          start_date.setFullYear(end_date_year - 1);
        }
        result = DAYS(end_date, start_date);
        break;
    }
    return result;
  }
  function DATEVALUE(date_text) {
    if (typeof date_text !== "string") {
      return value;
    }
    const date = Date.parse(date_text);
    if (isNaN(date)) {
      return value;
    }
    return new Date(date_text);
  }
  function DAY(serial_number) {
    const date = parseDate(serial_number);
    if (date instanceof Error) {
      return date;
    }
    return date.getDate();
  }
  function startOfDay(date) {
    const newDate = new Date(date);
    newDate.setHours(0, 0, 0, 0);
    return newDate;
  }
  function DAYS(end_date, start_date) {
    end_date = parseDate(end_date);
    start_date = parseDate(start_date);
    if (end_date instanceof Error) {
      return end_date;
    }
    if (start_date instanceof Error) {
      return start_date;
    }
    return serial(startOfDay(end_date)) - serial(startOfDay(start_date));
  }
  function DAYS360(start_date, end_date, method) {
    method = parseBool(method || "false");
    start_date = parseDate(start_date);
    end_date = parseDate(end_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    if (end_date instanceof Error) {
      return end_date;
    }
    if (method instanceof Error) {
      return method;
    }
    const sm = start_date.getMonth();
    let em = end_date.getMonth();
    let sd, ed;
    if (method) {
      sd = start_date.getDate() === 31 ? 30 : start_date.getDate();
      ed = end_date.getDate() === 31 ? 30 : end_date.getDate();
    } else {
      const smd = new Date(start_date.getFullYear(), sm + 1, 0).getDate();
      const emd = new Date(end_date.getFullYear(), em + 1, 0).getDate();
      sd = start_date.getDate() === smd ? 30 : start_date.getDate();
      if (end_date.getDate() === emd) {
        if (sd < 30) {
          em++;
          ed = 1;
        } else {
          ed = 30;
        }
      } else {
        ed = end_date.getDate();
      }
    }
    return 360 * (end_date.getFullYear() - start_date.getFullYear()) + 30 * (em - sm) + (ed - sd);
  }
  function EDATE(start_date, months) {
    start_date = parseDate(start_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    if (isNaN(months)) {
      return value;
    }
    let storedDay = start_date.getDate();
    start_date.setDate(1);
    months = parseInt(months, 10);
    start_date.setMonth(start_date.getMonth() + months);
    let targetMonth = start_date.getMonth();
    if (storedDay > 28) {
      let daysInTargetMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][targetMonth];
      let targetYear = start_date.getFullYear();
      if (targetMonth === 1 && (targetYear % 4 === 0 && targetYear % 100 !== 0 || targetYear % 400 === 0)) {
        daysInTargetMonth = 29;
      }
      storedDay = Math.min(storedDay, daysInTargetMonth);
    }
    start_date.setDate(storedDay);
    return start_date;
  }
  function EOMONTH(start_date, months) {
    start_date = parseDate(start_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    if (isNaN(months)) {
      return value;
    }
    months = parseInt(months, 10);
    return new Date(start_date.getFullYear(), start_date.getMonth() + months + 1, 0);
  }
  function HOUR(serial_number) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    return serial_number.getHours();
  }
  function ISOWEEKNUM(date) {
    date = parseDate(date);
    if (date instanceof Error) {
      return date;
    }
    date = startOfDay(date);
    date.setDate(date.getDate() + 4 - (date.getDay() || 7));
    const yearStart = new Date(date.getFullYear(), 0, 1);
    return Math.ceil(((date - yearStart) / 864e5 + 1) / 7);
  }
  function MINUTE(serial_number) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    return serial_number.getMinutes();
  }
  function MONTH(serial_number) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    return serial_number.getMonth() + 1;
  }
  function NETWORKDAYS(start_date, end_date, holidays) {
    return NETWORKDAYS.INTL(start_date, end_date, 1, holidays);
  }
  NETWORKDAYS.INTL = (start_date, end_date, weekend, holidays) => {
    start_date = parseDate(start_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    end_date = parseDate(end_date);
    if (end_date instanceof Error) {
      return end_date;
    }
    let isMask = false;
    const maskDays = [];
    const maskIndex = [1, 2, 3, 4, 5, 6, 0];
    const maskRegex = new RegExp("^[0|1]{7}$");
    if (weekend === void 0) {
      weekend = WEEKEND_TYPES[1];
    } else if (typeof weekend === "string" && maskRegex.test(weekend)) {
      isMask = true;
      weekend = weekend.split("");
      for (let i2 = 0; i2 < weekend.length; i2++) {
        if (weekend[i2] === "1") {
          maskDays.push(maskIndex[i2]);
        }
      }
    } else {
      weekend = WEEKEND_TYPES[weekend];
    }
    if (!(weekend instanceof Array)) {
      return value;
    }
    if (holidays === void 0) {
      holidays = [];
    } else if (!(holidays instanceof Array)) {
      holidays = [holidays];
    }
    for (let i2 = 0; i2 < holidays.length; i2++) {
      const h = parseDate(holidays[i2]);
      if (h instanceof Error) {
        return h;
      }
      holidays[i2] = h;
    }
    const days = Math.round((end_date - start_date) / (1e3 * 60 * 60 * 24)) + 1;
    let total = days;
    const day = start_date;
    for (let i2 = 0; i2 < days; i2++) {
      const d = new Date().getTimezoneOffset() > 0 ? day.getUTCDay() : day.getDay();
      let dec2 = isMask ? maskDays.includes(d) : d === weekend[0] || d === weekend[1];
      for (let j = 0; j < holidays.length; j++) {
        const holiday = holidays[j];
        if (holiday.getDate() === day.getDate() && holiday.getMonth() === day.getMonth() && holiday.getFullYear() === day.getFullYear()) {
          dec2 = true;
          break;
        }
      }
      if (dec2) {
        total--;
      }
      day.setDate(day.getDate() + 1);
    }
    return total;
  };
  function NOW() {
    return new Date();
  }
  function SECOND(serial_number) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    return serial_number.getSeconds();
  }
  function TIME(hour, minute, second) {
    hour = parseNumber(hour);
    minute = parseNumber(minute);
    second = parseNumber(second);
    if (anyIsError(hour, minute, second)) {
      return value;
    }
    if (hour < 0 || minute < 0 || second < 0) {
      return num;
    }
    return (3600 * hour + 60 * minute + second) / 86400;
  }
  function TIMEVALUE(time_text) {
    time_text = parseDate(time_text);
    if (time_text instanceof Error) {
      return time_text;
    }
    return (3600 * time_text.getHours() + 60 * time_text.getMinutes() + time_text.getSeconds()) / 86400;
  }
  function TODAY() {
    return startOfDay(new Date());
  }
  function WEEKDAY(serial_number, return_type) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    if (return_type === void 0) {
      return_type = 1;
    }
    const day = serial_number.getDay();
    return WEEK_TYPES[return_type][day];
  }
  function WEEKNUM(serial_number, return_type) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    if (return_type === void 0) {
      return_type = 1;
    }
    if (return_type === 21) {
      return ISOWEEKNUM(serial_number);
    }
    const week_start = WEEK_STARTS[return_type];
    let jan = new Date(serial_number.getFullYear(), 0, 1);
    const inc = jan.getDay() < week_start ? 1 : 0;
    jan -= Math.abs(jan.getDay() - week_start) * 24 * 60 * 60 * 1e3;
    return Math.floor((serial_number - jan) / (1e3 * 60 * 60 * 24) / 7 + 1) + inc;
  }
  function WORKDAY(start_date, days, holidays) {
    return WORKDAY.INTL(start_date, days, 1, holidays);
  }
  WORKDAY.INTL = (start_date, days, weekend, holidays) => {
    start_date = parseDate(start_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    days = parseNumber(days);
    if (days instanceof Error) {
      return days;
    }
    if (weekend === void 0) {
      weekend = WEEKEND_TYPES[1];
    } else {
      weekend = WEEKEND_TYPES[weekend];
    }
    if (!(weekend instanceof Array)) {
      return value;
    }
    if (holidays === void 0) {
      holidays = [];
    } else if (!(holidays instanceof Array)) {
      holidays = [holidays];
    }
    for (let i2 = 0; i2 < holidays.length; i2++) {
      const h = parseDate(holidays[i2]);
      if (h instanceof Error) {
        return h;
      }
      holidays[i2] = h;
    }
    let d = 0;
    const sign = Math.sign(days);
    while (d < days * sign) {
      start_date.setDate(start_date.getDate() + sign);
      const day = start_date.getDay();
      if (day === weekend[0] || day === weekend[1]) {
        continue;
      }
      for (let j = 0; j < holidays.length; j++) {
        const holiday = holidays[j];
        if (holiday.getDate() === start_date.getDate() && holiday.getMonth() === start_date.getMonth() && holiday.getFullYear() === start_date.getFullYear()) {
          d--;
          break;
        }
      }
      d++;
    }
    if (start_date.getFullYear() < 1900) {
      return value;
    }
    return start_date;
  };
  function YEAR(serial_number) {
    serial_number = parseDate(serial_number);
    if (serial_number instanceof Error) {
      return serial_number;
    }
    return serial_number.getFullYear();
  }
  function isLeapYear(year) {
    return new Date(year, 1, 29).getMonth() === 1;
  }
  function daysBetween(start_date, end_date) {
    return Math.ceil((end_date - start_date) / 1e3 / 60 / 60 / 24);
  }
  function YEARFRAC(start_date, end_date, basis) {
    start_date = parseDate(start_date);
    if (start_date instanceof Error) {
      return start_date;
    }
    end_date = parseDate(end_date);
    if (end_date instanceof Error) {
      return end_date;
    }
    basis = basis || 0;
    let sd = start_date.getDate();
    const sm = start_date.getMonth() + 1;
    const sy = start_date.getFullYear();
    let ed = end_date.getDate();
    const em = end_date.getMonth() + 1;
    const ey = end_date.getFullYear();
    switch (basis) {
      case 0:
        if (sd === 31 && ed === 31) {
          sd = 30;
          ed = 30;
        } else if (sd === 31) {
          sd = 30;
        } else if (sd === 30 && ed === 31) {
          ed = 30;
        }
        return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360;
      case 1: {
        const feb29Between = (date1, date2) => {
          const year1 = date1.getFullYear();
          const mar1year1 = new Date(year1, 2, 1);
          if (isLeapYear(year1) && date1 < mar1year1 && date2 >= mar1year1) {
            return true;
          }
          const year2 = date2.getFullYear();
          const mar1year2 = new Date(year2, 2, 1);
          return isLeapYear(year2) && date2 >= mar1year2 && date1 < mar1year2;
        };
        let ylength = 365;
        if (sy === ey || sy + 1 === ey && (sm > em || sm === em && sd >= ed)) {
          if (sy === ey && isLeapYear(sy) || feb29Between(start_date, end_date) || em === 1 && ed === 29) {
            ylength = 366;
          }
          return daysBetween(start_date, end_date) / ylength;
        }
        const years = ey - sy + 1;
        const days = (new Date(ey + 1, 0, 1) - new Date(sy, 0, 1)) / 1e3 / 60 / 60 / 24;
        const average = days / years;
        return daysBetween(start_date, end_date) / average;
      }
      case 2:
        return daysBetween(start_date, end_date) / 360;
      case 3:
        return daysBetween(start_date, end_date) / 365;
      case 4:
        return (ed + em * 30 + ey * 360 - (sd + sm * 30 + sy * 360)) / 360;
    }
  }
  function serial(date) {
    const addOn = date > -22038912e5 ? 2 : 1;
    return Math.ceil((date - d1900) / 864e5) + addOn;
  }
  function ASC() {
    throw new Error("ASC is not implemented");
  }
  function BAHTTEXT() {
    throw new Error("BAHTTEXT is not implemented");
  }
  function CHAR(number2) {
    number2 = parseNumber(number2);
    if (number2 === 0) {
      return value;
    }
    if (number2 instanceof Error) {
      return number2;
    }
    return String.fromCharCode(number2);
  }
  function CLEAN(text) {
    if (anyIsError(text)) {
      return text;
    }
    text = text || "";
    const re = /[\0-\x1F]/g;
    return text.replace(re, "");
  }
  function CODE(text) {
    if (anyIsError(text)) {
      return text;
    }
    text = text || "";
    let result = text.charCodeAt(0);
    if (isNaN(result)) {
      result = value;
    }
    return result;
  }
  function CONCATENATE() {
    const args = flatten$1(arguments);
    const someError = anyError.apply(void 0, args);
    if (someError) {
      return someError;
    }
    let trueFound = 0;
    while ((trueFound = args.indexOf(true)) > -1) {
      args[trueFound] = "TRUE";
    }
    let falseFound = 0;
    while ((falseFound = args.indexOf(false)) > -1) {
      args[falseFound] = "FALSE";
    }
    return args.join("");
  }
  const CONCAT = CONCATENATE;
  function DBCS() {
    throw new Error("DBCS is not implemented");
  }
  function DOLLAR(number2, decimals = 2) {
    number2 = parseNumber(number2);
    if (isNaN(number2)) {
      return value;
    }
    number2 = ROUND(number2, decimals);
    const options = {
      style: "currency",
      currency: "USD",
      minimumFractionDigits: decimals >= 0 ? decimals : 0,
      maximumFractionDigits: decimals >= 0 ? decimals : 0
    };
    const formattedNumber = number2.toLocaleString("en-US", options);
    if (number2 < 0) {
      return "$(" + formattedNumber.slice(2) + ")";
    }
    return formattedNumber;
  }
  function EXACT(text1, text2) {
    if (arguments.length !== 2) {
      return na;
    }
    const someError = anyError(text1, text2);
    if (someError) {
      return someError;
    }
    text1 = parseString(text1);
    text2 = parseString(text2);
    return text1 === text2;
  }
  function FIND(find_text, within_text, start_num) {
    if (arguments.length < 2) {
      return na;
    }
    find_text = parseString(find_text);
    within_text = parseString(within_text);
    start_num = start_num === void 0 ? 0 : start_num;
    const found_index = within_text.indexOf(find_text, start_num - 1);
    if (found_index === -1) {
      return value;
    }
    return found_index + 1;
  }
  function FIXED(number2, decimals = 2, no_commas = false) {
    number2 = parseNumber(number2);
    if (isNaN(number2)) {
      return value;
    }
    decimals = parseNumber(decimals);
    if (isNaN(decimals)) {
      return value;
    }
    if (decimals < 0) {
      const factor = Math.pow(10, -decimals);
      number2 = Math.round(number2 / factor) * factor;
    } else {
      number2 = number2.toFixed(decimals);
    }
    if (no_commas) {
      number2 = number2.toString().replace(/,/g, "");
    } else {
      const parts = number2.toString().split(".");
      parts[0] = parts[0].replace(/\B(?=(\d{3})+$)/g, ",");
      number2 = parts.join(".");
    }
    return number2;
  }
  function LEFT(text, num_chars) {
    const someError = anyError(text, num_chars);
    if (someError) {
      return someError;
    }
    text = parseString(text);
    num_chars = num_chars === void 0 ? 1 : num_chars;
    num_chars = parseNumber(num_chars);
    if (num_chars instanceof Error || typeof text !== "string") {
      return value;
    }
    return text.substring(0, num_chars);
  }
  function LEN(text) {
    if (arguments.length === 0) {
      return error;
    }
    if (text instanceof Error) {
      return text;
    }
    if (Array.isArray(text)) {
      return value;
    }
    const textAsString = parseString(text);
    return textAsString.length;
  }
  function LOWER(text) {
    if (arguments.length !== 1) {
      return value;
    }
    text = parseString(text);
    if (anyIsError(text)) {
      return text;
    }
    return text.toLowerCase();
  }
  function MID(text, start_num, num_chars) {
    if (start_num === void 0 || start_num === null) {
      return value;
    }
    start_num = parseNumber(start_num);
    num_chars = parseNumber(num_chars);
    if (anyIsError(start_num, num_chars) || typeof text !== "string") {
      return num_chars;
    }
    const begin = start_num - 1;
    const end = begin + num_chars;
    return text.substring(begin, end);
  }
  function NUMBERVALUE(text, decimal_separator, group_separator) {
    text = isDefined(text) ? text : "";
    if (typeof text === "number") {
      return text;
    }
    if (typeof text !== "string") {
      return na;
    }
    decimal_separator = typeof decimal_separator === "undefined" ? "." : decimal_separator;
    group_separator = typeof group_separator === "undefined" ? "," : group_separator;
    return Number(text.replace(decimal_separator, ".").replace(group_separator, ""));
  }
  function PRONETIC() {
    throw new Error("PRONETIC is not implemented");
  }
  function PROPER(text) {
    if (anyIsError(text)) {
      return text;
    }
    if (isNaN(text) && typeof text === "number") {
      return value;
    }
    text = parseString(text);
    return text.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
  }
  function REPLACE(old_text, num_chars, length, new_text) {
    num_chars = parseNumber(num_chars);
    length = parseNumber(length);
    if (anyIsError(num_chars, length) || typeof old_text !== "string" || typeof new_text !== "string") {
      return value;
    }
    return old_text.substr(0, num_chars - 1) + new_text + old_text.substr(num_chars - 1 + length);
  }
  function REPT(text, number_times) {
    const someError = anyError(text, number_times);
    if (someError) {
      return someError;
    }
    text = parseString(text);
    number_times = parseNumber(number_times);
    if (number_times instanceof Error) {
      return number_times;
    }
    return new Array(number_times + 1).join(text);
  }
  function RIGHT(text, num_chars) {
    const someError = anyError(text, num_chars);
    if (someError) {
      return someError;
    }
    text = parseString(text);
    num_chars = num_chars === void 0 ? 1 : num_chars;
    num_chars = parseNumber(num_chars);
    if (num_chars instanceof Error) {
      return num_chars;
    }
    return text.substring(text.length - num_chars);
  }
  function SEARCH(find_text, within_text, start_num) {
    let foundAt;
    if (typeof find_text !== "string" || typeof within_text !== "string") {
      return value;
    }
    start_num = start_num === void 0 ? 0 : start_num;
    foundAt = within_text.toLowerCase().indexOf(find_text.toLowerCase(), start_num - 1) + 1;
    return foundAt === 0 ? value : foundAt;
  }
  function SUBSTITUTE(text, old_text, new_text, instance_num) {
    if (arguments.length < 3) {
      return na;
    }
    if (!text || !old_text) {
      return text;
    } else if (instance_num === void 0) {
      return text.split(old_text).join(new_text);
    } else {
      instance_num = Math.floor(Number(instance_num));
      if (Number.isNaN(instance_num) || instance_num <= 0) {
        return value;
      }
      let index2 = 0;
      let i2 = 0;
      while (index2 > -1 && text.indexOf(old_text, index2) > -1) {
        index2 = text.indexOf(old_text, index2 + 1);
        i2++;
        if (index2 > -1 && i2 === instance_num) {
          return text.substring(0, index2) + new_text + text.substring(index2 + old_text.length);
        }
      }
      return text;
    }
  }
  function T(value2) {
    if (value2 instanceof Error) {
      return value2;
    }
    return typeof value2 === "string" ? value2 : "";
  }
  function TEXT(value$1, format_text) {
    if (value$1 === void 0 || value$1 instanceof Error || format_text instanceof Error) {
      return na;
    }
    if (format_text === void 0 || format_text === null) {
      return "";
    }
    if (typeof format_text === "number") {
      return String(format_text);
    }
    if (typeof format_text !== "string") {
      return value;
    }
    const currencySymbol = format_text.startsWith("$") ? "$" : "";
    const isPercent = format_text.endsWith("%");
    format_text = format_text.replace(/%/g, "").replace(/\$/g, "");
    const decimalPlaces = format_text.split(".")[1].match(/0/g).length;
    const noCommas = !format_text.includes(",");
    if (isPercent) {
      value$1 = value$1 * 100;
    }
    value$1 = FIXED(value$1, decimalPlaces, noCommas);
    if (value$1.startsWith("-")) {
      value$1 = value$1.replace("-", "");
      value$1 = "-" + currencySymbol + value$1;
    } else {
      value$1 = currencySymbol + value$1;
    }
    if (isPercent) {
      value$1 = value$1 + "%";
    }
    return value$1;
  }
  function TEXTJOIN(delimiter, ignore_empty, ...args) {
    if (typeof ignore_empty !== "boolean") {
      ignore_empty = parseBool(ignore_empty);
    }
    if (arguments.length < 3) {
      return na;
    }
    delimiter = delimiter !== null && delimiter !== void 0 ? delimiter : "";
    let flatArgs = flatten$1(args);
    let textToJoin = ignore_empty ? flatArgs.filter((text) => text) : flatArgs;
    if (Array.isArray(delimiter)) {
      delimiter = flatten$1(delimiter);
      let chunks = textToJoin.map((item) => [item]);
      let index2 = 0;
      for (let i2 = 0; i2 < chunks.length - 1; i2++) {
        chunks[i2].push(delimiter[index2]);
        index2++;
        if (index2 === delimiter.length) {
          index2 = 0;
        }
      }
      textToJoin = flatten$1(chunks);
      return textToJoin.join("");
    }
    return textToJoin.join(delimiter);
  }
  function TRIM(text) {
    text = parseString(text);
    if (text instanceof Error) {
      return text;
    }
    return text.replace(/\s+/g, " ").trim();
  }
  const UNICHAR = CHAR;
  const UNICODE = CODE;
  function UPPER(text) {
    text = parseString(text);
    if (text instanceof Error) {
      return text;
    }
    return text.toUpperCase();
  }
  function VALUE(text) {
    const anyError$1 = anyError(text);
    if (anyError$1) {
      return anyError$1;
    }
    if (typeof text === "number") {
      return text;
    }
    if (!isDefined(text)) {
      text = "";
    }
    if (typeof text !== "string") {
      return value;
    }
    const isPercent = /(%)$/.test(text) || /^(%)/.test(text);
    text = text.replace(/^[^0-9-]{0,3}/, "");
    text = text.replace(/[^0-9]{0,3}$/, "");
    text = text.replace(/[ ,]/g, "");
    if (text === "") {
      return 0;
    }
    let output = Number(text);
    if (isNaN(output)) {
      return value;
    }
    output = output || 0;
    if (isPercent) {
      output = output * 0.01;
    }
    return output;
  }
  function isValidBinaryNumber(number2) {
    return /^[01]{1,10}$/.test(number2);
  }
  function BESSELI(x, n) {
    x = parseNumber(x);
    n = parseNumber(n);
    if (anyIsError(x, n)) {
      return value;
    }
    return bessel.besseli(x, n);
  }
  function BESSELJ(x, n) {
    x = parseNumber(x);
    n = parseNumber(n);
    if (anyIsError(x, n)) {
      return value;
    }
    return bessel.besselj(x, n);
  }
  function BESSELK(x, n) {
    x = parseNumber(x);
    n = parseNumber(n);
    if (anyIsError(x, n)) {
      return value;
    }
    return bessel.besselk(x, n);
  }
  function BESSELY(x, n) {
    x = parseNumber(x);
    n = parseNumber(n);
    if (anyIsError(x, n)) {
      return value;
    }
    return bessel.bessely(x, n);
  }
  function BIN2DEC(number2) {
    if (!isValidBinaryNumber(number2)) {
      return num;
    }
    const result = parseInt(number2, 2);
    const stringified = number2.toString();
    if (stringified.length === 10 && stringified.substring(0, 1) === "1") {
      return parseInt(stringified.substring(1), 2) - 512;
    } else {
      return result;
    }
  }
  function BIN2HEX(number2, places) {
    if (!isValidBinaryNumber(number2)) {
      return num;
    }
    const stringified = number2.toString();
    if (stringified.length === 10 && stringified.substring(0, 1) === "1") {
      return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);
    }
    const result = parseInt(number2, 2).toString(16);
    if (places === void 0) {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function BIN2OCT(number2, places) {
    if (!isValidBinaryNumber(number2)) {
      return num;
    }
    const stringified = number2.toString();
    if (stringified.length === 10 && stringified.substring(0, 1) === "1") {
      return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);
    }
    const result = parseInt(number2, 2).toString(8);
    if (places === void 0) {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function BITAND(number1, number2) {
    number1 = parseNumber(number1);
    number2 = parseNumber(number2);
    if (anyIsError(number1, number2)) {
      return value;
    }
    if (number1 < 0 || number2 < 0) {
      return num;
    }
    if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {
      return num;
    }
    if (number1 > 281474976710655 || number2 > 281474976710655) {
      return num;
    }
    return number1 & number2;
  }
  function BITLSHIFT(number2, shift_amount) {
    number2 = parseNumber(number2);
    shift_amount = parseNumber(shift_amount);
    if (anyIsError(number2, shift_amount)) {
      return value;
    }
    if (number2 < 0) {
      return num;
    }
    if (Math.floor(number2) !== number2) {
      return num;
    }
    if (number2 > 281474976710655) {
      return num;
    }
    if (Math.abs(shift_amount) > 53) {
      return num;
    }
    return shift_amount >= 0 ? number2 << shift_amount : number2 >> -shift_amount;
  }
  function BITOR(number1, number2) {
    number1 = parseNumber(number1);
    number2 = parseNumber(number2);
    if (anyIsError(number1, number2)) {
      return value;
    }
    if (number1 < 0 || number2 < 0) {
      return num;
    }
    if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {
      return num;
    }
    if (number1 > 281474976710655 || number2 > 281474976710655) {
      return num;
    }
    return number1 | number2;
  }
  function BITRSHIFT(number2, shift_amount) {
    number2 = parseNumber(number2);
    shift_amount = parseNumber(shift_amount);
    if (anyIsError(number2, shift_amount)) {
      return value;
    }
    if (number2 < 0) {
      return num;
    }
    if (Math.floor(number2) !== number2) {
      return num;
    }
    if (number2 > 281474976710655) {
      return num;
    }
    if (Math.abs(shift_amount) > 53) {
      return num;
    }
    return shift_amount >= 0 ? number2 >> shift_amount : number2 << -shift_amount;
  }
  function BITXOR(number1, number2) {
    number1 = parseNumber(number1);
    number2 = parseNumber(number2);
    if (anyIsError(number1, number2)) {
      return value;
    }
    if (number1 < 0 || number2 < 0) {
      return num;
    }
    if (Math.floor(number1) !== number1 || Math.floor(number2) !== number2) {
      return num;
    }
    if (number1 > 281474976710655 || number2 > 281474976710655) {
      return num;
    }
    return number1 ^ number2;
  }
  function COMPLEX(real_num, i_num, suffix) {
    real_num = parseNumber(real_num);
    i_num = parseNumber(i_num);
    if (anyIsError(real_num, i_num)) {
      return real_num;
    }
    suffix = suffix === void 0 ? "i" : suffix;
    if (suffix !== "i" && suffix !== "j") {
      return value;
    }
    if (real_num === 0 && i_num === 0) {
      return 0;
    } else if (real_num === 0) {
      return i_num === 1 ? suffix : i_num.toString() + suffix;
    } else if (i_num === 0) {
      return real_num.toString();
    } else {
      const sign = i_num > 0 ? "+" : "";
      return real_num.toString() + sign + (i_num === 1 ? suffix : i_num.toString() + suffix);
    }
  }
  function CONVERT(number2, from_unit, to_unit) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    const units = [
      ["a.u. of action", "?", null, "action", false, false, 105457168181818e-48],
      ["a.u. of charge", "e", null, "electric_charge", false, false, 160217653141414e-33],
      ["a.u. of energy", "Eh", null, "energy", false, false, 435974417757576e-32],
      ["a.u. of length", "a?", null, "length", false, false, 529177210818182e-25],
      ["a.u. of mass", "m?", null, "mass", false, false, 910938261616162e-45],
      ["a.u. of time", "?/Eh", null, "time", false, false, 241888432650516e-31],
      ["admiralty knot", "admkn", null, "speed", false, true, 0.514773333],
      ["ampere", "A", null, "electric_current", true, false, 1],
      ["ampere per meter", "A/m", null, "magnetic_field_intensity", true, false, 1],
      ["\xE5ngstr\xF6m", "\xC5", ["ang"], "length", false, true, 1e-10],
      ["are", "ar", null, "area", false, true, 100],
      ["astronomical unit", "ua", null, "length", false, false, 149597870691667e-25],
      ["bar", "bar", null, "pressure", false, false, 1e5],
      ["barn", "b", null, "area", false, false, 1e-28],
      ["becquerel", "Bq", null, "radioactivity", true, false, 1],
      ["bit", "bit", ["b"], "information", false, true, 1],
      ["btu", "BTU", ["btu"], "energy", false, true, 1055.05585262],
      ["byte", "byte", null, "information", false, true, 8],
      ["candela", "cd", null, "luminous_intensity", true, false, 1],
      ["candela per square metre", "cd/m?", null, "luminance", true, false, 1],
      ["coulomb", "C", null, "electric_charge", true, false, 1],
      ["cubic \xE5ngstr\xF6m", "ang3", ["ang^3"], "volume", false, true, 1e-30],
      ["cubic foot", "ft3", ["ft^3"], "volume", false, true, 0.028316846592],
      ["cubic inch", "in3", ["in^3"], "volume", false, true, 16387064e-12],
      ["cubic light-year", "ly3", ["ly^3"], "volume", false, true, 846786664623715e-61],
      ["cubic metre", "m?", null, "volume", true, true, 1],
      ["cubic mile", "mi3", ["mi^3"], "volume", false, true, 416818182544058e-5],
      ["cubic nautical mile", "Nmi3", ["Nmi^3"], "volume", false, true, 6352182208],
      ["cubic Pica", "Pica3", ["Picapt3", "Pica^3", "Picapt^3"], "volume", false, true, 758660370370369e-22],
      ["cubic yard", "yd3", ["yd^3"], "volume", false, true, 0.764554857984],
      ["cup", "cup", null, "volume", false, true, 2365882365e-13],
      ["dalton", "Da", ["u"], "mass", false, false, 166053886282828e-41],
      ["day", "d", ["day"], "time", false, true, 86400],
      ["degree", "\xB0", null, "angle", false, false, 0.0174532925199433],
      ["degrees Rankine", "Rank", null, "temperature", false, true, 0.555555555555556],
      ["dyne", "dyn", ["dy"], "force", false, true, 1e-5],
      ["electronvolt", "eV", ["ev"], "energy", false, true, 1.60217656514141],
      ["ell", "ell", null, "length", false, true, 1.143],
      ["erg", "erg", ["e"], "energy", false, true, 1e-7],
      ["farad", "F", null, "electric_capacitance", true, false, 1],
      ["fluid ounce", "oz", null, "volume", false, true, 295735295625e-16],
      ["foot", "ft", null, "length", false, true, 0.3048],
      ["foot-pound", "flb", null, "energy", false, true, 1.3558179483314],
      ["gal", "Gal", null, "acceleration", false, false, 0.01],
      ["gallon", "gal", null, "volume", false, true, 0.003785411784],
      ["gauss", "G", ["ga"], "magnetic_flux_density", false, true, 1],
      ["grain", "grain", null, "mass", false, true, 647989e-10],
      ["gram", "g", null, "mass", false, true, 1e-3],
      ["gray", "Gy", null, "absorbed_dose", true, false, 1],
      ["gross registered ton", "GRT", ["regton"], "volume", false, true, 2.8316846592],
      ["hectare", "ha", null, "area", false, true, 1e4],
      ["henry", "H", null, "inductance", true, false, 1],
      ["hertz", "Hz", null, "frequency", true, false, 1],
      ["horsepower", "HP", ["h"], "power", false, true, 745.69987158227],
      ["horsepower-hour", "HPh", ["hh", "hph"], "energy", false, true, 2684519538e-3],
      ["hour", "h", ["hr"], "time", false, true, 3600],
      ["imperial gallon (U.K.)", "uk_gal", null, "volume", false, true, 454609e-8],
      ["imperial hundredweight", "lcwt", ["uk_cwt", "hweight"], "mass", false, true, 50.802345],
      ["imperial quart (U.K)", "uk_qt", null, "volume", false, true, 0.0011365225],
      ["imperial ton", "brton", ["uk_ton", "LTON"], "mass", false, true, 1016.046909],
      ["inch", "in", null, "length", false, true, 0.0254],
      ["international acre", "uk_acre", null, "area", false, true, 4046.8564224],
      ["IT calorie", "cal", null, "energy", false, true, 4.1868],
      ["joule", "J", null, "energy", true, true, 1],
      ["katal", "kat", null, "catalytic_activity", true, false, 1],
      ["kelvin", "K", ["kel"], "temperature", true, true, 1],
      ["kilogram", "kg", null, "mass", true, true, 1],
      ["knot", "kn", null, "speed", false, true, 0.514444444444444],
      ["light-year", "ly", null, "length", false, true, 9460730472580800],
      ["litre", "L", ["l", "lt"], "volume", false, true, 1e-3],
      ["lumen", "lm", null, "luminous_flux", true, false, 1],
      ["lux", "lx", null, "illuminance", true, false, 1],
      ["maxwell", "Mx", null, "magnetic_flux", false, false, 1e-18],
      ["measurement ton", "MTON", null, "volume", false, true, 1.13267386368],
      ["meter per hour", "m/h", ["m/hr"], "speed", false, true, 27777777777778e-17],
      ["meter per second", "m/s", ["m/sec"], "speed", true, true, 1],
      ["meter per second squared", "m?s??", null, "acceleration", true, false, 1],
      ["parsec", "pc", ["parsec"], "length", false, true, 30856775814671900],
      ["meter squared per second", "m?/s", null, "kinematic_viscosity", true, false, 1],
      ["metre", "m", null, "length", true, true, 1],
      ["miles per hour", "mph", null, "speed", false, true, 0.44704],
      ["millimetre of mercury", "mmHg", null, "pressure", false, false, 133.322],
      ["minute", "?", null, "angle", false, false, 290888208665722e-18],
      ["minute", "min", ["mn"], "time", false, true, 60],
      ["modern teaspoon", "tspm", null, "volume", false, true, 5e-6],
      ["mole", "mol", null, "amount_of_substance", true, false, 1],
      ["morgen", "Morgen", null, "area", false, true, 2500],
      ["n.u. of action", "?", null, "action", false, false, 105457168181818e-48],
      ["n.u. of mass", "m?", null, "mass", false, false, 910938261616162e-45],
      ["n.u. of speed", "c?", null, "speed", false, false, 299792458],
      ["n.u. of time", "?/(me?c??)", null, "time", false, false, 128808866778687e-35],
      ["nautical mile", "M", ["Nmi"], "length", false, true, 1852],
      ["newton", "N", null, "force", true, true, 1],
      ["\u0153rsted", "Oe ", null, "magnetic_field_intensity", false, false, 79.5774715459477],
      ["ohm", "\u03A9", null, "electric_resistance", true, false, 1],
      ["ounce mass", "ozm", null, "mass", false, true, 0.028349523125],
      ["pascal", "Pa", null, "pressure", true, false, 1],
      ["pascal second", "Pa?s", null, "dynamic_viscosity", true, false, 1],
      ["pferdest\xE4rke", "PS", null, "power", false, true, 735.49875],
      ["phot", "ph", null, "illuminance", false, false, 1e-4],
      ["pica (1/6 inch)", "pica", null, "length", false, true, 35277777777778e-17],
      ["pica (1/72 inch)", "Pica", ["Picapt"], "length", false, true, 0.00423333333333333],
      ["poise", "P", null, "dynamic_viscosity", false, false, 0.1],
      ["pond", "pond", null, "force", false, true, 980665e-8],
      ["pound force", "lbf", null, "force", false, true, 4.4482216152605],
      ["pound mass", "lbm", null, "mass", false, true, 0.45359237],
      ["quart", "qt", null, "volume", false, true, 946352946e-12],
      ["radian", "rad", null, "angle", true, false, 1],
      ["second", "?", null, "angle", false, false, 484813681109536e-20],
      ["second", "s", ["sec"], "time", true, true, 1],
      ["short hundredweight", "cwt", ["shweight"], "mass", false, true, 45.359237],
      ["siemens", "S", null, "electrical_conductance", true, false, 1],
      ["sievert", "Sv", null, "equivalent_dose", true, false, 1],
      ["slug", "sg", null, "mass", false, true, 14.59390294],
      ["square \xE5ngstr\xF6m", "ang2", ["ang^2"], "area", false, true, 1e-20],
      ["square foot", "ft2", ["ft^2"], "area", false, true, 0.09290304],
      ["square inch", "in2", ["in^2"], "area", false, true, 64516e-8],
      ["square light-year", "ly2", ["ly^2"], "area", false, true, 895054210748189e17],
      ["square meter", "m?", null, "area", true, true, 1],
      ["square mile", "mi2", ["mi^2"], "area", false, true, 2589988110336e-6],
      ["square nautical mile", "Nmi2", ["Nmi^2"], "area", false, true, 3429904],
      ["square Pica", "Pica2", ["Picapt2", "Pica^2", "Picapt^2"], "area", false, true, 1792111111111e-17],
      ["square yard", "yd2", ["yd^2"], "area", false, true, 0.83612736],
      ["statute mile", "mi", null, "length", false, true, 1609.344],
      ["steradian", "sr", null, "solid_angle", true, false, 1],
      ["stilb", "sb", null, "luminance", false, false, 1e-4],
      ["stokes", "St", null, "kinematic_viscosity", false, false, 1e-4],
      ["stone", "stone", null, "mass", false, true, 6.35029318],
      ["tablespoon", "tbs", null, "volume", false, true, 147868e-10],
      ["teaspoon", "tsp", null, "volume", false, true, 492892e-11],
      ["tesla", "T", null, "magnetic_flux_density", true, true, 1],
      ["thermodynamic calorie", "c", null, "energy", false, true, 4.184],
      ["ton", "ton", null, "mass", false, true, 907.18474],
      ["tonne", "t", null, "mass", false, false, 1e3],
      ["U.K. pint", "uk_pt", null, "volume", false, true, 56826125e-11],
      ["U.S. bushel", "bushel", null, "volume", false, true, 0.03523907],
      ["U.S. oil barrel", "barrel", null, "volume", false, true, 0.158987295],
      ["U.S. pint", "pt", ["us_pt"], "volume", false, true, 473176473e-12],
      ["U.S. survey mile", "survey_mi", null, "length", false, true, 1609.347219],
      ["U.S. survey/statute acre", "us_acre", null, "area", false, true, 4046.87261],
      ["volt", "V", null, "voltage", true, false, 1],
      ["watt", "W", null, "power", true, true, 1],
      ["watt-hour", "Wh", ["wh"], "energy", false, true, 3600],
      ["weber", "Wb", null, "magnetic_flux", true, false, 1],
      ["yard", "yd", null, "length", false, true, 0.9144],
      ["year", "yr", null, "time", false, true, 31557600]
    ];
    const binary_prefixes = {
      Yi: ["yobi", 80, 12089258196146292e8, "Yi", "yotta"],
      Zi: ["zebi", 70, 11805916207174113e5, "Zi", "zetta"],
      Ei: ["exbi", 60, 1152921504606847e3, "Ei", "exa"],
      Pi: ["pebi", 50, 1125899906842624, "Pi", "peta"],
      Ti: ["tebi", 40, 1099511627776, "Ti", "tera"],
      Gi: ["gibi", 30, 1073741824, "Gi", "giga"],
      Mi: ["mebi", 20, 1048576, "Mi", "mega"],
      ki: ["kibi", 10, 1024, "ki", "kilo"]
    };
    const unit_prefixes = {
      Y: ["yotta", 1e24, "Y"],
      Z: ["zetta", 1e21, "Z"],
      E: ["exa", 1e18, "E"],
      P: ["peta", 1e15, "P"],
      T: ["tera", 1e12, "T"],
      G: ["giga", 1e9, "G"],
      M: ["mega", 1e6, "M"],
      k: ["kilo", 1e3, "k"],
      h: ["hecto", 100, "h"],
      e: ["dekao", 10, "e"],
      d: ["deci", 0.1, "d"],
      c: ["centi", 0.01, "c"],
      m: ["milli", 1e-3, "m"],
      u: ["micro", 1e-6, "u"],
      n: ["nano", 1e-9, "n"],
      p: ["pico", 1e-12, "p"],
      f: ["femto", 1e-15, "f"],
      a: ["atto", 1e-18, "a"],
      z: ["zepto", 1e-21, "z"],
      y: ["yocto", 1e-24, "y"]
    };
    let from = null;
    let to = null;
    let base_from_unit = from_unit;
    let base_to_unit = to_unit;
    let from_multiplier = 1;
    let to_multiplier = 1;
    let alt;
    for (let i2 = 0; i2 < units.length; i2++) {
      alt = units[i2][2] === null ? [] : units[i2][2];
      if (units[i2][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {
        from = units[i2];
      }
      if (units[i2][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {
        to = units[i2];
      }
    }
    if (from === null) {
      const from_binary_prefix = binary_prefixes[from_unit.substring(0, 2)];
      let from_unit_prefix = unit_prefixes[from_unit.substring(0, 1)];
      if (from_unit.substring(0, 2) === "da") {
        from_unit_prefix = ["dekao", 10, "da"];
      }
      if (from_binary_prefix) {
        from_multiplier = from_binary_prefix[2];
        base_from_unit = from_unit.substring(2);
      } else if (from_unit_prefix) {
        from_multiplier = from_unit_prefix[1];
        base_from_unit = from_unit.substring(from_unit_prefix[2].length);
      }
      for (let j = 0; j < units.length; j++) {
        alt = units[j][2] === null ? [] : units[j][2];
        if (units[j][1] === base_from_unit || alt.indexOf(base_from_unit) >= 0) {
          from = units[j];
        }
      }
    }
    if (to === null) {
      const to_binary_prefix = binary_prefixes[to_unit.substring(0, 2)];
      let to_unit_prefix = unit_prefixes[to_unit.substring(0, 1)];
      if (to_unit.substring(0, 2) === "da") {
        to_unit_prefix = ["dekao", 10, "da"];
      }
      if (to_binary_prefix) {
        to_multiplier = to_binary_prefix[2];
        base_to_unit = to_unit.substring(2);
      } else if (to_unit_prefix) {
        to_multiplier = to_unit_prefix[1];
        base_to_unit = to_unit.substring(to_unit_prefix[2].length);
      }
      for (let k = 0; k < units.length; k++) {
        alt = units[k][2] === null ? [] : units[k][2];
        if (units[k][1] === base_to_unit || alt.indexOf(base_to_unit) >= 0) {
          to = units[k];
        }
      }
    }
    if (from === null || to === null) {
      return na;
    }
    if (from[3] !== to[3]) {
      return na;
    }
    return number2 * from[6] * from_multiplier / (to[6] * to_multiplier);
  }
  function DEC2BIN(number2, places) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (!/^-?[0-9]{1,3}$/.test(number2) || number2 < -512 || number2 > 511) {
      return num;
    }
    if (number2 < 0) {
      return "1" + REPT("0", 9 - (512 + number2).toString(2).length) + (512 + number2).toString(2);
    }
    const result = parseInt(number2, 10).toString(2);
    if (typeof places === "undefined") {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function DEC2HEX(number2, places) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (!/^-?[0-9]{1,12}$/.test(number2) || number2 < -549755813888 || number2 > 549755813887) {
      return num;
    }
    if (number2 < 0) {
      return (1099511627776 + number2).toString(16);
    }
    const result = parseInt(number2, 10).toString(16);
    if (typeof places === "undefined") {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function DEC2OCT(number2, places) {
    number2 = parseNumber(number2);
    if (number2 instanceof Error) {
      return number2;
    }
    if (!/^-?[0-9]{1,9}$/.test(number2) || number2 < -536870912 || number2 > 536870911) {
      return num;
    }
    if (number2 < 0) {
      return (1073741824 + number2).toString(8);
    }
    const result = parseInt(number2, 10).toString(8);
    if (typeof places === "undefined") {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function DELTA(number1, number2) {
    number2 = number2 === void 0 ? 0 : number2;
    number1 = parseNumber(number1);
    number2 = parseNumber(number2);
    if (anyIsError(number1, number2)) {
      return value;
    }
    return number1 === number2 ? 1 : 0;
  }
  function ERF(lower_limit, upper_limit) {
    upper_limit = upper_limit === void 0 ? 0 : upper_limit;
    lower_limit = parseNumber(lower_limit);
    upper_limit = parseNumber(upper_limit);
    if (anyIsError(lower_limit, upper_limit)) {
      return value;
    }
    return jStat.erf(lower_limit);
  }
  ERF.PRECISE = () => {
    throw new Error("ERF.PRECISE is not implemented");
  };
  function ERFC(x) {
    if (isNaN(x)) {
      return value;
    }
    return jStat.erfc(x);
  }
  ERFC.PRECISE = () => {
    throw new Error("ERFC.PRECISE is not implemented");
  };
  function GESTEP(number2, step) {
    step = step || 0;
    number2 = parseNumber(number2);
    if (anyIsError(step, number2)) {
      return number2;
    }
    return number2 >= step ? 1 : 0;
  }
  function HEX2BIN(number2, places) {
    if (!/^[0-9A-Fa-f]{1,10}$/.test(number2)) {
      return num;
    }
    const negative = !!(number2.length === 10 && number2.substring(0, 1).toLowerCase() === "f");
    const decimal = negative ? parseInt(number2, 16) - 1099511627776 : parseInt(number2, 16);
    if (decimal < -512 || decimal > 511) {
      return num;
    }
    if (negative) {
      return "1" + REPT("0", 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);
    }
    const result = decimal.toString(2);
    if (places === void 0) {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function HEX2DEC(number2) {
    if (!/^[0-9A-Fa-f]{1,10}$/.test(number2)) {
      return num;
    }
    const decimal = parseInt(number2, 16);
    return decimal >= 549755813888 ? decimal - 1099511627776 : decimal;
  }
  function HEX2OCT(number2, places) {
    if (!/^[0-9A-Fa-f]{1,10}$/.test(number2)) {
      return num;
    }
    const decimal = parseInt(number2, 16);
    if (decimal > 536870911 && decimal < 1098974756864) {
      return num;
    }
    if (decimal >= 1098974756864) {
      return (decimal - 1098437885952).toString(8);
    }
    const result = decimal.toString(8);
    if (places === void 0) {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function IMABS(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2));
  }
  function IMAGINARY(inumber) {
    if (inumber === void 0 || inumber === true || inumber === false) {
      return value;
    }
    if (inumber === 0 || inumber === "0") {
      return 0;
    }
    if (["i", "j"].indexOf(inumber) >= 0) {
      return 1;
    }
    inumber = inumber + "";
    inumber = inumber.replace("+i", "+1i").replace("-i", "-1i").replace("+j", "+1j").replace("-j", "-1j");
    let plus2 = inumber.indexOf("+");
    let minus2 = inumber.indexOf("-");
    if (plus2 === 0) {
      plus2 = inumber.indexOf("+", 1);
    }
    if (minus2 === 0) {
      minus2 = inumber.indexOf("-", 1);
    }
    const last = inumber.substring(inumber.length - 1, inumber.length);
    const unit = last === "i" || last === "j";
    if (plus2 >= 0 || minus2 >= 0) {
      if (!unit) {
        return num;
      }
      if (plus2 >= 0) {
        return isNaN(inumber.substring(0, plus2)) || isNaN(inumber.substring(plus2 + 1, inumber.length - 1)) ? num : Number(inumber.substring(plus2 + 1, inumber.length - 1));
      } else {
        return isNaN(inumber.substring(0, minus2)) || isNaN(inumber.substring(minus2 + 1, inumber.length - 1)) ? num : -Number(inumber.substring(minus2 + 1, inumber.length - 1));
      }
    } else {
      if (unit) {
        return isNaN(inumber.substring(0, inumber.length - 1)) ? num : inumber.substring(0, inumber.length - 1);
      } else {
        return isNaN(inumber) ? num : 0;
      }
    }
  }
  function IMARGUMENT(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    if (x === 0 && y === 0) {
      return div0;
    }
    if (x === 0 && y > 0) {
      return Math.PI / 2;
    }
    if (x === 0 && y < 0) {
      return -Math.PI / 2;
    }
    if (y === 0 && x > 0) {
      return 0;
    }
    if (y === 0 && x < 0) {
      return -Math.PI;
    }
    if (x > 0) {
      return Math.atan(y / x);
    } else if (x < 0 && y >= 0) {
      return Math.atan(y / x) + Math.PI;
    } else {
      return Math.atan(y / x) - Math.PI;
    }
  }
  function IMCONJUGATE(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return y !== 0 ? COMPLEX(x, -y, unit) : inumber;
  }
  function IMCOS(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.cos(x) * (Math.exp(y) + Math.exp(-y)) / 2, -Math.sin(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);
  }
  function IMCOSH(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.cos(y) * (Math.exp(x) + Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) - Math.exp(-x)) / 2, unit);
  }
  function IMCOT(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    return IMDIV(IMCOS(inumber), IMSIN(inumber));
  }
  function IMDIV(inumber1, inumber2) {
    const a = IMREAL(inumber1);
    const b = IMAGINARY(inumber1);
    const c = IMREAL(inumber2);
    const d = IMAGINARY(inumber2);
    if (anyIsError(a, b, c, d)) {
      return value;
    }
    const unit1 = inumber1.substring(inumber1.length - 1);
    const unit2 = inumber2.substring(inumber2.length - 1);
    let unit = "i";
    if (unit1 === "j") {
      unit = "j";
    } else if (unit2 === "j") {
      unit = "j";
    }
    if (c === 0 && d === 0) {
      return num;
    }
    const den = c * c + d * d;
    return COMPLEX((a * c + b * d) / den, (b * c - a * d) / den, unit);
  }
  function IMEXP(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    const e = Math.exp(x);
    return COMPLEX(e * Math.cos(y), e * Math.sin(y), unit);
  }
  function IMLN(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.log(Math.sqrt(x * x + y * y)), Math.atan(y / x), unit);
  }
  function IMLOG10(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(10), Math.atan(y / x) / Math.log(10), unit);
  }
  function IMLOG2(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.log(Math.sqrt(x * x + y * y)) / Math.log(2), Math.atan(y / x) / Math.log(2), unit);
  }
  function IMPOWER(inumber, number2) {
    number2 = parseNumber(number2);
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(number2, x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    const p = Math.pow(IMABS(inumber), number2);
    const t2 = IMARGUMENT(inumber);
    return COMPLEX(p * Math.cos(number2 * t2), p * Math.sin(number2 * t2), unit);
  }
  function IMPRODUCT() {
    let result = arguments[0];
    if (!arguments.length) {
      return value;
    }
    for (let i2 = 1; i2 < arguments.length; i2++) {
      const a = IMREAL(result);
      const b = IMAGINARY(result);
      const c = IMREAL(arguments[i2]);
      const d = IMAGINARY(arguments[i2]);
      if (anyIsError(a, b, c, d)) {
        return value;
      }
      result = COMPLEX(a * c - b * d, a * d + b * c);
    }
    return result;
  }
  function IMREAL(inumber) {
    if (inumber === void 0 || inumber === true || inumber === false) {
      return value;
    }
    if (inumber === 0 || inumber === "0") {
      return 0;
    }
    if (["i", "+i", "1i", "+1i", "-i", "-1i", "j", "+j", "1j", "+1j", "-j", "-1j"].indexOf(inumber) >= 0) {
      return 0;
    }
    inumber = inumber + "";
    let plus2 = inumber.indexOf("+");
    let minus2 = inumber.indexOf("-");
    if (plus2 === 0) {
      plus2 = inumber.indexOf("+", 1);
    }
    if (minus2 === 0) {
      minus2 = inumber.indexOf("-", 1);
    }
    const last = inumber.substring(inumber.length - 1, inumber.length);
    const unit = last === "i" || last === "j";
    if (plus2 >= 0 || minus2 >= 0) {
      if (!unit) {
        return num;
      }
      if (plus2 >= 0) {
        return isNaN(inumber.substring(0, plus2)) || isNaN(inumber.substring(plus2 + 1, inumber.length - 1)) ? num : Number(inumber.substring(0, plus2));
      } else {
        return isNaN(inumber.substring(0, minus2)) || isNaN(inumber.substring(minus2 + 1, inumber.length - 1)) ? num : Number(inumber.substring(0, minus2));
      }
    } else {
      if (unit) {
        return isNaN(inumber.substring(0, inumber.length - 1)) ? num : 0;
      } else {
        return isNaN(inumber) ? num : inumber;
      }
    }
  }
  function IMSEC(inumber) {
    if (inumber === true || inumber === false) {
      return value;
    }
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    return IMDIV("1", IMCOS(inumber));
  }
  function IMSECH(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    return IMDIV("1", IMCOSH(inumber));
  }
  function IMSIN(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.sin(x) * (Math.exp(y) + Math.exp(-y)) / 2, Math.cos(x) * (Math.exp(y) - Math.exp(-y)) / 2, unit);
  }
  function IMSINH(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    return COMPLEX(Math.cos(y) * (Math.exp(x) - Math.exp(-x)) / 2, Math.sin(y) * (Math.exp(x) + Math.exp(-x)) / 2, unit);
  }
  function IMSQRT(inumber) {
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    let unit = inumber.substring(inumber.length - 1);
    unit = unit === "i" || unit === "j" ? unit : "i";
    const s = Math.sqrt(IMABS(inumber));
    const t2 = IMARGUMENT(inumber);
    return COMPLEX(s * Math.cos(t2 / 2), s * Math.sin(t2 / 2), unit);
  }
  function IMCSC(inumber) {
    if (inumber === true || inumber === false) {
      return value;
    }
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return num;
    }
    return IMDIV("1", IMSIN(inumber));
  }
  function IMCSCH(inumber) {
    if (inumber === true || inumber === false) {
      return value;
    }
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return num;
    }
    return IMDIV("1", IMSINH(inumber));
  }
  function IMSUB(inumber1, inumber2) {
    const a = IMREAL(inumber1);
    const b = IMAGINARY(inumber1);
    const c = IMREAL(inumber2);
    const d = IMAGINARY(inumber2);
    if (anyIsError(a, b, c, d)) {
      return value;
    }
    const unit1 = inumber1.substring(inumber1.length - 1);
    const unit2 = inumber2.substring(inumber2.length - 1);
    let unit = "i";
    if (unit1 === "j") {
      unit = "j";
    } else if (unit2 === "j") {
      unit = "j";
    }
    return COMPLEX(a - c, b - d, unit);
  }
  function IMSUM() {
    if (!arguments.length) {
      return value;
    }
    const args = flatten$1(arguments);
    let result = args[0];
    for (let i2 = 1; i2 < args.length; i2++) {
      const a = IMREAL(result);
      const b = IMAGINARY(result);
      const c = IMREAL(args[i2]);
      const d = IMAGINARY(args[i2]);
      if (anyIsError(a, b, c, d)) {
        return value;
      }
      result = COMPLEX(a + c, b + d);
    }
    return result;
  }
  function IMTAN(inumber) {
    if (inumber === true || inumber === false) {
      return value;
    }
    const x = IMREAL(inumber);
    const y = IMAGINARY(inumber);
    if (anyIsError(x, y)) {
      return value;
    }
    return IMDIV(IMSIN(inumber), IMCOS(inumber));
  }
  function OCT2BIN(number2, places) {
    if (!/^[0-7]{1,10}$/.test(number2)) {
      return num;
    }
    const negative = !!(number2.length === 10 && number2.substring(0, 1) === "7");
    const decimal = negative ? parseInt(number2, 8) - 1073741824 : parseInt(number2, 8);
    if (decimal < -512 || decimal > 511) {
      return num;
    }
    if (negative) {
      return "1" + REPT("0", 9 - (512 + decimal).toString(2).length) + (512 + decimal).toString(2);
    }
    const result = decimal.toString(2);
    if (typeof places === "undefined") {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  function OCT2DEC(number2) {
    if (!/^[0-7]{1,10}$/.test(number2)) {
      return num;
    }
    const decimal = parseInt(number2, 8);
    return decimal >= 536870912 ? decimal - 1073741824 : decimal;
  }
  function OCT2HEX(number2, places) {
    if (!/^[0-7]{1,10}$/.test(number2)) {
      return num;
    }
    const decimal = parseInt(number2, 8);
    if (decimal >= 536870912) {
      return "ff" + (decimal + 3221225472).toString(16);
    }
    const result = decimal.toString(16);
    if (places === void 0) {
      return result;
    } else {
      if (isNaN(places)) {
        return value;
      }
      if (places < 0) {
        return num;
      }
      places = Math.floor(places);
      return places >= result.length ? REPT("0", places - result.length) + result : num;
    }
  }
  const BETADIST = BETA.DIST;
  const BETAINV = BETA.INV;
  const BINOMDIST = BINOM.DIST;
  const CEILINGMATH = CEILING.MATH;
  const CEILINGPRECISE = CEILING.PRECISE;
  const CHIDIST = CHISQ.DIST;
  const CHIDISTRT = CHISQ.DIST.RT;
  const CHIINV = CHISQ.INV;
  const CHIINVRT = CHISQ.INV.RT;
  const CHITEST = CHISQ.TEST;
  const COVAR = COVARIANCE.P;
  const COVARIANCEP = COVARIANCE.P;
  const COVARIANCES = COVARIANCE.S;
  const CRITBINOM = BINOM.INV;
  const ERFCPRECISE = ERFC.PRECISE;
  const ERFPRECISE = ERF.PRECISE;
  const EXPONDIST = EXPON.DIST;
  const FDIST = F.DIST;
  const FDISTRT = F.DIST.RT;
  const FINV = F.INV;
  const FINVRT = F.INV.RT;
  const FLOORMATH = FLOOR.MATH;
  const FLOORPRECISE = FLOOR.PRECISE;
  const FTEST = F.TEST;
  const GAMMADIST = GAMMA.DIST;
  const GAMMAINV = GAMMA.INV;
  const GAMMALNPRECISE = GAMMALN.PRECISE;
  const HYPGEOMDIST = HYPGEOM.DIST;
  const LOGINV = LOGNORM.INV;
  const LOGNORMDIST = LOGNORM.DIST;
  const LOGNORMINV = LOGNORM.INV;
  const MODEMULT = MODE.MULT;
  const MODESNGL = MODE.SNGL;
  const NEGBINOMDIST = NEGBINOM.DIST;
  const NETWORKDAYSINTL = NETWORKDAYS.INTL;
  const NORMDIST = NORM.DIST;
  const NORMINV = NORM.INV;
  const NORMSDIST = NORM.S.DIST;
  const NORMSINV = NORM.S.INV;
  const PERCENTILEEXC = PERCENTILE.EXC;
  const PERCENTILEINC = PERCENTILE.INC;
  const PERCENTRANKEXC = PERCENTRANK.EXC;
  const PERCENTRANKINC = PERCENTRANK.INC;
  const POISSONDIST = POISSON.DIST;
  const QUARTILEEXC = QUARTILE.EXC;
  const QUARTILEINC = QUARTILE.INC;
  const RANKAVG = RANK.AVG;
  const RANKEQ = RANK.EQ;
  const SKEWP = SKEW.P;
  const STDEVP = STDEV.P;
  const STDEVS = STDEV.S;
  const TDIST = T$1.DIST;
  const TDISTRT = T$1.DIST.RT;
  const TINV = T$1.INV;
  const TTEST = T$1.TEST;
  const VARP = VAR.P;
  const VARS = VAR.S;
  const WEIBULLDIST = WEIBULL.DIST;
  const WORKDAYINTL = WORKDAY.INTL;
  const ZTEST = Z.TEST;
  function compact(array) {
    const result = [];
    arrayEach(array, (value2) => {
      if (value2) {
        result.push(value2);
      }
    });
    return result;
  }
  function findResultIndex(database, criterias) {
    const matches2 = {};
    for (let i2 = 1; i2 < database[0].length; ++i2) {
      matches2[i2] = true;
    }
    let maxCriteriaLength = criterias[0].length;
    for (let i2 = 1; i2 < criterias.length; ++i2) {
      if (criterias[i2].length > maxCriteriaLength) {
        maxCriteriaLength = criterias[i2].length;
      }
    }
    for (let k = 1; k < database.length; ++k) {
      for (let l = 1; l < database[k].length; ++l) {
        let currentCriteriaResult = false;
        let hasMatchingCriteria = false;
        for (let j = 0; j < criterias.length; ++j) {
          const criteria = criterias[j];
          if (criteria.length < maxCriteriaLength) {
            continue;
          }
          const criteriaField = criteria[0];
          if (database[k][0] !== criteriaField) {
            continue;
          }
          hasMatchingCriteria = true;
          for (let p = 1; p < criteria.length; ++p) {
            if (!currentCriteriaResult) {
              const isWildcard = criteria[p] === void 0 || criteria[p] === "*";
              if (isWildcard) {
                currentCriteriaResult = true;
              } else {
                const tokenizedCriteria = parse(criteria[p] + "");
                const tokens = [createToken(database[k][l], TOKEN_TYPE_LITERAL)].concat(tokenizedCriteria);
                currentCriteriaResult = compute(tokens);
              }
            }
          }
        }
        if (hasMatchingCriteria) {
          matches2[l] = matches2[l] && currentCriteriaResult;
        }
      }
    }
    const result = [];
    for (let n = 0; n < database[0].length; ++n) {
      if (matches2[n]) {
        result.push(n - 1);
      }
    }
    return result;
  }
  function DAVERAGE(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let sum = 0;
    arrayEach(resultIndexes, (value2) => {
      sum += targetFields[value2];
    });
    return resultIndexes.length === 0 ? div0 : sum / resultIndexes.length;
  }
  function DCOUNT(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    const targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    return COUNT$1(targetValues);
  }
  function DCOUNTA(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    const targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    return COUNTA(targetValues);
  }
  function DGET(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    if (resultIndexes.length === 0) {
      return value;
    }
    if (resultIndexes.length > 1) {
      return num;
    }
    return targetFields[resultIndexes[0]];
  }
  function DMAX(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let maxValue = targetFields[resultIndexes[0]];
    arrayEach(resultIndexes, (value2) => {
      if (maxValue < targetFields[value2]) {
        maxValue = targetFields[value2];
      }
    });
    return maxValue;
  }
  function DMIN(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let minValue = targetFields[resultIndexes[0]];
    arrayEach(resultIndexes, (value2) => {
      if (minValue > targetFields[value2]) {
        minValue = targetFields[value2];
      }
    });
    return minValue;
  }
  function DPRODUCT(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    targetValues = compact(targetValues);
    let result = 1;
    arrayEach(targetValues, (value2) => {
      result *= value2;
    });
    return result;
  }
  function DSTDEV(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    targetValues = compact(targetValues);
    return STDEV.S(targetValues);
  }
  function DSTDEVP(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    let targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    targetValues = compact(targetValues);
    return STDEV.P(targetValues);
  }
  function DSUM(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    const targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    return SUM(targetValues);
  }
  function DVAR(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    const targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    return VAR.S(targetValues);
  }
  function DVARP(database, field, criteria) {
    if (isNaN(field) && typeof field !== "string") {
      return value;
    }
    const resultIndexes = findResultIndex(database, criteria);
    let targetFields = [];
    if (typeof field === "string") {
      const index2 = findField(database, field);
      targetFields = rest(database[index2]);
    } else {
      targetFields = rest(database[field]);
    }
    const targetValues = [];
    arrayEach(resultIndexes, (value2) => {
      targetValues.push(targetFields[value2]);
    });
    return VAR.P(targetValues);
  }
  function validDate(d) {
    return d && d.getTime && !isNaN(d.getTime());
  }
  function ensureDate(d) {
    return d instanceof Date ? d : new Date(d);
  }
  function lastCoupDateBeforeSettlement(settlement, maturity, frequency) {
    let date = parseDate(maturity);
    date.setFullYear(settlement.getFullYear());
    if (date < settlement) {
      date.setFullYear(date.getFullYear() + 1);
    }
    while (date > settlement) {
      date.setMonth(date.getMonth() + -12 / frequency);
    }
    return date;
  }
  function validateFrequency(frequency) {
    frequency = parseNumber(frequency);
    if ([1, 2, 4].indexOf(frequency) === -1) {
      return num;
    }
    return frequency;
  }
  function validateBasis(basis) {
    basis = parseNumber(basis);
    if ([0, 1, 2, 3, 4].indexOf(basis) === -1) {
      return num;
    }
    return basis;
  }
  function ACCRINT(issue, first_interest, settlement, rate, par, frequency, basis) {
    issue = ensureDate(issue);
    first_interest = ensureDate(first_interest);
    settlement = ensureDate(settlement);
    frequency = validateFrequency(frequency);
    basis = validateBasis(basis);
    if (anyError(frequency, basis)) {
      return num;
    }
    if (!validDate(issue) || !validDate(first_interest) || !validDate(settlement)) {
      return value;
    }
    if (rate <= 0 || par <= 0) {
      return num;
    }
    if (settlement <= issue) {
      return num;
    }
    par = par || 0;
    basis = basis || 0;
    return par * rate * YEARFRAC(issue, settlement, basis);
  }
  function ACCRINTM() {
    throw new Error("ACCRINTM is not implemented");
  }
  function AMORDEGRC() {
    throw new Error("AMORDEGRC is not implemented");
  }
  function AMORLINC() {
    throw new Error("AMORLINC is not implemented");
  }
  function COUPDAYBS() {
    throw new Error("COUPDAYBS is not implemented");
  }
  function COUPDAYS(settlement, maturity, frequency, basis) {
    basis = validateBasis(basis);
    frequency = validateFrequency(frequency);
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    if (anyError(settlement, maturity)) {
      return value;
    }
    if (anyError(frequency, basis) || settlement >= maturity) {
      return num;
    }
    if (basis === 1) {
      let date = lastCoupDateBeforeSettlement(settlement, maturity, frequency);
      let nextDate = parseDate(date);
      nextDate.setMonth(nextDate.getMonth() + 12 / frequency);
      return DATEDIF(date, nextDate, "D");
    }
    let numOfDays;
    switch (basis) {
      case 0:
      case 2:
      case 4:
        numOfDays = 360;
        break;
      case 3:
        numOfDays = 365;
        break;
      default:
        return num;
    }
    return numOfDays / frequency;
  }
  function COUPDAYSNC() {
    throw new Error("COUPDAYSNC is not implemented");
  }
  function COUPNCD() {
    throw new Error("COUPNCD is not implemented");
  }
  function COUPNUM() {
    throw new Error("COUPNUM is not implemented");
  }
  function COUPPCD() {
    throw new Error("COUPPCD is not implemented");
  }
  function CUMIPMT(rate, nper, pv, start_period, end_period, type) {
    rate = parseNumber(rate);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    if (anyIsError(rate, nper, pv)) {
      return value;
    }
    if (rate <= 0 || nper <= 0 || pv <= 0) {
      return num;
    }
    if (start_period < 1 || end_period < 1 || start_period > end_period) {
      return num;
    }
    if (type !== 0 && type !== 1) {
      return num;
    }
    const payment = PMT(rate, nper, pv, 0, type);
    let interest = 0;
    if (start_period === 1) {
      if (type === 0) {
        interest = -pv;
      }
      start_period++;
    }
    for (let i2 = start_period; i2 <= end_period; i2++) {
      interest += type === 1 ? FV(rate, i2 - 2, payment, pv, 1) - payment : FV(rate, i2 - 1, payment, pv, 0);
    }
    interest *= rate;
    return interest;
  }
  function CUMPRINC(rate, nper, pv, start_period, end, type) {
    rate = parseNumber(rate);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    if (anyIsError(rate, nper, pv)) {
      return value;
    }
    if (rate <= 0 || nper <= 0 || pv <= 0) {
      return num;
    }
    if (start_period < 1 || end < 1 || start_period > end) {
      return num;
    }
    if (type !== 0 && type !== 1) {
      return num;
    }
    const payment = PMT(rate, nper, pv, 0, type);
    let principal = 0;
    if (start_period === 1) {
      principal = type === 0 ? payment + pv * rate : payment;
      start_period++;
    }
    for (let i2 = start_period; i2 <= end; i2++) {
      principal += type > 0 ? payment - (FV(rate, i2 - 2, payment, pv, 1) - payment) * rate : payment - FV(rate, i2 - 1, payment, pv, 0) * rate;
    }
    return principal;
  }
  function DB(cost, salvage, life, period, month) {
    month = month === void 0 ? 12 : month;
    cost = parseNumber(cost);
    salvage = parseNumber(salvage);
    life = parseNumber(life);
    period = parseNumber(period);
    month = parseNumber(month);
    if (anyIsError(cost, salvage, life, period, month)) {
      return value;
    }
    if (cost < 0 || salvage < 0 || life < 0 || period < 0) {
      return num;
    }
    if ([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].indexOf(month) === -1) {
      return num;
    }
    if (period > life) {
      return num;
    }
    if (salvage >= cost) {
      return 0;
    }
    const rate = (1 - Math.pow(salvage / cost, 1 / life)).toFixed(3);
    const initial2 = cost * rate * month / 12;
    let total = initial2;
    let current = 0;
    const ceiling = period === life ? life - 1 : period;
    for (let i2 = 2; i2 <= ceiling; i2++) {
      current = (cost - total) * rate;
      total += current;
    }
    if (period === 1) {
      return initial2;
    } else if (period === life) {
      return (cost - total) * rate;
    } else {
      return current;
    }
  }
  function DDB(cost, salvage, life, period, factor) {
    factor = factor === void 0 ? 2 : factor;
    cost = parseNumber(cost);
    salvage = parseNumber(salvage);
    life = parseNumber(life);
    period = parseNumber(period);
    factor = parseNumber(factor);
    if (anyIsError(cost, salvage, life, period, factor)) {
      return value;
    }
    if (cost < 0 || salvage < 0 || life < 0 || period < 0 || factor <= 0) {
      return num;
    }
    if (period > life) {
      return num;
    }
    if (salvage >= cost) {
      return 0;
    }
    let total = 0;
    let current = 0;
    for (let i2 = 1; i2 <= period; i2++) {
      current = Math.min((cost - total) * (factor / life), cost - salvage - total);
      total += current;
    }
    return current;
  }
  function DISC(settlement, maturity, pr, redemption, basis) {
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    pr = parseNumber(pr);
    redemption = parseNumber(redemption);
    basis = parseNumber(basis);
    basis = basis || 0;
    if (anyIsError(settlement, maturity, pr, redemption, basis)) {
      return value;
    }
    if (pr <= 0 || redemption <= 0) {
      return num;
    }
    if (settlement >= maturity) {
      return value;
    }
    let basisVal, diff;
    switch (basis) {
      case 0:
        basisVal = 360;
        diff = DAYS360(settlement, maturity, false);
        break;
      case 1:
        basisVal = 365;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 2:
        basisVal = 360;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 3:
        basisVal = 365;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 4:
        basisVal = 360;
        diff = DAYS360(settlement, maturity, true);
        break;
      default:
        return num;
    }
    return (redemption - pr) / redemption * basisVal / diff;
  }
  function DOLLARDE(fractional_dollar, fraction) {
    fractional_dollar = parseNumber(fractional_dollar);
    fraction = parseNumber(fraction);
    if (anyIsError(fractional_dollar, fraction)) {
      return value;
    }
    if (fraction < 0) {
      return num;
    }
    if (fraction >= 0 && fraction < 1) {
      return div0;
    }
    fraction = parseInt(fraction, 10);
    let result = parseInt(fractional_dollar, 10);
    result += fractional_dollar % 1 * Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN10)) / fraction;
    const power = Math.pow(10, Math.ceil(Math.log(fraction) / Math.LN2) + 1);
    result = Math.round(result * power) / power;
    return result;
  }
  function DOLLARFR(decimal_dollar, fraction) {
    decimal_dollar = parseNumber(decimal_dollar);
    fraction = parseNumber(fraction);
    if (anyIsError(decimal_dollar, fraction)) {
      return value;
    }
    if (fraction < 0) {
      return num;
    }
    if (fraction >= 0 && fraction < 1) {
      return div0;
    }
    fraction = parseInt(fraction, 10);
    let result = parseInt(decimal_dollar, 10);
    result += decimal_dollar % 1 * Math.pow(10, -Math.ceil(Math.log(fraction) / Math.LN10)) * fraction;
    return result;
  }
  function DURATION() {
    throw new Error("DURATION is not implemented");
  }
  function EFFECT(nominal_rate, npery) {
    nominal_rate = parseNumber(nominal_rate);
    npery = parseNumber(npery);
    if (anyIsError(nominal_rate, npery)) {
      return value;
    }
    if (nominal_rate <= 0 || npery < 1) {
      return num;
    }
    npery = parseInt(npery, 10);
    return Math.pow(1 + nominal_rate / npery, npery) - 1;
  }
  function FV(rate, nper, payment, value$1, type) {
    value$1 = value$1 || 0;
    type = type || 0;
    rate = parseNumber(rate);
    nper = parseNumber(nper);
    payment = parseNumber(payment);
    value$1 = parseNumber(value$1);
    type = parseNumber(type);
    if (anyIsError(rate, nper, payment, value$1, type)) {
      return value;
    }
    let result;
    if (rate === 0) {
      result = value$1 + payment * nper;
    } else {
      const term = Math.pow(1 + rate, nper);
      result = type === 1 ? value$1 * term + payment * (1 + rate) * (term - 1) / rate : value$1 * term + payment * (term - 1) / rate;
    }
    return -result;
  }
  function FVSCHEDULE(principal, schedule) {
    principal = parseNumber(principal);
    schedule = parseNumberArray(flatten$1(schedule));
    if (anyIsError(principal, schedule)) {
      return value;
    }
    const n = schedule.length;
    let future = principal;
    for (let i2 = 0; i2 < n; i2++) {
      future *= 1 + schedule[i2];
    }
    return future;
  }
  function INTRATE() {
    throw new Error("INTRATE is not implemented");
  }
  function IPMT(rate, per, nper, pv, fv, type) {
    fv = fv || 0;
    type = type || 0;
    rate = parseNumber(rate);
    per = parseNumber(per);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    type = parseNumber(type);
    if (anyIsError(rate, per, nper, pv, fv, type)) {
      return value;
    }
    const payment = PMT(rate, nper, pv, fv, type);
    let interest = per === 1 ? type === 1 ? 0 : -pv : type === 1 ? FV(rate, per - 2, payment, pv, 1) - payment : FV(rate, per - 1, payment, pv, 0);
    return interest * rate;
  }
  function IRR(values, guess) {
    guess = guess || 0;
    values = parseNumberArray(flatten$1(values));
    guess = parseNumber(guess);
    if (anyIsError(values, guess)) {
      return value;
    }
    const irrResult = (values2, dates2, rate) => {
      const r = rate + 1;
      let result = values2[0];
      for (let i2 = 1; i2 < values2.length; i2++) {
        result += values2[i2] / Math.pow(r, (dates2[i2] - dates2[0]) / 365);
      }
      return result;
    };
    const irrResultDeriv = (values2, dates2, rate) => {
      const r = rate + 1;
      let result = 0;
      for (let i2 = 1; i2 < values2.length; i2++) {
        const frac = (dates2[i2] - dates2[0]) / 365;
        result -= frac * values2[i2] / Math.pow(r, frac + 1);
      }
      return result;
    };
    const dates = [];
    let positive = false;
    let negative = false;
    for (let i2 = 0; i2 < values.length; i2++) {
      dates[i2] = i2 === 0 ? 0 : dates[i2 - 1] + 365;
      if (values[i2] > 0) {
        positive = true;
      }
      if (values[i2] < 0) {
        negative = true;
      }
    }
    if (!positive || !negative) {
      return num;
    }
    guess = guess === void 0 ? 0.1 : guess;
    let resultRate = guess;
    const epsMax = 1e-10;
    let newRate, epsRate, resultValue;
    let contLoop = true;
    do {
      resultValue = irrResult(values, dates, resultRate);
      newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);
      epsRate = Math.abs(newRate - resultRate);
      resultRate = newRate;
      contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;
    } while (contLoop);
    return resultRate;
  }
  function ISPMT(rate, per, nper, pv) {
    rate = parseNumber(rate);
    per = parseNumber(per);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    if (anyIsError(rate, per, nper, pv)) {
      return value;
    }
    return pv * rate * (per / nper - 1);
  }
  function MDURATION() {
    throw new Error("MDURATION is not implemented");
  }
  function MIRR(values, finance_rate, reinvest_rate) {
    values = parseNumberArray(flatten$1(values));
    finance_rate = parseNumber(finance_rate);
    reinvest_rate = parseNumber(reinvest_rate);
    if (anyIsError(values, finance_rate, reinvest_rate)) {
      return value;
    }
    const n = values.length;
    const payments = [];
    const incomes = [];
    for (let i2 = 0; i2 < n; i2++) {
      if (values[i2] < 0) {
        payments.push(values[i2]);
      } else {
        incomes.push(values[i2]);
      }
    }
    const num2 = -NPV(reinvest_rate, incomes) * Math.pow(1 + reinvest_rate, n - 1);
    const den = NPV(finance_rate, payments) * (1 + finance_rate);
    return Math.pow(num2 / den, 1 / (n - 1)) - 1;
  }
  function NOMINAL(effect_rate, npery) {
    effect_rate = parseNumber(effect_rate);
    npery = parseNumber(npery);
    if (anyIsError(effect_rate, npery)) {
      return value;
    }
    if (effect_rate <= 0 || npery < 1) {
      return num;
    }
    npery = parseInt(npery, 10);
    return (Math.pow(effect_rate + 1, 1 / npery) - 1) * npery;
  }
  function NPER(rate, pmt, pv, fv, type) {
    type = type === void 0 ? 0 : type;
    fv = fv === void 0 ? 0 : fv;
    rate = parseNumber(rate);
    pmt = parseNumber(pmt);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    type = parseNumber(type);
    if (anyIsError(rate, pmt, pv, fv, type)) {
      return value;
    }
    if (rate === 0) {
      return -(pv + fv) / pmt;
    } else {
      const num2 = pmt * (1 + rate * type) - fv * rate;
      const den = pv * rate + pmt * (1 + rate * type);
      return Math.log(num2 / den) / Math.log(1 + rate);
    }
  }
  function NPV() {
    const args = parseNumberArray(flatten$1(arguments));
    if (args instanceof Error) {
      return args;
    }
    const rate = args[0];
    let value2 = 0;
    for (let j = 1; j < args.length; j++) {
      value2 += args[j] / Math.pow(1 + rate, j);
    }
    return value2;
  }
  function ODDFPRICE() {
    throw new Error("ODDFPRICE is not implemented");
  }
  function ODDFYIELD() {
    throw new Error("ODDFYIELD is not implemented");
  }
  function ODDLPRICE() {
    throw new Error("ODDLPRICE is not implemented");
  }
  function ODDLYIELD() {
    throw new Error("ODDLYIELD is not implemented");
  }
  function PDURATION(rate, pv, fv) {
    rate = parseNumber(rate);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    if (anyIsError(rate, pv, fv)) {
      return value;
    }
    if (rate <= 0) {
      return num;
    }
    return (Math.log(fv) - Math.log(pv)) / Math.log(1 + rate);
  }
  function PMT(rate, nper, pv, fv, type) {
    fv = fv || 0;
    type = type || 0;
    rate = parseNumber(rate);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    type = parseNumber(type);
    if (anyIsError(rate, nper, pv, fv, type)) {
      return value;
    }
    let result;
    if (rate === 0) {
      result = (pv + fv) / nper;
    } else {
      const term = Math.pow(1 + rate, nper);
      result = type === 1 ? (fv * rate / (term - 1) + pv * rate / (1 - 1 / term)) / (1 + rate) : fv * rate / (term - 1) + pv * rate / (1 - 1 / term);
    }
    return -result;
  }
  function PPMT(rate, per, nper, pv, fv, type) {
    fv = fv || 0;
    type = type || 0;
    rate = parseNumber(rate);
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    type = parseNumber(type);
    if (anyIsError(rate, nper, pv, fv, type)) {
      return value;
    }
    return PMT(rate, nper, pv, fv, type) - IPMT(rate, per, nper, pv, fv, type);
  }
  function PRICE() {
    throw new Error("PRICE is not implemented");
  }
  function PRICEDISC(settlement, maturity, discount, redemption, basis) {
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    discount = parseNumber(discount);
    redemption = parseNumber(redemption);
    basis = parseNumber(basis);
    basis = basis || 0;
    if (anyIsError(settlement, maturity, discount, redemption, basis)) {
      return value;
    }
    if (discount <= 0 || redemption <= 0) {
      return num;
    }
    if (settlement >= maturity) {
      return value;
    }
    let basisVal, diff;
    switch (basis) {
      case 0:
        basisVal = 360;
        diff = DAYS360(settlement, maturity, false);
        break;
      case 1:
        basisVal = 365;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 2:
        basisVal = 360;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 3:
        basisVal = 365;
        diff = DATEDIF(settlement, maturity, "D");
        break;
      case 4:
        basisVal = 360;
        diff = DAYS360(settlement, maturity, true);
        break;
      default:
        return num;
    }
    return redemption - discount * redemption * diff / basisVal;
  }
  function PRICEMAT() {
    throw new Error("PRICEMAT is not implemented");
  }
  function PV(rate, per, pmt, fv, type) {
    fv = fv || 0;
    type = type || 0;
    rate = parseNumber(rate);
    per = parseNumber(per);
    pmt = parseNumber(pmt);
    fv = parseNumber(fv);
    type = parseNumber(type);
    if (anyIsError(rate, per, pmt, fv, type)) {
      return value;
    }
    return rate === 0 ? -pmt * per - fv : ((1 - Math.pow(1 + rate, per)) / rate * pmt * (1 + rate * type) - fv) / Math.pow(1 + rate, per);
  }
  function RATE(nper, pmt, pv, fv, type, guess) {
    guess = guess === void 0 ? 0.01 : guess;
    fv = fv === void 0 ? 0 : fv;
    type = type === void 0 ? 0 : type;
    nper = parseNumber(nper);
    pmt = parseNumber(pmt);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    type = parseNumber(type);
    guess = parseNumber(guess);
    if (anyIsError(nper, pmt, pv, fv, type, guess)) {
      return value;
    }
    const epsMax = 1e-10;
    const iterMax = 20;
    let rate = guess;
    type = type ? 1 : 0;
    for (let i2 = 0; i2 < iterMax; i2++) {
      if (rate <= -1) {
        return num;
      }
      let y, f;
      if (Math.abs(rate) < epsMax) {
        y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;
      } else {
        f = Math.pow(1 + rate, nper);
        y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;
      }
      if (Math.abs(y) < epsMax) {
        return rate;
      }
      let dy;
      if (Math.abs(rate) < epsMax) {
        dy = pv * nper + pmt * type * nper;
      } else {
        f = Math.pow(1 + rate, nper);
        const df = nper * Math.pow(1 + rate, nper - 1);
        dy = pv * df + pmt * (1 / rate + type) * df + pmt * (-1 / (rate * rate)) * (f - 1);
      }
      rate -= y / dy;
    }
    return rate;
  }
  function RECEIVED() {
    throw new Error("RECEIVED is not implemented");
  }
  function RRI(nper, pv, fv) {
    nper = parseNumber(nper);
    pv = parseNumber(pv);
    fv = parseNumber(fv);
    if (anyIsError(nper, pv, fv)) {
      return value;
    }
    if (nper === 0 || pv === 0) {
      return num;
    }
    return Math.pow(fv / pv, 1 / nper) - 1;
  }
  function SLN(cost, salvage, life) {
    cost = parseNumber(cost);
    salvage = parseNumber(salvage);
    life = parseNumber(life);
    if (anyIsError(cost, salvage, life)) {
      return value;
    }
    if (life === 0) {
      return num;
    }
    return (cost - salvage) / life;
  }
  function SYD(cost, salvage, life, per) {
    cost = parseNumber(cost);
    salvage = parseNumber(salvage);
    life = parseNumber(life);
    per = parseNumber(per);
    if (anyIsError(cost, salvage, life, per)) {
      return value;
    }
    if (life === 0) {
      return num;
    }
    if (per < 1 || per > life) {
      return num;
    }
    per = parseInt(per, 10);
    return (cost - salvage) * (life - per + 1) * 2 / (life * (life + 1));
  }
  function TBILLEQ(settlement, maturity, discount) {
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    discount = parseNumber(discount);
    if (anyIsError(settlement, maturity, discount)) {
      return value;
    }
    if (discount <= 0) {
      return num;
    }
    if (settlement > maturity) {
      return num;
    }
    if (maturity - settlement > 365 * 24 * 60 * 60 * 1e3) {
      return num;
    }
    return 365 * discount / (360 - discount * DAYS360(settlement, maturity, false));
  }
  function TBILLPRICE(settlement, maturity, discount) {
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    discount = parseNumber(discount);
    if (anyIsError(settlement, maturity, discount)) {
      return value;
    }
    if (discount <= 0) {
      return num;
    }
    if (settlement > maturity) {
      return num;
    }
    if (maturity - settlement > 365 * 24 * 60 * 60 * 1e3) {
      return num;
    }
    return 100 * (1 - discount * DAYS360(settlement, maturity, false) / 360);
  }
  function TBILLYIELD(settlement, maturity, pr) {
    settlement = parseDate(settlement);
    maturity = parseDate(maturity);
    pr = parseNumber(pr);
    if (anyIsError(settlement, maturity, pr)) {
      return value;
    }
    if (pr <= 0) {
      return num;
    }
    if (settlement > maturity) {
      return num;
    }
    if (maturity - settlement > 365 * 24 * 60 * 60 * 1e3) {
      return num;
    }
    return (100 - pr) * 360 / (pr * DAYS360(settlement, maturity, false));
  }
  function VDB() {
    throw new Error("VDB is not implemented");
  }
  function XIRR(values, dates, guess) {
    values = parseNumberArray(flatten$1(values));
    dates = parseDateArray(flatten$1(dates));
    guess = parseNumber(guess);
    if (anyIsError(values, dates, guess)) {
      return value;
    }
    const irrResult = (values2, dates2, rate) => {
      const r = rate + 1;
      let result = values2[0];
      for (let i2 = 1; i2 < values2.length; i2++) {
        result += values2[i2] / Math.pow(r, DAYS(dates2[i2], dates2[0]) / 365);
      }
      return result;
    };
    const irrResultDeriv = (values2, dates2, rate) => {
      const r = rate + 1;
      let result = 0;
      for (let i2 = 1; i2 < values2.length; i2++) {
        const frac = DAYS(dates2[i2], dates2[0]) / 365;
        result -= frac * values2[i2] / Math.pow(r, frac + 1);
      }
      return result;
    };
    let positive = false;
    let negative = false;
    for (let i2 = 0; i2 < values.length; i2++) {
      if (values[i2] > 0) {
        positive = true;
      }
      if (values[i2] < 0) {
        negative = true;
      }
    }
    if (!positive || !negative) {
      return num;
    }
    guess = guess || 0.1;
    let resultRate = guess;
    const epsMax = 1e-10;
    let newRate, epsRate, resultValue;
    let contLoop = true;
    do {
      resultValue = irrResult(values, dates, resultRate);
      newRate = resultRate - resultValue / irrResultDeriv(values, dates, resultRate);
      epsRate = Math.abs(newRate - resultRate);
      resultRate = newRate;
      contLoop = epsRate > epsMax && Math.abs(resultValue) > epsMax;
    } while (contLoop);
    return resultRate;
  }
  function XNPV(rate, values, dates) {
    rate = parseNumber(rate);
    values = parseNumberArray(flatten$1(values));
    dates = parseDateArray(flatten$1(dates));
    if (anyIsError(rate, values, dates)) {
      return value;
    }
    let result = 0;
    for (let i2 = 0; i2 < values.length; i2++) {
      result += values[i2] / Math.pow(1 + rate, DAYS(dates[i2], dates[0]) / 365);
    }
    return result;
  }
  function YIELD() {
    throw new Error("YIELD is not implemented");
  }
  function YIELDDISC() {
    throw new Error("YIELDDISC is not implemented");
  }
  function YIELDMAT() {
    throw new Error("YIELDMAT is not implemented");
  }
  function AND() {
    const args = flatten$1(arguments);
    let result = value;
    for (let i2 = 0; i2 < args.length; i2++) {
      if (args[i2] instanceof Error) {
        return args[i2];
      }
      if (args[i2] === void 0 || args[i2] === null || typeof args[i2] === "string") {
        continue;
      }
      if (result === value) {
        result = true;
      }
      if (!args[i2]) {
        result = false;
      }
    }
    return result;
  }
  function FALSE() {
    return false;
  }
  function IF(logical_test, value_if_true, value_if_false) {
    if (logical_test instanceof Error) {
      return logical_test;
    }
    value_if_true = arguments.length >= 2 ? value_if_true : true;
    if (value_if_true === void 0 || value_if_true === null) {
      value_if_true = 0;
    }
    value_if_false = arguments.length === 3 ? value_if_false : false;
    if (value_if_false === void 0 || value_if_false === null) {
      value_if_false = 0;
    }
    return logical_test ? value_if_true : value_if_false;
  }
  function IFS() {
    for (let i2 = 0; i2 < arguments.length / 2; i2++) {
      if (arguments[i2 * 2]) {
        return arguments[i2 * 2 + 1];
      }
    }
    return na;
  }
  function IFERROR(value2, value_if_error) {
    if (ISERROR(value2)) {
      return value_if_error;
    }
    return value2;
  }
  function IFNA(value2, value_if_na) {
    return value2 === na ? value_if_na : value2;
  }
  function NOT(logical) {
    if (typeof logical === "string") {
      return value;
    }
    if (logical instanceof Error) {
      return logical;
    }
    return !logical;
  }
  function OR() {
    const args = flatten$1(arguments);
    let result = value;
    for (let i2 = 0; i2 < args.length; i2++) {
      if (args[i2] instanceof Error) {
        return args[i2];
      }
      if (args[i2] === void 0 || args[i2] === null || typeof args[i2] === "string") {
        continue;
      }
      if (result === value) {
        result = false;
      }
      if (args[i2]) {
        result = true;
      }
    }
    return result;
  }
  function TRUE() {
    return true;
  }
  function XOR() {
    const args = flatten$1(arguments);
    let result = value;
    for (let i2 = 0; i2 < args.length; i2++) {
      if (args[i2] instanceof Error) {
        return args[i2];
      }
      if (args[i2] === void 0 || args[i2] === null || typeof args[i2] === "string") {
        continue;
      }
      if (result === value) {
        result = 0;
      }
      if (args[i2]) {
        result++;
      }
    }
    if (result === value) {
      return result;
    }
    return !!(Math.floor(Math.abs(result)) & 1);
  }
  function SWITCH() {
    let result;
    if (arguments.length > 0) {
      const targetValue = arguments[0];
      const argc = arguments.length - 1;
      const switchCount = Math.floor(argc / 2);
      let switchSatisfied = false;
      const hasDefaultClause = argc % 2 !== 0;
      const defaultClause = argc % 2 === 0 ? null : arguments[arguments.length - 1];
      if (switchCount) {
        for (let index2 = 0; index2 < switchCount; index2++) {
          if (targetValue === arguments[index2 * 2 + 1]) {
            result = arguments[index2 * 2 + 2];
            switchSatisfied = true;
            break;
          }
        }
      }
      if (!switchSatisfied) {
        result = hasDefaultClause ? defaultClause : na;
      }
    } else {
      result = value;
    }
    return result;
  }
  const utils = { errors, symbols };
  var formulajs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    ABS,
    ACCRINT,
    ACCRINTM,
    ACOS,
    ACOSH,
    ACOT,
    ACOTH,
    AGGREGATE,
    AMORDEGRC,
    AMORLINC,
    AND,
    ARABIC,
    ASC,
    ASIN,
    ASINH,
    ATAN,
    ATAN2,
    ATANH,
    AVEDEV,
    AVERAGE,
    AVERAGEA,
    AVERAGEIF,
    AVERAGEIFS,
    BAHTTEXT,
    BASE,
    BESSELI,
    BESSELJ,
    BESSELK,
    BESSELY,
    BETA,
    BETADIST,
    BETAINV,
    BIN2DEC,
    BIN2HEX,
    BIN2OCT,
    BINOM,
    BINOMDIST,
    BITAND,
    BITLSHIFT,
    BITOR,
    BITRSHIFT,
    BITXOR,
    CEILING,
    CEILINGMATH,
    CEILINGPRECISE,
    CELL,
    CHAR,
    CHIDIST,
    CHIDISTRT,
    CHIINV,
    CHIINVRT,
    CHISQ,
    CHITEST,
    CHOOSE,
    CLEAN,
    CODE,
    COLUMN,
    COLUMNS,
    COMBIN,
    COMBINA,
    COMPLEX,
    CONCAT,
    CONCATENATE,
    CONFIDENCE,
    CONVERT,
    CORREL,
    COS,
    COSH,
    COT,
    COTH,
    COUNT: COUNT$1,
    COUNTA,
    COUNTBLANK,
    COUNTIF,
    COUNTIFS,
    COUPDAYBS,
    COUPDAYS,
    COUPDAYSNC,
    COUPNCD,
    COUPNUM,
    COUPPCD,
    COVAR,
    COVARIANCE,
    COVARIANCEP,
    COVARIANCES,
    CRITBINOM,
    CSC,
    CSCH,
    CUMIPMT,
    CUMPRINC,
    DATE,
    DATEDIF,
    DATEVALUE,
    DAVERAGE,
    DAY,
    DAYS,
    DAYS360,
    DB,
    DBCS,
    DCOUNT,
    DCOUNTA,
    DDB,
    DEC2BIN,
    DEC2HEX,
    DEC2OCT,
    DECIMAL,
    DEGREES,
    DELTA,
    DEVSQ,
    DGET,
    DISC,
    DMAX,
    DMIN,
    DOLLAR,
    DOLLARDE,
    DOLLARFR,
    DPRODUCT,
    DSTDEV,
    DSTDEVP,
    DSUM,
    DURATION,
    DVAR,
    DVARP,
    EDATE,
    EFFECT,
    EOMONTH,
    ERF,
    ERFC,
    ERFCPRECISE,
    ERFPRECISE,
    ERROR,
    EVEN,
    EXACT,
    EXP,
    EXPON,
    EXPONDIST,
    F,
    FACT,
    FACTDOUBLE,
    FALSE,
    FDIST,
    FDISTRT,
    FIND,
    FINV,
    FINVRT,
    FISHER,
    FISHERINV,
    FIXED,
    FLOOR,
    FLOORMATH,
    FLOORPRECISE,
    FORECAST,
    FREQUENCY,
    FTEST,
    FV,
    FVSCHEDULE,
    GAMMA,
    GAMMADIST,
    GAMMAINV,
    GAMMALN,
    GAMMALNPRECISE,
    GAUSS,
    GCD,
    GEOMEAN,
    GESTEP,
    GROWTH,
    HARMEAN,
    HEX2BIN,
    HEX2DEC,
    HEX2OCT,
    HLOOKUP,
    HOUR,
    HYPGEOM,
    HYPGEOMDIST,
    IF,
    IFERROR,
    IFNA,
    IFS,
    IMABS,
    IMAGINARY,
    IMARGUMENT,
    IMCONJUGATE,
    IMCOS,
    IMCOSH,
    IMCOT,
    IMCSC,
    IMCSCH,
    IMDIV,
    IMEXP,
    IMLN,
    IMLOG10,
    IMLOG2,
    IMPOWER,
    IMPRODUCT,
    IMREAL,
    IMSEC,
    IMSECH,
    IMSIN,
    IMSINH,
    IMSQRT,
    IMSUB,
    IMSUM,
    IMTAN,
    INDEX,
    INFO,
    INT,
    INTERCEPT,
    INTRATE,
    IPMT,
    IRR,
    ISBLANK,
    ISERR,
    ISERROR,
    ISEVEN,
    ISFORMULA,
    ISLOGICAL,
    ISNA,
    ISNONTEXT,
    ISNUMBER,
    ISO,
    ISODD,
    ISOWEEKNUM,
    ISPMT,
    ISREF,
    ISTEXT,
    KURT,
    LARGE,
    LCM,
    LEFT,
    LEN,
    LINEST,
    LN,
    LOG,
    LOG10,
    LOGEST,
    LOGINV,
    LOGNORM,
    LOGNORMDIST,
    LOGNORMINV,
    LOOKUP,
    LOWER,
    MATCH,
    MAX,
    MAXA,
    MDURATION,
    MEDIAN,
    MID,
    MIN,
    MINA,
    MINUTE,
    MIRR,
    MMULT,
    MOD,
    MODE,
    MODEMULT,
    MODESNGL,
    MONTH,
    MROUND,
    MULTINOMIAL,
    MUNIT,
    N,
    NA,
    NEGBINOM,
    NEGBINOMDIST,
    NETWORKDAYS,
    NETWORKDAYSINTL,
    NOMINAL,
    NORM,
    NORMDIST,
    NORMINV,
    NORMSDIST,
    NORMSINV,
    NOT,
    NOW,
    NPER,
    NPV,
    NUMBERVALUE,
    OCT2BIN,
    OCT2DEC,
    OCT2HEX,
    ODD,
    ODDFPRICE,
    ODDFYIELD,
    ODDLPRICE,
    ODDLYIELD,
    OR,
    PDURATION,
    PEARSON,
    PERCENTILE,
    PERCENTILEEXC,
    PERCENTILEINC,
    PERCENTRANK,
    PERCENTRANKEXC,
    PERCENTRANKINC,
    PERMUT,
    PERMUTATIONA,
    PHI,
    PI,
    PMT,
    POISSON,
    POISSONDIST,
    POWER,
    PPMT,
    PRICE,
    PRICEDISC,
    PRICEMAT,
    PROB,
    PRODUCT,
    PRONETIC,
    PROPER,
    PV,
    QUARTILE,
    QUARTILEEXC,
    QUARTILEINC,
    QUOTIENT,
    RADIANS,
    RAND,
    RANDBETWEEN,
    RANK,
    RANKAVG,
    RANKEQ,
    RATE,
    RECEIVED,
    REPLACE,
    REPT,
    RIGHT,
    ROMAN,
    ROUND,
    ROUNDDOWN,
    ROUNDUP,
    ROW,
    ROWS,
    RRI,
    RSQ,
    SEARCH,
    SEC,
    SECH,
    SECOND,
    SERIESSUM,
    SHEET,
    SHEETS,
    SIGN,
    SIN,
    SINH,
    SKEW,
    SKEWP,
    SLN,
    SLOPE,
    SMALL,
    SORT,
    SQRT,
    SQRTPI,
    STANDARDIZE,
    STDEV,
    STDEVA,
    STDEVP,
    STDEVPA,
    STDEVS,
    STEYX,
    SUBSTITUTE,
    SUBTOTAL,
    SUM,
    SUMIF,
    SUMIFS,
    SUMPRODUCT,
    SUMSQ,
    SUMX2MY2,
    SUMX2PY2,
    SUMXMY2,
    SWITCH,
    SYD,
    T,
    TAN,
    TANH,
    TBILLEQ,
    TBILLPRICE,
    TBILLYIELD,
    TDIST,
    TDISTRT,
    TEXT,
    TEXTJOIN,
    TIME,
    TIMEVALUE,
    TINV,
    TODAY,
    TRANSPOSE,
    TREND,
    TRIM,
    TRIMMEAN,
    TRUE,
    TRUNC,
    TTEST,
    TYPE,
    UNICHAR,
    UNICODE,
    UNIQUE,
    UPPER,
    VALUE,
    VAR,
    VARA,
    VARP,
    VARPA,
    VARS,
    VDB,
    VLOOKUP,
    WEEKDAY,
    WEEKNUM,
    WEIBULL,
    WEIBULLDIST,
    WORKDAY,
    WORKDAYINTL,
    XIRR,
    XNPV,
    XOR,
    YEAR,
    YEARFRAC,
    YIELD,
    YIELDDISC,
    YIELDMAT,
    Z,
    ZTEST,
    utils
  }, Symbol.toStringTag, { value: "Module" }));
  class Text$1 {
    lineAt(pos) {
      if (pos < 0 || pos > this.length)
        throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);
      return this.lineInner(pos, false, 1, 0);
    }
    line(n) {
      if (n < 1 || n > this.lines)
        throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);
      return this.lineInner(n, true, 1, 0);
    }
    replace(from, to, text) {
      let parts = [];
      this.decompose(0, from, parts, 2);
      if (text.length)
        text.decompose(0, text.length, parts, 1 | 2);
      this.decompose(to, this.length, parts, 1);
      return TextNode.from(parts, this.length - (to - from) + text.length);
    }
    append(other) {
      return this.replace(this.length, this.length, other);
    }
    slice(from, to = this.length) {
      let parts = [];
      this.decompose(from, to, parts, 0);
      return TextNode.from(parts, to - from);
    }
    eq(other) {
      if (other == this)
        return true;
      if (other.length != this.length || other.lines != this.lines)
        return false;
      let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1);
      let a = new RawTextCursor(this), b = new RawTextCursor(other);
      for (let skip = start, pos = start; ; ) {
        a.next(skip);
        b.next(skip);
        skip = 0;
        if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value)
          return false;
        pos += a.value.length;
        if (a.done || pos >= end)
          return true;
      }
    }
    iter(dir = 1) {
      return new RawTextCursor(this, dir);
    }
    iterRange(from, to = this.length) {
      return new PartialTextCursor(this, from, to);
    }
    iterLines(from, to) {
      let inner;
      if (from == null) {
        inner = this.iter();
      } else {
        if (to == null)
          to = this.lines + 1;
        let start = this.line(from).from;
        inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));
      }
      return new LineCursor(inner);
    }
    toString() {
      return this.sliceString(0);
    }
    toJSON() {
      let lines = [];
      this.flatten(lines);
      return lines;
    }
    constructor() {
    }
    static of(text) {
      if (text.length == 0)
        throw new RangeError("A document must have at least one line");
      if (text.length == 1 && !text[0])
        return Text$1.empty;
      return text.length <= 32 ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));
    }
  }
  class TextLeaf extends Text$1 {
    constructor(text, length = textLength(text)) {
      super();
      this.text = text;
      this.length = length;
    }
    get lines() {
      return this.text.length;
    }
    get children() {
      return null;
    }
    lineInner(target, isLine, line, offset) {
      for (let i2 = 0; ; i2++) {
        let string2 = this.text[i2], end = offset + string2.length;
        if ((isLine ? line : end) >= target)
          return new Line(offset, end, line, string2);
        offset = end + 1;
        line++;
      }
    }
    decompose(from, to, target, open2) {
      let text = from <= 0 && to >= this.length ? this : new TextLeaf(sliceText(this.text, from, to), Math.min(to, this.length) - Math.max(0, from));
      if (open2 & 1) {
        let prev = target.pop();
        let joined = appendText(text.text, prev.text.slice(), 0, text.length);
        if (joined.length <= 32) {
          target.push(new TextLeaf(joined, prev.length + text.length));
        } else {
          let mid = joined.length >> 1;
          target.push(new TextLeaf(joined.slice(0, mid)), new TextLeaf(joined.slice(mid)));
        }
      } else {
        target.push(text);
      }
    }
    replace(from, to, text) {
      if (!(text instanceof TextLeaf))
        return super.replace(from, to, text);
      let lines = appendText(this.text, appendText(text.text, sliceText(this.text, 0, from)), to);
      let newLen = this.length + text.length - (to - from);
      if (lines.length <= 32)
        return new TextLeaf(lines, newLen);
      return TextNode.from(TextLeaf.split(lines, []), newLen);
    }
    sliceString(from, to = this.length, lineSep = "\n") {
      let result = "";
      for (let pos = 0, i2 = 0; pos <= to && i2 < this.text.length; i2++) {
        let line = this.text[i2], end = pos + line.length;
        if (pos > from && i2)
          result += lineSep;
        if (from < end && to > pos)
          result += line.slice(Math.max(0, from - pos), to - pos);
        pos = end + 1;
      }
      return result;
    }
    flatten(target) {
      for (let line of this.text)
        target.push(line);
    }
    scanIdentical() {
      return 0;
    }
    static split(text, target) {
      let part = [], len = -1;
      for (let line of text) {
        part.push(line);
        len += line.length + 1;
        if (part.length == 32) {
          target.push(new TextLeaf(part, len));
          part = [];
          len = -1;
        }
      }
      if (len > -1)
        target.push(new TextLeaf(part, len));
      return target;
    }
  }
  class TextNode extends Text$1 {
    constructor(children, length) {
      super();
      this.children = children;
      this.length = length;
      this.lines = 0;
      for (let child of children)
        this.lines += child.lines;
    }
    lineInner(target, isLine, line, offset) {
      for (let i2 = 0; ; i2++) {
        let child = this.children[i2], end = offset + child.length, endLine = line + child.lines - 1;
        if ((isLine ? endLine : end) >= target)
          return child.lineInner(target, isLine, line, offset);
        offset = end + 1;
        line = endLine + 1;
      }
    }
    decompose(from, to, target, open2) {
      for (let i2 = 0, pos = 0; pos <= to && i2 < this.children.length; i2++) {
        let child = this.children[i2], end = pos + child.length;
        if (from <= end && to >= pos) {
          let childOpen = open2 & ((pos <= from ? 1 : 0) | (end >= to ? 2 : 0));
          if (pos >= from && end <= to && !childOpen)
            target.push(child);
          else
            child.decompose(from - pos, to - pos, target, childOpen);
        }
        pos = end + 1;
      }
    }
    replace(from, to, text) {
      if (text.lines < this.lines)
        for (let i2 = 0, pos = 0; i2 < this.children.length; i2++) {
          let child = this.children[i2], end = pos + child.length;
          if (from >= pos && to <= end) {
            let updated = child.replace(from - pos, to - pos, text);
            let totalLines = this.lines - child.lines + updated.lines;
            if (updated.lines < totalLines >> 5 - 1 && updated.lines > totalLines >> 5 + 1) {
              let copy = this.children.slice();
              copy[i2] = updated;
              return new TextNode(copy, this.length - (to - from) + text.length);
            }
            return super.replace(pos, end, updated);
          }
          pos = end + 1;
        }
      return super.replace(from, to, text);
    }
    sliceString(from, to = this.length, lineSep = "\n") {
      let result = "";
      for (let i2 = 0, pos = 0; i2 < this.children.length && pos <= to; i2++) {
        let child = this.children[i2], end = pos + child.length;
        if (pos > from && i2)
          result += lineSep;
        if (from < end && to > pos)
          result += child.sliceString(from - pos, to - pos, lineSep);
        pos = end + 1;
      }
      return result;
    }
    flatten(target) {
      for (let child of this.children)
        child.flatten(target);
    }
    scanIdentical(other, dir) {
      if (!(other instanceof TextNode))
        return 0;
      let length = 0;
      let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length] : [this.children.length - 1, other.children.length - 1, -1, -1];
      for (; ; iA += dir, iB += dir) {
        if (iA == eA || iB == eB)
          return length;
        let chA = this.children[iA], chB = other.children[iB];
        if (chA != chB)
          return length + chA.scanIdentical(chB, dir);
        length += chA.length + 1;
      }
    }
    static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {
      let lines = 0;
      for (let ch of children)
        lines += ch.lines;
      if (lines < 32) {
        let flat = [];
        for (let ch of children)
          ch.flatten(flat);
        return new TextLeaf(flat, length);
      }
      let chunk = Math.max(32, lines >> 5), maxChunk = chunk << 1, minChunk = chunk >> 1;
      let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];
      function add2(child) {
        let last;
        if (child.lines > maxChunk && child instanceof TextNode) {
          for (let node of child.children)
            add2(node);
        } else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {
          flush();
          chunked.push(child);
        } else if (child instanceof TextLeaf && currentLines && (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf && child.lines + last.lines <= 32) {
          currentLines += child.lines;
          currentLen += child.length + 1;
          currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);
        } else {
          if (currentLines + child.lines > chunk)
            flush();
          currentLines += child.lines;
          currentLen += child.length + 1;
          currentChunk.push(child);
        }
      }
      function flush() {
        if (currentLines == 0)
          return;
        chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode.from(currentChunk, currentLen));
        currentLen = -1;
        currentLines = currentChunk.length = 0;
      }
      for (let child of children)
        add2(child);
      flush();
      return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);
    }
  }
  Text$1.empty = /* @__PURE__ */ new TextLeaf([""], 0);
  function textLength(text) {
    let length = -1;
    for (let line of text)
      length += line.length + 1;
    return length;
  }
  function appendText(text, target, from = 0, to = 1e9) {
    for (let pos = 0, i2 = 0, first = true; i2 < text.length && pos <= to; i2++) {
      let line = text[i2], end = pos + line.length;
      if (end >= from) {
        if (end > to)
          line = line.slice(0, to - pos);
        if (pos < from)
          line = line.slice(from - pos);
        if (first) {
          target[target.length - 1] += line;
          first = false;
        } else
          target.push(line);
      }
      pos = end + 1;
    }
    return target;
  }
  function sliceText(text, from, to) {
    return appendText(text, [""], from, to);
  }
  class RawTextCursor {
    constructor(text, dir = 1) {
      this.dir = dir;
      this.done = false;
      this.lineBreak = false;
      this.value = "";
      this.nodes = [text];
      this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf ? text.text.length : text.children.length) << 1];
    }
    nextInner(skip, dir) {
      this.done = this.lineBreak = false;
      for (; ; ) {
        let last = this.nodes.length - 1;
        let top2 = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1;
        let size = top2 instanceof TextLeaf ? top2.text.length : top2.children.length;
        if (offset == (dir > 0 ? size : 0)) {
          if (last == 0) {
            this.done = true;
            this.value = "";
            return this;
          }
          if (dir > 0)
            this.offsets[last - 1]++;
          this.nodes.pop();
          this.offsets.pop();
        } else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {
          this.offsets[last] += dir;
          if (skip == 0) {
            this.lineBreak = true;
            this.value = "\n";
            return this;
          }
          skip--;
        } else if (top2 instanceof TextLeaf) {
          let next = top2.text[offset + (dir < 0 ? -1 : 0)];
          this.offsets[last] += dir;
          if (next.length > Math.max(0, skip)) {
            this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip);
            return this;
          }
          skip -= next.length;
        } else {
          let next = top2.children[offset + (dir < 0 ? -1 : 0)];
          if (skip > next.length) {
            skip -= next.length;
            this.offsets[last] += dir;
          } else {
            if (dir < 0)
              this.offsets[last]--;
            this.nodes.push(next);
            this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf ? next.text.length : next.children.length) << 1);
          }
        }
      }
    }
    next(skip = 0) {
      if (skip < 0) {
        this.nextInner(-skip, -this.dir);
        skip = this.value.length;
      }
      return this.nextInner(skip, this.dir);
    }
  }
  class PartialTextCursor {
    constructor(text, start, end) {
      this.value = "";
      this.done = false;
      this.cursor = new RawTextCursor(text, start > end ? -1 : 1);
      this.pos = start > end ? text.length : 0;
      this.from = Math.min(start, end);
      this.to = Math.max(start, end);
    }
    nextInner(skip, dir) {
      if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {
        this.value = "";
        this.done = true;
        return this;
      }
      skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);
      let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;
      if (skip > limit)
        skip = limit;
      limit -= skip;
      let { value: value2 } = this.cursor.next(skip);
      this.pos += (value2.length + skip) * dir;
      this.value = value2.length <= limit ? value2 : dir < 0 ? value2.slice(value2.length - limit) : value2.slice(0, limit);
      this.done = !this.value;
      return this;
    }
    next(skip = 0) {
      if (skip < 0)
        skip = Math.max(skip, this.from - this.pos);
      else if (skip > 0)
        skip = Math.min(skip, this.to - this.pos);
      return this.nextInner(skip, this.cursor.dir);
    }
    get lineBreak() {
      return this.cursor.lineBreak && this.value != "";
    }
  }
  class LineCursor {
    constructor(inner) {
      this.inner = inner;
      this.afterBreak = true;
      this.value = "";
      this.done = false;
    }
    next(skip = 0) {
      let { done, lineBreak, value: value2 } = this.inner.next(skip);
      if (done) {
        this.done = true;
        this.value = "";
      } else if (lineBreak) {
        if (this.afterBreak) {
          this.value = "";
        } else {
          this.afterBreak = true;
          this.next();
        }
      } else {
        this.value = value2;
        this.afterBreak = false;
      }
      return this;
    }
    get lineBreak() {
      return false;
    }
  }
  if (typeof Symbol != "undefined") {
    Text$1.prototype[Symbol.iterator] = function() {
      return this.iter();
    };
    RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] = LineCursor.prototype[Symbol.iterator] = function() {
      return this;
    };
  }
  class Line {
    constructor(from, to, number2, text) {
      this.from = from;
      this.to = to;
      this.number = number2;
      this.text = text;
    }
    get length() {
      return this.to - this.from;
    }
  }
  let extend$1 = /* @__PURE__ */ "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s) => s ? parseInt(s, 36) : 1);
  for (let i2 = 1; i2 < extend$1.length; i2++)
    extend$1[i2] += extend$1[i2 - 1];
  function isExtendingChar(code2) {
    for (let i2 = 1; i2 < extend$1.length; i2 += 2)
      if (extend$1[i2] > code2)
        return extend$1[i2 - 1] <= code2;
    return false;
  }
  function isRegionalIndicator(code2) {
    return code2 >= 127462 && code2 <= 127487;
  }
  const ZWJ = 8205;
  function findClusterBreak(str, pos, forward = true, includeExtending = true) {
    return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);
  }
  function nextClusterBreak(str, pos, includeExtending) {
    if (pos == str.length)
      return pos;
    if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1)))
      pos--;
    let prev = codePointAt(str, pos);
    pos += codePointSize(prev);
    while (pos < str.length) {
      let next = codePointAt(str, pos);
      if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {
        pos += codePointSize(next);
        prev = next;
      } else if (isRegionalIndicator(next)) {
        let countBefore = 0, i2 = pos - 2;
        while (i2 >= 0 && isRegionalIndicator(codePointAt(str, i2))) {
          countBefore++;
          i2 -= 2;
        }
        if (countBefore % 2 == 0)
          break;
        else
          pos += 2;
      } else {
        break;
      }
    }
    return pos;
  }
  function prevClusterBreak(str, pos, includeExtending) {
    while (pos > 0) {
      let found = nextClusterBreak(str, pos - 2, includeExtending);
      if (found < pos)
        return found;
      pos--;
    }
    return 0;
  }
  function surrogateLow(ch) {
    return ch >= 56320 && ch < 57344;
  }
  function surrogateHigh(ch) {
    return ch >= 55296 && ch < 56320;
  }
  function codePointAt(str, pos) {
    let code0 = str.charCodeAt(pos);
    if (!surrogateHigh(code0) || pos + 1 == str.length)
      return code0;
    let code1 = str.charCodeAt(pos + 1);
    if (!surrogateLow(code1))
      return code0;
    return (code0 - 55296 << 10) + (code1 - 56320) + 65536;
  }
  function fromCodePoint(code2) {
    if (code2 <= 65535)
      return String.fromCharCode(code2);
    code2 -= 65536;
    return String.fromCharCode((code2 >> 10) + 55296, (code2 & 1023) + 56320);
  }
  function codePointSize(code2) {
    return code2 < 65536 ? 1 : 2;
  }
  const DefaultSplit = /\r\n?|\n/;
  var MapMode = /* @__PURE__ */ function(MapMode2) {
    MapMode2[MapMode2["Simple"] = 0] = "Simple";
    MapMode2[MapMode2["TrackDel"] = 1] = "TrackDel";
    MapMode2[MapMode2["TrackBefore"] = 2] = "TrackBefore";
    MapMode2[MapMode2["TrackAfter"] = 3] = "TrackAfter";
    return MapMode2;
  }(MapMode || (MapMode = {}));
  class ChangeDesc {
    constructor(sections) {
      this.sections = sections;
    }
    get length() {
      let result = 0;
      for (let i2 = 0; i2 < this.sections.length; i2 += 2)
        result += this.sections[i2];
      return result;
    }
    get newLength() {
      let result = 0;
      for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
        let ins = this.sections[i2 + 1];
        result += ins < 0 ? this.sections[i2] : ins;
      }
      return result;
    }
    get empty() {
      return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0;
    }
    iterGaps(f) {
      for (let i2 = 0, posA = 0, posB = 0; i2 < this.sections.length; ) {
        let len = this.sections[i2++], ins = this.sections[i2++];
        if (ins < 0) {
          f(posA, posB, len);
          posB += len;
        } else {
          posB += ins;
        }
        posA += len;
      }
    }
    iterChangedRanges(f, individual = false) {
      iterChanges(this, f, individual);
    }
    get invertedDesc() {
      let sections = [];
      for (let i2 = 0; i2 < this.sections.length; ) {
        let len = this.sections[i2++], ins = this.sections[i2++];
        if (ins < 0)
          sections.push(len, ins);
        else
          sections.push(ins, len);
      }
      return new ChangeDesc(sections);
    }
    composeDesc(other) {
      return this.empty ? other : other.empty ? this : composeSets(this, other);
    }
    mapDesc(other, before = false) {
      return other.empty ? this : mapSet(this, other, before);
    }
    mapPos(pos, assoc = -1, mode = MapMode.Simple) {
      let posA = 0, posB = 0;
      for (let i2 = 0; i2 < this.sections.length; ) {
        let len = this.sections[i2++], ins = this.sections[i2++], endA = posA + len;
        if (ins < 0) {
          if (endA > pos)
            return posB + (pos - posA);
          posB += len;
        } else {
          if (mode != MapMode.Simple && endA >= pos && (mode == MapMode.TrackDel && posA < pos && endA > pos || mode == MapMode.TrackBefore && posA < pos || mode == MapMode.TrackAfter && endA > pos))
            return null;
          if (endA > pos || endA == pos && assoc < 0 && !len)
            return pos == posA || assoc < 0 ? posB : posB + ins;
          posB += ins;
        }
        posA = endA;
      }
      if (pos > posA)
        throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`);
      return posB;
    }
    touchesRange(from, to = from) {
      for (let i2 = 0, pos = 0; i2 < this.sections.length && pos <= to; ) {
        let len = this.sections[i2++], ins = this.sections[i2++], end = pos + len;
        if (ins >= 0 && pos <= to && end >= from)
          return pos < from && end > to ? "cover" : true;
        pos = end;
      }
      return false;
    }
    toString() {
      let result = "";
      for (let i2 = 0; i2 < this.sections.length; ) {
        let len = this.sections[i2++], ins = this.sections[i2++];
        result += (result ? " " : "") + len + (ins >= 0 ? ":" + ins : "");
      }
      return result;
    }
    toJSON() {
      return this.sections;
    }
    static fromJSON(json) {
      if (!Array.isArray(json) || json.length % 2 || json.some((a) => typeof a != "number"))
        throw new RangeError("Invalid JSON representation of ChangeDesc");
      return new ChangeDesc(json);
    }
    static create(sections) {
      return new ChangeDesc(sections);
    }
  }
  class ChangeSet extends ChangeDesc {
    constructor(sections, inserted) {
      super(sections);
      this.inserted = inserted;
    }
    apply(doc2) {
      if (this.length != doc2.length)
        throw new RangeError("Applying change set to a document with the wrong length");
      iterChanges(this, (fromA, toA, fromB, _toB, text) => doc2 = doc2.replace(fromB, fromB + (toA - fromA), text), false);
      return doc2;
    }
    mapDesc(other, before = false) {
      return mapSet(this, other, before, true);
    }
    invert(doc2) {
      let sections = this.sections.slice(), inserted = [];
      for (let i2 = 0, pos = 0; i2 < sections.length; i2 += 2) {
        let len = sections[i2], ins = sections[i2 + 1];
        if (ins >= 0) {
          sections[i2] = ins;
          sections[i2 + 1] = len;
          let index2 = i2 >> 1;
          while (inserted.length < index2)
            inserted.push(Text$1.empty);
          inserted.push(len ? doc2.slice(pos, pos + len) : Text$1.empty);
        }
        pos += len;
      }
      return new ChangeSet(sections, inserted);
    }
    compose(other) {
      return this.empty ? other : other.empty ? this : composeSets(this, other, true);
    }
    map(other, before = false) {
      return other.empty ? this : mapSet(this, other, before, true);
    }
    iterChanges(f, individual = false) {
      iterChanges(this, f, individual);
    }
    get desc() {
      return ChangeDesc.create(this.sections);
    }
    filter(ranges) {
      let resultSections = [], resultInserted = [], filteredSections = [];
      let iter = new SectionIter(this);
      done:
        for (let i2 = 0, pos = 0; ; ) {
          let next = i2 == ranges.length ? 1e9 : ranges[i2++];
          while (pos < next || pos == next && iter.len == 0) {
            if (iter.done)
              break done;
            let len = Math.min(iter.len, next - pos);
            addSection(filteredSections, len, -1);
            let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;
            addSection(resultSections, len, ins);
            if (ins > 0)
              addInsert(resultInserted, resultSections, iter.text);
            iter.forward(len);
            pos += len;
          }
          let end = ranges[i2++];
          while (pos < end) {
            if (iter.done)
              break done;
            let len = Math.min(iter.len, end - pos);
            addSection(resultSections, len, -1);
            addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);
            iter.forward(len);
            pos += len;
          }
        }
      return {
        changes: new ChangeSet(resultSections, resultInserted),
        filtered: ChangeDesc.create(filteredSections)
      };
    }
    toJSON() {
      let parts = [];
      for (let i2 = 0; i2 < this.sections.length; i2 += 2) {
        let len = this.sections[i2], ins = this.sections[i2 + 1];
        if (ins < 0)
          parts.push(len);
        else if (ins == 0)
          parts.push([len]);
        else
          parts.push([len].concat(this.inserted[i2 >> 1].toJSON()));
      }
      return parts;
    }
    static of(changes, length, lineSep) {
      let sections = [], inserted = [], pos = 0;
      let total = null;
      function flush(force = false) {
        if (!force && !sections.length)
          return;
        if (pos < length)
          addSection(sections, length - pos, -1);
        let set = new ChangeSet(sections, inserted);
        total = total ? total.compose(set.map(total)) : set;
        sections = [];
        inserted = [];
        pos = 0;
      }
      function process2(spec) {
        if (Array.isArray(spec)) {
          for (let sub of spec)
            process2(sub);
        } else if (spec instanceof ChangeSet) {
          if (spec.length != length)
            throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);
          flush();
          total = total ? total.compose(spec.map(total)) : spec;
        } else {
          let { from, to = from, insert: insert2 } = spec;
          if (from > to || from < 0 || to > length)
            throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length})`);
          let insText = !insert2 ? Text$1.empty : typeof insert2 == "string" ? Text$1.of(insert2.split(lineSep || DefaultSplit)) : insert2;
          let insLen = insText.length;
          if (from == to && insLen == 0)
            return;
          if (from < pos)
            flush();
          if (from > pos)
            addSection(sections, from - pos, -1);
          addSection(sections, to - from, insLen);
          addInsert(inserted, sections, insText);
          pos = to;
        }
      }
      process2(changes);
      flush(!total);
      return total;
    }
    static empty(length) {
      return new ChangeSet(length ? [length, -1] : [], []);
    }
    static fromJSON(json) {
      if (!Array.isArray(json))
        throw new RangeError("Invalid JSON representation of ChangeSet");
      let sections = [], inserted = [];
      for (let i2 = 0; i2 < json.length; i2++) {
        let part = json[i2];
        if (typeof part == "number") {
          sections.push(part, -1);
        } else if (!Array.isArray(part) || typeof part[0] != "number" || part.some((e, i3) => i3 && typeof e != "string")) {
          throw new RangeError("Invalid JSON representation of ChangeSet");
        } else if (part.length == 1) {
          sections.push(part[0], 0);
        } else {
          while (inserted.length < i2)
            inserted.push(Text$1.empty);
          inserted[i2] = Text$1.of(part.slice(1));
          sections.push(part[0], inserted[i2].length);
        }
      }
      return new ChangeSet(sections, inserted);
    }
    static createSet(sections, inserted) {
      return new ChangeSet(sections, inserted);
    }
  }
  function addSection(sections, len, ins, forceJoin = false) {
    if (len == 0 && ins <= 0)
      return;
    let last = sections.length - 2;
    if (last >= 0 && ins <= 0 && ins == sections[last + 1])
      sections[last] += len;
    else if (len == 0 && sections[last] == 0)
      sections[last + 1] += ins;
    else if (forceJoin) {
      sections[last] += len;
      sections[last + 1] += ins;
    } else
      sections.push(len, ins);
  }
  function addInsert(values, sections, value2) {
    if (value2.length == 0)
      return;
    let index2 = sections.length - 2 >> 1;
    if (index2 < values.length) {
      values[values.length - 1] = values[values.length - 1].append(value2);
    } else {
      while (values.length < index2)
        values.push(Text$1.empty);
      values.push(value2);
    }
  }
  function iterChanges(desc, f, individual) {
    let inserted = desc.inserted;
    for (let posA = 0, posB = 0, i2 = 0; i2 < desc.sections.length; ) {
      let len = desc.sections[i2++], ins = desc.sections[i2++];
      if (ins < 0) {
        posA += len;
        posB += len;
      } else {
        let endA = posA, endB = posB, text = Text$1.empty;
        for (; ; ) {
          endA += len;
          endB += ins;
          if (ins && inserted)
            text = text.append(inserted[i2 - 2 >> 1]);
          if (individual || i2 == desc.sections.length || desc.sections[i2 + 1] < 0)
            break;
          len = desc.sections[i2++];
          ins = desc.sections[i2++];
        }
        f(posA, endA, posB, endB, text);
        posA = endA;
        posB = endB;
      }
    }
  }
  function mapSet(setA, setB, before, mkSet = false) {
    let sections = [], insert2 = mkSet ? [] : null;
    let a = new SectionIter(setA), b = new SectionIter(setB);
    for (let inserted = -1; ; ) {
      if (a.ins == -1 && b.ins == -1) {
        let len = Math.min(a.len, b.len);
        addSection(sections, len, -1);
        a.forward(len);
        b.forward(len);
      } else if (b.ins >= 0 && (a.ins < 0 || inserted == a.i || a.off == 0 && (b.len < a.len || b.len == a.len && !before))) {
        let len = b.len;
        addSection(sections, b.ins, -1);
        while (len) {
          let piece = Math.min(a.len, len);
          if (a.ins >= 0 && inserted < a.i && a.len <= piece) {
            addSection(sections, 0, a.ins);
            if (insert2)
              addInsert(insert2, sections, a.text);
            inserted = a.i;
          }
          a.forward(piece);
          len -= piece;
        }
        b.next();
      } else if (a.ins >= 0) {
        let len = 0, left = a.len;
        while (left) {
          if (b.ins == -1) {
            let piece = Math.min(left, b.len);
            len += piece;
            left -= piece;
            b.forward(piece);
          } else if (b.ins == 0 && b.len < left) {
            left -= b.len;
            b.next();
          } else {
            break;
          }
        }
        addSection(sections, len, inserted < a.i ? a.ins : 0);
        if (insert2 && inserted < a.i)
          addInsert(insert2, sections, a.text);
        inserted = a.i;
        a.forward(a.len - left);
      } else if (a.done && b.done) {
        return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
      } else {
        throw new Error("Mismatched change set lengths");
      }
    }
  }
  function composeSets(setA, setB, mkSet = false) {
    let sections = [];
    let insert2 = mkSet ? [] : null;
    let a = new SectionIter(setA), b = new SectionIter(setB);
    for (let open2 = false; ; ) {
      if (a.done && b.done) {
        return insert2 ? ChangeSet.createSet(sections, insert2) : ChangeDesc.create(sections);
      } else if (a.ins == 0) {
        addSection(sections, a.len, 0, open2);
        a.next();
      } else if (b.len == 0 && !b.done) {
        addSection(sections, 0, b.ins, open2);
        if (insert2)
          addInsert(insert2, sections, b.text);
        b.next();
      } else if (a.done || b.done) {
        throw new Error("Mismatched change set lengths");
      } else {
        let len = Math.min(a.len2, b.len), sectionLen = sections.length;
        if (a.ins == -1) {
          let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;
          addSection(sections, len, insB, open2);
          if (insert2 && insB)
            addInsert(insert2, sections, b.text);
        } else if (b.ins == -1) {
          addSection(sections, a.off ? 0 : a.len, len, open2);
          if (insert2)
            addInsert(insert2, sections, a.textBit(len));
        } else {
          addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open2);
          if (insert2 && !b.off)
            addInsert(insert2, sections, b.text);
        }
        open2 = (a.ins > len || b.ins >= 0 && b.len > len) && (open2 || sections.length > sectionLen);
        a.forward2(len);
        b.forward(len);
      }
    }
  }
  class SectionIter {
    constructor(set) {
      this.set = set;
      this.i = 0;
      this.next();
    }
    next() {
      let { sections } = this.set;
      if (this.i < sections.length) {
        this.len = sections[this.i++];
        this.ins = sections[this.i++];
      } else {
        this.len = 0;
        this.ins = -2;
      }
      this.off = 0;
    }
    get done() {
      return this.ins == -2;
    }
    get len2() {
      return this.ins < 0 ? this.len : this.ins;
    }
    get text() {
      let { inserted } = this.set, index2 = this.i - 2 >> 1;
      return index2 >= inserted.length ? Text$1.empty : inserted[index2];
    }
    textBit(len) {
      let { inserted } = this.set, index2 = this.i - 2 >> 1;
      return index2 >= inserted.length && !len ? Text$1.empty : inserted[index2].slice(this.off, len == null ? void 0 : this.off + len);
    }
    forward(len) {
      if (len == this.len)
        this.next();
      else {
        this.len -= len;
        this.off += len;
      }
    }
    forward2(len) {
      if (this.ins == -1)
        this.forward(len);
      else if (len == this.ins)
        this.next();
      else {
        this.ins -= len;
        this.off += len;
      }
    }
  }
  class SelectionRange {
    constructor(from, to, flags) {
      this.from = from;
      this.to = to;
      this.flags = flags;
    }
    get anchor() {
      return this.flags & 32 ? this.to : this.from;
    }
    get head() {
      return this.flags & 32 ? this.from : this.to;
    }
    get empty() {
      return this.from == this.to;
    }
    get assoc() {
      return this.flags & 8 ? -1 : this.flags & 16 ? 1 : 0;
    }
    get bidiLevel() {
      let level = this.flags & 7;
      return level == 7 ? null : level;
    }
    get goalColumn() {
      let value2 = this.flags >> 6;
      return value2 == 16777215 ? void 0 : value2;
    }
    map(change, assoc = -1) {
      let from, to;
      if (this.empty) {
        from = to = change.mapPos(this.from, assoc);
      } else {
        from = change.mapPos(this.from, 1);
        to = change.mapPos(this.to, -1);
      }
      return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);
    }
    extend(from, to = from) {
      if (from <= this.anchor && to >= this.anchor)
        return EditorSelection.range(from, to);
      let head = Math.abs(from - this.anchor) > Math.abs(to - this.anchor) ? from : to;
      return EditorSelection.range(this.anchor, head);
    }
    eq(other) {
      return this.anchor == other.anchor && this.head == other.head;
    }
    toJSON() {
      return { anchor: this.anchor, head: this.head };
    }
    static fromJSON(json) {
      if (!json || typeof json.anchor != "number" || typeof json.head != "number")
        throw new RangeError("Invalid JSON representation for SelectionRange");
      return EditorSelection.range(json.anchor, json.head);
    }
    static create(from, to, flags) {
      return new SelectionRange(from, to, flags);
    }
  }
  class EditorSelection {
    constructor(ranges, mainIndex) {
      this.ranges = ranges;
      this.mainIndex = mainIndex;
    }
    map(change, assoc = -1) {
      if (change.empty)
        return this;
      return EditorSelection.create(this.ranges.map((r) => r.map(change, assoc)), this.mainIndex);
    }
    eq(other) {
      if (this.ranges.length != other.ranges.length || this.mainIndex != other.mainIndex)
        return false;
      for (let i2 = 0; i2 < this.ranges.length; i2++)
        if (!this.ranges[i2].eq(other.ranges[i2]))
          return false;
      return true;
    }
    get main() {
      return this.ranges[this.mainIndex];
    }
    asSingle() {
      return this.ranges.length == 1 ? this : new EditorSelection([this.main], 0);
    }
    addRange(range, main = true) {
      return EditorSelection.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1);
    }
    replaceRange(range, which = this.mainIndex) {
      let ranges = this.ranges.slice();
      ranges[which] = range;
      return EditorSelection.create(ranges, this.mainIndex);
    }
    toJSON() {
      return { ranges: this.ranges.map((r) => r.toJSON()), main: this.mainIndex };
    }
    static fromJSON(json) {
      if (!json || !Array.isArray(json.ranges) || typeof json.main != "number" || json.main >= json.ranges.length)
        throw new RangeError("Invalid JSON representation for EditorSelection");
      return new EditorSelection(json.ranges.map((r) => SelectionRange.fromJSON(r)), json.main);
    }
    static single(anchor, head = anchor) {
      return new EditorSelection([EditorSelection.range(anchor, head)], 0);
    }
    static create(ranges, mainIndex = 0) {
      if (ranges.length == 0)
        throw new RangeError("A selection needs at least one range");
      for (let pos = 0, i2 = 0; i2 < ranges.length; i2++) {
        let range = ranges[i2];
        if (range.empty ? range.from <= pos : range.from < pos)
          return EditorSelection.normalized(ranges.slice(), mainIndex);
        pos = range.to;
      }
      return new EditorSelection(ranges, mainIndex);
    }
    static cursor(pos, assoc = 0, bidiLevel, goalColumn) {
      return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 : 16) | (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) | (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6);
    }
    static range(anchor, head, goalColumn, bidiLevel) {
      let flags = (goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215) << 6 | (bidiLevel == null ? 7 : Math.min(6, bidiLevel));
      return head < anchor ? SelectionRange.create(head, anchor, 32 | 16 | flags) : SelectionRange.create(anchor, head, (head > anchor ? 8 : 0) | flags);
    }
    static normalized(ranges, mainIndex = 0) {
      let main = ranges[mainIndex];
      ranges.sort((a, b) => a.from - b.from);
      mainIndex = ranges.indexOf(main);
      for (let i2 = 1; i2 < ranges.length; i2++) {
        let range = ranges[i2], prev = ranges[i2 - 1];
        if (range.empty ? range.from <= prev.to : range.from < prev.to) {
          let from = prev.from, to = Math.max(range.to, prev.to);
          if (i2 <= mainIndex)
            mainIndex--;
          ranges.splice(--i2, 2, range.anchor > range.head ? EditorSelection.range(to, from) : EditorSelection.range(from, to));
        }
      }
      return new EditorSelection(ranges, mainIndex);
    }
  }
  function checkSelection(selection, docLength) {
    for (let range of selection.ranges)
      if (range.to > docLength)
        throw new RangeError("Selection points outside of document");
  }
  let nextID = 0;
  class Facet {
    constructor(combine, compareInput, compare2, isStatic, enables) {
      this.combine = combine;
      this.compareInput = compareInput;
      this.compare = compare2;
      this.isStatic = isStatic;
      this.id = nextID++;
      this.default = combine([]);
      this.extensions = typeof enables == "function" ? enables(this) : enables;
    }
    get reader() {
      return this;
    }
    static define(config2 = {}) {
      return new Facet(config2.combine || ((a) => a), config2.compareInput || ((a, b) => a === b), config2.compare || (!config2.combine ? sameArray$1 : (a, b) => a === b), !!config2.static, config2.enables);
    }
    of(value2) {
      return new FacetProvider([], this, 0, value2);
    }
    compute(deps, get2) {
      if (this.isStatic)
        throw new Error("Can't compute a static facet");
      return new FacetProvider(deps, this, 1, get2);
    }
    computeN(deps, get2) {
      if (this.isStatic)
        throw new Error("Can't compute a static facet");
      return new FacetProvider(deps, this, 2, get2);
    }
    from(field, get2) {
      if (!get2)
        get2 = (x) => x;
      return this.compute([field], (state) => get2(state.field(field)));
    }
  }
  function sameArray$1(a, b) {
    return a == b || a.length == b.length && a.every((e, i2) => e === b[i2]);
  }
  class FacetProvider {
    constructor(dependencies, facet, type, value2) {
      this.dependencies = dependencies;
      this.facet = facet;
      this.type = type;
      this.value = value2;
      this.id = nextID++;
    }
    dynamicSlot(addresses) {
      var _a2;
      let getter = this.value;
      let compare2 = this.facet.compareInput;
      let id2 = this.id, idx = addresses[id2] >> 1, multi = this.type == 2;
      let depDoc = false, depSel = false, depAddrs = [];
      for (let dep of this.dependencies) {
        if (dep == "doc")
          depDoc = true;
        else if (dep == "selection")
          depSel = true;
        else if ((((_a2 = addresses[dep.id]) !== null && _a2 !== void 0 ? _a2 : 1) & 1) == 0)
          depAddrs.push(addresses[dep.id]);
      }
      return {
        create(state) {
          state.values[idx] = getter(state);
          return 1;
        },
        update(state, tr) {
          if (depDoc && tr.docChanged || depSel && (tr.docChanged || tr.selection) || ensureAll(state, depAddrs)) {
            let newVal = getter(state);
            if (multi ? !compareArray(newVal, state.values[idx], compare2) : !compare2(newVal, state.values[idx])) {
              state.values[idx] = newVal;
              return 1;
            }
          }
          return 0;
        },
        reconfigure: (state, oldState) => {
          let newVal, oldAddr = oldState.config.address[id2];
          if (oldAddr != null) {
            let oldVal = getAddr(oldState, oldAddr);
            if (this.dependencies.every((dep) => {
              return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) : dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;
            }) || (multi ? compareArray(newVal = getter(state), oldVal, compare2) : compare2(newVal = getter(state), oldVal))) {
              state.values[idx] = oldVal;
              return 0;
            }
          } else {
            newVal = getter(state);
          }
          state.values[idx] = newVal;
          return 1;
        }
      };
    }
  }
  function compareArray(a, b, compare2) {
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++)
      if (!compare2(a[i2], b[i2]))
        return false;
    return true;
  }
  function ensureAll(state, addrs) {
    let changed = false;
    for (let addr of addrs)
      if (ensureAddr(state, addr) & 1)
        changed = true;
    return changed;
  }
  function dynamicFacetSlot(addresses, facet, providers) {
    let providerAddrs = providers.map((p) => addresses[p.id]);
    let providerTypes = providers.map((p) => p.type);
    let dynamic = providerAddrs.filter((p) => !(p & 1));
    let idx = addresses[facet.id] >> 1;
    function get2(state) {
      let values = [];
      for (let i2 = 0; i2 < providerAddrs.length; i2++) {
        let value2 = getAddr(state, providerAddrs[i2]);
        if (providerTypes[i2] == 2)
          for (let val of value2)
            values.push(val);
        else
          values.push(value2);
      }
      return facet.combine(values);
    }
    return {
      create(state) {
        for (let addr of providerAddrs)
          ensureAddr(state, addr);
        state.values[idx] = get2(state);
        return 1;
      },
      update(state, tr) {
        if (!ensureAll(state, dynamic))
          return 0;
        let value2 = get2(state);
        if (facet.compare(value2, state.values[idx]))
          return 0;
        state.values[idx] = value2;
        return 1;
      },
      reconfigure(state, oldState) {
        let depChanged = ensureAll(state, providerAddrs);
        let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);
        if (oldProviders && !depChanged && sameArray$1(providers, oldProviders)) {
          state.values[idx] = oldValue;
          return 0;
        }
        let value2 = get2(state);
        if (facet.compare(value2, oldValue)) {
          state.values[idx] = oldValue;
          return 0;
        }
        state.values[idx] = value2;
        return 1;
      }
    };
  }
  const initField = /* @__PURE__ */ Facet.define({ static: true });
  class StateField {
    constructor(id2, createF, updateF, compareF, spec) {
      this.id = id2;
      this.createF = createF;
      this.updateF = updateF;
      this.compareF = compareF;
      this.spec = spec;
      this.provides = void 0;
    }
    static define(config2) {
      let field = new StateField(nextID++, config2.create, config2.update, config2.compare || ((a, b) => a === b), config2);
      if (config2.provide)
        field.provides = config2.provide(field);
      return field;
    }
    create(state) {
      let init = state.facet(initField).find((i2) => i2.field == this);
      return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);
    }
    slot(addresses) {
      let idx = addresses[this.id] >> 1;
      return {
        create: (state) => {
          state.values[idx] = this.create(state);
          return 1;
        },
        update: (state, tr) => {
          let oldVal = state.values[idx];
          let value2 = this.updateF(oldVal, tr);
          if (this.compareF(oldVal, value2))
            return 0;
          state.values[idx] = value2;
          return 1;
        },
        reconfigure: (state, oldState) => {
          if (oldState.config.address[this.id] != null) {
            state.values[idx] = oldState.field(this);
            return 0;
          }
          state.values[idx] = this.create(state);
          return 1;
        }
      };
    }
    init(create) {
      return [this, initField.of({ field: this, create })];
    }
    get extension() {
      return this;
    }
  }
  const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };
  function prec(value2) {
    return (ext) => new PrecExtension(ext, value2);
  }
  const Prec = {
    highest: /* @__PURE__ */ prec(Prec_.highest),
    high: /* @__PURE__ */ prec(Prec_.high),
    default: /* @__PURE__ */ prec(Prec_.default),
    low: /* @__PURE__ */ prec(Prec_.low),
    lowest: /* @__PURE__ */ prec(Prec_.lowest)
  };
  class PrecExtension {
    constructor(inner, prec2) {
      this.inner = inner;
      this.prec = prec2;
    }
  }
  class Compartment {
    of(ext) {
      return new CompartmentInstance(this, ext);
    }
    reconfigure(content2) {
      return Compartment.reconfigure.of({ compartment: this, extension: content2 });
    }
    get(state) {
      return state.config.compartments.get(this);
    }
  }
  class CompartmentInstance {
    constructor(compartment, inner) {
      this.compartment = compartment;
      this.inner = inner;
    }
  }
  class Configuration {
    constructor(base2, compartments, dynamicSlots, address, staticValues, facets) {
      this.base = base2;
      this.compartments = compartments;
      this.dynamicSlots = dynamicSlots;
      this.address = address;
      this.staticValues = staticValues;
      this.facets = facets;
      this.statusTemplate = [];
      while (this.statusTemplate.length < dynamicSlots.length)
        this.statusTemplate.push(0);
    }
    staticFacet(facet) {
      let addr = this.address[facet.id];
      return addr == null ? facet.default : this.staticValues[addr >> 1];
    }
    static resolve(base2, compartments, oldState) {
      let fields = [];
      let facets = Object.create(null);
      let newCompartments = new Map();
      for (let ext of flatten(base2, compartments, newCompartments)) {
        if (ext instanceof StateField)
          fields.push(ext);
        else
          (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);
      }
      let address = Object.create(null);
      let staticValues = [];
      let dynamicSlots = [];
      for (let field of fields) {
        address[field.id] = dynamicSlots.length << 1;
        dynamicSlots.push((a) => field.slot(a));
      }
      let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;
      for (let id2 in facets) {
        let providers = facets[id2], facet = providers[0].facet;
        let oldProviders = oldFacets && oldFacets[id2] || [];
        if (providers.every((p) => p.type == 0)) {
          address[facet.id] = staticValues.length << 1 | 1;
          if (sameArray$1(oldProviders, providers)) {
            staticValues.push(oldState.facet(facet));
          } else {
            let value2 = facet.combine(providers.map((p) => p.value));
            staticValues.push(oldState && facet.compare(value2, oldState.facet(facet)) ? oldState.facet(facet) : value2);
          }
        } else {
          for (let p of providers) {
            if (p.type == 0) {
              address[p.id] = staticValues.length << 1 | 1;
              staticValues.push(p.value);
            } else {
              address[p.id] = dynamicSlots.length << 1;
              dynamicSlots.push((a) => p.dynamicSlot(a));
            }
          }
          address[facet.id] = dynamicSlots.length << 1;
          dynamicSlots.push((a) => dynamicFacetSlot(a, facet, providers));
        }
      }
      let dynamic = dynamicSlots.map((f) => f(address));
      return new Configuration(base2, newCompartments, dynamic, address, staticValues, facets);
    }
  }
  function flatten(extension, compartments, newCompartments) {
    let result = [[], [], [], [], []];
    let seen = new Map();
    function inner(ext, prec2) {
      let known = seen.get(ext);
      if (known != null) {
        if (known <= prec2)
          return;
        let found = result[known].indexOf(ext);
        if (found > -1)
          result[known].splice(found, 1);
        if (ext instanceof CompartmentInstance)
          newCompartments.delete(ext.compartment);
      }
      seen.set(ext, prec2);
      if (Array.isArray(ext)) {
        for (let e of ext)
          inner(e, prec2);
      } else if (ext instanceof CompartmentInstance) {
        if (newCompartments.has(ext.compartment))
          throw new RangeError(`Duplicate use of compartment in extensions`);
        let content2 = compartments.get(ext.compartment) || ext.inner;
        newCompartments.set(ext.compartment, content2);
        inner(content2, prec2);
      } else if (ext instanceof PrecExtension) {
        inner(ext.inner, ext.prec);
      } else if (ext instanceof StateField) {
        result[prec2].push(ext);
        if (ext.provides)
          inner(ext.provides, prec2);
      } else if (ext instanceof FacetProvider) {
        result[prec2].push(ext);
        if (ext.facet.extensions)
          inner(ext.facet.extensions, Prec_.default);
      } else {
        let content2 = ext.extension;
        if (!content2)
          throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
        inner(content2, prec2);
      }
    }
    inner(extension, Prec_.default);
    return result.reduce((a, b) => a.concat(b));
  }
  function ensureAddr(state, addr) {
    if (addr & 1)
      return 2;
    let idx = addr >> 1;
    let status = state.status[idx];
    if (status == 4)
      throw new Error("Cyclic dependency between fields and/or facets");
    if (status & 2)
      return status;
    state.status[idx] = 4;
    let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);
    return state.status[idx] = 2 | changed;
  }
  function getAddr(state, addr) {
    return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];
  }
  const languageData = /* @__PURE__ */ Facet.define();
  const allowMultipleSelections = /* @__PURE__ */ Facet.define({
    combine: (values) => values.some((v) => v),
    static: true
  });
  const lineSeparator = /* @__PURE__ */ Facet.define({
    combine: (values) => values.length ? values[0] : void 0,
    static: true
  });
  const changeFilter = /* @__PURE__ */ Facet.define();
  const transactionFilter = /* @__PURE__ */ Facet.define();
  const transactionExtender = /* @__PURE__ */ Facet.define();
  const readOnly = /* @__PURE__ */ Facet.define({
    combine: (values) => values.length ? values[0] : false
  });
  class Annotation {
    constructor(type, value2) {
      this.type = type;
      this.value = value2;
    }
    static define() {
      return new AnnotationType();
    }
  }
  class AnnotationType {
    of(value2) {
      return new Annotation(this, value2);
    }
  }
  class StateEffectType {
    constructor(map) {
      this.map = map;
    }
    of(value2) {
      return new StateEffect(this, value2);
    }
  }
  class StateEffect {
    constructor(type, value2) {
      this.type = type;
      this.value = value2;
    }
    map(mapping) {
      let mapped = this.type.map(this.value, mapping);
      return mapped === void 0 ? void 0 : mapped == this.value ? this : new StateEffect(this.type, mapped);
    }
    is(type) {
      return this.type == type;
    }
    static define(spec = {}) {
      return new StateEffectType(spec.map || ((v) => v));
    }
    static mapEffects(effects, mapping) {
      if (!effects.length)
        return effects;
      let result = [];
      for (let effect of effects) {
        let mapped = effect.map(mapping);
        if (mapped)
          result.push(mapped);
      }
      return result;
    }
  }
  StateEffect.reconfigure = /* @__PURE__ */ StateEffect.define();
  StateEffect.appendConfig = /* @__PURE__ */ StateEffect.define();
  class Transaction {
    constructor(startState, changes, selection, effects, annotations, scrollIntoView2) {
      this.startState = startState;
      this.changes = changes;
      this.selection = selection;
      this.effects = effects;
      this.annotations = annotations;
      this.scrollIntoView = scrollIntoView2;
      this._doc = null;
      this._state = null;
      if (selection)
        checkSelection(selection, changes.newLength);
      if (!annotations.some((a) => a.type == Transaction.time))
        this.annotations = annotations.concat(Transaction.time.of(Date.now()));
    }
    static create(startState, changes, selection, effects, annotations, scrollIntoView2) {
      return new Transaction(startState, changes, selection, effects, annotations, scrollIntoView2);
    }
    get newDoc() {
      return this._doc || (this._doc = this.changes.apply(this.startState.doc));
    }
    get newSelection() {
      return this.selection || this.startState.selection.map(this.changes);
    }
    get state() {
      if (!this._state)
        this.startState.applyTransaction(this);
      return this._state;
    }
    annotation(type) {
      for (let ann of this.annotations)
        if (ann.type == type)
          return ann.value;
      return void 0;
    }
    get docChanged() {
      return !this.changes.empty;
    }
    get reconfigured() {
      return this.startState.config != this.state.config;
    }
    isUserEvent(event) {
      let e = this.annotation(Transaction.userEvent);
      return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == "."));
    }
  }
  Transaction.time = /* @__PURE__ */ Annotation.define();
  Transaction.userEvent = /* @__PURE__ */ Annotation.define();
  Transaction.addToHistory = /* @__PURE__ */ Annotation.define();
  Transaction.remote = /* @__PURE__ */ Annotation.define();
  function joinRanges(a, b) {
    let result = [];
    for (let iA = 0, iB = 0; ; ) {
      let from, to;
      if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {
        from = a[iA++];
        to = a[iA++];
      } else if (iB < b.length) {
        from = b[iB++];
        to = b[iB++];
      } else
        return result;
      if (!result.length || result[result.length - 1] < from)
        result.push(from, to);
      else if (result[result.length - 1] < to)
        result[result.length - 1] = to;
    }
  }
  function mergeTransaction(a, b, sequential) {
    var _a2;
    let mapForA, mapForB, changes;
    if (sequential) {
      mapForA = b.changes;
      mapForB = ChangeSet.empty(b.changes.length);
      changes = a.changes.compose(b.changes);
    } else {
      mapForA = b.changes.map(a.changes);
      mapForB = a.changes.mapDesc(b.changes, true);
      changes = a.changes.compose(mapForA);
    }
    return {
      changes,
      selection: b.selection ? b.selection.map(mapForB) : (_a2 = a.selection) === null || _a2 === void 0 ? void 0 : _a2.map(mapForA),
      effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),
      annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,
      scrollIntoView: a.scrollIntoView || b.scrollIntoView
    };
  }
  function resolveTransactionInner(state, spec, docSize) {
    let sel = spec.selection, annotations = asArray$1(spec.annotations);
    if (spec.userEvent)
      annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));
    return {
      changes: spec.changes instanceof ChangeSet ? spec.changes : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),
      selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),
      effects: asArray$1(spec.effects),
      annotations,
      scrollIntoView: !!spec.scrollIntoView
    };
  }
  function resolveTransaction(state, specs, filter) {
    let s = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);
    if (specs.length && specs[0].filter === false)
      filter = false;
    for (let i2 = 1; i2 < specs.length; i2++) {
      if (specs[i2].filter === false)
        filter = false;
      let seq = !!specs[i2].sequential;
      s = mergeTransaction(s, resolveTransactionInner(state, specs[i2], seq ? s.changes.newLength : state.doc.length), seq);
    }
    let tr = Transaction.create(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView);
    return extendTransaction(filter ? filterTransaction(tr) : tr);
  }
  function filterTransaction(tr) {
    let state = tr.startState;
    let result = true;
    for (let filter of state.facet(changeFilter)) {
      let value2 = filter(tr);
      if (value2 === false) {
        result = false;
        break;
      }
      if (Array.isArray(value2))
        result = result === true ? value2 : joinRanges(result, value2);
    }
    if (result !== true) {
      let changes, back;
      if (result === false) {
        back = tr.changes.invertedDesc;
        changes = ChangeSet.empty(state.doc.length);
      } else {
        let filtered = tr.changes.filter(result);
        changes = filtered.changes;
        back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;
      }
      tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);
    }
    let filters = state.facet(transactionFilter);
    for (let i2 = filters.length - 1; i2 >= 0; i2--) {
      let filtered = filters[i2](tr);
      if (filtered instanceof Transaction)
        tr = filtered;
      else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)
        tr = filtered[0];
      else
        tr = resolveTransaction(state, asArray$1(filtered), false);
    }
    return tr;
  }
  function extendTransaction(tr) {
    let state = tr.startState, extenders = state.facet(transactionExtender), spec = tr;
    for (let i2 = extenders.length - 1; i2 >= 0; i2--) {
      let extension = extenders[i2](tr);
      if (extension && Object.keys(extension).length)
        spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr.changes.newLength), true);
    }
    return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);
  }
  const none$2 = [];
  function asArray$1(value2) {
    return value2 == null ? none$2 : Array.isArray(value2) ? value2 : [value2];
  }
  var CharCategory = /* @__PURE__ */ function(CharCategory2) {
    CharCategory2[CharCategory2["Word"] = 0] = "Word";
    CharCategory2[CharCategory2["Space"] = 1] = "Space";
    CharCategory2[CharCategory2["Other"] = 2] = "Other";
    return CharCategory2;
  }(CharCategory || (CharCategory = {}));
  const nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
  let wordChar;
  try {
    wordChar = /* @__PURE__ */ new RegExp("[\\p{Alphabetic}\\p{Number}_]", "u");
  } catch (_) {
  }
  function hasWordChar(str) {
    if (wordChar)
      return wordChar.test(str);
    for (let i2 = 0; i2 < str.length; i2++) {
      let ch = str[i2];
      if (/\w/.test(ch) || ch > "\x80" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)))
        return true;
    }
    return false;
  }
  function makeCategorizer(wordChars) {
    return (char) => {
      if (!/\S/.test(char))
        return CharCategory.Space;
      if (hasWordChar(char))
        return CharCategory.Word;
      for (let i2 = 0; i2 < wordChars.length; i2++)
        if (char.indexOf(wordChars[i2]) > -1)
          return CharCategory.Word;
      return CharCategory.Other;
    };
  }
  class EditorState {
    constructor(config2, doc2, selection, values, computeSlot, tr) {
      this.config = config2;
      this.doc = doc2;
      this.selection = selection;
      this.values = values;
      this.status = config2.statusTemplate.slice();
      this.computeSlot = computeSlot;
      if (tr)
        tr._state = this;
      for (let i2 = 0; i2 < this.config.dynamicSlots.length; i2++)
        ensureAddr(this, i2 << 1);
      this.computeSlot = null;
    }
    field(field, require2 = true) {
      let addr = this.config.address[field.id];
      if (addr == null) {
        if (require2)
          throw new RangeError("Field is not present in this state");
        return void 0;
      }
      ensureAddr(this, addr);
      return getAddr(this, addr);
    }
    update(...specs) {
      return resolveTransaction(this, specs, true);
    }
    applyTransaction(tr) {
      let conf = this.config, { base: base2, compartments } = conf;
      for (let effect of tr.effects) {
        if (effect.is(Compartment.reconfigure)) {
          if (conf) {
            compartments = new Map();
            conf.compartments.forEach((val, key) => compartments.set(key, val));
            conf = null;
          }
          compartments.set(effect.value.compartment, effect.value.extension);
        } else if (effect.is(StateEffect.reconfigure)) {
          conf = null;
          base2 = effect.value;
        } else if (effect.is(StateEffect.appendConfig)) {
          conf = null;
          base2 = asArray$1(base2).concat(effect.value);
        }
      }
      let startValues;
      if (!conf) {
        conf = Configuration.resolve(base2, compartments, this);
        let intermediateState = new EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);
        startValues = intermediateState.values;
      } else {
        startValues = tr.startState.values.slice();
      }
      new EditorState(conf, tr.newDoc, tr.newSelection, startValues, (state, slot) => slot.update(state, tr), tr);
    }
    replaceSelection(text) {
      if (typeof text == "string")
        text = this.toText(text);
      return this.changeByRange((range) => ({
        changes: { from: range.from, to: range.to, insert: text },
        range: EditorSelection.cursor(range.from + text.length)
      }));
    }
    changeByRange(f) {
      let sel = this.selection;
      let result1 = f(sel.ranges[0]);
      let changes = this.changes(result1.changes), ranges = [result1.range];
      let effects = asArray$1(result1.effects);
      for (let i2 = 1; i2 < sel.ranges.length; i2++) {
        let result = f(sel.ranges[i2]);
        let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);
        for (let j = 0; j < i2; j++)
          ranges[j] = ranges[j].map(newMapped);
        let mapBy = changes.mapDesc(newChanges, true);
        ranges.push(result.range.map(mapBy));
        changes = changes.compose(newMapped);
        effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));
      }
      return {
        changes,
        selection: EditorSelection.create(ranges, sel.mainIndex),
        effects
      };
    }
    changes(spec = []) {
      if (spec instanceof ChangeSet)
        return spec;
      return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));
    }
    toText(string2) {
      return Text$1.of(string2.split(this.facet(EditorState.lineSeparator) || DefaultSplit));
    }
    sliceDoc(from = 0, to = this.doc.length) {
      return this.doc.sliceString(from, to, this.lineBreak);
    }
    facet(facet) {
      let addr = this.config.address[facet.id];
      if (addr == null)
        return facet.default;
      ensureAddr(this, addr);
      return getAddr(this, addr);
    }
    toJSON(fields) {
      let result = {
        doc: this.sliceDoc(),
        selection: this.selection.toJSON()
      };
      if (fields)
        for (let prop in fields) {
          let value2 = fields[prop];
          if (value2 instanceof StateField && this.config.address[value2.id] != null)
            result[prop] = value2.spec.toJSON(this.field(fields[prop]), this);
        }
      return result;
    }
    static fromJSON(json, config2 = {}, fields) {
      if (!json || typeof json.doc != "string")
        throw new RangeError("Invalid JSON representation for EditorState");
      let fieldInit = [];
      if (fields)
        for (let prop in fields) {
          if (Object.prototype.hasOwnProperty.call(json, prop)) {
            let field = fields[prop], value2 = json[prop];
            fieldInit.push(field.init((state) => field.spec.fromJSON(value2, state)));
          }
        }
      return EditorState.create({
        doc: json.doc,
        selection: EditorSelection.fromJSON(json.selection),
        extensions: config2.extensions ? fieldInit.concat([config2.extensions]) : fieldInit
      });
    }
    static create(config2 = {}) {
      let configuration = Configuration.resolve(config2.extensions || [], new Map());
      let doc2 = config2.doc instanceof Text$1 ? config2.doc : Text$1.of((config2.doc || "").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));
      let selection = !config2.selection ? EditorSelection.single(0) : config2.selection instanceof EditorSelection ? config2.selection : EditorSelection.single(config2.selection.anchor, config2.selection.head);
      checkSelection(selection, doc2.length);
      if (!configuration.staticFacet(allowMultipleSelections))
        selection = selection.asSingle();
      return new EditorState(configuration, doc2, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);
    }
    get tabSize() {
      return this.facet(EditorState.tabSize);
    }
    get lineBreak() {
      return this.facet(EditorState.lineSeparator) || "\n";
    }
    get readOnly() {
      return this.facet(readOnly);
    }
    phrase(phrase2, ...insert2) {
      for (let map of this.facet(EditorState.phrases))
        if (Object.prototype.hasOwnProperty.call(map, phrase2)) {
          phrase2 = map[phrase2];
          break;
        }
      if (insert2.length)
        phrase2 = phrase2.replace(/\$(\$|\d*)/g, (m, i2) => {
          if (i2 == "$")
            return "$";
          let n = +(i2 || 1);
          return !n || n > insert2.length ? m : insert2[n - 1];
        });
      return phrase2;
    }
    languageDataAt(name2, pos, side = -1) {
      let values = [];
      for (let provider of this.facet(languageData)) {
        for (let result of provider(this, pos, side)) {
          if (Object.prototype.hasOwnProperty.call(result, name2))
            values.push(result[name2]);
        }
      }
      return values;
    }
    charCategorizer(at) {
      return makeCategorizer(this.languageDataAt("wordChars", at).join(""));
    }
    wordAt(pos) {
      let { text, from, length } = this.doc.lineAt(pos);
      let cat = this.charCategorizer(pos);
      let start = pos - from, end = pos - from;
      while (start > 0) {
        let prev = findClusterBreak(text, start, false);
        if (cat(text.slice(prev, start)) != CharCategory.Word)
          break;
        start = prev;
      }
      while (end < length) {
        let next = findClusterBreak(text, end);
        if (cat(text.slice(end, next)) != CharCategory.Word)
          break;
        end = next;
      }
      return start == end ? null : EditorSelection.range(start + from, end + from);
    }
  }
  EditorState.allowMultipleSelections = allowMultipleSelections;
  EditorState.tabSize = /* @__PURE__ */ Facet.define({
    combine: (values) => values.length ? values[0] : 4
  });
  EditorState.lineSeparator = lineSeparator;
  EditorState.readOnly = readOnly;
  EditorState.phrases = /* @__PURE__ */ Facet.define({
    compare(a, b) {
      let kA = Object.keys(a), kB = Object.keys(b);
      return kA.length == kB.length && kA.every((k) => a[k] == b[k]);
    }
  });
  EditorState.languageData = languageData;
  EditorState.changeFilter = changeFilter;
  EditorState.transactionFilter = transactionFilter;
  EditorState.transactionExtender = transactionExtender;
  Compartment.reconfigure = /* @__PURE__ */ StateEffect.define();
  function combineConfig(configs, defaults2, combine = {}) {
    let result = {};
    for (let config2 of configs)
      for (let key of Object.keys(config2)) {
        let value2 = config2[key], current = result[key];
        if (current === void 0)
          result[key] = value2;
        else if (current === value2 || value2 === void 0)
          ;
        else if (Object.hasOwnProperty.call(combine, key))
          result[key] = combine[key](current, value2);
        else
          throw new Error("Config merge conflict for field " + key);
      }
    for (let key in defaults2)
      if (result[key] === void 0)
        result[key] = defaults2[key];
    return result;
  }
  class RangeValue {
    eq(other) {
      return this == other;
    }
    range(from, to = from) {
      return Range$1.create(from, to, this);
    }
  }
  RangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;
  RangeValue.prototype.point = false;
  RangeValue.prototype.mapMode = MapMode.TrackDel;
  class Range$1 {
    constructor(from, to, value2) {
      this.from = from;
      this.to = to;
      this.value = value2;
    }
    static create(from, to, value2) {
      return new Range$1(from, to, value2);
    }
  }
  function cmpRange(a, b) {
    return a.from - b.from || a.value.startSide - b.value.startSide;
  }
  class Chunk {
    constructor(from, to, value2, maxPoint) {
      this.from = from;
      this.to = to;
      this.value = value2;
      this.maxPoint = maxPoint;
    }
    get length() {
      return this.to[this.to.length - 1];
    }
    findIndex(pos, side, end, startAt = 0) {
      let arr = end ? this.to : this.from;
      for (let lo = startAt, hi = arr.length; ; ) {
        if (lo == hi)
          return lo;
        let mid = lo + hi >> 1;
        let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;
        if (mid == lo)
          return diff >= 0 ? lo : hi;
        if (diff >= 0)
          hi = mid;
        else
          lo = mid + 1;
      }
    }
    between(offset, from, to, f) {
      for (let i2 = this.findIndex(from, -1e9, true), e = this.findIndex(to, 1e9, false, i2); i2 < e; i2++)
        if (f(this.from[i2] + offset, this.to[i2] + offset, this.value[i2]) === false)
          return false;
    }
    map(offset, changes) {
      let value2 = [], from = [], to = [], newPos = -1, maxPoint = -1;
      for (let i2 = 0; i2 < this.value.length; i2++) {
        let val = this.value[i2], curFrom = this.from[i2] + offset, curTo = this.to[i2] + offset, newFrom, newTo;
        if (curFrom == curTo) {
          let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);
          if (mapped == null)
            continue;
          newFrom = newTo = mapped;
          if (val.startSide != val.endSide) {
            newTo = changes.mapPos(curFrom, val.endSide);
            if (newTo < newFrom)
              continue;
          }
        } else {
          newFrom = changes.mapPos(curFrom, val.startSide);
          newTo = changes.mapPos(curTo, val.endSide);
          if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)
            continue;
        }
        if ((newTo - newFrom || val.endSide - val.startSide) < 0)
          continue;
        if (newPos < 0)
          newPos = newFrom;
        if (val.point)
          maxPoint = Math.max(maxPoint, newTo - newFrom);
        value2.push(val);
        from.push(newFrom - newPos);
        to.push(newTo - newPos);
      }
      return { mapped: value2.length ? new Chunk(from, to, value2, maxPoint) : null, pos: newPos };
    }
  }
  class RangeSet {
    constructor(chunkPos, chunk, nextLayer, maxPoint) {
      this.chunkPos = chunkPos;
      this.chunk = chunk;
      this.nextLayer = nextLayer;
      this.maxPoint = maxPoint;
    }
    static create(chunkPos, chunk, nextLayer, maxPoint) {
      return new RangeSet(chunkPos, chunk, nextLayer, maxPoint);
    }
    get length() {
      let last = this.chunk.length - 1;
      return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);
    }
    get size() {
      if (this.isEmpty)
        return 0;
      let size = this.nextLayer.size;
      for (let chunk of this.chunk)
        size += chunk.value.length;
      return size;
    }
    chunkEnd(index2) {
      return this.chunkPos[index2] + this.chunk[index2].length;
    }
    update(updateSpec) {
      let { add: add2 = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec;
      let filter = updateSpec.filter;
      if (add2.length == 0 && !filter)
        return this;
      if (sort)
        add2 = add2.slice().sort(cmpRange);
      if (this.isEmpty)
        return add2.length ? RangeSet.of(add2) : this;
      let cur2 = new LayerCursor(this, null, -1).goto(0), i2 = 0, spill = [];
      let builder = new RangeSetBuilder();
      while (cur2.value || i2 < add2.length) {
        if (i2 < add2.length && (cur2.from - add2[i2].from || cur2.startSide - add2[i2].value.startSide) >= 0) {
          let range = add2[i2++];
          if (!builder.addInner(range.from, range.to, range.value))
            spill.push(range);
        } else if (cur2.rangeIndex == 1 && cur2.chunkIndex < this.chunk.length && (i2 == add2.length || this.chunkEnd(cur2.chunkIndex) < add2[i2].from) && (!filter || filterFrom > this.chunkEnd(cur2.chunkIndex) || filterTo < this.chunkPos[cur2.chunkIndex]) && builder.addChunk(this.chunkPos[cur2.chunkIndex], this.chunk[cur2.chunkIndex])) {
          cur2.nextChunk();
        } else {
          if (!filter || filterFrom > cur2.to || filterTo < cur2.from || filter(cur2.from, cur2.to, cur2.value)) {
            if (!builder.addInner(cur2.from, cur2.to, cur2.value))
              spill.push(Range$1.create(cur2.from, cur2.to, cur2.value));
          }
          cur2.next();
        }
      }
      return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet.empty : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));
    }
    map(changes) {
      if (changes.empty || this.isEmpty)
        return this;
      let chunks = [], chunkPos = [], maxPoint = -1;
      for (let i2 = 0; i2 < this.chunk.length; i2++) {
        let start = this.chunkPos[i2], chunk = this.chunk[i2];
        let touch = changes.touchesRange(start, start + chunk.length);
        if (touch === false) {
          maxPoint = Math.max(maxPoint, chunk.maxPoint);
          chunks.push(chunk);
          chunkPos.push(changes.mapPos(start));
        } else if (touch === true) {
          let { mapped, pos } = chunk.map(start, changes);
          if (mapped) {
            maxPoint = Math.max(maxPoint, mapped.maxPoint);
            chunks.push(mapped);
            chunkPos.push(pos);
          }
        }
      }
      let next = this.nextLayer.map(changes);
      return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);
    }
    between(from, to, f) {
      if (this.isEmpty)
        return;
      for (let i2 = 0; i2 < this.chunk.length; i2++) {
        let start = this.chunkPos[i2], chunk = this.chunk[i2];
        if (to >= start && from <= start + chunk.length && chunk.between(start, from - start, to - start, f) === false)
          return;
      }
      this.nextLayer.between(from, to, f);
    }
    iter(from = 0) {
      return HeapCursor.from([this]).goto(from);
    }
    get isEmpty() {
      return this.nextLayer == this;
    }
    static iter(sets, from = 0) {
      return HeapCursor.from(sets).goto(from);
    }
    static compare(oldSets, newSets, textDiff, comparator, minPointSize = -1) {
      let a = oldSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);
      let b = newSets.filter((set) => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);
      let sharedChunks = findSharedChunks(a, b, textDiff);
      let sideA = new SpanCursor(a, sharedChunks, minPointSize);
      let sideB = new SpanCursor(b, sharedChunks, minPointSize);
      textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));
      if (textDiff.empty && textDiff.length == 0)
        compare(sideA, 0, sideB, 0, 0, comparator);
    }
    static eq(oldSets, newSets, from = 0, to) {
      if (to == null)
        to = 1e9 - 1;
      let a = oldSets.filter((set) => !set.isEmpty && newSets.indexOf(set) < 0);
      let b = newSets.filter((set) => !set.isEmpty && oldSets.indexOf(set) < 0);
      if (a.length != b.length)
        return false;
      if (!a.length)
        return true;
      let sharedChunks = findSharedChunks(a, b);
      let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);
      for (; ; ) {
        if (sideA.to != sideB.to || !sameValues(sideA.active, sideB.active) || sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))
          return false;
        if (sideA.to > to)
          return true;
        sideA.next();
        sideB.next();
      }
    }
    static spans(sets, from, to, iterator, minPointSize = -1) {
      let cursor = new SpanCursor(sets, null, minPointSize).goto(from), pos = from;
      let openRanges = cursor.openStart;
      for (; ; ) {
        let curTo = Math.min(cursor.to, to);
        if (cursor.point) {
          let active = cursor.activeForPoint(cursor.to);
          let openCount = cursor.pointFrom < from ? active.length + 1 : Math.min(active.length, openRanges);
          iterator.point(pos, curTo, cursor.point, active, openCount, cursor.pointRank);
          openRanges = Math.min(cursor.openEnd(curTo), active.length);
        } else if (curTo > pos) {
          iterator.span(pos, curTo, cursor.active, openRanges);
          openRanges = cursor.openEnd(curTo);
        }
        if (cursor.to > to)
          return openRanges + (cursor.point && cursor.to > to ? 1 : 0);
        pos = cursor.to;
        cursor.next();
      }
    }
    static of(ranges, sort = false) {
      let build = new RangeSetBuilder();
      for (let range of ranges instanceof Range$1 ? [ranges] : sort ? lazySort(ranges) : ranges)
        build.add(range.from, range.to, range.value);
      return build.finish();
    }
  }
  RangeSet.empty = /* @__PURE__ */ new RangeSet([], [], null, -1);
  function lazySort(ranges) {
    if (ranges.length > 1)
      for (let prev = ranges[0], i2 = 1; i2 < ranges.length; i2++) {
        let cur2 = ranges[i2];
        if (cmpRange(prev, cur2) > 0)
          return ranges.slice().sort(cmpRange);
        prev = cur2;
      }
    return ranges;
  }
  RangeSet.empty.nextLayer = RangeSet.empty;
  class RangeSetBuilder {
    finishChunk(newArrays) {
      this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));
      this.chunkPos.push(this.chunkStart);
      this.chunkStart = -1;
      this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);
      this.maxPoint = -1;
      if (newArrays) {
        this.from = [];
        this.to = [];
        this.value = [];
      }
    }
    constructor() {
      this.chunks = [];
      this.chunkPos = [];
      this.chunkStart = -1;
      this.last = null;
      this.lastFrom = -1e9;
      this.lastTo = -1e9;
      this.from = [];
      this.to = [];
      this.value = [];
      this.maxPoint = -1;
      this.setMaxPoint = -1;
      this.nextLayer = null;
    }
    add(from, to, value2) {
      if (!this.addInner(from, to, value2))
        (this.nextLayer || (this.nextLayer = new RangeSetBuilder())).add(from, to, value2);
    }
    addInner(from, to, value2) {
      let diff = from - this.lastTo || value2.startSide - this.last.endSide;
      if (diff <= 0 && (from - this.lastFrom || value2.startSide - this.last.startSide) < 0)
        throw new Error("Ranges must be added sorted by `from` position and `startSide`");
      if (diff < 0)
        return false;
      if (this.from.length == 250)
        this.finishChunk(true);
      if (this.chunkStart < 0)
        this.chunkStart = from;
      this.from.push(from - this.chunkStart);
      this.to.push(to - this.chunkStart);
      this.last = value2;
      this.lastFrom = from;
      this.lastTo = to;
      this.value.push(value2);
      if (value2.point)
        this.maxPoint = Math.max(this.maxPoint, to - from);
      return true;
    }
    addChunk(from, chunk) {
      if ((from - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)
        return false;
      if (this.from.length)
        this.finishChunk(true);
      this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);
      this.chunks.push(chunk);
      this.chunkPos.push(from);
      let last = chunk.value.length - 1;
      this.last = chunk.value[last];
      this.lastFrom = chunk.from[last] + from;
      this.lastTo = chunk.to[last] + from;
      return true;
    }
    finish() {
      return this.finishInner(RangeSet.empty);
    }
    finishInner(next) {
      if (this.from.length)
        this.finishChunk(false);
      if (this.chunks.length == 0)
        return next;
      let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);
      this.from = null;
      return result;
    }
  }
  function findSharedChunks(a, b, textDiff) {
    let inA = new Map();
    for (let set of a)
      for (let i2 = 0; i2 < set.chunk.length; i2++)
        if (set.chunk[i2].maxPoint <= 0)
          inA.set(set.chunk[i2], set.chunkPos[i2]);
    let shared = new Set();
    for (let set of b)
      for (let i2 = 0; i2 < set.chunk.length; i2++) {
        let known = inA.get(set.chunk[i2]);
        if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i2] && !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i2].length)))
          shared.add(set.chunk[i2]);
      }
    return shared;
  }
  class LayerCursor {
    constructor(layer2, skip, minPoint, rank = 0) {
      this.layer = layer2;
      this.skip = skip;
      this.minPoint = minPoint;
      this.rank = rank;
    }
    get startSide() {
      return this.value ? this.value.startSide : 0;
    }
    get endSide() {
      return this.value ? this.value.endSide : 0;
    }
    goto(pos, side = -1e9) {
      this.chunkIndex = this.rangeIndex = 0;
      this.gotoInner(pos, side, false);
      return this;
    }
    gotoInner(pos, side, forward) {
      while (this.chunkIndex < this.layer.chunk.length) {
        let next = this.layer.chunk[this.chunkIndex];
        if (!(this.skip && this.skip.has(next) || this.layer.chunkEnd(this.chunkIndex) < pos || next.maxPoint < this.minPoint))
          break;
        this.chunkIndex++;
        forward = false;
      }
      if (this.chunkIndex < this.layer.chunk.length) {
        let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true);
        if (!forward || this.rangeIndex < rangeIndex)
          this.setRangeIndex(rangeIndex);
      }
      this.next();
    }
    forward(pos, side) {
      if ((this.to - pos || this.endSide - side) < 0)
        this.gotoInner(pos, side, true);
    }
    next() {
      for (; ; ) {
        if (this.chunkIndex == this.layer.chunk.length) {
          this.from = this.to = 1e9;
          this.value = null;
          break;
        } else {
          let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];
          let from = chunkPos + chunk.from[this.rangeIndex];
          this.from = from;
          this.to = chunkPos + chunk.to[this.rangeIndex];
          this.value = chunk.value[this.rangeIndex];
          this.setRangeIndex(this.rangeIndex + 1);
          if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)
            break;
        }
      }
    }
    setRangeIndex(index2) {
      if (index2 == this.layer.chunk[this.chunkIndex].value.length) {
        this.chunkIndex++;
        if (this.skip) {
          while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))
            this.chunkIndex++;
        }
        this.rangeIndex = 0;
      } else {
        this.rangeIndex = index2;
      }
    }
    nextChunk() {
      this.chunkIndex++;
      this.rangeIndex = 0;
      this.next();
    }
    compare(other) {
      return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank || this.to - other.to || this.endSide - other.endSide;
    }
  }
  class HeapCursor {
    constructor(heap) {
      this.heap = heap;
    }
    static from(sets, skip = null, minPoint = -1) {
      let heap = [];
      for (let i2 = 0; i2 < sets.length; i2++) {
        for (let cur2 = sets[i2]; !cur2.isEmpty; cur2 = cur2.nextLayer) {
          if (cur2.maxPoint >= minPoint)
            heap.push(new LayerCursor(cur2, skip, minPoint, i2));
        }
      }
      return heap.length == 1 ? heap[0] : new HeapCursor(heap);
    }
    get startSide() {
      return this.value ? this.value.startSide : 0;
    }
    goto(pos, side = -1e9) {
      for (let cur2 of this.heap)
        cur2.goto(pos, side);
      for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
        heapBubble(this.heap, i2);
      this.next();
      return this;
    }
    forward(pos, side) {
      for (let cur2 of this.heap)
        cur2.forward(pos, side);
      for (let i2 = this.heap.length >> 1; i2 >= 0; i2--)
        heapBubble(this.heap, i2);
      if ((this.to - pos || this.value.endSide - side) < 0)
        this.next();
    }
    next() {
      if (this.heap.length == 0) {
        this.from = this.to = 1e9;
        this.value = null;
        this.rank = -1;
      } else {
        let top2 = this.heap[0];
        this.from = top2.from;
        this.to = top2.to;
        this.value = top2.value;
        this.rank = top2.rank;
        if (top2.value)
          top2.next();
        heapBubble(this.heap, 0);
      }
    }
  }
  function heapBubble(heap, index2) {
    for (let cur2 = heap[index2]; ; ) {
      let childIndex = (index2 << 1) + 1;
      if (childIndex >= heap.length)
        break;
      let child = heap[childIndex];
      if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) {
        child = heap[childIndex + 1];
        childIndex++;
      }
      if (cur2.compare(child) < 0)
        break;
      heap[childIndex] = cur2;
      heap[index2] = child;
      index2 = childIndex;
    }
  }
  class SpanCursor {
    constructor(sets, skip, minPoint) {
      this.minPoint = minPoint;
      this.active = [];
      this.activeTo = [];
      this.activeRank = [];
      this.minActive = -1;
      this.point = null;
      this.pointFrom = 0;
      this.pointRank = 0;
      this.to = -1e9;
      this.endSide = 0;
      this.openStart = -1;
      this.cursor = HeapCursor.from(sets, skip, minPoint);
    }
    goto(pos, side = -1e9) {
      this.cursor.goto(pos, side);
      this.active.length = this.activeTo.length = this.activeRank.length = 0;
      this.minActive = -1;
      this.to = pos;
      this.endSide = side;
      this.openStart = -1;
      this.next();
      return this;
    }
    forward(pos, side) {
      while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0)
        this.removeActive(this.minActive);
      this.cursor.forward(pos, side);
    }
    removeActive(index2) {
      remove(this.active, index2);
      remove(this.activeTo, index2);
      remove(this.activeRank, index2);
      this.minActive = findMinIndex(this.active, this.activeTo);
    }
    addActive(trackOpen) {
      let i2 = 0, { value: value2, to, rank } = this.cursor;
      while (i2 < this.activeRank.length && this.activeRank[i2] <= rank)
        i2++;
      insert(this.active, i2, value2);
      insert(this.activeTo, i2, to);
      insert(this.activeRank, i2, rank);
      if (trackOpen)
        insert(trackOpen, i2, this.cursor.from);
      this.minActive = findMinIndex(this.active, this.activeTo);
    }
    next() {
      let from = this.to, wasPoint = this.point;
      this.point = null;
      let trackOpen = this.openStart < 0 ? [] : null;
      for (; ; ) {
        let a = this.minActive;
        if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) {
          if (this.activeTo[a] > from) {
            this.to = this.activeTo[a];
            this.endSide = this.active[a].endSide;
            break;
          }
          this.removeActive(a);
          if (trackOpen)
            remove(trackOpen, a);
        } else if (!this.cursor.value) {
          this.to = this.endSide = 1e9;
          break;
        } else if (this.cursor.from > from) {
          this.to = this.cursor.from;
          this.endSide = this.cursor.startSide;
          break;
        } else {
          let nextVal = this.cursor.value;
          if (!nextVal.point) {
            this.addActive(trackOpen);
            this.cursor.next();
          } else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {
            this.cursor.next();
          } else {
            this.point = nextVal;
            this.pointFrom = this.cursor.from;
            this.pointRank = this.cursor.rank;
            this.to = this.cursor.to;
            this.endSide = nextVal.endSide;
            this.cursor.next();
            this.forward(this.to, this.endSide);
            break;
          }
        }
      }
      if (trackOpen) {
        this.openStart = 0;
        for (let i2 = trackOpen.length - 1; i2 >= 0 && trackOpen[i2] < from; i2--)
          this.openStart++;
      }
    }
    activeForPoint(to) {
      if (!this.active.length)
        return this.active;
      let active = [];
      for (let i2 = this.active.length - 1; i2 >= 0; i2--) {
        if (this.activeRank[i2] < this.pointRank)
          break;
        if (this.activeTo[i2] > to || this.activeTo[i2] == to && this.active[i2].endSide >= this.point.endSide)
          active.push(this.active[i2]);
      }
      return active.reverse();
    }
    openEnd(to) {
      let open2 = 0;
      for (let i2 = this.activeTo.length - 1; i2 >= 0 && this.activeTo[i2] > to; i2--)
        open2++;
      return open2;
    }
  }
  function compare(a, startA, b, startB, length, comparator) {
    a.goto(startA);
    b.goto(startB);
    let endB = startB + length;
    let pos = startB, dPos = startB - startA;
    for (; ; ) {
      let diff = a.to + dPos - b.to || a.endSide - b.endSide;
      let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB);
      if (a.point || b.point) {
        if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) && sameValues(a.activeForPoint(a.to), b.activeForPoint(b.to))))
          comparator.comparePoint(pos, clipEnd, a.point, b.point);
      } else {
        if (clipEnd > pos && !sameValues(a.active, b.active))
          comparator.compareRange(pos, clipEnd, a.active, b.active);
      }
      if (end > endB)
        break;
      pos = end;
      if (diff <= 0)
        a.next();
      if (diff >= 0)
        b.next();
    }
  }
  function sameValues(a, b) {
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++)
      if (a[i2] != b[i2] && !a[i2].eq(b[i2]))
        return false;
    return true;
  }
  function remove(array, index2) {
    for (let i2 = index2, e = array.length - 1; i2 < e; i2++)
      array[i2] = array[i2 + 1];
    array.pop();
  }
  function insert(array, index2, value2) {
    for (let i2 = array.length - 1; i2 >= index2; i2--)
      array[i2 + 1] = array[i2];
    array[index2] = value2;
  }
  function findMinIndex(value2, array) {
    let found = -1, foundPos = 1e9;
    for (let i2 = 0; i2 < array.length; i2++)
      if ((array[i2] - foundPos || value2[i2].endSide - value2[found].endSide) < 0) {
        found = i2;
        foundPos = array[i2];
      }
    return found;
  }
  function countColumn(string2, tabSize, to = string2.length) {
    let n = 0;
    for (let i2 = 0; i2 < to; ) {
      if (string2.charCodeAt(i2) == 9) {
        n += tabSize - n % tabSize;
        i2++;
      } else {
        n++;
        i2 = findClusterBreak(string2, i2);
      }
    }
    return n;
  }
  function findColumn(string2, col, tabSize, strict) {
    for (let i2 = 0, n = 0; ; ) {
      if (n >= col)
        return i2;
      if (i2 == string2.length)
        break;
      n += string2.charCodeAt(i2) == 9 ? tabSize - n % tabSize : 1;
      i2 = findClusterBreak(string2, i2);
    }
    return strict === true ? -1 : string2.length;
  }
  const C = "\u037C";
  const COUNT = typeof Symbol == "undefined" ? "__" + C : Symbol.for(C);
  const SET = typeof Symbol == "undefined" ? "__styleSet" + Math.floor(Math.random() * 1e8) : Symbol("styleSet");
  const top = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : {};
  class StyleModule {
    constructor(spec, options) {
      this.rules = [];
      let { finish } = options || {};
      function splitSelector(selector) {
        return /^@/.test(selector) ? [selector] : selector.split(/,\s*/);
      }
      function render(selectors, spec2, target, isKeyframes) {
        let local = [], isAt = /^@(\w+)\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == "keyframes";
        if (isAt && spec2 == null)
          return target.push(selectors[0] + ";");
        for (let prop in spec2) {
          let value2 = spec2[prop];
          if (/&/.test(prop)) {
            render(prop.split(/,\s*/).map((part) => selectors.map((sel) => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)), value2, target);
          } else if (value2 && typeof value2 == "object") {
            if (!isAt)
              throw new RangeError("The value of a property (" + prop + ") should be a primitive value.");
            render(splitSelector(prop), value2, local, keyframes);
          } else if (value2 != null) {
            local.push(prop.replace(/_.*/, "").replace(/[A-Z]/g, (l) => "-" + l.toLowerCase()) + ": " + value2 + ";");
          }
        }
        if (local.length || keyframes) {
          target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(", ") + " {" + local.join(" ") + "}");
        }
      }
      for (let prop in spec)
        render(splitSelector(prop), spec[prop], this.rules);
    }
    getRules() {
      return this.rules.join("\n");
    }
    static newName() {
      let id2 = top[COUNT] || 1;
      top[COUNT] = id2 + 1;
      return C + id2.toString(36);
    }
    static mount(root, modules2, options) {
      let set = root[SET], nonce = options && options.nonce;
      if (!set)
        set = new StyleSet(root, nonce);
      else if (nonce)
        set.setNonce(nonce);
      set.mount(Array.isArray(modules2) ? modules2 : [modules2]);
    }
  }
  let adoptedSet = new Map();
  class StyleSet {
    constructor(root, nonce) {
      let doc2 = root.ownerDocument || root, win = doc2.defaultView;
      if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {
        let adopted = adoptedSet.get(doc2);
        if (adopted) {
          root.adoptedStyleSheets = [adopted.sheet, ...root.adoptedStyleSheets];
          return root[SET] = adopted;
        }
        this.sheet = new win.CSSStyleSheet();
        root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets];
        adoptedSet.set(doc2, this);
      } else {
        this.styleTag = doc2.createElement("style");
        if (nonce)
          this.styleTag.setAttribute("nonce", nonce);
        let target = root.head || root;
        target.insertBefore(this.styleTag, target.firstChild);
      }
      this.modules = [];
      root[SET] = this;
    }
    mount(modules2) {
      let sheet = this.sheet;
      let pos = 0, j = 0;
      for (let i2 = 0; i2 < modules2.length; i2++) {
        let mod = modules2[i2], index2 = this.modules.indexOf(mod);
        if (index2 < j && index2 > -1) {
          this.modules.splice(index2, 1);
          j--;
          index2 = -1;
        }
        if (index2 == -1) {
          this.modules.splice(j++, 0, mod);
          if (sheet)
            for (let k = 0; k < mod.rules.length; k++)
              sheet.insertRule(mod.rules[k], pos++);
        } else {
          while (j < index2)
            pos += this.modules[j++].rules.length;
          pos += mod.rules.length;
          j++;
        }
      }
      if (!sheet) {
        let text = "";
        for (let i2 = 0; i2 < this.modules.length; i2++)
          text += this.modules[i2].getRules() + "\n";
        this.styleTag.textContent = text;
      }
    }
    setNonce(nonce) {
      if (this.styleTag && this.styleTag.getAttribute("nonce") != nonce)
        this.styleTag.setAttribute("nonce", nonce);
    }
  }
  var base = {
    8: "Backspace",
    9: "Tab",
    10: "Enter",
    12: "NumLock",
    13: "Enter",
    16: "Shift",
    17: "Control",
    18: "Alt",
    20: "CapsLock",
    27: "Escape",
    32: " ",
    33: "PageUp",
    34: "PageDown",
    35: "End",
    36: "Home",
    37: "ArrowLeft",
    38: "ArrowUp",
    39: "ArrowRight",
    40: "ArrowDown",
    44: "PrintScreen",
    45: "Insert",
    46: "Delete",
    59: ";",
    61: "=",
    91: "Meta",
    92: "Meta",
    106: "*",
    107: "+",
    108: ",",
    109: "-",
    110: ".",
    111: "/",
    144: "NumLock",
    145: "ScrollLock",
    160: "Shift",
    161: "Shift",
    162: "Control",
    163: "Control",
    164: "Alt",
    165: "Alt",
    173: "-",
    186: ";",
    187: "=",
    188: ",",
    189: "-",
    190: ".",
    191: "/",
    192: "`",
    219: "[",
    220: "\\",
    221: "]",
    222: "'"
  };
  var shift = {
    48: ")",
    49: "!",
    50: "@",
    51: "#",
    52: "$",
    53: "%",
    54: "^",
    55: "&",
    56: "*",
    57: "(",
    59: ":",
    61: "+",
    173: "_",
    186: ":",
    187: "+",
    188: "<",
    189: "_",
    190: ">",
    191: "?",
    192: "~",
    219: "{",
    220: "|",
    221: "}",
    222: '"'
  };
  var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
  var ie$1 = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
  for (var i = 0; i < 10; i++)
    base[48 + i] = base[96 + i] = String(i);
  for (var i = 1; i <= 24; i++)
    base[i + 111] = "F" + i;
  for (var i = 65; i <= 90; i++) {
    base[i] = String.fromCharCode(i + 32);
    shift[i] = String.fromCharCode(i);
  }
  for (var code in base)
    if (!shift.hasOwnProperty(code))
      shift[code] = base[code];
  function keyName(event) {
    var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey || ie$1 && event.shiftKey && event.key && event.key.length == 1 || event.key == "Unidentified";
    var name2 = !ignoreKey && event.key || (event.shiftKey ? shift : base)[event.keyCode] || event.key || "Unidentified";
    if (name2 == "Esc")
      name2 = "Escape";
    if (name2 == "Del")
      name2 = "Delete";
    if (name2 == "Left")
      name2 = "ArrowLeft";
    if (name2 == "Up")
      name2 = "ArrowUp";
    if (name2 == "Right")
      name2 = "ArrowRight";
    if (name2 == "Down")
      name2 = "ArrowDown";
    return name2;
  }
  function getSelection(root) {
    let target;
    if (root.nodeType == 11) {
      target = root.getSelection ? root : root.ownerDocument;
    } else {
      target = root;
    }
    return target.getSelection();
  }
  function contains(dom, node) {
    return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false;
  }
  function deepActiveElement(doc2) {
    let elt = doc2.activeElement;
    while (elt && elt.shadowRoot)
      elt = elt.shadowRoot.activeElement;
    return elt;
  }
  function hasSelection(dom, selection) {
    if (!selection.anchorNode)
      return false;
    try {
      return contains(dom, selection.anchorNode);
    } catch (_) {
      return false;
    }
  }
  function clientRectsFor(dom) {
    if (dom.nodeType == 3)
      return textRange(dom, 0, dom.nodeValue.length).getClientRects();
    else if (dom.nodeType == 1)
      return dom.getClientRects();
    else
      return [];
  }
  function isEquivalentPosition(node, off2, targetNode, targetOff) {
    return targetNode ? scanFor(node, off2, targetNode, targetOff, -1) || scanFor(node, off2, targetNode, targetOff, 1) : false;
  }
  function domIndex(node) {
    for (var index2 = 0; ; index2++) {
      node = node.previousSibling;
      if (!node)
        return index2;
    }
  }
  function scanFor(node, off2, targetNode, targetOff, dir) {
    for (; ; ) {
      if (node == targetNode && off2 == targetOff)
        return true;
      if (off2 == (dir < 0 ? 0 : maxOffset(node))) {
        if (node.nodeName == "DIV")
          return false;
        let parent = node.parentNode;
        if (!parent || parent.nodeType != 1)
          return false;
        off2 = domIndex(node) + (dir < 0 ? 0 : 1);
        node = parent;
      } else if (node.nodeType == 1) {
        node = node.childNodes[off2 + (dir < 0 ? -1 : 0)];
        if (node.nodeType == 1 && node.contentEditable == "false")
          return false;
        off2 = dir < 0 ? maxOffset(node) : 0;
      } else {
        return false;
      }
    }
  }
  function maxOffset(node) {
    return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;
  }
  function flattenRect(rect, left) {
    let x = left ? rect.left : rect.right;
    return { left: x, right: x, top: rect.top, bottom: rect.bottom };
  }
  function windowRect(win) {
    return {
      left: 0,
      right: win.innerWidth,
      top: 0,
      bottom: win.innerHeight
    };
  }
  function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {
    let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
    for (let cur2 = dom, stop = false; cur2 && !stop; ) {
      if (cur2.nodeType == 1) {
        let bounding, top2 = cur2 == doc2.body;
        let scaleX = 1, scaleY = 1;
        if (top2) {
          bounding = windowRect(win);
        } else {
          if (/^(fixed|sticky)$/.test(getComputedStyle(cur2).position))
            stop = true;
          if (cur2.scrollHeight <= cur2.clientHeight && cur2.scrollWidth <= cur2.clientWidth) {
            cur2 = cur2.assignedSlot || cur2.parentNode;
            continue;
          }
          let rect2 = cur2.getBoundingClientRect();
          scaleX = rect2.width / cur2.offsetWidth;
          scaleY = rect2.height / cur2.offsetHeight;
          bounding = {
            left: rect2.left,
            right: rect2.left + cur2.clientWidth * scaleX,
            top: rect2.top,
            bottom: rect2.top + cur2.clientHeight * scaleY
          };
        }
        let moveX = 0, moveY = 0;
        if (y == "nearest") {
          if (rect.top < bounding.top) {
            moveY = -(bounding.top - rect.top + yMargin);
            if (side > 0 && rect.bottom > bounding.bottom + moveY)
              moveY = rect.bottom - bounding.bottom + moveY + yMargin;
          } else if (rect.bottom > bounding.bottom) {
            moveY = rect.bottom - bounding.bottom + yMargin;
            if (side < 0 && rect.top - moveY < bounding.top)
              moveY = -(bounding.top + moveY - rect.top + yMargin);
          }
        } else {
          let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top;
          let targetTop = y == "center" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 : y == "start" || y == "center" && side < 0 ? rect.top - yMargin : rect.bottom - boundingHeight + yMargin;
          moveY = targetTop - bounding.top;
        }
        if (x == "nearest") {
          if (rect.left < bounding.left) {
            moveX = -(bounding.left - rect.left + xMargin);
            if (side > 0 && rect.right > bounding.right + moveX)
              moveX = rect.right - bounding.right + moveX + xMargin;
          } else if (rect.right > bounding.right) {
            moveX = rect.right - bounding.right + xMargin;
            if (side < 0 && rect.left < bounding.left + moveX)
              moveX = -(bounding.left + moveX - rect.left + xMargin);
          }
        } else {
          let targetLeft = x == "center" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 : x == "start" == ltr ? rect.left - xMargin : rect.right - (bounding.right - bounding.left) + xMargin;
          moveX = targetLeft - bounding.left;
        }
        if (moveX || moveY) {
          if (top2) {
            win.scrollBy(moveX, moveY);
          } else {
            let movedX = 0, movedY = 0;
            if (moveY) {
              let start = cur2.scrollTop;
              cur2.scrollTop += moveY / scaleY;
              movedY = (cur2.scrollTop - start) * scaleY;
            }
            if (moveX) {
              let start = cur2.scrollLeft;
              cur2.scrollLeft += moveX / scaleX;
              movedX = (cur2.scrollLeft - start) * scaleX;
            }
            rect = {
              left: rect.left - movedX,
              top: rect.top - movedY,
              right: rect.right - movedX,
              bottom: rect.bottom - movedY
            };
            if (movedX && Math.abs(movedX - moveX) < 1)
              x = "nearest";
            if (movedY && Math.abs(movedY - moveY) < 1)
              y = "nearest";
          }
        }
        if (top2)
          break;
        cur2 = cur2.assignedSlot || cur2.parentNode;
      } else if (cur2.nodeType == 11) {
        cur2 = cur2.host;
      } else {
        break;
      }
    }
  }
  function scrollableParent(dom) {
    let doc2 = dom.ownerDocument;
    for (let cur2 = dom.parentNode; cur2; ) {
      if (cur2 == doc2.body) {
        break;
      } else if (cur2.nodeType == 1) {
        if (cur2.scrollHeight > cur2.clientHeight || cur2.scrollWidth > cur2.clientWidth)
          return cur2;
        cur2 = cur2.assignedSlot || cur2.parentNode;
      } else if (cur2.nodeType == 11) {
        cur2 = cur2.host;
      } else {
        break;
      }
    }
    return null;
  }
  class DOMSelectionState {
    constructor() {
      this.anchorNode = null;
      this.anchorOffset = 0;
      this.focusNode = null;
      this.focusOffset = 0;
    }
    eq(domSel) {
      return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset && this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset;
    }
    setRange(range) {
      let { anchorNode, focusNode } = range;
      this.set(anchorNode, Math.min(range.anchorOffset, anchorNode ? maxOffset(anchorNode) : 0), focusNode, Math.min(range.focusOffset, focusNode ? maxOffset(focusNode) : 0));
    }
    set(anchorNode, anchorOffset, focusNode, focusOffset) {
      this.anchorNode = anchorNode;
      this.anchorOffset = anchorOffset;
      this.focusNode = focusNode;
      this.focusOffset = focusOffset;
    }
  }
  let preventScrollSupported = null;
  function focusPreventScroll(dom) {
    if (dom.setActive)
      return dom.setActive();
    if (preventScrollSupported)
      return dom.focus(preventScrollSupported);
    let stack = [];
    for (let cur2 = dom; cur2; cur2 = cur2.parentNode) {
      stack.push(cur2, cur2.scrollTop, cur2.scrollLeft);
      if (cur2 == cur2.ownerDocument)
        break;
    }
    dom.focus(preventScrollSupported == null ? {
      get preventScroll() {
        preventScrollSupported = { preventScroll: true };
        return true;
      }
    } : void 0);
    if (!preventScrollSupported) {
      preventScrollSupported = false;
      for (let i2 = 0; i2 < stack.length; ) {
        let elt = stack[i2++], top2 = stack[i2++], left = stack[i2++];
        if (elt.scrollTop != top2)
          elt.scrollTop = top2;
        if (elt.scrollLeft != left)
          elt.scrollLeft = left;
      }
    }
  }
  let scratchRange;
  function textRange(node, from, to = from) {
    let range = scratchRange || (scratchRange = document.createRange());
    range.setEnd(node, to);
    range.setStart(node, from);
    return range;
  }
  function dispatchKey(elt, name2, code2) {
    let options = { key: name2, code: name2, keyCode: code2, which: code2, cancelable: true };
    let down = new KeyboardEvent("keydown", options);
    down.synthetic = true;
    elt.dispatchEvent(down);
    let up = new KeyboardEvent("keyup", options);
    up.synthetic = true;
    elt.dispatchEvent(up);
    return down.defaultPrevented || up.defaultPrevented;
  }
  function getRoot(node) {
    while (node) {
      if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host))
        return node;
      node = node.assignedSlot || node.parentNode;
    }
    return null;
  }
  function clearAttributes(node) {
    while (node.attributes.length)
      node.removeAttributeNode(node.attributes[0]);
  }
  function atElementStart(doc2, selection) {
    let node = selection.focusNode, offset = selection.focusOffset;
    if (!node || selection.anchorNode != node || selection.anchorOffset != offset)
      return false;
    offset = Math.min(offset, maxOffset(node));
    for (; ; ) {
      if (offset) {
        if (node.nodeType != 1)
          return false;
        let prev = node.childNodes[offset - 1];
        if (prev.contentEditable == "false")
          offset--;
        else {
          node = prev;
          offset = maxOffset(node);
        }
      } else if (node == doc2) {
        return true;
      } else {
        offset = domIndex(node);
        node = node.parentNode;
      }
    }
  }
  function isScrolledToBottom(elt) {
    return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);
  }
  class DOMPos {
    constructor(node, offset, precise = true) {
      this.node = node;
      this.offset = offset;
      this.precise = precise;
    }
    static before(dom, precise) {
      return new DOMPos(dom.parentNode, domIndex(dom), precise);
    }
    static after(dom, precise) {
      return new DOMPos(dom.parentNode, domIndex(dom) + 1, precise);
    }
  }
  const noChildren = [];
  class ContentView {
    constructor() {
      this.parent = null;
      this.dom = null;
      this.flags = 2;
    }
    get overrideDOMText() {
      return null;
    }
    get posAtStart() {
      return this.parent ? this.parent.posBefore(this) : 0;
    }
    get posAtEnd() {
      return this.posAtStart + this.length;
    }
    posBefore(view) {
      let pos = this.posAtStart;
      for (let child of this.children) {
        if (child == view)
          return pos;
        pos += child.length + child.breakAfter;
      }
      throw new RangeError("Invalid child in posBefore");
    }
    posAfter(view) {
      return this.posBefore(view) + view.length;
    }
    sync(view, track) {
      if (this.flags & 2) {
        let parent = this.dom;
        let prev = null, next;
        for (let child of this.children) {
          if (child.flags & 7) {
            if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) {
              let contentView = ContentView.get(next);
              if (!contentView || !contentView.parent && contentView.canReuseDOM(child))
                child.reuseDOM(next);
            }
            child.sync(view, track);
            child.flags &= ~7;
          }
          next = prev ? prev.nextSibling : parent.firstChild;
          if (track && !track.written && track.node == parent && next != child.dom)
            track.written = true;
          if (child.dom.parentNode == parent) {
            while (next && next != child.dom)
              next = rm$1(next);
          } else {
            parent.insertBefore(child.dom, next);
          }
          prev = child.dom;
        }
        next = prev ? prev.nextSibling : parent.firstChild;
        if (next && track && track.node == parent)
          track.written = true;
        while (next)
          next = rm$1(next);
      } else if (this.flags & 1) {
        for (let child of this.children)
          if (child.flags & 7) {
            child.sync(view, track);
            child.flags &= ~7;
          }
      }
    }
    reuseDOM(_dom) {
    }
    localPosFromDOM(node, offset) {
      let after;
      if (node == this.dom) {
        after = this.dom.childNodes[offset];
      } else {
        let bias = maxOffset(node) == 0 ? 0 : offset == 0 ? -1 : 1;
        for (; ; ) {
          let parent = node.parentNode;
          if (parent == this.dom)
            break;
          if (bias == 0 && parent.firstChild != parent.lastChild) {
            if (node == parent.firstChild)
              bias = -1;
            else
              bias = 1;
          }
          node = parent;
        }
        if (bias < 0)
          after = node;
        else
          after = node.nextSibling;
      }
      if (after == this.dom.firstChild)
        return 0;
      while (after && !ContentView.get(after))
        after = after.nextSibling;
      if (!after)
        return this.length;
      for (let i2 = 0, pos = 0; ; i2++) {
        let child = this.children[i2];
        if (child.dom == after)
          return pos;
        pos += child.length + child.breakAfter;
      }
    }
    domBoundsAround(from, to, offset = 0) {
      let fromI = -1, fromStart = -1, toI = -1, toEnd = -1;
      for (let i2 = 0, pos = offset, prevEnd = offset; i2 < this.children.length; i2++) {
        let child = this.children[i2], end = pos + child.length;
        if (pos < from && end > to)
          return child.domBoundsAround(from, to, pos);
        if (end >= from && fromI == -1) {
          fromI = i2;
          fromStart = pos;
        }
        if (pos > to && child.dom.parentNode == this.dom) {
          toI = i2;
          toEnd = prevEnd;
          break;
        }
        prevEnd = end;
        pos = end + child.breakAfter;
      }
      return {
        from: fromStart,
        to: toEnd < 0 ? offset + this.length : toEnd,
        startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild,
        endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null
      };
    }
    markDirty(andParent = false) {
      this.flags |= 2;
      this.markParentsDirty(andParent);
    }
    markParentsDirty(childList) {
      for (let parent = this.parent; parent; parent = parent.parent) {
        if (childList)
          parent.flags |= 2;
        if (parent.flags & 1)
          return;
        parent.flags |= 1;
        childList = false;
      }
    }
    setParent(parent) {
      if (this.parent != parent) {
        this.parent = parent;
        if (this.flags & 7)
          this.markParentsDirty(true);
      }
    }
    setDOM(dom) {
      if (this.dom == dom)
        return;
      if (this.dom)
        this.dom.cmView = null;
      this.dom = dom;
      dom.cmView = this;
    }
    get rootView() {
      for (let v = this; ; ) {
        let parent = v.parent;
        if (!parent)
          return v;
        v = parent;
      }
    }
    replaceChildren(from, to, children = noChildren) {
      this.markDirty();
      for (let i2 = from; i2 < to; i2++) {
        let child = this.children[i2];
        if (child.parent == this)
          child.destroy();
      }
      this.children.splice(from, to - from, ...children);
      for (let i2 = 0; i2 < children.length; i2++)
        children[i2].setParent(this);
    }
    ignoreMutation(_rec) {
      return false;
    }
    ignoreEvent(_event) {
      return false;
    }
    childCursor(pos = this.length) {
      return new ChildCursor(this.children, pos, this.children.length);
    }
    childPos(pos, bias = 1) {
      return this.childCursor().findPos(pos, bias);
    }
    toString() {
      let name2 = this.constructor.name.replace("View", "");
      return name2 + (this.children.length ? "(" + this.children.join() + ")" : this.length ? "[" + (name2 == "Text" ? this.text : this.length) + "]" : "") + (this.breakAfter ? "#" : "");
    }
    static get(node) {
      return node.cmView;
    }
    get isEditable() {
      return true;
    }
    get isWidget() {
      return false;
    }
    get isHidden() {
      return false;
    }
    merge(from, to, source, hasStart, openStart, openEnd) {
      return false;
    }
    become(other) {
      return false;
    }
    canReuseDOM(other) {
      return other.constructor == this.constructor && !((this.flags | other.flags) & 8);
    }
    getSide() {
      return 0;
    }
    destroy() {
      this.parent = null;
    }
  }
  ContentView.prototype.breakAfter = 0;
  function rm$1(dom) {
    let next = dom.nextSibling;
    dom.parentNode.removeChild(dom);
    return next;
  }
  class ChildCursor {
    constructor(children, pos, i2) {
      this.children = children;
      this.pos = pos;
      this.i = i2;
      this.off = 0;
    }
    findPos(pos, bias = 1) {
      for (; ; ) {
        if (pos > this.pos || pos == this.pos && (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {
          this.off = pos - this.pos;
          return this;
        }
        let next = this.children[--this.i];
        this.pos -= next.length + next.breakAfter;
      }
    }
  }
  function replaceRange(parent, fromI, fromOff, toI, toOff, insert2, breakAtStart, openStart, openEnd) {
    let { children } = parent;
    let before = children.length ? children[fromI] : null;
    let last = insert2.length ? insert2[insert2.length - 1] : null;
    let breakAtEnd = last ? last.breakAfter : breakAtStart;
    if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert2.length < 2 && before.merge(fromOff, toOff, insert2.length ? last : null, fromOff == 0, openStart, openEnd))
      return;
    if (toI < children.length) {
      let after = children[toI];
      if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {
        if (fromI == toI) {
          after = after.split(toOff);
          toOff = 0;
        }
        if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) {
          insert2[insert2.length - 1] = after;
        } else {
          if (toOff || after.children.length && !after.children[0].length)
            after.merge(0, toOff, null, false, 0, openEnd);
          insert2.push(after);
        }
      } else if (after === null || after === void 0 ? void 0 : after.breakAfter) {
        if (last)
          last.breakAfter = 1;
        else
          breakAtStart = 1;
      }
      toI++;
    }
    if (before) {
      before.breakAfter = breakAtStart;
      if (fromOff > 0) {
        if (!breakAtStart && insert2.length && before.merge(fromOff, before.length, insert2[0], false, openStart, 0)) {
          before.breakAfter = insert2.shift().breakAfter;
        } else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) {
          before.merge(fromOff, before.length, null, false, openStart, 0);
        }
        fromI++;
      }
    }
    while (fromI < toI && insert2.length) {
      if (children[toI - 1].become(insert2[insert2.length - 1])) {
        toI--;
        insert2.pop();
        openEnd = insert2.length ? 0 : openStart;
      } else if (children[fromI].become(insert2[0])) {
        fromI++;
        insert2.shift();
        openStart = insert2.length ? 0 : openEnd;
      } else {
        break;
      }
    }
    if (!insert2.length && fromI && toI < children.length && !children[fromI - 1].breakAfter && children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd))
      fromI--;
    if (fromI < toI || insert2.length)
      parent.replaceChildren(fromI, toI, insert2);
  }
  function mergeChildrenInto(parent, from, to, insert2, openStart, openEnd) {
    let cur2 = parent.childCursor();
    let { i: toI, off: toOff } = cur2.findPos(to, 1);
    let { i: fromI, off: fromOff } = cur2.findPos(from, -1);
    let dLen = from - to;
    for (let view of insert2)
      dLen += view.length;
    parent.length += dLen;
    replaceRange(parent, fromI, fromOff, toI, toOff, insert2, 0, openStart, openEnd);
  }
  let nav = typeof navigator != "undefined" ? navigator : { userAgent: "", vendor: "", platform: "" };
  let doc = typeof document != "undefined" ? document : { documentElement: { style: {} } };
  const ie_edge = /* @__PURE__ */ /Edge\/(\d+)/.exec(nav.userAgent);
  const ie_upto10 = /* @__PURE__ */ /MSIE \d/.test(nav.userAgent);
  const ie_11up = /* @__PURE__ */ /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent);
  const ie = !!(ie_upto10 || ie_11up || ie_edge);
  const gecko = !ie && /* @__PURE__ */ /gecko\/(\d+)/i.test(nav.userAgent);
  const chrome = !ie && /* @__PURE__ */ /Chrome\/(\d+)/.exec(nav.userAgent);
  const webkit = "webkitFontSmoothing" in doc.documentElement.style;
  const safari = !ie && /* @__PURE__ */ /Apple Computer/.test(nav.vendor);
  const ios = safari && (/* @__PURE__ */ /Mobile\/\w+/.test(nav.userAgent) || nav.maxTouchPoints > 2);
  var browser = {
    mac: ios || /* @__PURE__ */ /Mac/.test(nav.platform),
    windows: /* @__PURE__ */ /Win/.test(nav.platform),
    linux: /* @__PURE__ */ /Linux|X11/.test(nav.platform),
    ie,
    ie_version: ie_upto10 ? doc.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0,
    gecko,
    gecko_version: gecko ? +(/* @__PURE__ */ /Firefox\/(\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,
    chrome: !!chrome,
    chrome_version: chrome ? +chrome[1] : 0,
    ios,
    android: /* @__PURE__ */ /Android\b/.test(nav.userAgent),
    webkit,
    safari,
    webkit_version: webkit ? +(/* @__PURE__ */ /\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0,
    tabSize: doc.documentElement.style.tabSize != null ? "tab-size" : "-moz-tab-size"
  };
  const MaxJoinLen = 256;
  class TextView extends ContentView {
    constructor(text) {
      super();
      this.text = text;
    }
    get length() {
      return this.text.length;
    }
    createDOM(textDOM) {
      this.setDOM(textDOM || document.createTextNode(this.text));
    }
    sync(view, track) {
      if (!this.dom)
        this.createDOM();
      if (this.dom.nodeValue != this.text) {
        if (track && track.node == this.dom)
          track.written = true;
        this.dom.nodeValue = this.text;
      }
    }
    reuseDOM(dom) {
      if (dom.nodeType == 3)
        this.createDOM(dom);
    }
    merge(from, to, source) {
      if (this.flags & 8 || source && (!(source instanceof TextView) || this.length - (to - from) + source.length > MaxJoinLen || source.flags & 8))
        return false;
      this.text = this.text.slice(0, from) + (source ? source.text : "") + this.text.slice(to);
      this.markDirty();
      return true;
    }
    split(from) {
      let result = new TextView(this.text.slice(from));
      this.text = this.text.slice(0, from);
      this.markDirty();
      result.flags |= this.flags & 8;
      return result;
    }
    localPosFromDOM(node, offset) {
      return node == this.dom ? offset : offset ? this.text.length : 0;
    }
    domAtPos(pos) {
      return new DOMPos(this.dom, pos);
    }
    domBoundsAround(_from, _to, offset) {
      return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };
    }
    coordsAt(pos, side) {
      return textCoords(this.dom, pos, side);
    }
  }
  class MarkView extends ContentView {
    constructor(mark, children = [], length = 0) {
      super();
      this.mark = mark;
      this.children = children;
      this.length = length;
      for (let ch of children)
        ch.setParent(this);
    }
    setAttrs(dom) {
      clearAttributes(dom);
      if (this.mark.class)
        dom.className = this.mark.class;
      if (this.mark.attrs)
        for (let name2 in this.mark.attrs)
          dom.setAttribute(name2, this.mark.attrs[name2]);
      return dom;
    }
    canReuseDOM(other) {
      return super.canReuseDOM(other) && !((this.flags | other.flags) & 8);
    }
    reuseDOM(node) {
      if (node.nodeName == this.mark.tagName.toUpperCase()) {
        this.setDOM(node);
        this.flags |= 4 | 2;
      }
    }
    sync(view, track) {
      if (!this.dom)
        this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));
      else if (this.flags & 4)
        this.setAttrs(this.dom);
      super.sync(view, track);
    }
    merge(from, to, source, _hasStart, openStart, openEnd) {
      if (source && (!(source instanceof MarkView && source.mark.eq(this.mark)) || from && openStart <= 0 || to < this.length && openEnd <= 0))
        return false;
      mergeChildrenInto(this, from, to, source ? source.children : [], openStart - 1, openEnd - 1);
      this.markDirty();
      return true;
    }
    split(from) {
      let result = [], off2 = 0, detachFrom = -1, i2 = 0;
      for (let elt of this.children) {
        let end = off2 + elt.length;
        if (end > from)
          result.push(off2 < from ? elt.split(from - off2) : elt);
        if (detachFrom < 0 && off2 >= from)
          detachFrom = i2;
        off2 = end;
        i2++;
      }
      let length = this.length - from;
      this.length = from;
      if (detachFrom > -1) {
        this.children.length = detachFrom;
        this.markDirty();
      }
      return new MarkView(this.mark, result, length);
    }
    domAtPos(pos) {
      return inlineDOMAtPos(this, pos);
    }
    coordsAt(pos, side) {
      return coordsInChildren(this, pos, side);
    }
  }
  function textCoords(text, pos, side) {
    let length = text.nodeValue.length;
    if (pos > length)
      pos = length;
    let from = pos, to = pos, flatten2 = 0;
    if (pos == 0 && side < 0 || pos == length && side >= 0) {
      if (!(browser.chrome || browser.gecko)) {
        if (pos) {
          from--;
          flatten2 = 1;
        } else if (to < length) {
          to++;
          flatten2 = -1;
        }
      }
    } else {
      if (side < 0)
        from--;
      else if (to < length)
        to++;
    }
    let rects = textRange(text, from, to).getClientRects();
    if (!rects.length)
      return null;
    let rect = rects[(flatten2 ? flatten2 < 0 : side >= 0) ? 0 : rects.length - 1];
    if (browser.safari && !flatten2 && rect.width == 0)
      rect = Array.prototype.find.call(rects, (r) => r.width) || rect;
    return flatten2 ? flattenRect(rect, flatten2 < 0) : rect || null;
  }
  class WidgetView extends ContentView {
    static create(widget, length, side) {
      return new WidgetView(widget, length, side);
    }
    constructor(widget, length, side) {
      super();
      this.widget = widget;
      this.length = length;
      this.side = side;
      this.prevWidget = null;
    }
    split(from) {
      let result = WidgetView.create(this.widget, this.length - from, this.side);
      this.length -= from;
      return result;
    }
    sync(view) {
      if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
        if (this.dom && this.prevWidget)
          this.prevWidget.destroy(this.dom);
        this.prevWidget = null;
        this.setDOM(this.widget.toDOM(view));
        this.dom.contentEditable = "false";
      }
    }
    getSide() {
      return this.side;
    }
    merge(from, to, source, hasStart, openStart, openEnd) {
      if (source && (!(source instanceof WidgetView) || !this.widget.compare(source.widget) || from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))
        return false;
      this.length = from + (source ? source.length : 0) + (this.length - to);
      return true;
    }
    become(other) {
      if (other instanceof WidgetView && other.side == this.side && this.widget.constructor == other.widget.constructor) {
        if (!this.widget.compare(other.widget))
          this.markDirty(true);
        if (this.dom && !this.prevWidget)
          this.prevWidget = this.widget;
        this.widget = other.widget;
        this.length = other.length;
        return true;
      }
      return false;
    }
    ignoreMutation() {
      return true;
    }
    ignoreEvent(event) {
      return this.widget.ignoreEvent(event);
    }
    get overrideDOMText() {
      if (this.length == 0)
        return Text$1.empty;
      let top2 = this;
      while (top2.parent)
        top2 = top2.parent;
      let { view } = top2, text = view && view.state.doc, start = this.posAtStart;
      return text ? text.slice(start, start + this.length) : Text$1.empty;
    }
    domAtPos(pos) {
      return (this.length ? pos == 0 : this.side > 0) ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
    }
    domBoundsAround() {
      return null;
    }
    coordsAt(pos, side) {
      let custom = this.widget.coordsAt(this.dom, pos, side);
      if (custom)
        return custom;
      let rects = this.dom.getClientRects(), rect = null;
      if (!rects.length)
        return null;
      let fromBack = this.side ? this.side < 0 : pos > 0;
      for (let i2 = fromBack ? rects.length - 1 : 0; ; i2 += fromBack ? -1 : 1) {
        rect = rects[i2];
        if (pos > 0 ? i2 == 0 : i2 == rects.length - 1 || rect.top < rect.bottom)
          break;
      }
      return flattenRect(rect, !fromBack);
    }
    get isEditable() {
      return false;
    }
    get isWidget() {
      return true;
    }
    get isHidden() {
      return this.widget.isHidden;
    }
    destroy() {
      super.destroy();
      if (this.dom)
        this.widget.destroy(this.dom);
    }
  }
  class WidgetBufferView extends ContentView {
    constructor(side) {
      super();
      this.side = side;
    }
    get length() {
      return 0;
    }
    merge() {
      return false;
    }
    become(other) {
      return other instanceof WidgetBufferView && other.side == this.side;
    }
    split() {
      return new WidgetBufferView(this.side);
    }
    sync() {
      if (!this.dom) {
        let dom = document.createElement("img");
        dom.className = "cm-widgetBuffer";
        dom.setAttribute("aria-hidden", "true");
        this.setDOM(dom);
      }
    }
    getSide() {
      return this.side;
    }
    domAtPos(pos) {
      return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom);
    }
    localPosFromDOM() {
      return 0;
    }
    domBoundsAround() {
      return null;
    }
    coordsAt(pos) {
      return this.dom.getBoundingClientRect();
    }
    get overrideDOMText() {
      return Text$1.empty;
    }
    get isHidden() {
      return true;
    }
  }
  TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;
  function inlineDOMAtPos(parent, pos) {
    let dom = parent.dom, { children } = parent, i2 = 0;
    for (let off2 = 0; i2 < children.length; i2++) {
      let child = children[i2], end = off2 + child.length;
      if (end == off2 && child.getSide() <= 0)
        continue;
      if (pos > off2 && pos < end && child.dom.parentNode == dom)
        return child.domAtPos(pos - off2);
      if (pos <= off2)
        break;
      off2 = end;
    }
    for (let j = i2; j > 0; j--) {
      let prev = children[j - 1];
      if (prev.dom.parentNode == dom)
        return prev.domAtPos(prev.length);
    }
    for (let j = i2; j < children.length; j++) {
      let next = children[j];
      if (next.dom.parentNode == dom)
        return next.domAtPos(0);
    }
    return new DOMPos(dom, 0);
  }
  function joinInlineInto(parent, view, open2) {
    let last, { children } = parent;
    if (open2 > 0 && view instanceof MarkView && children.length && (last = children[children.length - 1]) instanceof MarkView && last.mark.eq(view.mark)) {
      joinInlineInto(last, view.children[0], open2 - 1);
    } else {
      children.push(view);
      view.setParent(parent);
    }
    parent.length += view.length;
  }
  function coordsInChildren(view, pos, side) {
    let before = null, beforePos = -1, after = null, afterPos = -1;
    function scan(view2, pos2) {
      for (let i2 = 0, off2 = 0; i2 < view2.children.length && off2 <= pos2; i2++) {
        let child = view2.children[i2], end = off2 + child.length;
        if (end >= pos2) {
          if (child.children.length) {
            scan(child, pos2 - off2);
          } else if ((!after || after.isHidden && side > 0) && (end > pos2 || off2 == end && child.getSide() > 0)) {
            after = child;
            afterPos = pos2 - off2;
          } else if (off2 < pos2 || off2 == end && child.getSide() < 0 && !child.isHidden) {
            before = child;
            beforePos = pos2 - off2;
          }
        }
        off2 = end;
      }
    }
    scan(view, pos);
    let target = (side < 0 ? before : after) || before || after;
    if (target)
      return target.coordsAt(Math.max(0, target == before ? beforePos : afterPos), side);
    return fallbackRect(view);
  }
  function fallbackRect(view) {
    let last = view.dom.lastChild;
    if (!last)
      return view.dom.getBoundingClientRect();
    let rects = clientRectsFor(last);
    return rects[rects.length - 1] || null;
  }
  function combineAttrs(source, target) {
    for (let name2 in source) {
      if (name2 == "class" && target.class)
        target.class += " " + source.class;
      else if (name2 == "style" && target.style)
        target.style += ";" + source.style;
      else
        target[name2] = source[name2];
    }
    return target;
  }
  const noAttrs = /* @__PURE__ */ Object.create(null);
  function attrsEq(a, b, ignore) {
    if (a == b)
      return true;
    if (!a)
      a = noAttrs;
    if (!b)
      b = noAttrs;
    let keysA = Object.keys(a), keysB = Object.keys(b);
    if (keysA.length - (ignore && keysA.indexOf(ignore) > -1 ? 1 : 0) != keysB.length - (ignore && keysB.indexOf(ignore) > -1 ? 1 : 0))
      return false;
    for (let key of keysA) {
      if (key != ignore && (keysB.indexOf(key) == -1 || a[key] !== b[key]))
        return false;
    }
    return true;
  }
  function updateAttrs(dom, prev, attrs) {
    let changed = false;
    if (prev) {
      for (let name2 in prev)
        if (!(attrs && name2 in attrs)) {
          changed = true;
          if (name2 == "style")
            dom.style.cssText = "";
          else
            dom.removeAttribute(name2);
        }
    }
    if (attrs) {
      for (let name2 in attrs)
        if (!(prev && prev[name2] == attrs[name2])) {
          changed = true;
          if (name2 == "style")
            dom.style.cssText = attrs[name2];
          else
            dom.setAttribute(name2, attrs[name2]);
        }
    }
    return changed;
  }
  function getAttrs(dom) {
    let attrs = Object.create(null);
    for (let i2 = 0; i2 < dom.attributes.length; i2++) {
      let attr = dom.attributes[i2];
      attrs[attr.name] = attr.value;
    }
    return attrs;
  }
  class LineView extends ContentView {
    constructor() {
      super(...arguments);
      this.children = [];
      this.length = 0;
      this.prevAttrs = void 0;
      this.attrs = null;
      this.breakAfter = 0;
    }
    merge(from, to, source, hasStart, openStart, openEnd) {
      if (source) {
        if (!(source instanceof LineView))
          return false;
        if (!this.dom)
          source.transferDOM(this);
      }
      if (hasStart)
        this.setDeco(source ? source.attrs : null);
      mergeChildrenInto(this, from, to, source ? source.children : [], openStart, openEnd);
      return true;
    }
    split(at) {
      let end = new LineView();
      end.breakAfter = this.breakAfter;
      if (this.length == 0)
        return end;
      let { i: i2, off: off2 } = this.childPos(at);
      if (off2) {
        end.append(this.children[i2].split(off2), 0);
        this.children[i2].merge(off2, this.children[i2].length, null, false, 0, 0);
        i2++;
      }
      for (let j = i2; j < this.children.length; j++)
        end.append(this.children[j], 0);
      while (i2 > 0 && this.children[i2 - 1].length == 0)
        this.children[--i2].destroy();
      this.children.length = i2;
      this.markDirty();
      this.length = at;
      return end;
    }
    transferDOM(other) {
      if (!this.dom)
        return;
      this.markDirty();
      other.setDOM(this.dom);
      other.prevAttrs = this.prevAttrs === void 0 ? this.attrs : this.prevAttrs;
      this.prevAttrs = void 0;
      this.dom = null;
    }
    setDeco(attrs) {
      if (!attrsEq(this.attrs, attrs)) {
        if (this.dom) {
          this.prevAttrs = this.attrs;
          this.markDirty();
        }
        this.attrs = attrs;
      }
    }
    append(child, openStart) {
      joinInlineInto(this, child, openStart);
    }
    addLineDeco(deco) {
      let attrs = deco.spec.attributes, cls = deco.spec.class;
      if (attrs)
        this.attrs = combineAttrs(attrs, this.attrs || {});
      if (cls)
        this.attrs = combineAttrs({ class: cls }, this.attrs || {});
    }
    domAtPos(pos) {
      return inlineDOMAtPos(this, pos);
    }
    reuseDOM(node) {
      if (node.nodeName == "DIV") {
        this.setDOM(node);
        this.flags |= 4 | 2;
      }
    }
    sync(view, track) {
      var _a2;
      if (!this.dom) {
        this.setDOM(document.createElement("div"));
        this.dom.className = "cm-line";
        this.prevAttrs = this.attrs ? null : void 0;
      } else if (this.flags & 4) {
        clearAttributes(this.dom);
        this.dom.className = "cm-line";
        this.prevAttrs = this.attrs ? null : void 0;
      }
      if (this.prevAttrs !== void 0) {
        updateAttrs(this.dom, this.prevAttrs, this.attrs);
        this.dom.classList.add("cm-line");
        this.prevAttrs = void 0;
      }
      super.sync(view, track);
      let last = this.dom.lastChild;
      while (last && ContentView.get(last) instanceof MarkView)
        last = last.lastChild;
      if (!last || !this.length || last.nodeName != "BR" && ((_a2 = ContentView.get(last)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) == false && (!browser.ios || !this.children.some((ch) => ch instanceof TextView))) {
        let hack = document.createElement("BR");
        hack.cmIgnore = true;
        this.dom.appendChild(hack);
      }
    }
    measureTextSize() {
      if (this.children.length == 0 || this.length > 20)
        return null;
      let totalWidth = 0, textHeight;
      for (let child of this.children) {
        if (!(child instanceof TextView) || /[^ -~]/.test(child.text))
          return null;
        let rects = clientRectsFor(child.dom);
        if (rects.length != 1)
          return null;
        totalWidth += rects[0].width;
        textHeight = rects[0].height;
      }
      return !totalWidth ? null : {
        lineHeight: this.dom.getBoundingClientRect().height,
        charWidth: totalWidth / this.length,
        textHeight
      };
    }
    coordsAt(pos, side) {
      let rect = coordsInChildren(this, pos, side);
      if (!this.children.length && rect && this.parent) {
        let { heightOracle } = this.parent.view.viewState, height = rect.bottom - rect.top;
        if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {
          let dist2 = (height - heightOracle.textHeight) / 2;
          return { top: rect.top + dist2, bottom: rect.bottom - dist2, left: rect.left, right: rect.left };
        }
      }
      return rect;
    }
    become(_other) {
      return false;
    }
    covers() {
      return true;
    }
    static find(docView, pos) {
      for (let i2 = 0, off2 = 0; i2 < docView.children.length; i2++) {
        let block = docView.children[i2], end = off2 + block.length;
        if (end >= pos) {
          if (block instanceof LineView)
            return block;
          if (end > pos)
            break;
        }
        off2 = end + block.breakAfter;
      }
      return null;
    }
  }
  class BlockWidgetView extends ContentView {
    constructor(widget, length, deco) {
      super();
      this.widget = widget;
      this.length = length;
      this.deco = deco;
      this.breakAfter = 0;
      this.prevWidget = null;
    }
    merge(from, to, source, _takeDeco, openStart, openEnd) {
      if (source && (!(source instanceof BlockWidgetView) || !this.widget.compare(source.widget) || from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))
        return false;
      this.length = from + (source ? source.length : 0) + (this.length - to);
      return true;
    }
    domAtPos(pos) {
      return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);
    }
    split(at) {
      let len = this.length - at;
      this.length = at;
      let end = new BlockWidgetView(this.widget, len, this.deco);
      end.breakAfter = this.breakAfter;
      return end;
    }
    get children() {
      return noChildren;
    }
    sync(view) {
      if (!this.dom || !this.widget.updateDOM(this.dom, view)) {
        if (this.dom && this.prevWidget)
          this.prevWidget.destroy(this.dom);
        this.prevWidget = null;
        this.setDOM(this.widget.toDOM(view));
        this.dom.contentEditable = "false";
      }
    }
    get overrideDOMText() {
      return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text$1.empty;
    }
    domBoundsAround() {
      return null;
    }
    become(other) {
      if (other instanceof BlockWidgetView && other.widget.constructor == this.widget.constructor) {
        if (!other.widget.compare(this.widget))
          this.markDirty(true);
        if (this.dom && !this.prevWidget)
          this.prevWidget = this.widget;
        this.widget = other.widget;
        this.length = other.length;
        this.deco = other.deco;
        this.breakAfter = other.breakAfter;
        return true;
      }
      return false;
    }
    ignoreMutation() {
      return true;
    }
    ignoreEvent(event) {
      return this.widget.ignoreEvent(event);
    }
    get isEditable() {
      return false;
    }
    get isWidget() {
      return true;
    }
    coordsAt(pos, side) {
      return this.widget.coordsAt(this.dom, pos, side);
    }
    destroy() {
      super.destroy();
      if (this.dom)
        this.widget.destroy(this.dom);
    }
    covers(side) {
      let { startSide, endSide } = this.deco;
      return startSide == endSide ? false : side < 0 ? startSide < 0 : endSide > 0;
    }
  }
  class WidgetType {
    eq(widget) {
      return false;
    }
    updateDOM(dom, view) {
      return false;
    }
    compare(other) {
      return this == other || this.constructor == other.constructor && this.eq(other);
    }
    get estimatedHeight() {
      return -1;
    }
    get lineBreaks() {
      return 0;
    }
    ignoreEvent(event) {
      return true;
    }
    coordsAt(dom, pos, side) {
      return null;
    }
    get isHidden() {
      return false;
    }
    destroy(dom) {
    }
  }
  var BlockType = /* @__PURE__ */ function(BlockType2) {
    BlockType2[BlockType2["Text"] = 0] = "Text";
    BlockType2[BlockType2["WidgetBefore"] = 1] = "WidgetBefore";
    BlockType2[BlockType2["WidgetAfter"] = 2] = "WidgetAfter";
    BlockType2[BlockType2["WidgetRange"] = 3] = "WidgetRange";
    return BlockType2;
  }(BlockType || (BlockType = {}));
  class Decoration extends RangeValue {
    constructor(startSide, endSide, widget, spec) {
      super();
      this.startSide = startSide;
      this.endSide = endSide;
      this.widget = widget;
      this.spec = spec;
    }
    get heightRelevant() {
      return false;
    }
    static mark(spec) {
      return new MarkDecoration(spec);
    }
    static widget(spec) {
      let side = Math.max(-1e4, Math.min(1e4, spec.side || 0)), block = !!spec.block;
      side += block && !spec.inlineOrder ? side > 0 ? 3e8 : -4e8 : side > 0 ? 1e8 : -1e8;
      return new PointDecoration(spec, side, side, block, spec.widget || null, false);
    }
    static replace(spec) {
      let block = !!spec.block, startSide, endSide;
      if (spec.isBlockGap) {
        startSide = -5e8;
        endSide = 4e8;
      } else {
        let { start, end } = getInclusive(spec, block);
        startSide = (start ? block ? -3e8 : -1 : 5e8) - 1;
        endSide = (end ? block ? 2e8 : 1 : -6e8) + 1;
      }
      return new PointDecoration(spec, startSide, endSide, block, spec.widget || null, true);
    }
    static line(spec) {
      return new LineDecoration(spec);
    }
    static set(of, sort = false) {
      return RangeSet.of(of, sort);
    }
    hasHeight() {
      return this.widget ? this.widget.estimatedHeight > -1 : false;
    }
  }
  Decoration.none = RangeSet.empty;
  class MarkDecoration extends Decoration {
    constructor(spec) {
      let { start, end } = getInclusive(spec);
      super(start ? -1 : 5e8, end ? 1 : -6e8, null, spec);
      this.tagName = spec.tagName || "span";
      this.class = spec.class || "";
      this.attrs = spec.attributes || null;
    }
    eq(other) {
      var _a2, _b;
      return this == other || other instanceof MarkDecoration && this.tagName == other.tagName && (this.class || ((_a2 = this.attrs) === null || _a2 === void 0 ? void 0 : _a2.class)) == (other.class || ((_b = other.attrs) === null || _b === void 0 ? void 0 : _b.class)) && attrsEq(this.attrs, other.attrs, "class");
    }
    range(from, to = from) {
      if (from >= to)
        throw new RangeError("Mark decorations may not be empty");
      return super.range(from, to);
    }
  }
  MarkDecoration.prototype.point = false;
  class LineDecoration extends Decoration {
    constructor(spec) {
      super(-2e8, -2e8, null, spec);
    }
    eq(other) {
      return other instanceof LineDecoration && this.spec.class == other.spec.class && attrsEq(this.spec.attributes, other.spec.attributes);
    }
    range(from, to = from) {
      if (to != from)
        throw new RangeError("Line decoration ranges must be zero-length");
      return super.range(from, to);
    }
  }
  LineDecoration.prototype.mapMode = MapMode.TrackBefore;
  LineDecoration.prototype.point = true;
  class PointDecoration extends Decoration {
    constructor(spec, startSide, endSide, block, widget, isReplace) {
      super(startSide, endSide, widget, spec);
      this.block = block;
      this.isReplace = isReplace;
      this.mapMode = !block ? MapMode.TrackDel : startSide <= 0 ? MapMode.TrackBefore : MapMode.TrackAfter;
    }
    get type() {
      return this.startSide != this.endSide ? BlockType.WidgetRange : this.startSide <= 0 ? BlockType.WidgetBefore : BlockType.WidgetAfter;
    }
    get heightRelevant() {
      return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);
    }
    eq(other) {
      return other instanceof PointDecoration && widgetsEq(this.widget, other.widget) && this.block == other.block && this.startSide == other.startSide && this.endSide == other.endSide;
    }
    range(from, to = from) {
      if (this.isReplace && (from > to || from == to && this.startSide > 0 && this.endSide <= 0))
        throw new RangeError("Invalid range for replacement decoration");
      if (!this.isReplace && to != from)
        throw new RangeError("Widget decorations can only have zero-length ranges");
      return super.range(from, to);
    }
  }
  PointDecoration.prototype.point = true;
  function getInclusive(spec, block = false) {
    let { inclusiveStart: start, inclusiveEnd: end } = spec;
    if (start == null)
      start = spec.inclusive;
    if (end == null)
      end = spec.inclusive;
    return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block };
  }
  function widgetsEq(a, b) {
    return a == b || !!(a && b && a.compare(b));
  }
  function addRange(from, to, ranges, margin = 0) {
    let last = ranges.length - 1;
    if (last >= 0 && ranges[last] + margin >= from)
      ranges[last] = Math.max(ranges[last], to);
    else
      ranges.push(from, to);
  }
  class ContentBuilder {
    constructor(doc2, pos, end, disallowBlockEffectsFor) {
      this.doc = doc2;
      this.pos = pos;
      this.end = end;
      this.disallowBlockEffectsFor = disallowBlockEffectsFor;
      this.content = [];
      this.curLine = null;
      this.breakAtStart = 0;
      this.pendingBuffer = 0;
      this.bufferMarks = [];
      this.atCursorPos = true;
      this.openStart = -1;
      this.openEnd = -1;
      this.text = "";
      this.textOff = 0;
      this.cursor = doc2.iter();
      this.skip = pos;
    }
    posCovered() {
      if (this.content.length == 0)
        return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;
      let last = this.content[this.content.length - 1];
      return !(last.breakAfter || last instanceof BlockWidgetView && last.deco.endSide < 0);
    }
    getLine() {
      if (!this.curLine) {
        this.content.push(this.curLine = new LineView());
        this.atCursorPos = true;
      }
      return this.curLine;
    }
    flushBuffer(active = this.bufferMarks) {
      if (this.pendingBuffer) {
        this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);
        this.pendingBuffer = 0;
      }
    }
    addBlockWidget(view) {
      this.flushBuffer();
      this.curLine = null;
      this.content.push(view);
    }
    finish(openEnd) {
      if (this.pendingBuffer && openEnd <= this.bufferMarks.length)
        this.flushBuffer();
      else
        this.pendingBuffer = 0;
      if (!this.posCovered() && !(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))
        this.getLine();
    }
    buildText(length, active, openStart) {
      while (length > 0) {
        if (this.textOff == this.text.length) {
          let { value: value2, lineBreak, done } = this.cursor.next(this.skip);
          this.skip = 0;
          if (done)
            throw new Error("Ran out of text content when drawing inline views");
          if (lineBreak) {
            if (!this.posCovered())
              this.getLine();
            if (this.content.length)
              this.content[this.content.length - 1].breakAfter = 1;
            else
              this.breakAtStart = 1;
            this.flushBuffer();
            this.curLine = null;
            this.atCursorPos = true;
            length--;
            continue;
          } else {
            this.text = value2;
            this.textOff = 0;
          }
        }
        let take = Math.min(this.text.length - this.textOff, length, 512);
        this.flushBuffer(active.slice(active.length - openStart));
        this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);
        this.atCursorPos = true;
        this.textOff += take;
        length -= take;
        openStart = 0;
      }
    }
    span(from, to, active, openStart) {
      this.buildText(to - from, active, openStart);
      this.pos = to;
      if (this.openStart < 0)
        this.openStart = openStart;
    }
    point(from, to, deco, active, openStart, index2) {
      if (this.disallowBlockEffectsFor[index2] && deco instanceof PointDecoration) {
        if (deco.block)
          throw new RangeError("Block decorations may not be specified via plugins");
        if (to > this.doc.lineAt(this.pos).to)
          throw new RangeError("Decorations that replace line breaks may not be specified via plugins");
      }
      let len = to - from;
      if (deco instanceof PointDecoration) {
        if (deco.block) {
          if (deco.startSide > 0 && !this.posCovered())
            this.getLine();
          this.addBlockWidget(new BlockWidgetView(deco.widget || new NullWidget("div"), len, deco));
        } else {
          let view = WidgetView.create(deco.widget || new NullWidget("span"), len, len ? 0 : deco.startSide);
          let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length && (from < to || deco.startSide > 0);
          let cursorAfter = !view.isEditable && (from < to || openStart > active.length || deco.startSide <= 0);
          let line = this.getLine();
          if (this.pendingBuffer == 2 && !cursorBefore && !view.isEditable)
            this.pendingBuffer = 0;
          this.flushBuffer(active);
          if (cursorBefore) {
            line.append(wrapMarks(new WidgetBufferView(1), active), openStart);
            openStart = active.length + Math.max(0, openStart - active.length);
          }
          line.append(wrapMarks(view, active), openStart);
          this.atCursorPos = cursorAfter;
          this.pendingBuffer = !cursorAfter ? 0 : from < to || openStart > active.length ? 1 : 2;
          if (this.pendingBuffer)
            this.bufferMarks = active.slice();
        }
      } else if (this.doc.lineAt(this.pos).from == this.pos) {
        this.getLine().addLineDeco(deco);
      }
      if (len) {
        if (this.textOff + len <= this.text.length) {
          this.textOff += len;
        } else {
          this.skip += len - (this.text.length - this.textOff);
          this.text = "";
          this.textOff = 0;
        }
        this.pos = to;
      }
      if (this.openStart < 0)
        this.openStart = openStart;
    }
    static build(text, from, to, decorations2, dynamicDecorationMap) {
      let builder = new ContentBuilder(text, from, to, dynamicDecorationMap);
      builder.openEnd = RangeSet.spans(decorations2, from, to, builder);
      if (builder.openStart < 0)
        builder.openStart = builder.openEnd;
      builder.finish(builder.openEnd);
      return builder;
    }
  }
  function wrapMarks(view, active) {
    for (let mark of active)
      view = new MarkView(mark, [view], view.length);
    return view;
  }
  class NullWidget extends WidgetType {
    constructor(tag) {
      super();
      this.tag = tag;
    }
    eq(other) {
      return other.tag == this.tag;
    }
    toDOM() {
      return document.createElement(this.tag);
    }
    updateDOM(elt) {
      return elt.nodeName.toLowerCase() == this.tag;
    }
    get isHidden() {
      return true;
    }
  }
  const clickAddsSelectionRange = /* @__PURE__ */ Facet.define();
  const dragMovesSelection$1 = /* @__PURE__ */ Facet.define();
  const mouseSelectionStyle = /* @__PURE__ */ Facet.define();
  const exceptionSink = /* @__PURE__ */ Facet.define();
  const updateListener = /* @__PURE__ */ Facet.define();
  const inputHandler$1 = /* @__PURE__ */ Facet.define();
  const focusChangeEffect = /* @__PURE__ */ Facet.define();
  const perLineTextDirection = /* @__PURE__ */ Facet.define({
    combine: (values) => values.some((x) => x)
  });
  const nativeSelectionHidden = /* @__PURE__ */ Facet.define({
    combine: (values) => values.some((x) => x)
  });
  class ScrollTarget {
    constructor(range, y = "nearest", x = "nearest", yMargin = 5, xMargin = 5, isSnapshot = false) {
      this.range = range;
      this.y = y;
      this.x = x;
      this.yMargin = yMargin;
      this.xMargin = xMargin;
      this.isSnapshot = isSnapshot;
    }
    map(changes) {
      return changes.empty ? this : new ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
    }
    clip(state) {
      return this.range.to <= state.doc.length ? this : new ScrollTarget(EditorSelection.cursor(state.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);
    }
  }
  const scrollIntoView$1 = /* @__PURE__ */ StateEffect.define({ map: (t2, ch) => t2.map(ch) });
  function logException(state, exception, context) {
    let handler = state.facet(exceptionSink);
    if (handler.length)
      handler[0](exception);
    else if (window.onerror)
      window.onerror(String(exception), context, void 0, void 0, exception);
    else if (context)
      console.error(context + ":", exception);
    else
      console.error(exception);
  }
  const editable = /* @__PURE__ */ Facet.define({ combine: (values) => values.length ? values[0] : true });
  let nextPluginID = 0;
  const viewPlugin = /* @__PURE__ */ Facet.define();
  class ViewPlugin {
    constructor(id2, create, domEventHandlers, domEventObservers, buildExtensions) {
      this.id = id2;
      this.create = create;
      this.domEventHandlers = domEventHandlers;
      this.domEventObservers = domEventObservers;
      this.extension = buildExtensions(this);
    }
    static define(create, spec) {
      const { eventHandlers, eventObservers, provide, decorations: deco } = spec || {};
      return new ViewPlugin(nextPluginID++, create, eventHandlers, eventObservers, (plugin) => {
        let ext = [viewPlugin.of(plugin)];
        if (deco)
          ext.push(decorations.of((view) => {
            let pluginInst = view.plugin(plugin);
            return pluginInst ? deco(pluginInst) : Decoration.none;
          }));
        if (provide)
          ext.push(provide(plugin));
        return ext;
      });
    }
    static fromClass(cls, spec) {
      return ViewPlugin.define((view) => new cls(view), spec);
    }
  }
  class PluginInstance {
    constructor(spec) {
      this.spec = spec;
      this.mustUpdate = null;
      this.value = null;
    }
    update(view) {
      if (!this.value) {
        if (this.spec) {
          try {
            this.value = this.spec.create(view);
          } catch (e) {
            logException(view.state, e, "CodeMirror plugin crashed");
            this.deactivate();
          }
        }
      } else if (this.mustUpdate) {
        let update = this.mustUpdate;
        this.mustUpdate = null;
        if (this.value.update) {
          try {
            this.value.update(update);
          } catch (e) {
            logException(update.state, e, "CodeMirror plugin crashed");
            if (this.value.destroy)
              try {
                this.value.destroy();
              } catch (_) {
              }
            this.deactivate();
          }
        }
      }
      return this;
    }
    destroy(view) {
      var _a2;
      if ((_a2 = this.value) === null || _a2 === void 0 ? void 0 : _a2.destroy) {
        try {
          this.value.destroy();
        } catch (e) {
          logException(view.state, e, "CodeMirror plugin crashed");
        }
      }
    }
    deactivate() {
      this.spec = this.value = null;
    }
  }
  const editorAttributes = /* @__PURE__ */ Facet.define();
  const contentAttributes = /* @__PURE__ */ Facet.define();
  const decorations = /* @__PURE__ */ Facet.define();
  const atomicRanges = /* @__PURE__ */ Facet.define();
  const bidiIsolatedRanges = /* @__PURE__ */ Facet.define();
  function getIsolatedRanges(view, from, to) {
    let isolates = view.state.facet(bidiIsolatedRanges);
    if (!isolates.length)
      return isolates;
    let sets = isolates.map((i2) => i2 instanceof Function ? i2(view) : i2);
    let result = [];
    RangeSet.spans(sets, from, to, {
      point() {
      },
      span(from2, to2, active, open2) {
        let level = result;
        for (let i2 = active.length - 1; i2 >= 0; i2--, open2--) {
          let iso = active[i2].spec.bidiIsolate, update;
          if (iso == null)
            continue;
          if (open2 > 0 && level.length && (update = level[level.length - 1]).to == from2 && update.direction == iso) {
            update.to = to2;
            level = update.inner;
          } else {
            let add2 = { from: from2, to: to2, direction: iso, inner: [] };
            level.push(add2);
            level = add2.inner;
          }
        }
      }
    });
    return result;
  }
  const scrollMargins = /* @__PURE__ */ Facet.define();
  function getScrollMargins(view) {
    let left = 0, right = 0, top2 = 0, bottom = 0;
    for (let source of view.state.facet(scrollMargins)) {
      let m = source(view);
      if (m) {
        if (m.left != null)
          left = Math.max(left, m.left);
        if (m.right != null)
          right = Math.max(right, m.right);
        if (m.top != null)
          top2 = Math.max(top2, m.top);
        if (m.bottom != null)
          bottom = Math.max(bottom, m.bottom);
      }
    }
    return { left, right, top: top2, bottom };
  }
  const styleModule = /* @__PURE__ */ Facet.define();
  class ChangedRange {
    constructor(fromA, toA, fromB, toB) {
      this.fromA = fromA;
      this.toA = toA;
      this.fromB = fromB;
      this.toB = toB;
    }
    join(other) {
      return new ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));
    }
    addToSet(set) {
      let i2 = set.length, me = this;
      for (; i2 > 0; i2--) {
        let range = set[i2 - 1];
        if (range.fromA > me.toA)
          continue;
        if (range.toA < me.fromA)
          break;
        me = me.join(range);
        set.splice(i2 - 1, 1);
      }
      set.splice(i2, 0, me);
      return set;
    }
    static extendWithRanges(diff, ranges) {
      if (ranges.length == 0)
        return diff;
      let result = [];
      for (let dI = 0, rI = 0, posA = 0, posB = 0; ; dI++) {
        let next = dI == diff.length ? null : diff[dI], off2 = posA - posB;
        let end = next ? next.fromB : 1e9;
        while (rI < ranges.length && ranges[rI] < end) {
          let from = ranges[rI], to = ranges[rI + 1];
          let fromB = Math.max(posB, from), toB = Math.min(end, to);
          if (fromB <= toB)
            new ChangedRange(fromB + off2, toB + off2, fromB, toB).addToSet(result);
          if (to > end)
            break;
          else
            rI += 2;
        }
        if (!next)
          return result;
        new ChangedRange(next.fromA, next.toA, next.fromB, next.toB).addToSet(result);
        posA = next.toA;
        posB = next.toB;
      }
    }
  }
  class ViewUpdate {
    constructor(view, state, transactions) {
      this.view = view;
      this.state = state;
      this.transactions = transactions;
      this.flags = 0;
      this.startState = view.state;
      this.changes = ChangeSet.empty(this.startState.doc.length);
      for (let tr of transactions)
        this.changes = this.changes.compose(tr.changes);
      let changedRanges = [];
      this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));
      this.changedRanges = changedRanges;
    }
    static create(view, state, transactions) {
      return new ViewUpdate(view, state, transactions);
    }
    get viewportChanged() {
      return (this.flags & 4) > 0;
    }
    get heightChanged() {
      return (this.flags & 2) > 0;
    }
    get geometryChanged() {
      return this.docChanged || (this.flags & (8 | 2)) > 0;
    }
    get focusChanged() {
      return (this.flags & 1) > 0;
    }
    get docChanged() {
      return !this.changes.empty;
    }
    get selectionSet() {
      return this.transactions.some((tr) => tr.selection);
    }
    get empty() {
      return this.flags == 0 && this.transactions.length == 0;
    }
  }
  var Direction = /* @__PURE__ */ function(Direction2) {
    Direction2[Direction2["LTR"] = 0] = "LTR";
    Direction2[Direction2["RTL"] = 1] = "RTL";
    return Direction2;
  }(Direction || (Direction = {}));
  const LTR = Direction.LTR, RTL = Direction.RTL;
  function dec(str) {
    let result = [];
    for (let i2 = 0; i2 < str.length; i2++)
      result.push(1 << +str[i2]);
    return result;
  }
  const LowTypes = /* @__PURE__ */ dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");
  const ArabicTypes = /* @__PURE__ */ dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");
  const Brackets = /* @__PURE__ */ Object.create(null), BracketStack = [];
  for (let p of ["()", "[]", "{}"]) {
    let l = /* @__PURE__ */ p.charCodeAt(0), r = /* @__PURE__ */ p.charCodeAt(1);
    Brackets[l] = r;
    Brackets[r] = -l;
  }
  function charType(ch) {
    return ch <= 247 ? LowTypes[ch] : 1424 <= ch && ch <= 1524 ? 2 : 1536 <= ch && ch <= 1785 ? ArabicTypes[ch - 1536] : 1774 <= ch && ch <= 2220 ? 4 : 8192 <= ch && ch <= 8203 ? 256 : 64336 <= ch && ch <= 65023 ? 4 : ch == 8204 ? 256 : 1;
  }
  const BidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;
  class BidiSpan {
    get dir() {
      return this.level % 2 ? RTL : LTR;
    }
    constructor(from, to, level) {
      this.from = from;
      this.to = to;
      this.level = level;
    }
    side(end, dir) {
      return this.dir == dir == end ? this.to : this.from;
    }
    static find(order, index2, level, assoc) {
      let maybe = -1;
      for (let i2 = 0; i2 < order.length; i2++) {
        let span = order[i2];
        if (span.from <= index2 && span.to >= index2) {
          if (span.level == level)
            return i2;
          if (maybe < 0 || (assoc != 0 ? assoc < 0 ? span.from < index2 : span.to > index2 : order[maybe].level > span.level))
            maybe = i2;
        }
      }
      if (maybe < 0)
        throw new RangeError("Index out of range");
      return maybe;
    }
  }
  function isolatesEq(a, b) {
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++) {
      let iA = a[i2], iB = b[i2];
      if (iA.from != iB.from || iA.to != iB.to || iA.direction != iB.direction || !isolatesEq(iA.inner, iB.inner))
        return false;
    }
    return true;
  }
  const types = [];
  function computeCharTypes(line, rFrom, rTo, isolates, outerType) {
    for (let iI = 0; iI <= isolates.length; iI++) {
      let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
      let prevType = iI ? 256 : outerType;
      for (let i2 = from, prev = prevType, prevStrong = prevType; i2 < to; i2++) {
        let type = charType(line.charCodeAt(i2));
        if (type == 512)
          type = prev;
        else if (type == 8 && prevStrong == 4)
          type = 16;
        types[i2] = type == 4 ? 2 : type;
        if (type & 7)
          prevStrong = type;
        prev = type;
      }
      for (let i2 = from, prev = prevType, prevStrong = prevType; i2 < to; i2++) {
        let type = types[i2];
        if (type == 128) {
          if (i2 < to - 1 && prev == types[i2 + 1] && prev & 24)
            type = types[i2] = prev;
          else
            types[i2] = 256;
        } else if (type == 64) {
          let end = i2 + 1;
          while (end < to && types[end] == 64)
            end++;
          let replace = i2 && prev == 8 || end < rTo && types[end] == 8 ? prevStrong == 1 ? 1 : 8 : 256;
          for (let j = i2; j < end; j++)
            types[j] = replace;
          i2 = end - 1;
        } else if (type == 8 && prevStrong == 1) {
          types[i2] = 1;
        }
        prev = type;
        if (type & 7)
          prevStrong = type;
      }
    }
  }
  function processBracketPairs(line, rFrom, rTo, isolates, outerType) {
    let oppositeType = outerType == 1 ? 2 : 1;
    for (let iI = 0, sI = 0, context = 0; iI <= isolates.length; iI++) {
      let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
      for (let i2 = from, ch, br, type; i2 < to; i2++) {
        if (br = Brackets[ch = line.charCodeAt(i2)]) {
          if (br < 0) {
            for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
              if (BracketStack[sJ + 1] == -br) {
                let flags = BracketStack[sJ + 2];
                let type2 = flags & 2 ? outerType : !(flags & 4) ? 0 : flags & 1 ? oppositeType : outerType;
                if (type2)
                  types[i2] = types[BracketStack[sJ]] = type2;
                sI = sJ;
                break;
              }
            }
          } else if (BracketStack.length == 189) {
            break;
          } else {
            BracketStack[sI++] = i2;
            BracketStack[sI++] = ch;
            BracketStack[sI++] = context;
          }
        } else if ((type = types[i2]) == 2 || type == 1) {
          let embed = type == outerType;
          context = embed ? 0 : 1;
          for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {
            let cur2 = BracketStack[sJ + 2];
            if (cur2 & 2)
              break;
            if (embed) {
              BracketStack[sJ + 2] |= 2;
            } else {
              if (cur2 & 4)
                break;
              BracketStack[sJ + 2] |= 4;
            }
          }
        }
      }
    }
  }
  function processNeutrals(rFrom, rTo, isolates, outerType) {
    for (let iI = 0, prev = outerType; iI <= isolates.length; iI++) {
      let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;
      for (let i2 = from; i2 < to; ) {
        let type = types[i2];
        if (type == 256) {
          let end = i2 + 1;
          for (; ; ) {
            if (end == to) {
              if (iI == isolates.length)
                break;
              end = isolates[iI++].to;
              to = iI < isolates.length ? isolates[iI].from : rTo;
            } else if (types[end] == 256) {
              end++;
            } else {
              break;
            }
          }
          let beforeL = prev == 1;
          let afterL = (end < rTo ? types[end] : outerType) == 1;
          let replace = beforeL == afterL ? beforeL ? 1 : 2 : outerType;
          for (let j = end, jI = iI, fromJ = jI ? isolates[jI - 1].to : rFrom; j > i2; ) {
            if (j == fromJ) {
              j = isolates[--jI].from;
              fromJ = jI ? isolates[jI - 1].to : rFrom;
            }
            types[--j] = replace;
          }
          i2 = end;
        } else {
          prev = type;
          i2++;
        }
      }
    }
  }
  function emitSpans(line, from, to, level, baseLevel, isolates, order) {
    let ourType = level % 2 ? 2 : 1;
    if (level % 2 == baseLevel % 2) {
      for (let iCh = from, iI = 0; iCh < to; ) {
        let sameDir = true, isNum = false;
        if (iI == isolates.length || iCh < isolates[iI].from) {
          let next = types[iCh];
          if (next != ourType) {
            sameDir = false;
            isNum = next == 16;
          }
        }
        let recurse = !sameDir && ourType == 1 ? [] : null;
        let localLevel = sameDir ? level : level + 1;
        let iScan = iCh;
        run:
          for (; ; ) {
            if (iI < isolates.length && iScan == isolates[iI].from) {
              if (isNum)
                break run;
              let iso = isolates[iI];
              if (!sameDir)
                for (let upto = iso.to, jI = iI + 1; ; ) {
                  if (upto == to)
                    break run;
                  if (jI < isolates.length && isolates[jI].from == upto)
                    upto = isolates[jI++].to;
                  else if (types[upto] == ourType)
                    break run;
                  else
                    break;
                }
              iI++;
              if (recurse) {
                recurse.push(iso);
              } else {
                if (iso.from > iCh)
                  order.push(new BidiSpan(iCh, iso.from, localLevel));
                let dirSwap = iso.direction == LTR != !(localLevel % 2);
                computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);
                iCh = iso.to;
              }
              iScan = iso.to;
            } else if (iScan == to || (sameDir ? types[iScan] != ourType : types[iScan] == ourType)) {
              break;
            } else {
              iScan++;
            }
          }
        if (recurse)
          emitSpans(line, iCh, iScan, level + 1, baseLevel, recurse, order);
        else if (iCh < iScan)
          order.push(new BidiSpan(iCh, iScan, localLevel));
        iCh = iScan;
      }
    } else {
      for (let iCh = to, iI = isolates.length; iCh > from; ) {
        let sameDir = true, isNum = false;
        if (!iI || iCh > isolates[iI - 1].to) {
          let next = types[iCh - 1];
          if (next != ourType) {
            sameDir = false;
            isNum = next == 16;
          }
        }
        let recurse = !sameDir && ourType == 1 ? [] : null;
        let localLevel = sameDir ? level : level + 1;
        let iScan = iCh;
        run:
          for (; ; ) {
            if (iI && iScan == isolates[iI - 1].to) {
              if (isNum)
                break run;
              let iso = isolates[--iI];
              if (!sameDir)
                for (let upto = iso.from, jI = iI; ; ) {
                  if (upto == from)
                    break run;
                  if (jI && isolates[jI - 1].to == upto)
                    upto = isolates[--jI].from;
                  else if (types[upto - 1] == ourType)
                    break run;
                  else
                    break;
                }
              if (recurse) {
                recurse.push(iso);
              } else {
                if (iso.to < iCh)
                  order.push(new BidiSpan(iso.to, iCh, localLevel));
                let dirSwap = iso.direction == LTR != !(localLevel % 2);
                computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);
                iCh = iso.from;
              }
              iScan = iso.from;
            } else if (iScan == from || (sameDir ? types[iScan - 1] != ourType : types[iScan - 1] == ourType)) {
              break;
            } else {
              iScan--;
            }
          }
        if (recurse)
          emitSpans(line, iScan, iCh, level + 1, baseLevel, recurse, order);
        else if (iScan < iCh)
          order.push(new BidiSpan(iScan, iCh, localLevel));
        iCh = iScan;
      }
    }
  }
  function computeSectionOrder(line, level, baseLevel, isolates, from, to, order) {
    let outerType = level % 2 ? 2 : 1;
    computeCharTypes(line, from, to, isolates, outerType);
    processBracketPairs(line, from, to, isolates, outerType);
    processNeutrals(from, to, isolates, outerType);
    emitSpans(line, from, to, level, baseLevel, isolates, order);
  }
  function computeOrder(line, direction, isolates) {
    if (!line)
      return [new BidiSpan(0, 0, direction == RTL ? 1 : 0)];
    if (direction == LTR && !isolates.length && !BidiRE.test(line))
      return trivialOrder(line.length);
    if (isolates.length)
      while (line.length > types.length)
        types[types.length] = 256;
    let order = [], level = direction == LTR ? 0 : 1;
    computeSectionOrder(line, level, level, isolates, 0, line.length, order);
    return order;
  }
  function trivialOrder(length) {
    return [new BidiSpan(0, length, 0)];
  }
  let movedOver = "";
  function moveVisually(line, order, dir, start, forward) {
    var _a2;
    let startIndex = start.head - line.from, spanI = -1;
    if (startIndex == 0) {
      if (!forward || !line.length)
        return null;
      if (order[0].level != dir) {
        startIndex = order[0].side(false, dir);
        spanI = 0;
      }
    } else if (startIndex == line.length) {
      if (forward)
        return null;
      let last = order[order.length - 1];
      if (last.level != dir) {
        startIndex = last.side(true, dir);
        spanI = order.length - 1;
      }
    }
    if (spanI < 0)
      spanI = BidiSpan.find(order, startIndex, (_a2 = start.bidiLevel) !== null && _a2 !== void 0 ? _a2 : -1, start.assoc);
    let span = order[spanI];
    if (startIndex == span.side(forward, dir)) {
      span = order[spanI += forward ? 1 : -1];
      startIndex = span.side(!forward, dir);
    }
    let indexForward = forward == (span.dir == dir);
    let nextIndex = findClusterBreak(line.text, startIndex, indexForward);
    movedOver = line.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex));
    if (nextIndex != span.side(forward, dir))
      return EditorSelection.cursor(nextIndex + line.from, indexForward ? -1 : 1, span.level);
    let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)];
    if (!nextSpan && span.level != dir)
      return EditorSelection.cursor(forward ? line.to : line.from, forward ? -1 : 1, dir);
    if (nextSpan && nextSpan.level < span.level)
      return EditorSelection.cursor(nextSpan.side(!forward, dir) + line.from, forward ? 1 : -1, nextSpan.level);
    return EditorSelection.cursor(nextIndex + line.from, forward ? -1 : 1, span.level);
  }
  class DocView extends ContentView {
    get length() {
      return this.view.state.doc.length;
    }
    constructor(view) {
      super();
      this.view = view;
      this.decorations = [];
      this.dynamicDecorationMap = [];
      this.domChanged = null;
      this.hasComposition = null;
      this.markedForComposition = new Set();
      this.minWidth = 0;
      this.minWidthFrom = 0;
      this.minWidthTo = 0;
      this.impreciseAnchor = null;
      this.impreciseHead = null;
      this.forceSelection = false;
      this.lastUpdate = Date.now();
      this.setDOM(view.contentDOM);
      this.children = [new LineView()];
      this.children[0].setParent(this);
      this.updateDeco();
      this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0, null);
    }
    update(update) {
      var _a2;
      let changedRanges = update.changedRanges;
      if (this.minWidth > 0 && changedRanges.length) {
        if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {
          this.minWidth = this.minWidthFrom = this.minWidthTo = 0;
        } else {
          this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);
          this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);
        }
      }
      let readCompositionAt = -1;
      if (this.view.inputState.composing >= 0) {
        if ((_a2 = this.domChanged) === null || _a2 === void 0 ? void 0 : _a2.newSel)
          readCompositionAt = this.domChanged.newSel.head;
        else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet)
          readCompositionAt = update.state.selection.main.head;
      }
      let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;
      this.domChanged = null;
      if (this.hasComposition) {
        this.markedForComposition.clear();
        let { from, to } = this.hasComposition;
        changedRanges = new ChangedRange(from, to, update.changes.mapPos(from, -1), update.changes.mapPos(to, 1)).addToSet(changedRanges.slice());
      }
      this.hasComposition = composition ? { from: composition.range.fromB, to: composition.range.toB } : null;
      if ((browser.ie || browser.chrome) && !composition && update && update.state.doc.lines != update.startState.doc.lines)
        this.forceSelection = true;
      let prevDeco = this.decorations, deco = this.updateDeco();
      let decoDiff = findChangedDeco(prevDeco, deco, update.changes);
      changedRanges = ChangedRange.extendWithRanges(changedRanges, decoDiff);
      if (!(this.flags & 7) && changedRanges.length == 0) {
        return false;
      } else {
        this.updateInner(changedRanges, update.startState.doc.length, composition);
        if (update.transactions.length)
          this.lastUpdate = Date.now();
        return true;
      }
    }
    updateInner(changes, oldLength, composition) {
      this.view.viewState.mustMeasureContent = true;
      this.updateChildren(changes, oldLength, composition);
      let { observer } = this.view;
      observer.ignore(() => {
        this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + "px";
        this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
        let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0;
        this.sync(this.view, track);
        this.flags &= ~7;
        if (track && (track.written || observer.selectionRange.focusNode != track.node))
          this.forceSelection = true;
        this.dom.style.height = "";
      });
      this.markedForComposition.forEach((cView) => cView.flags &= ~8);
      let gaps = [];
      if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length) {
        for (let child of this.children)
          if (child instanceof BlockWidgetView && child.widget instanceof BlockGapWidget)
            gaps.push(child.dom);
      }
      observer.updateGaps(gaps);
    }
    updateChildren(changes, oldLength, composition) {
      let ranges = composition ? composition.range.addToSet(changes.slice()) : changes;
      let cursor = this.childCursor(oldLength);
      for (let i2 = ranges.length - 1; ; i2--) {
        let next = i2 >= 0 ? ranges[i2] : null;
        if (!next)
          break;
        let { fromA, toA, fromB, toB } = next, content2, breakAtStart, openStart, openEnd;
        if (composition && composition.range.fromB < toB && composition.range.toB > fromB) {
          let before = ContentBuilder.build(this.view.state.doc, fromB, composition.range.fromB, this.decorations, this.dynamicDecorationMap);
          let after = ContentBuilder.build(this.view.state.doc, composition.range.toB, toB, this.decorations, this.dynamicDecorationMap);
          breakAtStart = before.breakAtStart;
          openStart = before.openStart;
          openEnd = after.openEnd;
          let compLine = this.compositionView(composition);
          if (after.breakAtStart) {
            compLine.breakAfter = 1;
          } else if (after.content.length && compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {
            compLine.breakAfter = after.content[0].breakAfter;
            after.content.shift();
          }
          if (before.content.length && compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {
            before.content.pop();
          }
          content2 = before.content.concat(compLine).concat(after.content);
        } else {
          ({ content: content2, breakAtStart, openStart, openEnd } = ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap));
        }
        let { i: toI, off: toOff } = cursor.findPos(toA, 1);
        let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1);
        replaceRange(this, fromI, fromOff, toI, toOff, content2, breakAtStart, openStart, openEnd);
      }
      if (composition)
        this.fixCompositionDOM(composition);
    }
    compositionView(composition) {
      let cur2 = new TextView(composition.text.nodeValue);
      cur2.flags |= 8;
      for (let { deco } of composition.marks)
        cur2 = new MarkView(deco, [cur2], cur2.length);
      let line = new LineView();
      line.append(cur2, 0);
      return line;
    }
    fixCompositionDOM(composition) {
      let fix = (dom, cView2) => {
        cView2.flags |= 8 | (cView2.children.some((c) => c.flags & 7) ? 1 : 0);
        this.markedForComposition.add(cView2);
        let prev = ContentView.get(dom);
        if (prev && prev != cView2)
          prev.dom = null;
        cView2.setDOM(dom);
      };
      let pos = this.childPos(composition.range.fromB, 1);
      let cView = this.children[pos.i];
      fix(composition.line, cView);
      for (let i2 = composition.marks.length - 1; i2 >= -1; i2--) {
        pos = cView.childPos(pos.off, 1);
        cView = cView.children[pos.i];
        fix(i2 >= 0 ? composition.marks[i2].node : composition.text, cView);
      }
    }
    updateSelection(mustRead = false, fromPointer = false) {
      if (mustRead || !this.view.observer.selectionRange.focusNode)
        this.view.observer.readSelectionRange();
      let activeElt = this.view.root.activeElement, focused = activeElt == this.dom;
      let selectionNotFocus = !focused && hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));
      if (!(focused || fromPointer || selectionNotFocus))
        return;
      let force = this.forceSelection;
      this.forceSelection = false;
      let main = this.view.state.selection.main;
      let anchor = this.moveToLine(this.domAtPos(main.anchor));
      let head = main.empty ? anchor : this.moveToLine(this.domAtPos(main.head));
      if (browser.gecko && main.empty && !this.hasComposition && betweenUneditable(anchor)) {
        let dummy = document.createTextNode("");
        this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));
        anchor = head = new DOMPos(dummy, 0);
        force = true;
      }
      let domSel = this.view.observer.selectionRange;
      if (force || !domSel.focusNode || !isEquivalentPosition(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) || !isEquivalentPosition(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) {
        this.view.observer.ignore(() => {
          if (browser.android && browser.chrome && this.dom.contains(domSel.focusNode) && inUneditable(domSel.focusNode, this.dom)) {
            this.dom.blur();
            this.dom.focus({ preventScroll: true });
          }
          let rawSel = getSelection(this.view.root);
          if (!rawSel)
            ;
          else if (main.empty) {
            if (browser.gecko) {
              let nextTo = nextToUneditable(anchor.node, anchor.offset);
              if (nextTo && nextTo != (1 | 2)) {
                let text = nearbyTextNode(anchor.node, anchor.offset, nextTo == 1 ? 1 : -1);
                if (text)
                  anchor = new DOMPos(text.node, text.offset);
              }
            }
            rawSel.collapse(anchor.node, anchor.offset);
            if (main.bidiLevel != null && rawSel.caretBidiLevel !== void 0)
              rawSel.caretBidiLevel = main.bidiLevel;
          } else if (rawSel.extend) {
            rawSel.collapse(anchor.node, anchor.offset);
            try {
              rawSel.extend(head.node, head.offset);
            } catch (_) {
            }
          } else {
            let range = document.createRange();
            if (main.anchor > main.head)
              [anchor, head] = [head, anchor];
            range.setEnd(head.node, head.offset);
            range.setStart(anchor.node, anchor.offset);
            rawSel.removeAllRanges();
            rawSel.addRange(range);
          }
          if (selectionNotFocus && this.view.root.activeElement == this.dom) {
            this.dom.blur();
            if (activeElt)
              activeElt.focus();
          }
        });
        this.view.observer.setSelectionRange(anchor, head);
      }
      this.impreciseAnchor = anchor.precise ? null : new DOMPos(domSel.anchorNode, domSel.anchorOffset);
      this.impreciseHead = head.precise ? null : new DOMPos(domSel.focusNode, domSel.focusOffset);
    }
    enforceCursorAssoc() {
      if (this.hasComposition)
        return;
      let { view } = this, cursor = view.state.selection.main;
      let sel = getSelection(view.root);
      let { anchorNode, anchorOffset } = view.observer.selectionRange;
      if (!sel || !cursor.empty || !cursor.assoc || !sel.modify)
        return;
      let line = LineView.find(this, cursor.head);
      if (!line)
        return;
      let lineStart = line.posAtStart;
      if (cursor.head == lineStart || cursor.head == lineStart + line.length)
        return;
      let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1);
      if (!before || !after || before.bottom > after.top)
        return;
      let dom = this.domAtPos(cursor.head + cursor.assoc);
      sel.collapse(dom.node, dom.offset);
      sel.modify("move", cursor.assoc < 0 ? "forward" : "backward", "lineboundary");
      view.observer.readSelectionRange();
      let newRange = view.observer.selectionRange;
      if (view.docView.posFromDOM(newRange.anchorNode, newRange.anchorOffset) != cursor.from)
        sel.collapse(anchorNode, anchorOffset);
    }
    moveToLine(pos) {
      let dom = this.dom, newPos;
      if (pos.node != dom)
        return pos;
      for (let i2 = pos.offset; !newPos && i2 < dom.childNodes.length; i2++) {
        let view = ContentView.get(dom.childNodes[i2]);
        if (view instanceof LineView)
          newPos = view.domAtPos(0);
      }
      for (let i2 = pos.offset - 1; !newPos && i2 >= 0; i2--) {
        let view = ContentView.get(dom.childNodes[i2]);
        if (view instanceof LineView)
          newPos = view.domAtPos(view.length);
      }
      return newPos ? new DOMPos(newPos.node, newPos.offset, true) : pos;
    }
    nearest(dom) {
      for (let cur2 = dom; cur2; ) {
        let domView = ContentView.get(cur2);
        if (domView && domView.rootView == this)
          return domView;
        cur2 = cur2.parentNode;
      }
      return null;
    }
    posFromDOM(node, offset) {
      let view = this.nearest(node);
      if (!view)
        throw new RangeError("Trying to find position for a DOM position outside of the document");
      return view.localPosFromDOM(node, offset) + view.posAtStart;
    }
    domAtPos(pos) {
      let { i: i2, off: off2 } = this.childCursor().findPos(pos, -1);
      for (; i2 < this.children.length - 1; ) {
        let child = this.children[i2];
        if (off2 < child.length || child instanceof LineView)
          break;
        i2++;
        off2 = 0;
      }
      return this.children[i2].domAtPos(off2);
    }
    coordsAt(pos, side) {
      let best = null, bestPos = 0;
      for (let off2 = this.length, i2 = this.children.length - 1; i2 >= 0; i2--) {
        let child = this.children[i2], end = off2 - child.breakAfter, start = end - child.length;
        if (end < pos)
          break;
        if (start <= pos && (start < pos || child.covers(-1)) && (end > pos || child.covers(1)) && (!best || child instanceof LineView && !(best instanceof LineView && side >= 0))) {
          best = child;
          bestPos = start;
        }
        off2 = start;
      }
      return best ? best.coordsAt(pos - bestPos, side) : null;
    }
    coordsForChar(pos) {
      let { i: i2, off: off2 } = this.childPos(pos, 1), child = this.children[i2];
      if (!(child instanceof LineView))
        return null;
      while (child.children.length) {
        let { i: i3, off: childOff } = child.childPos(off2, 1);
        for (; ; i3++) {
          if (i3 == child.children.length)
            return null;
          if ((child = child.children[i3]).length)
            break;
        }
        off2 = childOff;
      }
      if (!(child instanceof TextView))
        return null;
      let end = findClusterBreak(child.text, off2);
      if (end == off2)
        return null;
      let rects = textRange(child.dom, off2, end).getClientRects();
      for (let i3 = 0; i3 < rects.length; i3++) {
        let rect = rects[i3];
        if (i3 == rects.length - 1 || rect.top < rect.bottom && rect.left < rect.right)
          return rect;
      }
      return null;
    }
    measureVisibleLineHeights(viewport) {
      let result = [], { from, to } = viewport;
      let contentWidth = this.view.contentDOM.clientWidth;
      let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;
      let widest = -1, ltr = this.view.textDirection == Direction.LTR;
      for (let pos = 0, i2 = 0; i2 < this.children.length; i2++) {
        let child = this.children[i2], end = pos + child.length;
        if (end > to)
          break;
        if (pos >= from) {
          let childRect = child.dom.getBoundingClientRect();
          result.push(childRect.height);
          if (isWider) {
            let last = child.dom.lastChild;
            let rects = last ? clientRectsFor(last) : [];
            if (rects.length) {
              let rect = rects[rects.length - 1];
              let width = ltr ? rect.right - childRect.left : childRect.right - rect.left;
              if (width > widest) {
                widest = width;
                this.minWidth = contentWidth;
                this.minWidthFrom = pos;
                this.minWidthTo = end;
              }
            }
          }
        }
        pos = end + child.breakAfter;
      }
      return result;
    }
    textDirectionAt(pos) {
      let { i: i2 } = this.childPos(pos, 1);
      return getComputedStyle(this.children[i2].dom).direction == "rtl" ? Direction.RTL : Direction.LTR;
    }
    measureTextSize() {
      for (let child of this.children) {
        if (child instanceof LineView) {
          let measure = child.measureTextSize();
          if (measure)
            return measure;
        }
      }
      let dummy = document.createElement("div"), lineHeight, charWidth, textHeight;
      dummy.className = "cm-line";
      dummy.style.width = "99999px";
      dummy.style.position = "absolute";
      dummy.textContent = "abc def ghi jkl mno pqr stu";
      this.view.observer.ignore(() => {
        this.dom.appendChild(dummy);
        let rect = clientRectsFor(dummy.firstChild)[0];
        lineHeight = dummy.getBoundingClientRect().height;
        charWidth = rect ? rect.width / 27 : 7;
        textHeight = rect ? rect.height : lineHeight;
        dummy.remove();
      });
      return { lineHeight, charWidth, textHeight };
    }
    childCursor(pos = this.length) {
      let i2 = this.children.length;
      if (i2)
        pos -= this.children[--i2].length;
      return new ChildCursor(this.children, pos, i2);
    }
    computeBlockGapDeco() {
      let deco = [], vs = this.view.viewState;
      for (let pos = 0, i2 = 0; ; i2++) {
        let next = i2 == vs.viewports.length ? null : vs.viewports[i2];
        let end = next ? next.from - 1 : this.length;
        if (end > pos) {
          let height = (vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top) / this.view.scaleY;
          deco.push(Decoration.replace({
            widget: new BlockGapWidget(height),
            block: true,
            inclusive: true,
            isBlockGap: true
          }).range(pos, end));
        }
        if (!next)
          break;
        pos = next.to + 1;
      }
      return Decoration.set(deco);
    }
    updateDeco() {
      let allDeco = this.view.state.facet(decorations).map((d, i2) => {
        let dynamic = this.dynamicDecorationMap[i2] = typeof d == "function";
        return dynamic ? d(this.view) : d;
      });
      for (let i2 = allDeco.length; i2 < allDeco.length + 3; i2++)
        this.dynamicDecorationMap[i2] = false;
      return this.decorations = [
        ...allDeco,
        this.computeBlockGapDeco(),
        this.view.viewState.lineGapDeco
      ];
    }
    scrollIntoView(target) {
      if (target.isSnapshot) {
        let ref2 = this.view.viewState.lineBlockAt(target.range.head);
        this.view.scrollDOM.scrollTop = ref2.top - target.yMargin;
        this.view.scrollDOM.scrollLeft = target.xMargin;
        return;
      }
      let { range } = target;
      let rect = this.coordsAt(range.head, range.empty ? range.assoc : range.head > range.anchor ? -1 : 1), other;
      if (!rect)
        return;
      if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1)))
        rect = {
          left: Math.min(rect.left, other.left),
          top: Math.min(rect.top, other.top),
          right: Math.max(rect.right, other.right),
          bottom: Math.max(rect.bottom, other.bottom)
        };
      let margins = getScrollMargins(this.view);
      let targetRect = {
        left: rect.left - margins.left,
        top: rect.top - margins.top,
        right: rect.right + margins.right,
        bottom: rect.bottom + margins.bottom
      };
      let { offsetWidth, offsetHeight } = this.view.scrollDOM;
      scrollRectIntoView(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, Math.max(Math.min(target.xMargin, offsetWidth), -offsetWidth), Math.max(Math.min(target.yMargin, offsetHeight), -offsetHeight), this.view.textDirection == Direction.LTR);
    }
  }
  function betweenUneditable(pos) {
    return pos.node.nodeType == 1 && pos.node.firstChild && (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == "false") && (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == "false");
  }
  class BlockGapWidget extends WidgetType {
    constructor(height) {
      super();
      this.height = height;
    }
    toDOM() {
      let elt = document.createElement("div");
      this.updateDOM(elt);
      return elt;
    }
    eq(other) {
      return other.height == this.height;
    }
    updateDOM(elt) {
      elt.style.height = this.height + "px";
      return true;
    }
    get estimatedHeight() {
      return this.height;
    }
  }
  function findCompositionNode(view, headPos) {
    let sel = view.observer.selectionRange;
    let textNode = sel.focusNode && nearbyTextNode(sel.focusNode, sel.focusOffset, 0);
    if (!textNode)
      return null;
    let from = headPos - textNode.offset;
    return { from, to: from + textNode.node.nodeValue.length, node: textNode.node };
  }
  function findCompositionRange(view, changes, headPos) {
    let found = findCompositionNode(view, headPos);
    if (!found)
      return null;
    let { node: textNode, from, to } = found, text = textNode.nodeValue;
    if (/[\n\r]/.test(text))
      return null;
    if (view.state.doc.sliceString(found.from, found.to) != text)
      return null;
    let inv = changes.invertedDesc;
    let range = new ChangedRange(inv.mapPos(from), inv.mapPos(to), from, to);
    let marks = [];
    for (let parent = textNode.parentNode; ; parent = parent.parentNode) {
      let parentView = ContentView.get(parent);
      if (parentView instanceof MarkView)
        marks.push({ node: parent, deco: parentView.mark });
      else if (parentView instanceof LineView || parent.nodeName == "DIV" && parent.parentNode == view.contentDOM)
        return { range, text: textNode, marks, line: parent };
      else if (parent != view.contentDOM)
        marks.push({ node: parent, deco: new MarkDecoration({
          inclusive: true,
          attributes: getAttrs(parent),
          tagName: parent.tagName.toLowerCase()
        }) });
      else
        return null;
    }
  }
  function nearbyTextNode(startNode, startOffset, side) {
    if (side <= 0)
      for (let node = startNode, offset = startOffset; ; ) {
        if (node.nodeType == 3)
          return { node, offset };
        if (node.nodeType == 1 && offset > 0) {
          node = node.childNodes[offset - 1];
          offset = maxOffset(node);
        } else {
          break;
        }
      }
    if (side >= 0)
      for (let node = startNode, offset = startOffset; ; ) {
        if (node.nodeType == 3)
          return { node, offset };
        if (node.nodeType == 1 && offset < node.childNodes.length && side >= 0) {
          node = node.childNodes[offset];
          offset = 0;
        } else {
          break;
        }
      }
    return null;
  }
  function nextToUneditable(node, offset) {
    if (node.nodeType != 1)
      return 0;
    return (offset && node.childNodes[offset - 1].contentEditable == "false" ? 1 : 0) | (offset < node.childNodes.length && node.childNodes[offset].contentEditable == "false" ? 2 : 0);
  }
  let DecorationComparator$1 = class DecorationComparator {
    constructor() {
      this.changes = [];
    }
    compareRange(from, to) {
      addRange(from, to, this.changes);
    }
    comparePoint(from, to) {
      addRange(from, to, this.changes);
    }
  };
  function findChangedDeco(a, b, diff) {
    let comp = new DecorationComparator$1();
    RangeSet.compare(a, b, diff, comp);
    return comp.changes;
  }
  function inUneditable(node, inside2) {
    for (let cur2 = node; cur2 && cur2 != inside2; cur2 = cur2.assignedSlot || cur2.parentNode) {
      if (cur2.nodeType == 1 && cur2.contentEditable == "false") {
        return true;
      }
    }
    return false;
  }
  function touchesComposition(changes, composition) {
    let touched = false;
    if (composition)
      changes.iterChangedRanges((from, to) => {
        if (from < composition.to && to > composition.from)
          touched = true;
      });
    return touched;
  }
  function groupAt(state, pos, bias = 1) {
    let categorize = state.charCategorizer(pos);
    let line = state.doc.lineAt(pos), linePos = pos - line.from;
    if (line.length == 0)
      return EditorSelection.cursor(pos);
    if (linePos == 0)
      bias = 1;
    else if (linePos == line.length)
      bias = -1;
    let from = linePos, to = linePos;
    if (bias < 0)
      from = findClusterBreak(line.text, linePos, false);
    else
      to = findClusterBreak(line.text, linePos);
    let cat = categorize(line.text.slice(from, to));
    while (from > 0) {
      let prev = findClusterBreak(line.text, from, false);
      if (categorize(line.text.slice(prev, from)) != cat)
        break;
      from = prev;
    }
    while (to < line.length) {
      let next = findClusterBreak(line.text, to);
      if (categorize(line.text.slice(to, next)) != cat)
        break;
      to = next;
    }
    return EditorSelection.range(from + line.from, to + line.from);
  }
  function getdx(x, rect) {
    return rect.left > x ? rect.left - x : Math.max(0, x - rect.right);
  }
  function getdy(y, rect) {
    return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom);
  }
  function yOverlap(a, b) {
    return a.top < b.bottom - 1 && a.bottom > b.top + 1;
  }
  function upTop(rect, top2) {
    return top2 < rect.top ? { top: top2, left: rect.left, right: rect.right, bottom: rect.bottom } : rect;
  }
  function upBot(rect, bottom) {
    return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect;
  }
  function domPosAtCoords(parent, x, y) {
    let closest2, closestRect, closestX, closestY, closestOverlap = false;
    let above, below, aboveRect, belowRect;
    for (let child = parent.firstChild; child; child = child.nextSibling) {
      let rects = clientRectsFor(child);
      for (let i2 = 0; i2 < rects.length; i2++) {
        let rect = rects[i2];
        if (closestRect && yOverlap(closestRect, rect))
          rect = upTop(upBot(rect, closestRect.bottom), closestRect.top);
        let dx = getdx(x, rect), dy = getdy(y, rect);
        if (dx == 0 && dy == 0)
          return child.nodeType == 3 ? domPosInText(child, x, y) : domPosAtCoords(child, x, y);
        if (!closest2 || closestY > dy || closestY == dy && closestX > dx) {
          closest2 = child;
          closestRect = rect;
          closestX = dx;
          closestY = dy;
          let side = dy ? y < rect.top ? -1 : 1 : dx ? x < rect.left ? -1 : 1 : 0;
          closestOverlap = !side || (side > 0 ? i2 < rects.length - 1 : i2 > 0);
        }
        if (dx == 0) {
          if (y > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) {
            above = child;
            aboveRect = rect;
          } else if (y < rect.top && (!belowRect || belowRect.top > rect.top)) {
            below = child;
            belowRect = rect;
          }
        } else if (aboveRect && yOverlap(aboveRect, rect)) {
          aboveRect = upBot(aboveRect, rect.bottom);
        } else if (belowRect && yOverlap(belowRect, rect)) {
          belowRect = upTop(belowRect, rect.top);
        }
      }
    }
    if (aboveRect && aboveRect.bottom >= y) {
      closest2 = above;
      closestRect = aboveRect;
    } else if (belowRect && belowRect.top <= y) {
      closest2 = below;
      closestRect = belowRect;
    }
    if (!closest2)
      return { node: parent, offset: 0 };
    let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x));
    if (closest2.nodeType == 3)
      return domPosInText(closest2, clipX, y);
    if (closestOverlap && closest2.contentEditable != "false")
      return domPosAtCoords(closest2, clipX, y);
    let offset = Array.prototype.indexOf.call(parent.childNodes, closest2) + (x >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);
    return { node: parent, offset };
  }
  function domPosInText(node, x, y) {
    let len = node.nodeValue.length;
    let closestOffset = -1, closestDY = 1e9, generalSide = 0;
    for (let i2 = 0; i2 < len; i2++) {
      let rects = textRange(node, i2, i2 + 1).getClientRects();
      for (let j = 0; j < rects.length; j++) {
        let rect = rects[j];
        if (rect.top == rect.bottom)
          continue;
        if (!generalSide)
          generalSide = x - rect.left;
        let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1;
        if (rect.left - 1 <= x && rect.right + 1 >= x && dy < closestDY) {
          let right = x >= (rect.left + rect.right) / 2, after = right;
          if (browser.chrome || browser.gecko) {
            let rectBefore = textRange(node, i2).getBoundingClientRect();
            if (rectBefore.left == rect.right)
              after = !right;
          }
          if (dy <= 0)
            return { node, offset: i2 + (after ? 1 : 0) };
          closestOffset = i2 + (after ? 1 : 0);
          closestDY = dy;
        }
      }
    }
    return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 };
  }
  function posAtCoords(view, coords, precise, bias = -1) {
    var _a2, _b;
    let content2 = view.contentDOM.getBoundingClientRect(), docTop = content2.top + view.viewState.paddingTop;
    let block, { docHeight } = view.viewState;
    let { x, y } = coords, yOffset = y - docTop;
    if (yOffset < 0)
      return 0;
    if (yOffset > docHeight)
      return view.state.doc.length;
    for (let halfLine = view.viewState.heightOracle.textHeight / 2, bounced = false; ; ) {
      block = view.elementAtHeight(yOffset);
      if (block.type == BlockType.Text)
        break;
      for (; ; ) {
        yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine;
        if (yOffset >= 0 && yOffset <= docHeight)
          break;
        if (bounced)
          return precise ? null : 0;
        bounced = true;
        bias = -bias;
      }
    }
    y = docTop + yOffset;
    let lineStart = block.from;
    if (lineStart < view.viewport.from)
      return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content2, block, x, y);
    if (lineStart > view.viewport.to)
      return view.viewport.to == view.state.doc.length ? view.state.doc.length : precise ? null : posAtCoordsImprecise(view, content2, block, x, y);
    let doc2 = view.dom.ownerDocument;
    let root = view.root.elementFromPoint ? view.root : doc2;
    let element = root.elementFromPoint(x, y);
    if (element && !view.contentDOM.contains(element))
      element = null;
    if (!element) {
      x = Math.max(content2.left + 1, Math.min(content2.right - 1, x));
      element = root.elementFromPoint(x, y);
      if (element && !view.contentDOM.contains(element))
        element = null;
    }
    let node, offset = -1;
    if (element && ((_a2 = view.docView.nearest(element)) === null || _a2 === void 0 ? void 0 : _a2.isEditable) != false) {
      if (doc2.caretPositionFromPoint) {
        let pos = doc2.caretPositionFromPoint(x, y);
        if (pos)
          ({ offsetNode: node, offset } = pos);
      } else if (doc2.caretRangeFromPoint) {
        let range = doc2.caretRangeFromPoint(x, y);
        if (range) {
          ({ startContainer: node, startOffset: offset } = range);
          if (!view.contentDOM.contains(node) || browser.safari && isSuspiciousSafariCaretResult(node, offset, x) || browser.chrome && isSuspiciousChromeCaretResult(node, offset, x))
            node = void 0;
        }
      }
    }
    if (!node || !view.docView.dom.contains(node)) {
      let line = LineView.find(view.docView, lineStart);
      if (!line)
        return yOffset > block.top + block.height / 2 ? block.to : block.from;
      ({ node, offset } = domPosAtCoords(line.dom, x, y));
    }
    let nearest = view.docView.nearest(node);
    if (!nearest)
      return null;
    if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {
      let rect = nearest.dom.getBoundingClientRect();
      return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2 ? nearest.posAtStart : nearest.posAtEnd;
    } else {
      return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;
    }
  }
  function posAtCoordsImprecise(view, contentRect, block, x, y) {
    let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);
    if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) {
      let textHeight = view.viewState.heightOracle.textHeight;
      let line = Math.floor((y - block.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);
      into += line * view.viewState.heightOracle.lineLength;
    }
    let content2 = view.state.sliceDoc(block.from, block.to);
    return block.from + findColumn(content2, into, view.state.tabSize);
  }
  function isSuspiciousSafariCaretResult(node, offset, x) {
    let len;
    if (node.nodeType != 3 || offset != (len = node.nodeValue.length))
      return false;
    for (let next = node.nextSibling; next; next = next.nextSibling)
      if (next.nodeType != 1 || next.nodeName != "BR")
        return false;
    return textRange(node, len - 1, len).getBoundingClientRect().left > x;
  }
  function isSuspiciousChromeCaretResult(node, offset, x) {
    if (offset != 0)
      return false;
    for (let cur2 = node; ; ) {
      let parent = cur2.parentNode;
      if (!parent || parent.nodeType != 1 || parent.firstChild != cur2)
        return false;
      if (parent.classList.contains("cm-line"))
        break;
      cur2 = parent;
    }
    let rect = node.nodeType == 1 ? node.getBoundingClientRect() : textRange(node, 0, Math.max(node.nodeValue.length, 1)).getBoundingClientRect();
    return x - rect.left > 5;
  }
  function blockAt(view, pos) {
    let line = view.lineBlockAt(pos);
    if (Array.isArray(line.type))
      for (let l of line.type) {
        if (l.to > pos || l.to == pos && (l.to == line.to || l.type == BlockType.Text))
          return l;
      }
    return line;
  }
  function moveToLineBoundary(view, start, forward, includeWrap) {
    let line = blockAt(view, start.head);
    let coords = !includeWrap || line.type != BlockType.Text || !(view.lineWrapping || line.widgetLineBreaks) ? null : view.coordsAtPos(start.assoc < 0 && start.head > line.from ? start.head - 1 : start.head);
    if (coords) {
      let editorRect = view.dom.getBoundingClientRect();
      let direction = view.textDirectionAt(line.from);
      let pos = view.posAtCoords({
        x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,
        y: (coords.top + coords.bottom) / 2
      });
      if (pos != null)
        return EditorSelection.cursor(pos, forward ? -1 : 1);
    }
    return EditorSelection.cursor(forward ? line.to : line.from, forward ? -1 : 1);
  }
  function moveByChar(view, start, forward, by) {
    let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line);
    let direction = view.textDirectionAt(line.from);
    for (let cur2 = start, check = null; ; ) {
      let next = moveVisually(line, spans, direction, cur2, forward), char = movedOver;
      if (!next) {
        if (line.number == (forward ? view.state.doc.lines : 1))
          return cur2;
        char = "\n";
        line = view.state.doc.line(line.number + (forward ? 1 : -1));
        spans = view.bidiSpans(line);
        next = EditorSelection.cursor(forward ? line.from : line.to);
      }
      if (!check) {
        if (!by)
          return next;
        check = by(char);
      } else if (!check(char)) {
        return cur2;
      }
      cur2 = next;
    }
  }
  function byGroup(view, pos, start) {
    let categorize = view.state.charCategorizer(pos);
    let cat = categorize(start);
    return (next) => {
      let nextCat = categorize(next);
      if (cat == CharCategory.Space)
        cat = nextCat;
      return cat == nextCat;
    };
  }
  function moveVertically(view, start, forward, distance) {
    let startPos = start.head, dir = forward ? 1 : -1;
    if (startPos == (forward ? view.state.doc.length : 0))
      return EditorSelection.cursor(startPos, start.assoc);
    let goal = start.goalColumn, startY;
    let rect = view.contentDOM.getBoundingClientRect();
    let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;
    if (startCoords) {
      if (goal == null)
        goal = startCoords.left - rect.left;
      startY = dir < 0 ? startCoords.top : startCoords.bottom;
    } else {
      let line = view.viewState.lineBlockAt(startPos);
      if (goal == null)
        goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line.from));
      startY = (dir < 0 ? line.top : line.bottom) + docTop;
    }
    let resolvedGoal = rect.left + goal;
    let dist2 = distance !== null && distance !== void 0 ? distance : view.viewState.heightOracle.textHeight >> 1;
    for (let extra = 0; ; extra += 10) {
      let curY = startY + (dist2 + extra) * dir;
      let pos = posAtCoords(view, { x: resolvedGoal, y: curY }, false, dir);
      if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) {
        let charRect = view.docView.coordsForChar(pos);
        let assoc = !charRect || curY < charRect.top ? -1 : 1;
        return EditorSelection.cursor(pos, assoc, void 0, goal);
      }
    }
  }
  function skipAtomicRanges(atoms, pos, bias) {
    for (; ; ) {
      let moved2 = 0;
      for (let set of atoms) {
        set.between(pos - 1, pos + 1, (from, to, value2) => {
          if (pos > from && pos < to) {
            let side = moved2 || bias || (pos - from < to - pos ? -1 : 1);
            pos = side < 0 ? from : to;
            moved2 = side;
          }
        });
      }
      if (!moved2)
        return pos;
    }
  }
  function skipAtoms(view, oldPos, pos) {
    let newPos = skipAtomicRanges(view.state.facet(atomicRanges).map((f) => f(view)), pos.from, oldPos.head > pos.from ? -1 : 1);
    return newPos == pos.from ? pos : EditorSelection.cursor(newPos, newPos < pos.from ? 1 : -1);
  }
  class InputState {
    setSelectionOrigin(origin) {
      this.lastSelectionOrigin = origin;
      this.lastSelectionTime = Date.now();
    }
    constructor(view) {
      this.view = view;
      this.lastKeyCode = 0;
      this.lastKeyTime = 0;
      this.lastTouchTime = 0;
      this.lastFocusTime = 0;
      this.lastScrollTop = 0;
      this.lastScrollLeft = 0;
      this.pendingIOSKey = void 0;
      this.lastSelectionOrigin = null;
      this.lastSelectionTime = 0;
      this.lastEscPress = 0;
      this.lastContextMenu = 0;
      this.scrollHandlers = [];
      this.handlers = Object.create(null);
      this.composing = -1;
      this.compositionFirstChange = null;
      this.compositionEndedAt = 0;
      this.compositionPendingKey = false;
      this.compositionPendingChange = false;
      this.mouseSelection = null;
      this.draggedContent = null;
      this.handleEvent = this.handleEvent.bind(this);
      this.notifiedFocused = view.hasFocus;
      if (browser.safari)
        view.contentDOM.addEventListener("input", () => null);
      if (browser.gecko)
        firefoxCopyCutHack(view.contentDOM.ownerDocument);
    }
    handleEvent(event) {
      if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event))
        return;
      if (event.type == "keydown" && this.keydown(event))
        return;
      this.runHandlers(event.type, event);
    }
    runHandlers(type, event) {
      let handlers2 = this.handlers[type];
      if (handlers2) {
        for (let observer of handlers2.observers)
          observer(this.view, event);
        for (let handler of handlers2.handlers) {
          if (event.defaultPrevented)
            break;
          if (handler(this.view, event)) {
            event.preventDefault();
            break;
          }
        }
      }
    }
    ensureHandlers(plugins2) {
      let handlers2 = computeHandlers(plugins2), prev = this.handlers, dom = this.view.contentDOM;
      for (let type in handlers2)
        if (type != "scroll") {
          let passive = !handlers2[type].handlers.length;
          let exists = prev[type];
          if (exists && passive != !exists.handlers.length) {
            dom.removeEventListener(type, this.handleEvent);
            exists = null;
          }
          if (!exists)
            dom.addEventListener(type, this.handleEvent, { passive });
        }
      for (let type in prev)
        if (type != "scroll" && !handlers2[type])
          dom.removeEventListener(type, this.handleEvent);
      this.handlers = handlers2;
    }
    keydown(event) {
      this.lastKeyCode = event.keyCode;
      this.lastKeyTime = Date.now();
      if (event.keyCode == 9 && Date.now() < this.lastEscPress + 2e3)
        return true;
      if (event.keyCode != 27 && modifierCodes.indexOf(event.keyCode) < 0)
        this.view.inputState.lastEscPress = 0;
      if (browser.android && browser.chrome && !event.synthetic && (event.keyCode == 13 || event.keyCode == 8)) {
        this.view.observer.delayAndroidKey(event.key, event.keyCode);
        return true;
      }
      let pending;
      if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey && ((pending = PendingKeys.find((key) => key.keyCode == event.keyCode)) && !event.ctrlKey || EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey && !event.shiftKey)) {
        this.pendingIOSKey = pending || event;
        setTimeout(() => this.flushIOSKey(), 250);
        return true;
      }
      if (event.keyCode != 229)
        this.view.observer.forceFlush();
      return false;
    }
    flushIOSKey() {
      let key = this.pendingIOSKey;
      if (!key)
        return false;
      this.pendingIOSKey = void 0;
      return dispatchKey(this.view.contentDOM, key.key, key.keyCode);
    }
    ignoreDuringComposition(event) {
      if (!/^key/.test(event.type))
        return false;
      if (this.composing > 0)
        return true;
      if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {
        this.compositionPendingKey = false;
        return true;
      }
      return false;
    }
    startMouseSelection(mouseSelection) {
      if (this.mouseSelection)
        this.mouseSelection.destroy();
      this.mouseSelection = mouseSelection;
    }
    update(update) {
      if (this.mouseSelection)
        this.mouseSelection.update(update);
      if (this.draggedContent && update.docChanged)
        this.draggedContent = this.draggedContent.map(update.changes);
      if (update.transactions.length)
        this.lastKeyCode = this.lastSelectionTime = 0;
    }
    destroy() {
      if (this.mouseSelection)
        this.mouseSelection.destroy();
    }
  }
  function bindHandler(plugin, handler) {
    return (view, event) => {
      try {
        return handler.call(plugin, event, view);
      } catch (e) {
        logException(view.state, e);
      }
    };
  }
  function computeHandlers(plugins2) {
    let result = Object.create(null);
    function record(type) {
      return result[type] || (result[type] = { observers: [], handlers: [] });
    }
    for (let plugin of plugins2) {
      let spec = plugin.spec;
      if (spec && spec.domEventHandlers)
        for (let type in spec.domEventHandlers) {
          let f = spec.domEventHandlers[type];
          if (f)
            record(type).handlers.push(bindHandler(plugin.value, f));
        }
      if (spec && spec.domEventObservers)
        for (let type in spec.domEventObservers) {
          let f = spec.domEventObservers[type];
          if (f)
            record(type).observers.push(bindHandler(plugin.value, f));
        }
    }
    for (let type in handlers)
      record(type).handlers.push(handlers[type]);
    for (let type in observers)
      record(type).observers.push(observers[type]);
    return result;
  }
  const PendingKeys = [
    { key: "Backspace", keyCode: 8, inputType: "deleteContentBackward" },
    { key: "Enter", keyCode: 13, inputType: "insertParagraph" },
    { key: "Enter", keyCode: 13, inputType: "insertLineBreak" },
    { key: "Delete", keyCode: 46, inputType: "deleteContentForward" }
  ];
  const EmacsyPendingKeys = "dthko";
  const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];
  const dragScrollMargin = 6;
  function dragScrollSpeed(dist2) {
    return Math.max(0, dist2) * 0.7 + 8;
  }
  function dist(a, b) {
    return Math.max(Math.abs(a.clientX - b.clientX), Math.abs(a.clientY - b.clientY));
  }
  class MouseSelection {
    constructor(view, startEvent, style, mustSelect) {
      this.view = view;
      this.startEvent = startEvent;
      this.style = style;
      this.mustSelect = mustSelect;
      this.scrollSpeed = { x: 0, y: 0 };
      this.scrolling = -1;
      this.lastEvent = startEvent;
      this.scrollParent = scrollableParent(view.contentDOM);
      this.atoms = view.state.facet(atomicRanges).map((f) => f(view));
      let doc2 = view.contentDOM.ownerDocument;
      doc2.addEventListener("mousemove", this.move = this.move.bind(this));
      doc2.addEventListener("mouseup", this.up = this.up.bind(this));
      this.extend = startEvent.shiftKey;
      this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);
      this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;
    }
    start(event) {
      if (this.dragging === false)
        this.select(event);
    }
    move(event) {
      var _a2;
      if (event.buttons == 0)
        return this.destroy();
      if (this.dragging || this.dragging == null && dist(this.startEvent, event) < 10)
        return;
      this.select(this.lastEvent = event);
      let sx = 0, sy = 0;
      let rect = ((_a2 = this.scrollParent) === null || _a2 === void 0 ? void 0 : _a2.getBoundingClientRect()) || { left: 0, top: 0, right: this.view.win.innerWidth, bottom: this.view.win.innerHeight };
      let margins = getScrollMargins(this.view);
      if (event.clientX - margins.left <= rect.left + dragScrollMargin)
        sx = -dragScrollSpeed(rect.left - event.clientX);
      else if (event.clientX + margins.right >= rect.right - dragScrollMargin)
        sx = dragScrollSpeed(event.clientX - rect.right);
      if (event.clientY - margins.top <= rect.top + dragScrollMargin)
        sy = -dragScrollSpeed(rect.top - event.clientY);
      else if (event.clientY + margins.bottom >= rect.bottom - dragScrollMargin)
        sy = dragScrollSpeed(event.clientY - rect.bottom);
      this.setScrollSpeed(sx, sy);
    }
    up(event) {
      if (this.dragging == null)
        this.select(this.lastEvent);
      if (!this.dragging)
        event.preventDefault();
      this.destroy();
    }
    destroy() {
      this.setScrollSpeed(0, 0);
      let doc2 = this.view.contentDOM.ownerDocument;
      doc2.removeEventListener("mousemove", this.move);
      doc2.removeEventListener("mouseup", this.up);
      this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null;
    }
    setScrollSpeed(sx, sy) {
      this.scrollSpeed = { x: sx, y: sy };
      if (sx || sy) {
        if (this.scrolling < 0)
          this.scrolling = setInterval(() => this.scroll(), 50);
      } else if (this.scrolling > -1) {
        clearInterval(this.scrolling);
        this.scrolling = -1;
      }
    }
    scroll() {
      if (this.scrollParent) {
        this.scrollParent.scrollLeft += this.scrollSpeed.x;
        this.scrollParent.scrollTop += this.scrollSpeed.y;
      } else {
        this.view.win.scrollBy(this.scrollSpeed.x, this.scrollSpeed.y);
      }
      if (this.dragging === false)
        this.select(this.lastEvent);
    }
    skipAtoms(sel) {
      let ranges = null;
      for (let i2 = 0; i2 < sel.ranges.length; i2++) {
        let range = sel.ranges[i2], updated = null;
        if (range.empty) {
          let pos = skipAtomicRanges(this.atoms, range.from, 0);
          if (pos != range.from)
            updated = EditorSelection.cursor(pos, -1);
        } else {
          let from = skipAtomicRanges(this.atoms, range.from, -1);
          let to = skipAtomicRanges(this.atoms, range.to, 1);
          if (from != range.from || to != range.to)
            updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);
        }
        if (updated) {
          if (!ranges)
            ranges = sel.ranges.slice();
          ranges[i2] = updated;
        }
      }
      return ranges ? EditorSelection.create(ranges, sel.mainIndex) : sel;
    }
    select(event) {
      let { view } = this, selection = this.skipAtoms(this.style.get(event, this.extend, this.multiple));
      if (this.mustSelect || !selection.eq(view.state.selection) || selection.main.assoc != view.state.selection.main.assoc && this.dragging === false)
        this.view.dispatch({
          selection,
          userEvent: "select.pointer"
        });
      this.mustSelect = false;
    }
    update(update) {
      if (this.style.update(update))
        setTimeout(() => this.select(this.lastEvent), 20);
    }
  }
  function addsSelectionRange(view, event) {
    let facet = view.state.facet(clickAddsSelectionRange);
    return facet.length ? facet[0](event) : browser.mac ? event.metaKey : event.ctrlKey;
  }
  function dragMovesSelection(view, event) {
    let facet = view.state.facet(dragMovesSelection$1);
    return facet.length ? facet[0](event) : browser.mac ? !event.altKey : !event.ctrlKey;
  }
  function isInPrimarySelection(view, event) {
    let { main } = view.state.selection;
    if (main.empty)
      return false;
    let sel = getSelection(view.root);
    if (!sel || sel.rangeCount == 0)
      return true;
    let rects = sel.getRangeAt(0).getClientRects();
    for (let i2 = 0; i2 < rects.length; i2++) {
      let rect = rects[i2];
      if (rect.left <= event.clientX && rect.right >= event.clientX && rect.top <= event.clientY && rect.bottom >= event.clientY)
        return true;
    }
    return false;
  }
  function eventBelongsToEditor(view, event) {
    if (!event.bubbles)
      return true;
    if (event.defaultPrevented)
      return false;
    for (let node = event.target, cView; node != view.contentDOM; node = node.parentNode)
      if (!node || node.nodeType == 11 || (cView = ContentView.get(node)) && cView.ignoreEvent(event))
        return false;
    return true;
  }
  const handlers = /* @__PURE__ */ Object.create(null);
  const observers = /* @__PURE__ */ Object.create(null);
  const brokenClipboardAPI = browser.ie && browser.ie_version < 15 || browser.ios && browser.webkit_version < 604;
  function capturePaste(view) {
    let parent = view.dom.parentNode;
    if (!parent)
      return;
    let target = parent.appendChild(document.createElement("textarea"));
    target.style.cssText = "position: fixed; left: -10000px; top: 10px";
    target.focus();
    setTimeout(() => {
      view.focus();
      target.remove();
      doPaste(view, target.value);
    }, 50);
  }
  function doPaste(view, input) {
    let { state } = view, changes, i2 = 1, text = state.toText(input);
    let byLine = text.lines == state.selection.ranges.length;
    let linewise = lastLinewiseCopy != null && state.selection.ranges.every((r) => r.empty) && lastLinewiseCopy == text.toString();
    if (linewise) {
      let lastLine = -1;
      changes = state.changeByRange((range) => {
        let line = state.doc.lineAt(range.from);
        if (line.from == lastLine)
          return { range };
        lastLine = line.from;
        let insert2 = state.toText((byLine ? text.line(i2++).text : input) + state.lineBreak);
        return {
          changes: { from: line.from, insert: insert2 },
          range: EditorSelection.cursor(range.from + insert2.length)
        };
      });
    } else if (byLine) {
      changes = state.changeByRange((range) => {
        let line = text.line(i2++);
        return {
          changes: { from: range.from, to: range.to, insert: line.text },
          range: EditorSelection.cursor(range.from + line.length)
        };
      });
    } else {
      changes = state.replaceSelection(text);
    }
    view.dispatch(changes, {
      userEvent: "input.paste",
      scrollIntoView: true
    });
  }
  observers.scroll = (view) => {
    view.inputState.lastScrollTop = view.scrollDOM.scrollTop;
    view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;
  };
  handlers.keydown = (view, event) => {
    view.inputState.setSelectionOrigin("select");
    if (event.keyCode == 27)
      view.inputState.lastEscPress = Date.now();
    return false;
  };
  observers.touchstart = (view, e) => {
    view.inputState.lastTouchTime = Date.now();
    view.inputState.setSelectionOrigin("select.pointer");
  };
  observers.touchmove = (view) => {
    view.inputState.setSelectionOrigin("select.pointer");
  };
  handlers.mousedown = (view, event) => {
    view.observer.flush();
    if (view.inputState.lastTouchTime > Date.now() - 2e3)
      return false;
    let style = null;
    for (let makeStyle of view.state.facet(mouseSelectionStyle)) {
      style = makeStyle(view, event);
      if (style)
        break;
    }
    if (!style && event.button == 0)
      style = basicMouseSelection(view, event);
    if (style) {
      let mustFocus = !view.hasFocus;
      view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));
      if (mustFocus)
        view.observer.ignore(() => focusPreventScroll(view.contentDOM));
      let mouseSel = view.inputState.mouseSelection;
      if (mouseSel) {
        mouseSel.start(event);
        return mouseSel.dragging === false;
      }
    }
    return false;
  };
  function rangeForClick(view, pos, bias, type) {
    if (type == 1) {
      return EditorSelection.cursor(pos, bias);
    } else if (type == 2) {
      return groupAt(view.state, pos, bias);
    } else {
      let visual = LineView.find(view.docView, pos), line = view.state.doc.lineAt(visual ? visual.posAtEnd : pos);
      let from = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to;
      if (to < view.state.doc.length && to == line.to)
        to++;
      return EditorSelection.range(from, to);
    }
  }
  let insideY = (y, rect) => y >= rect.top && y <= rect.bottom;
  let inside = (x, y, rect) => insideY(y, rect) && x >= rect.left && x <= rect.right;
  function findPositionSide(view, pos, x, y) {
    let line = LineView.find(view.docView, pos);
    if (!line)
      return 1;
    let off2 = pos - line.posAtStart;
    if (off2 == 0)
      return 1;
    if (off2 == line.length)
      return -1;
    let before = line.coordsAt(off2, -1);
    if (before && inside(x, y, before))
      return -1;
    let after = line.coordsAt(off2, 1);
    if (after && inside(x, y, after))
      return 1;
    return before && insideY(y, before) ? -1 : 1;
  }
  function queryPos(view, event) {
    let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
    return { pos, bias: findPositionSide(view, pos, event.clientX, event.clientY) };
  }
  const BadMouseDetail = browser.ie && browser.ie_version <= 11;
  let lastMouseDown = null, lastMouseDownCount = 0, lastMouseDownTime = 0;
  function getClickType(event) {
    if (!BadMouseDetail)
      return event.detail;
    let last = lastMouseDown, lastTime = lastMouseDownTime;
    lastMouseDown = event;
    lastMouseDownTime = Date.now();
    return lastMouseDownCount = !last || lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 && Math.abs(last.clientY - event.clientY) < 2 ? (lastMouseDownCount + 1) % 3 : 1;
  }
  function basicMouseSelection(view, event) {
    let start = queryPos(view, event), type = getClickType(event);
    let startSel = view.state.selection;
    return {
      update(update) {
        if (update.docChanged) {
          start.pos = update.changes.mapPos(start.pos);
          startSel = startSel.map(update.changes);
        }
      },
      get(event2, extend2, multiple) {
        let cur2 = queryPos(view, event2), removed;
        let range = rangeForClick(view, cur2.pos, cur2.bias, type);
        if (start.pos != cur2.pos && !extend2) {
          let startRange = rangeForClick(view, start.pos, start.bias, type);
          let from = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to);
          range = from < range.from ? EditorSelection.range(from, to) : EditorSelection.range(to, from);
        }
        if (extend2)
          return startSel.replaceRange(startSel.main.extend(range.from, range.to));
        else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur2.pos)))
          return removed;
        else if (multiple)
          return startSel.addRange(range);
        else
          return EditorSelection.create([range]);
      }
    };
  }
  function removeRangeAround(sel, pos) {
    for (let i2 = 0; i2 < sel.ranges.length; i2++) {
      let { from, to } = sel.ranges[i2];
      if (from <= pos && to >= pos)
        return EditorSelection.create(sel.ranges.slice(0, i2).concat(sel.ranges.slice(i2 + 1)), sel.mainIndex == i2 ? 0 : sel.mainIndex - (sel.mainIndex > i2 ? 1 : 0));
    }
    return null;
  }
  handlers.dragstart = (view, event) => {
    let { selection: { main: range } } = view.state;
    if (event.target.draggable) {
      let cView = view.docView.nearest(event.target);
      if (cView && cView.isWidget) {
        let from = cView.posAtStart, to = from + cView.length;
        if (from >= range.to || to <= range.from)
          range = EditorSelection.range(from, to);
      }
    }
    let { inputState } = view;
    if (inputState.mouseSelection)
      inputState.mouseSelection.dragging = true;
    inputState.draggedContent = range;
    if (event.dataTransfer) {
      event.dataTransfer.setData("Text", view.state.sliceDoc(range.from, range.to));
      event.dataTransfer.effectAllowed = "copyMove";
    }
    return false;
  };
  handlers.dragend = (view) => {
    view.inputState.draggedContent = null;
    return false;
  };
  function dropText(view, event, text, direct) {
    if (!text)
      return;
    let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
    let { draggedContent } = view.inputState;
    let del = direct && draggedContent && dragMovesSelection(view, event) ? { from: draggedContent.from, to: draggedContent.to } : null;
    let ins = { from: dropPos, insert: text };
    let changes = view.state.changes(del ? [del, ins] : ins);
    view.focus();
    view.dispatch({
      changes,
      selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) },
      userEvent: del ? "move.drop" : "input.drop"
    });
    view.inputState.draggedContent = null;
  }
  handlers.drop = (view, event) => {
    if (!event.dataTransfer)
      return false;
    if (view.state.readOnly)
      return true;
    let files = event.dataTransfer.files;
    if (files && files.length) {
      let text = Array(files.length), read = 0;
      let finishFile = () => {
        if (++read == files.length)
          dropText(view, event, text.filter((s) => s != null).join(view.state.lineBreak), false);
      };
      for (let i2 = 0; i2 < files.length; i2++) {
        let reader = new FileReader();
        reader.onerror = finishFile;
        reader.onload = () => {
          if (!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result))
            text[i2] = reader.result;
          finishFile();
        };
        reader.readAsText(files[i2]);
      }
      return true;
    } else {
      let text = event.dataTransfer.getData("Text");
      if (text) {
        dropText(view, event, text, true);
        return true;
      }
    }
    return false;
  };
  handlers.paste = (view, event) => {
    if (view.state.readOnly)
      return true;
    view.observer.flush();
    let data2 = brokenClipboardAPI ? null : event.clipboardData;
    if (data2) {
      doPaste(view, data2.getData("text/plain") || data2.getData("text/uri-text"));
      return true;
    } else {
      capturePaste(view);
      return false;
    }
  };
  function captureCopy(view, text) {
    let parent = view.dom.parentNode;
    if (!parent)
      return;
    let target = parent.appendChild(document.createElement("textarea"));
    target.style.cssText = "position: fixed; left: -10000px; top: 10px";
    target.value = text;
    target.focus();
    target.selectionEnd = text.length;
    target.selectionStart = 0;
    setTimeout(() => {
      target.remove();
      view.focus();
    }, 50);
  }
  function copiedRange(state) {
    let content2 = [], ranges = [], linewise = false;
    for (let range of state.selection.ranges)
      if (!range.empty) {
        content2.push(state.sliceDoc(range.from, range.to));
        ranges.push(range);
      }
    if (!content2.length) {
      let upto = -1;
      for (let { from } of state.selection.ranges) {
        let line = state.doc.lineAt(from);
        if (line.number > upto) {
          content2.push(line.text);
          ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) });
        }
        upto = line.number;
      }
      linewise = true;
    }
    return { text: content2.join(state.lineBreak), ranges, linewise };
  }
  let lastLinewiseCopy = null;
  handlers.copy = handlers.cut = (view, event) => {
    let { text, ranges, linewise } = copiedRange(view.state);
    if (!text && !linewise)
      return false;
    lastLinewiseCopy = linewise ? text : null;
    if (event.type == "cut" && !view.state.readOnly)
      view.dispatch({
        changes: ranges,
        scrollIntoView: true,
        userEvent: "delete.cut"
      });
    let data2 = brokenClipboardAPI ? null : event.clipboardData;
    if (data2) {
      data2.clearData();
      data2.setData("text/plain", text);
      return true;
    } else {
      captureCopy(view, text);
      return false;
    }
  };
  const isFocusChange = /* @__PURE__ */ Annotation.define();
  function focusChangeTransaction(state, focus) {
    let effects = [];
    for (let getEffect of state.facet(focusChangeEffect)) {
      let effect = getEffect(state, focus);
      if (effect)
        effects.push(effect);
    }
    return effects ? state.update({ effects, annotations: isFocusChange.of(true) }) : null;
  }
  function updateForFocusChange(view) {
    setTimeout(() => {
      let focus = view.hasFocus;
      if (focus != view.inputState.notifiedFocused) {
        let tr = focusChangeTransaction(view.state, focus);
        if (tr)
          view.dispatch(tr);
        else
          view.update([]);
      }
    }, 10);
  }
  observers.focus = (view) => {
    view.inputState.lastFocusTime = Date.now();
    if (!view.scrollDOM.scrollTop && (view.inputState.lastScrollTop || view.inputState.lastScrollLeft)) {
      view.scrollDOM.scrollTop = view.inputState.lastScrollTop;
      view.scrollDOM.scrollLeft = view.inputState.lastScrollLeft;
    }
    updateForFocusChange(view);
  };
  observers.blur = (view) => {
    view.observer.clearSelectionRange();
    updateForFocusChange(view);
  };
  observers.compositionstart = observers.compositionupdate = (view) => {
    if (view.inputState.compositionFirstChange == null)
      view.inputState.compositionFirstChange = true;
    if (view.inputState.composing < 0) {
      view.inputState.composing = 0;
    }
  };
  observers.compositionend = (view) => {
    view.inputState.composing = -1;
    view.inputState.compositionEndedAt = Date.now();
    view.inputState.compositionPendingKey = true;
    view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;
    view.inputState.compositionFirstChange = null;
    if (browser.chrome && browser.android) {
      view.observer.flushSoon();
    } else if (view.inputState.compositionPendingChange) {
      Promise.resolve().then(() => view.observer.flush());
    } else {
      setTimeout(() => {
        if (view.inputState.composing < 0 && view.docView.hasComposition)
          view.update([]);
      }, 50);
    }
  };
  observers.contextmenu = (view) => {
    view.inputState.lastContextMenu = Date.now();
  };
  handlers.beforeinput = (view, event) => {
    var _a2;
    let pending;
    if (browser.chrome && browser.android && (pending = PendingKeys.find((key) => key.inputType == event.inputType))) {
      view.observer.delayAndroidKey(pending.key, pending.keyCode);
      if (pending.key == "Backspace" || pending.key == "Delete") {
        let startViewHeight = ((_a2 = window.visualViewport) === null || _a2 === void 0 ? void 0 : _a2.height) || 0;
        setTimeout(() => {
          var _a3;
          if ((((_a3 = window.visualViewport) === null || _a3 === void 0 ? void 0 : _a3.height) || 0) > startViewHeight + 10 && view.hasFocus) {
            view.contentDOM.blur();
            view.focus();
          }
        }, 100);
      }
    }
    return false;
  };
  const appliedFirefoxHack = /* @__PURE__ */ new Set();
  function firefoxCopyCutHack(doc2) {
    if (!appliedFirefoxHack.has(doc2)) {
      appliedFirefoxHack.add(doc2);
      doc2.addEventListener("copy", () => {
      });
      doc2.addEventListener("cut", () => {
      });
    }
  }
  const wrappingWhiteSpace = ["pre-wrap", "normal", "pre-line", "break-spaces"];
  class HeightOracle {
    constructor(lineWrapping) {
      this.lineWrapping = lineWrapping;
      this.doc = Text$1.empty;
      this.heightSamples = {};
      this.lineHeight = 14;
      this.charWidth = 7;
      this.textHeight = 14;
      this.lineLength = 30;
      this.heightChanged = false;
    }
    heightForGap(from, to) {
      let lines = this.doc.lineAt(to).number - this.doc.lineAt(from).number + 1;
      if (this.lineWrapping)
        lines += Math.max(0, Math.ceil((to - from - lines * this.lineLength * 0.5) / this.lineLength));
      return this.lineHeight * lines;
    }
    heightForLine(length) {
      if (!this.lineWrapping)
        return this.lineHeight;
      let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5)));
      return lines * this.lineHeight;
    }
    setDoc(doc2) {
      this.doc = doc2;
      return this;
    }
    mustRefreshForWrapping(whiteSpace) {
      return wrappingWhiteSpace.indexOf(whiteSpace) > -1 != this.lineWrapping;
    }
    mustRefreshForHeights(lineHeights) {
      let newHeight = false;
      for (let i2 = 0; i2 < lineHeights.length; i2++) {
        let h = lineHeights[i2];
        if (h < 0) {
          i2++;
        } else if (!this.heightSamples[Math.floor(h * 10)]) {
          newHeight = true;
          this.heightSamples[Math.floor(h * 10)] = true;
        }
      }
      return newHeight;
    }
    refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {
      let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;
      let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;
      this.lineWrapping = lineWrapping;
      this.lineHeight = lineHeight;
      this.charWidth = charWidth;
      this.textHeight = textHeight;
      this.lineLength = lineLength;
      if (changed) {
        this.heightSamples = {};
        for (let i2 = 0; i2 < knownHeights.length; i2++) {
          let h = knownHeights[i2];
          if (h < 0)
            i2++;
          else
            this.heightSamples[Math.floor(h * 10)] = true;
        }
      }
      return changed;
    }
  }
  class MeasuredHeights {
    constructor(from, heights) {
      this.from = from;
      this.heights = heights;
      this.index = 0;
    }
    get more() {
      return this.index < this.heights.length;
    }
  }
  class BlockInfo {
    constructor(from, length, top2, height, _content) {
      this.from = from;
      this.length = length;
      this.top = top2;
      this.height = height;
      this._content = _content;
    }
    get type() {
      return typeof this._content == "number" ? BlockType.Text : Array.isArray(this._content) ? this._content : this._content.type;
    }
    get to() {
      return this.from + this.length;
    }
    get bottom() {
      return this.top + this.height;
    }
    get widget() {
      return this._content instanceof PointDecoration ? this._content.widget : null;
    }
    get widgetLineBreaks() {
      return typeof this._content == "number" ? this._content : 0;
    }
    join(other) {
      let content2 = (Array.isArray(this._content) ? this._content : [this]).concat(Array.isArray(other._content) ? other._content : [other]);
      return new BlockInfo(this.from, this.length + other.length, this.top, this.height + other.height, content2);
    }
  }
  var QueryType$1 = /* @__PURE__ */ function(QueryType2) {
    QueryType2[QueryType2["ByPos"] = 0] = "ByPos";
    QueryType2[QueryType2["ByHeight"] = 1] = "ByHeight";
    QueryType2[QueryType2["ByPosNoHeight"] = 2] = "ByPosNoHeight";
    return QueryType2;
  }(QueryType$1 || (QueryType$1 = {}));
  const Epsilon = 1e-3;
  class HeightMap {
    constructor(length, height, flags = 2) {
      this.length = length;
      this.height = height;
      this.flags = flags;
    }
    get outdated() {
      return (this.flags & 2) > 0;
    }
    set outdated(value2) {
      this.flags = (value2 ? 2 : 0) | this.flags & ~2;
    }
    setHeight(oracle, height) {
      if (this.height != height) {
        if (Math.abs(this.height - height) > Epsilon)
          oracle.heightChanged = true;
        this.height = height;
      }
    }
    replace(_from, _to, nodes) {
      return HeightMap.of(nodes);
    }
    decomposeLeft(_to, result) {
      result.push(this);
    }
    decomposeRight(_from, result) {
      result.push(this);
    }
    applyChanges(decorations2, oldDoc, oracle, changes) {
      let me = this, doc2 = oracle.doc;
      for (let i2 = changes.length - 1; i2 >= 0; i2--) {
        let { fromA, toA, fromB, toB } = changes[i2];
        let start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);
        let end = start.to >= toA ? start : me.lineAt(toA, QueryType$1.ByPosNoHeight, oracle, 0, 0);
        toB += end.to - toA;
        toA = end.to;
        while (i2 > 0 && start.from <= changes[i2 - 1].toA) {
          fromA = changes[i2 - 1].fromA;
          fromB = changes[i2 - 1].fromB;
          i2--;
          if (fromA < start.from)
            start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle, 0, 0);
        }
        fromB += start.from - fromA;
        fromA = start.from;
        let nodes = NodeBuilder.build(oracle.setDoc(doc2), decorations2, fromB, toB);
        me = me.replace(fromA, toA, nodes);
      }
      return me.updateHeight(oracle, 0);
    }
    static empty() {
      return new HeightMapText(0, 0);
    }
    static of(nodes) {
      if (nodes.length == 1)
        return nodes[0];
      let i2 = 0, j = nodes.length, before = 0, after = 0;
      for (; ; ) {
        if (i2 == j) {
          if (before > after * 2) {
            let split = nodes[i2 - 1];
            if (split.break)
              nodes.splice(--i2, 1, split.left, null, split.right);
            else
              nodes.splice(--i2, 1, split.left, split.right);
            j += 1 + split.break;
            before -= split.size;
          } else if (after > before * 2) {
            let split = nodes[j];
            if (split.break)
              nodes.splice(j, 1, split.left, null, split.right);
            else
              nodes.splice(j, 1, split.left, split.right);
            j += 2 + split.break;
            after -= split.size;
          } else {
            break;
          }
        } else if (before < after) {
          let next = nodes[i2++];
          if (next)
            before += next.size;
        } else {
          let next = nodes[--j];
          if (next)
            after += next.size;
        }
      }
      let brk = 0;
      if (nodes[i2 - 1] == null) {
        brk = 1;
        i2--;
      } else if (nodes[i2] == null) {
        brk = 1;
        j++;
      }
      return new HeightMapBranch(HeightMap.of(nodes.slice(0, i2)), brk, HeightMap.of(nodes.slice(j)));
    }
  }
  HeightMap.prototype.size = 1;
  class HeightMapBlock extends HeightMap {
    constructor(length, height, deco) {
      super(length, height);
      this.deco = deco;
    }
    blockAt(_height, _oracle, top2, offset) {
      return new BlockInfo(offset, this.length, top2, this.height, this.deco || 0);
    }
    lineAt(_value, _type, oracle, top2, offset) {
      return this.blockAt(0, oracle, top2, offset);
    }
    forEachLine(from, to, oracle, top2, offset, f) {
      if (from <= offset + this.length && to >= offset)
        f(this.blockAt(0, oracle, top2, offset));
    }
    updateHeight(oracle, offset = 0, _force = false, measured) {
      if (measured && measured.from <= offset && measured.more)
        this.setHeight(oracle, measured.heights[measured.index++]);
      this.outdated = false;
      return this;
    }
    toString() {
      return `block(${this.length})`;
    }
  }
  class HeightMapText extends HeightMapBlock {
    constructor(length, height) {
      super(length, height, null);
      this.collapsed = 0;
      this.widgetHeight = 0;
      this.breaks = 0;
    }
    blockAt(_height, _oracle, top2, offset) {
      return new BlockInfo(offset, this.length, top2, this.height, this.breaks);
    }
    replace(_from, _to, nodes) {
      let node = nodes[0];
      if (nodes.length == 1 && (node instanceof HeightMapText || node instanceof HeightMapGap && node.flags & 4) && Math.abs(this.length - node.length) < 10) {
        if (node instanceof HeightMapGap)
          node = new HeightMapText(node.length, this.height);
        else
          node.height = this.height;
        if (!this.outdated)
          node.outdated = false;
        return node;
      } else {
        return HeightMap.of(nodes);
      }
    }
    updateHeight(oracle, offset = 0, force = false, measured) {
      if (measured && measured.from <= offset && measured.more)
        this.setHeight(oracle, measured.heights[measured.index++]);
      else if (force || this.outdated)
        this.setHeight(oracle, Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)) + this.breaks * oracle.lineHeight);
      this.outdated = false;
      return this;
    }
    toString() {
      return `line(${this.length}${this.collapsed ? -this.collapsed : ""}${this.widgetHeight ? ":" + this.widgetHeight : ""})`;
    }
  }
  class HeightMapGap extends HeightMap {
    constructor(length) {
      super(length, 0);
    }
    heightMetrics(oracle, offset) {
      let firstLine = oracle.doc.lineAt(offset).number, lastLine = oracle.doc.lineAt(offset + this.length).number;
      let lines = lastLine - firstLine + 1;
      let perLine, perChar = 0;
      if (oracle.lineWrapping) {
        let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);
        perLine = totalPerLine / lines;
        if (this.length > lines + 1)
          perChar = (this.height - totalPerLine) / (this.length - lines - 1);
      } else {
        perLine = this.height / lines;
      }
      return { firstLine, lastLine, perLine, perChar };
    }
    blockAt(height, oracle, top2, offset) {
      let { firstLine, lastLine, perLine, perChar } = this.heightMetrics(oracle, offset);
      if (oracle.lineWrapping) {
        let guess = offset + Math.round(Math.max(0, Math.min(1, (height - top2) / this.height)) * this.length);
        let line = oracle.doc.lineAt(guess), lineHeight = perLine + line.length * perChar;
        let lineTop = Math.max(top2, height - lineHeight / 2);
        return new BlockInfo(line.from, line.length, lineTop, lineHeight, 0);
      } else {
        let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top2) / perLine)));
        let { from, length } = oracle.doc.line(firstLine + line);
        return new BlockInfo(from, length, top2 + perLine * line, perLine, 0);
      }
    }
    lineAt(value2, type, oracle, top2, offset) {
      if (type == QueryType$1.ByHeight)
        return this.blockAt(value2, oracle, top2, offset);
      if (type == QueryType$1.ByPosNoHeight) {
        let { from, to } = oracle.doc.lineAt(value2);
        return new BlockInfo(from, to - from, 0, 0, 0);
      }
      let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);
      let line = oracle.doc.lineAt(value2), lineHeight = perLine + line.length * perChar;
      let linesAbove = line.number - firstLine;
      let lineTop = top2 + perLine * linesAbove + perChar * (line.from - offset - linesAbove);
      return new BlockInfo(line.from, line.length, Math.max(top2, Math.min(lineTop, top2 + this.height - lineHeight)), lineHeight, 0);
    }
    forEachLine(from, to, oracle, top2, offset, f) {
      from = Math.max(from, offset);
      to = Math.min(to, offset + this.length);
      let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);
      for (let pos = from, lineTop = top2; pos <= to; ) {
        let line = oracle.doc.lineAt(pos);
        if (pos == from) {
          let linesAbove = line.number - firstLine;
          lineTop += perLine * linesAbove + perChar * (from - offset - linesAbove);
        }
        let lineHeight = perLine + perChar * line.length;
        f(new BlockInfo(line.from, line.length, lineTop, lineHeight, 0));
        lineTop += lineHeight;
        pos = line.to + 1;
      }
    }
    replace(from, to, nodes) {
      let after = this.length - to;
      if (after > 0) {
        let last = nodes[nodes.length - 1];
        if (last instanceof HeightMapGap)
          nodes[nodes.length - 1] = new HeightMapGap(last.length + after);
        else
          nodes.push(null, new HeightMapGap(after - 1));
      }
      if (from > 0) {
        let first = nodes[0];
        if (first instanceof HeightMapGap)
          nodes[0] = new HeightMapGap(from + first.length);
        else
          nodes.unshift(new HeightMapGap(from - 1), null);
      }
      return HeightMap.of(nodes);
    }
    decomposeLeft(to, result) {
      result.push(new HeightMapGap(to - 1), null);
    }
    decomposeRight(from, result) {
      result.push(null, new HeightMapGap(this.length - from - 1));
    }
    updateHeight(oracle, offset = 0, force = false, measured) {
      let end = offset + this.length;
      if (measured && measured.from <= offset + this.length && measured.more) {
        let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1;
        if (measured.from > offset)
          nodes.push(new HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));
        while (pos <= end && measured.more) {
          let len = oracle.doc.lineAt(pos).length;
          if (nodes.length)
            nodes.push(null);
          let height = measured.heights[measured.index++];
          if (singleHeight == -1)
            singleHeight = height;
          else if (Math.abs(height - singleHeight) >= Epsilon)
            singleHeight = -2;
          let line = new HeightMapText(len, height);
          line.outdated = false;
          nodes.push(line);
          pos += len + 1;
        }
        if (pos <= end)
          nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));
        let result = HeightMap.of(nodes);
        if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon || Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)
          oracle.heightChanged = true;
        return result;
      } else if (force || this.outdated) {
        this.setHeight(oracle, oracle.heightForGap(offset, offset + this.length));
        this.outdated = false;
      }
      return this;
    }
    toString() {
      return `gap(${this.length})`;
    }
  }
  class HeightMapBranch extends HeightMap {
    constructor(left, brk, right) {
      super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 : 0));
      this.left = left;
      this.right = right;
      this.size = left.size + right.size;
    }
    get break() {
      return this.flags & 1;
    }
    blockAt(height, oracle, top2, offset) {
      let mid = top2 + this.left.height;
      return height < mid ? this.left.blockAt(height, oracle, top2, offset) : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);
    }
    lineAt(value2, type, oracle, top2, offset) {
      let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break;
      let left = type == QueryType$1.ByHeight ? value2 < rightTop : value2 < rightOffset;
      let base2 = left ? this.left.lineAt(value2, type, oracle, top2, offset) : this.right.lineAt(value2, type, oracle, rightTop, rightOffset);
      if (this.break || (left ? base2.to < rightOffset : base2.from > rightOffset))
        return base2;
      let subQuery = type == QueryType$1.ByPosNoHeight ? QueryType$1.ByPosNoHeight : QueryType$1.ByPos;
      if (left)
        return base2.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));
      else
        return this.left.lineAt(rightOffset, subQuery, oracle, top2, offset).join(base2);
    }
    forEachLine(from, to, oracle, top2, offset, f) {
      let rightTop = top2 + this.left.height, rightOffset = offset + this.left.length + this.break;
      if (this.break) {
        if (from < rightOffset)
          this.left.forEachLine(from, to, oracle, top2, offset, f);
        if (to >= rightOffset)
          this.right.forEachLine(from, to, oracle, rightTop, rightOffset, f);
      } else {
        let mid = this.lineAt(rightOffset, QueryType$1.ByPos, oracle, top2, offset);
        if (from < mid.from)
          this.left.forEachLine(from, mid.from - 1, oracle, top2, offset, f);
        if (mid.to >= from && mid.from <= to)
          f(mid);
        if (to > mid.to)
          this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);
      }
    }
    replace(from, to, nodes) {
      let rightStart = this.left.length + this.break;
      if (to < rightStart)
        return this.balanced(this.left.replace(from, to, nodes), this.right);
      if (from > this.left.length)
        return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));
      let result = [];
      if (from > 0)
        this.decomposeLeft(from, result);
      let left = result.length;
      for (let node of nodes)
        result.push(node);
      if (from > 0)
        mergeGaps(result, left - 1);
      if (to < this.length) {
        let right = result.length;
        this.decomposeRight(to, result);
        mergeGaps(result, right);
      }
      return HeightMap.of(result);
    }
    decomposeLeft(to, result) {
      let left = this.left.length;
      if (to <= left)
        return this.left.decomposeLeft(to, result);
      result.push(this.left);
      if (this.break) {
        left++;
        if (to >= left)
          result.push(null);
      }
      if (to > left)
        this.right.decomposeLeft(to - left, result);
    }
    decomposeRight(from, result) {
      let left = this.left.length, right = left + this.break;
      if (from >= right)
        return this.right.decomposeRight(from - right, result);
      if (from < left)
        this.left.decomposeRight(from, result);
      if (this.break && from < right)
        result.push(null);
      result.push(this.right);
    }
    balanced(left, right) {
      if (left.size > 2 * right.size || right.size > 2 * left.size)
        return HeightMap.of(this.break ? [left, null, right] : [left, right]);
      this.left = left;
      this.right = right;
      this.height = left.height + right.height;
      this.outdated = left.outdated || right.outdated;
      this.size = left.size + right.size;
      this.length = left.length + this.break + right.length;
      return this;
    }
    updateHeight(oracle, offset = 0, force = false, measured) {
      let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null;
      if (measured && measured.from <= offset + left.length && measured.more)
        rebalance = left = left.updateHeight(oracle, offset, force, measured);
      else
        left.updateHeight(oracle, offset, force);
      if (measured && measured.from <= rightStart + right.length && measured.more)
        rebalance = right = right.updateHeight(oracle, rightStart, force, measured);
      else
        right.updateHeight(oracle, rightStart, force);
      if (rebalance)
        return this.balanced(left, right);
      this.height = this.left.height + this.right.height;
      this.outdated = false;
      return this;
    }
    toString() {
      return this.left + (this.break ? " " : "-") + this.right;
    }
  }
  function mergeGaps(nodes, around) {
    let before, after;
    if (nodes[around] == null && (before = nodes[around - 1]) instanceof HeightMapGap && (after = nodes[around + 1]) instanceof HeightMapGap)
      nodes.splice(around - 1, 3, new HeightMapGap(before.length + 1 + after.length));
  }
  const relevantWidgetHeight = 5;
  class NodeBuilder {
    constructor(pos, oracle) {
      this.pos = pos;
      this.oracle = oracle;
      this.nodes = [];
      this.lineStart = -1;
      this.lineEnd = -1;
      this.covering = null;
      this.writtenTo = pos;
    }
    get isCovered() {
      return this.covering && this.nodes[this.nodes.length - 1] == this.covering;
    }
    span(_from, to) {
      if (this.lineStart > -1) {
        let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1];
        if (last instanceof HeightMapText)
          last.length += end - this.pos;
        else if (end > this.pos || !this.isCovered)
          this.nodes.push(new HeightMapText(end - this.pos, -1));
        this.writtenTo = end;
        if (to > end) {
          this.nodes.push(null);
          this.writtenTo++;
          this.lineStart = -1;
        }
      }
      this.pos = to;
    }
    point(from, to, deco) {
      if (from < to || deco.heightRelevant) {
        let height = deco.widget ? deco.widget.estimatedHeight : 0;
        let breaks = deco.widget ? deco.widget.lineBreaks : 0;
        if (height < 0)
          height = this.oracle.lineHeight;
        let len = to - from;
        if (deco.block) {
          this.addBlock(new HeightMapBlock(len, height, deco));
        } else if (len || breaks || height >= relevantWidgetHeight) {
          this.addLineDeco(height, breaks, len);
        }
      } else if (to > from) {
        this.span(from, to);
      }
      if (this.lineEnd > -1 && this.lineEnd < this.pos)
        this.lineEnd = this.oracle.doc.lineAt(this.pos).to;
    }
    enterLine() {
      if (this.lineStart > -1)
        return;
      let { from, to } = this.oracle.doc.lineAt(this.pos);
      this.lineStart = from;
      this.lineEnd = to;
      if (this.writtenTo < from) {
        if (this.writtenTo < from - 1 || this.nodes[this.nodes.length - 1] == null)
          this.nodes.push(this.blankContent(this.writtenTo, from - 1));
        this.nodes.push(null);
      }
      if (this.pos > from)
        this.nodes.push(new HeightMapText(this.pos - from, -1));
      this.writtenTo = this.pos;
    }
    blankContent(from, to) {
      let gap = new HeightMapGap(to - from);
      if (this.oracle.doc.lineAt(from).to == to)
        gap.flags |= 4;
      return gap;
    }
    ensureLine() {
      this.enterLine();
      let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;
      if (last instanceof HeightMapText)
        return last;
      let line = new HeightMapText(0, -1);
      this.nodes.push(line);
      return line;
    }
    addBlock(block) {
      this.enterLine();
      let deco = block.deco;
      if (deco && deco.startSide > 0 && !this.isCovered)
        this.ensureLine();
      this.nodes.push(block);
      this.writtenTo = this.pos = this.pos + block.length;
      if (deco && deco.endSide > 0)
        this.covering = block;
    }
    addLineDeco(height, breaks, length) {
      let line = this.ensureLine();
      line.length += length;
      line.collapsed += length;
      line.widgetHeight = Math.max(line.widgetHeight, height);
      line.breaks += breaks;
      this.writtenTo = this.pos = this.pos + length;
    }
    finish(from) {
      let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];
      if (this.lineStart > -1 && !(last instanceof HeightMapText) && !this.isCovered)
        this.nodes.push(new HeightMapText(0, -1));
      else if (this.writtenTo < this.pos || last == null)
        this.nodes.push(this.blankContent(this.writtenTo, this.pos));
      let pos = from;
      for (let node of this.nodes) {
        if (node instanceof HeightMapText)
          node.updateHeight(this.oracle, pos);
        pos += node ? node.length : 1;
      }
      return this.nodes;
    }
    static build(oracle, decorations2, from, to) {
      let builder = new NodeBuilder(from, oracle);
      RangeSet.spans(decorations2, from, to, builder, 0);
      return builder.finish(from);
    }
  }
  function heightRelevantDecoChanges(a, b, diff) {
    let comp = new DecorationComparator();
    RangeSet.compare(a, b, diff, comp, 0);
    return comp.changes;
  }
  class DecorationComparator {
    constructor() {
      this.changes = [];
    }
    compareRange() {
    }
    comparePoint(from, to, a, b) {
      if (from < to || a && a.heightRelevant || b && b.heightRelevant)
        addRange(from, to, this.changes, 5);
    }
  }
  function visiblePixelRange(dom, paddingTop) {
    let rect = dom.getBoundingClientRect();
    let doc2 = dom.ownerDocument, win = doc2.defaultView || window;
    let left = Math.max(0, rect.left), right = Math.min(win.innerWidth, rect.right);
    let top2 = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);
    for (let parent = dom.parentNode; parent && parent != doc2.body; ) {
      if (parent.nodeType == 1) {
        let elt = parent;
        let style = window.getComputedStyle(elt);
        if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) && style.overflow != "visible") {
          let parentRect = elt.getBoundingClientRect();
          left = Math.max(left, parentRect.left);
          right = Math.min(right, parentRect.right);
          top2 = Math.max(top2, parentRect.top);
          bottom = parent == dom.parentNode ? parentRect.bottom : Math.min(bottom, parentRect.bottom);
        }
        parent = style.position == "absolute" || style.position == "fixed" ? elt.offsetParent : elt.parentNode;
      } else if (parent.nodeType == 11) {
        parent = parent.host;
      } else {
        break;
      }
    }
    return {
      left: left - rect.left,
      right: Math.max(left, right) - rect.left,
      top: top2 - (rect.top + paddingTop),
      bottom: Math.max(top2, bottom) - (rect.top + paddingTop)
    };
  }
  function fullPixelRange(dom, paddingTop) {
    let rect = dom.getBoundingClientRect();
    return {
      left: 0,
      right: rect.right - rect.left,
      top: paddingTop,
      bottom: rect.bottom - (rect.top + paddingTop)
    };
  }
  class LineGap {
    constructor(from, to, size) {
      this.from = from;
      this.to = to;
      this.size = size;
    }
    static same(a, b) {
      if (a.length != b.length)
        return false;
      for (let i2 = 0; i2 < a.length; i2++) {
        let gA = a[i2], gB = b[i2];
        if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size)
          return false;
      }
      return true;
    }
    draw(viewState, wrapping) {
      return Decoration.replace({
        widget: new LineGapWidget(this.size * (wrapping ? viewState.scaleY : viewState.scaleX), wrapping)
      }).range(this.from, this.to);
    }
  }
  class LineGapWidget extends WidgetType {
    constructor(size, vertical) {
      super();
      this.size = size;
      this.vertical = vertical;
    }
    eq(other) {
      return other.size == this.size && other.vertical == this.vertical;
    }
    toDOM() {
      let elt = document.createElement("div");
      if (this.vertical) {
        elt.style.height = this.size + "px";
      } else {
        elt.style.width = this.size + "px";
        elt.style.height = "2px";
        elt.style.display = "inline-block";
      }
      return elt;
    }
    get estimatedHeight() {
      return this.vertical ? this.size : -1;
    }
  }
  class ViewState {
    constructor(state) {
      this.state = state;
      this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 };
      this.inView = true;
      this.paddingTop = 0;
      this.paddingBottom = 0;
      this.contentDOMWidth = 0;
      this.contentDOMHeight = 0;
      this.editorHeight = 0;
      this.editorWidth = 0;
      this.scrollTop = 0;
      this.scrolledToBottom = true;
      this.scaleX = 1;
      this.scaleY = 1;
      this.scrollAnchorPos = 0;
      this.scrollAnchorHeight = -1;
      this.scaler = IdScaler;
      this.scrollTarget = null;
      this.printing = false;
      this.mustMeasureContent = true;
      this.defaultTextDirection = Direction.LTR;
      this.visibleRanges = [];
      this.mustEnforceCursorAssoc = false;
      let guessWrapping = state.facet(contentAttributes).some((v) => typeof v != "function" && v.class == "cm-lineWrapping");
      this.heightOracle = new HeightOracle(guessWrapping);
      this.stateDeco = state.facet(decorations).filter((d) => typeof d != "function");
      this.heightMap = HeightMap.empty().applyChanges(this.stateDeco, Text$1.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange(0, 0, 0, state.doc.length)]);
      this.viewport = this.getViewport(0, null);
      this.updateViewportLines();
      this.updateForViewport();
      this.lineGaps = this.ensureLineGaps([]);
      this.lineGapDeco = Decoration.set(this.lineGaps.map((gap) => gap.draw(this, false)));
      this.computeVisibleRanges();
    }
    updateForViewport() {
      let viewports = [this.viewport], { main } = this.state.selection;
      for (let i2 = 0; i2 <= 1; i2++) {
        let pos = i2 ? main.head : main.anchor;
        if (!viewports.some(({ from, to }) => pos >= from && pos <= to)) {
          let { from, to } = this.lineBlockAt(pos);
          viewports.push(new Viewport(from, to));
        }
      }
      this.viewports = viewports.sort((a, b) => a.from - b.from);
      this.scaler = this.heightMap.height <= 7e6 ? IdScaler : new BigScaler(this.heightOracle, this.heightMap, this.viewports);
    }
    updateViewportLines() {
      this.viewportLines = [];
      this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, (block) => {
        this.viewportLines.push(this.scaler.scale == 1 ? block : scaleBlock(block, this.scaler));
      });
    }
    update(update, scrollTarget = null) {
      this.state = update.state;
      let prevDeco = this.stateDeco;
      this.stateDeco = this.state.facet(decorations).filter((d) => typeof d != "function");
      let contentChanges = update.changedRanges;
      let heightChanges = ChangedRange.extendWithRanges(contentChanges, heightRelevantDecoChanges(prevDeco, this.stateDeco, update ? update.changes : ChangeSet.empty(this.state.doc.length)));
      let prevHeight = this.heightMap.height;
      let scrollAnchor = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop);
      this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges);
      if (this.heightMap.height != prevHeight)
        update.flags |= 2;
      if (scrollAnchor) {
        this.scrollAnchorPos = update.changes.mapPos(scrollAnchor.from, -1);
        this.scrollAnchorHeight = scrollAnchor.top;
      } else {
        this.scrollAnchorPos = -1;
        this.scrollAnchorHeight = this.heightMap.height;
      }
      let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport;
      if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) || !this.viewportIsAppropriate(viewport))
        viewport = this.getViewport(0, scrollTarget);
      let updateLines = !update.changes.empty || update.flags & 2 || viewport.from != this.viewport.from || viewport.to != this.viewport.to;
      this.viewport = viewport;
      this.updateForViewport();
      if (updateLines)
        this.updateViewportLines();
      if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
        this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));
      update.flags |= this.computeVisibleRanges();
      if (scrollTarget)
        this.scrollTarget = scrollTarget;
      if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc && !update.state.facet(nativeSelectionHidden))
        this.mustEnforceCursorAssoc = true;
    }
    measure(view) {
      let dom = view.contentDOM, style = window.getComputedStyle(dom);
      let oracle = this.heightOracle;
      let whiteSpace = style.whiteSpace;
      this.defaultTextDirection = style.direction == "rtl" ? Direction.RTL : Direction.LTR;
      let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);
      let domRect = dom.getBoundingClientRect();
      let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;
      this.contentDOMHeight = domRect.height;
      this.mustMeasureContent = false;
      let result = 0, bias = 0;
      if (domRect.width && domRect.height) {
        let scaleX = domRect.width / dom.offsetWidth;
        let scaleY = domRect.height / dom.offsetHeight;
        if (scaleX > 0.995 && scaleX < 1.005 || !isFinite(scaleX) || Math.abs(domRect.width - dom.offsetWidth) < 1)
          scaleX = 1;
        if (scaleY > 0.995 && scaleY < 1.005 || !isFinite(scaleY) || Math.abs(domRect.height - dom.offsetHeight) < 1)
          scaleY = 1;
        if (this.scaleX != scaleX || this.scaleY != scaleY) {
          this.scaleX = scaleX;
          this.scaleY = scaleY;
          result |= 8;
          refresh = measureContent = true;
        }
      }
      let paddingTop = (parseInt(style.paddingTop) || 0) * this.scaleY;
      let paddingBottom = (parseInt(style.paddingBottom) || 0) * this.scaleY;
      if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
        this.paddingTop = paddingTop;
        this.paddingBottom = paddingBottom;
        result |= 8 | 2;
      }
      if (this.editorWidth != view.scrollDOM.clientWidth) {
        if (oracle.lineWrapping)
          measureContent = true;
        this.editorWidth = view.scrollDOM.clientWidth;
        result |= 8;
      }
      let scrollTop = view.scrollDOM.scrollTop * this.scaleY;
      if (this.scrollTop != scrollTop) {
        this.scrollAnchorHeight = -1;
        this.scrollTop = scrollTop;
      }
      this.scrolledToBottom = isScrolledToBottom(view.scrollDOM);
      let pixelViewport = (this.printing ? fullPixelRange : visiblePixelRange)(dom, this.paddingTop);
      let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom;
      this.pixelViewport = pixelViewport;
      let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;
      if (inView != this.inView) {
        this.inView = inView;
        if (inView)
          measureContent = true;
      }
      if (!this.inView && !this.scrollTarget)
        return 0;
      let contentWidth = domRect.width;
      if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
        this.contentDOMWidth = domRect.width;
        this.editorHeight = view.scrollDOM.clientHeight;
        result |= 8;
      }
      if (measureContent) {
        let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
        if (oracle.mustRefreshForHeights(lineHeights))
          refresh = true;
        if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {
          let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();
          refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
          if (refresh) {
            view.docView.minWidth = 0;
            result |= 8;
          }
        }
        if (dTop > 0 && dBottom > 0)
          bias = Math.max(dTop, dBottom);
        else if (dTop < 0 && dBottom < 0)
          bias = Math.min(dTop, dBottom);
        oracle.heightChanged = false;
        for (let vp of this.viewports) {
          let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp);
          this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text$1.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));
        }
        if (oracle.heightChanged)
          result |= 2;
      }
      let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) || this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from || this.scrollTarget.range.head > this.viewport.to);
      if (viewportChange)
        this.viewport = this.getViewport(bias, this.scrollTarget);
      this.updateForViewport();
      if (result & 2 || viewportChange)
        this.updateViewportLines();
      if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
        this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));
      result |= this.computeVisibleRanges();
      if (this.mustEnforceCursorAssoc) {
        this.mustEnforceCursorAssoc = false;
        view.docView.enforceCursorAssoc();
      }
      return result;
    }
    get visibleTop() {
      return this.scaler.fromDOM(this.pixelViewport.top);
    }
    get visibleBottom() {
      return this.scaler.fromDOM(this.pixelViewport.bottom);
    }
    getViewport(bias, scrollTarget) {
      let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2));
      let map = this.heightMap, oracle = this.heightOracle;
      let { visibleTop, visibleBottom } = this;
      let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1e3, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType$1.ByHeight, oracle, 0, 0).to);
      if (scrollTarget) {
        let { head } = scrollTarget.range;
        if (head < viewport.from || head > viewport.to) {
          let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
          let block = map.lineAt(head, QueryType$1.ByPos, oracle, 0, 0), topPos;
          if (scrollTarget.y == "center")
            topPos = (block.top + block.bottom) / 2 - viewHeight / 2;
          else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from)
            topPos = block.top;
          else
            topPos = block.bottom - viewHeight;
          viewport = new Viewport(map.lineAt(topPos - 1e3 / 2, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 1e3 / 2, QueryType$1.ByHeight, oracle, 0, 0).to);
        }
      }
      return viewport;
    }
    mapViewport(viewport, changes) {
      let from = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1);
      return new Viewport(this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0).to);
    }
    viewportIsAppropriate({ from, to }, bias = 0) {
      if (!this.inView)
        return true;
      let { top: top2 } = this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0);
      let { bottom } = this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0);
      let { visibleTop, visibleBottom } = this;
      return (from == 0 || top2 <= visibleTop - Math.max(10, Math.min(-bias, 250))) && (to == this.state.doc.length || bottom >= visibleBottom + Math.max(10, Math.min(bias, 250))) && (top2 > visibleTop - 2 * 1e3 && bottom < visibleBottom + 2 * 1e3);
    }
    mapLineGaps(gaps, changes) {
      if (!gaps.length || changes.empty)
        return gaps;
      let mapped = [];
      for (let gap of gaps)
        if (!changes.touchesRange(gap.from, gap.to))
          mapped.push(new LineGap(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size));
      return mapped;
    }
    ensureLineGaps(current, mayMeasure) {
      let wrapping = this.heightOracle.lineWrapping;
      let margin = wrapping ? 1e4 : 2e3, halfMargin = margin >> 1, doubleMargin = margin << 1;
      if (this.defaultTextDirection != Direction.LTR && !wrapping)
        return [];
      let gaps = [];
      let addGap = (from, to, line, structure) => {
        if (to - from < halfMargin)
          return;
        let sel = this.state.selection.main, avoid = [sel.from];
        if (!sel.empty)
          avoid.push(sel.to);
        for (let pos of avoid) {
          if (pos > from && pos < to) {
            addGap(from, pos - 10, line, structure);
            addGap(pos + 10, to, line, structure);
            return;
          }
        }
        let gap = find$1(current, (gap2) => gap2.from >= line.from && gap2.to <= line.to && Math.abs(gap2.from - from) < halfMargin && Math.abs(gap2.to - to) < halfMargin && !avoid.some((pos) => gap2.from < pos && gap2.to > pos));
        if (!gap) {
          if (to < line.to && mayMeasure && wrapping && mayMeasure.visibleRanges.some((r) => r.from <= to && r.to >= to)) {
            let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to), false, true).head;
            if (lineStart > from)
              to = lineStart;
          }
          gap = new LineGap(from, to, this.gapSize(line, from, to, structure));
        }
        gaps.push(gap);
      };
      for (let line of this.viewportLines) {
        if (line.length < doubleMargin)
          continue;
        let structure = lineStructure(line.from, line.to, this.stateDeco);
        if (structure.total < doubleMargin)
          continue;
        let target = this.scrollTarget ? this.scrollTarget.range.head : null;
        let viewFrom, viewTo;
        if (wrapping) {
          let marginHeight = margin / this.heightOracle.lineLength * this.heightOracle.lineHeight;
          let top2, bot;
          if (target != null) {
            let targetFrac = findFraction(structure, target);
            let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line.height;
            top2 = targetFrac - spaceFrac;
            bot = targetFrac + spaceFrac;
          } else {
            top2 = (this.visibleTop - line.top - marginHeight) / line.height;
            bot = (this.visibleBottom - line.top + marginHeight) / line.height;
          }
          viewFrom = findPosition(structure, top2);
          viewTo = findPosition(structure, bot);
        } else {
          let totalWidth = structure.total * this.heightOracle.charWidth;
          let marginWidth = margin * this.heightOracle.charWidth;
          let left, right;
          if (target != null) {
            let targetFrac = findFraction(structure, target);
            let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;
            left = targetFrac - spaceFrac;
            right = targetFrac + spaceFrac;
          } else {
            left = (this.pixelViewport.left - marginWidth) / totalWidth;
            right = (this.pixelViewport.right + marginWidth) / totalWidth;
          }
          viewFrom = findPosition(structure, left);
          viewTo = findPosition(structure, right);
        }
        if (viewFrom > line.from)
          addGap(line.from, viewFrom, line, structure);
        if (viewTo < line.to)
          addGap(viewTo, line.to, line, structure);
      }
      return gaps;
    }
    gapSize(line, from, to, structure) {
      let fraction = findFraction(structure, to) - findFraction(structure, from);
      if (this.heightOracle.lineWrapping) {
        return line.height * fraction;
      } else {
        return structure.total * this.heightOracle.charWidth * fraction;
      }
    }
    updateLineGaps(gaps) {
      if (!LineGap.same(gaps, this.lineGaps)) {
        this.lineGaps = gaps;
        this.lineGapDeco = Decoration.set(gaps.map((gap) => gap.draw(this, this.heightOracle.lineWrapping)));
      }
    }
    computeVisibleRanges() {
      let deco = this.stateDeco;
      if (this.lineGaps.length)
        deco = deco.concat(this.lineGapDeco);
      let ranges = [];
      RangeSet.spans(deco, this.viewport.from, this.viewport.to, {
        span(from, to) {
          ranges.push({ from, to });
        },
        point() {
        }
      }, 20);
      let changed = ranges.length != this.visibleRanges.length || this.visibleRanges.some((r, i2) => r.from != ranges[i2].from || r.to != ranges[i2].to);
      this.visibleRanges = ranges;
      return changed ? 4 : 0;
    }
    lineBlockAt(pos) {
      return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos && b.to >= pos) || scaleBlock(this.heightMap.lineAt(pos, QueryType$1.ByPos, this.heightOracle, 0, 0), this.scaler);
    }
    lineBlockAtHeight(height) {
      return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType$1.ByHeight, this.heightOracle, 0, 0), this.scaler);
    }
    scrollAnchorAt(scrollTop) {
      let block = this.lineBlockAtHeight(scrollTop + 8);
      return block.from >= this.viewport.from || this.viewportLines[0].top - scrollTop > 200 ? block : this.viewportLines[0];
    }
    elementAtHeight(height) {
      return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);
    }
    get docHeight() {
      return this.scaler.toDOM(this.heightMap.height);
    }
    get contentHeight() {
      return this.docHeight + this.paddingTop + this.paddingBottom;
    }
  }
  class Viewport {
    constructor(from, to) {
      this.from = from;
      this.to = to;
    }
  }
  function lineStructure(from, to, stateDeco) {
    let ranges = [], pos = from, total = 0;
    RangeSet.spans(stateDeco, from, to, {
      span() {
      },
      point(from2, to2) {
        if (from2 > pos) {
          ranges.push({ from: pos, to: from2 });
          total += from2 - pos;
        }
        pos = to2;
      }
    }, 20);
    if (pos < to) {
      ranges.push({ from: pos, to });
      total += to - pos;
    }
    return { total, ranges };
  }
  function findPosition({ total, ranges }, ratio) {
    if (ratio <= 0)
      return ranges[0].from;
    if (ratio >= 1)
      return ranges[ranges.length - 1].to;
    let dist2 = Math.floor(total * ratio);
    for (let i2 = 0; ; i2++) {
      let { from, to } = ranges[i2], size = to - from;
      if (dist2 <= size)
        return from + dist2;
      dist2 -= size;
    }
  }
  function findFraction(structure, pos) {
    let counted = 0;
    for (let { from, to } of structure.ranges) {
      if (pos <= to) {
        counted += pos - from;
        break;
      }
      counted += to - from;
    }
    return counted / structure.total;
  }
  function find$1(array, f) {
    for (let val of array)
      if (f(val))
        return val;
    return void 0;
  }
  const IdScaler = {
    toDOM(n) {
      return n;
    },
    fromDOM(n) {
      return n;
    },
    scale: 1
  };
  class BigScaler {
    constructor(oracle, heightMap, viewports) {
      let vpHeight = 0, base2 = 0, domBase = 0;
      this.viewports = viewports.map(({ from, to }) => {
        let top2 = heightMap.lineAt(from, QueryType$1.ByPos, oracle, 0, 0).top;
        let bottom = heightMap.lineAt(to, QueryType$1.ByPos, oracle, 0, 0).bottom;
        vpHeight += bottom - top2;
        return { from, to, top: top2, bottom, domTop: 0, domBottom: 0 };
      });
      this.scale = (7e6 - vpHeight) / (heightMap.height - vpHeight);
      for (let obj of this.viewports) {
        obj.domTop = domBase + (obj.top - base2) * this.scale;
        domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);
        base2 = obj.bottom;
      }
    }
    toDOM(n) {
      for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
        let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
        if (!vp || n < vp.top)
          return domBase + (n - base2) * this.scale;
        if (n <= vp.bottom)
          return vp.domTop + (n - vp.top);
        base2 = vp.bottom;
        domBase = vp.domBottom;
      }
    }
    fromDOM(n) {
      for (let i2 = 0, base2 = 0, domBase = 0; ; i2++) {
        let vp = i2 < this.viewports.length ? this.viewports[i2] : null;
        if (!vp || n < vp.domTop)
          return base2 + (n - domBase) / this.scale;
        if (n <= vp.domBottom)
          return vp.top + (n - vp.domTop);
        base2 = vp.bottom;
        domBase = vp.domBottom;
      }
    }
  }
  function scaleBlock(block, scaler) {
    if (scaler.scale == 1)
      return block;
    let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom);
    return new BlockInfo(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block._content) ? block._content.map((b) => scaleBlock(b, scaler)) : block._content);
  }
  const theme = /* @__PURE__ */ Facet.define({ combine: (strs) => strs.join(" ") });
  const darkTheme = /* @__PURE__ */ Facet.define({ combine: (values) => values.indexOf(true) > -1 });
  const baseThemeID = /* @__PURE__ */ StyleModule.newName(), baseLightID = /* @__PURE__ */ StyleModule.newName(), baseDarkID = /* @__PURE__ */ StyleModule.newName();
  const lightDarkIDs = { "&light": "." + baseLightID, "&dark": "." + baseDarkID };
  function buildTheme(main, spec, scopes) {
    return new StyleModule(spec, {
      finish(sel) {
        return /&/.test(sel) ? sel.replace(/&\w*/, (m) => {
          if (m == "&")
            return main;
          if (!scopes || !scopes[m])
            throw new RangeError(`Unsupported selector: ${m}`);
          return scopes[m];
        }) : main + " " + sel;
      }
    });
  }
  const baseTheme$1$3 = /* @__PURE__ */ buildTheme("." + baseThemeID, {
    "&": {
      position: "relative !important",
      boxSizing: "border-box",
      "&.cm-focused": {
        outline: "1px dotted #212121"
      },
      display: "flex !important",
      flexDirection: "column"
    },
    ".cm-scroller": {
      display: "flex !important",
      alignItems: "flex-start !important",
      fontFamily: "monospace",
      lineHeight: 1.4,
      height: "100%",
      overflowX: "auto",
      position: "relative",
      zIndex: 0
    },
    ".cm-content": {
      margin: 0,
      flexGrow: 2,
      flexShrink: 0,
      display: "block",
      whiteSpace: "pre",
      wordWrap: "normal",
      boxSizing: "border-box",
      minHeight: "100%",
      padding: "4px 0",
      outline: "none",
      "&[contenteditable=true]": {
        WebkitUserModify: "read-write-plaintext-only"
      }
    },
    ".cm-lineWrapping": {
      whiteSpace_fallback: "pre-wrap",
      whiteSpace: "break-spaces",
      wordBreak: "break-word",
      overflowWrap: "anywhere",
      flexShrink: 1
    },
    "&light .cm-content": { caretColor: "black" },
    "&dark .cm-content": { caretColor: "white" },
    ".cm-line": {
      display: "block",
      padding: "0 2px 0 6px"
    },
    ".cm-layer": {
      position: "absolute",
      left: 0,
      top: 0,
      contain: "size style",
      "& > *": {
        position: "absolute"
      }
    },
    "&light .cm-selectionBackground": {
      background: "#d9d9d9"
    },
    "&dark .cm-selectionBackground": {
      background: "#222"
    },
    "&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
      background: "#d7d4f0"
    },
    "&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": {
      background: "#233"
    },
    ".cm-cursorLayer": {
      pointerEvents: "none"
    },
    "&.cm-focused > .cm-scroller > .cm-cursorLayer": {
      animation: "steps(1) cm-blink 1.2s infinite"
    },
    "@keyframes cm-blink": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
    "@keyframes cm-blink2": { "0%": {}, "50%": { opacity: 0 }, "100%": {} },
    ".cm-cursor, .cm-dropCursor": {
      borderLeft: "1.2px solid black",
      marginLeft: "-0.6px",
      pointerEvents: "none"
    },
    ".cm-cursor": {
      display: "none"
    },
    "&dark .cm-cursor": {
      borderLeftColor: "#444"
    },
    ".cm-dropCursor": {
      position: "absolute"
    },
    "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": {
      display: "block"
    },
    "&light .cm-activeLine": { backgroundColor: "#cceeff44" },
    "&dark .cm-activeLine": { backgroundColor: "#99eeff33" },
    "&light .cm-specialChar": { color: "red" },
    "&dark .cm-specialChar": { color: "#f78" },
    ".cm-gutters": {
      flexShrink: 0,
      display: "flex",
      height: "100%",
      boxSizing: "border-box",
      insetInlineStart: 0,
      zIndex: 200
    },
    "&light .cm-gutters": {
      backgroundColor: "#f5f5f5",
      color: "#6c6c6c",
      borderRight: "1px solid #ddd"
    },
    "&dark .cm-gutters": {
      backgroundColor: "#333338",
      color: "#ccc"
    },
    ".cm-gutter": {
      display: "flex !important",
      flexDirection: "column",
      flexShrink: 0,
      boxSizing: "border-box",
      minHeight: "100%",
      overflow: "hidden"
    },
    ".cm-gutterElement": {
      boxSizing: "border-box"
    },
    ".cm-lineNumbers .cm-gutterElement": {
      padding: "0 3px 0 5px",
      minWidth: "20px",
      textAlign: "right",
      whiteSpace: "nowrap"
    },
    "&light .cm-activeLineGutter": {
      backgroundColor: "#e2f2ff"
    },
    "&dark .cm-activeLineGutter": {
      backgroundColor: "#222227"
    },
    ".cm-panels": {
      boxSizing: "border-box",
      position: "sticky",
      left: 0,
      right: 0
    },
    "&light .cm-panels": {
      backgroundColor: "#f5f5f5",
      color: "black"
    },
    "&light .cm-panels-top": {
      borderBottom: "1px solid #ddd"
    },
    "&light .cm-panels-bottom": {
      borderTop: "1px solid #ddd"
    },
    "&dark .cm-panels": {
      backgroundColor: "#333338",
      color: "white"
    },
    ".cm-tab": {
      display: "inline-block",
      overflow: "hidden",
      verticalAlign: "bottom"
    },
    ".cm-widgetBuffer": {
      verticalAlign: "text-top",
      height: "1em",
      width: 0,
      display: "inline"
    },
    ".cm-placeholder": {
      color: "#888",
      display: "inline-block",
      verticalAlign: "top"
    },
    ".cm-highlightSpace:before": {
      content: "attr(data-display)",
      position: "absolute",
      pointerEvents: "none",
      color: "#888"
    },
    ".cm-highlightTab": {
      backgroundImage: `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,
      backgroundSize: "auto 100%",
      backgroundPosition: "right 90%",
      backgroundRepeat: "no-repeat"
    },
    ".cm-trailingSpace": {
      backgroundColor: "#ff332255"
    },
    ".cm-button": {
      verticalAlign: "middle",
      color: "inherit",
      fontSize: "70%",
      padding: ".2em 1em",
      borderRadius: "1px"
    },
    "&light .cm-button": {
      backgroundImage: "linear-gradient(#eff1f5, #d9d9df)",
      border: "1px solid #888",
      "&:active": {
        backgroundImage: "linear-gradient(#b4b4b4, #d0d3d6)"
      }
    },
    "&dark .cm-button": {
      backgroundImage: "linear-gradient(#393939, #111)",
      border: "1px solid #888",
      "&:active": {
        backgroundImage: "linear-gradient(#111, #333)"
      }
    },
    ".cm-textfield": {
      verticalAlign: "middle",
      color: "inherit",
      fontSize: "70%",
      border: "1px solid silver",
      padding: ".2em .5em"
    },
    "&light .cm-textfield": {
      backgroundColor: "white"
    },
    "&dark .cm-textfield": {
      border: "1px solid #555",
      backgroundColor: "inherit"
    }
  }, lightDarkIDs);
  const LineBreakPlaceholder = "\uFFFF";
  class DOMReader {
    constructor(points, state) {
      this.points = points;
      this.text = "";
      this.lineSeparator = state.facet(EditorState.lineSeparator);
    }
    append(text) {
      this.text += text;
    }
    lineBreak() {
      this.text += LineBreakPlaceholder;
    }
    readRange(start, end) {
      if (!start)
        return this;
      let parent = start.parentNode;
      for (let cur2 = start; ; ) {
        this.findPointBefore(parent, cur2);
        let oldLen = this.text.length;
        this.readNode(cur2);
        let next = cur2.nextSibling;
        if (next == end)
          break;
        let view = ContentView.get(cur2), nextView = ContentView.get(next);
        if (view && nextView ? view.breakAfter : (view ? view.breakAfter : isBlockElement(cur2)) || isBlockElement(next) && (cur2.nodeName != "BR" || cur2.cmIgnore) && this.text.length > oldLen)
          this.lineBreak();
        cur2 = next;
      }
      this.findPointBefore(parent, end);
      return this;
    }
    readTextNode(node) {
      let text = node.nodeValue;
      for (let point of this.points)
        if (point.node == node)
          point.pos = this.text.length + Math.min(point.offset, text.length);
      for (let off2 = 0, re = this.lineSeparator ? null : /\r\n?|\n/g; ; ) {
        let nextBreak = -1, breakSize = 1, m;
        if (this.lineSeparator) {
          nextBreak = text.indexOf(this.lineSeparator, off2);
          breakSize = this.lineSeparator.length;
        } else if (m = re.exec(text)) {
          nextBreak = m.index;
          breakSize = m[0].length;
        }
        this.append(text.slice(off2, nextBreak < 0 ? text.length : nextBreak));
        if (nextBreak < 0)
          break;
        this.lineBreak();
        if (breakSize > 1) {
          for (let point of this.points)
            if (point.node == node && point.pos > this.text.length)
              point.pos -= breakSize - 1;
        }
        off2 = nextBreak + breakSize;
      }
    }
    readNode(node) {
      if (node.cmIgnore)
        return;
      let view = ContentView.get(node);
      let fromView = view && view.overrideDOMText;
      if (fromView != null) {
        this.findPointInside(node, fromView.length);
        for (let i2 = fromView.iter(); !i2.next().done; ) {
          if (i2.lineBreak)
            this.lineBreak();
          else
            this.append(i2.value);
        }
      } else if (node.nodeType == 3) {
        this.readTextNode(node);
      } else if (node.nodeName == "BR") {
        if (node.nextSibling)
          this.lineBreak();
      } else if (node.nodeType == 1) {
        this.readRange(node.firstChild, null);
      }
    }
    findPointBefore(node, next) {
      for (let point of this.points)
        if (point.node == node && node.childNodes[point.offset] == next)
          point.pos = this.text.length;
    }
    findPointInside(node, length) {
      for (let point of this.points)
        if (node.nodeType == 3 ? point.node == node : node.contains(point.node))
          point.pos = this.text.length + (isAtEnd(node, point.node, point.offset) ? length : 0);
    }
  }
  function isAtEnd(parent, node, offset) {
    for (; ; ) {
      if (!node || offset < maxOffset(node))
        return false;
      if (node == parent)
        return true;
      offset = domIndex(node) + 1;
      node = node.parentNode;
    }
  }
  function isBlockElement(node) {
    return node.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName);
  }
  class DOMPoint {
    constructor(node, offset) {
      this.node = node;
      this.offset = offset;
      this.pos = -1;
    }
  }
  class DOMChange {
    constructor(view, start, end, typeOver) {
      this.typeOver = typeOver;
      this.bounds = null;
      this.text = "";
      let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView;
      if (view.state.readOnly && start > -1) {
        this.newSel = null;
      } else if (start > -1 && (this.bounds = view.docView.domBoundsAround(start, end, 0))) {
        let selPoints = iHead || iAnchor ? [] : selectionPoints(view);
        let reader = new DOMReader(selPoints, view.state);
        reader.readRange(this.bounds.startDOM, this.bounds.endDOM);
        this.text = reader.text;
        this.newSel = selectionFromPoints(selPoints, this.bounds.from);
      } else {
        let domSel = view.observer.selectionRange;
        let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset || !contains(view.contentDOM, domSel.focusNode) ? view.state.selection.main.head : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);
        let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset || !contains(view.contentDOM, domSel.anchorNode) ? view.state.selection.main.anchor : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);
        this.newSel = EditorSelection.single(anchor, head);
      }
    }
  }
  function applyDOMChange(view, domChange) {
    let change;
    let { newSel } = domChange, sel = view.state.selection.main;
    let lastKey = view.inputState.lastKeyTime > Date.now() - 100 ? view.inputState.lastKeyCode : -1;
    if (domChange.bounds) {
      let { from, to } = domChange.bounds;
      let preferredPos = sel.from, preferredSide = null;
      if (lastKey === 8 || browser.android && domChange.text.length < to - from) {
        preferredPos = sel.to;
        preferredSide = "end";
      }
      let diff = findDiff(view.state.doc.sliceString(from, to, LineBreakPlaceholder), domChange.text, preferredPos - from, preferredSide);
      if (diff) {
        if (browser.chrome && lastKey == 13 && diff.toB == diff.from + 2 && domChange.text.slice(diff.from, diff.toB) == LineBreakPlaceholder + LineBreakPlaceholder)
          diff.toB--;
        change = {
          from: from + diff.from,
          to: from + diff.toA,
          insert: Text$1.of(domChange.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder))
        };
      }
    } else if (newSel && (!view.hasFocus && view.state.facet(editable) || newSel.main.eq(sel))) {
      newSel = null;
    }
    if (!change && !newSel)
      return false;
    if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {
      change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };
    } else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) {
      change = {
        from: sel.from,
        to: sel.to,
        insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
      };
    } else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
      if (newSel && change.insert.length == 2)
        newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
      change = { from: sel.from, to: sel.to, insert: Text$1.of([" "]) };
    } else if (browser.chrome && change && change.from == change.to && change.from == sel.head && change.insert.toString() == "\n " && view.lineWrapping) {
      if (newSel)
        newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
      change = { from: sel.from, to: sel.to, insert: Text$1.of([" "]) };
    }
    if (change) {
      if (browser.ios && view.inputState.flushIOSKey())
        return true;
      if (browser.android && (change.from == sel.from && change.to == sel.to && change.insert.length == 1 && change.insert.lines == 2 && dispatchKey(view.contentDOM, "Enter", 13) || (change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 || lastKey == 8 && change.insert.length < change.to - change.from && change.to > sel.head) && dispatchKey(view.contentDOM, "Backspace", 8) || change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 && dispatchKey(view.contentDOM, "Delete", 46)))
        return true;
      let text = change.insert.toString();
      if (view.inputState.composing >= 0)
        view.inputState.composing++;
      let defaultTr;
      let defaultInsert = () => defaultTr || (defaultTr = applyDefaultInsert(view, change, newSel));
      if (!view.state.facet(inputHandler$1).some((h) => h(view, change.from, change.to, text, defaultInsert)))
        view.dispatch(defaultInsert());
      return true;
    } else if (newSel && !newSel.main.eq(sel)) {
      let scrollIntoView2 = false, userEvent = "select";
      if (view.inputState.lastSelectionTime > Date.now() - 50) {
        if (view.inputState.lastSelectionOrigin == "select")
          scrollIntoView2 = true;
        userEvent = view.inputState.lastSelectionOrigin;
      }
      view.dispatch({ selection: newSel, scrollIntoView: scrollIntoView2, userEvent });
      return true;
    } else {
      return false;
    }
  }
  function applyDefaultInsert(view, change, newSel) {
    let tr, startState = view.state, sel = startState.selection.main;
    if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 && (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) && view.inputState.composing < 0) {
      let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : "";
      let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : "";
      tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, void 0, view.state.lineBreak) + after));
    } else {
      let changes = startState.changes(change);
      let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : void 0;
      if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 && change.to <= sel.to && change.to >= sel.to - 10) {
        let replaced = view.state.sliceDoc(change.from, change.to);
        let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);
        if (composition) {
          let dLen = change.insert.length - (change.to - change.from);
          compositionRange = { from: composition.from, to: composition.to - dLen };
        } else {
          compositionRange = view.state.doc.lineAt(sel.head);
        }
        let offset = sel.to - change.to, size = sel.to - sel.from;
        tr = startState.changeByRange((range) => {
          if (range.from == sel.from && range.to == sel.to)
            return { changes, range: mainSel || range.map(changes) };
          let to = range.to - offset, from = to - replaced.length;
          if (range.to - range.from != size || view.state.sliceDoc(from, to) != replaced || range.to >= compositionRange.from && range.from <= compositionRange.to)
            return { range };
          let rangeChanges = startState.changes({ from, to, insert: change.insert }), selOff = range.to - sel.to;
          return {
            changes: rangeChanges,
            range: !mainSel ? range.map(rangeChanges) : EditorSelection.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff))
          };
        });
      } else {
        tr = {
          changes,
          selection: mainSel && startState.selection.replaceRange(mainSel)
        };
      }
    }
    let userEvent = "input.type";
    if (view.composing || view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {
      view.inputState.compositionPendingChange = false;
      userEvent += ".compose";
      if (view.inputState.compositionFirstChange) {
        userEvent += ".start";
        view.inputState.compositionFirstChange = false;
      }
    }
    return startState.update(tr, { userEvent, scrollIntoView: true });
  }
  function findDiff(a, b, preferredPos, preferredSide) {
    let minLen = Math.min(a.length, b.length);
    let from = 0;
    while (from < minLen && a.charCodeAt(from) == b.charCodeAt(from))
      from++;
    if (from == minLen && a.length == b.length)
      return null;
    let toA = a.length, toB = b.length;
    while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) {
      toA--;
      toB--;
    }
    if (preferredSide == "end") {
      let adjust = Math.max(0, from - Math.min(toA, toB));
      preferredPos -= toA + adjust - from;
    }
    if (toA < from && a.length < b.length) {
      let move = preferredPos <= from && preferredPos >= toA ? from - preferredPos : 0;
      from -= move;
      toB = from + (toB - toA);
      toA = from;
    } else if (toB < from) {
      let move = preferredPos <= from && preferredPos >= toB ? from - preferredPos : 0;
      from -= move;
      toA = from + (toA - toB);
      toB = from;
    }
    return { from, toA, toB };
  }
  function selectionPoints(view) {
    let result = [];
    if (view.root.activeElement != view.contentDOM)
      return result;
    let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;
    if (anchorNode) {
      result.push(new DOMPoint(anchorNode, anchorOffset));
      if (focusNode != anchorNode || focusOffset != anchorOffset)
        result.push(new DOMPoint(focusNode, focusOffset));
    }
    return result;
  }
  function selectionFromPoints(points, base2) {
    if (points.length == 0)
      return null;
    let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor;
    return anchor > -1 && head > -1 ? EditorSelection.single(anchor + base2, head + base2) : null;
  }
  const observeOptions = {
    childList: true,
    characterData: true,
    subtree: true,
    attributes: true,
    characterDataOldValue: true
  };
  const useCharData = browser.ie && browser.ie_version <= 11;
  class DOMObserver {
    constructor(view) {
      this.view = view;
      this.active = false;
      this.selectionRange = new DOMSelectionState();
      this.selectionChanged = false;
      this.delayedFlush = -1;
      this.resizeTimeout = -1;
      this.queue = [];
      this.delayedAndroidKey = null;
      this.flushingAndroidKey = -1;
      this.lastChange = 0;
      this.scrollTargets = [];
      this.intersection = null;
      this.resizeScroll = null;
      this.intersecting = false;
      this.gapIntersection = null;
      this.gaps = [];
      this.parentCheck = -1;
      this.dom = view.contentDOM;
      this.observer = new MutationObserver((mutations) => {
        for (let mut of mutations)
          this.queue.push(mut);
        if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) && mutations.some((m) => m.type == "childList" && m.removedNodes.length || m.type == "characterData" && m.oldValue.length > m.target.nodeValue.length))
          this.flushSoon();
        else
          this.flush();
      });
      if (useCharData)
        this.onCharData = (event) => {
          this.queue.push({
            target: event.target,
            type: "characterData",
            oldValue: event.prevValue
          });
          this.flushSoon();
        };
      this.onSelectionChange = this.onSelectionChange.bind(this);
      this.onResize = this.onResize.bind(this);
      this.onPrint = this.onPrint.bind(this);
      this.onScroll = this.onScroll.bind(this);
      if (typeof ResizeObserver == "function") {
        this.resizeScroll = new ResizeObserver(() => {
          var _a2;
          if (((_a2 = this.view.docView) === null || _a2 === void 0 ? void 0 : _a2.lastUpdate) < Date.now() - 75)
            this.onResize();
        });
        this.resizeScroll.observe(view.scrollDOM);
      }
      this.addWindowListeners(this.win = view.win);
      this.start();
      if (typeof IntersectionObserver == "function") {
        this.intersection = new IntersectionObserver((entries) => {
          if (this.parentCheck < 0)
            this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1e3);
          if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0 != this.intersecting) {
            this.intersecting = !this.intersecting;
            if (this.intersecting != this.view.inView)
              this.onScrollChanged(document.createEvent("Event"));
          }
        }, { threshold: [0, 1e-3] });
        this.intersection.observe(this.dom);
        this.gapIntersection = new IntersectionObserver((entries) => {
          if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0)
            this.onScrollChanged(document.createEvent("Event"));
        }, {});
      }
      this.listenForScroll();
      this.readSelectionRange();
    }
    onScrollChanged(e) {
      this.view.inputState.runHandlers("scroll", e);
      if (this.intersecting)
        this.view.measure();
    }
    onScroll(e) {
      if (this.intersecting)
        this.flush(false);
      this.onScrollChanged(e);
    }
    onResize() {
      if (this.resizeTimeout < 0)
        this.resizeTimeout = setTimeout(() => {
          this.resizeTimeout = -1;
          this.view.requestMeasure();
        }, 50);
    }
    onPrint() {
      this.view.viewState.printing = true;
      this.view.measure();
      setTimeout(() => {
        this.view.viewState.printing = false;
        this.view.requestMeasure();
      }, 500);
    }
    updateGaps(gaps) {
      if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i2) => g != gaps[i2]))) {
        this.gapIntersection.disconnect();
        for (let gap of gaps)
          this.gapIntersection.observe(gap);
        this.gaps = gaps;
      }
    }
    onSelectionChange(event) {
      let wasChanged = this.selectionChanged;
      if (!this.readSelectionRange() || this.delayedAndroidKey)
        return;
      let { view } = this, sel = this.selectionRange;
      if (view.state.facet(editable) ? view.root.activeElement != this.dom : !hasSelection(view.dom, sel))
        return;
      let context = sel.anchorNode && view.docView.nearest(sel.anchorNode);
      if (context && context.ignoreEvent(event)) {
        if (!wasChanged)
          this.selectionChanged = false;
        return;
      }
      if ((browser.ie && browser.ie_version <= 11 || browser.android && browser.chrome) && !view.state.selection.main.empty && sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))
        this.flushSoon();
      else
        this.flush(false);
    }
    readSelectionRange() {
      let { view } = this;
      let range = browser.safari && view.root.nodeType == 11 && deepActiveElement(this.dom.ownerDocument) == this.dom && safariSelectionRangeHack(this.view) || getSelection(view.root);
      if (!range || this.selectionRange.eq(range))
        return false;
      let local = hasSelection(this.dom, range);
      if (local && !this.selectionChanged && view.inputState.lastFocusTime > Date.now() - 200 && view.inputState.lastTouchTime < Date.now() - 300 && atElementStart(this.dom, range)) {
        this.view.inputState.lastFocusTime = 0;
        view.docView.updateSelection();
        return false;
      }
      this.selectionRange.setRange(range);
      if (local)
        this.selectionChanged = true;
      return true;
    }
    setSelectionRange(anchor, head) {
      this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset);
      this.selectionChanged = false;
    }
    clearSelectionRange() {
      this.selectionRange.set(null, 0, null, 0);
    }
    listenForScroll() {
      this.parentCheck = -1;
      let i2 = 0, changed = null;
      for (let dom = this.dom; dom; ) {
        if (dom.nodeType == 1) {
          if (!changed && i2 < this.scrollTargets.length && this.scrollTargets[i2] == dom)
            i2++;
          else if (!changed)
            changed = this.scrollTargets.slice(0, i2);
          if (changed)
            changed.push(dom);
          dom = dom.assignedSlot || dom.parentNode;
        } else if (dom.nodeType == 11) {
          dom = dom.host;
        } else {
          break;
        }
      }
      if (i2 < this.scrollTargets.length && !changed)
        changed = this.scrollTargets.slice(0, i2);
      if (changed) {
        for (let dom of this.scrollTargets)
          dom.removeEventListener("scroll", this.onScroll);
        for (let dom of this.scrollTargets = changed)
          dom.addEventListener("scroll", this.onScroll);
      }
    }
    ignore(f) {
      if (!this.active)
        return f();
      try {
        this.stop();
        return f();
      } finally {
        this.start();
        this.clear();
      }
    }
    start() {
      if (this.active)
        return;
      this.observer.observe(this.dom, observeOptions);
      if (useCharData)
        this.dom.addEventListener("DOMCharacterDataModified", this.onCharData);
      this.active = true;
    }
    stop() {
      if (!this.active)
        return;
      this.active = false;
      this.observer.disconnect();
      if (useCharData)
        this.dom.removeEventListener("DOMCharacterDataModified", this.onCharData);
    }
    clear() {
      this.processRecords();
      this.queue.length = 0;
      this.selectionChanged = false;
    }
    delayAndroidKey(key, keyCode) {
      var _a2;
      if (!this.delayedAndroidKey) {
        let flush = () => {
          let key2 = this.delayedAndroidKey;
          if (key2) {
            this.clearDelayedAndroidKey();
            this.view.inputState.lastKeyCode = key2.keyCode;
            this.view.inputState.lastKeyTime = Date.now();
            let flushed = this.flush();
            if (!flushed && key2.force)
              dispatchKey(this.dom, key2.key, key2.keyCode);
          }
        };
        this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);
      }
      if (!this.delayedAndroidKey || key == "Enter")
        this.delayedAndroidKey = {
          key,
          keyCode,
          force: this.lastChange < Date.now() - 50 || !!((_a2 = this.delayedAndroidKey) === null || _a2 === void 0 ? void 0 : _a2.force)
        };
    }
    clearDelayedAndroidKey() {
      this.win.cancelAnimationFrame(this.flushingAndroidKey);
      this.delayedAndroidKey = null;
      this.flushingAndroidKey = -1;
    }
    flushSoon() {
      if (this.delayedFlush < 0)
        this.delayedFlush = this.view.win.requestAnimationFrame(() => {
          this.delayedFlush = -1;
          this.flush();
        });
    }
    forceFlush() {
      if (this.delayedFlush >= 0) {
        this.view.win.cancelAnimationFrame(this.delayedFlush);
        this.delayedFlush = -1;
      }
      this.flush();
    }
    pendingRecords() {
      for (let mut of this.observer.takeRecords())
        this.queue.push(mut);
      return this.queue;
    }
    processRecords() {
      let records = this.pendingRecords();
      if (records.length)
        this.queue = [];
      let from = -1, to = -1, typeOver = false;
      for (let record of records) {
        let range = this.readMutation(record);
        if (!range)
          continue;
        if (range.typeOver)
          typeOver = true;
        if (from == -1) {
          ({ from, to } = range);
        } else {
          from = Math.min(range.from, from);
          to = Math.max(range.to, to);
        }
      }
      return { from, to, typeOver };
    }
    readChange() {
      let { from, to, typeOver } = this.processRecords();
      let newSel = this.selectionChanged && hasSelection(this.dom, this.selectionRange);
      if (from < 0 && !newSel)
        return null;
      if (from > -1)
        this.lastChange = Date.now();
      this.view.inputState.lastFocusTime = 0;
      this.selectionChanged = false;
      let change = new DOMChange(this.view, from, to, typeOver);
      this.view.docView.domChanged = { newSel: change.newSel ? change.newSel.main : null };
      return change;
    }
    flush(readSelection = true) {
      if (this.delayedFlush >= 0 || this.delayedAndroidKey)
        return false;
      if (readSelection)
        this.readSelectionRange();
      let domChange = this.readChange();
      if (!domChange) {
        this.view.requestMeasure();
        return false;
      }
      let startState = this.view.state;
      let handled = applyDOMChange(this.view, domChange);
      if (this.view.state == startState)
        this.view.update([]);
      return handled;
    }
    readMutation(rec) {
      let cView = this.view.docView.nearest(rec.target);
      if (!cView || cView.ignoreMutation(rec))
        return null;
      cView.markDirty(rec.type == "attributes");
      if (rec.type == "attributes")
        cView.flags |= 4;
      if (rec.type == "childList") {
        let childBefore = findChild(cView, rec.previousSibling || rec.target.previousSibling, -1);
        let childAfter = findChild(cView, rec.nextSibling || rec.target.nextSibling, 1);
        return {
          from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart,
          to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd,
          typeOver: false
        };
      } else if (rec.type == "characterData") {
        return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };
      } else {
        return null;
      }
    }
    setWindow(win) {
      if (win != this.win) {
        this.removeWindowListeners(this.win);
        this.win = win;
        this.addWindowListeners(this.win);
      }
    }
    addWindowListeners(win) {
      win.addEventListener("resize", this.onResize);
      win.addEventListener("beforeprint", this.onPrint);
      win.addEventListener("scroll", this.onScroll);
      win.document.addEventListener("selectionchange", this.onSelectionChange);
    }
    removeWindowListeners(win) {
      win.removeEventListener("scroll", this.onScroll);
      win.removeEventListener("resize", this.onResize);
      win.removeEventListener("beforeprint", this.onPrint);
      win.document.removeEventListener("selectionchange", this.onSelectionChange);
    }
    destroy() {
      var _a2, _b, _c;
      this.stop();
      (_a2 = this.intersection) === null || _a2 === void 0 ? void 0 : _a2.disconnect();
      (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect();
      (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();
      for (let dom of this.scrollTargets)
        dom.removeEventListener("scroll", this.onScroll);
      this.removeWindowListeners(this.win);
      clearTimeout(this.parentCheck);
      clearTimeout(this.resizeTimeout);
      this.win.cancelAnimationFrame(this.delayedFlush);
      this.win.cancelAnimationFrame(this.flushingAndroidKey);
    }
  }
  function findChild(cView, dom, dir) {
    while (dom) {
      let curView = ContentView.get(dom);
      if (curView && curView.parent == cView)
        return curView;
      let parent = dom.parentNode;
      dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling;
    }
    return null;
  }
  function safariSelectionRangeHack(view) {
    let found = null;
    function read(event) {
      event.preventDefault();
      event.stopImmediatePropagation();
      found = event.getTargetRanges()[0];
    }
    view.contentDOM.addEventListener("beforeinput", read, true);
    view.dom.ownerDocument.execCommand("indent");
    view.contentDOM.removeEventListener("beforeinput", read, true);
    if (!found)
      return null;
    let anchorNode = found.startContainer, anchorOffset = found.startOffset;
    let focusNode = found.endContainer, focusOffset = found.endOffset;
    let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor);
    if (isEquivalentPosition(curAnchor.node, curAnchor.offset, focusNode, focusOffset))
      [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];
    return { anchorNode, anchorOffset, focusNode, focusOffset };
  }
  class EditorView {
    get state() {
      return this.viewState.state;
    }
    get viewport() {
      return this.viewState.viewport;
    }
    get visibleRanges() {
      return this.viewState.visibleRanges;
    }
    get inView() {
      return this.viewState.inView;
    }
    get composing() {
      return this.inputState.composing > 0;
    }
    get compositionStarted() {
      return this.inputState.composing >= 0;
    }
    get root() {
      return this._root;
    }
    get win() {
      return this.dom.ownerDocument.defaultView || window;
    }
    constructor(config2 = {}) {
      this.plugins = [];
      this.pluginMap = new Map();
      this.editorAttrs = {};
      this.contentAttrs = {};
      this.bidiCache = [];
      this.destroyed = false;
      this.updateState = 2;
      this.measureScheduled = -1;
      this.measureRequests = [];
      this.contentDOM = document.createElement("div");
      this.scrollDOM = document.createElement("div");
      this.scrollDOM.tabIndex = -1;
      this.scrollDOM.className = "cm-scroller";
      this.scrollDOM.appendChild(this.contentDOM);
      this.announceDOM = document.createElement("div");
      this.announceDOM.style.cssText = "position: fixed; top: -10000px";
      this.announceDOM.setAttribute("aria-live", "polite");
      this.dom = document.createElement("div");
      this.dom.appendChild(this.announceDOM);
      this.dom.appendChild(this.scrollDOM);
      let { dispatch } = config2;
      this.dispatchTransactions = config2.dispatchTransactions || dispatch && ((trs) => trs.forEach((tr) => dispatch(tr, this))) || ((trs) => this.update(trs));
      this.dispatch = this.dispatch.bind(this);
      this._root = config2.root || getRoot(config2.parent) || document;
      this.viewState = new ViewState(config2.state || EditorState.create(config2));
      if (config2.scrollTo && config2.scrollTo.is(scrollIntoView$1))
        this.viewState.scrollTarget = config2.scrollTo.value.clip(this.viewState.state);
      this.plugins = this.state.facet(viewPlugin).map((spec) => new PluginInstance(spec));
      for (let plugin of this.plugins)
        plugin.update(this);
      this.observer = new DOMObserver(this);
      this.inputState = new InputState(this);
      this.inputState.ensureHandlers(this.plugins);
      this.docView = new DocView(this);
      this.mountStyles();
      this.updateAttrs();
      this.updateState = 0;
      this.requestMeasure();
      if (config2.parent)
        config2.parent.appendChild(this.dom);
    }
    dispatch(...input) {
      let trs = input.length == 1 && input[0] instanceof Transaction ? input : input.length == 1 && Array.isArray(input[0]) ? input[0] : [this.state.update(...input)];
      this.dispatchTransactions(trs, this);
    }
    update(transactions) {
      if (this.updateState != 0)
        throw new Error("Calls to EditorView.update are not allowed while an update is in progress");
      let redrawn = false, attrsChanged = false, update;
      let state = this.state;
      for (let tr of transactions) {
        if (tr.startState != state)
          throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");
        state = tr.state;
      }
      if (this.destroyed) {
        this.viewState.state = state;
        return;
      }
      let focus = this.hasFocus, focusFlag = 0, dispatchFocus = null;
      if (transactions.some((tr) => tr.annotation(isFocusChange))) {
        this.inputState.notifiedFocused = focus;
        focusFlag = 1;
      } else if (focus != this.inputState.notifiedFocused) {
        this.inputState.notifiedFocused = focus;
        dispatchFocus = focusChangeTransaction(state, focus);
        if (!dispatchFocus)
          focusFlag = 1;
      }
      let pendingKey = this.observer.delayedAndroidKey, domChange = null;
      if (pendingKey) {
        this.observer.clearDelayedAndroidKey();
        domChange = this.observer.readChange();
        if (domChange && !this.state.doc.eq(state.doc) || !this.state.selection.eq(state.selection))
          domChange = null;
      } else {
        this.observer.clear();
      }
      if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases))
        return this.setState(state);
      update = ViewUpdate.create(this, state, transactions);
      update.flags |= focusFlag;
      let scrollTarget = this.viewState.scrollTarget;
      try {
        this.updateState = 2;
        for (let tr of transactions) {
          if (scrollTarget)
            scrollTarget = scrollTarget.map(tr.changes);
          if (tr.scrollIntoView) {
            let { main } = tr.state.selection;
            scrollTarget = new ScrollTarget(main.empty ? main : EditorSelection.cursor(main.head, main.head > main.anchor ? -1 : 1));
          }
          for (let e of tr.effects)
            if (e.is(scrollIntoView$1))
              scrollTarget = e.value.clip(this.state);
        }
        this.viewState.update(update, scrollTarget);
        this.bidiCache = CachedOrder.update(this.bidiCache, update.changes);
        if (!update.empty) {
          this.updatePlugins(update);
          this.inputState.update(update);
        }
        redrawn = this.docView.update(update);
        if (this.state.facet(styleModule) != this.styleModules)
          this.mountStyles();
        attrsChanged = this.updateAttrs();
        this.showAnnouncements(transactions);
        this.docView.updateSelection(redrawn, transactions.some((tr) => tr.isUserEvent("select.pointer")));
      } finally {
        this.updateState = 0;
      }
      if (update.startState.facet(theme) != update.state.facet(theme))
        this.viewState.mustMeasureContent = true;
      if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent)
        this.requestMeasure();
      if (!update.empty)
        for (let listener of this.state.facet(updateListener)) {
          try {
            listener(update);
          } catch (e) {
            logException(this.state, e, "update listener");
          }
        }
      if (dispatchFocus || domChange)
        Promise.resolve().then(() => {
          if (dispatchFocus && this.state == dispatchFocus.startState)
            this.dispatch(dispatchFocus);
          if (domChange) {
            if (!applyDOMChange(this, domChange) && pendingKey.force)
              dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);
          }
        });
    }
    setState(newState) {
      if (this.updateState != 0)
        throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");
      if (this.destroyed) {
        this.viewState.state = newState;
        return;
      }
      this.updateState = 2;
      let hadFocus = this.hasFocus;
      try {
        for (let plugin of this.plugins)
          plugin.destroy(this);
        this.viewState = new ViewState(newState);
        this.plugins = newState.facet(viewPlugin).map((spec) => new PluginInstance(spec));
        this.pluginMap.clear();
        for (let plugin of this.plugins)
          plugin.update(this);
        this.docView = new DocView(this);
        this.inputState.ensureHandlers(this.plugins);
        this.mountStyles();
        this.updateAttrs();
        this.bidiCache = [];
      } finally {
        this.updateState = 0;
      }
      if (hadFocus)
        this.focus();
      this.requestMeasure();
    }
    updatePlugins(update) {
      let prevSpecs = update.startState.facet(viewPlugin), specs = update.state.facet(viewPlugin);
      if (prevSpecs != specs) {
        let newPlugins = [];
        for (let spec of specs) {
          let found = prevSpecs.indexOf(spec);
          if (found < 0) {
            newPlugins.push(new PluginInstance(spec));
          } else {
            let plugin = this.plugins[found];
            plugin.mustUpdate = update;
            newPlugins.push(plugin);
          }
        }
        for (let plugin of this.plugins)
          if (plugin.mustUpdate != update)
            plugin.destroy(this);
        this.plugins = newPlugins;
        this.pluginMap.clear();
      } else {
        for (let p of this.plugins)
          p.mustUpdate = update;
      }
      for (let i2 = 0; i2 < this.plugins.length; i2++)
        this.plugins[i2].update(this);
      if (prevSpecs != specs)
        this.inputState.ensureHandlers(this.plugins);
    }
    measure(flush = true) {
      if (this.destroyed)
        return;
      if (this.measureScheduled > -1)
        this.win.cancelAnimationFrame(this.measureScheduled);
      if (this.observer.delayedAndroidKey) {
        this.measureScheduled = -1;
        this.requestMeasure();
        return;
      }
      this.measureScheduled = 0;
      if (flush)
        this.observer.forceFlush();
      let updated = null;
      let sDOM = this.scrollDOM, scrollTop = sDOM.scrollTop * this.scaleY;
      let { scrollAnchorPos, scrollAnchorHeight } = this.viewState;
      if (Math.abs(scrollTop - this.viewState.scrollTop) > 1)
        scrollAnchorHeight = -1;
      this.viewState.scrollAnchorHeight = -1;
      try {
        for (let i2 = 0; ; i2++) {
          if (scrollAnchorHeight < 0) {
            if (isScrolledToBottom(sDOM)) {
              scrollAnchorPos = -1;
              scrollAnchorHeight = this.viewState.heightMap.height;
            } else {
              let block = this.viewState.scrollAnchorAt(scrollTop);
              scrollAnchorPos = block.from;
              scrollAnchorHeight = block.top;
            }
          }
          this.updateState = 1;
          let changed = this.viewState.measure(this);
          if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null)
            break;
          if (i2 > 5) {
            console.warn(this.measureRequests.length ? "Measure loop restarted more than 5 times" : "Viewport failed to stabilize");
            break;
          }
          let measuring = [];
          if (!(changed & 4))
            [this.measureRequests, measuring] = [measuring, this.measureRequests];
          let measured = measuring.map((m) => {
            try {
              return m.read(this);
            } catch (e) {
              logException(this.state, e);
              return BadMeasure;
            }
          });
          let update = ViewUpdate.create(this, this.state, []), redrawn = false;
          update.flags |= changed;
          if (!updated)
            updated = update;
          else
            updated.flags |= changed;
          this.updateState = 2;
          if (!update.empty) {
            this.updatePlugins(update);
            this.inputState.update(update);
            this.updateAttrs();
            redrawn = this.docView.update(update);
          }
          for (let i3 = 0; i3 < measuring.length; i3++)
            if (measured[i3] != BadMeasure) {
              try {
                let m = measuring[i3];
                if (m.write)
                  m.write(measured[i3], this);
              } catch (e) {
                logException(this.state, e);
              }
            }
          if (redrawn)
            this.docView.updateSelection(true);
          if (!update.viewportChanged && this.measureRequests.length == 0) {
            if (this.viewState.editorHeight) {
              if (this.viewState.scrollTarget) {
                this.docView.scrollIntoView(this.viewState.scrollTarget);
                this.viewState.scrollTarget = null;
                continue;
              } else {
                let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height : this.viewState.lineBlockAt(scrollAnchorPos).top;
                let diff = newAnchorHeight - scrollAnchorHeight;
                if (diff > 1 || diff < -1) {
                  scrollTop = scrollTop + diff;
                  sDOM.scrollTop = scrollTop / this.scaleY;
                  scrollAnchorHeight = -1;
                  continue;
                }
              }
            }
            break;
          }
        }
      } finally {
        this.updateState = 0;
        this.measureScheduled = -1;
      }
      if (updated && !updated.empty)
        for (let listener of this.state.facet(updateListener))
          listener(updated);
    }
    get themeClasses() {
      return baseThemeID + " " + (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + " " + this.state.facet(theme);
    }
    updateAttrs() {
      let editorAttrs = attrsFromFacet(this, editorAttributes, {
        class: "cm-editor" + (this.hasFocus ? " cm-focused " : " ") + this.themeClasses
      });
      let contentAttrs = {
        spellcheck: "false",
        autocorrect: "off",
        autocapitalize: "off",
        translate: "no",
        contenteditable: !this.state.facet(editable) ? "false" : "true",
        class: "cm-content",
        style: `${browser.tabSize}: ${this.state.tabSize}`,
        role: "textbox",
        "aria-multiline": "true"
      };
      if (this.state.readOnly)
        contentAttrs["aria-readonly"] = "true";
      attrsFromFacet(this, contentAttributes, contentAttrs);
      let changed = this.observer.ignore(() => {
        let changedContent = updateAttrs(this.contentDOM, this.contentAttrs, contentAttrs);
        let changedEditor = updateAttrs(this.dom, this.editorAttrs, editorAttrs);
        return changedContent || changedEditor;
      });
      this.editorAttrs = editorAttrs;
      this.contentAttrs = contentAttrs;
      return changed;
    }
    showAnnouncements(trs) {
      let first = true;
      for (let tr of trs)
        for (let effect of tr.effects)
          if (effect.is(EditorView.announce)) {
            if (first)
              this.announceDOM.textContent = "";
            first = false;
            let div = this.announceDOM.appendChild(document.createElement("div"));
            div.textContent = effect.value;
          }
    }
    mountStyles() {
      this.styleModules = this.state.facet(styleModule);
      let nonce = this.state.facet(EditorView.cspNonce);
      StyleModule.mount(this.root, this.styleModules.concat(baseTheme$1$3).reverse(), nonce ? { nonce } : void 0);
    }
    readMeasured() {
      if (this.updateState == 2)
        throw new Error("Reading the editor layout isn't allowed during an update");
      if (this.updateState == 0 && this.measureScheduled > -1)
        this.measure(false);
    }
    requestMeasure(request) {
      if (this.measureScheduled < 0)
        this.measureScheduled = this.win.requestAnimationFrame(() => this.measure());
      if (request) {
        if (this.measureRequests.indexOf(request) > -1)
          return;
        if (request.key != null)
          for (let i2 = 0; i2 < this.measureRequests.length; i2++) {
            if (this.measureRequests[i2].key === request.key) {
              this.measureRequests[i2] = request;
              return;
            }
          }
        this.measureRequests.push(request);
      }
    }
    plugin(plugin) {
      let known = this.pluginMap.get(plugin);
      if (known === void 0 || known && known.spec != plugin)
        this.pluginMap.set(plugin, known = this.plugins.find((p) => p.spec == plugin) || null);
      return known && known.update(this).value;
    }
    get documentTop() {
      return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;
    }
    get documentPadding() {
      return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };
    }
    get scaleX() {
      return this.viewState.scaleX;
    }
    get scaleY() {
      return this.viewState.scaleY;
    }
    elementAtHeight(height) {
      this.readMeasured();
      return this.viewState.elementAtHeight(height);
    }
    lineBlockAtHeight(height) {
      this.readMeasured();
      return this.viewState.lineBlockAtHeight(height);
    }
    get viewportLineBlocks() {
      return this.viewState.viewportLines;
    }
    lineBlockAt(pos) {
      return this.viewState.lineBlockAt(pos);
    }
    get contentHeight() {
      return this.viewState.contentHeight;
    }
    moveByChar(start, forward, by) {
      return skipAtoms(this, start, moveByChar(this, start, forward, by));
    }
    moveByGroup(start, forward) {
      return skipAtoms(this, start, moveByChar(this, start, forward, (initial2) => byGroup(this, start.head, initial2)));
    }
    moveToLineBoundary(start, forward, includeWrap = true) {
      return moveToLineBoundary(this, start, forward, includeWrap);
    }
    moveVertically(start, forward, distance) {
      return skipAtoms(this, start, moveVertically(this, start, forward, distance));
    }
    domAtPos(pos) {
      return this.docView.domAtPos(pos);
    }
    posAtDOM(node, offset = 0) {
      return this.docView.posFromDOM(node, offset);
    }
    posAtCoords(coords, precise = true) {
      this.readMeasured();
      return posAtCoords(this, coords, precise);
    }
    coordsAtPos(pos, side = 1) {
      this.readMeasured();
      let rect = this.docView.coordsAt(pos, side);
      if (!rect || rect.left == rect.right)
        return rect;
      let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line);
      let span = order[BidiSpan.find(order, pos - line.from, -1, side)];
      return flattenRect(rect, span.dir == Direction.LTR == side > 0);
    }
    coordsForChar(pos) {
      this.readMeasured();
      return this.docView.coordsForChar(pos);
    }
    get defaultCharacterWidth() {
      return this.viewState.heightOracle.charWidth;
    }
    get defaultLineHeight() {
      return this.viewState.heightOracle.lineHeight;
    }
    get textDirection() {
      return this.viewState.defaultTextDirection;
    }
    textDirectionAt(pos) {
      let perLine = this.state.facet(perLineTextDirection);
      if (!perLine || pos < this.viewport.from || pos > this.viewport.to)
        return this.textDirection;
      this.readMeasured();
      return this.docView.textDirectionAt(pos);
    }
    get lineWrapping() {
      return this.viewState.heightOracle.lineWrapping;
    }
    bidiSpans(line) {
      if (line.length > MaxBidiLine)
        return trivialOrder(line.length);
      let dir = this.textDirectionAt(line.from), isolates;
      for (let entry of this.bidiCache) {
        if (entry.from == line.from && entry.dir == dir && (entry.fresh || isolatesEq(entry.isolates, isolates = getIsolatedRanges(this, line.from, line.to))))
          return entry.order;
      }
      if (!isolates)
        isolates = getIsolatedRanges(this, line.from, line.to);
      let order = computeOrder(line.text, dir, isolates);
      this.bidiCache.push(new CachedOrder(line.from, line.to, dir, isolates, true, order));
      return order;
    }
    get hasFocus() {
      var _a2;
      return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a2 = this.inputState) === null || _a2 === void 0 ? void 0 : _a2.lastContextMenu) > Date.now() - 3e4) && this.root.activeElement == this.contentDOM;
    }
    focus() {
      this.observer.ignore(() => {
        focusPreventScroll(this.contentDOM);
        this.docView.updateSelection();
      });
    }
    setRoot(root) {
      if (this._root != root) {
        this._root = root;
        this.observer.setWindow((root.nodeType == 9 ? root : root.ownerDocument).defaultView || window);
        this.mountStyles();
      }
    }
    destroy() {
      for (let plugin of this.plugins)
        plugin.destroy(this);
      this.plugins = [];
      this.inputState.destroy();
      this.dom.remove();
      this.observer.destroy();
      if (this.measureScheduled > -1)
        this.win.cancelAnimationFrame(this.measureScheduled);
      this.destroyed = true;
    }
    static scrollIntoView(pos, options = {}) {
      return scrollIntoView$1.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));
    }
    scrollSnapshot() {
      let { scrollTop, scrollLeft } = this.scrollDOM;
      let ref2 = this.viewState.scrollAnchorAt(scrollTop);
      return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(ref2.from), "start", "start", ref2.top - scrollTop, scrollLeft, true));
    }
    static domEventHandlers(handlers2) {
      return ViewPlugin.define(() => ({}), { eventHandlers: handlers2 });
    }
    static domEventObservers(observers2) {
      return ViewPlugin.define(() => ({}), { eventObservers: observers2 });
    }
    static theme(spec, options) {
      let prefix = StyleModule.newName();
      let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];
      if (options && options.dark)
        result.push(darkTheme.of(true));
      return result;
    }
    static baseTheme(spec) {
      return Prec.lowest(styleModule.of(buildTheme("." + baseThemeID, spec, lightDarkIDs)));
    }
    static findFromDOM(dom) {
      var _a2;
      let content2 = dom.querySelector(".cm-content");
      let cView = content2 && ContentView.get(content2) || ContentView.get(dom);
      return ((_a2 = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a2 === void 0 ? void 0 : _a2.view) || null;
    }
  }
  EditorView.styleModule = styleModule;
  EditorView.inputHandler = inputHandler$1;
  EditorView.focusChangeEffect = focusChangeEffect;
  EditorView.perLineTextDirection = perLineTextDirection;
  EditorView.exceptionSink = exceptionSink;
  EditorView.updateListener = updateListener;
  EditorView.editable = editable;
  EditorView.mouseSelectionStyle = mouseSelectionStyle;
  EditorView.dragMovesSelection = dragMovesSelection$1;
  EditorView.clickAddsSelectionRange = clickAddsSelectionRange;
  EditorView.decorations = decorations;
  EditorView.atomicRanges = atomicRanges;
  EditorView.bidiIsolatedRanges = bidiIsolatedRanges;
  EditorView.scrollMargins = scrollMargins;
  EditorView.darkTheme = darkTheme;
  EditorView.cspNonce = /* @__PURE__ */ Facet.define({ combine: (values) => values.length ? values[0] : "" });
  EditorView.contentAttributes = contentAttributes;
  EditorView.editorAttributes = editorAttributes;
  EditorView.lineWrapping = /* @__PURE__ */ EditorView.contentAttributes.of({ "class": "cm-lineWrapping" });
  EditorView.announce = /* @__PURE__ */ StateEffect.define();
  const MaxBidiLine = 4096;
  const BadMeasure = {};
  class CachedOrder {
    constructor(from, to, dir, isolates, fresh, order) {
      this.from = from;
      this.to = to;
      this.dir = dir;
      this.isolates = isolates;
      this.fresh = fresh;
      this.order = order;
    }
    static update(cache2, changes) {
      if (changes.empty && !cache2.some((c) => c.fresh))
        return cache2;
      let result = [], lastDir = cache2.length ? cache2[cache2.length - 1].dir : Direction.LTR;
      for (let i2 = Math.max(0, cache2.length - 10); i2 < cache2.length; i2++) {
        let entry = cache2[i2];
        if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))
          result.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));
      }
      return result;
    }
  }
  function attrsFromFacet(view, facet, base2) {
    for (let sources = view.state.facet(facet), i2 = sources.length - 1; i2 >= 0; i2--) {
      let source = sources[i2], value2 = typeof source == "function" ? source(view) : source;
      if (value2)
        combineAttrs(value2, base2);
    }
    return base2;
  }
  const currentPlatform = browser.mac ? "mac" : browser.windows ? "win" : browser.linux ? "linux" : "key";
  function normalizeKeyName(name2, platform) {
    const parts = name2.split(/-(?!$)/);
    let result = parts[parts.length - 1];
    if (result == "Space")
      result = " ";
    let alt, ctrl, shift2, meta2;
    for (let i2 = 0; i2 < parts.length - 1; ++i2) {
      const mod = parts[i2];
      if (/^(cmd|meta|m)$/i.test(mod))
        meta2 = true;
      else if (/^a(lt)?$/i.test(mod))
        alt = true;
      else if (/^(c|ctrl|control)$/i.test(mod))
        ctrl = true;
      else if (/^s(hift)?$/i.test(mod))
        shift2 = true;
      else if (/^mod$/i.test(mod)) {
        if (platform == "mac")
          meta2 = true;
        else
          ctrl = true;
      } else
        throw new Error("Unrecognized modifier name: " + mod);
    }
    if (alt)
      result = "Alt-" + result;
    if (ctrl)
      result = "Ctrl-" + result;
    if (meta2)
      result = "Meta-" + result;
    if (shift2)
      result = "Shift-" + result;
    return result;
  }
  function modifiers(name2, event, shift2) {
    if (event.altKey)
      name2 = "Alt-" + name2;
    if (event.ctrlKey)
      name2 = "Ctrl-" + name2;
    if (event.metaKey)
      name2 = "Meta-" + name2;
    if (shift2 !== false && event.shiftKey)
      name2 = "Shift-" + name2;
    return name2;
  }
  const handleKeyEvents = /* @__PURE__ */ Prec.default(/* @__PURE__ */ EditorView.domEventHandlers({
    keydown(event, view) {
      return runHandlers(getKeymap(view.state), event, view, "editor");
    }
  }));
  const keymap = /* @__PURE__ */ Facet.define({ enables: handleKeyEvents });
  const Keymaps = /* @__PURE__ */ new WeakMap();
  function getKeymap(state) {
    let bindings = state.facet(keymap);
    let map = Keymaps.get(bindings);
    if (!map)
      Keymaps.set(bindings, map = buildKeymap(bindings.reduce((a, b) => a.concat(b), [])));
    return map;
  }
  function runScopeHandlers(view, event, scope) {
    return runHandlers(getKeymap(view.state), event, view, scope);
  }
  let storedPrefix = null;
  const PrefixTimeout = 4e3;
  function buildKeymap(bindings, platform = currentPlatform) {
    let bound = Object.create(null);
    let isPrefix = Object.create(null);
    let checkPrefix = (name2, is) => {
      let current = isPrefix[name2];
      if (current == null)
        isPrefix[name2] = is;
      else if (current != is)
        throw new Error("Key binding " + name2 + " is used both as a regular binding and as a multi-stroke prefix");
    };
    let add2 = (scope, key, command2, preventDefault, stopPropagation) => {
      var _a2, _b;
      let scopeObj = bound[scope] || (bound[scope] = Object.create(null));
      let parts = key.split(/ (?!$)/).map((k) => normalizeKeyName(k, platform));
      for (let i2 = 1; i2 < parts.length; i2++) {
        let prefix = parts.slice(0, i2).join(" ");
        checkPrefix(prefix, true);
        if (!scopeObj[prefix])
          scopeObj[prefix] = {
            preventDefault: true,
            stopPropagation: false,
            run: [(view) => {
              let ourObj = storedPrefix = { view, prefix, scope };
              setTimeout(() => {
                if (storedPrefix == ourObj)
                  storedPrefix = null;
              }, PrefixTimeout);
              return true;
            }]
          };
      }
      let full = parts.join(" ");
      checkPrefix(full, false);
      let binding = scopeObj[full] || (scopeObj[full] = {
        preventDefault: false,
        stopPropagation: false,
        run: ((_b = (_a2 = scopeObj._any) === null || _a2 === void 0 ? void 0 : _a2.run) === null || _b === void 0 ? void 0 : _b.slice()) || []
      });
      if (command2)
        binding.run.push(command2);
      if (preventDefault)
        binding.preventDefault = true;
      if (stopPropagation)
        binding.stopPropagation = true;
    };
    for (let b of bindings) {
      let scopes = b.scope ? b.scope.split(" ") : ["editor"];
      if (b.any)
        for (let scope of scopes) {
          let scopeObj = bound[scope] || (bound[scope] = Object.create(null));
          if (!scopeObj._any)
            scopeObj._any = { preventDefault: false, stopPropagation: false, run: [] };
          for (let key in scopeObj)
            scopeObj[key].run.push(b.any);
        }
      let name2 = b[platform] || b.key;
      if (!name2)
        continue;
      for (let scope of scopes) {
        add2(scope, name2, b.run, b.preventDefault, b.stopPropagation);
        if (b.shift)
          add2(scope, "Shift-" + name2, b.shift, b.preventDefault, b.stopPropagation);
      }
    }
    return bound;
  }
  function runHandlers(map, event, view, scope) {
    let name2 = keyName(event);
    let charCode = codePointAt(name2, 0), isChar = codePointSize(charCode) == name2.length && name2 != " ";
    let prefix = "", handled = false, prevented = false, stopPropagation = false;
    if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) {
      prefix = storedPrefix.prefix + " ";
      if (modifierCodes.indexOf(event.keyCode) < 0) {
        prevented = true;
        storedPrefix = null;
      }
    }
    let ran = new Set();
    let runFor = (binding) => {
      if (binding) {
        for (let cmd2 of binding.run)
          if (!ran.has(cmd2)) {
            ran.add(cmd2);
            if (cmd2(view, event)) {
              if (binding.stopPropagation)
                stopPropagation = true;
              return true;
            }
          }
        if (binding.preventDefault) {
          if (binding.stopPropagation)
            stopPropagation = true;
          prevented = true;
        }
      }
      return false;
    };
    let scopeObj = map[scope], baseName, shiftName;
    if (scopeObj) {
      if (runFor(scopeObj[prefix + modifiers(name2, event, !isChar)])) {
        handled = true;
      } else if (isChar && (event.altKey || event.metaKey || event.ctrlKey) && !(browser.windows && event.ctrlKey && event.altKey) && (baseName = base[event.keyCode]) && baseName != name2) {
        if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) {
          handled = true;
        } else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name2 && shiftName != baseName && runFor(scopeObj[prefix + modifiers(shiftName, event, false)])) {
          handled = true;
        }
      } else if (isChar && event.shiftKey && runFor(scopeObj[prefix + modifiers(name2, event, true)])) {
        handled = true;
      }
      if (!handled && runFor(scopeObj._any))
        handled = true;
    }
    if (prevented)
      handled = true;
    if (handled && stopPropagation)
      event.stopPropagation();
    return handled;
  }
  class RectangleMarker {
    constructor(className, left, top2, width, height) {
      this.className = className;
      this.left = left;
      this.top = top2;
      this.width = width;
      this.height = height;
    }
    draw() {
      let elt = document.createElement("div");
      elt.className = this.className;
      this.adjust(elt);
      return elt;
    }
    update(elt, prev) {
      if (prev.className != this.className)
        return false;
      this.adjust(elt);
      return true;
    }
    adjust(elt) {
      elt.style.left = this.left + "px";
      elt.style.top = this.top + "px";
      if (this.width != null)
        elt.style.width = this.width + "px";
      elt.style.height = this.height + "px";
    }
    eq(p) {
      return this.left == p.left && this.top == p.top && this.width == p.width && this.height == p.height && this.className == p.className;
    }
    static forRange(view, className, range) {
      if (range.empty) {
        let pos = view.coordsAtPos(range.head, range.assoc || 1);
        if (!pos)
          return [];
        let base2 = getBase(view);
        return [new RectangleMarker(className, pos.left - base2.left, pos.top - base2.top, null, pos.bottom - pos.top)];
      } else {
        return rectanglesForRange(view, className, range);
      }
    }
  }
  function getBase(view) {
    let rect = view.scrollDOM.getBoundingClientRect();
    let left = view.textDirection == Direction.LTR ? rect.left : rect.right - view.scrollDOM.clientWidth * view.scaleX;
    return { left: left - view.scrollDOM.scrollLeft * view.scaleX, top: rect.top - view.scrollDOM.scrollTop * view.scaleY };
  }
  function wrappedLine(view, pos, inside2) {
    let range = EditorSelection.cursor(pos);
    return {
      from: Math.max(inside2.from, view.moveToLineBoundary(range, false, true).from),
      to: Math.min(inside2.to, view.moveToLineBoundary(range, true, true).from),
      type: BlockType.Text
    };
  }
  function rectanglesForRange(view, className, range) {
    if (range.to <= view.viewport.from || range.from >= view.viewport.to)
      return [];
    let from = Math.max(range.from, view.viewport.from), to = Math.min(range.to, view.viewport.to);
    let ltr = view.textDirection == Direction.LTR;
    let content2 = view.contentDOM, contentRect = content2.getBoundingClientRect(), base2 = getBase(view);
    let lineElt = content2.querySelector(".cm-line"), lineStyle = lineElt && window.getComputedStyle(lineElt);
    let leftSide = contentRect.left + (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);
    let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);
    let startBlock = blockAt(view, from), endBlock = blockAt(view, to);
    let visualStart = startBlock.type == BlockType.Text ? startBlock : null;
    let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;
    if (visualStart && (view.lineWrapping || startBlock.widgetLineBreaks))
      visualStart = wrappedLine(view, from, visualStart);
    if (visualEnd && (view.lineWrapping || endBlock.widgetLineBreaks))
      visualEnd = wrappedLine(view, to, visualEnd);
    if (visualStart && visualEnd && visualStart.from == visualEnd.from) {
      return pieces(drawForLine(range.from, range.to, visualStart));
    } else {
      let top2 = visualStart ? drawForLine(range.from, null, visualStart) : drawForWidget(startBlock, false);
      let bottom = visualEnd ? drawForLine(null, range.to, visualEnd) : drawForWidget(endBlock, true);
      let between = [];
      if ((visualStart || startBlock).to < (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) || startBlock.widgetLineBreaks > 1 && top2.bottom + view.defaultLineHeight / 2 < bottom.top)
        between.push(piece(leftSide, top2.bottom, rightSide, bottom.top));
      else if (top2.bottom < bottom.top && view.elementAtHeight((top2.bottom + bottom.top) / 2).type == BlockType.Text)
        top2.bottom = bottom.top = (top2.bottom + bottom.top) / 2;
      return pieces(top2).concat(between).concat(pieces(bottom));
    }
    function piece(left, top2, right, bottom) {
      return new RectangleMarker(className, left - base2.left, top2 - base2.top - 0.01, right - left, bottom - top2 + 0.01);
    }
    function pieces({ top: top2, bottom, horizontal }) {
      let pieces2 = [];
      for (let i2 = 0; i2 < horizontal.length; i2 += 2)
        pieces2.push(piece(horizontal[i2], top2, horizontal[i2 + 1], bottom));
      return pieces2;
    }
    function drawForLine(from2, to2, line) {
      let top2 = 1e9, bottom = -1e9, horizontal = [];
      function addSpan(from3, fromOpen, to3, toOpen, dir) {
        let fromCoords = view.coordsAtPos(from3, from3 == line.to ? -2 : 2);
        let toCoords = view.coordsAtPos(to3, to3 == line.from ? 2 : -2);
        if (!fromCoords || !toCoords)
          return;
        top2 = Math.min(fromCoords.top, toCoords.top, top2);
        bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);
        if (dir == Direction.LTR)
          horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);
        else
          horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);
      }
      let start = from2 !== null && from2 !== void 0 ? from2 : line.from, end = to2 !== null && to2 !== void 0 ? to2 : line.to;
      for (let r of view.visibleRanges)
        if (r.to > start && r.from < end) {
          for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end); ; ) {
            let docLine = view.state.doc.lineAt(pos);
            for (let span of view.bidiSpans(docLine)) {
              let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;
              if (spanFrom >= endPos)
                break;
              if (spanTo > pos)
                addSpan(Math.max(spanFrom, pos), from2 == null && spanFrom <= start, Math.min(spanTo, endPos), to2 == null && spanTo >= end, span.dir);
            }
            pos = docLine.to + 1;
            if (pos >= endPos)
              break;
          }
        }
      if (horizontal.length == 0)
        addSpan(start, from2 == null, end, to2 == null, view.textDirection);
      return { top: top2, bottom, horizontal };
    }
    function drawForWidget(block, top2) {
      let y = contentRect.top + (top2 ? block.top : block.bottom);
      return { top: y, bottom: y, horizontal: [] };
    }
  }
  function sameMarker(a, b) {
    return a.constructor == b.constructor && a.eq(b);
  }
  class LayerView {
    constructor(view, layer2) {
      this.view = view;
      this.layer = layer2;
      this.drawn = [];
      this.scaleX = 1;
      this.scaleY = 1;
      this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) };
      this.dom = view.scrollDOM.appendChild(document.createElement("div"));
      this.dom.classList.add("cm-layer");
      if (layer2.above)
        this.dom.classList.add("cm-layer-above");
      if (layer2.class)
        this.dom.classList.add(layer2.class);
      this.scale();
      this.dom.setAttribute("aria-hidden", "true");
      this.setOrder(view.state);
      view.requestMeasure(this.measureReq);
      if (layer2.mount)
        layer2.mount(this.dom, view);
    }
    update(update) {
      if (update.startState.facet(layerOrder) != update.state.facet(layerOrder))
        this.setOrder(update.state);
      if (this.layer.update(update, this.dom) || update.geometryChanged) {
        this.scale();
        update.view.requestMeasure(this.measureReq);
      }
    }
    setOrder(state) {
      let pos = 0, order = state.facet(layerOrder);
      while (pos < order.length && order[pos] != this.layer)
        pos++;
      this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - pos);
    }
    measure() {
      return this.layer.markers(this.view);
    }
    scale() {
      let { scaleX, scaleY } = this.view;
      if (scaleX != this.scaleX || scaleY != this.scaleY) {
        this.scaleX = scaleX;
        this.scaleY = scaleY;
        this.dom.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;
      }
    }
    draw(markers) {
      if (markers.length != this.drawn.length || markers.some((p, i2) => !sameMarker(p, this.drawn[i2]))) {
        let old = this.dom.firstChild, oldI = 0;
        for (let marker of markers) {
          if (marker.update && old && marker.constructor && this.drawn[oldI].constructor && marker.update(old, this.drawn[oldI])) {
            old = old.nextSibling;
            oldI++;
          } else {
            this.dom.insertBefore(marker.draw(), old);
          }
        }
        while (old) {
          let next = old.nextSibling;
          old.remove();
          old = next;
        }
        this.drawn = markers;
      }
    }
    destroy() {
      if (this.layer.destroy)
        this.layer.destroy(this.dom, this.view);
      this.dom.remove();
    }
  }
  const layerOrder = /* @__PURE__ */ Facet.define();
  function layer(config2) {
    return [
      ViewPlugin.define((v) => new LayerView(v, config2)),
      layerOrder.of(config2)
    ];
  }
  const CanHidePrimary = !browser.ios;
  const selectionConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      return combineConfig(configs, {
        cursorBlinkRate: 1200,
        drawRangeCursor: true
      }, {
        cursorBlinkRate: (a, b) => Math.min(a, b),
        drawRangeCursor: (a, b) => a || b
      });
    }
  });
  function drawSelection(config2 = {}) {
    return [
      selectionConfig.of(config2),
      cursorLayer,
      selectionLayer,
      hideNativeSelection,
      nativeSelectionHidden.of(true)
    ];
  }
  function configChanged(update) {
    return update.startState.facet(selectionConfig) != update.state.facet(selectionConfig);
  }
  const cursorLayer = /* @__PURE__ */ layer({
    above: true,
    markers(view) {
      let { state } = view, conf = state.facet(selectionConfig);
      let cursors = [];
      for (let r of state.selection.ranges) {
        let prim = r == state.selection.main;
        if (r.empty ? !prim || CanHidePrimary : conf.drawRangeCursor) {
          let className = prim ? "cm-cursor cm-cursor-primary" : "cm-cursor cm-cursor-secondary";
          let cursor = r.empty ? r : EditorSelection.cursor(r.head, r.head > r.anchor ? -1 : 1);
          for (let piece of RectangleMarker.forRange(view, className, cursor))
            cursors.push(piece);
        }
      }
      return cursors;
    },
    update(update, dom) {
      if (update.transactions.some((tr) => tr.selection))
        dom.style.animationName = dom.style.animationName == "cm-blink" ? "cm-blink2" : "cm-blink";
      let confChange = configChanged(update);
      if (confChange)
        setBlinkRate(update.state, dom);
      return update.docChanged || update.selectionSet || confChange;
    },
    mount(dom, view) {
      setBlinkRate(view.state, dom);
    },
    class: "cm-cursorLayer"
  });
  function setBlinkRate(state, dom) {
    dom.style.animationDuration = state.facet(selectionConfig).cursorBlinkRate + "ms";
  }
  const selectionLayer = /* @__PURE__ */ layer({
    above: false,
    markers(view) {
      return view.state.selection.ranges.map((r) => r.empty ? [] : RectangleMarker.forRange(view, "cm-selectionBackground", r)).reduce((a, b) => a.concat(b));
    },
    update(update, dom) {
      return update.docChanged || update.selectionSet || update.viewportChanged || configChanged(update);
    },
    class: "cm-selectionLayer"
  });
  const themeSpec = {
    ".cm-line": {
      "& ::selection": { backgroundColor: "transparent !important" },
      "&::selection": { backgroundColor: "transparent !important" }
    }
  };
  if (CanHidePrimary)
    themeSpec[".cm-line"].caretColor = "transparent !important";
  const hideNativeSelection = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ EditorView.theme(themeSpec));
  const setDropCursorPos = /* @__PURE__ */ StateEffect.define({
    map(pos, mapping) {
      return pos == null ? null : mapping.mapPos(pos);
    }
  });
  const dropCursorPos = /* @__PURE__ */ StateField.define({
    create() {
      return null;
    },
    update(pos, tr) {
      if (pos != null)
        pos = tr.changes.mapPos(pos);
      return tr.effects.reduce((pos2, e) => e.is(setDropCursorPos) ? e.value : pos2, pos);
    }
  });
  const drawDropCursor = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.cursor = null;
      this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) };
    }
    update(update) {
      var _a2;
      let cursorPos = update.state.field(dropCursorPos);
      if (cursorPos == null) {
        if (this.cursor != null) {
          (_a2 = this.cursor) === null || _a2 === void 0 ? void 0 : _a2.remove();
          this.cursor = null;
        }
      } else {
        if (!this.cursor) {
          this.cursor = this.view.scrollDOM.appendChild(document.createElement("div"));
          this.cursor.className = "cm-dropCursor";
        }
        if (update.startState.field(dropCursorPos) != cursorPos || update.docChanged || update.geometryChanged)
          this.view.requestMeasure(this.measureReq);
      }
    }
    readPos() {
      let { view } = this;
      let pos = view.state.field(dropCursorPos);
      let rect = pos != null && view.coordsAtPos(pos);
      if (!rect)
        return null;
      let outer = view.scrollDOM.getBoundingClientRect();
      return {
        left: rect.left - outer.left + view.scrollDOM.scrollLeft * view.scaleX,
        top: rect.top - outer.top + view.scrollDOM.scrollTop * view.scaleY,
        height: rect.bottom - rect.top
      };
    }
    drawCursor(pos) {
      if (this.cursor) {
        let { scaleX, scaleY } = this.view;
        if (pos) {
          this.cursor.style.left = pos.left / scaleX + "px";
          this.cursor.style.top = pos.top / scaleY + "px";
          this.cursor.style.height = pos.height / scaleY + "px";
        } else {
          this.cursor.style.left = "-100000px";
        }
      }
    }
    destroy() {
      if (this.cursor)
        this.cursor.remove();
    }
    setDropPos(pos) {
      if (this.view.state.field(dropCursorPos) != pos)
        this.view.dispatch({ effects: setDropCursorPos.of(pos) });
    }
  }, {
    eventObservers: {
      dragover(event) {
        this.setDropPos(this.view.posAtCoords({ x: event.clientX, y: event.clientY }));
      },
      dragleave(event) {
        if (event.target == this.view.contentDOM || !this.view.contentDOM.contains(event.relatedTarget))
          this.setDropPos(null);
      },
      dragend() {
        this.setDropPos(null);
      },
      drop() {
        this.setDropPos(null);
      }
    }
  });
  function dropCursor() {
    return [dropCursorPos, drawDropCursor];
  }
  function iterMatches(doc2, re, from, to, f) {
    re.lastIndex = 0;
    for (let cursor = doc2.iterRange(from, to), pos = from, m; !cursor.next().done; pos += cursor.value.length) {
      if (!cursor.lineBreak)
        while (m = re.exec(cursor.value))
          f(pos + m.index, m);
    }
  }
  function matchRanges(view, maxLength) {
    let visible = view.visibleRanges;
    if (visible.length == 1 && visible[0].from == view.viewport.from && visible[0].to == view.viewport.to)
      return visible;
    let result = [];
    for (let { from, to } of visible) {
      from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);
      to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);
      if (result.length && result[result.length - 1].to >= from)
        result[result.length - 1].to = to;
      else
        result.push({ from, to });
    }
    return result;
  }
  class MatchDecorator {
    constructor(config2) {
      const { regexp, decoration, decorate, boundary, maxLength = 1e3 } = config2;
      if (!regexp.global)
        throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");
      this.regexp = regexp;
      if (decorate) {
        this.addMatch = (match, view, from, add2) => decorate(add2, from, from + match[0].length, match, view);
      } else if (typeof decoration == "function") {
        this.addMatch = (match, view, from, add2) => {
          let deco = decoration(match, view, from);
          if (deco)
            add2(from, from + match[0].length, deco);
        };
      } else if (decoration) {
        this.addMatch = (match, _view, from, add2) => add2(from, from + match[0].length, decoration);
      } else {
        throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");
      }
      this.boundary = boundary;
      this.maxLength = maxLength;
    }
    createDeco(view) {
      let build = new RangeSetBuilder(), add2 = build.add.bind(build);
      for (let { from, to } of matchRanges(view, this.maxLength))
        iterMatches(view.state.doc, this.regexp, from, to, (from2, m) => this.addMatch(m, view, from2, add2));
      return build.finish();
    }
    updateDeco(update, deco) {
      let changeFrom = 1e9, changeTo = -1;
      if (update.docChanged)
        update.changes.iterChanges((_f, _t, from, to) => {
          if (to > update.view.viewport.from && from < update.view.viewport.to) {
            changeFrom = Math.min(from, changeFrom);
            changeTo = Math.max(to, changeTo);
          }
        });
      if (update.viewportChanged || changeTo - changeFrom > 1e3)
        return this.createDeco(update.view);
      if (changeTo > -1)
        return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);
      return deco;
    }
    updateRange(view, deco, updateFrom, updateTo) {
      for (let r of view.visibleRanges) {
        let from = Math.max(r.from, updateFrom), to = Math.min(r.to, updateTo);
        if (to > from) {
          let fromLine = view.state.doc.lineAt(from), toLine = fromLine.to < to ? view.state.doc.lineAt(to) : fromLine;
          let start = Math.max(r.from, fromLine.from), end = Math.min(r.to, toLine.to);
          if (this.boundary) {
            for (; from > fromLine.from; from--)
              if (this.boundary.test(fromLine.text[from - 1 - fromLine.from])) {
                start = from;
                break;
              }
            for (; to < toLine.to; to++)
              if (this.boundary.test(toLine.text[to - toLine.from])) {
                end = to;
                break;
              }
          }
          let ranges = [], m;
          let add2 = (from2, to2, deco2) => ranges.push(deco2.range(from2, to2));
          if (fromLine == toLine) {
            this.regexp.lastIndex = start - fromLine.from;
            while ((m = this.regexp.exec(fromLine.text)) && m.index < end - fromLine.from)
              this.addMatch(m, view, m.index + fromLine.from, add2);
          } else {
            iterMatches(view.state.doc, this.regexp, start, end, (from2, m2) => this.addMatch(m2, view, from2, add2));
          }
          deco = deco.update({ filterFrom: start, filterTo: end, filter: (from2, to2) => from2 < start || to2 > end, add: ranges });
        }
      }
      return deco;
    }
  }
  const UnicodeRegexpSupport = /x/.unicode != null ? "gu" : "g";
  const Specials = /* @__PURE__ */ new RegExp("[\0-\b\n-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]", UnicodeRegexpSupport);
  const Names = {
    0: "null",
    7: "bell",
    8: "backspace",
    10: "newline",
    11: "vertical tab",
    13: "carriage return",
    27: "escape",
    8203: "zero width space",
    8204: "zero width non-joiner",
    8205: "zero width joiner",
    8206: "left-to-right mark",
    8207: "right-to-left mark",
    8232: "line separator",
    8237: "left-to-right override",
    8238: "right-to-left override",
    8294: "left-to-right isolate",
    8295: "right-to-left isolate",
    8297: "pop directional isolate",
    8233: "paragraph separator",
    65279: "zero width no-break space",
    65532: "object replacement"
  };
  let _supportsTabSize = null;
  function supportsTabSize() {
    var _a2;
    if (_supportsTabSize == null && typeof document != "undefined" && document.body) {
      let styles = document.body.style;
      _supportsTabSize = ((_a2 = styles.tabSize) !== null && _a2 !== void 0 ? _a2 : styles.MozTabSize) != null;
    }
    return _supportsTabSize || false;
  }
  const specialCharConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      let config2 = combineConfig(configs, {
        render: null,
        specialChars: Specials,
        addSpecialChars: null
      });
      if (config2.replaceTabs = !supportsTabSize())
        config2.specialChars = new RegExp("	|" + config2.specialChars.source, UnicodeRegexpSupport);
      if (config2.addSpecialChars)
        config2.specialChars = new RegExp(config2.specialChars.source + "|" + config2.addSpecialChars.source, UnicodeRegexpSupport);
      return config2;
    }
  });
  function highlightSpecialChars(config2 = {}) {
    return [specialCharConfig.of(config2), specialCharPlugin()];
  }
  let _plugin = null;
  function specialCharPlugin() {
    return _plugin || (_plugin = ViewPlugin.fromClass(class {
      constructor(view) {
        this.view = view;
        this.decorations = Decoration.none;
        this.decorationCache = Object.create(null);
        this.decorator = this.makeDecorator(view.state.facet(specialCharConfig));
        this.decorations = this.decorator.createDeco(view);
      }
      makeDecorator(conf) {
        return new MatchDecorator({
          regexp: conf.specialChars,
          decoration: (m, view, pos) => {
            let { doc: doc2 } = view.state;
            let code2 = codePointAt(m[0], 0);
            if (code2 == 9) {
              let line = doc2.lineAt(pos);
              let size = view.state.tabSize, col = countColumn(line.text, size, pos - line.from);
              return Decoration.replace({
                widget: new TabWidget((size - col % size) * this.view.defaultCharacterWidth / this.view.scaleX)
              });
            }
            return this.decorationCache[code2] || (this.decorationCache[code2] = Decoration.replace({ widget: new SpecialCharWidget(conf, code2) }));
          },
          boundary: conf.replaceTabs ? void 0 : /[^]/
        });
      }
      update(update) {
        let conf = update.state.facet(specialCharConfig);
        if (update.startState.facet(specialCharConfig) != conf) {
          this.decorator = this.makeDecorator(conf);
          this.decorations = this.decorator.createDeco(update.view);
        } else {
          this.decorations = this.decorator.updateDeco(update, this.decorations);
        }
      }
    }, {
      decorations: (v) => v.decorations
    }));
  }
  const DefaultPlaceholder = "\u2022";
  function placeholder$1(code2) {
    if (code2 >= 32)
      return DefaultPlaceholder;
    if (code2 == 10)
      return "\u2424";
    return String.fromCharCode(9216 + code2);
  }
  class SpecialCharWidget extends WidgetType {
    constructor(options, code2) {
      super();
      this.options = options;
      this.code = code2;
    }
    eq(other) {
      return other.code == this.code;
    }
    toDOM(view) {
      let ph = placeholder$1(this.code);
      let desc = view.state.phrase("Control character") + " " + (Names[this.code] || "0x" + this.code.toString(16));
      let custom = this.options.render && this.options.render(this.code, desc, ph);
      if (custom)
        return custom;
      let span = document.createElement("span");
      span.textContent = ph;
      span.title = desc;
      span.setAttribute("aria-label", desc);
      span.className = "cm-specialChar";
      return span;
    }
    ignoreEvent() {
      return false;
    }
  }
  class TabWidget extends WidgetType {
    constructor(width) {
      super();
      this.width = width;
    }
    eq(other) {
      return other.width == this.width;
    }
    toDOM() {
      let span = document.createElement("span");
      span.textContent = "	";
      span.className = "cm-tab";
      span.style.width = this.width + "px";
      return span;
    }
    ignoreEvent() {
      return false;
    }
  }
  function highlightActiveLine() {
    return activeLineHighlighter;
  }
  const lineDeco = /* @__PURE__ */ Decoration.line({ class: "cm-activeLine" });
  const activeLineHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.decorations = this.getDeco(view);
    }
    update(update) {
      if (update.docChanged || update.selectionSet)
        this.decorations = this.getDeco(update.view);
    }
    getDeco(view) {
      let lastLineStart = -1, deco = [];
      for (let r of view.state.selection.ranges) {
        let line = view.lineBlockAt(r.head);
        if (line.from > lastLineStart) {
          deco.push(lineDeco.range(line.from));
          lastLineStart = line.from;
        }
      }
      return Decoration.set(deco);
    }
  }, {
    decorations: (v) => v.decorations
  });
  const MaxOff = 2e3;
  function rectangleFor(state, a, b) {
    let startLine = Math.min(a.line, b.line), endLine = Math.max(a.line, b.line);
    let ranges = [];
    if (a.off > MaxOff || b.off > MaxOff || a.col < 0 || b.col < 0) {
      let startOff = Math.min(a.off, b.off), endOff = Math.max(a.off, b.off);
      for (let i2 = startLine; i2 <= endLine; i2++) {
        let line = state.doc.line(i2);
        if (line.length <= endOff)
          ranges.push(EditorSelection.range(line.from + startOff, line.to + endOff));
      }
    } else {
      let startCol = Math.min(a.col, b.col), endCol = Math.max(a.col, b.col);
      for (let i2 = startLine; i2 <= endLine; i2++) {
        let line = state.doc.line(i2);
        let start = findColumn(line.text, startCol, state.tabSize, true);
        if (start < 0) {
          ranges.push(EditorSelection.cursor(line.to));
        } else {
          let end = findColumn(line.text, endCol, state.tabSize);
          ranges.push(EditorSelection.range(line.from + start, line.from + end));
        }
      }
    }
    return ranges;
  }
  function absoluteColumn(view, x) {
    let ref2 = view.coordsAtPos(view.viewport.from);
    return ref2 ? Math.round(Math.abs((ref2.left - x) / view.defaultCharacterWidth)) : -1;
  }
  function getPos(view, event) {
    let offset = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);
    let line = view.state.doc.lineAt(offset), off2 = offset - line.from;
    let col = off2 > MaxOff ? -1 : off2 == line.length ? absoluteColumn(view, event.clientX) : countColumn(line.text, view.state.tabSize, offset - line.from);
    return { line: line.number, col, off: off2 };
  }
  function rectangleSelectionStyle(view, event) {
    let start = getPos(view, event), startSel = view.state.selection;
    if (!start)
      return null;
    return {
      update(update) {
        if (update.docChanged) {
          let newStart = update.changes.mapPos(update.startState.doc.line(start.line).from);
          let newLine = update.state.doc.lineAt(newStart);
          start = { line: newLine.number, col: start.col, off: Math.min(start.off, newLine.length) };
          startSel = startSel.map(update.changes);
        }
      },
      get(event2, _extend, multiple) {
        let cur2 = getPos(view, event2);
        if (!cur2)
          return startSel;
        let ranges = rectangleFor(view.state, start, cur2);
        if (!ranges.length)
          return startSel;
        if (multiple)
          return EditorSelection.create(ranges.concat(startSel.ranges));
        else
          return EditorSelection.create(ranges);
      }
    };
  }
  function rectangularSelection(options) {
    let filter = (options === null || options === void 0 ? void 0 : options.eventFilter) || ((e) => e.altKey && e.button == 0);
    return EditorView.mouseSelectionStyle.of((view, event) => filter(event) ? rectangleSelectionStyle(view, event) : null);
  }
  const keys = {
    Alt: [18, (e) => !!e.altKey],
    Control: [17, (e) => !!e.ctrlKey],
    Shift: [16, (e) => !!e.shiftKey],
    Meta: [91, (e) => !!e.metaKey]
  };
  const showCrosshair = { style: "cursor: crosshair" };
  function crosshairCursor(options = {}) {
    let [code2, getter] = keys[options.key || "Alt"];
    let plugin = ViewPlugin.fromClass(class {
      constructor(view) {
        this.view = view;
        this.isDown = false;
      }
      set(isDown) {
        if (this.isDown != isDown) {
          this.isDown = isDown;
          this.view.update([]);
        }
      }
    }, {
      eventObservers: {
        keydown(e) {
          this.set(e.keyCode == code2 || getter(e));
        },
        keyup(e) {
          if (e.keyCode == code2 || !getter(e))
            this.set(false);
        },
        mousemove(e) {
          this.set(getter(e));
        }
      }
    });
    return [
      plugin,
      EditorView.contentAttributes.of((view) => {
        var _a2;
        return ((_a2 = view.plugin(plugin)) === null || _a2 === void 0 ? void 0 : _a2.isDown) ? showCrosshair : null;
      })
    ];
  }
  const Outside = "-10000px";
  class TooltipViewManager {
    constructor(view, facet, createTooltipView) {
      this.facet = facet;
      this.createTooltipView = createTooltipView;
      this.input = view.state.facet(facet);
      this.tooltips = this.input.filter((t2) => t2);
      this.tooltipViews = this.tooltips.map(createTooltipView);
    }
    update(update, above) {
      var _a2;
      let input = update.state.facet(this.facet);
      let tooltips = input.filter((x) => x);
      if (input === this.input) {
        for (let t2 of this.tooltipViews)
          if (t2.update)
            t2.update(update);
        return false;
      }
      let tooltipViews = [], newAbove = above ? [] : null;
      for (let i2 = 0; i2 < tooltips.length; i2++) {
        let tip = tooltips[i2], known = -1;
        if (!tip)
          continue;
        for (let i3 = 0; i3 < this.tooltips.length; i3++) {
          let other = this.tooltips[i3];
          if (other && other.create == tip.create)
            known = i3;
        }
        if (known < 0) {
          tooltipViews[i2] = this.createTooltipView(tip);
          if (newAbove)
            newAbove[i2] = !!tip.above;
        } else {
          let tooltipView = tooltipViews[i2] = this.tooltipViews[known];
          if (newAbove)
            newAbove[i2] = above[known];
          if (tooltipView.update)
            tooltipView.update(update);
        }
      }
      for (let t2 of this.tooltipViews)
        if (tooltipViews.indexOf(t2) < 0) {
          t2.dom.remove();
          (_a2 = t2.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t2);
        }
      if (above) {
        newAbove.forEach((val, i2) => above[i2] = val);
        above.length = newAbove.length;
      }
      this.input = input;
      this.tooltips = tooltips;
      this.tooltipViews = tooltipViews;
      return true;
    }
  }
  function windowSpace(view) {
    let { win } = view;
    return { top: 0, left: 0, bottom: win.innerHeight, right: win.innerWidth };
  }
  const tooltipConfig = /* @__PURE__ */ Facet.define({
    combine: (values) => {
      var _a2, _b, _c;
      return {
        position: browser.ios ? "absolute" : ((_a2 = values.find((conf) => conf.position)) === null || _a2 === void 0 ? void 0 : _a2.position) || "fixed",
        parent: ((_b = values.find((conf) => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null,
        tooltipSpace: ((_c = values.find((conf) => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace
      };
    }
  });
  const knownHeight = /* @__PURE__ */ new WeakMap();
  const tooltipPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.above = [];
      this.inView = true;
      this.madeAbsolute = false;
      this.lastTransaction = 0;
      this.measureTimeout = -1;
      let config2 = view.state.facet(tooltipConfig);
      this.position = config2.position;
      this.parent = config2.parent;
      this.classes = view.themeClasses;
      this.createContainer();
      this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this };
      this.manager = new TooltipViewManager(view, showTooltip, (t2) => this.createTooltip(t2));
      this.intersectionObserver = typeof IntersectionObserver == "function" ? new IntersectionObserver((entries) => {
        if (Date.now() > this.lastTransaction - 50 && entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1)
          this.measureSoon();
      }, { threshold: [1] }) : null;
      this.observeIntersection();
      view.win.addEventListener("resize", this.measureSoon = this.measureSoon.bind(this));
      this.maybeMeasure();
    }
    createContainer() {
      if (this.parent) {
        this.container = document.createElement("div");
        this.container.style.position = "relative";
        this.container.className = this.view.themeClasses;
        this.parent.appendChild(this.container);
      } else {
        this.container = this.view.dom;
      }
    }
    observeIntersection() {
      if (this.intersectionObserver) {
        this.intersectionObserver.disconnect();
        for (let tooltip of this.manager.tooltipViews)
          this.intersectionObserver.observe(tooltip.dom);
      }
    }
    measureSoon() {
      if (this.measureTimeout < 0)
        this.measureTimeout = setTimeout(() => {
          this.measureTimeout = -1;
          this.maybeMeasure();
        }, 50);
    }
    update(update) {
      if (update.transactions.length)
        this.lastTransaction = Date.now();
      let updated = this.manager.update(update, this.above);
      if (updated)
        this.observeIntersection();
      let shouldMeasure = updated || update.geometryChanged;
      let newConfig = update.state.facet(tooltipConfig);
      if (newConfig.position != this.position && !this.madeAbsolute) {
        this.position = newConfig.position;
        for (let t2 of this.manager.tooltipViews)
          t2.dom.style.position = this.position;
        shouldMeasure = true;
      }
      if (newConfig.parent != this.parent) {
        if (this.parent)
          this.container.remove();
        this.parent = newConfig.parent;
        this.createContainer();
        for (let t2 of this.manager.tooltipViews)
          this.container.appendChild(t2.dom);
        shouldMeasure = true;
      } else if (this.parent && this.view.themeClasses != this.classes) {
        this.classes = this.container.className = this.view.themeClasses;
      }
      if (shouldMeasure)
        this.maybeMeasure();
    }
    createTooltip(tooltip) {
      let tooltipView = tooltip.create(this.view);
      tooltipView.dom.classList.add("cm-tooltip");
      if (tooltip.arrow && !tooltipView.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")) {
        let arrow = document.createElement("div");
        arrow.className = "cm-tooltip-arrow";
        tooltipView.dom.appendChild(arrow);
      }
      tooltipView.dom.style.position = this.position;
      tooltipView.dom.style.top = Outside;
      tooltipView.dom.style.left = "0px";
      this.container.appendChild(tooltipView.dom);
      if (tooltipView.mount)
        tooltipView.mount(this.view);
      return tooltipView;
    }
    destroy() {
      var _a2, _b;
      this.view.win.removeEventListener("resize", this.measureSoon);
      for (let tooltipView of this.manager.tooltipViews) {
        tooltipView.dom.remove();
        (_a2 = tooltipView.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(tooltipView);
      }
      if (this.parent)
        this.container.remove();
      (_b = this.intersectionObserver) === null || _b === void 0 ? void 0 : _b.disconnect();
      clearTimeout(this.measureTimeout);
    }
    readMeasure() {
      let editor = this.view.dom.getBoundingClientRect();
      let scaleX = 1, scaleY = 1, makeAbsolute = false;
      if (this.position == "fixed" && this.manager.tooltipViews.length) {
        let { dom } = this.manager.tooltipViews[0];
        if (browser.gecko) {
          makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;
        } else {
          if (this.view.scaleX != 1 || this.view.scaleY != 1) {
            makeAbsolute = true;
          } else if (dom.style.top == Outside && dom.style.left == "0px") {
            let rect = dom.getBoundingClientRect();
            makeAbsolute = Math.abs(rect.top + 1e4) > 1 || Math.abs(rect.left) > 1;
          }
        }
      }
      if (makeAbsolute || this.position == "absolute") {
        if (this.parent) {
          let rect = this.parent.getBoundingClientRect();
          if (rect.width && rect.height) {
            scaleX = rect.width / this.parent.offsetWidth;
            scaleY = rect.height / this.parent.offsetHeight;
          }
        } else {
          ({ scaleX, scaleY } = this.view.viewState);
        }
      }
      return {
        editor,
        parent: this.parent ? this.container.getBoundingClientRect() : editor,
        pos: this.manager.tooltips.map((t2, i2) => {
          let tv = this.manager.tooltipViews[i2];
          return tv.getCoords ? tv.getCoords(t2.pos) : this.view.coordsAtPos(t2.pos);
        }),
        size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),
        space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),
        scaleX,
        scaleY,
        makeAbsolute
      };
    }
    writeMeasure(measured) {
      var _a2;
      if (measured.makeAbsolute) {
        this.madeAbsolute = true;
        this.position = "absolute";
        for (let t2 of this.manager.tooltipViews)
          t2.dom.style.position = "absolute";
      }
      let { editor, space: space2, scaleX, scaleY } = measured;
      let others = [];
      for (let i2 = 0; i2 < this.manager.tooltips.length; i2++) {
        let tooltip = this.manager.tooltips[i2], tView = this.manager.tooltipViews[i2], { dom } = tView;
        let pos = measured.pos[i2], size = measured.size[i2];
        if (!pos || pos.bottom <= Math.max(editor.top, space2.top) || pos.top >= Math.min(editor.bottom, space2.bottom) || pos.right < Math.max(editor.left, space2.left) - 0.1 || pos.left > Math.min(editor.right, space2.right) + 0.1) {
          dom.style.top = Outside;
          continue;
        }
        let arrow = tooltip.arrow ? tView.dom.querySelector(".cm-tooltip-arrow") : null;
        let arrowHeight = arrow ? 7 : 0;
        let width = size.right - size.left, height = (_a2 = knownHeight.get(tView)) !== null && _a2 !== void 0 ? _a2 : size.bottom - size.top;
        let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR;
        let left = size.width > space2.right - space2.left ? ltr ? space2.left : space2.right - size.width : ltr ? Math.min(pos.left - (arrow ? 14 : 0) + offset.x, space2.right - width) : Math.max(space2.left, pos.left - width + (arrow ? 14 : 0) - offset.x);
        let above = this.above[i2];
        if (!tooltip.strictSide && (above ? pos.top - (size.bottom - size.top) - offset.y < space2.top : pos.bottom + (size.bottom - size.top) + offset.y > space2.bottom) && above == space2.bottom - pos.bottom > pos.top - space2.top)
          above = this.above[i2] = !above;
        let spaceVert = (above ? pos.top - space2.top : space2.bottom - pos.bottom) - arrowHeight;
        if (spaceVert < height && tView.resize !== false) {
          if (spaceVert < this.view.defaultLineHeight) {
            dom.style.top = Outside;
            continue;
          }
          knownHeight.set(tView, height);
          dom.style.height = (height = spaceVert) / scaleY + "px";
        } else if (dom.style.height) {
          dom.style.height = "";
        }
        let top2 = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y;
        let right = left + width;
        if (tView.overlap !== true) {
          for (let r of others)
            if (r.left < right && r.right > left && r.top < top2 + height && r.bottom > top2)
              top2 = above ? r.top - height - 2 - arrowHeight : r.bottom + arrowHeight + 2;
        }
        if (this.position == "absolute") {
          dom.style.top = (top2 - measured.parent.top) / scaleY + "px";
          dom.style.left = (left - measured.parent.left) / scaleX + "px";
        } else {
          dom.style.top = top2 / scaleY + "px";
          dom.style.left = left / scaleX + "px";
        }
        if (arrow) {
          let arrowLeft = pos.left + (ltr ? offset.x : -offset.x) - (left + 14 - 7);
          arrow.style.left = arrowLeft / scaleX + "px";
        }
        if (tView.overlap !== true)
          others.push({ left, top: top2, right, bottom: top2 + height });
        dom.classList.toggle("cm-tooltip-above", above);
        dom.classList.toggle("cm-tooltip-below", !above);
        if (tView.positioned)
          tView.positioned(measured.space);
      }
    }
    maybeMeasure() {
      if (this.manager.tooltips.length) {
        if (this.view.inView)
          this.view.requestMeasure(this.measureReq);
        if (this.inView != this.view.inView) {
          this.inView = this.view.inView;
          if (!this.inView)
            for (let tv of this.manager.tooltipViews)
              tv.dom.style.top = Outside;
        }
      }
    }
  }, {
    eventObservers: {
      scroll() {
        this.maybeMeasure();
      }
    }
  });
  const baseTheme$5 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-tooltip": {
      zIndex: 100,
      boxSizing: "border-box"
    },
    "&light .cm-tooltip": {
      border: "1px solid #bbb",
      backgroundColor: "#f5f5f5"
    },
    "&light .cm-tooltip-section:not(:first-child)": {
      borderTop: "1px solid #bbb"
    },
    "&dark .cm-tooltip": {
      backgroundColor: "#333338",
      color: "white"
    },
    ".cm-tooltip-arrow": {
      height: `${7}px`,
      width: `${7 * 2}px`,
      position: "absolute",
      zIndex: -1,
      overflow: "hidden",
      "&:before, &:after": {
        content: "''",
        position: "absolute",
        width: 0,
        height: 0,
        borderLeft: `${7}px solid transparent`,
        borderRight: `${7}px solid transparent`
      },
      ".cm-tooltip-above &": {
        bottom: `-${7}px`,
        "&:before": {
          borderTop: `${7}px solid #bbb`
        },
        "&:after": {
          borderTop: `${7}px solid #f5f5f5`,
          bottom: "1px"
        }
      },
      ".cm-tooltip-below &": {
        top: `-${7}px`,
        "&:before": {
          borderBottom: `${7}px solid #bbb`
        },
        "&:after": {
          borderBottom: `${7}px solid #f5f5f5`,
          top: "1px"
        }
      }
    },
    "&dark .cm-tooltip .cm-tooltip-arrow": {
      "&:before": {
        borderTopColor: "#333338",
        borderBottomColor: "#333338"
      },
      "&:after": {
        borderTopColor: "transparent",
        borderBottomColor: "transparent"
      }
    }
  });
  const noOffset = { x: 0, y: 0 };
  const showTooltip = /* @__PURE__ */ Facet.define({
    enables: [tooltipPlugin, baseTheme$5]
  });
  const showHoverTooltip = /* @__PURE__ */ Facet.define();
  class HoverTooltipHost {
    static create(view) {
      return new HoverTooltipHost(view);
    }
    constructor(view) {
      this.view = view;
      this.mounted = false;
      this.dom = document.createElement("div");
      this.dom.classList.add("cm-tooltip-hover");
      this.manager = new TooltipViewManager(view, showHoverTooltip, (t2) => this.createHostedView(t2));
    }
    createHostedView(tooltip) {
      let hostedView = tooltip.create(this.view);
      hostedView.dom.classList.add("cm-tooltip-section");
      this.dom.appendChild(hostedView.dom);
      if (this.mounted && hostedView.mount)
        hostedView.mount(this.view);
      return hostedView;
    }
    mount(view) {
      for (let hostedView of this.manager.tooltipViews) {
        if (hostedView.mount)
          hostedView.mount(view);
      }
      this.mounted = true;
    }
    positioned(space2) {
      for (let hostedView of this.manager.tooltipViews) {
        if (hostedView.positioned)
          hostedView.positioned(space2);
      }
    }
    update(update) {
      this.manager.update(update);
    }
    destroy() {
      var _a2;
      for (let t2 of this.manager.tooltipViews)
        (_a2 = t2.destroy) === null || _a2 === void 0 ? void 0 : _a2.call(t2);
    }
    passProp(name2) {
      let value2 = void 0;
      for (let view of this.manager.tooltipViews) {
        let given = view[name2];
        if (given !== void 0) {
          if (value2 === void 0)
            value2 = given;
          else if (value2 !== given)
            return void 0;
        }
      }
      return value2;
    }
    get offset() {
      return this.passProp("offset");
    }
    get getCoords() {
      return this.passProp("getCoords");
    }
    get overlap() {
      return this.passProp("overlap");
    }
    get resize() {
      return this.passProp("resize");
    }
  }
  const showHoverTooltipHost = /* @__PURE__ */ showTooltip.compute([showHoverTooltip], (state) => {
    let tooltips = state.facet(showHoverTooltip).filter((t2) => t2);
    if (tooltips.length === 0)
      return null;
    return {
      pos: Math.min(...tooltips.map((t2) => t2.pos)),
      end: Math.max(...tooltips.filter((t2) => t2.end != null).map((t2) => t2.end)),
      create: HoverTooltipHost.create,
      above: tooltips[0].above,
      arrow: tooltips.some((t2) => t2.arrow)
    };
  });
  class HoverPlugin {
    constructor(view, source, field, setHover, hoverTime) {
      this.view = view;
      this.source = source;
      this.field = field;
      this.setHover = setHover;
      this.hoverTime = hoverTime;
      this.hoverTimeout = -1;
      this.restartTimeout = -1;
      this.pending = null;
      this.lastMove = { x: 0, y: 0, target: view.dom, time: 0 };
      this.checkHover = this.checkHover.bind(this);
      view.dom.addEventListener("mouseleave", this.mouseleave = this.mouseleave.bind(this));
      view.dom.addEventListener("mousemove", this.mousemove = this.mousemove.bind(this));
    }
    update() {
      if (this.pending) {
        this.pending = null;
        clearTimeout(this.restartTimeout);
        this.restartTimeout = setTimeout(() => this.startHover(), 20);
      }
    }
    get active() {
      return this.view.state.field(this.field);
    }
    checkHover() {
      this.hoverTimeout = -1;
      if (this.active)
        return;
      let hovered = Date.now() - this.lastMove.time;
      if (hovered < this.hoverTime)
        this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime - hovered);
      else
        this.startHover();
    }
    startHover() {
      clearTimeout(this.restartTimeout);
      let { view, lastMove } = this;
      let desc = view.docView.nearest(lastMove.target);
      if (!desc)
        return;
      let pos, side = 1;
      if (desc instanceof WidgetView) {
        pos = desc.posAtStart;
      } else {
        pos = view.posAtCoords(lastMove);
        if (pos == null)
          return;
        let posCoords = view.coordsAtPos(pos);
        if (!posCoords || lastMove.y < posCoords.top || lastMove.y > posCoords.bottom || lastMove.x < posCoords.left - view.defaultCharacterWidth || lastMove.x > posCoords.right + view.defaultCharacterWidth)
          return;
        let bidi = view.bidiSpans(view.state.doc.lineAt(pos)).find((s) => s.from <= pos && s.to >= pos);
        let rtl = bidi && bidi.dir == Direction.RTL ? -1 : 1;
        side = lastMove.x < posCoords.left ? -rtl : rtl;
      }
      let open2 = this.source(view, pos, side);
      if (open2 === null || open2 === void 0 ? void 0 : open2.then) {
        let pending = this.pending = { pos };
        open2.then((result) => {
          if (this.pending == pending) {
            this.pending = null;
            if (result)
              view.dispatch({ effects: this.setHover.of(result) });
          }
        }, (e) => logException(view.state, e, "hover tooltip"));
      } else if (open2) {
        view.dispatch({ effects: this.setHover.of(open2) });
      }
    }
    mousemove(event) {
      var _a2;
      this.lastMove = { x: event.clientX, y: event.clientY, target: event.target, time: Date.now() };
      if (this.hoverTimeout < 0)
        this.hoverTimeout = setTimeout(this.checkHover, this.hoverTime);
      let tooltip = this.active;
      if (tooltip && !isInTooltip(this.lastMove.target) || this.pending) {
        let { pos } = tooltip || this.pending, end = (_a2 = tooltip === null || tooltip === void 0 ? void 0 : tooltip.end) !== null && _a2 !== void 0 ? _a2 : pos;
        if (pos == end ? this.view.posAtCoords(this.lastMove) != pos : !isOverRange(this.view, pos, end, event.clientX, event.clientY)) {
          this.view.dispatch({ effects: this.setHover.of(null) });
          this.pending = null;
        }
      }
    }
    mouseleave(e) {
      clearTimeout(this.hoverTimeout);
      this.hoverTimeout = -1;
      if (this.active && !isInTooltip(e.relatedTarget))
        this.view.dispatch({ effects: this.setHover.of(null) });
    }
    destroy() {
      clearTimeout(this.hoverTimeout);
      this.view.dom.removeEventListener("mouseleave", this.mouseleave);
      this.view.dom.removeEventListener("mousemove", this.mousemove);
    }
  }
  function isInTooltip(elt) {
    for (let cur2 = elt; cur2; cur2 = cur2.parentNode)
      if (cur2.nodeType == 1 && cur2.classList.contains("cm-tooltip"))
        return true;
    return false;
  }
  function isOverRange(view, from, to, x, y, margin) {
    let rect = view.scrollDOM.getBoundingClientRect();
    let docBottom = view.documentTop + view.documentPadding.top + view.contentHeight;
    if (rect.left > x || rect.right < x || rect.top > y || Math.min(rect.bottom, docBottom) < y)
      return false;
    let pos = view.posAtCoords({ x, y }, false);
    return pos >= from && pos <= to;
  }
  function hoverTooltip(source, options = {}) {
    let setHover = StateEffect.define();
    let hoverState = StateField.define({
      create() {
        return null;
      },
      update(value2, tr) {
        if (value2 && (options.hideOnChange && (tr.docChanged || tr.selection) || options.hideOn && options.hideOn(tr, value2)))
          return null;
        if (value2 && tr.docChanged) {
          let newPos = tr.changes.mapPos(value2.pos, -1, MapMode.TrackDel);
          if (newPos == null)
            return null;
          let copy = Object.assign(Object.create(null), value2);
          copy.pos = newPos;
          if (value2.end != null)
            copy.end = tr.changes.mapPos(value2.end);
          value2 = copy;
        }
        for (let effect of tr.effects) {
          if (effect.is(setHover))
            value2 = effect.value;
          if (effect.is(closeHoverTooltipEffect))
            value2 = null;
        }
        return value2;
      },
      provide: (f) => showHoverTooltip.from(f)
    });
    return [
      hoverState,
      ViewPlugin.define((view) => new HoverPlugin(view, source, hoverState, setHover, options.hoverTime || 300)),
      showHoverTooltipHost
    ];
  }
  function getTooltip(view, tooltip) {
    let plugin = view.plugin(tooltipPlugin);
    if (!plugin)
      return null;
    let found = plugin.manager.tooltips.indexOf(tooltip);
    return found < 0 ? null : plugin.manager.tooltipViews[found];
  }
  const closeHoverTooltipEffect = /* @__PURE__ */ StateEffect.define();
  const panelConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      let topContainer, bottomContainer;
      for (let c of configs) {
        topContainer = topContainer || c.topContainer;
        bottomContainer = bottomContainer || c.bottomContainer;
      }
      return { topContainer, bottomContainer };
    }
  });
  function getPanel(view, panel) {
    let plugin = view.plugin(panelPlugin);
    let index2 = plugin ? plugin.specs.indexOf(panel) : -1;
    return index2 > -1 ? plugin.panels[index2] : null;
  }
  const panelPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.input = view.state.facet(showPanel);
      this.specs = this.input.filter((s) => s);
      this.panels = this.specs.map((spec) => spec(view));
      let conf = view.state.facet(panelConfig);
      this.top = new PanelGroup(view, true, conf.topContainer);
      this.bottom = new PanelGroup(view, false, conf.bottomContainer);
      this.top.sync(this.panels.filter((p) => p.top));
      this.bottom.sync(this.panels.filter((p) => !p.top));
      for (let p of this.panels) {
        p.dom.classList.add("cm-panel");
        if (p.mount)
          p.mount();
      }
    }
    update(update) {
      let conf = update.state.facet(panelConfig);
      if (this.top.container != conf.topContainer) {
        this.top.sync([]);
        this.top = new PanelGroup(update.view, true, conf.topContainer);
      }
      if (this.bottom.container != conf.bottomContainer) {
        this.bottom.sync([]);
        this.bottom = new PanelGroup(update.view, false, conf.bottomContainer);
      }
      this.top.syncClasses();
      this.bottom.syncClasses();
      let input = update.state.facet(showPanel);
      if (input != this.input) {
        let specs = input.filter((x) => x);
        let panels = [], top2 = [], bottom = [], mount = [];
        for (let spec of specs) {
          let known = this.specs.indexOf(spec), panel;
          if (known < 0) {
            panel = spec(update.view);
            mount.push(panel);
          } else {
            panel = this.panels[known];
            if (panel.update)
              panel.update(update);
          }
          panels.push(panel);
          (panel.top ? top2 : bottom).push(panel);
        }
        this.specs = specs;
        this.panels = panels;
        this.top.sync(top2);
        this.bottom.sync(bottom);
        for (let p of mount) {
          p.dom.classList.add("cm-panel");
          if (p.mount)
            p.mount();
        }
      } else {
        for (let p of this.panels)
          if (p.update)
            p.update(update);
      }
    }
    destroy() {
      this.top.sync([]);
      this.bottom.sync([]);
    }
  }, {
    provide: (plugin) => EditorView.scrollMargins.of((view) => {
      let value2 = view.plugin(plugin);
      return value2 && { top: value2.top.scrollMargin(), bottom: value2.bottom.scrollMargin() };
    })
  });
  class PanelGroup {
    constructor(view, top2, container) {
      this.view = view;
      this.top = top2;
      this.container = container;
      this.dom = void 0;
      this.classes = "";
      this.panels = [];
      this.syncClasses();
    }
    sync(panels) {
      for (let p of this.panels)
        if (p.destroy && panels.indexOf(p) < 0)
          p.destroy();
      this.panels = panels;
      this.syncDOM();
    }
    syncDOM() {
      if (this.panels.length == 0) {
        if (this.dom) {
          this.dom.remove();
          this.dom = void 0;
        }
        return;
      }
      if (!this.dom) {
        this.dom = document.createElement("div");
        this.dom.className = this.top ? "cm-panels cm-panels-top" : "cm-panels cm-panels-bottom";
        this.dom.style[this.top ? "top" : "bottom"] = "0";
        let parent = this.container || this.view.dom;
        parent.insertBefore(this.dom, this.top ? parent.firstChild : null);
      }
      let curDOM = this.dom.firstChild;
      for (let panel of this.panels) {
        if (panel.dom.parentNode == this.dom) {
          while (curDOM != panel.dom)
            curDOM = rm(curDOM);
          curDOM = curDOM.nextSibling;
        } else {
          this.dom.insertBefore(panel.dom, curDOM);
        }
      }
      while (curDOM)
        curDOM = rm(curDOM);
    }
    scrollMargin() {
      return !this.dom || this.container ? 0 : Math.max(0, this.top ? this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) : Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);
    }
    syncClasses() {
      if (!this.container || this.classes == this.view.themeClasses)
        return;
      for (let cls of this.classes.split(" "))
        if (cls)
          this.container.classList.remove(cls);
      for (let cls of (this.classes = this.view.themeClasses).split(" "))
        if (cls)
          this.container.classList.add(cls);
    }
  }
  function rm(node) {
    let next = node.nextSibling;
    node.remove();
    return next;
  }
  const showPanel = /* @__PURE__ */ Facet.define({
    enables: panelPlugin
  });
  class GutterMarker extends RangeValue {
    compare(other) {
      return this == other || this.constructor == other.constructor && this.eq(other);
    }
    eq(other) {
      return false;
    }
    destroy(dom) {
    }
  }
  GutterMarker.prototype.elementClass = "";
  GutterMarker.prototype.toDOM = void 0;
  GutterMarker.prototype.mapMode = MapMode.TrackBefore;
  GutterMarker.prototype.startSide = GutterMarker.prototype.endSide = -1;
  GutterMarker.prototype.point = true;
  const gutterLineClass = /* @__PURE__ */ Facet.define();
  const defaults$2 = {
    class: "",
    renderEmptyElements: false,
    elementStyle: "",
    markers: () => RangeSet.empty,
    lineMarker: () => null,
    widgetMarker: () => null,
    lineMarkerChange: null,
    initialSpacer: null,
    updateSpacer: null,
    domEventHandlers: {}
  };
  const activeGutters = /* @__PURE__ */ Facet.define();
  function gutter(config2) {
    return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults$2), config2))];
  }
  const unfixGutters = /* @__PURE__ */ Facet.define({
    combine: (values) => values.some((x) => x)
  });
  function gutters(config2) {
    let result = [
      gutterView
    ];
    if (config2 && config2.fixed === false)
      result.push(unfixGutters.of(true));
    return result;
  }
  const gutterView = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.prevViewport = view.viewport;
      this.dom = document.createElement("div");
      this.dom.className = "cm-gutters";
      this.dom.setAttribute("aria-hidden", "true");
      this.dom.style.minHeight = this.view.contentHeight / this.view.scaleY + "px";
      this.gutters = view.state.facet(activeGutters).map((conf) => new SingleGutterView(view, conf));
      for (let gutter2 of this.gutters)
        this.dom.appendChild(gutter2.dom);
      this.fixed = !view.state.facet(unfixGutters);
      if (this.fixed) {
        this.dom.style.position = "sticky";
      }
      this.syncGutters(false);
      view.scrollDOM.insertBefore(this.dom, view.contentDOM);
    }
    update(update) {
      if (this.updateGutters(update)) {
        let vpA = this.prevViewport, vpB = update.view.viewport;
        let vpOverlap = Math.min(vpA.to, vpB.to) - Math.max(vpA.from, vpB.from);
        this.syncGutters(vpOverlap < (vpB.to - vpB.from) * 0.8);
      }
      if (update.geometryChanged)
        this.dom.style.minHeight = this.view.contentHeight + "px";
      if (this.view.state.facet(unfixGutters) != !this.fixed) {
        this.fixed = !this.fixed;
        this.dom.style.position = this.fixed ? "sticky" : "";
      }
      this.prevViewport = update.view.viewport;
    }
    syncGutters(detach) {
      let after = this.dom.nextSibling;
      if (detach)
        this.dom.remove();
      let lineClasses = RangeSet.iter(this.view.state.facet(gutterLineClass), this.view.viewport.from);
      let classSet = [];
      let contexts = this.gutters.map((gutter2) => new UpdateContext(gutter2, this.view.viewport, -this.view.documentPadding.top));
      for (let line of this.view.viewportLineBlocks) {
        if (classSet.length)
          classSet = [];
        if (Array.isArray(line.type)) {
          let first = true;
          for (let b of line.type) {
            if (b.type == BlockType.Text && first) {
              advanceCursor(lineClasses, classSet, b.from);
              for (let cx of contexts)
                cx.line(this.view, b, classSet);
              first = false;
            } else if (b.widget) {
              for (let cx of contexts)
                cx.widget(this.view, b);
            }
          }
        } else if (line.type == BlockType.Text) {
          advanceCursor(lineClasses, classSet, line.from);
          for (let cx of contexts)
            cx.line(this.view, line, classSet);
        } else if (line.widget) {
          for (let cx of contexts)
            cx.widget(this.view, line);
        }
      }
      for (let cx of contexts)
        cx.finish();
      if (detach)
        this.view.scrollDOM.insertBefore(this.dom, after);
    }
    updateGutters(update) {
      let prev = update.startState.facet(activeGutters), cur2 = update.state.facet(activeGutters);
      let change = update.docChanged || update.heightChanged || update.viewportChanged || !RangeSet.eq(update.startState.facet(gutterLineClass), update.state.facet(gutterLineClass), update.view.viewport.from, update.view.viewport.to);
      if (prev == cur2) {
        for (let gutter2 of this.gutters)
          if (gutter2.update(update))
            change = true;
      } else {
        change = true;
        let gutters2 = [];
        for (let conf of cur2) {
          let known = prev.indexOf(conf);
          if (known < 0) {
            gutters2.push(new SingleGutterView(this.view, conf));
          } else {
            this.gutters[known].update(update);
            gutters2.push(this.gutters[known]);
          }
        }
        for (let g of this.gutters) {
          g.dom.remove();
          if (gutters2.indexOf(g) < 0)
            g.destroy();
        }
        for (let g of gutters2)
          this.dom.appendChild(g.dom);
        this.gutters = gutters2;
      }
      return change;
    }
    destroy() {
      for (let view of this.gutters)
        view.destroy();
      this.dom.remove();
    }
  }, {
    provide: (plugin) => EditorView.scrollMargins.of((view) => {
      let value2 = view.plugin(plugin);
      if (!value2 || value2.gutters.length == 0 || !value2.fixed)
        return null;
      return view.textDirection == Direction.LTR ? { left: value2.dom.offsetWidth * view.scaleX } : { right: value2.dom.offsetWidth * view.scaleX };
    })
  });
  function asArray(val) {
    return Array.isArray(val) ? val : [val];
  }
  function advanceCursor(cursor, collect, pos) {
    while (cursor.value && cursor.from <= pos) {
      if (cursor.from == pos)
        collect.push(cursor.value);
      cursor.next();
    }
  }
  class UpdateContext {
    constructor(gutter2, viewport, height) {
      this.gutter = gutter2;
      this.height = height;
      this.i = 0;
      this.cursor = RangeSet.iter(gutter2.markers, viewport.from);
    }
    addElement(view, block, markers) {
      let { gutter: gutter2 } = this, above = (block.top - this.height) / view.scaleY, height = block.height / view.scaleY;
      if (this.i == gutter2.elements.length) {
        let newElt = new GutterElement(view, height, above, markers);
        gutter2.elements.push(newElt);
        gutter2.dom.appendChild(newElt.dom);
      } else {
        gutter2.elements[this.i].update(view, height, above, markers);
      }
      this.height = block.bottom;
      this.i++;
    }
    line(view, line, extraMarkers) {
      let localMarkers = [];
      advanceCursor(this.cursor, localMarkers, line.from);
      if (extraMarkers.length)
        localMarkers = localMarkers.concat(extraMarkers);
      let forLine = this.gutter.config.lineMarker(view, line, localMarkers);
      if (forLine)
        localMarkers.unshift(forLine);
      let gutter2 = this.gutter;
      if (localMarkers.length == 0 && !gutter2.config.renderEmptyElements)
        return;
      this.addElement(view, line, localMarkers);
    }
    widget(view, block) {
      let marker = this.gutter.config.widgetMarker(view, block.widget, block);
      if (marker)
        this.addElement(view, block, [marker]);
    }
    finish() {
      let gutter2 = this.gutter;
      while (gutter2.elements.length > this.i) {
        let last = gutter2.elements.pop();
        gutter2.dom.removeChild(last.dom);
        last.destroy();
      }
    }
  }
  class SingleGutterView {
    constructor(view, config2) {
      this.view = view;
      this.config = config2;
      this.elements = [];
      this.spacer = null;
      this.dom = document.createElement("div");
      this.dom.className = "cm-gutter" + (this.config.class ? " " + this.config.class : "");
      for (let prop in config2.domEventHandlers) {
        this.dom.addEventListener(prop, (event) => {
          let target = event.target, y;
          if (target != this.dom && this.dom.contains(target)) {
            while (target.parentNode != this.dom)
              target = target.parentNode;
            let rect = target.getBoundingClientRect();
            y = (rect.top + rect.bottom) / 2;
          } else {
            y = event.clientY;
          }
          let line = view.lineBlockAtHeight(y - view.documentTop);
          if (config2.domEventHandlers[prop](view, line, event))
            event.preventDefault();
        });
      }
      this.markers = asArray(config2.markers(view));
      if (config2.initialSpacer) {
        this.spacer = new GutterElement(view, 0, 0, [config2.initialSpacer(view)]);
        this.dom.appendChild(this.spacer.dom);
        this.spacer.dom.style.cssText += "visibility: hidden; pointer-events: none";
      }
    }
    update(update) {
      let prevMarkers = this.markers;
      this.markers = asArray(this.config.markers(update.view));
      if (this.spacer && this.config.updateSpacer) {
        let updated = this.config.updateSpacer(this.spacer.markers[0], update);
        if (updated != this.spacer.markers[0])
          this.spacer.update(update.view, 0, 0, [updated]);
      }
      let vp = update.view.viewport;
      return !RangeSet.eq(this.markers, prevMarkers, vp.from, vp.to) || (this.config.lineMarkerChange ? this.config.lineMarkerChange(update) : false);
    }
    destroy() {
      for (let elt of this.elements)
        elt.destroy();
    }
  }
  class GutterElement {
    constructor(view, height, above, markers) {
      this.height = -1;
      this.above = 0;
      this.markers = [];
      this.dom = document.createElement("div");
      this.dom.className = "cm-gutterElement";
      this.update(view, height, above, markers);
    }
    update(view, height, above, markers) {
      if (this.height != height) {
        this.height = height;
        this.dom.style.height = height + "px";
      }
      if (this.above != above)
        this.dom.style.marginTop = (this.above = above) ? above + "px" : "";
      if (!sameMarkers(this.markers, markers))
        this.setMarkers(view, markers);
    }
    setMarkers(view, markers) {
      let cls = "cm-gutterElement", domPos = this.dom.firstChild;
      for (let iNew = 0, iOld = 0; ; ) {
        let skipTo = iOld, marker = iNew < markers.length ? markers[iNew++] : null, matched = false;
        if (marker) {
          let c = marker.elementClass;
          if (c)
            cls += " " + c;
          for (let i2 = iOld; i2 < this.markers.length; i2++)
            if (this.markers[i2].compare(marker)) {
              skipTo = i2;
              matched = true;
              break;
            }
        } else {
          skipTo = this.markers.length;
        }
        while (iOld < skipTo) {
          let next = this.markers[iOld++];
          if (next.toDOM) {
            next.destroy(domPos);
            let after = domPos.nextSibling;
            domPos.remove();
            domPos = after;
          }
        }
        if (!marker)
          break;
        if (marker.toDOM) {
          if (matched)
            domPos = domPos.nextSibling;
          else
            this.dom.insertBefore(marker.toDOM(view), domPos);
        }
        if (matched)
          iOld++;
      }
      this.dom.className = cls;
      this.markers = markers;
    }
    destroy() {
      this.setMarkers(null, []);
    }
  }
  function sameMarkers(a, b) {
    if (a.length != b.length)
      return false;
    for (let i2 = 0; i2 < a.length; i2++)
      if (!a[i2].compare(b[i2]))
        return false;
    return true;
  }
  const lineNumberMarkers = /* @__PURE__ */ Facet.define();
  const lineNumberConfig = /* @__PURE__ */ Facet.define({
    combine(values) {
      return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {
        domEventHandlers(a, b) {
          let result = Object.assign({}, a);
          for (let event in b) {
            let exists = result[event], add2 = b[event];
            result[event] = exists ? (view, line, event2) => exists(view, line, event2) || add2(view, line, event2) : add2;
          }
          return result;
        }
      });
    }
  });
  class NumberMarker extends GutterMarker {
    constructor(number2) {
      super();
      this.number = number2;
    }
    eq(other) {
      return this.number == other.number;
    }
    toDOM() {
      return document.createTextNode(this.number);
    }
  }
  function formatNumber(view, number2) {
    return view.state.facet(lineNumberConfig).formatNumber(number2, view.state);
  }
  const lineNumberGutter = /* @__PURE__ */ activeGutters.compute([lineNumberConfig], (state) => ({
    class: "cm-lineNumbers",
    renderEmptyElements: false,
    markers(view) {
      return view.state.facet(lineNumberMarkers);
    },
    lineMarker(view, line, others) {
      if (others.some((m) => m.toDOM))
        return null;
      return new NumberMarker(formatNumber(view, view.state.doc.lineAt(line.from).number));
    },
    widgetMarker: () => null,
    lineMarkerChange: (update) => update.startState.facet(lineNumberConfig) != update.state.facet(lineNumberConfig),
    initialSpacer(view) {
      return new NumberMarker(formatNumber(view, maxLineNumber(view.state.doc.lines)));
    },
    updateSpacer(spacer, update) {
      let max = formatNumber(update.view, maxLineNumber(update.view.state.doc.lines));
      return max == spacer.number ? spacer : new NumberMarker(max);
    },
    domEventHandlers: state.facet(lineNumberConfig).domEventHandlers
  }));
  function lineNumbers(config2 = {}) {
    return [
      lineNumberConfig.of(config2),
      gutters(),
      lineNumberGutter
    ];
  }
  function maxLineNumber(lines) {
    let last = 9;
    while (last < lines)
      last = last * 10 + 9;
    return last;
  }
  const activeLineGutterMarker = /* @__PURE__ */ new class extends GutterMarker {
    constructor() {
      super(...arguments);
      this.elementClass = "cm-activeLineGutter";
    }
  }();
  const activeLineGutterHighlighter = /* @__PURE__ */ gutterLineClass.compute(["selection"], (state) => {
    let marks = [], last = -1;
    for (let range of state.selection.ranges) {
      let linePos = state.doc.lineAt(range.head).from;
      if (linePos > last) {
        last = linePos;
        marks.push(activeLineGutterMarker.range(linePos));
      }
    }
    return RangeSet.of(marks);
  });
  function highlightActiveLineGutter() {
    return activeLineGutterHighlighter;
  }
  const DefaultBufferLength = 1024;
  let nextPropID = 0;
  class Range {
    constructor(from, to) {
      this.from = from;
      this.to = to;
    }
  }
  class NodeProp {
    constructor(config2 = {}) {
      this.id = nextPropID++;
      this.perNode = !!config2.perNode;
      this.deserialize = config2.deserialize || (() => {
        throw new Error("This node type doesn't define a deserialize function");
      });
    }
    add(match) {
      if (this.perNode)
        throw new RangeError("Can't add per-node props to node types");
      if (typeof match != "function")
        match = NodeType.match(match);
      return (type) => {
        let result = match(type);
        return result === void 0 ? null : [this, result];
      };
    }
  }
  NodeProp.closedBy = new NodeProp({ deserialize: (str) => str.split(" ") });
  NodeProp.openedBy = new NodeProp({ deserialize: (str) => str.split(" ") });
  NodeProp.group = new NodeProp({ deserialize: (str) => str.split(" ") });
  NodeProp.contextHash = new NodeProp({ perNode: true });
  NodeProp.lookAhead = new NodeProp({ perNode: true });
  NodeProp.mounted = new NodeProp({ perNode: true });
  class MountedTree {
    constructor(tree, overlay, parser2) {
      this.tree = tree;
      this.overlay = overlay;
      this.parser = parser2;
    }
    static get(tree) {
      return tree && tree.props && tree.props[NodeProp.mounted.id];
    }
  }
  const noProps = Object.create(null);
  class NodeType {
    constructor(name2, props, id2, flags = 0) {
      this.name = name2;
      this.props = props;
      this.id = id2;
      this.flags = flags;
    }
    static define(spec) {
      let props = spec.props && spec.props.length ? Object.create(null) : noProps;
      let flags = (spec.top ? 1 : 0) | (spec.skipped ? 2 : 0) | (spec.error ? 4 : 0) | (spec.name == null ? 8 : 0);
      let type = new NodeType(spec.name || "", props, spec.id, flags);
      if (spec.props)
        for (let src of spec.props) {
          if (!Array.isArray(src))
            src = src(type);
          if (src) {
            if (src[0].perNode)
              throw new RangeError("Can't store a per-node prop on a node type");
            props[src[0].id] = src[1];
          }
        }
      return type;
    }
    prop(prop) {
      return this.props[prop.id];
    }
    get isTop() {
      return (this.flags & 1) > 0;
    }
    get isSkipped() {
      return (this.flags & 2) > 0;
    }
    get isError() {
      return (this.flags & 4) > 0;
    }
    get isAnonymous() {
      return (this.flags & 8) > 0;
    }
    is(name2) {
      if (typeof name2 == "string") {
        if (this.name == name2)
          return true;
        let group = this.prop(NodeProp.group);
        return group ? group.indexOf(name2) > -1 : false;
      }
      return this.id == name2;
    }
    static match(map) {
      let direct = Object.create(null);
      for (let prop in map)
        for (let name2 of prop.split(" "))
          direct[name2] = map[prop];
      return (node) => {
        for (let groups = node.prop(NodeProp.group), i2 = -1; i2 < (groups ? groups.length : 0); i2++) {
          let found = direct[i2 < 0 ? node.name : groups[i2]];
          if (found)
            return found;
        }
      };
    }
  }
  NodeType.none = new NodeType("", Object.create(null), 0, 8);
  class NodeSet {
    constructor(types2) {
      this.types = types2;
      for (let i2 = 0; i2 < types2.length; i2++)
        if (types2[i2].id != i2)
          throw new RangeError("Node type ids should correspond to array positions when creating a node set");
    }
    extend(...props) {
      let newTypes = [];
      for (let type of this.types) {
        let newProps = null;
        for (let source of props) {
          let add2 = source(type);
          if (add2) {
            if (!newProps)
              newProps = Object.assign({}, type.props);
            newProps[add2[0].id] = add2[1];
          }
        }
        newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);
      }
      return new NodeSet(newTypes);
    }
  }
  const CachedNode = new WeakMap(), CachedInnerNode = new WeakMap();
  var IterMode;
  (function(IterMode2) {
    IterMode2[IterMode2["ExcludeBuffers"] = 1] = "ExcludeBuffers";
    IterMode2[IterMode2["IncludeAnonymous"] = 2] = "IncludeAnonymous";
    IterMode2[IterMode2["IgnoreMounts"] = 4] = "IgnoreMounts";
    IterMode2[IterMode2["IgnoreOverlays"] = 8] = "IgnoreOverlays";
  })(IterMode || (IterMode = {}));
  class Tree {
    constructor(type, children, positions, length, props) {
      this.type = type;
      this.children = children;
      this.positions = positions;
      this.length = length;
      this.props = null;
      if (props && props.length) {
        this.props = Object.create(null);
        for (let [prop, value2] of props)
          this.props[typeof prop == "number" ? prop : prop.id] = value2;
      }
    }
    toString() {
      let mounted = MountedTree.get(this);
      if (mounted && !mounted.overlay)
        return mounted.tree.toString();
      let children = "";
      for (let ch of this.children) {
        let str = ch.toString();
        if (str) {
          if (children)
            children += ",";
          children += str;
        }
      }
      return !this.type.name ? children : (/\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) + (children.length ? "(" + children + ")" : "");
    }
    cursor(mode = 0) {
      return new TreeCursor(this.topNode, mode);
    }
    cursorAt(pos, side = 0, mode = 0) {
      let scope = CachedNode.get(this) || this.topNode;
      let cursor = new TreeCursor(scope);
      cursor.moveTo(pos, side);
      CachedNode.set(this, cursor._tree);
      return cursor;
    }
    get topNode() {
      return new TreeNode(this, 0, 0, null);
    }
    resolve(pos, side = 0) {
      let node = resolveNode(CachedNode.get(this) || this.topNode, pos, side, false);
      CachedNode.set(this, node);
      return node;
    }
    resolveInner(pos, side = 0) {
      let node = resolveNode(CachedInnerNode.get(this) || this.topNode, pos, side, true);
      CachedInnerNode.set(this, node);
      return node;
    }
    resolveStack(pos, side = 0) {
      return stackIterator(this, pos, side);
    }
    iterate(spec) {
      let { enter, leave, from = 0, to = this.length } = spec;
      let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;
      for (let c = this.cursor(mode | IterMode.IncludeAnonymous); ; ) {
        let entered = false;
        if (c.from <= to && c.to >= from && (!anon && c.type.isAnonymous || enter(c) !== false)) {
          if (c.firstChild())
            continue;
          entered = true;
        }
        for (; ; ) {
          if (entered && leave && (anon || !c.type.isAnonymous))
            leave(c);
          if (c.nextSibling())
            break;
          if (!c.parent())
            return;
          entered = true;
        }
      }
    }
    prop(prop) {
      return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : void 0;
    }
    get propValues() {
      let result = [];
      if (this.props)
        for (let id2 in this.props)
          result.push([+id2, this.props[id2]]);
      return result;
    }
    balance(config2 = {}) {
      return this.children.length <= 8 ? this : balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config2.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));
    }
    static build(data2) {
      return buildTree(data2);
    }
  }
  Tree.empty = new Tree(NodeType.none, [], [], 0);
  class FlatBufferCursor {
    constructor(buffer, index2) {
      this.buffer = buffer;
      this.index = index2;
    }
    get id() {
      return this.buffer[this.index - 4];
    }
    get start() {
      return this.buffer[this.index - 3];
    }
    get end() {
      return this.buffer[this.index - 2];
    }
    get size() {
      return this.buffer[this.index - 1];
    }
    get pos() {
      return this.index;
    }
    next() {
      this.index -= 4;
    }
    fork() {
      return new FlatBufferCursor(this.buffer, this.index);
    }
  }
  class TreeBuffer {
    constructor(buffer, length, set) {
      this.buffer = buffer;
      this.length = length;
      this.set = set;
    }
    get type() {
      return NodeType.none;
    }
    toString() {
      let result = [];
      for (let index2 = 0; index2 < this.buffer.length; ) {
        result.push(this.childString(index2));
        index2 = this.buffer[index2 + 3];
      }
      return result.join(",");
    }
    childString(index2) {
      let id2 = this.buffer[index2], endIndex = this.buffer[index2 + 3];
      let type = this.set.types[id2], result = type.name;
      if (/\W/.test(result) && !type.isError)
        result = JSON.stringify(result);
      index2 += 4;
      if (endIndex == index2)
        return result;
      let children = [];
      while (index2 < endIndex) {
        children.push(this.childString(index2));
        index2 = this.buffer[index2 + 3];
      }
      return result + "(" + children.join(",") + ")";
    }
    findChild(startIndex, endIndex, dir, pos, side) {
      let { buffer } = this, pick = -1;
      for (let i2 = startIndex; i2 != endIndex; i2 = buffer[i2 + 3]) {
        if (checkSide(side, pos, buffer[i2 + 1], buffer[i2 + 2])) {
          pick = i2;
          if (dir > 0)
            break;
        }
      }
      return pick;
    }
    slice(startI, endI, from) {
      let b = this.buffer;
      let copy = new Uint16Array(endI - startI), len = 0;
      for (let i2 = startI, j = 0; i2 < endI; ) {
        copy[j++] = b[i2++];
        copy[j++] = b[i2++] - from;
        let to = copy[j++] = b[i2++] - from;
        copy[j++] = b[i2++] - startI;
        len = Math.max(len, to);
      }
      return new TreeBuffer(copy, len, this.set);
    }
  }
  function checkSide(side, pos, from, to) {
    switch (side) {
      case -2:
        return from < pos;
      case -1:
        return to >= pos && from < pos;
      case 0:
        return from < pos && to > pos;
      case 1:
        return from <= pos && to > pos;
      case 2:
        return to > pos;
      case 4:
        return true;
    }
  }
  function resolveNode(node, pos, side, overlays) {
    var _a2;
    while (node.from == node.to || (side < 1 ? node.from >= pos : node.from > pos) || (side > -1 ? node.to <= pos : node.to < pos)) {
      let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent;
      if (!parent)
        return node;
      node = parent;
    }
    let mode = overlays ? 0 : IterMode.IgnoreOverlays;
    if (overlays)
      for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {
        if (scan instanceof TreeNode && scan.index < 0 && ((_a2 = parent.enter(pos, side, mode)) === null || _a2 === void 0 ? void 0 : _a2.from) != scan.from)
          node = parent;
      }
    for (; ; ) {
      let inner = node.enter(pos, side, mode);
      if (!inner)
        return node;
      node = inner;
    }
  }
  class BaseNode {
    cursor(mode = 0) {
      return new TreeCursor(this, mode);
    }
    getChild(type, before = null, after = null) {
      let r = getChildren(this, type, before, after);
      return r.length ? r[0] : null;
    }
    getChildren(type, before = null, after = null) {
      return getChildren(this, type, before, after);
    }
    resolve(pos, side = 0) {
      return resolveNode(this, pos, side, false);
    }
    resolveInner(pos, side = 0) {
      return resolveNode(this, pos, side, true);
    }
    matchContext(context) {
      return matchNodeContext(this, context);
    }
    enterUnfinishedNodesBefore(pos) {
      let scan = this.childBefore(pos), node = this;
      while (scan) {
        let last = scan.lastChild;
        if (!last || last.to != scan.to)
          break;
        if (last.type.isError && last.from == last.to) {
          node = scan;
          scan = last.prevSibling;
        } else {
          scan = last;
        }
      }
      return node;
    }
    get node() {
      return this;
    }
    get next() {
      return this.parent;
    }
  }
  class TreeNode extends BaseNode {
    constructor(_tree, from, index2, _parent) {
      super();
      this._tree = _tree;
      this.from = from;
      this.index = index2;
      this._parent = _parent;
    }
    get type() {
      return this._tree.type;
    }
    get name() {
      return this._tree.type.name;
    }
    get to() {
      return this.from + this._tree.length;
    }
    nextChild(i2, dir, pos, side, mode = 0) {
      for (let parent = this; ; ) {
        for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i2 != e; i2 += dir) {
          let next = children[i2], start = positions[i2] + parent.from;
          if (!checkSide(side, pos, start, start + next.length))
            continue;
          if (next instanceof TreeBuffer) {
            if (mode & IterMode.ExcludeBuffers)
              continue;
            let index2 = next.findChild(0, next.buffer.length, dir, pos - start, side);
            if (index2 > -1)
              return new BufferNode(new BufferContext(parent, next, i2, start), null, index2);
          } else if (mode & IterMode.IncludeAnonymous || (!next.type.isAnonymous || hasChild(next))) {
            let mounted;
            if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)
              return new TreeNode(mounted.tree, start, i2, parent);
            let inner = new TreeNode(next, start, i2, parent);
            return mode & IterMode.IncludeAnonymous || !inner.type.isAnonymous ? inner : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);
          }
        }
        if (mode & IterMode.IncludeAnonymous || !parent.type.isAnonymous)
          return null;
        if (parent.index >= 0)
          i2 = parent.index + dir;
        else
          i2 = dir < 0 ? -1 : parent._parent._tree.children.length;
        parent = parent._parent;
        if (!parent)
          return null;
      }
    }
    get firstChild() {
      return this.nextChild(0, 1, 0, 4);
    }
    get lastChild() {
      return this.nextChild(this._tree.children.length - 1, -1, 0, 4);
    }
    childAfter(pos) {
      return this.nextChild(0, 1, pos, 2);
    }
    childBefore(pos) {
      return this.nextChild(this._tree.children.length - 1, -1, pos, -2);
    }
    enter(pos, side, mode = 0) {
      let mounted;
      if (!(mode & IterMode.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {
        let rPos = pos - this.from;
        for (let { from, to } of mounted.overlay) {
          if ((side > 0 ? from <= rPos : from < rPos) && (side < 0 ? to >= rPos : to > rPos))
            return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);
        }
      }
      return this.nextChild(0, 1, pos, side, mode);
    }
    nextSignificantParent() {
      let val = this;
      while (val.type.isAnonymous && val._parent)
        val = val._parent;
      return val;
    }
    get parent() {
      return this._parent ? this._parent.nextSignificantParent() : null;
    }
    get nextSibling() {
      return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4) : null;
    }
    get prevSibling() {
      return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4) : null;
    }
    get tree() {
      return this._tree;
    }
    toTree() {
      return this._tree;
    }
    toString() {
      return this._tree.toString();
    }
  }
  function getChildren(node, type, before, after) {
    let cur2 = node.cursor(), result = [];
    if (!cur2.firstChild())
      return result;
    if (before != null) {
      while (!cur2.type.is(before))
        if (!cur2.nextSibling())
          return result;
    }
    for (; ; ) {
      if (after != null && cur2.type.is(after))
        return result;
      if (cur2.type.is(type))
        result.push(cur2.node);
      if (!cur2.nextSibling())
        return after == null ? result : [];
    }
  }
  function matchNodeContext(node, context, i2 = context.length - 1) {
    for (let p = node.parent; i2 >= 0; p = p.parent) {
      if (!p)
        return false;
      if (!p.type.isAnonymous) {
        if (context[i2] && context[i2] != p.name)
          return false;
        i2--;
      }
    }
    return true;
  }
  class BufferContext {
    constructor(parent, buffer, index2, start) {
      this.parent = parent;
      this.buffer = buffer;
      this.index = index2;
      this.start = start;
    }
  }
  class BufferNode extends BaseNode {
    get name() {
      return this.type.name;
    }
    get from() {
      return this.context.start + this.context.buffer.buffer[this.index + 1];
    }
    get to() {
      return this.context.start + this.context.buffer.buffer[this.index + 2];
    }
    constructor(context, _parent, index2) {
      super();
      this.context = context;
      this._parent = _parent;
      this.index = index2;
      this.type = context.buffer.set.types[context.buffer.buffer[index2]];
    }
    child(dir, pos, side) {
      let { buffer } = this.context;
      let index2 = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side);
      return index2 < 0 ? null : new BufferNode(this.context, this, index2);
    }
    get firstChild() {
      return this.child(1, 0, 4);
    }
    get lastChild() {
      return this.child(-1, 0, 4);
    }
    childAfter(pos) {
      return this.child(1, pos, 2);
    }
    childBefore(pos) {
      return this.child(-1, pos, -2);
    }
    enter(pos, side, mode = 0) {
      if (mode & IterMode.ExcludeBuffers)
        return null;
      let { buffer } = this.context;
      let index2 = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side);
      return index2 < 0 ? null : new BufferNode(this.context, this, index2);
    }
    get parent() {
      return this._parent || this.context.parent.nextSignificantParent();
    }
    externalSibling(dir) {
      return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4);
    }
    get nextSibling() {
      let { buffer } = this.context;
      let after = buffer.buffer[this.index + 3];
      if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length))
        return new BufferNode(this.context, this._parent, after);
      return this.externalSibling(1);
    }
    get prevSibling() {
      let { buffer } = this.context;
      let parentStart = this._parent ? this._parent.index + 4 : 0;
      if (this.index == parentStart)
        return this.externalSibling(-1);
      return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4));
    }
    get tree() {
      return null;
    }
    toTree() {
      let children = [], positions = [];
      let { buffer } = this.context;
      let startI = this.index + 4, endI = buffer.buffer[this.index + 3];
      if (endI > startI) {
        let from = buffer.buffer[this.index + 1];
        children.push(buffer.slice(startI, endI, from));
        positions.push(0);
      }
      return new Tree(this.type, children, positions, this.to - this.from);
    }
    toString() {
      return this.context.buffer.childString(this.index);
    }
  }
  function iterStack(heads) {
    if (!heads.length)
      return null;
    let pick = 0, picked = heads[0];
    for (let i2 = 1; i2 < heads.length; i2++) {
      let node = heads[i2];
      if (node.from > picked.from || node.to < picked.to) {
        picked = node;
        pick = i2;
      }
    }
    let next = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;
    let newHeads = heads.slice();
    if (next)
      newHeads[pick] = next;
    else
      newHeads.splice(pick, 1);
    return new StackIterator(newHeads, picked);
  }
  class StackIterator {
    constructor(heads, node) {
      this.heads = heads;
      this.node = node;
    }
    get next() {
      return iterStack(this.heads);
    }
  }
  function stackIterator(tree, pos, side) {
    let inner = tree.resolveInner(pos, side), layers = null;
    for (let scan = inner instanceof TreeNode ? inner : inner.context.parent; scan; scan = scan.parent) {
      if (scan.index < 0) {
        let parent = scan.parent;
        (layers || (layers = [inner])).push(parent.resolve(pos, side));
        scan = parent;
      } else {
        let mount = MountedTree.get(scan.tree);
        if (mount && mount.overlay && mount.overlay[0].from <= pos && mount.overlay[mount.overlay.length - 1].to >= pos) {
          let root = new TreeNode(mount.tree, mount.overlay[0].from + scan.from, -1, scan);
          (layers || (layers = [inner])).push(resolveNode(root, pos, side, false));
        }
      }
    }
    return layers ? iterStack(layers) : inner;
  }
  class TreeCursor {
    get name() {
      return this.type.name;
    }
    constructor(node, mode = 0) {
      this.mode = mode;
      this.buffer = null;
      this.stack = [];
      this.index = 0;
      this.bufferNode = null;
      if (node instanceof TreeNode) {
        this.yieldNode(node);
      } else {
        this._tree = node.context.parent;
        this.buffer = node.context;
        for (let n = node._parent; n; n = n._parent)
          this.stack.unshift(n.index);
        this.bufferNode = node;
        this.yieldBuf(node.index);
      }
    }
    yieldNode(node) {
      if (!node)
        return false;
      this._tree = node;
      this.type = node.type;
      this.from = node.from;
      this.to = node.to;
      return true;
    }
    yieldBuf(index2, type) {
      this.index = index2;
      let { start, buffer } = this.buffer;
      this.type = type || buffer.set.types[buffer.buffer[index2]];
      this.from = start + buffer.buffer[index2 + 1];
      this.to = start + buffer.buffer[index2 + 2];
      return true;
    }
    yield(node) {
      if (!node)
        return false;
      if (node instanceof TreeNode) {
        this.buffer = null;
        return this.yieldNode(node);
      }
      this.buffer = node.context;
      return this.yieldBuf(node.index, node.type);
    }
    toString() {
      return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();
    }
    enterChild(dir, pos, side) {
      if (!this.buffer)
        return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode));
      let { buffer } = this.buffer;
      let index2 = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side);
      if (index2 < 0)
        return false;
      this.stack.push(this.index);
      return this.yieldBuf(index2);
    }
    firstChild() {
      return this.enterChild(1, 0, 4);
    }
    lastChild() {
      return this.enterChild(-1, 0, 4);
    }
    childAfter(pos) {
      return this.enterChild(1, pos, 2);
    }
    childBefore(pos) {
      return this.enterChild(-1, pos, -2);
    }
    enter(pos, side, mode = this.mode) {
      if (!this.buffer)
        return this.yield(this._tree.enter(pos, side, mode));
      return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);
    }
    parent() {
      if (!this.buffer)
        return this.yieldNode(this.mode & IterMode.IncludeAnonymous ? this._tree._parent : this._tree.parent);
      if (this.stack.length)
        return this.yieldBuf(this.stack.pop());
      let parent = this.mode & IterMode.IncludeAnonymous ? this.buffer.parent : this.buffer.parent.nextSignificantParent();
      this.buffer = null;
      return this.yieldNode(parent);
    }
    sibling(dir) {
      if (!this.buffer)
        return !this._tree._parent ? false : this.yield(this._tree.index < 0 ? null : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4, this.mode));
      let { buffer } = this.buffer, d = this.stack.length - 1;
      if (dir < 0) {
        let parentStart = d < 0 ? 0 : this.stack[d] + 4;
        if (this.index != parentStart)
          return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4));
      } else {
        let after = buffer.buffer[this.index + 3];
        if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3]))
          return this.yieldBuf(after);
      }
      return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4, this.mode)) : false;
    }
    nextSibling() {
      return this.sibling(1);
    }
    prevSibling() {
      return this.sibling(-1);
    }
    atLastNode(dir) {
      let index2, parent, { buffer } = this;
      if (buffer) {
        if (dir > 0) {
          if (this.index < buffer.buffer.buffer.length)
            return false;
        } else {
          for (let i2 = 0; i2 < this.index; i2++)
            if (buffer.buffer.buffer[i2 + 3] < this.index)
              return false;
        }
        ({ index: index2, parent } = buffer);
      } else {
        ({ index: index2, _parent: parent } = this._tree);
      }
      for (; parent; { index: index2, _parent: parent } = parent) {
        if (index2 > -1)
          for (let i2 = index2 + dir, e = dir < 0 ? -1 : parent._tree.children.length; i2 != e; i2 += dir) {
            let child = parent._tree.children[i2];
            if (this.mode & IterMode.IncludeAnonymous || child instanceof TreeBuffer || !child.type.isAnonymous || hasChild(child))
              return false;
          }
      }
      return true;
    }
    move(dir, enter) {
      if (enter && this.enterChild(dir, 0, 4))
        return true;
      for (; ; ) {
        if (this.sibling(dir))
          return true;
        if (this.atLastNode(dir) || !this.parent())
          return false;
      }
    }
    next(enter = true) {
      return this.move(1, enter);
    }
    prev(enter = true) {
      return this.move(-1, enter);
    }
    moveTo(pos, side = 0) {
      while (this.from == this.to || (side < 1 ? this.from >= pos : this.from > pos) || (side > -1 ? this.to <= pos : this.to < pos))
        if (!this.parent())
          break;
      while (this.enterChild(1, pos, side)) {
      }
      return this;
    }
    get node() {
      if (!this.buffer)
        return this._tree;
      let cache2 = this.bufferNode, result = null, depth = 0;
      if (cache2 && cache2.context == this.buffer) {
        scan:
          for (let index2 = this.index, d = this.stack.length; d >= 0; ) {
            for (let c = cache2; c; c = c._parent)
              if (c.index == index2) {
                if (index2 == this.index)
                  return c;
                result = c;
                depth = d + 1;
                break scan;
              }
            index2 = this.stack[--d];
          }
      }
      for (let i2 = depth; i2 < this.stack.length; i2++)
        result = new BufferNode(this.buffer, result, this.stack[i2]);
      return this.bufferNode = new BufferNode(this.buffer, result, this.index);
    }
    get tree() {
      return this.buffer ? null : this._tree._tree;
    }
    iterate(enter, leave) {
      for (let depth = 0; ; ) {
        let mustLeave = false;
        if (this.type.isAnonymous || enter(this) !== false) {
          if (this.firstChild()) {
            depth++;
            continue;
          }
          if (!this.type.isAnonymous)
            mustLeave = true;
        }
        for (; ; ) {
          if (mustLeave && leave)
            leave(this);
          mustLeave = this.type.isAnonymous;
          if (this.nextSibling())
            break;
          if (!depth)
            return;
          this.parent();
          depth--;
          mustLeave = true;
        }
      }
    }
    matchContext(context) {
      if (!this.buffer)
        return matchNodeContext(this.node, context);
      let { buffer } = this.buffer, { types: types2 } = buffer.set;
      for (let i2 = context.length - 1, d = this.stack.length - 1; i2 >= 0; d--) {
        if (d < 0)
          return matchNodeContext(this.node, context, i2);
        let type = types2[buffer.buffer[this.stack[d]]];
        if (!type.isAnonymous) {
          if (context[i2] && context[i2] != type.name)
            return false;
          i2--;
        }
      }
      return true;
    }
  }
  function hasChild(tree) {
    return tree.children.some((ch) => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));
  }
  function buildTree(data2) {
    var _a2;
    let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data2;
    let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;
    let types2 = nodeSet.types;
    let contextHash = 0, lookAhead = 0;
    function takeNode(parentStart, minPos, children2, positions2, inRepeat, depth) {
      let { id: id2, start, end, size } = cursor;
      let lookAheadAtStart = lookAhead;
      while (size < 0) {
        cursor.next();
        if (size == -1) {
          let node2 = reused[id2];
          children2.push(node2);
          positions2.push(start - parentStart);
          return;
        } else if (size == -3) {
          contextHash = id2;
          return;
        } else if (size == -4) {
          lookAhead = id2;
          return;
        } else {
          throw new RangeError(`Unrecognized record size: ${size}`);
        }
      }
      let type = types2[id2], node, buffer2;
      let startPos = start - parentStart;
      if (end - start <= maxBufferLength && (buffer2 = findBufferSize(cursor.pos - minPos, inRepeat))) {
        let data3 = new Uint16Array(buffer2.size - buffer2.skip);
        let endPos = cursor.pos - buffer2.size, index2 = data3.length;
        while (cursor.pos > endPos)
          index2 = copyToBuffer(buffer2.start, data3, index2);
        node = new TreeBuffer(data3, end - buffer2.start, nodeSet);
        startPos = buffer2.start - parentStart;
      } else {
        let endPos = cursor.pos - size;
        cursor.next();
        let localChildren = [], localPositions = [];
        let localInRepeat = id2 >= minRepeatType ? id2 : -1;
        let lastGroup = 0, lastEnd = end;
        while (cursor.pos > endPos) {
          if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {
            if (cursor.end <= lastEnd - maxBufferLength) {
              makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart);
              lastGroup = localChildren.length;
              lastEnd = cursor.end;
            }
            cursor.next();
          } else if (depth > 2500) {
            takeFlatNode(start, endPos, localChildren, localPositions);
          } else {
            takeNode(start, endPos, localChildren, localPositions, localInRepeat, depth + 1);
          }
        }
        if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)
          makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);
        localChildren.reverse();
        localPositions.reverse();
        if (localInRepeat > -1 && lastGroup > 0) {
          let make = makeBalanced(type);
          node = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);
        } else {
          node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);
        }
      }
      children2.push(node);
      positions2.push(startPos);
    }
    function takeFlatNode(parentStart, minPos, children2, positions2) {
      let nodes = [];
      let nodeCount = 0, stopAt = -1;
      while (cursor.pos > minPos) {
        let { id: id2, start, end, size } = cursor;
        if (size > 4) {
          cursor.next();
        } else if (stopAt > -1 && start < stopAt) {
          break;
        } else {
          if (stopAt < 0)
            stopAt = end - maxBufferLength;
          nodes.push(id2, start, end);
          nodeCount++;
          cursor.next();
        }
      }
      if (nodeCount) {
        let buffer2 = new Uint16Array(nodeCount * 4);
        let start = nodes[nodes.length - 2];
        for (let i2 = nodes.length - 3, j = 0; i2 >= 0; i2 -= 3) {
          buffer2[j++] = nodes[i2];
          buffer2[j++] = nodes[i2 + 1] - start;
          buffer2[j++] = nodes[i2 + 2] - start;
          buffer2[j++] = j;
        }
        children2.push(new TreeBuffer(buffer2, nodes[2] - start, nodeSet));
        positions2.push(start - parentStart);
      }
    }
    function makeBalanced(type) {
      return (children2, positions2, length2) => {
        let lookAhead2 = 0, lastI = children2.length - 1, last, lookAheadProp;
        if (lastI >= 0 && (last = children2[lastI]) instanceof Tree) {
          if (!lastI && last.type == type && last.length == length2)
            return last;
          if (lookAheadProp = last.prop(NodeProp.lookAhead))
            lookAhead2 = positions2[lastI] + last.length + lookAheadProp;
        }
        return makeTree(type, children2, positions2, length2, lookAhead2);
      };
    }
    function makeRepeatLeaf(children2, positions2, base2, i2, from, to, type, lookAhead2) {
      let localChildren = [], localPositions = [];
      while (children2.length > i2) {
        localChildren.push(children2.pop());
        localPositions.push(positions2.pop() + base2 - from);
      }
      children2.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead2 - to));
      positions2.push(from - base2);
    }
    function makeTree(type, children2, positions2, length2, lookAhead2 = 0, props) {
      if (contextHash) {
        let pair2 = [NodeProp.contextHash, contextHash];
        props = props ? [pair2].concat(props) : [pair2];
      }
      if (lookAhead2 > 25) {
        let pair2 = [NodeProp.lookAhead, lookAhead2];
        props = props ? [pair2].concat(props) : [pair2];
      }
      return new Tree(type, children2, positions2, length2, props);
    }
    function findBufferSize(maxSize, inRepeat) {
      let fork = cursor.fork();
      let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;
      let result = { size: 0, start: 0, skip: 0 };
      scan:
        for (let minPos = fork.pos - maxSize; fork.pos > minPos; ) {
          let nodeSize2 = fork.size;
          if (fork.id == inRepeat && nodeSize2 >= 0) {
            result.size = size;
            result.start = start;
            result.skip = skip;
            skip += 4;
            size += 4;
            fork.next();
            continue;
          }
          let startPos = fork.pos - nodeSize2;
          if (nodeSize2 < 0 || startPos < minPos || fork.start < minStart)
            break;
          let localSkipped = fork.id >= minRepeatType ? 4 : 0;
          let nodeStart2 = fork.start;
          fork.next();
          while (fork.pos > startPos) {
            if (fork.size < 0) {
              if (fork.size == -3)
                localSkipped += 4;
              else
                break scan;
            } else if (fork.id >= minRepeatType) {
              localSkipped += 4;
            }
            fork.next();
          }
          start = nodeStart2;
          size += nodeSize2;
          skip += localSkipped;
        }
      if (inRepeat < 0 || size == maxSize) {
        result.size = size;
        result.start = start;
        result.skip = skip;
      }
      return result.size > 4 ? result : void 0;
    }
    function copyToBuffer(bufferStart, buffer2, index2) {
      let { id: id2, start, end, size } = cursor;
      cursor.next();
      if (size >= 0 && id2 < minRepeatType) {
        let startIndex = index2;
        if (size > 4) {
          let endPos = cursor.pos - (size - 4);
          while (cursor.pos > endPos)
            index2 = copyToBuffer(bufferStart, buffer2, index2);
        }
        buffer2[--index2] = startIndex;
        buffer2[--index2] = end - bufferStart;
        buffer2[--index2] = start - bufferStart;
        buffer2[--index2] = id2;
      } else if (size == -3) {
        contextHash = id2;
      } else if (size == -4) {
        lookAhead = id2;
      }
      return index2;
    }
    let children = [], positions = [];
    while (cursor.pos > 0)
      takeNode(data2.start || 0, data2.bufferStart || 0, children, positions, -1, 0);
    let length = (_a2 = data2.length) !== null && _a2 !== void 0 ? _a2 : children.length ? positions[0] + children[0].length : 0;
    return new Tree(types2[data2.topID], children.reverse(), positions.reverse(), length);
  }
  const nodeSizeCache = new WeakMap();
  function nodeSize(balanceType, node) {
    if (!balanceType.isAnonymous || node instanceof TreeBuffer || node.type != balanceType)
      return 1;
    let size = nodeSizeCache.get(node);
    if (size == null) {
      size = 1;
      for (let child of node.children) {
        if (child.type != balanceType || !(child instanceof Tree)) {
          size = 1;
          break;
        }
        size += nodeSize(balanceType, child);
      }
      nodeSizeCache.set(node, size);
    }
    return size;
  }
  function balanceRange(balanceType, children, positions, from, to, start, length, mkTop, mkTree) {
    let total = 0;
    for (let i2 = from; i2 < to; i2++)
      total += nodeSize(balanceType, children[i2]);
    let maxChild = Math.ceil(total * 1.5 / 8);
    let localChildren = [], localPositions = [];
    function divide(children2, positions2, from2, to2, offset) {
      for (let i2 = from2; i2 < to2; ) {
        let groupFrom = i2, groupStart = positions2[i2], groupSize = nodeSize(balanceType, children2[i2]);
        i2++;
        for (; i2 < to2; i2++) {
          let nextSize = nodeSize(balanceType, children2[i2]);
          if (groupSize + nextSize >= maxChild)
            break;
          groupSize += nextSize;
        }
        if (i2 == groupFrom + 1) {
          if (groupSize > maxChild) {
            let only = children2[groupFrom];
            divide(only.children, only.positions, 0, only.children.length, positions2[groupFrom] + offset);
            continue;
          }
          localChildren.push(children2[groupFrom]);
        } else {
          let length2 = positions2[i2 - 1] + children2[i2 - 1].length - groupStart;
          localChildren.push(balanceRange(balanceType, children2, positions2, groupFrom, i2, groupStart, length2, null, mkTree));
        }
        localPositions.push(groupStart + offset - start);
      }
    }
    divide(children, positions, from, to, 0);
    return (mkTop || mkTree)(localChildren, localPositions, length);
  }
  class NodeWeakMap {
    constructor() {
      this.map = new WeakMap();
    }
    setBuffer(buffer, index2, value2) {
      let inner = this.map.get(buffer);
      if (!inner)
        this.map.set(buffer, inner = new Map());
      inner.set(index2, value2);
    }
    getBuffer(buffer, index2) {
      let inner = this.map.get(buffer);
      return inner && inner.get(index2);
    }
    set(node, value2) {
      if (node instanceof BufferNode)
        this.setBuffer(node.context.buffer, node.index, value2);
      else if (node instanceof TreeNode)
        this.map.set(node.tree, value2);
    }
    get(node) {
      return node instanceof BufferNode ? this.getBuffer(node.context.buffer, node.index) : node instanceof TreeNode ? this.map.get(node.tree) : void 0;
    }
    cursorSet(cursor, value2) {
      if (cursor.buffer)
        this.setBuffer(cursor.buffer.buffer, cursor.index, value2);
      else
        this.map.set(cursor.tree, value2);
    }
    cursorGet(cursor) {
      return cursor.buffer ? this.getBuffer(cursor.buffer.buffer, cursor.index) : this.map.get(cursor.tree);
    }
  }
  class TreeFragment {
    constructor(from, to, tree, offset, openStart = false, openEnd = false) {
      this.from = from;
      this.to = to;
      this.tree = tree;
      this.offset = offset;
      this.open = (openStart ? 1 : 0) | (openEnd ? 2 : 0);
    }
    get openStart() {
      return (this.open & 1) > 0;
    }
    get openEnd() {
      return (this.open & 2) > 0;
    }
    static addTree(tree, fragments = [], partial = false) {
      let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];
      for (let f of fragments)
        if (f.to > tree.length)
          result.push(f);
      return result;
    }
    static applyChanges(fragments, changes, minGap = 128) {
      if (!changes.length)
        return fragments;
      let result = [];
      let fI = 1, nextF = fragments.length ? fragments[0] : null;
      for (let cI = 0, pos = 0, off2 = 0; ; cI++) {
        let nextC = cI < changes.length ? changes[cI] : null;
        let nextPos = nextC ? nextC.fromA : 1e9;
        if (nextPos - pos >= minGap)
          while (nextF && nextF.from < nextPos) {
            let cut = nextF;
            if (pos >= cut.from || nextPos <= cut.to || off2) {
              let fFrom = Math.max(cut.from, pos) - off2, fTo = Math.min(cut.to, nextPos) - off2;
              cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off2, cI > 0, !!nextC);
            }
            if (cut)
              result.push(cut);
            if (nextF.to > nextPos)
              break;
            nextF = fI < fragments.length ? fragments[fI++] : null;
          }
        if (!nextC)
          break;
        pos = nextC.toA;
        off2 = nextC.toA - nextC.toB;
      }
      return result;
    }
  }
  class Parser {
    startParse(input, fragments, ranges) {
      if (typeof input == "string")
        input = new StringInput(input);
      ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map((r) => new Range(r.from, r.to)) : [new Range(0, 0)];
      return this.createParse(input, fragments || [], ranges);
    }
    parse(input, fragments, ranges) {
      let parse2 = this.startParse(input, fragments, ranges);
      for (; ; ) {
        let done = parse2.advance();
        if (done)
          return done;
      }
    }
  }
  class StringInput {
    constructor(string2) {
      this.string = string2;
    }
    get length() {
      return this.string.length;
    }
    chunk(from) {
      return this.string.slice(from);
    }
    get lineChunks() {
      return false;
    }
    read(from, to) {
      return this.string.slice(from, to);
    }
  }
  new NodeProp({ perNode: true });
  let nextTagID = 0;
  class Tag {
    constructor(set, base2, modified) {
      this.set = set;
      this.base = base2;
      this.modified = modified;
      this.id = nextTagID++;
    }
    static define(parent) {
      if (parent === null || parent === void 0 ? void 0 : parent.base)
        throw new Error("Can not derive from a modified tag");
      let tag = new Tag([], null, []);
      tag.set.push(tag);
      if (parent)
        for (let t2 of parent.set)
          tag.set.push(t2);
      return tag;
    }
    static defineModifier() {
      let mod = new Modifier();
      return (tag) => {
        if (tag.modified.indexOf(mod) > -1)
          return tag;
        return Modifier.get(tag.base || tag, tag.modified.concat(mod).sort((a, b) => a.id - b.id));
      };
    }
  }
  let nextModifierID = 0;
  class Modifier {
    constructor() {
      this.instances = [];
      this.id = nextModifierID++;
    }
    static get(base2, mods) {
      if (!mods.length)
        return base2;
      let exists = mods[0].instances.find((t2) => t2.base == base2 && sameArray(mods, t2.modified));
      if (exists)
        return exists;
      let set = [], tag = new Tag(set, base2, mods);
      for (let m of mods)
        m.instances.push(tag);
      let configs = powerSet(mods);
      for (let parent of base2.set)
        if (!parent.modified.length)
          for (let config2 of configs)
            set.push(Modifier.get(parent, config2));
      return tag;
    }
  }
  function sameArray(a, b) {
    return a.length == b.length && a.every((x, i2) => x == b[i2]);
  }
  function powerSet(array) {
    let sets = [[]];
    for (let i2 = 0; i2 < array.length; i2++) {
      for (let j = 0, e = sets.length; j < e; j++) {
        sets.push(sets[j].concat(array[i2]));
      }
    }
    return sets.sort((a, b) => b.length - a.length);
  }
  function styleTags(spec) {
    let byName = Object.create(null);
    for (let prop in spec) {
      let tags2 = spec[prop];
      if (!Array.isArray(tags2))
        tags2 = [tags2];
      for (let part of prop.split(" "))
        if (part) {
          let pieces = [], mode = 2, rest2 = part;
          for (let pos = 0; ; ) {
            if (rest2 == "..." && pos > 0 && pos + 3 == part.length) {
              mode = 1;
              break;
            }
            let m = /^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest2);
            if (!m)
              throw new RangeError("Invalid path: " + part);
            pieces.push(m[0] == "*" ? "" : m[0][0] == '"' ? JSON.parse(m[0]) : m[0]);
            pos += m[0].length;
            if (pos == part.length)
              break;
            let next = part[pos++];
            if (pos == part.length && next == "!") {
              mode = 0;
              break;
            }
            if (next != "/")
              throw new RangeError("Invalid path: " + part);
            rest2 = part.slice(pos);
          }
          let last = pieces.length - 1, inner = pieces[last];
          if (!inner)
            throw new RangeError("Invalid path: " + part);
          let rule = new Rule(tags2, mode, last > 0 ? pieces.slice(0, last) : null);
          byName[inner] = rule.sort(byName[inner]);
        }
    }
    return ruleNodeProp.add(byName);
  }
  const ruleNodeProp = new NodeProp();
  class Rule {
    constructor(tags2, mode, context, next) {
      this.tags = tags2;
      this.mode = mode;
      this.context = context;
      this.next = next;
    }
    get opaque() {
      return this.mode == 0;
    }
    get inherit() {
      return this.mode == 1;
    }
    sort(other) {
      if (!other || other.depth < this.depth) {
        this.next = other;
        return this;
      }
      other.next = this.sort(other.next);
      return other;
    }
    get depth() {
      return this.context ? this.context.length : 0;
    }
  }
  Rule.empty = new Rule([], 2, null);
  function tagHighlighter(tags2, options) {
    let map = Object.create(null);
    for (let style of tags2) {
      if (!Array.isArray(style.tag))
        map[style.tag.id] = style.class;
      else
        for (let tag of style.tag)
          map[tag.id] = style.class;
    }
    let { scope, all = null } = options || {};
    return {
      style: (tags3) => {
        let cls = all;
        for (let tag of tags3) {
          for (let sub of tag.set) {
            let tagClass = map[sub.id];
            if (tagClass) {
              cls = cls ? cls + " " + tagClass : tagClass;
              break;
            }
          }
        }
        return cls;
      },
      scope
    };
  }
  function highlightTags(highlighters, tags2) {
    let result = null;
    for (let highlighter of highlighters) {
      let value2 = highlighter.style(tags2);
      if (value2)
        result = result ? result + " " + value2 : value2;
    }
    return result;
  }
  function highlightTree(tree, highlighter, putStyle, from = 0, to = tree.length) {
    let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);
    builder.highlightRange(tree.cursor(), from, to, "", builder.highlighters);
    builder.flush(to);
  }
  class HighlightBuilder {
    constructor(at, highlighters, span) {
      this.at = at;
      this.highlighters = highlighters;
      this.span = span;
      this.class = "";
    }
    startSpan(at, cls) {
      if (cls != this.class) {
        this.flush(at);
        if (at > this.at)
          this.at = at;
        this.class = cls;
      }
    }
    flush(to) {
      if (to > this.at && this.class)
        this.span(this.at, to, this.class);
    }
    highlightRange(cursor, from, to, inheritedClass, highlighters) {
      let { type, from: start, to: end } = cursor;
      if (start >= to || end <= from)
        return;
      if (type.isTop)
        highlighters = this.highlighters.filter((h) => !h.scope || h.scope(type));
      let cls = inheritedClass;
      let rule = getStyleTags(cursor) || Rule.empty;
      let tagCls = highlightTags(highlighters, rule.tags);
      if (tagCls) {
        if (cls)
          cls += " ";
        cls += tagCls;
        if (rule.mode == 1)
          inheritedClass += (inheritedClass ? " " : "") + tagCls;
      }
      this.startSpan(Math.max(from, start), cls);
      if (rule.opaque)
        return;
      let mounted = cursor.tree && cursor.tree.prop(NodeProp.mounted);
      if (mounted && mounted.overlay) {
        let inner = cursor.node.enter(mounted.overlay[0].from + start, 1);
        let innerHighlighters = this.highlighters.filter((h) => !h.scope || h.scope(mounted.tree.type));
        let hasChild2 = cursor.firstChild();
        for (let i2 = 0, pos = start; ; i2++) {
          let next = i2 < mounted.overlay.length ? mounted.overlay[i2] : null;
          let nextPos = next ? next.from + start : end;
          let rangeFrom = Math.max(from, pos), rangeTo = Math.min(to, nextPos);
          if (rangeFrom < rangeTo && hasChild2) {
            while (cursor.from < rangeTo) {
              this.highlightRange(cursor, rangeFrom, rangeTo, inheritedClass, highlighters);
              this.startSpan(Math.min(rangeTo, cursor.to), cls);
              if (cursor.to >= nextPos || !cursor.nextSibling())
                break;
            }
          }
          if (!next || nextPos > to)
            break;
          pos = next.to + start;
          if (pos > from) {
            this.highlightRange(inner.cursor(), Math.max(from, next.from + start), Math.min(to, pos), "", innerHighlighters);
            this.startSpan(Math.min(to, pos), cls);
          }
        }
        if (hasChild2)
          cursor.parent();
      } else if (cursor.firstChild()) {
        if (mounted)
          inheritedClass = "";
        do {
          if (cursor.to <= from)
            continue;
          if (cursor.from >= to)
            break;
          this.highlightRange(cursor, from, to, inheritedClass, highlighters);
          this.startSpan(Math.min(to, cursor.to), cls);
        } while (cursor.nextSibling());
        cursor.parent();
      }
    }
  }
  function getStyleTags(node) {
    let rule = node.type.prop(ruleNodeProp);
    while (rule && rule.context && !node.matchContext(rule.context))
      rule = rule.next;
    return rule || null;
  }
  const t = Tag.define;
  const comment = t(), name = t(), typeName = t(name), propertyName = t(name), literal = t(), string = t(literal), number = t(literal), content = t(), heading = t(content), keyword = t(), operator = t(), punctuation = t(), bracket = t(punctuation), meta = t();
  const tags = {
    comment,
    lineComment: t(comment),
    blockComment: t(comment),
    docComment: t(comment),
    name,
    variableName: t(name),
    typeName,
    tagName: t(typeName),
    propertyName,
    attributeName: t(propertyName),
    className: t(name),
    labelName: t(name),
    namespace: t(name),
    macroName: t(name),
    literal,
    string,
    docString: t(string),
    character: t(string),
    attributeValue: t(string),
    number,
    integer: t(number),
    float: t(number),
    bool: t(literal),
    regexp: t(literal),
    escape: t(literal),
    color: t(literal),
    url: t(literal),
    keyword,
    self: t(keyword),
    null: t(keyword),
    atom: t(keyword),
    unit: t(keyword),
    modifier: t(keyword),
    operatorKeyword: t(keyword),
    controlKeyword: t(keyword),
    definitionKeyword: t(keyword),
    moduleKeyword: t(keyword),
    operator,
    derefOperator: t(operator),
    arithmeticOperator: t(operator),
    logicOperator: t(operator),
    bitwiseOperator: t(operator),
    compareOperator: t(operator),
    updateOperator: t(operator),
    definitionOperator: t(operator),
    typeOperator: t(operator),
    controlOperator: t(operator),
    punctuation,
    separator: t(punctuation),
    bracket,
    angleBracket: t(bracket),
    squareBracket: t(bracket),
    paren: t(bracket),
    brace: t(bracket),
    content,
    heading,
    heading1: t(heading),
    heading2: t(heading),
    heading3: t(heading),
    heading4: t(heading),
    heading5: t(heading),
    heading6: t(heading),
    contentSeparator: t(content),
    list: t(content),
    quote: t(content),
    emphasis: t(content),
    strong: t(content),
    link: t(content),
    monospace: t(content),
    strikethrough: t(content),
    inserted: t(),
    deleted: t(),
    changed: t(),
    invalid: t(),
    meta,
    documentMeta: t(meta),
    annotation: t(meta),
    processingInstruction: t(meta),
    definition: Tag.defineModifier(),
    constant: Tag.defineModifier(),
    function: Tag.defineModifier(),
    standard: Tag.defineModifier(),
    local: Tag.defineModifier(),
    special: Tag.defineModifier()
  };
  tagHighlighter([
    { tag: tags.link, class: "tok-link" },
    { tag: tags.heading, class: "tok-heading" },
    { tag: tags.emphasis, class: "tok-emphasis" },
    { tag: tags.strong, class: "tok-strong" },
    { tag: tags.keyword, class: "tok-keyword" },
    { tag: tags.atom, class: "tok-atom" },
    { tag: tags.bool, class: "tok-bool" },
    { tag: tags.url, class: "tok-url" },
    { tag: tags.labelName, class: "tok-labelName" },
    { tag: tags.inserted, class: "tok-inserted" },
    { tag: tags.deleted, class: "tok-deleted" },
    { tag: tags.literal, class: "tok-literal" },
    { tag: tags.string, class: "tok-string" },
    { tag: tags.number, class: "tok-number" },
    { tag: [tags.regexp, tags.escape, tags.special(tags.string)], class: "tok-string2" },
    { tag: tags.variableName, class: "tok-variableName" },
    { tag: tags.local(tags.variableName), class: "tok-variableName tok-local" },
    { tag: tags.definition(tags.variableName), class: "tok-variableName tok-definition" },
    { tag: tags.special(tags.variableName), class: "tok-variableName2" },
    { tag: tags.definition(tags.propertyName), class: "tok-propertyName tok-definition" },
    { tag: tags.typeName, class: "tok-typeName" },
    { tag: tags.namespace, class: "tok-namespace" },
    { tag: tags.className, class: "tok-className" },
    { tag: tags.macroName, class: "tok-macroName" },
    { tag: tags.propertyName, class: "tok-propertyName" },
    { tag: tags.operator, class: "tok-operator" },
    { tag: tags.comment, class: "tok-comment" },
    { tag: tags.meta, class: "tok-meta" },
    { tag: tags.invalid, class: "tok-invalid" },
    { tag: tags.punctuation, class: "tok-punctuation" }
  ]);
  var _a;
  const languageDataProp = /* @__PURE__ */ new NodeProp();
  function defineLanguageFacet(baseData) {
    return Facet.define({
      combine: baseData ? (values) => values.concat(baseData) : void 0
    });
  }
  const sublanguageProp = /* @__PURE__ */ new NodeProp();
  class Language {
    constructor(data2, parser2, extraExtensions = [], name2 = "") {
      this.data = data2;
      this.name = name2;
      if (!EditorState.prototype.hasOwnProperty("tree"))
        Object.defineProperty(EditorState.prototype, "tree", { get() {
          return syntaxTree(this);
        } });
      this.parser = parser2;
      this.extension = [
        language.of(this),
        EditorState.languageData.of((state, pos, side) => {
          let top2 = topNodeAt(state, pos, side), data3 = top2.type.prop(languageDataProp);
          if (!data3)
            return [];
          let base2 = state.facet(data3), sub = top2.type.prop(sublanguageProp);
          if (sub) {
            let innerNode = top2.resolve(pos - top2.from, side);
            for (let sublang of sub)
              if (sublang.test(innerNode, state)) {
                let data4 = state.facet(sublang.facet);
                return sublang.type == "replace" ? data4 : data4.concat(base2);
              }
          }
          return base2;
        })
      ].concat(extraExtensions);
    }
    isActiveAt(state, pos, side = -1) {
      return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;
    }
    findRegions(state) {
      let lang = state.facet(language);
      if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data)
        return [{ from: 0, to: state.doc.length }];
      if (!lang || !lang.allowsNesting)
        return [];
      let result = [];
      let explore = (tree, from) => {
        if (tree.prop(languageDataProp) == this.data) {
          result.push({ from, to: from + tree.length });
          return;
        }
        let mount = tree.prop(NodeProp.mounted);
        if (mount) {
          if (mount.tree.prop(languageDataProp) == this.data) {
            if (mount.overlay)
              for (let r of mount.overlay)
                result.push({ from: r.from + from, to: r.to + from });
            else
              result.push({ from, to: from + tree.length });
            return;
          } else if (mount.overlay) {
            let size = result.length;
            explore(mount.tree, mount.overlay[0].from + from);
            if (result.length > size)
              return;
          }
        }
        for (let i2 = 0; i2 < tree.children.length; i2++) {
          let ch = tree.children[i2];
          if (ch instanceof Tree)
            explore(ch, tree.positions[i2] + from);
        }
      };
      explore(syntaxTree(state), 0);
      return result;
    }
    get allowsNesting() {
      return true;
    }
  }
  Language.setState = /* @__PURE__ */ StateEffect.define();
  function topNodeAt(state, pos, side) {
    let topLang = state.facet(language), tree = syntaxTree(state).topNode;
    if (!topLang || topLang.allowsNesting) {
      for (let node = tree; node; node = node.enter(pos, side, IterMode.ExcludeBuffers))
        if (node.type.isTop)
          tree = node;
    }
    return tree;
  }
  class LRLanguage extends Language {
    constructor(data2, parser2, name2) {
      super(data2, parser2, [], name2);
      this.parser = parser2;
    }
    static define(spec) {
      let data2 = defineLanguageFacet(spec.languageData);
      return new LRLanguage(data2, spec.parser.configure({
        props: [languageDataProp.add((type) => type.isTop ? data2 : void 0)]
      }), spec.name);
    }
    configure(options, name2) {
      return new LRLanguage(this.data, this.parser.configure(options), name2 || this.name);
    }
    get allowsNesting() {
      return this.parser.hasWrappers();
    }
  }
  function syntaxTree(state) {
    let field = state.field(Language.state, false);
    return field ? field.tree : Tree.empty;
  }
  class DocInput {
    constructor(doc2) {
      this.doc = doc2;
      this.cursorPos = 0;
      this.string = "";
      this.cursor = doc2.iter();
    }
    get length() {
      return this.doc.length;
    }
    syncTo(pos) {
      this.string = this.cursor.next(pos - this.cursorPos).value;
      this.cursorPos = pos + this.string.length;
      return this.cursorPos - this.string.length;
    }
    chunk(pos) {
      this.syncTo(pos);
      return this.string;
    }
    get lineChunks() {
      return true;
    }
    read(from, to) {
      let stringStart = this.cursorPos - this.string.length;
      if (from < stringStart || to >= this.cursorPos)
        return this.doc.sliceString(from, to);
      else
        return this.string.slice(from - stringStart, to - stringStart);
    }
  }
  let currentContext = null;
  class ParseContext {
    constructor(parser2, state, fragments = [], tree, treeLen, viewport, skipped, scheduleOn) {
      this.parser = parser2;
      this.state = state;
      this.fragments = fragments;
      this.tree = tree;
      this.treeLen = treeLen;
      this.viewport = viewport;
      this.skipped = skipped;
      this.scheduleOn = scheduleOn;
      this.parse = null;
      this.tempSkipped = [];
    }
    static create(parser2, state, viewport) {
      return new ParseContext(parser2, state, [], Tree.empty, 0, viewport, [], null);
    }
    startParse() {
      return this.parser.startParse(new DocInput(this.state.doc), this.fragments);
    }
    work(until, upto) {
      if (upto != null && upto >= this.state.doc.length)
        upto = void 0;
      if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {
        this.takeTree();
        return true;
      }
      return this.withContext(() => {
        var _a2;
        if (typeof until == "number") {
          let endTime = Date.now() + until;
          until = () => Date.now() > endTime;
        }
        if (!this.parse)
          this.parse = this.startParse();
        if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) && upto < this.state.doc.length)
          this.parse.stopAt(upto);
        for (; ; ) {
          let done = this.parse.advance();
          if (done) {
            this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));
            this.treeLen = (_a2 = this.parse.stoppedAt) !== null && _a2 !== void 0 ? _a2 : this.state.doc.length;
            this.tree = done;
            this.parse = null;
            if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))
              this.parse = this.startParse();
            else
              return true;
          }
          if (until())
            return false;
        }
      });
    }
    takeTree() {
      let pos, tree;
      if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) {
        if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos)
          this.parse.stopAt(pos);
        this.withContext(() => {
          while (!(tree = this.parse.advance())) {
          }
        });
        this.treeLen = pos;
        this.tree = tree;
        this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));
        this.parse = null;
      }
    }
    withContext(f) {
      let prev = currentContext;
      currentContext = this;
      try {
        return f();
      } finally {
        currentContext = prev;
      }
    }
    withoutTempSkipped(fragments) {
      for (let r; r = this.tempSkipped.pop(); )
        fragments = cutFragments(fragments, r.from, r.to);
      return fragments;
    }
    changes(changes, newState) {
      let { fragments, tree, treeLen, viewport, skipped } = this;
      this.takeTree();
      if (!changes.empty) {
        let ranges = [];
        changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));
        fragments = TreeFragment.applyChanges(fragments, ranges);
        tree = Tree.empty;
        treeLen = 0;
        viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };
        if (this.skipped.length) {
          skipped = [];
          for (let r of this.skipped) {
            let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1);
            if (from < to)
              skipped.push({ from, to });
          }
        }
      }
      return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn);
    }
    updateViewport(viewport) {
      if (this.viewport.from == viewport.from && this.viewport.to == viewport.to)
        return false;
      this.viewport = viewport;
      let startLen = this.skipped.length;
      for (let i2 = 0; i2 < this.skipped.length; i2++) {
        let { from, to } = this.skipped[i2];
        if (from < viewport.to && to > viewport.from) {
          this.fragments = cutFragments(this.fragments, from, to);
          this.skipped.splice(i2--, 1);
        }
      }
      if (this.skipped.length >= startLen)
        return false;
      this.reset();
      return true;
    }
    reset() {
      if (this.parse) {
        this.takeTree();
        this.parse = null;
      }
    }
    skipUntilInView(from, to) {
      this.skipped.push({ from, to });
    }
    static getSkippingParser(until) {
      return new class extends Parser {
        createParse(input, fragments, ranges) {
          let from = ranges[0].from, to = ranges[ranges.length - 1].to;
          let parser2 = {
            parsedPos: from,
            advance() {
              let cx = currentContext;
              if (cx) {
                for (let r of ranges)
                  cx.tempSkipped.push(r);
                if (until)
                  cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;
              }
              this.parsedPos = to;
              return new Tree(NodeType.none, [], [], to - from);
            },
            stoppedAt: null,
            stopAt() {
            }
          };
          return parser2;
        }
      }();
    }
    isDone(upto) {
      upto = Math.min(upto, this.state.doc.length);
      let frags = this.fragments;
      return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;
    }
    static get() {
      return currentContext;
    }
  }
  function cutFragments(fragments, from, to) {
    return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to, fromB: from, toB: to }]);
  }
  class LanguageState {
    constructor(context) {
      this.context = context;
      this.tree = context.tree;
    }
    apply(tr) {
      if (!tr.docChanged && this.tree == this.context.tree)
        return this;
      let newCx = this.context.changes(tr.changes, tr.state);
      let upto = this.context.treeLen == tr.startState.doc.length ? void 0 : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to);
      if (!newCx.work(20, upto))
        newCx.takeTree();
      return new LanguageState(newCx);
    }
    static init(state) {
      let vpTo = Math.min(3e3, state.doc.length);
      let parseState = ParseContext.create(state.facet(language).parser, state, { from: 0, to: vpTo });
      if (!parseState.work(20, vpTo))
        parseState.takeTree();
      return new LanguageState(parseState);
    }
  }
  Language.state = /* @__PURE__ */ StateField.define({
    create: LanguageState.init,
    update(value2, tr) {
      for (let e of tr.effects)
        if (e.is(Language.setState))
          return e.value;
      if (tr.startState.facet(language) != tr.state.facet(language))
        return LanguageState.init(tr.state);
      return value2.apply(tr);
    }
  });
  let requestIdle = (callback) => {
    let timeout = setTimeout(() => callback(), 500);
    return () => clearTimeout(timeout);
  };
  if (typeof requestIdleCallback != "undefined")
    requestIdle = (callback) => {
      let idle = -1, timeout = setTimeout(() => {
        idle = requestIdleCallback(callback, { timeout: 500 - 100 });
      }, 100);
      return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);
    };
  const isInputPending = typeof navigator != "undefined" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending) ? () => navigator.scheduling.isInputPending() : null;
  const parseWorker = /* @__PURE__ */ ViewPlugin.fromClass(class ParseWorker {
    constructor(view) {
      this.view = view;
      this.working = null;
      this.workScheduled = 0;
      this.chunkEnd = -1;
      this.chunkBudget = -1;
      this.work = this.work.bind(this);
      this.scheduleWork();
    }
    update(update) {
      let cx = this.view.state.field(Language.state).context;
      if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)
        this.scheduleWork();
      if (update.docChanged || update.selectionSet) {
        if (this.view.hasFocus)
          this.chunkBudget += 50;
        this.scheduleWork();
      }
      this.checkAsyncSchedule(cx);
    }
    scheduleWork() {
      if (this.working)
        return;
      let { state } = this.view, field = state.field(Language.state);
      if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))
        this.working = requestIdle(this.work);
    }
    work(deadline) {
      this.working = null;
      let now = Date.now();
      if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) {
        this.chunkEnd = now + 3e4;
        this.chunkBudget = 3e3;
      }
      if (this.chunkBudget <= 0)
        return;
      let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language.state);
      if (field.tree == field.context.tree && field.context.isDone(vpTo + 1e5))
        return;
      let endTime = Date.now() + Math.min(this.chunkBudget, 100, deadline && !isInputPending ? Math.max(25, deadline.timeRemaining() - 5) : 1e9);
      let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1e3;
      let done = field.context.work(() => {
        return isInputPending && isInputPending() || Date.now() > endTime;
      }, vpTo + (viewportFirst ? 0 : 1e5));
      this.chunkBudget -= Date.now() - now;
      if (done || this.chunkBudget <= 0) {
        field.context.takeTree();
        this.view.dispatch({ effects: Language.setState.of(new LanguageState(field.context)) });
      }
      if (this.chunkBudget > 0 && !(done && !viewportFirst))
        this.scheduleWork();
      this.checkAsyncSchedule(field.context);
    }
    checkAsyncSchedule(cx) {
      if (cx.scheduleOn) {
        this.workScheduled++;
        cx.scheduleOn.then(() => this.scheduleWork()).catch((err) => logException(this.view.state, err)).then(() => this.workScheduled--);
        cx.scheduleOn = null;
      }
    }
    destroy() {
      if (this.working)
        this.working();
    }
    isWorking() {
      return !!(this.working || this.workScheduled > 0);
    }
  }, {
    eventHandlers: { focus() {
      this.scheduleWork();
    } }
  });
  const language = /* @__PURE__ */ Facet.define({
    combine(languages) {
      return languages.length ? languages[0] : null;
    },
    enables: (language2) => [
      Language.state,
      parseWorker,
      EditorView.contentAttributes.compute([language2], (state) => {
        let lang = state.facet(language2);
        return lang && lang.name ? { "data-language": lang.name } : {};
      })
    ]
  });
  class LanguageSupport {
    constructor(language2, support = []) {
      this.language = language2;
      this.support = support;
      this.extension = [language2, support];
    }
  }
  const indentService = /* @__PURE__ */ Facet.define();
  const indentUnit = /* @__PURE__ */ Facet.define({
    combine: (values) => {
      if (!values.length)
        return "  ";
      let unit = values[0];
      if (!unit || /\S/.test(unit) || Array.from(unit).some((e) => e != unit[0]))
        throw new Error("Invalid indent unit: " + JSON.stringify(values[0]));
      return unit;
    }
  });
  function getIndentUnit(state) {
    let unit = state.facet(indentUnit);
    return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;
  }
  function indentString(state, cols) {
    let result = "", ts = state.tabSize, ch = state.facet(indentUnit)[0];
    if (ch == "	") {
      while (cols >= ts) {
        result += "	";
        cols -= ts;
      }
      ch = " ";
    }
    for (let i2 = 0; i2 < cols; i2++)
      result += ch;
    return result;
  }
  function getIndentation(context, pos) {
    if (context instanceof EditorState)
      context = new IndentContext(context);
    for (let service of context.state.facet(indentService)) {
      let result = service(context, pos);
      if (result !== void 0)
        return result;
    }
    let tree = syntaxTree(context.state);
    return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;
  }
  class IndentContext {
    constructor(state, options = {}) {
      this.state = state;
      this.options = options;
      this.unit = getIndentUnit(state);
    }
    lineAt(pos, bias = 1) {
      let line = this.state.doc.lineAt(pos);
      let { simulateBreak, simulateDoubleBreak } = this.options;
      if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {
        if (simulateDoubleBreak && simulateBreak == pos)
          return { text: "", from: pos };
        else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)
          return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };
        else
          return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };
      }
      return line;
    }
    textAfterPos(pos, bias = 1) {
      if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak)
        return "";
      let { text, from } = this.lineAt(pos, bias);
      return text.slice(pos - from, Math.min(text.length, pos + 100 - from));
    }
    column(pos, bias = 1) {
      let { text, from } = this.lineAt(pos, bias);
      let result = this.countColumn(text, pos - from);
      let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;
      if (override > -1)
        result += override - this.countColumn(text, text.search(/\S|$/));
      return result;
    }
    countColumn(line, pos = line.length) {
      return countColumn(line, this.state.tabSize, pos);
    }
    lineIndent(pos, bias = 1) {
      let { text, from } = this.lineAt(pos, bias);
      let override = this.options.overrideIndentation;
      if (override) {
        let overriden = override(from);
        if (overriden > -1)
          return overriden;
      }
      return this.countColumn(text, text.search(/\S|$/));
    }
    get simulatedBreak() {
      return this.options.simulateBreak || null;
    }
  }
  const indentNodeProp = /* @__PURE__ */ new NodeProp();
  function syntaxIndentation(cx, ast, pos) {
    let stack = ast.resolveStack(pos);
    let inner = stack.node.enterUnfinishedNodesBefore(pos);
    if (inner != stack.node) {
      let add2 = [];
      for (let cur2 = inner; cur2 != stack.node; cur2 = cur2.parent)
        add2.push(cur2);
      for (let i2 = add2.length - 1; i2 >= 0; i2--)
        stack = { node: add2[i2], next: stack };
    }
    return indentFor(stack, cx, pos);
  }
  function indentFor(stack, cx, pos) {
    for (let cur2 = stack; cur2; cur2 = cur2.next) {
      let strategy = indentStrategy(cur2.node);
      if (strategy)
        return strategy(TreeIndentContext.create(cx, pos, cur2));
    }
    return 0;
  }
  function ignoreClosed(cx) {
    return cx.pos == cx.options.simulateBreak && cx.options.simulateDoubleBreak;
  }
  function indentStrategy(tree) {
    let strategy = tree.type.prop(indentNodeProp);
    if (strategy)
      return strategy;
    let first = tree.firstChild, close;
    if (first && (close = first.type.prop(NodeProp.closedBy))) {
      let last = tree.lastChild, closed = last && close.indexOf(last.name) > -1;
      return (cx) => delimitedStrategy(cx, true, 1, void 0, closed && !ignoreClosed(cx) ? last.from : void 0);
    }
    return tree.parent == null ? topIndent : null;
  }
  function topIndent() {
    return 0;
  }
  class TreeIndentContext extends IndentContext {
    constructor(base2, pos, context) {
      super(base2.state, base2.options);
      this.base = base2;
      this.pos = pos;
      this.context = context;
    }
    get node() {
      return this.context.node;
    }
    static create(base2, pos, context) {
      return new TreeIndentContext(base2, pos, context);
    }
    get textAfter() {
      return this.textAfterPos(this.pos);
    }
    get baseIndent() {
      return this.baseIndentFor(this.node);
    }
    baseIndentFor(node) {
      let line = this.state.doc.lineAt(node.from);
      for (; ; ) {
        let atBreak = node.resolve(line.from);
        while (atBreak.parent && atBreak.parent.from == atBreak.from)
          atBreak = atBreak.parent;
        if (isParent(atBreak, node))
          break;
        line = this.state.doc.lineAt(atBreak.from);
      }
      return this.lineIndent(line.from);
    }
    continue() {
      return indentFor(this.context.next, this.base, this.pos);
    }
  }
  function isParent(parent, of) {
    for (let cur2 = of; cur2; cur2 = cur2.parent)
      if (parent == cur2)
        return true;
    return false;
  }
  function bracketedAligned(context) {
    let tree = context.node;
    let openToken = tree.childAfter(tree.from), last = tree.lastChild;
    if (!openToken)
      return null;
    let sim = context.options.simulateBreak;
    let openLine = context.state.doc.lineAt(openToken.from);
    let lineEnd = sim == null || sim <= openLine.from ? openLine.to : Math.min(openLine.to, sim);
    for (let pos = openToken.to; ; ) {
      let next = tree.childAfter(pos);
      if (!next || next == last)
        return null;
      if (!next.type.isSkipped)
        return next.from < lineEnd ? openToken : null;
      pos = next.to;
    }
  }
  function delimitedIndent({ closing: closing2, align = true, units = 1 }) {
    return (context) => delimitedStrategy(context, align, units, closing2);
  }
  function delimitedStrategy(context, align, units, closing2, closedAt) {
    let after = context.textAfter, space2 = after.match(/^\s*/)[0].length;
    let closed = closing2 && after.slice(space2, space2 + closing2.length) == closing2 || closedAt == context.pos + space2;
    let aligned = align ? bracketedAligned(context) : null;
    if (aligned)
      return closed ? context.column(aligned.from) : context.column(aligned.to);
    return context.baseIndent + (closed ? 0 : context.unit * units);
  }
  const flatIndent = (context) => context.baseIndent;
  function continuedIndent({ except, units = 1 } = {}) {
    return (context) => {
      let matchExcept = except && except.test(context.textAfter);
      return context.baseIndent + (matchExcept ? 0 : units * context.unit);
    };
  }
  const DontIndentBeyond = 200;
  function indentOnInput() {
    return EditorState.transactionFilter.of((tr) => {
      if (!tr.docChanged || !tr.isUserEvent("input.type") && !tr.isUserEvent("input.complete"))
        return tr;
      let rules = tr.startState.languageDataAt("indentOnInput", tr.startState.selection.main.head);
      if (!rules.length)
        return tr;
      let doc2 = tr.newDoc, { head } = tr.newSelection.main, line = doc2.lineAt(head);
      if (head > line.from + DontIndentBeyond)
        return tr;
      let lineStart = doc2.sliceString(line.from, head);
      if (!rules.some((r) => r.test(lineStart)))
        return tr;
      let { state } = tr, last = -1, changes = [];
      for (let { head: head2 } of state.selection.ranges) {
        let line2 = state.doc.lineAt(head2);
        if (line2.from == last)
          continue;
        last = line2.from;
        let indent = getIndentation(state, line2.from);
        if (indent == null)
          continue;
        let cur2 = /^\s*/.exec(line2.text)[0];
        let norm = indentString(state, indent);
        if (cur2 != norm)
          changes.push({ from: line2.from, to: line2.from + cur2.length, insert: norm });
      }
      return changes.length ? [tr, { changes, sequential: true }] : tr;
    });
  }
  const foldService = /* @__PURE__ */ Facet.define();
  const foldNodeProp = /* @__PURE__ */ new NodeProp();
  function foldInside(node) {
    let first = node.firstChild, last = node.lastChild;
    return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node.to : last.from } : null;
  }
  function syntaxFolding(state, start, end) {
    let tree = syntaxTree(state);
    if (tree.length < end)
      return null;
    let stack = tree.resolveStack(end, 1);
    let found = null;
    for (let iter = stack; iter; iter = iter.next) {
      let cur2 = iter.node;
      if (cur2.to <= end || cur2.from > end)
        continue;
      if (found && cur2.from < start)
        break;
      let prop = cur2.type.prop(foldNodeProp);
      if (prop && (cur2.to < tree.length - 50 || tree.length == state.doc.length || !isUnfinished(cur2))) {
        let value2 = prop(cur2, state);
        if (value2 && value2.from <= end && value2.from >= start && value2.to > end)
          found = value2;
      }
    }
    return found;
  }
  function isUnfinished(node) {
    let ch = node.lastChild;
    return ch && ch.to == node.to && ch.type.isError;
  }
  function foldable(state, lineStart, lineEnd) {
    for (let service of state.facet(foldService)) {
      let result = service(state, lineStart, lineEnd);
      if (result)
        return result;
    }
    return syntaxFolding(state, lineStart, lineEnd);
  }
  function mapRange(range, mapping) {
    let from = mapping.mapPos(range.from, 1), to = mapping.mapPos(range.to, -1);
    return from >= to ? void 0 : { from, to };
  }
  const foldEffect = /* @__PURE__ */ StateEffect.define({ map: mapRange });
  const unfoldEffect = /* @__PURE__ */ StateEffect.define({ map: mapRange });
  function selectedLines(view) {
    let lines = [];
    for (let { head } of view.state.selection.ranges) {
      if (lines.some((l) => l.from <= head && l.to >= head))
        continue;
      lines.push(view.lineBlockAt(head));
    }
    return lines;
  }
  const foldState = /* @__PURE__ */ StateField.define({
    create() {
      return Decoration.none;
    },
    update(folded, tr) {
      folded = folded.map(tr.changes);
      for (let e of tr.effects) {
        if (e.is(foldEffect) && !foldExists(folded, e.value.from, e.value.to)) {
          let { preparePlaceholder } = tr.state.facet(foldConfig);
          let widget = !preparePlaceholder ? foldWidget : Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, e.value)) });
          folded = folded.update({ add: [widget.range(e.value.from, e.value.to)] });
        } else if (e.is(unfoldEffect)) {
          folded = folded.update({
            filter: (from, to) => e.value.from != from || e.value.to != to,
            filterFrom: e.value.from,
            filterTo: e.value.to
          });
        }
      }
      if (tr.selection) {
        let onSelection = false, { head } = tr.selection.main;
        folded.between(head, head, (a, b) => {
          if (a < head && b > head)
            onSelection = true;
        });
        if (onSelection)
          folded = folded.update({
            filterFrom: head,
            filterTo: head,
            filter: (a, b) => b <= head || a >= head
          });
      }
      return folded;
    },
    provide: (f) => EditorView.decorations.from(f),
    toJSON(folded, state) {
      let ranges = [];
      folded.between(0, state.doc.length, (from, to) => {
        ranges.push(from, to);
      });
      return ranges;
    },
    fromJSON(value2) {
      if (!Array.isArray(value2) || value2.length % 2)
        throw new RangeError("Invalid JSON for fold state");
      let ranges = [];
      for (let i2 = 0; i2 < value2.length; ) {
        let from = value2[i2++], to = value2[i2++];
        if (typeof from != "number" || typeof to != "number")
          throw new RangeError("Invalid JSON for fold state");
        ranges.push(foldWidget.range(from, to));
      }
      return Decoration.set(ranges, true);
    }
  });
  function findFold(state, from, to) {
    var _a2;
    let found = null;
    (_a2 = state.field(foldState, false)) === null || _a2 === void 0 ? void 0 : _a2.between(from, to, (from2, to2) => {
      if (!found || found.from > from2)
        found = { from: from2, to: to2 };
    });
    return found;
  }
  function foldExists(folded, from, to) {
    let found = false;
    folded.between(from, from, (a, b) => {
      if (a == from && b == to)
        found = true;
    });
    return found;
  }
  function maybeEnable(state, other) {
    return state.field(foldState, false) ? other : other.concat(StateEffect.appendConfig.of(codeFolding()));
  }
  const foldCode = (view) => {
    for (let line of selectedLines(view)) {
      let range = foldable(view.state, line.from, line.to);
      if (range) {
        view.dispatch({ effects: maybeEnable(view.state, [foldEffect.of(range), announceFold(view, range)]) });
        return true;
      }
    }
    return false;
  };
  const unfoldCode = (view) => {
    if (!view.state.field(foldState, false))
      return false;
    let effects = [];
    for (let line of selectedLines(view)) {
      let folded = findFold(view.state, line.from, line.to);
      if (folded)
        effects.push(unfoldEffect.of(folded), announceFold(view, folded, false));
    }
    if (effects.length)
      view.dispatch({ effects });
    return effects.length > 0;
  };
  function announceFold(view, range, fold = true) {
    let lineFrom = view.state.doc.lineAt(range.from).number, lineTo = view.state.doc.lineAt(range.to).number;
    return EditorView.announce.of(`${view.state.phrase(fold ? "Folded lines" : "Unfolded lines")} ${lineFrom} ${view.state.phrase("to")} ${lineTo}.`);
  }
  const foldAll = (view) => {
    let { state } = view, effects = [];
    for (let pos = 0; pos < state.doc.length; ) {
      let line = view.lineBlockAt(pos), range = foldable(state, line.from, line.to);
      if (range)
        effects.push(foldEffect.of(range));
      pos = (range ? view.lineBlockAt(range.to) : line).to + 1;
    }
    if (effects.length)
      view.dispatch({ effects: maybeEnable(view.state, effects) });
    return !!effects.length;
  };
  const unfoldAll = (view) => {
    let field = view.state.field(foldState, false);
    if (!field || !field.size)
      return false;
    let effects = [];
    field.between(0, view.state.doc.length, (from, to) => {
      effects.push(unfoldEffect.of({ from, to }));
    });
    view.dispatch({ effects });
    return true;
  };
  const foldKeymap = [
    { key: "Ctrl-Shift-[", mac: "Cmd-Alt-[", run: foldCode },
    { key: "Ctrl-Shift-]", mac: "Cmd-Alt-]", run: unfoldCode },
    { key: "Ctrl-Alt-[", run: foldAll },
    { key: "Ctrl-Alt-]", run: unfoldAll }
  ];
  const defaultConfig = {
    placeholderDOM: null,
    preparePlaceholder: null,
    placeholderText: "\u2026"
  };
  const foldConfig = /* @__PURE__ */ Facet.define({
    combine(values) {
      return combineConfig(values, defaultConfig);
    }
  });
  function codeFolding(config2) {
    let result = [foldState, baseTheme$1$2];
    if (config2)
      result.push(foldConfig.of(config2));
    return result;
  }
  function widgetToDOM(view, prepared) {
    let { state } = view, conf = state.facet(foldConfig);
    let onclick = (event) => {
      let line = view.lineBlockAt(view.posAtDOM(event.target));
      let folded = findFold(view.state, line.from, line.to);
      if (folded)
        view.dispatch({ effects: unfoldEffect.of(folded) });
      event.preventDefault();
    };
    if (conf.placeholderDOM)
      return conf.placeholderDOM(view, onclick, prepared);
    let element = document.createElement("span");
    element.textContent = conf.placeholderText;
    element.setAttribute("aria-label", state.phrase("folded code"));
    element.title = state.phrase("unfold");
    element.className = "cm-foldPlaceholder";
    element.onclick = onclick;
    return element;
  }
  const foldWidget = /* @__PURE__ */ Decoration.replace({ widget: /* @__PURE__ */ new class extends WidgetType {
    toDOM(view) {
      return widgetToDOM(view, null);
    }
  }() });
  class PreparedFoldWidget extends WidgetType {
    constructor(value2) {
      super();
      this.value = value2;
    }
    eq(other) {
      return this.value == other.value;
    }
    toDOM(view) {
      return widgetToDOM(view, this.value);
    }
  }
  const foldGutterDefaults = {
    openText: "\u2304",
    closedText: "\u203A",
    markerDOM: null,
    domEventHandlers: {},
    foldingChanged: () => false
  };
  class FoldMarker extends GutterMarker {
    constructor(config2, open2) {
      super();
      this.config = config2;
      this.open = open2;
    }
    eq(other) {
      return this.config == other.config && this.open == other.open;
    }
    toDOM(view) {
      if (this.config.markerDOM)
        return this.config.markerDOM(this.open);
      let span = document.createElement("span");
      span.textContent = this.open ? this.config.openText : this.config.closedText;
      span.title = view.state.phrase(this.open ? "Fold line" : "Unfold line");
      return span;
    }
  }
  function foldGutter(config2 = {}) {
    let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config2);
    let canFold = new FoldMarker(fullConfig, true), canUnfold = new FoldMarker(fullConfig, false);
    let markers = ViewPlugin.fromClass(class {
      constructor(view) {
        this.from = view.viewport.from;
        this.markers = this.buildMarkers(view);
      }
      update(update) {
        if (update.docChanged || update.viewportChanged || update.startState.facet(language) != update.state.facet(language) || update.startState.field(foldState, false) != update.state.field(foldState, false) || syntaxTree(update.startState) != syntaxTree(update.state) || fullConfig.foldingChanged(update))
          this.markers = this.buildMarkers(update.view);
      }
      buildMarkers(view) {
        let builder = new RangeSetBuilder();
        for (let line of view.viewportLineBlocks) {
          let mark = findFold(view.state, line.from, line.to) ? canUnfold : foldable(view.state, line.from, line.to) ? canFold : null;
          if (mark)
            builder.add(line.from, line.from, mark);
        }
        return builder.finish();
      }
    });
    let { domEventHandlers } = fullConfig;
    return [
      markers,
      gutter({
        class: "cm-foldGutter",
        markers(view) {
          var _a2;
          return ((_a2 = view.plugin(markers)) === null || _a2 === void 0 ? void 0 : _a2.markers) || RangeSet.empty;
        },
        initialSpacer() {
          return new FoldMarker(fullConfig, false);
        },
        domEventHandlers: Object.assign(Object.assign({}, domEventHandlers), { click: (view, line, event) => {
          if (domEventHandlers.click && domEventHandlers.click(view, line, event))
            return true;
          let folded = findFold(view.state, line.from, line.to);
          if (folded) {
            view.dispatch({ effects: unfoldEffect.of(folded) });
            return true;
          }
          let range = foldable(view.state, line.from, line.to);
          if (range) {
            view.dispatch({ effects: foldEffect.of(range) });
            return true;
          }
          return false;
        } })
      }),
      codeFolding()
    ];
  }
  const baseTheme$1$2 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-foldPlaceholder": {
      backgroundColor: "#eee",
      border: "1px solid #ddd",
      color: "#888",
      borderRadius: ".2em",
      margin: "0 1px",
      padding: "0 1px",
      cursor: "pointer"
    },
    ".cm-foldGutter span": {
      padding: "0 1px",
      cursor: "pointer"
    }
  });
  class HighlightStyle {
    constructor(specs, options) {
      this.specs = specs;
      let modSpec;
      function def(spec) {
        let cls = StyleModule.newName();
        (modSpec || (modSpec = Object.create(null)))["." + cls] = spec;
        return cls;
      }
      const all = typeof options.all == "string" ? options.all : options.all ? def(options.all) : void 0;
      const scopeOpt = options.scope;
      this.scope = scopeOpt instanceof Language ? (type) => type.prop(languageDataProp) == scopeOpt.data : scopeOpt ? (type) => type == scopeOpt : void 0;
      this.style = tagHighlighter(specs.map((style) => ({
        tag: style.tag,
        class: style.class || def(Object.assign({}, style, { tag: null }))
      })), {
        all
      }).style;
      this.module = modSpec ? new StyleModule(modSpec) : null;
      this.themeType = options.themeType;
    }
    static define(specs, options) {
      return new HighlightStyle(specs, options || {});
    }
  }
  const highlighterFacet = /* @__PURE__ */ Facet.define();
  const fallbackHighlighter = /* @__PURE__ */ Facet.define({
    combine(values) {
      return values.length ? [values[0]] : null;
    }
  });
  function getHighlighters(state) {
    let main = state.facet(highlighterFacet);
    return main.length ? main : state.facet(fallbackHighlighter);
  }
  function syntaxHighlighting(highlighter, options) {
    let ext = [treeHighlighter], themeType;
    if (highlighter instanceof HighlightStyle) {
      if (highlighter.module)
        ext.push(EditorView.styleModule.of(highlighter.module));
      themeType = highlighter.themeType;
    }
    if (options === null || options === void 0 ? void 0 : options.fallback)
      ext.push(fallbackHighlighter.of(highlighter));
    else if (themeType)
      ext.push(highlighterFacet.computeN([EditorView.darkTheme], (state) => {
        return state.facet(EditorView.darkTheme) == (themeType == "dark") ? [highlighter] : [];
      }));
    else
      ext.push(highlighterFacet.of(highlighter));
    return ext;
  }
  class TreeHighlighter {
    constructor(view) {
      this.markCache = Object.create(null);
      this.tree = syntaxTree(view.state);
      this.decorations = this.buildDeco(view, getHighlighters(view.state));
    }
    update(update) {
      let tree = syntaxTree(update.state), highlighters = getHighlighters(update.state);
      let styleChange = highlighters != getHighlighters(update.startState);
      if (tree.length < update.view.viewport.to && !styleChange && tree.type == this.tree.type) {
        this.decorations = this.decorations.map(update.changes);
      } else if (tree != this.tree || update.viewportChanged || styleChange) {
        this.tree = tree;
        this.decorations = this.buildDeco(update.view, highlighters);
      }
    }
    buildDeco(view, highlighters) {
      if (!highlighters || !this.tree.length)
        return Decoration.none;
      let builder = new RangeSetBuilder();
      for (let { from, to } of view.visibleRanges) {
        highlightTree(this.tree, highlighters, (from2, to2, style) => {
          builder.add(from2, to2, this.markCache[style] || (this.markCache[style] = Decoration.mark({ class: style })));
        }, from, to);
      }
      return builder.finish();
    }
  }
  const treeHighlighter = /* @__PURE__ */ Prec.high(/* @__PURE__ */ ViewPlugin.fromClass(TreeHighlighter, {
    decorations: (v) => v.decorations
  }));
  const defaultHighlightStyle = /* @__PURE__ */ HighlightStyle.define([
    {
      tag: tags.meta,
      color: "#404740"
    },
    {
      tag: tags.link,
      textDecoration: "underline"
    },
    {
      tag: tags.heading,
      textDecoration: "underline",
      fontWeight: "bold"
    },
    {
      tag: tags.emphasis,
      fontStyle: "italic"
    },
    {
      tag: tags.strong,
      fontWeight: "bold"
    },
    {
      tag: tags.strikethrough,
      textDecoration: "line-through"
    },
    {
      tag: tags.keyword,
      color: "#708"
    },
    {
      tag: [tags.atom, tags.bool, tags.url, tags.contentSeparator, tags.labelName],
      color: "#219"
    },
    {
      tag: [tags.literal, tags.inserted],
      color: "#164"
    },
    {
      tag: [tags.string, tags.deleted],
      color: "#a11"
    },
    {
      tag: [tags.regexp, tags.escape, /* @__PURE__ */ tags.special(tags.string)],
      color: "#e40"
    },
    {
      tag: /* @__PURE__ */ tags.definition(tags.variableName),
      color: "#00f"
    },
    {
      tag: /* @__PURE__ */ tags.local(tags.variableName),
      color: "#30a"
    },
    {
      tag: [tags.typeName, tags.namespace],
      color: "#085"
    },
    {
      tag: tags.className,
      color: "#167"
    },
    {
      tag: [/* @__PURE__ */ tags.special(tags.variableName), tags.macroName],
      color: "#256"
    },
    {
      tag: /* @__PURE__ */ tags.definition(tags.propertyName),
      color: "#00c"
    },
    {
      tag: tags.comment,
      color: "#940"
    },
    {
      tag: tags.invalid,
      color: "#f00"
    }
  ]);
  const baseTheme$4 = /* @__PURE__ */ EditorView.baseTheme({
    "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" },
    "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" }
  });
  const DefaultScanDist = 1e4, DefaultBrackets = "()[]{}";
  const bracketMatchingConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      return combineConfig(configs, {
        afterCursor: true,
        brackets: DefaultBrackets,
        maxScanDistance: DefaultScanDist,
        renderMatch: defaultRenderMatch
      });
    }
  });
  const matchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-matchingBracket" }), nonmatchingMark = /* @__PURE__ */ Decoration.mark({ class: "cm-nonmatchingBracket" });
  function defaultRenderMatch(match) {
    let decorations2 = [];
    let mark = match.matched ? matchingMark : nonmatchingMark;
    decorations2.push(mark.range(match.start.from, match.start.to));
    if (match.end)
      decorations2.push(mark.range(match.end.from, match.end.to));
    return decorations2;
  }
  const bracketMatchingState = /* @__PURE__ */ StateField.define({
    create() {
      return Decoration.none;
    },
    update(deco, tr) {
      if (!tr.docChanged && !tr.selection)
        return deco;
      let decorations2 = [];
      let config2 = tr.state.facet(bracketMatchingConfig);
      for (let range of tr.state.selection.ranges) {
        if (!range.empty)
          continue;
        let match = matchBrackets(tr.state, range.head, -1, config2) || range.head > 0 && matchBrackets(tr.state, range.head - 1, 1, config2) || config2.afterCursor && (matchBrackets(tr.state, range.head, 1, config2) || range.head < tr.state.doc.length && matchBrackets(tr.state, range.head + 1, -1, config2));
        if (match)
          decorations2 = decorations2.concat(config2.renderMatch(match, tr.state));
      }
      return Decoration.set(decorations2, true);
    },
    provide: (f) => EditorView.decorations.from(f)
  });
  const bracketMatchingUnique = [
    bracketMatchingState,
    baseTheme$4
  ];
  function bracketMatching(config2 = {}) {
    return [bracketMatchingConfig.of(config2), bracketMatchingUnique];
  }
  const bracketMatchingHandle = /* @__PURE__ */ new NodeProp();
  function matchingNodes(node, dir, brackets) {
    let byProp = node.prop(dir < 0 ? NodeProp.openedBy : NodeProp.closedBy);
    if (byProp)
      return byProp;
    if (node.name.length == 1) {
      let index2 = brackets.indexOf(node.name);
      if (index2 > -1 && index2 % 2 == (dir < 0 ? 1 : 0))
        return [brackets[index2 + dir]];
    }
    return null;
  }
  function findHandle(node) {
    let hasHandle = node.type.prop(bracketMatchingHandle);
    return hasHandle ? hasHandle(node.node) : node;
  }
  function matchBrackets(state, pos, dir, config2 = {}) {
    let maxScanDistance = config2.maxScanDistance || DefaultScanDist, brackets = config2.brackets || DefaultBrackets;
    let tree = syntaxTree(state), node = tree.resolveInner(pos, dir);
    for (let cur2 = node; cur2; cur2 = cur2.parent) {
      let matches2 = matchingNodes(cur2.type, dir, brackets);
      if (matches2 && cur2.from < cur2.to) {
        let handle = findHandle(cur2);
        if (handle && (dir > 0 ? pos >= handle.from && pos < handle.to : pos > handle.from && pos <= handle.to))
          return matchMarkedBrackets(state, pos, dir, cur2, handle, matches2, brackets);
      }
    }
    return matchPlainBrackets(state, pos, dir, tree, node.type, maxScanDistance, brackets);
  }
  function matchMarkedBrackets(_state, _pos, dir, token, handle, matching, brackets) {
    let parent = token.parent, firstToken = { from: handle.from, to: handle.to };
    let depth = 0, cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();
    if (cursor && (dir < 0 ? cursor.childBefore(token.from) : cursor.childAfter(token.to)))
      do {
        if (dir < 0 ? cursor.to <= token.from : cursor.from >= token.to) {
          if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {
            let endHandle = findHandle(cursor);
            return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : void 0, matched: true };
          } else if (matchingNodes(cursor.type, dir, brackets)) {
            depth++;
          } else if (matchingNodes(cursor.type, -dir, brackets)) {
            if (depth == 0) {
              let endHandle = findHandle(cursor);
              return {
                start: firstToken,
                end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : void 0,
                matched: false
              };
            }
            depth--;
          }
        }
      } while (dir < 0 ? cursor.prevSibling() : cursor.nextSibling());
    return { start: firstToken, matched: false };
  }
  function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, brackets) {
    let startCh = dir < 0 ? state.sliceDoc(pos - 1, pos) : state.sliceDoc(pos, pos + 1);
    let bracket2 = brackets.indexOf(startCh);
    if (bracket2 < 0 || bracket2 % 2 == 0 != dir > 0)
      return null;
    let startToken = { from: dir < 0 ? pos - 1 : pos, to: dir > 0 ? pos + 1 : pos };
    let iter = state.doc.iterRange(pos, dir > 0 ? state.doc.length : 0), depth = 0;
    for (let distance = 0; !iter.next().done && distance <= maxScanDistance; ) {
      let text = iter.value;
      if (dir < 0)
        distance += text.length;
      let basePos = pos + distance * dir;
      for (let pos2 = dir > 0 ? 0 : text.length - 1, end = dir > 0 ? text.length : -1; pos2 != end; pos2 += dir) {
        let found = brackets.indexOf(text[pos2]);
        if (found < 0 || tree.resolveInner(basePos + pos2, 1).type != tokenType)
          continue;
        if (found % 2 == 0 == dir > 0) {
          depth++;
        } else if (depth == 1) {
          return { start: startToken, end: { from: basePos + pos2, to: basePos + pos2 + 1 }, matched: found >> 1 == bracket2 >> 1 };
        } else {
          depth--;
        }
      }
      if (dir > 0)
        distance += text.length;
    }
    return iter.done ? { start: startToken, matched: false } : null;
  }
  const noTokens = /* @__PURE__ */ Object.create(null);
  const typeArray = [NodeType.none];
  const warned = [];
  const defaultTable = /* @__PURE__ */ Object.create(null);
  for (let [legacyName, name2] of [
    ["variable", "variableName"],
    ["variable-2", "variableName.special"],
    ["string-2", "string.special"],
    ["def", "variableName.definition"],
    ["tag", "tagName"],
    ["attribute", "attributeName"],
    ["type", "typeName"],
    ["builtin", "variableName.standard"],
    ["qualifier", "modifier"],
    ["error", "invalid"],
    ["header", "heading"],
    ["property", "propertyName"]
  ])
    defaultTable[legacyName] = /* @__PURE__ */ createTokenType(noTokens, name2);
  function warnForPart(part, msg) {
    if (warned.indexOf(part) > -1)
      return;
    warned.push(part);
    console.warn(msg);
  }
  function createTokenType(extra, tagStr) {
    let tags$1 = [];
    for (let name3 of tagStr.split(" ")) {
      let found = [];
      for (let part of name3.split(".")) {
        let value2 = extra[part] || tags[part];
        if (!value2) {
          warnForPart(part, `Unknown highlighting tag ${part}`);
        } else if (typeof value2 == "function") {
          if (!found.length)
            warnForPart(part, `Modifier ${part} used at start of tag`);
          else
            found = found.map(value2);
        } else {
          if (found.length)
            warnForPart(part, `Tag ${part} used as modifier`);
          else
            found = Array.isArray(value2) ? value2 : [value2];
        }
      }
      for (let tag of found)
        tags$1.push(tag);
    }
    if (!tags$1.length)
      return 0;
    let name2 = tagStr.replace(/ /g, "_"), type = NodeType.define({
      id: typeArray.length,
      name: name2,
      props: [styleTags({ [name2]: tags$1 })]
    });
    typeArray.push(type);
    return type.id;
  }
  const toggleComment = (target) => {
    let { state } = target, line = state.doc.lineAt(state.selection.main.from), config2 = getConfig(target.state, line.from);
    return config2.line ? toggleLineComment(target) : config2.block ? toggleBlockCommentByLine(target) : false;
  };
  function command(f, option) {
    return ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      let tr = f(option, state);
      if (!tr)
        return false;
      dispatch(state.update(tr));
      return true;
    };
  }
  const toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0);
  const toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0);
  const toggleBlockCommentByLine = /* @__PURE__ */ command((o, s) => changeBlockComment(o, s, selectedLineRanges(s)), 0);
  function getConfig(state, pos) {
    let data2 = state.languageDataAt("commentTokens", pos);
    return data2.length ? data2[0] : {};
  }
  const SearchMargin = 50;
  function findBlockComment(state, { open: open2, close }, from, to) {
    let textBefore = state.sliceDoc(from - SearchMargin, from);
    let textAfter = state.sliceDoc(to, to + SearchMargin);
    let spaceBefore = /\s*$/.exec(textBefore)[0].length, spaceAfter = /^\s*/.exec(textAfter)[0].length;
    let beforeOff = textBefore.length - spaceBefore;
    if (textBefore.slice(beforeOff - open2.length, beforeOff) == open2 && textAfter.slice(spaceAfter, spaceAfter + close.length) == close) {
      return {
        open: { pos: from - spaceBefore, margin: spaceBefore && 1 },
        close: { pos: to + spaceAfter, margin: spaceAfter && 1 }
      };
    }
    let startText, endText;
    if (to - from <= 2 * SearchMargin) {
      startText = endText = state.sliceDoc(from, to);
    } else {
      startText = state.sliceDoc(from, from + SearchMargin);
      endText = state.sliceDoc(to - SearchMargin, to);
    }
    let startSpace = /^\s*/.exec(startText)[0].length, endSpace = /\s*$/.exec(endText)[0].length;
    let endOff = endText.length - endSpace - close.length;
    if (startText.slice(startSpace, startSpace + open2.length) == open2 && endText.slice(endOff, endOff + close.length) == close) {
      return {
        open: {
          pos: from + startSpace + open2.length,
          margin: /\s/.test(startText.charAt(startSpace + open2.length)) ? 1 : 0
        },
        close: {
          pos: to - endSpace - close.length,
          margin: /\s/.test(endText.charAt(endOff - 1)) ? 1 : 0
        }
      };
    }
    return null;
  }
  function selectedLineRanges(state) {
    let ranges = [];
    for (let r of state.selection.ranges) {
      let fromLine = state.doc.lineAt(r.from);
      let toLine = r.to <= fromLine.to ? fromLine : state.doc.lineAt(r.to);
      let last = ranges.length - 1;
      if (last >= 0 && ranges[last].to > fromLine.from)
        ranges[last].to = toLine.to;
      else
        ranges.push({ from: fromLine.from + /^\s*/.exec(fromLine.text)[0].length, to: toLine.to });
    }
    return ranges;
  }
  function changeBlockComment(option, state, ranges = state.selection.ranges) {
    let tokens = ranges.map((r) => getConfig(state, r.from).block);
    if (!tokens.every((c) => c))
      return null;
    let comments = ranges.map((r, i2) => findBlockComment(state, tokens[i2], r.from, r.to));
    if (option != 2 && !comments.every((c) => c)) {
      return { changes: state.changes(ranges.map((range, i2) => {
        if (comments[i2])
          return [];
        return [{ from: range.from, insert: tokens[i2].open + " " }, { from: range.to, insert: " " + tokens[i2].close }];
      })) };
    } else if (option != 1 && comments.some((c) => c)) {
      let changes = [];
      for (let i2 = 0, comment2; i2 < comments.length; i2++)
        if (comment2 = comments[i2]) {
          let token = tokens[i2], { open: open2, close } = comment2;
          changes.push({ from: open2.pos - token.open.length, to: open2.pos + open2.margin }, { from: close.pos - close.margin, to: close.pos + token.close.length });
        }
      return { changes };
    }
    return null;
  }
  function changeLineComment(option, state, ranges = state.selection.ranges) {
    let lines = [];
    let prevLine = -1;
    for (let { from, to } of ranges) {
      let startI = lines.length, minIndent = 1e9;
      let token = getConfig(state, from).line;
      if (!token)
        continue;
      for (let pos = from; pos <= to; ) {
        let line = state.doc.lineAt(pos);
        if (line.from > prevLine && (from == to || to > line.from)) {
          prevLine = line.from;
          let indent = /^\s*/.exec(line.text)[0].length;
          let empty2 = indent == line.length;
          let comment2 = line.text.slice(indent, indent + token.length) == token ? indent : -1;
          if (indent < line.text.length && indent < minIndent)
            minIndent = indent;
          lines.push({ line, comment: comment2, token, indent, empty: empty2, single: false });
        }
        pos = line.to + 1;
      }
      if (minIndent < 1e9) {
        for (let i2 = startI; i2 < lines.length; i2++)
          if (lines[i2].indent < lines[i2].line.text.length)
            lines[i2].indent = minIndent;
      }
      if (lines.length == startI + 1)
        lines[startI].single = true;
    }
    if (option != 2 && lines.some((l) => l.comment < 0 && (!l.empty || l.single))) {
      let changes = [];
      for (let { line, token, indent, empty: empty2, single } of lines)
        if (single || !empty2)
          changes.push({ from: line.from + indent, insert: token + " " });
      let changeSet = state.changes(changes);
      return { changes: changeSet, selection: state.selection.map(changeSet, 1) };
    } else if (option != 1 && lines.some((l) => l.comment >= 0)) {
      let changes = [];
      for (let { line, comment: comment2, token } of lines)
        if (comment2 >= 0) {
          let from = line.from + comment2, to = from + token.length;
          if (line.text[to - line.from] == " ")
            to++;
          changes.push({ from, to });
        }
      return { changes };
    }
    return null;
  }
  const fromHistory = /* @__PURE__ */ Annotation.define();
  const isolateHistory = /* @__PURE__ */ Annotation.define();
  const invertedEffects = /* @__PURE__ */ Facet.define();
  const historyConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      return combineConfig(configs, {
        minDepth: 100,
        newGroupDelay: 500,
        joinToEvent: (_t, isAdjacent2) => isAdjacent2
      }, {
        minDepth: Math.max,
        newGroupDelay: Math.min,
        joinToEvent: (a, b) => (tr, adj) => a(tr, adj) || b(tr, adj)
      });
    }
  });
  function changeEnd(changes) {
    let end = 0;
    changes.iterChangedRanges((_, to) => end = to);
    return end;
  }
  const historyField_ = /* @__PURE__ */ StateField.define({
    create() {
      return HistoryState.empty;
    },
    update(state, tr) {
      let config2 = tr.state.facet(historyConfig);
      let fromHist = tr.annotation(fromHistory);
      if (fromHist) {
        let selection = tr.docChanged ? EditorSelection.single(changeEnd(tr.changes)) : void 0;
        let item = HistEvent.fromTransaction(tr, selection), from = fromHist.side;
        let other = from == 0 ? state.undone : state.done;
        if (item)
          other = updateBranch(other, other.length, config2.minDepth, item);
        else
          other = addSelection(other, tr.startState.selection);
        return new HistoryState(from == 0 ? fromHist.rest : other, from == 0 ? other : fromHist.rest);
      }
      let isolate = tr.annotation(isolateHistory);
      if (isolate == "full" || isolate == "before")
        state = state.isolate();
      if (tr.annotation(Transaction.addToHistory) === false)
        return !tr.changes.empty ? state.addMapping(tr.changes.desc) : state;
      let event = HistEvent.fromTransaction(tr);
      let time = tr.annotation(Transaction.time), userEvent = tr.annotation(Transaction.userEvent);
      if (event)
        state = state.addChanges(event, time, userEvent, config2, tr);
      else if (tr.selection)
        state = state.addSelection(tr.startState.selection, time, userEvent, config2.newGroupDelay);
      if (isolate == "full" || isolate == "after")
        state = state.isolate();
      return state;
    },
    toJSON(value2) {
      return { done: value2.done.map((e) => e.toJSON()), undone: value2.undone.map((e) => e.toJSON()) };
    },
    fromJSON(json) {
      return new HistoryState(json.done.map(HistEvent.fromJSON), json.undone.map(HistEvent.fromJSON));
    }
  });
  function history(config2 = {}) {
    return [
      historyField_,
      historyConfig.of(config2),
      EditorView.domEventHandlers({
        beforeinput(e, view) {
          let command2 = e.inputType == "historyUndo" ? undo : e.inputType == "historyRedo" ? redo : null;
          if (!command2)
            return false;
          e.preventDefault();
          return command2(view);
        }
      })
    ];
  }
  function cmd(side, selection) {
    return function({ state, dispatch }) {
      if (!selection && state.readOnly)
        return false;
      let historyState = state.field(historyField_, false);
      if (!historyState)
        return false;
      let tr = historyState.pop(side, state, selection);
      if (!tr)
        return false;
      dispatch(tr);
      return true;
    };
  }
  const undo = /* @__PURE__ */ cmd(0, false);
  const redo = /* @__PURE__ */ cmd(1, false);
  const undoSelection = /* @__PURE__ */ cmd(0, true);
  const redoSelection = /* @__PURE__ */ cmd(1, true);
  class HistEvent {
    constructor(changes, effects, mapped, startSelection, selectionsAfter) {
      this.changes = changes;
      this.effects = effects;
      this.mapped = mapped;
      this.startSelection = startSelection;
      this.selectionsAfter = selectionsAfter;
    }
    setSelAfter(after) {
      return new HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after);
    }
    toJSON() {
      var _a2, _b, _c;
      return {
        changes: (_a2 = this.changes) === null || _a2 === void 0 ? void 0 : _a2.toJSON(),
        mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(),
        startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),
        selectionsAfter: this.selectionsAfter.map((s) => s.toJSON())
      };
    }
    static fromJSON(json) {
      return new HistEvent(json.changes && ChangeSet.fromJSON(json.changes), [], json.mapped && ChangeDesc.fromJSON(json.mapped), json.startSelection && EditorSelection.fromJSON(json.startSelection), json.selectionsAfter.map(EditorSelection.fromJSON));
    }
    static fromTransaction(tr, selection) {
      let effects = none$1;
      for (let invert of tr.startState.facet(invertedEffects)) {
        let result = invert(tr);
        if (result.length)
          effects = effects.concat(result);
      }
      if (!effects.length && tr.changes.empty)
        return null;
      return new HistEvent(tr.changes.invert(tr.startState.doc), effects, void 0, selection || tr.startState.selection, none$1);
    }
    static selection(selections) {
      return new HistEvent(void 0, none$1, void 0, void 0, selections);
    }
  }
  function updateBranch(branch, to, maxLen, newEvent) {
    let start = to + 1 > maxLen + 20 ? to - maxLen - 1 : 0;
    let newBranch = branch.slice(start, to);
    newBranch.push(newEvent);
    return newBranch;
  }
  function isAdjacent(a, b) {
    let ranges = [], isAdjacent2 = false;
    a.iterChangedRanges((f, t2) => ranges.push(f, t2));
    b.iterChangedRanges((_f, _t, f, t2) => {
      for (let i2 = 0; i2 < ranges.length; ) {
        let from = ranges[i2++], to = ranges[i2++];
        if (t2 >= from && f <= to)
          isAdjacent2 = true;
      }
    });
    return isAdjacent2;
  }
  function eqSelectionShape(a, b) {
    return a.ranges.length == b.ranges.length && a.ranges.filter((r, i2) => r.empty != b.ranges[i2].empty).length === 0;
  }
  function conc(a, b) {
    return !a.length ? b : !b.length ? a : a.concat(b);
  }
  const none$1 = [];
  const MaxSelectionsPerEvent = 200;
  function addSelection(branch, selection) {
    if (!branch.length) {
      return [HistEvent.selection([selection])];
    } else {
      let lastEvent = branch[branch.length - 1];
      let sels = lastEvent.selectionsAfter.slice(Math.max(0, lastEvent.selectionsAfter.length - MaxSelectionsPerEvent));
      if (sels.length && sels[sels.length - 1].eq(selection))
        return branch;
      sels.push(selection);
      return updateBranch(branch, branch.length - 1, 1e9, lastEvent.setSelAfter(sels));
    }
  }
  function popSelection(branch) {
    let last = branch[branch.length - 1];
    let newBranch = branch.slice();
    newBranch[branch.length - 1] = last.setSelAfter(last.selectionsAfter.slice(0, last.selectionsAfter.length - 1));
    return newBranch;
  }
  function addMappingToBranch(branch, mapping) {
    if (!branch.length)
      return branch;
    let length = branch.length, selections = none$1;
    while (length) {
      let event = mapEvent(branch[length - 1], mapping, selections);
      if (event.changes && !event.changes.empty || event.effects.length) {
        let result = branch.slice(0, length);
        result[length - 1] = event;
        return result;
      } else {
        mapping = event.mapped;
        length--;
        selections = event.selectionsAfter;
      }
    }
    return selections.length ? [HistEvent.selection(selections)] : none$1;
  }
  function mapEvent(event, mapping, extraSelections) {
    let selections = conc(event.selectionsAfter.length ? event.selectionsAfter.map((s) => s.map(mapping)) : none$1, extraSelections);
    if (!event.changes)
      return HistEvent.selection(selections);
    let mappedChanges = event.changes.map(mapping), before = mapping.mapDesc(event.changes, true);
    let fullMapping = event.mapped ? event.mapped.composeDesc(before) : before;
    return new HistEvent(mappedChanges, StateEffect.mapEffects(event.effects, mapping), fullMapping, event.startSelection.map(before), selections);
  }
  const joinableUserEvent = /^(input\.type|delete)($|\.)/;
  class HistoryState {
    constructor(done, undone, prevTime = 0, prevUserEvent = void 0) {
      this.done = done;
      this.undone = undone;
      this.prevTime = prevTime;
      this.prevUserEvent = prevUserEvent;
    }
    isolate() {
      return this.prevTime ? new HistoryState(this.done, this.undone) : this;
    }
    addChanges(event, time, userEvent, config2, tr) {
      let done = this.done, lastEvent = done[done.length - 1];
      if (lastEvent && lastEvent.changes && !lastEvent.changes.empty && event.changes && (!userEvent || joinableUserEvent.test(userEvent)) && (!lastEvent.selectionsAfter.length && time - this.prevTime < config2.newGroupDelay && config2.joinToEvent(tr, isAdjacent(lastEvent.changes, event.changes)) || userEvent == "input.type.compose")) {
        done = updateBranch(done, done.length - 1, config2.minDepth, new HistEvent(event.changes.compose(lastEvent.changes), conc(event.effects, lastEvent.effects), lastEvent.mapped, lastEvent.startSelection, none$1));
      } else {
        done = updateBranch(done, done.length, config2.minDepth, event);
      }
      return new HistoryState(done, none$1, time, userEvent);
    }
    addSelection(selection, time, userEvent, newGroupDelay) {
      let last = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none$1;
      if (last.length > 0 && time - this.prevTime < newGroupDelay && userEvent == this.prevUserEvent && userEvent && /^select($|\.)/.test(userEvent) && eqSelectionShape(last[last.length - 1], selection))
        return this;
      return new HistoryState(addSelection(this.done, selection), this.undone, time, userEvent);
    }
    addMapping(mapping) {
      return new HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);
    }
    pop(side, state, selection) {
      let branch = side == 0 ? this.done : this.undone;
      if (branch.length == 0)
        return null;
      let event = branch[branch.length - 1];
      if (selection && event.selectionsAfter.length) {
        return state.update({
          selection: event.selectionsAfter[event.selectionsAfter.length - 1],
          annotations: fromHistory.of({ side, rest: popSelection(branch) }),
          userEvent: side == 0 ? "select.undo" : "select.redo",
          scrollIntoView: true
        });
      } else if (!event.changes) {
        return null;
      } else {
        let rest2 = branch.length == 1 ? none$1 : branch.slice(0, branch.length - 1);
        if (event.mapped)
          rest2 = addMappingToBranch(rest2, event.mapped);
        return state.update({
          changes: event.changes,
          selection: event.startSelection,
          effects: event.effects,
          annotations: fromHistory.of({ side, rest: rest2 }),
          filter: false,
          userEvent: side == 0 ? "undo" : "redo",
          scrollIntoView: true
        });
      }
    }
  }
  HistoryState.empty = /* @__PURE__ */ new HistoryState(none$1, none$1);
  const historyKeymap = [
    { key: "Mod-z", run: undo, preventDefault: true },
    { key: "Mod-y", mac: "Mod-Shift-z", run: redo, preventDefault: true },
    { linux: "Ctrl-Shift-z", run: redo, preventDefault: true },
    { key: "Mod-u", run: undoSelection, preventDefault: true },
    { key: "Alt-u", mac: "Mod-Shift-u", run: redoSelection, preventDefault: true }
  ];
  function updateSel(sel, by) {
    return EditorSelection.create(sel.ranges.map(by), sel.mainIndex);
  }
  function setSel(state, selection) {
    return state.update({ selection, scrollIntoView: true, userEvent: "select" });
  }
  function moveSel({ state, dispatch }, how) {
    let selection = updateSel(state.selection, how);
    if (selection.eq(state.selection))
      return false;
    dispatch(setSel(state, selection));
    return true;
  }
  function rangeEnd(range, forward) {
    return EditorSelection.cursor(forward ? range.to : range.from);
  }
  function cursorByChar(view, forward) {
    return moveSel(view, (range) => range.empty ? view.moveByChar(range, forward) : rangeEnd(range, forward));
  }
  function ltrAtCursor(view) {
    return view.textDirectionAt(view.state.selection.main.head) == Direction.LTR;
  }
  const cursorCharLeft = (view) => cursorByChar(view, !ltrAtCursor(view));
  const cursorCharRight = (view) => cursorByChar(view, ltrAtCursor(view));
  function cursorByGroup(view, forward) {
    return moveSel(view, (range) => range.empty ? view.moveByGroup(range, forward) : rangeEnd(range, forward));
  }
  const cursorGroupLeft = (view) => cursorByGroup(view, !ltrAtCursor(view));
  const cursorGroupRight = (view) => cursorByGroup(view, ltrAtCursor(view));
  function interestingNode(state, node, bracketProp) {
    if (node.type.prop(bracketProp))
      return true;
    let len = node.to - node.from;
    return len && (len > 2 || /[^\s,.;:]/.test(state.sliceDoc(node.from, node.to))) || node.firstChild;
  }
  function moveBySyntax(state, start, forward) {
    let pos = syntaxTree(state).resolveInner(start.head);
    let bracketProp = forward ? NodeProp.closedBy : NodeProp.openedBy;
    for (let at = start.head; ; ) {
      let next = forward ? pos.childAfter(at) : pos.childBefore(at);
      if (!next)
        break;
      if (interestingNode(state, next, bracketProp))
        pos = next;
      else
        at = forward ? next.to : next.from;
    }
    let bracket2 = pos.type.prop(bracketProp), match, newPos;
    if (bracket2 && (match = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match.matched)
      newPos = forward ? match.end.to : match.end.from;
    else
      newPos = forward ? pos.to : pos.from;
    return EditorSelection.cursor(newPos, forward ? -1 : 1);
  }
  const cursorSyntaxLeft = (view) => moveSel(view, (range) => moveBySyntax(view.state, range, !ltrAtCursor(view)));
  const cursorSyntaxRight = (view) => moveSel(view, (range) => moveBySyntax(view.state, range, ltrAtCursor(view)));
  function cursorByLine(view, forward) {
    return moveSel(view, (range) => {
      if (!range.empty)
        return rangeEnd(range, forward);
      let moved2 = view.moveVertically(range, forward);
      return moved2.head != range.head ? moved2 : view.moveToLineBoundary(range, forward);
    });
  }
  const cursorLineUp = (view) => cursorByLine(view, false);
  const cursorLineDown = (view) => cursorByLine(view, true);
  function pageInfo(view) {
    let selfScroll = view.scrollDOM.clientHeight < view.scrollDOM.scrollHeight - 2;
    let marginTop = 0, marginBottom = 0, height;
    if (selfScroll) {
      for (let source of view.state.facet(EditorView.scrollMargins)) {
        let margins = source(view);
        if (margins === null || margins === void 0 ? void 0 : margins.top)
          marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);
        if (margins === null || margins === void 0 ? void 0 : margins.bottom)
          marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);
      }
      height = view.scrollDOM.clientHeight - marginTop - marginBottom;
    } else {
      height = (view.dom.ownerDocument.defaultView || window).innerHeight;
    }
    return {
      marginTop,
      marginBottom,
      selfScroll,
      height: Math.max(view.defaultLineHeight, height - 5)
    };
  }
  function cursorByPage(view, forward) {
    let page = pageInfo(view);
    let { state } = view, selection = updateSel(state.selection, (range) => {
      return range.empty ? view.moveVertically(range, forward, page.height) : rangeEnd(range, forward);
    });
    if (selection.eq(state.selection))
      return false;
    let effect;
    if (page.selfScroll) {
      let startPos = view.coordsAtPos(state.selection.main.head);
      let scrollRect = view.scrollDOM.getBoundingClientRect();
      let scrollTop = scrollRect.top + page.marginTop, scrollBottom = scrollRect.bottom - page.marginBottom;
      if (startPos && startPos.top > scrollTop && startPos.bottom < scrollBottom)
        effect = EditorView.scrollIntoView(selection.main.head, { y: "start", yMargin: startPos.top - scrollTop });
    }
    view.dispatch(setSel(state, selection), { effects: effect });
    return true;
  }
  const cursorPageUp = (view) => cursorByPage(view, false);
  const cursorPageDown = (view) => cursorByPage(view, true);
  function moveByLineBoundary(view, start, forward) {
    let line = view.lineBlockAt(start.head), moved2 = view.moveToLineBoundary(start, forward);
    if (moved2.head == start.head && moved2.head != (forward ? line.to : line.from))
      moved2 = view.moveToLineBoundary(start, forward, false);
    if (!forward && moved2.head == line.from && line.length) {
      let space2 = /^\s*/.exec(view.state.sliceDoc(line.from, Math.min(line.from + 100, line.to)))[0].length;
      if (space2 && start.head != line.from + space2)
        moved2 = EditorSelection.cursor(line.from + space2);
    }
    return moved2;
  }
  const cursorLineBoundaryForward = (view) => moveSel(view, (range) => moveByLineBoundary(view, range, true));
  const cursorLineBoundaryBackward = (view) => moveSel(view, (range) => moveByLineBoundary(view, range, false));
  const cursorLineBoundaryLeft = (view) => moveSel(view, (range) => moveByLineBoundary(view, range, !ltrAtCursor(view)));
  const cursorLineBoundaryRight = (view) => moveSel(view, (range) => moveByLineBoundary(view, range, ltrAtCursor(view)));
  const cursorLineStart = (view) => moveSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).from, 1));
  const cursorLineEnd = (view) => moveSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).to, -1));
  function toMatchingBracket(state, dispatch, extend2) {
    let found = false, selection = updateSel(state.selection, (range) => {
      let matching = matchBrackets(state, range.head, -1) || matchBrackets(state, range.head, 1) || range.head > 0 && matchBrackets(state, range.head - 1, 1) || range.head < state.doc.length && matchBrackets(state, range.head + 1, -1);
      if (!matching || !matching.end)
        return range;
      found = true;
      let head = matching.start.from == range.head ? matching.end.to : matching.end.from;
      return extend2 ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head);
    });
    if (!found)
      return false;
    dispatch(setSel(state, selection));
    return true;
  }
  const cursorMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch, false);
  function extendSel(view, how) {
    let selection = updateSel(view.state.selection, (range) => {
      let head = how(range);
      return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || void 0);
    });
    if (selection.eq(view.state.selection))
      return false;
    view.dispatch(setSel(view.state, selection));
    return true;
  }
  function selectByChar(view, forward) {
    return extendSel(view, (range) => view.moveByChar(range, forward));
  }
  const selectCharLeft = (view) => selectByChar(view, !ltrAtCursor(view));
  const selectCharRight = (view) => selectByChar(view, ltrAtCursor(view));
  function selectByGroup(view, forward) {
    return extendSel(view, (range) => view.moveByGroup(range, forward));
  }
  const selectGroupLeft = (view) => selectByGroup(view, !ltrAtCursor(view));
  const selectGroupRight = (view) => selectByGroup(view, ltrAtCursor(view));
  const selectSyntaxLeft = (view) => extendSel(view, (range) => moveBySyntax(view.state, range, !ltrAtCursor(view)));
  const selectSyntaxRight = (view) => extendSel(view, (range) => moveBySyntax(view.state, range, ltrAtCursor(view)));
  function selectByLine(view, forward) {
    return extendSel(view, (range) => view.moveVertically(range, forward));
  }
  const selectLineUp = (view) => selectByLine(view, false);
  const selectLineDown = (view) => selectByLine(view, true);
  function selectByPage(view, forward) {
    return extendSel(view, (range) => view.moveVertically(range, forward, pageInfo(view).height));
  }
  const selectPageUp = (view) => selectByPage(view, false);
  const selectPageDown = (view) => selectByPage(view, true);
  const selectLineBoundaryForward = (view) => extendSel(view, (range) => moveByLineBoundary(view, range, true));
  const selectLineBoundaryBackward = (view) => extendSel(view, (range) => moveByLineBoundary(view, range, false));
  const selectLineBoundaryLeft = (view) => extendSel(view, (range) => moveByLineBoundary(view, range, !ltrAtCursor(view)));
  const selectLineBoundaryRight = (view) => extendSel(view, (range) => moveByLineBoundary(view, range, ltrAtCursor(view)));
  const selectLineStart = (view) => extendSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).from));
  const selectLineEnd = (view) => extendSel(view, (range) => EditorSelection.cursor(view.lineBlockAt(range.head).to));
  const cursorDocStart = ({ state, dispatch }) => {
    dispatch(setSel(state, { anchor: 0 }));
    return true;
  };
  const cursorDocEnd = ({ state, dispatch }) => {
    dispatch(setSel(state, { anchor: state.doc.length }));
    return true;
  };
  const selectDocStart = ({ state, dispatch }) => {
    dispatch(setSel(state, { anchor: state.selection.main.anchor, head: 0 }));
    return true;
  };
  const selectDocEnd = ({ state, dispatch }) => {
    dispatch(setSel(state, { anchor: state.selection.main.anchor, head: state.doc.length }));
    return true;
  };
  const selectAll = ({ state, dispatch }) => {
    dispatch(state.update({ selection: { anchor: 0, head: state.doc.length }, userEvent: "select" }));
    return true;
  };
  const selectLine = ({ state, dispatch }) => {
    let ranges = selectedLineBlocks(state).map(({ from, to }) => EditorSelection.range(from, Math.min(to + 1, state.doc.length)));
    dispatch(state.update({ selection: EditorSelection.create(ranges), userEvent: "select" }));
    return true;
  };
  const selectParentSyntax = ({ state, dispatch }) => {
    let selection = updateSel(state.selection, (range) => {
      var _a2;
      let stack = syntaxTree(state).resolveStack(range.from, 1);
      for (let cur2 = stack; cur2; cur2 = cur2.next) {
        let { node } = cur2;
        if ((node.from < range.from && node.to >= range.to || node.to > range.to && node.from <= range.from) && ((_a2 = node.parent) === null || _a2 === void 0 ? void 0 : _a2.parent))
          return EditorSelection.range(node.to, node.from);
      }
      return range;
    });
    dispatch(setSel(state, selection));
    return true;
  };
  const simplifySelection = ({ state, dispatch }) => {
    let cur2 = state.selection, selection = null;
    if (cur2.ranges.length > 1)
      selection = EditorSelection.create([cur2.main]);
    else if (!cur2.main.empty)
      selection = EditorSelection.create([EditorSelection.cursor(cur2.main.head)]);
    if (!selection)
      return false;
    dispatch(setSel(state, selection));
    return true;
  };
  function deleteBy(target, by) {
    if (target.state.readOnly)
      return false;
    let event = "delete.selection", { state } = target;
    let changes = state.changeByRange((range) => {
      let { from, to } = range;
      if (from == to) {
        let towards = by(range);
        if (towards < from) {
          event = "delete.backward";
          towards = skipAtomic(target, towards, false);
        } else if (towards > from) {
          event = "delete.forward";
          towards = skipAtomic(target, towards, true);
        }
        from = Math.min(from, towards);
        to = Math.max(to, towards);
      } else {
        from = skipAtomic(target, from, false);
        to = skipAtomic(target, to, true);
      }
      return from == to ? { range } : { changes: { from, to }, range: EditorSelection.cursor(from, from < range.head ? -1 : 1) };
    });
    if (changes.changes.empty)
      return false;
    target.dispatch(state.update(changes, {
      scrollIntoView: true,
      userEvent: event,
      effects: event == "delete.selection" ? EditorView.announce.of(state.phrase("Selection deleted")) : void 0
    }));
    return true;
  }
  function skipAtomic(target, pos, forward) {
    if (target instanceof EditorView)
      for (let ranges of target.state.facet(EditorView.atomicRanges).map((f) => f(target)))
        ranges.between(pos, pos, (from, to) => {
          if (from < pos && to > pos)
            pos = forward ? to : from;
        });
    return pos;
  }
  const deleteByChar = (target, forward) => deleteBy(target, (range) => {
    let pos = range.from, { state } = target, line = state.doc.lineAt(pos), before, targetPos;
    if (!forward && pos > line.from && pos < line.from + 200 && !/[^ \t]/.test(before = line.text.slice(0, pos - line.from))) {
      if (before[before.length - 1] == "	")
        return pos - 1;
      let col = countColumn(before, state.tabSize), drop2 = col % getIndentUnit(state) || getIndentUnit(state);
      for (let i2 = 0; i2 < drop2 && before[before.length - 1 - i2] == " "; i2++)
        pos--;
      targetPos = pos;
    } else {
      targetPos = findClusterBreak(line.text, pos - line.from, forward, forward) + line.from;
      if (targetPos == pos && line.number != (forward ? state.doc.lines : 1))
        targetPos += forward ? 1 : -1;
    }
    return targetPos;
  });
  const deleteCharBackward = (view) => deleteByChar(view, false);
  const deleteCharForward = (view) => deleteByChar(view, true);
  const deleteByGroup = (target, forward) => deleteBy(target, (range) => {
    let pos = range.head, { state } = target, line = state.doc.lineAt(pos);
    let categorize = state.charCategorizer(pos);
    for (let cat = null; ; ) {
      if (pos == (forward ? line.to : line.from)) {
        if (pos == range.head && line.number != (forward ? state.doc.lines : 1))
          pos += forward ? 1 : -1;
        break;
      }
      let next = findClusterBreak(line.text, pos - line.from, forward) + line.from;
      let nextChar2 = line.text.slice(Math.min(pos, next) - line.from, Math.max(pos, next) - line.from);
      let nextCat = categorize(nextChar2);
      if (cat != null && nextCat != cat)
        break;
      if (nextChar2 != " " || pos != range.head)
        cat = nextCat;
      pos = next;
    }
    return pos;
  });
  const deleteGroupBackward = (target) => deleteByGroup(target, false);
  const deleteGroupForward = (target) => deleteByGroup(target, true);
  const deleteToLineEnd = (view) => deleteBy(view, (range) => {
    let lineEnd = view.lineBlockAt(range.head).to;
    return range.head < lineEnd ? lineEnd : Math.min(view.state.doc.length, range.head + 1);
  });
  const deleteLineBoundaryBackward = (view) => deleteBy(view, (range) => {
    let lineStart = view.moveToLineBoundary(range, false).head;
    return range.head > lineStart ? lineStart : Math.max(0, range.head - 1);
  });
  const deleteLineBoundaryForward = (view) => deleteBy(view, (range) => {
    let lineStart = view.moveToLineBoundary(range, true).head;
    return range.head < lineStart ? lineStart : Math.min(view.state.doc.length, range.head + 1);
  });
  const splitLine = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let changes = state.changeByRange((range) => {
      return {
        changes: { from: range.from, to: range.to, insert: Text$1.of(["", ""]) },
        range: EditorSelection.cursor(range.from)
      };
    });
    dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
    return true;
  };
  const transposeChars = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let changes = state.changeByRange((range) => {
      if (!range.empty || range.from == 0 || range.from == state.doc.length)
        return { range };
      let pos = range.from, line = state.doc.lineAt(pos);
      let from = pos == line.from ? pos - 1 : findClusterBreak(line.text, pos - line.from, false) + line.from;
      let to = pos == line.to ? pos + 1 : findClusterBreak(line.text, pos - line.from, true) + line.from;
      return {
        changes: { from, to, insert: state.doc.slice(pos, to).append(state.doc.slice(from, pos)) },
        range: EditorSelection.cursor(to)
      };
    });
    if (changes.changes.empty)
      return false;
    dispatch(state.update(changes, { scrollIntoView: true, userEvent: "move.character" }));
    return true;
  };
  function selectedLineBlocks(state) {
    let blocks = [], upto = -1;
    for (let range of state.selection.ranges) {
      let startLine = state.doc.lineAt(range.from), endLine = state.doc.lineAt(range.to);
      if (!range.empty && range.to == endLine.from)
        endLine = state.doc.lineAt(range.to - 1);
      if (upto >= startLine.number) {
        let prev = blocks[blocks.length - 1];
        prev.to = endLine.to;
        prev.ranges.push(range);
      } else {
        blocks.push({ from: startLine.from, to: endLine.to, ranges: [range] });
      }
      upto = endLine.number + 1;
    }
    return blocks;
  }
  function moveLine(state, dispatch, forward) {
    if (state.readOnly)
      return false;
    let changes = [], ranges = [];
    for (let block of selectedLineBlocks(state)) {
      if (forward ? block.to == state.doc.length : block.from == 0)
        continue;
      let nextLine = state.doc.lineAt(forward ? block.to + 1 : block.from - 1);
      let size = nextLine.length + 1;
      if (forward) {
        changes.push({ from: block.to, to: nextLine.to }, { from: block.from, insert: nextLine.text + state.lineBreak });
        for (let r of block.ranges)
          ranges.push(EditorSelection.range(Math.min(state.doc.length, r.anchor + size), Math.min(state.doc.length, r.head + size)));
      } else {
        changes.push({ from: nextLine.from, to: block.from }, { from: block.to, insert: state.lineBreak + nextLine.text });
        for (let r of block.ranges)
          ranges.push(EditorSelection.range(r.anchor - size, r.head - size));
      }
    }
    if (!changes.length)
      return false;
    dispatch(state.update({
      changes,
      scrollIntoView: true,
      selection: EditorSelection.create(ranges, state.selection.mainIndex),
      userEvent: "move.line"
    }));
    return true;
  }
  const moveLineUp = ({ state, dispatch }) => moveLine(state, dispatch, false);
  const moveLineDown = ({ state, dispatch }) => moveLine(state, dispatch, true);
  function copyLine(state, dispatch, forward) {
    if (state.readOnly)
      return false;
    let changes = [];
    for (let block of selectedLineBlocks(state)) {
      if (forward)
        changes.push({ from: block.from, insert: state.doc.slice(block.from, block.to) + state.lineBreak });
      else
        changes.push({ from: block.to, insert: state.lineBreak + state.doc.slice(block.from, block.to) });
    }
    dispatch(state.update({ changes, scrollIntoView: true, userEvent: "input.copyline" }));
    return true;
  }
  const copyLineUp = ({ state, dispatch }) => copyLine(state, dispatch, false);
  const copyLineDown = ({ state, dispatch }) => copyLine(state, dispatch, true);
  const deleteLine = (view) => {
    if (view.state.readOnly)
      return false;
    let { state } = view, changes = state.changes(selectedLineBlocks(state).map(({ from, to }) => {
      if (from > 0)
        from--;
      else if (to < state.doc.length)
        to++;
      return { from, to };
    }));
    let selection = updateSel(state.selection, (range) => view.moveVertically(range, true)).map(changes);
    view.dispatch({ changes, selection, scrollIntoView: true, userEvent: "delete.line" });
    return true;
  };
  function isBetweenBrackets(state, pos) {
    if (/\(\)|\[\]|\{\}/.test(state.sliceDoc(pos - 1, pos + 1)))
      return { from: pos, to: pos };
    let context = syntaxTree(state).resolveInner(pos);
    let before = context.childBefore(pos), after = context.childAfter(pos), closedBy;
    if (before && after && before.to <= pos && after.from >= pos && (closedBy = before.type.prop(NodeProp.closedBy)) && closedBy.indexOf(after.name) > -1 && state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from && !/\S/.test(state.sliceDoc(before.to, after.from)))
      return { from: before.to, to: after.from };
    return null;
  }
  const insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false);
  const insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
  function newlineAndIndent(atEof) {
    return ({ state, dispatch }) => {
      if (state.readOnly)
        return false;
      let changes = state.changeByRange((range) => {
        let { from, to } = range, line = state.doc.lineAt(from);
        let explode = !atEof && from == to && isBetweenBrackets(state, from);
        if (atEof)
          from = to = (to <= line.to ? line : state.doc.lineAt(to)).to;
        let cx = new IndentContext(state, { simulateBreak: from, simulateDoubleBreak: !!explode });
        let indent = getIndentation(cx, from);
        if (indent == null)
          indent = countColumn(/^\s*/.exec(state.doc.lineAt(from).text)[0], state.tabSize);
        while (to < line.to && /\s/.test(line.text[to - line.from]))
          to++;
        if (explode)
          ({ from, to } = explode);
        else if (from > line.from && from < line.from + 100 && !/\S/.test(line.text.slice(0, from)))
          from = line.from;
        let insert2 = ["", indentString(state, indent)];
        if (explode)
          insert2.push(indentString(state, cx.lineIndent(line.from, -1)));
        return {
          changes: { from, to, insert: Text$1.of(insert2) },
          range: EditorSelection.cursor(from + 1 + insert2[1].length)
        };
      });
      dispatch(state.update(changes, { scrollIntoView: true, userEvent: "input" }));
      return true;
    };
  }
  function changeBySelectedLine(state, f) {
    let atLine = -1;
    return state.changeByRange((range) => {
      let changes = [];
      for (let pos = range.from; pos <= range.to; ) {
        let line = state.doc.lineAt(pos);
        if (line.number > atLine && (range.empty || range.to > line.from)) {
          f(line, changes, range);
          atLine = line.number;
        }
        pos = line.to + 1;
      }
      let changeSet = state.changes(changes);
      return {
        changes,
        range: EditorSelection.range(changeSet.mapPos(range.anchor, 1), changeSet.mapPos(range.head, 1))
      };
    });
  }
  const indentSelection = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let updated = Object.create(null);
    let context = new IndentContext(state, { overrideIndentation: (start) => {
      let found = updated[start];
      return found == null ? -1 : found;
    } });
    let changes = changeBySelectedLine(state, (line, changes2, range) => {
      let indent = getIndentation(context, line.from);
      if (indent == null)
        return;
      if (!/\S/.test(line.text))
        indent = 0;
      let cur2 = /^\s*/.exec(line.text)[0];
      let norm = indentString(state, indent);
      if (cur2 != norm || range.from < line.from + cur2.length) {
        updated[line.from] = indent;
        changes2.push({ from: line.from, to: line.from + cur2.length, insert: norm });
      }
    });
    if (!changes.changes.empty)
      dispatch(state.update(changes, { userEvent: "indent" }));
    return true;
  };
  const indentMore = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    dispatch(state.update(changeBySelectedLine(state, (line, changes) => {
      changes.push({ from: line.from, insert: state.facet(indentUnit) });
    }), { userEvent: "input.indent" }));
    return true;
  };
  const indentLess = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    dispatch(state.update(changeBySelectedLine(state, (line, changes) => {
      let space2 = /^\s*/.exec(line.text)[0];
      if (!space2)
        return;
      let col = countColumn(space2, state.tabSize), keep = 0;
      let insert2 = indentString(state, Math.max(0, col - getIndentUnit(state)));
      while (keep < space2.length && keep < insert2.length && space2.charCodeAt(keep) == insert2.charCodeAt(keep))
        keep++;
      changes.push({ from: line.from + keep, to: line.from + space2.length, insert: insert2.slice(keep) });
    }), { userEvent: "delete.dedent" }));
    return true;
  };
  const emacsStyleKeymap = [
    { key: "Ctrl-b", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
    { key: "Ctrl-f", run: cursorCharRight, shift: selectCharRight },
    { key: "Ctrl-p", run: cursorLineUp, shift: selectLineUp },
    { key: "Ctrl-n", run: cursorLineDown, shift: selectLineDown },
    { key: "Ctrl-a", run: cursorLineStart, shift: selectLineStart },
    { key: "Ctrl-e", run: cursorLineEnd, shift: selectLineEnd },
    { key: "Ctrl-d", run: deleteCharForward },
    { key: "Ctrl-h", run: deleteCharBackward },
    { key: "Ctrl-k", run: deleteToLineEnd },
    { key: "Ctrl-Alt-h", run: deleteGroupBackward },
    { key: "Ctrl-o", run: splitLine },
    { key: "Ctrl-t", run: transposeChars },
    { key: "Ctrl-v", run: cursorPageDown }
  ];
  const standardKeymap = /* @__PURE__ */ [
    { key: "ArrowLeft", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },
    { key: "Mod-ArrowLeft", mac: "Alt-ArrowLeft", run: cursorGroupLeft, shift: selectGroupLeft, preventDefault: true },
    { mac: "Cmd-ArrowLeft", run: cursorLineBoundaryLeft, shift: selectLineBoundaryLeft, preventDefault: true },
    { key: "ArrowRight", run: cursorCharRight, shift: selectCharRight, preventDefault: true },
    { key: "Mod-ArrowRight", mac: "Alt-ArrowRight", run: cursorGroupRight, shift: selectGroupRight, preventDefault: true },
    { mac: "Cmd-ArrowRight", run: cursorLineBoundaryRight, shift: selectLineBoundaryRight, preventDefault: true },
    { key: "ArrowUp", run: cursorLineUp, shift: selectLineUp, preventDefault: true },
    { mac: "Cmd-ArrowUp", run: cursorDocStart, shift: selectDocStart },
    { mac: "Ctrl-ArrowUp", run: cursorPageUp, shift: selectPageUp },
    { key: "ArrowDown", run: cursorLineDown, shift: selectLineDown, preventDefault: true },
    { mac: "Cmd-ArrowDown", run: cursorDocEnd, shift: selectDocEnd },
    { mac: "Ctrl-ArrowDown", run: cursorPageDown, shift: selectPageDown },
    { key: "PageUp", run: cursorPageUp, shift: selectPageUp },
    { key: "PageDown", run: cursorPageDown, shift: selectPageDown },
    { key: "Home", run: cursorLineBoundaryBackward, shift: selectLineBoundaryBackward, preventDefault: true },
    { key: "Mod-Home", run: cursorDocStart, shift: selectDocStart },
    { key: "End", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true },
    { key: "Mod-End", run: cursorDocEnd, shift: selectDocEnd },
    { key: "Enter", run: insertNewlineAndIndent },
    { key: "Mod-a", run: selectAll },
    { key: "Backspace", run: deleteCharBackward, shift: deleteCharBackward },
    { key: "Delete", run: deleteCharForward },
    { key: "Mod-Backspace", mac: "Alt-Backspace", run: deleteGroupBackward },
    { key: "Mod-Delete", mac: "Alt-Delete", run: deleteGroupForward },
    { mac: "Mod-Backspace", run: deleteLineBoundaryBackward },
    { mac: "Mod-Delete", run: deleteLineBoundaryForward }
  ].concat(/* @__PURE__ */ emacsStyleKeymap.map((b) => ({ mac: b.key, run: b.run, shift: b.shift })));
  const defaultKeymap = /* @__PURE__ */ [
    { key: "Alt-ArrowLeft", mac: "Ctrl-ArrowLeft", run: cursorSyntaxLeft, shift: selectSyntaxLeft },
    { key: "Alt-ArrowRight", mac: "Ctrl-ArrowRight", run: cursorSyntaxRight, shift: selectSyntaxRight },
    { key: "Alt-ArrowUp", run: moveLineUp },
    { key: "Shift-Alt-ArrowUp", run: copyLineUp },
    { key: "Alt-ArrowDown", run: moveLineDown },
    { key: "Shift-Alt-ArrowDown", run: copyLineDown },
    { key: "Escape", run: simplifySelection },
    { key: "Mod-Enter", run: insertBlankLine },
    { key: "Alt-l", mac: "Ctrl-l", run: selectLine },
    { key: "Mod-i", run: selectParentSyntax, preventDefault: true },
    { key: "Mod-[", run: indentLess },
    { key: "Mod-]", run: indentMore },
    { key: "Mod-Alt-\\", run: indentSelection },
    { key: "Shift-Mod-k", run: deleteLine },
    { key: "Shift-Mod-\\", run: cursorMatchingBracket },
    { key: "Mod-/", run: toggleComment },
    { key: "Alt-A", run: toggleBlockComment }
  ].concat(standardKeymap);
  function crelt() {
    var elt = arguments[0];
    if (typeof elt == "string")
      elt = document.createElement(elt);
    var i2 = 1, next = arguments[1];
    if (next && typeof next == "object" && next.nodeType == null && !Array.isArray(next)) {
      for (var name2 in next)
        if (Object.prototype.hasOwnProperty.call(next, name2)) {
          var value2 = next[name2];
          if (typeof value2 == "string")
            elt.setAttribute(name2, value2);
          else if (value2 != null)
            elt[name2] = value2;
        }
      i2++;
    }
    for (; i2 < arguments.length; i2++)
      add(elt, arguments[i2]);
    return elt;
  }
  function add(elt, child) {
    if (typeof child == "string") {
      elt.appendChild(document.createTextNode(child));
    } else if (child == null)
      ;
    else if (child.nodeType != null) {
      elt.appendChild(child);
    } else if (Array.isArray(child)) {
      for (var i2 = 0; i2 < child.length; i2++)
        add(elt, child[i2]);
    } else {
      throw new RangeError("Unsupported child node: " + child);
    }
  }
  const basicNormalize = typeof String.prototype.normalize == "function" ? (x) => x.normalize("NFKD") : (x) => x;
  class SearchCursor {
    constructor(text, query, from = 0, to = text.length, normalize, test) {
      this.test = test;
      this.value = { from: 0, to: 0 };
      this.done = false;
      this.matches = [];
      this.buffer = "";
      this.bufferPos = 0;
      this.iter = text.iterRange(from, to);
      this.bufferStart = from;
      this.normalize = normalize ? (x) => normalize(basicNormalize(x)) : basicNormalize;
      this.query = this.normalize(query);
    }
    peek() {
      if (this.bufferPos == this.buffer.length) {
        this.bufferStart += this.buffer.length;
        this.iter.next();
        if (this.iter.done)
          return -1;
        this.bufferPos = 0;
        this.buffer = this.iter.value;
      }
      return codePointAt(this.buffer, this.bufferPos);
    }
    next() {
      while (this.matches.length)
        this.matches.pop();
      return this.nextOverlapping();
    }
    nextOverlapping() {
      for (; ; ) {
        let next = this.peek();
        if (next < 0) {
          this.done = true;
          return this;
        }
        let str = fromCodePoint(next), start = this.bufferStart + this.bufferPos;
        this.bufferPos += codePointSize(next);
        let norm = this.normalize(str);
        for (let i2 = 0, pos = start; ; i2++) {
          let code2 = norm.charCodeAt(i2);
          let match = this.match(code2, pos);
          if (i2 == norm.length - 1) {
            if (match) {
              this.value = match;
              return this;
            }
            break;
          }
          if (pos == start && i2 < str.length && str.charCodeAt(i2) == code2)
            pos++;
        }
      }
    }
    match(code2, pos) {
      let match = null;
      for (let i2 = 0; i2 < this.matches.length; i2 += 2) {
        let index2 = this.matches[i2], keep = false;
        if (this.query.charCodeAt(index2) == code2) {
          if (index2 == this.query.length - 1) {
            match = { from: this.matches[i2 + 1], to: pos + 1 };
          } else {
            this.matches[i2]++;
            keep = true;
          }
        }
        if (!keep) {
          this.matches.splice(i2, 2);
          i2 -= 2;
        }
      }
      if (this.query.charCodeAt(0) == code2) {
        if (this.query.length == 1)
          match = { from: pos, to: pos + 1 };
        else
          this.matches.push(1, pos);
      }
      if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart))
        match = null;
      return match;
    }
  }
  if (typeof Symbol != "undefined")
    SearchCursor.prototype[Symbol.iterator] = function() {
      return this;
    };
  const empty = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") };
  const baseFlags = "gm" + (/x/.unicode == null ? "" : "u");
  class RegExpCursor {
    constructor(text, query, options, from = 0, to = text.length) {
      this.text = text;
      this.to = to;
      this.curLine = "";
      this.done = false;
      this.value = empty;
      if (/\\[sWDnr]|\n|\r|\[\^/.test(query))
        return new MultilineRegExpCursor(text, query, options, from, to);
      this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
      this.test = options === null || options === void 0 ? void 0 : options.test;
      this.iter = text.iter();
      let startLine = text.lineAt(from);
      this.curLineStart = startLine.from;
      this.matchPos = toCharEnd(text, from);
      this.getLine(this.curLineStart);
    }
    getLine(skip) {
      this.iter.next(skip);
      if (this.iter.lineBreak) {
        this.curLine = "";
      } else {
        this.curLine = this.iter.value;
        if (this.curLineStart + this.curLine.length > this.to)
          this.curLine = this.curLine.slice(0, this.to - this.curLineStart);
        this.iter.next();
      }
    }
    nextLine() {
      this.curLineStart = this.curLineStart + this.curLine.length + 1;
      if (this.curLineStart > this.to)
        this.curLine = "";
      else
        this.getLine(0);
    }
    next() {
      for (let off2 = this.matchPos - this.curLineStart; ; ) {
        this.re.lastIndex = off2;
        let match = this.matchPos <= this.to && this.re.exec(this.curLine);
        if (match) {
          let from = this.curLineStart + match.index, to = from + match[0].length;
          this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));
          if (from == this.curLineStart + this.curLine.length)
            this.nextLine();
          if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {
            this.value = { from, to, match };
            return this;
          }
          off2 = this.matchPos - this.curLineStart;
        } else if (this.curLineStart + this.curLine.length < this.to) {
          this.nextLine();
          off2 = 0;
        } else {
          this.done = true;
          return this;
        }
      }
    }
  }
  const flattened = /* @__PURE__ */ new WeakMap();
  class FlattenedDoc {
    constructor(from, text) {
      this.from = from;
      this.text = text;
    }
    get to() {
      return this.from + this.text.length;
    }
    static get(doc2, from, to) {
      let cached = flattened.get(doc2);
      if (!cached || cached.from >= to || cached.to <= from) {
        let flat = new FlattenedDoc(from, doc2.sliceString(from, to));
        flattened.set(doc2, flat);
        return flat;
      }
      if (cached.from == from && cached.to == to)
        return cached;
      let { text, from: cachedFrom } = cached;
      if (cachedFrom > from) {
        text = doc2.sliceString(from, cachedFrom) + text;
        cachedFrom = from;
      }
      if (cached.to < to)
        text += doc2.sliceString(cached.to, to);
      flattened.set(doc2, new FlattenedDoc(cachedFrom, text));
      return new FlattenedDoc(from, text.slice(from - cachedFrom, to - cachedFrom));
    }
  }
  class MultilineRegExpCursor {
    constructor(text, query, options, from, to) {
      this.text = text;
      this.to = to;
      this.done = false;
      this.value = empty;
      this.matchPos = toCharEnd(text, from);
      this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? "i" : ""));
      this.test = options === null || options === void 0 ? void 0 : options.test;
      this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5e3));
    }
    chunkEnd(pos) {
      return pos >= this.to ? this.to : this.text.lineAt(pos).to;
    }
    next() {
      for (; ; ) {
        let off2 = this.re.lastIndex = this.matchPos - this.flat.from;
        let match = this.re.exec(this.flat.text);
        if (match && !match[0] && match.index == off2) {
          this.re.lastIndex = off2 + 1;
          match = this.re.exec(this.flat.text);
        }
        if (match) {
          let from = this.flat.from + match.index, to = from + match[0].length;
          if ((this.flat.to >= this.to || match.index + match[0].length <= this.flat.text.length - 10) && (!this.test || this.test(from, to, match))) {
            this.value = { from, to, match };
            this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));
            return this;
          }
        }
        if (this.flat.to == this.to) {
          this.done = true;
          return this;
        }
        this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
      }
    }
  }
  if (typeof Symbol != "undefined") {
    RegExpCursor.prototype[Symbol.iterator] = MultilineRegExpCursor.prototype[Symbol.iterator] = function() {
      return this;
    };
  }
  function validRegExp(source) {
    try {
      new RegExp(source, baseFlags);
      return true;
    } catch (_a2) {
      return false;
    }
  }
  function toCharEnd(text, pos) {
    if (pos >= text.length)
      return pos;
    let line = text.lineAt(pos), next;
    while (pos < line.to && (next = line.text.charCodeAt(pos - line.from)) >= 56320 && next < 57344)
      pos++;
    return pos;
  }
  function createLineDialog(view) {
    let line = String(view.state.doc.lineAt(view.state.selection.main.head).number);
    let input = crelt("input", { class: "cm-textfield", name: "line", value: line });
    let dom = crelt("form", {
      class: "cm-gotoLine",
      onkeydown: (event) => {
        if (event.keyCode == 27) {
          event.preventDefault();
          view.dispatch({ effects: dialogEffect.of(false) });
          view.focus();
        } else if (event.keyCode == 13) {
          event.preventDefault();
          go();
        }
      },
      onsubmit: (event) => {
        event.preventDefault();
        go();
      }
    }, crelt("label", view.state.phrase("Go to line"), ": ", input), " ", crelt("button", { class: "cm-button", type: "submit" }, view.state.phrase("go")));
    function go() {
      let match = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(input.value);
      if (!match)
        return;
      let { state } = view, startLine = state.doc.lineAt(state.selection.main.head);
      let [, sign, ln, cl, percent] = match;
      let col = cl ? +cl.slice(1) : 0;
      let line2 = ln ? +ln : startLine.number;
      if (ln && percent) {
        let pc = line2 / 100;
        if (sign)
          pc = pc * (sign == "-" ? -1 : 1) + startLine.number / state.doc.lines;
        line2 = Math.round(state.doc.lines * pc);
      } else if (ln && sign) {
        line2 = line2 * (sign == "-" ? -1 : 1) + startLine.number;
      }
      let docLine = state.doc.line(Math.max(1, Math.min(state.doc.lines, line2)));
      let selection = EditorSelection.cursor(docLine.from + Math.max(0, Math.min(col, docLine.length)));
      view.dispatch({
        effects: [dialogEffect.of(false), EditorView.scrollIntoView(selection.from, { y: "center" })],
        selection
      });
      view.focus();
    }
    return { dom };
  }
  const dialogEffect = /* @__PURE__ */ StateEffect.define();
  const dialogField = /* @__PURE__ */ StateField.define({
    create() {
      return true;
    },
    update(value2, tr) {
      for (let e of tr.effects)
        if (e.is(dialogEffect))
          value2 = e.value;
      return value2;
    },
    provide: (f) => showPanel.from(f, (val) => val ? createLineDialog : null)
  });
  const gotoLine = (view) => {
    let panel = getPanel(view, createLineDialog);
    if (!panel) {
      let effects = [dialogEffect.of(true)];
      if (view.state.field(dialogField, false) == null)
        effects.push(StateEffect.appendConfig.of([dialogField, baseTheme$1$1]));
      view.dispatch({ effects });
      panel = getPanel(view, createLineDialog);
    }
    if (panel)
      panel.dom.querySelector("input").select();
    return true;
  };
  const baseTheme$1$1 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-panel.cm-gotoLine": {
      padding: "2px 6px 4px",
      "& label": { fontSize: "80%" }
    }
  });
  const defaultHighlightOptions = {
    highlightWordAroundCursor: false,
    minSelectionLength: 1,
    maxMatches: 100,
    wholeWords: false
  };
  const highlightConfig = /* @__PURE__ */ Facet.define({
    combine(options) {
      return combineConfig(options, defaultHighlightOptions, {
        highlightWordAroundCursor: (a, b) => a || b,
        minSelectionLength: Math.min,
        maxMatches: Math.min
      });
    }
  });
  function highlightSelectionMatches(options) {
    let ext = [defaultTheme, matchHighlighter];
    if (options)
      ext.push(highlightConfig.of(options));
    return ext;
  }
  const matchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch" });
  const mainMatchDeco = /* @__PURE__ */ Decoration.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
  function insideWordBoundaries(check, state, from, to) {
    return (from == 0 || check(state.sliceDoc(from - 1, from)) != CharCategory.Word) && (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);
  }
  function insideWord(check, state, from, to) {
    return check(state.sliceDoc(from, from + 1)) == CharCategory.Word && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;
  }
  const matchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.decorations = this.getDeco(view);
    }
    update(update) {
      if (update.selectionSet || update.docChanged || update.viewportChanged)
        this.decorations = this.getDeco(update.view);
    }
    getDeco(view) {
      let conf = view.state.facet(highlightConfig);
      let { state } = view, sel = state.selection;
      if (sel.ranges.length > 1)
        return Decoration.none;
      let range = sel.main, query, check = null;
      if (range.empty) {
        if (!conf.highlightWordAroundCursor)
          return Decoration.none;
        let word = state.wordAt(range.head);
        if (!word)
          return Decoration.none;
        check = state.charCategorizer(range.head);
        query = state.sliceDoc(word.from, word.to);
      } else {
        let len = range.to - range.from;
        if (len < conf.minSelectionLength || len > 200)
          return Decoration.none;
        if (conf.wholeWords) {
          query = state.sliceDoc(range.from, range.to);
          check = state.charCategorizer(range.head);
          if (!(insideWordBoundaries(check, state, range.from, range.to) && insideWord(check, state, range.from, range.to)))
            return Decoration.none;
        } else {
          query = state.sliceDoc(range.from, range.to).trim();
          if (!query)
            return Decoration.none;
        }
      }
      let deco = [];
      for (let part of view.visibleRanges) {
        let cursor = new SearchCursor(state.doc, query, part.from, part.to);
        while (!cursor.next().done) {
          let { from, to } = cursor.value;
          if (!check || insideWordBoundaries(check, state, from, to)) {
            if (range.empty && from <= range.from && to >= range.to)
              deco.push(mainMatchDeco.range(from, to));
            else if (from >= range.to || to <= range.from)
              deco.push(matchDeco.range(from, to));
            if (deco.length > conf.maxMatches)
              return Decoration.none;
          }
        }
      }
      return Decoration.set(deco);
    }
  }, {
    decorations: (v) => v.decorations
  });
  const defaultTheme = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
    ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
  });
  const selectWord = ({ state, dispatch }) => {
    let { selection } = state;
    let newSel = EditorSelection.create(selection.ranges.map((range) => state.wordAt(range.head) || EditorSelection.cursor(range.head)), selection.mainIndex);
    if (newSel.eq(selection))
      return false;
    dispatch(state.update({ selection: newSel }));
    return true;
  };
  function findNextOccurrence(state, query) {
    let { main, ranges } = state.selection;
    let word = state.wordAt(main.head), fullWord = word && word.from == main.from && word.to == main.to;
    for (let cycled = false, cursor = new SearchCursor(state.doc, query, ranges[ranges.length - 1].to); ; ) {
      cursor.next();
      if (cursor.done) {
        if (cycled)
          return null;
        cursor = new SearchCursor(state.doc, query, 0, Math.max(0, ranges[ranges.length - 1].from - 1));
        cycled = true;
      } else {
        if (cycled && ranges.some((r) => r.from == cursor.value.from))
          continue;
        if (fullWord) {
          let word2 = state.wordAt(cursor.value.from);
          if (!word2 || word2.from != cursor.value.from || word2.to != cursor.value.to)
            continue;
        }
        return cursor.value;
      }
    }
  }
  const selectNextOccurrence = ({ state, dispatch }) => {
    let { ranges } = state.selection;
    if (ranges.some((sel) => sel.from === sel.to))
      return selectWord({ state, dispatch });
    let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);
    if (state.selection.ranges.some((r) => state.sliceDoc(r.from, r.to) != searchedText))
      return false;
    let range = findNextOccurrence(state, searchedText);
    if (!range)
      return false;
    dispatch(state.update({
      selection: state.selection.addRange(EditorSelection.range(range.from, range.to), false),
      effects: EditorView.scrollIntoView(range.to)
    }));
    return true;
  };
  const searchConfigFacet = /* @__PURE__ */ Facet.define({
    combine(configs) {
      return combineConfig(configs, {
        top: false,
        caseSensitive: false,
        literal: false,
        regexp: false,
        wholeWord: false,
        createPanel: (view) => new SearchPanel(view),
        scrollToMatch: (range) => EditorView.scrollIntoView(range)
      });
    }
  });
  class SearchQuery {
    constructor(config2) {
      this.search = config2.search;
      this.caseSensitive = !!config2.caseSensitive;
      this.literal = !!config2.literal;
      this.regexp = !!config2.regexp;
      this.replace = config2.replace || "";
      this.valid = !!this.search && (!this.regexp || validRegExp(this.search));
      this.unquoted = this.unquote(this.search);
      this.wholeWord = !!config2.wholeWord;
    }
    unquote(text) {
      return this.literal ? text : text.replace(/\\([nrt\\])/g, (_, ch) => ch == "n" ? "\n" : ch == "r" ? "\r" : ch == "t" ? "	" : "\\");
    }
    eq(other) {
      return this.search == other.search && this.replace == other.replace && this.caseSensitive == other.caseSensitive && this.regexp == other.regexp && this.wholeWord == other.wholeWord;
    }
    create() {
      return this.regexp ? new RegExpQuery(this) : new StringQuery(this);
    }
    getCursor(state, from = 0, to) {
      let st = state.doc ? state : EditorState.create({ doc: state });
      if (to == null)
        to = st.doc.length;
      return this.regexp ? regexpCursor(this, st, from, to) : stringCursor(this, st, from, to);
    }
  }
  class QueryType {
    constructor(spec) {
      this.spec = spec;
    }
  }
  function stringCursor(spec, state, from, to) {
    return new SearchCursor(state.doc, spec.unquoted, from, to, spec.caseSensitive ? void 0 : (x) => x.toLowerCase(), spec.wholeWord ? stringWordTest(state.doc, state.charCategorizer(state.selection.main.head)) : void 0);
  }
  function stringWordTest(doc2, categorizer) {
    return (from, to, buf, bufPos) => {
      if (bufPos > from || bufPos + buf.length < to) {
        bufPos = Math.max(0, from - 2);
        buf = doc2.sliceString(bufPos, Math.min(doc2.length, to + 2));
      }
      return (categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word || categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word) && (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word || categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);
    };
  }
  class StringQuery extends QueryType {
    constructor(spec) {
      super(spec);
    }
    nextMatch(state, curFrom, curTo) {
      let cursor = stringCursor(this.spec, state, curTo, state.doc.length).nextOverlapping();
      if (cursor.done)
        cursor = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();
      return cursor.done ? null : cursor.value;
    }
    prevMatchInRange(state, from, to) {
      for (let pos = to; ; ) {
        let start = Math.max(from, pos - 1e4 - this.spec.unquoted.length);
        let cursor = stringCursor(this.spec, state, start, pos), range = null;
        while (!cursor.nextOverlapping().done)
          range = cursor.value;
        if (range)
          return range;
        if (start == from)
          return null;
        pos -= 1e4;
      }
    }
    prevMatch(state, curFrom, curTo) {
      return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
    }
    getReplacement(_result) {
      return this.spec.unquote(this.spec.replace);
    }
    matchAll(state, limit) {
      let cursor = stringCursor(this.spec, state, 0, state.doc.length), ranges = [];
      while (!cursor.next().done) {
        if (ranges.length >= limit)
          return null;
        ranges.push(cursor.value);
      }
      return ranges;
    }
    highlight(state, from, to, add2) {
      let cursor = stringCursor(this.spec, state, Math.max(0, from - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, state.doc.length));
      while (!cursor.next().done)
        add2(cursor.value.from, cursor.value.to);
    }
  }
  function regexpCursor(spec, state, from, to) {
    return new RegExpCursor(state.doc, spec.search, {
      ignoreCase: !spec.caseSensitive,
      test: spec.wholeWord ? regexpWordTest(state.charCategorizer(state.selection.main.head)) : void 0
    }, from, to);
  }
  function charBefore(str, index2) {
    return str.slice(findClusterBreak(str, index2, false), index2);
  }
  function charAfter(str, index2) {
    return str.slice(index2, findClusterBreak(str, index2));
  }
  function regexpWordTest(categorizer) {
    return (_from, _to, match) => !match[0].length || (categorizer(charBefore(match.input, match.index)) != CharCategory.Word || categorizer(charAfter(match.input, match.index)) != CharCategory.Word) && (categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word || categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word);
  }
  class RegExpQuery extends QueryType {
    nextMatch(state, curFrom, curTo) {
      let cursor = regexpCursor(this.spec, state, curTo, state.doc.length).next();
      if (cursor.done)
        cursor = regexpCursor(this.spec, state, 0, curFrom).next();
      return cursor.done ? null : cursor.value;
    }
    prevMatchInRange(state, from, to) {
      for (let size = 1; ; size++) {
        let start = Math.max(from, to - size * 1e4);
        let cursor = regexpCursor(this.spec, state, start, to), range = null;
        while (!cursor.next().done)
          range = cursor.value;
        if (range && (start == from || range.from > start + 10))
          return range;
        if (start == from)
          return null;
      }
    }
    prevMatch(state, curFrom, curTo) {
      return this.prevMatchInRange(state, 0, curFrom) || this.prevMatchInRange(state, curTo, state.doc.length);
    }
    getReplacement(result) {
      return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g, (m, i2) => i2 == "$" ? "$" : i2 == "&" ? result.match[0] : i2 != "0" && +i2 < result.match.length ? result.match[i2] : m));
    }
    matchAll(state, limit) {
      let cursor = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];
      while (!cursor.next().done) {
        if (ranges.length >= limit)
          return null;
        ranges.push(cursor.value);
      }
      return ranges;
    }
    highlight(state, from, to, add2) {
      let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250), Math.min(to + 250, state.doc.length));
      while (!cursor.next().done)
        add2(cursor.value.from, cursor.value.to);
    }
  }
  const setSearchQuery = /* @__PURE__ */ StateEffect.define();
  const togglePanel$1 = /* @__PURE__ */ StateEffect.define();
  const searchState = /* @__PURE__ */ StateField.define({
    create(state) {
      return new SearchState(defaultQuery(state).create(), null);
    },
    update(value2, tr) {
      for (let effect of tr.effects) {
        if (effect.is(setSearchQuery))
          value2 = new SearchState(effect.value.create(), value2.panel);
        else if (effect.is(togglePanel$1))
          value2 = new SearchState(value2.query, effect.value ? createSearchPanel : null);
      }
      return value2;
    },
    provide: (f) => showPanel.from(f, (val) => val.panel)
  });
  class SearchState {
    constructor(query, panel) {
      this.query = query;
      this.panel = panel;
    }
  }
  const matchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch" }), selectedMatchMark = /* @__PURE__ */ Decoration.mark({ class: "cm-searchMatch cm-searchMatch-selected" });
  const searchHighlighter = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.decorations = this.highlight(view.state.field(searchState));
    }
    update(update) {
      let state = update.state.field(searchState);
      if (state != update.startState.field(searchState) || update.docChanged || update.selectionSet || update.viewportChanged)
        this.decorations = this.highlight(state);
    }
    highlight({ query, panel }) {
      if (!panel || !query.spec.valid)
        return Decoration.none;
      let { view } = this;
      let builder = new RangeSetBuilder();
      for (let i2 = 0, ranges = view.visibleRanges, l = ranges.length; i2 < l; i2++) {
        let { from, to } = ranges[i2];
        while (i2 < l - 1 && to > ranges[i2 + 1].from - 2 * 250)
          to = ranges[++i2].to;
        query.highlight(view.state, from, to, (from2, to2) => {
          let selected = view.state.selection.ranges.some((r) => r.from == from2 && r.to == to2);
          builder.add(from2, to2, selected ? selectedMatchMark : matchMark);
        });
      }
      return builder.finish();
    }
  }, {
    decorations: (v) => v.decorations
  });
  function searchCommand(f) {
    return (view) => {
      let state = view.state.field(searchState, false);
      return state && state.query.spec.valid ? f(view, state) : openSearchPanel(view);
    };
  }
  const findNext = /* @__PURE__ */ searchCommand((view, { query }) => {
    let { to } = view.state.selection.main;
    let next = query.nextMatch(view.state, to, to);
    if (!next)
      return false;
    let selection = EditorSelection.single(next.from, next.to);
    let config2 = view.state.facet(searchConfigFacet);
    view.dispatch({
      selection,
      effects: [announceMatch(view, next), config2.scrollToMatch(selection.main, view)],
      userEvent: "select.search"
    });
    selectSearchInput(view);
    return true;
  });
  const findPrevious = /* @__PURE__ */ searchCommand((view, { query }) => {
    let { state } = view, { from } = state.selection.main;
    let prev = query.prevMatch(state, from, from);
    if (!prev)
      return false;
    let selection = EditorSelection.single(prev.from, prev.to);
    let config2 = view.state.facet(searchConfigFacet);
    view.dispatch({
      selection,
      effects: [announceMatch(view, prev), config2.scrollToMatch(selection.main, view)],
      userEvent: "select.search"
    });
    selectSearchInput(view);
    return true;
  });
  const selectMatches = /* @__PURE__ */ searchCommand((view, { query }) => {
    let ranges = query.matchAll(view.state, 1e3);
    if (!ranges || !ranges.length)
      return false;
    view.dispatch({
      selection: EditorSelection.create(ranges.map((r) => EditorSelection.range(r.from, r.to))),
      userEvent: "select.search.matches"
    });
    return true;
  });
  const selectSelectionMatches = ({ state, dispatch }) => {
    let sel = state.selection;
    if (sel.ranges.length > 1 || sel.main.empty)
      return false;
    let { from, to } = sel.main;
    let ranges = [], main = 0;
    for (let cur2 = new SearchCursor(state.doc, state.sliceDoc(from, to)); !cur2.next().done; ) {
      if (ranges.length > 1e3)
        return false;
      if (cur2.value.from == from)
        main = ranges.length;
      ranges.push(EditorSelection.range(cur2.value.from, cur2.value.to));
    }
    dispatch(state.update({
      selection: EditorSelection.create(ranges, main),
      userEvent: "select.search.matches"
    }));
    return true;
  };
  const replaceNext = /* @__PURE__ */ searchCommand((view, { query }) => {
    let { state } = view, { from, to } = state.selection.main;
    if (state.readOnly)
      return false;
    let next = query.nextMatch(state, from, from);
    if (!next)
      return false;
    let changes = [], selection, replacement;
    let effects = [];
    if (next.from == from && next.to == to) {
      replacement = state.toText(query.getReplacement(next));
      changes.push({ from: next.from, to: next.to, insert: replacement });
      next = query.nextMatch(state, next.from, next.to);
      effects.push(EditorView.announce.of(state.phrase("replaced match on line $", state.doc.lineAt(from).number) + "."));
    }
    if (next) {
      let off2 = changes.length == 0 || changes[0].from >= next.to ? 0 : next.to - next.from - replacement.length;
      selection = EditorSelection.single(next.from - off2, next.to - off2);
      effects.push(announceMatch(view, next));
      effects.push(state.facet(searchConfigFacet).scrollToMatch(selection.main, view));
    }
    view.dispatch({
      changes,
      selection,
      effects,
      userEvent: "input.replace"
    });
    return true;
  });
  const replaceAll = /* @__PURE__ */ searchCommand((view, { query }) => {
    if (view.state.readOnly)
      return false;
    let changes = query.matchAll(view.state, 1e9).map((match) => {
      let { from, to } = match;
      return { from, to, insert: query.getReplacement(match) };
    });
    if (!changes.length)
      return false;
    let announceText = view.state.phrase("replaced $ matches", changes.length) + ".";
    view.dispatch({
      changes,
      effects: EditorView.announce.of(announceText),
      userEvent: "input.replace.all"
    });
    return true;
  });
  function createSearchPanel(view) {
    return view.state.facet(searchConfigFacet).createPanel(view);
  }
  function defaultQuery(state, fallback) {
    var _a2, _b, _c, _d, _e;
    let sel = state.selection.main;
    let selText = sel.empty || sel.to > sel.from + 100 ? "" : state.sliceDoc(sel.from, sel.to);
    if (fallback && !selText)
      return fallback;
    let config2 = state.facet(searchConfigFacet);
    return new SearchQuery({
      search: ((_a2 = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a2 !== void 0 ? _a2 : config2.literal) ? selText : selText.replace(/\n/g, "\\n"),
      caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config2.caseSensitive,
      literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config2.literal,
      regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config2.regexp,
      wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config2.wholeWord
    });
  }
  function getSearchInput(view) {
    let panel = getPanel(view, createSearchPanel);
    return panel && panel.dom.querySelector("[main-field]");
  }
  function selectSearchInput(view) {
    let input = getSearchInput(view);
    if (input && input == view.root.activeElement)
      input.select();
  }
  const openSearchPanel = (view) => {
    let state = view.state.field(searchState, false);
    if (state && state.panel) {
      let searchInput = getSearchInput(view);
      if (searchInput && searchInput != view.root.activeElement) {
        let query = defaultQuery(view.state, state.query.spec);
        if (query.valid)
          view.dispatch({ effects: setSearchQuery.of(query) });
        searchInput.focus();
        searchInput.select();
      }
    } else {
      view.dispatch({ effects: [
        togglePanel$1.of(true),
        state ? setSearchQuery.of(defaultQuery(view.state, state.query.spec)) : StateEffect.appendConfig.of(searchExtensions)
      ] });
    }
    return true;
  };
  const closeSearchPanel = (view) => {
    let state = view.state.field(searchState, false);
    if (!state || !state.panel)
      return false;
    let panel = getPanel(view, createSearchPanel);
    if (panel && panel.dom.contains(view.root.activeElement))
      view.focus();
    view.dispatch({ effects: togglePanel$1.of(false) });
    return true;
  };
  const searchKeymap = [
    { key: "Mod-f", run: openSearchPanel, scope: "editor search-panel" },
    { key: "F3", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true },
    { key: "Mod-g", run: findNext, shift: findPrevious, scope: "editor search-panel", preventDefault: true },
    { key: "Escape", run: closeSearchPanel, scope: "editor search-panel" },
    { key: "Mod-Shift-l", run: selectSelectionMatches },
    { key: "Alt-g", run: gotoLine },
    { key: "Mod-d", run: selectNextOccurrence, preventDefault: true }
  ];
  class SearchPanel {
    constructor(view) {
      this.view = view;
      let query = this.query = view.state.field(searchState).query.spec;
      this.commit = this.commit.bind(this);
      this.searchField = crelt("input", {
        value: query.search,
        placeholder: phrase(view, "Find"),
        "aria-label": phrase(view, "Find"),
        class: "cm-textfield",
        name: "search",
        form: "",
        "main-field": "true",
        onchange: this.commit,
        onkeyup: this.commit
      });
      this.replaceField = crelt("input", {
        value: query.replace,
        placeholder: phrase(view, "Replace"),
        "aria-label": phrase(view, "Replace"),
        class: "cm-textfield",
        name: "replace",
        form: "",
        onchange: this.commit,
        onkeyup: this.commit
      });
      this.caseField = crelt("input", {
        type: "checkbox",
        name: "case",
        form: "",
        checked: query.caseSensitive,
        onchange: this.commit
      });
      this.reField = crelt("input", {
        type: "checkbox",
        name: "re",
        form: "",
        checked: query.regexp,
        onchange: this.commit
      });
      this.wordField = crelt("input", {
        type: "checkbox",
        name: "word",
        form: "",
        checked: query.wholeWord,
        onchange: this.commit
      });
      function button(name2, onclick, content2) {
        return crelt("button", { class: "cm-button", name: name2, onclick, type: "button" }, content2);
      }
      this.dom = crelt("div", { onkeydown: (e) => this.keydown(e), class: "cm-search" }, [
        this.searchField,
        button("next", () => findNext(view), [phrase(view, "next")]),
        button("prev", () => findPrevious(view), [phrase(view, "previous")]),
        button("select", () => selectMatches(view), [phrase(view, "all")]),
        crelt("label", null, [this.caseField, phrase(view, "match case")]),
        crelt("label", null, [this.reField, phrase(view, "regexp")]),
        crelt("label", null, [this.wordField, phrase(view, "by word")]),
        ...view.state.readOnly ? [] : [
          crelt("br"),
          this.replaceField,
          button("replace", () => replaceNext(view), [phrase(view, "replace")]),
          button("replaceAll", () => replaceAll(view), [phrase(view, "replace all")])
        ],
        crelt("button", {
          name: "close",
          onclick: () => closeSearchPanel(view),
          "aria-label": phrase(view, "close"),
          type: "button"
        }, ["\xD7"])
      ]);
    }
    commit() {
      let query = new SearchQuery({
        search: this.searchField.value,
        caseSensitive: this.caseField.checked,
        regexp: this.reField.checked,
        wholeWord: this.wordField.checked,
        replace: this.replaceField.value
      });
      if (!query.eq(this.query)) {
        this.query = query;
        this.view.dispatch({ effects: setSearchQuery.of(query) });
      }
    }
    keydown(e) {
      if (runScopeHandlers(this.view, e, "search-panel")) {
        e.preventDefault();
      } else if (e.keyCode == 13 && e.target == this.searchField) {
        e.preventDefault();
        (e.shiftKey ? findPrevious : findNext)(this.view);
      } else if (e.keyCode == 13 && e.target == this.replaceField) {
        e.preventDefault();
        replaceNext(this.view);
      }
    }
    update(update) {
      for (let tr of update.transactions)
        for (let effect of tr.effects) {
          if (effect.is(setSearchQuery) && !effect.value.eq(this.query))
            this.setQuery(effect.value);
        }
    }
    setQuery(query) {
      this.query = query;
      this.searchField.value = query.search;
      this.replaceField.value = query.replace;
      this.caseField.checked = query.caseSensitive;
      this.reField.checked = query.regexp;
      this.wordField.checked = query.wholeWord;
    }
    mount() {
      this.searchField.select();
    }
    get pos() {
      return 80;
    }
    get top() {
      return this.view.state.facet(searchConfigFacet).top;
    }
  }
  function phrase(view, phrase2) {
    return view.state.phrase(phrase2);
  }
  const AnnounceMargin = 30;
  const Break = /[\s\.,:;?!]/;
  function announceMatch(view, { from, to }) {
    let line = view.state.doc.lineAt(from), lineEnd = view.state.doc.lineAt(to).to;
    let start = Math.max(line.from, from - AnnounceMargin), end = Math.min(lineEnd, to + AnnounceMargin);
    let text = view.state.sliceDoc(start, end);
    if (start != line.from) {
      for (let i2 = 0; i2 < AnnounceMargin; i2++)
        if (!Break.test(text[i2 + 1]) && Break.test(text[i2])) {
          text = text.slice(i2);
          break;
        }
    }
    if (end != lineEnd) {
      for (let i2 = text.length - 1; i2 > text.length - AnnounceMargin; i2--)
        if (!Break.test(text[i2 - 1]) && Break.test(text[i2])) {
          text = text.slice(0, i2);
          break;
        }
    }
    return EditorView.announce.of(`${view.state.phrase("current match")}. ${text} ${view.state.phrase("on line")} ${line.number}.`);
  }
  const baseTheme$3 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-panel.cm-search": {
      padding: "2px 6px 4px",
      position: "relative",
      "& [name=close]": {
        position: "absolute",
        top: "0",
        right: "4px",
        backgroundColor: "inherit",
        border: "none",
        font: "inherit",
        padding: 0,
        margin: 0
      },
      "& input, & button, & label": {
        margin: ".2em .6em .2em 0"
      },
      "& input[type=checkbox]": {
        marginRight: ".2em"
      },
      "& label": {
        fontSize: "80%",
        whiteSpace: "pre"
      }
    },
    "&light .cm-searchMatch": { backgroundColor: "#ffff0054" },
    "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
    "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
    "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
  });
  const searchExtensions = [
    searchState,
    /* @__PURE__ */ Prec.low(searchHighlighter),
    baseTheme$3
  ];
  class CompletionContext {
    constructor(state, pos, explicit) {
      this.state = state;
      this.pos = pos;
      this.explicit = explicit;
      this.abortListeners = [];
    }
    tokenBefore(types2) {
      let token = syntaxTree(this.state).resolveInner(this.pos, -1);
      while (token && types2.indexOf(token.name) < 0)
        token = token.parent;
      return token ? {
        from: token.from,
        to: this.pos,
        text: this.state.sliceDoc(token.from, this.pos),
        type: token.type
      } : null;
    }
    matchBefore(expr) {
      let line = this.state.doc.lineAt(this.pos);
      let start = Math.max(line.from, this.pos - 250);
      let str = line.text.slice(start - line.from, this.pos - line.from);
      let found = str.search(ensureAnchor(expr, false));
      return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };
    }
    get aborted() {
      return this.abortListeners == null;
    }
    addEventListener(type, listener) {
      if (type == "abort" && this.abortListeners)
        this.abortListeners.push(listener);
    }
  }
  function toSet(chars) {
    let flat = Object.keys(chars).join("");
    let words = /\w/.test(flat);
    if (words)
      flat = flat.replace(/\w/g, "");
    return `[${words ? "\\w" : ""}${flat.replace(/[^\w\s]/g, "\\$&")}]`;
  }
  function prefixMatch(options) {
    let first = Object.create(null), rest2 = Object.create(null);
    for (let { label } of options) {
      first[label[0]] = true;
      for (let i2 = 1; i2 < label.length; i2++)
        rest2[label[i2]] = true;
    }
    let source = toSet(first) + toSet(rest2) + "*$";
    return [new RegExp("^" + source), new RegExp(source)];
  }
  function completeFromList(list) {
    let options = list.map((o) => typeof o == "string" ? { label: o } : o);
    let [validFor, match] = options.every((o) => /^\w+$/.test(o.label)) ? [/\w*$/, /\w+$/] : prefixMatch(options);
    return (context) => {
      let token = context.matchBefore(match);
      return token || context.explicit ? { from: token ? token.from : context.pos, options, validFor } : null;
    };
  }
  function ifNotIn(nodes, source) {
    return (context) => {
      for (let pos = syntaxTree(context.state).resolveInner(context.pos, -1); pos; pos = pos.parent) {
        if (nodes.indexOf(pos.name) > -1)
          return null;
        if (pos.type.isTop)
          break;
      }
      return source(context);
    };
  }
  class Option {
    constructor(completion, source, match, score2) {
      this.completion = completion;
      this.source = source;
      this.match = match;
      this.score = score2;
    }
  }
  function cur(state) {
    return state.selection.main.from;
  }
  function ensureAnchor(expr, start) {
    var _a2;
    let { source } = expr;
    let addStart = start && source[0] != "^", addEnd = source[source.length - 1] != "$";
    if (!addStart && !addEnd)
      return expr;
    return new RegExp(`${addStart ? "^" : ""}(?:${source})${addEnd ? "$" : ""}`, (_a2 = expr.flags) !== null && _a2 !== void 0 ? _a2 : expr.ignoreCase ? "i" : "");
  }
  const pickedCompletion = /* @__PURE__ */ Annotation.define();
  function insertCompletionText(state, text, from, to) {
    let { main } = state.selection, fromOff = from - main.from, toOff = to - main.from;
    return Object.assign(Object.assign({}, state.changeByRange((range) => {
      if (range != main && from != to && state.sliceDoc(range.from + fromOff, range.from + toOff) != state.sliceDoc(from, to))
        return { range };
      return {
        changes: { from: range.from + fromOff, to: to == main.from ? range.to : range.from + toOff, insert: text },
        range: EditorSelection.cursor(range.from + fromOff + text.length)
      };
    })), { scrollIntoView: true, userEvent: "input.complete" });
  }
  const SourceCache = /* @__PURE__ */ new WeakMap();
  function asSource(source) {
    if (!Array.isArray(source))
      return source;
    let known = SourceCache.get(source);
    if (!known)
      SourceCache.set(source, known = completeFromList(source));
    return known;
  }
  const startCompletionEffect = /* @__PURE__ */ StateEffect.define();
  const closeCompletionEffect = /* @__PURE__ */ StateEffect.define();
  class FuzzyMatcher {
    constructor(pattern) {
      this.pattern = pattern;
      this.chars = [];
      this.folded = [];
      this.any = [];
      this.precise = [];
      this.byWord = [];
      this.score = 0;
      this.matched = [];
      for (let p = 0; p < pattern.length; ) {
        let char = codePointAt(pattern, p), size = codePointSize(char);
        this.chars.push(char);
        let part = pattern.slice(p, p + size), upper = part.toUpperCase();
        this.folded.push(codePointAt(upper == part ? part.toLowerCase() : upper, 0));
        p += size;
      }
      this.astral = pattern.length != this.chars.length;
    }
    ret(score2, matched) {
      this.score = score2;
      this.matched = matched;
      return true;
    }
    match(word) {
      if (this.pattern.length == 0)
        return this.ret(-100, []);
      if (word.length < this.pattern.length)
        return false;
      let { chars, folded, any, precise, byWord } = this;
      if (chars.length == 1) {
        let first = codePointAt(word, 0), firstSize = codePointSize(first);
        let score2 = firstSize == word.length ? 0 : -100;
        if (first == chars[0])
          ;
        else if (first == folded[0])
          score2 += -200;
        else
          return false;
        return this.ret(score2, [0, firstSize]);
      }
      let direct = word.indexOf(this.pattern);
      if (direct == 0)
        return this.ret(word.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
      let len = chars.length, anyTo = 0;
      if (direct < 0) {
        for (let i2 = 0, e = Math.min(word.length, 200); i2 < e && anyTo < len; ) {
          let next = codePointAt(word, i2);
          if (next == chars[anyTo] || next == folded[anyTo])
            any[anyTo++] = i2;
          i2 += codePointSize(next);
        }
        if (anyTo < len)
          return false;
      }
      let preciseTo = 0;
      let byWordTo = 0, byWordFolded = false;
      let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;
      let hasLower = /[a-z]/.test(word), wordAdjacent = true;
      for (let i2 = 0, e = Math.min(word.length, 200), prevType = 0; i2 < e && byWordTo < len; ) {
        let next = codePointAt(word, i2);
        if (direct < 0) {
          if (preciseTo < len && next == chars[preciseTo])
            precise[preciseTo++] = i2;
          if (adjacentTo < len) {
            if (next == chars[adjacentTo] || next == folded[adjacentTo]) {
              if (adjacentTo == 0)
                adjacentStart = i2;
              adjacentEnd = i2 + 1;
              adjacentTo++;
            } else {
              adjacentTo = 0;
            }
          }
        }
        let ch, type = next < 255 ? next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 : next >= 65 && next <= 90 ? 1 : 0 : (ch = fromCodePoint(next)) != ch.toLowerCase() ? 1 : ch != ch.toUpperCase() ? 2 : 0;
        if (!i2 || type == 1 && hasLower || prevType == 0 && type != 0) {
          if (chars[byWordTo] == next || folded[byWordTo] == next && (byWordFolded = true))
            byWord[byWordTo++] = i2;
          else if (byWord.length)
            wordAdjacent = false;
        }
        prevType = type;
        i2 += codePointSize(next);
      }
      if (byWordTo == len && byWord[0] == 0 && wordAdjacent)
        return this.result(-100 + (byWordFolded ? -200 : 0), byWord, word);
      if (adjacentTo == len && adjacentStart == 0)
        return this.ret(-200 - word.length + (adjacentEnd == word.length ? 0 : -100), [0, adjacentEnd]);
      if (direct > -1)
        return this.ret(-700 - word.length, [direct, direct + this.pattern.length]);
      if (adjacentTo == len)
        return this.ret(-200 + -700 - word.length, [adjacentStart, adjacentEnd]);
      if (byWordTo == len)
        return this.result(-100 + (byWordFolded ? -200 : 0) + -700 + (wordAdjacent ? 0 : -1100), byWord, word);
      return chars.length == 2 ? false : this.result((any[0] ? -700 : 0) + -200 + -1100, any, word);
    }
    result(score2, positions, word) {
      let result = [], i2 = 0;
      for (let pos of positions) {
        let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);
        if (i2 && result[i2 - 1] == pos)
          result[i2 - 1] = to;
        else {
          result[i2++] = pos;
          result[i2++] = to;
        }
      }
      return this.ret(score2 - word.length, result);
    }
  }
  const completionConfig = /* @__PURE__ */ Facet.define({
    combine(configs) {
      return combineConfig(configs, {
        activateOnTyping: true,
        selectOnOpen: true,
        override: null,
        closeOnBlur: true,
        maxRenderedOptions: 100,
        defaultKeymap: true,
        tooltipClass: () => "",
        optionClass: () => "",
        aboveCursor: false,
        icons: true,
        addToOptions: [],
        positionInfo: defaultPositionInfo,
        compareCompletions: (a, b) => a.label.localeCompare(b.label),
        interactionDelay: 75,
        updateSyncTime: 100
      }, {
        defaultKeymap: (a, b) => a && b,
        closeOnBlur: (a, b) => a && b,
        icons: (a, b) => a && b,
        tooltipClass: (a, b) => (c) => joinClass(a(c), b(c)),
        optionClass: (a, b) => (c) => joinClass(a(c), b(c)),
        addToOptions: (a, b) => a.concat(b)
      });
    }
  });
  function joinClass(a, b) {
    return a ? b ? a + " " + b : a : b;
  }
  function defaultPositionInfo(view, list, option, info, space2, tooltip) {
    let rtl = view.textDirection == Direction.RTL, left = rtl, narrow = false;
    let side = "top", offset, maxWidth;
    let spaceLeft = list.left - space2.left, spaceRight = space2.right - list.right;
    let infoWidth = info.right - info.left, infoHeight = info.bottom - info.top;
    if (left && spaceLeft < Math.min(infoWidth, spaceRight))
      left = false;
    else if (!left && spaceRight < Math.min(infoWidth, spaceLeft))
      left = true;
    if (infoWidth <= (left ? spaceLeft : spaceRight)) {
      offset = Math.max(space2.top, Math.min(option.top, space2.bottom - infoHeight)) - list.top;
      maxWidth = Math.min(400, left ? spaceLeft : spaceRight);
    } else {
      narrow = true;
      maxWidth = Math.min(400, (rtl ? list.right : space2.right - list.left) - 30);
      let spaceBelow = space2.bottom - list.bottom;
      if (spaceBelow >= infoHeight || spaceBelow > list.top) {
        offset = option.bottom - list.top;
      } else {
        side = "bottom";
        offset = list.bottom - option.top;
      }
    }
    let scaleY = (list.bottom - list.top) / tooltip.offsetHeight;
    let scaleX = (list.right - list.left) / tooltip.offsetWidth;
    return {
      style: `${side}: ${offset / scaleY}px; max-width: ${maxWidth / scaleX}px`,
      class: "cm-completionInfo-" + (narrow ? rtl ? "left-narrow" : "right-narrow" : left ? "left" : "right")
    };
  }
  function optionContent(config2) {
    let content2 = config2.addToOptions.slice();
    if (config2.icons)
      content2.push({
        render(completion) {
          let icon = document.createElement("div");
          icon.classList.add("cm-completionIcon");
          if (completion.type)
            icon.classList.add(...completion.type.split(/\s+/g).map((cls) => "cm-completionIcon-" + cls));
          icon.setAttribute("aria-hidden", "true");
          return icon;
        },
        position: 20
      });
    content2.push({
      render(completion, _s, _v, match) {
        let labelElt = document.createElement("span");
        labelElt.className = "cm-completionLabel";
        let label = completion.displayLabel || completion.label, off2 = 0;
        for (let j = 0; j < match.length; ) {
          let from = match[j++], to = match[j++];
          if (from > off2)
            labelElt.appendChild(document.createTextNode(label.slice(off2, from)));
          let span = labelElt.appendChild(document.createElement("span"));
          span.appendChild(document.createTextNode(label.slice(from, to)));
          span.className = "cm-completionMatchedText";
          off2 = to;
        }
        if (off2 < label.length)
          labelElt.appendChild(document.createTextNode(label.slice(off2)));
        return labelElt;
      },
      position: 50
    }, {
      render(completion) {
        if (!completion.detail)
          return null;
        let detailElt = document.createElement("span");
        detailElt.className = "cm-completionDetail";
        detailElt.textContent = completion.detail;
        return detailElt;
      },
      position: 80
    });
    return content2.sort((a, b) => a.position - b.position).map((a) => a.render);
  }
  function rangeAroundSelected(total, selected, max) {
    if (total <= max)
      return { from: 0, to: total };
    if (selected < 0)
      selected = 0;
    if (selected <= total >> 1) {
      let off3 = Math.floor(selected / max);
      return { from: off3 * max, to: (off3 + 1) * max };
    }
    let off2 = Math.floor((total - selected) / max);
    return { from: total - (off2 + 1) * max, to: total - off2 * max };
  }
  class CompletionTooltip {
    constructor(view, stateField, applyCompletion2) {
      this.view = view;
      this.stateField = stateField;
      this.applyCompletion = applyCompletion2;
      this.info = null;
      this.infoDestroy = null;
      this.placeInfoReq = {
        read: () => this.measureInfo(),
        write: (pos) => this.placeInfo(pos),
        key: this
      };
      this.space = null;
      this.currentClass = "";
      let cState = view.state.field(stateField);
      let { options, selected } = cState.open;
      let config2 = view.state.facet(completionConfig);
      this.optionContent = optionContent(config2);
      this.optionClass = config2.optionClass;
      this.tooltipClass = config2.tooltipClass;
      this.range = rangeAroundSelected(options.length, selected, config2.maxRenderedOptions);
      this.dom = document.createElement("div");
      this.dom.className = "cm-tooltip-autocomplete";
      this.updateTooltipClass(view.state);
      this.dom.addEventListener("mousedown", (e) => {
        let { options: options2 } = view.state.field(stateField).open;
        for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {
          if (dom.nodeName == "LI" && (match = /-(\d+)$/.exec(dom.id)) && +match[1] < options2.length) {
            this.applyCompletion(view, options2[+match[1]]);
            e.preventDefault();
            return;
          }
        }
      });
      this.dom.addEventListener("focusout", (e) => {
        let state = view.state.field(this.stateField, false);
        if (state && state.tooltip && view.state.facet(completionConfig).closeOnBlur && e.relatedTarget != view.contentDOM)
          view.dispatch({ effects: closeCompletionEffect.of(null) });
      });
      this.showOptions(options, cState.id);
    }
    mount() {
      this.updateSel();
    }
    showOptions(options, id2) {
      if (this.list)
        this.list.remove();
      this.list = this.dom.appendChild(this.createListBox(options, id2, this.range));
      this.list.addEventListener("scroll", () => {
        if (this.info)
          this.view.requestMeasure(this.placeInfoReq);
      });
    }
    update(update) {
      var _a2;
      let cState = update.state.field(this.stateField);
      let prevState = update.startState.field(this.stateField);
      this.updateTooltipClass(update.state);
      if (cState != prevState) {
        let { options, selected, disabled } = cState.open;
        if (!prevState.open || prevState.open.options != options) {
          this.range = rangeAroundSelected(options.length, selected, update.state.facet(completionConfig).maxRenderedOptions);
          this.showOptions(options, cState.id);
        }
        this.updateSel();
        if (disabled != ((_a2 = prevState.open) === null || _a2 === void 0 ? void 0 : _a2.disabled))
          this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!disabled);
      }
    }
    updateTooltipClass(state) {
      let cls = this.tooltipClass(state);
      if (cls != this.currentClass) {
        for (let c of this.currentClass.split(" "))
          if (c)
            this.dom.classList.remove(c);
        for (let c of cls.split(" "))
          if (c)
            this.dom.classList.add(c);
        this.currentClass = cls;
      }
    }
    positioned(space2) {
      this.space = space2;
      if (this.info)
        this.view.requestMeasure(this.placeInfoReq);
    }
    updateSel() {
      let cState = this.view.state.field(this.stateField), open2 = cState.open;
      if (open2.selected > -1 && open2.selected < this.range.from || open2.selected >= this.range.to) {
        this.range = rangeAroundSelected(open2.options.length, open2.selected, this.view.state.facet(completionConfig).maxRenderedOptions);
        this.showOptions(open2.options, cState.id);
      }
      if (this.updateSelectedOption(open2.selected)) {
        this.destroyInfo();
        let { completion } = open2.options[open2.selected];
        let { info } = completion;
        if (!info)
          return;
        let infoResult = typeof info === "string" ? document.createTextNode(info) : info(completion);
        if (!infoResult)
          return;
        if ("then" in infoResult) {
          infoResult.then((obj) => {
            if (obj && this.view.state.field(this.stateField, false) == cState)
              this.addInfoPane(obj, completion);
          }).catch((e) => logException(this.view.state, e, "completion info"));
        } else {
          this.addInfoPane(infoResult, completion);
        }
      }
    }
    addInfoPane(content2, completion) {
      this.destroyInfo();
      let wrap = this.info = document.createElement("div");
      wrap.className = "cm-tooltip cm-completionInfo";
      if (content2.nodeType != null) {
        wrap.appendChild(content2);
        this.infoDestroy = null;
      } else {
        let { dom, destroy } = content2;
        wrap.appendChild(dom);
        this.infoDestroy = destroy || null;
      }
      this.dom.appendChild(wrap);
      this.view.requestMeasure(this.placeInfoReq);
    }
    updateSelectedOption(selected) {
      let set = null;
      for (let opt = this.list.firstChild, i2 = this.range.from; opt; opt = opt.nextSibling, i2++) {
        if (opt.nodeName != "LI" || !opt.id) {
          i2--;
        } else if (i2 == selected) {
          if (!opt.hasAttribute("aria-selected")) {
            opt.setAttribute("aria-selected", "true");
            set = opt;
          }
        } else {
          if (opt.hasAttribute("aria-selected"))
            opt.removeAttribute("aria-selected");
        }
      }
      if (set)
        scrollIntoView(this.list, set);
      return set;
    }
    measureInfo() {
      let sel = this.dom.querySelector("[aria-selected]");
      if (!sel || !this.info)
        return null;
      let listRect = this.dom.getBoundingClientRect();
      let infoRect = this.info.getBoundingClientRect();
      let selRect = sel.getBoundingClientRect();
      let space2 = this.space;
      if (!space2) {
        let win = this.dom.ownerDocument.defaultView || window;
        space2 = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };
      }
      if (selRect.top > Math.min(space2.bottom, listRect.bottom) - 10 || selRect.bottom < Math.max(space2.top, listRect.top) + 10)
        return null;
      return this.view.state.facet(completionConfig).positionInfo(this.view, listRect, selRect, infoRect, space2, this.dom);
    }
    placeInfo(pos) {
      if (this.info) {
        if (pos) {
          if (pos.style)
            this.info.style.cssText = pos.style;
          this.info.className = "cm-tooltip cm-completionInfo " + (pos.class || "");
        } else {
          this.info.style.cssText = "top: -1e6px";
        }
      }
    }
    createListBox(options, id2, range) {
      const ul = document.createElement("ul");
      ul.id = id2;
      ul.setAttribute("role", "listbox");
      ul.setAttribute("aria-expanded", "true");
      ul.setAttribute("aria-label", this.view.state.phrase("Completions"));
      let curSection = null;
      for (let i2 = range.from; i2 < range.to; i2++) {
        let { completion, match } = options[i2], { section } = completion;
        if (section) {
          let name2 = typeof section == "string" ? section : section.name;
          if (name2 != curSection && (i2 > range.from || range.from == 0)) {
            curSection = name2;
            if (typeof section != "string" && section.header) {
              ul.appendChild(section.header(section));
            } else {
              let header = ul.appendChild(document.createElement("completion-section"));
              header.textContent = name2;
            }
          }
        }
        const li = ul.appendChild(document.createElement("li"));
        li.id = id2 + "-" + i2;
        li.setAttribute("role", "option");
        let cls = this.optionClass(completion);
        if (cls)
          li.className = cls;
        for (let source of this.optionContent) {
          let node = source(completion, this.view.state, this.view, match);
          if (node)
            li.appendChild(node);
        }
      }
      if (range.from)
        ul.classList.add("cm-completionListIncompleteTop");
      if (range.to < options.length)
        ul.classList.add("cm-completionListIncompleteBottom");
      return ul;
    }
    destroyInfo() {
      if (this.info) {
        if (this.infoDestroy)
          this.infoDestroy();
        this.info.remove();
        this.info = null;
      }
    }
    destroy() {
      this.destroyInfo();
    }
  }
  function completionTooltip(stateField, applyCompletion2) {
    return (view) => new CompletionTooltip(view, stateField, applyCompletion2);
  }
  function scrollIntoView(container, element) {
    let parent = container.getBoundingClientRect();
    let self2 = element.getBoundingClientRect();
    let scaleY = parent.height / container.offsetHeight;
    if (self2.top < parent.top)
      container.scrollTop -= (parent.top - self2.top) / scaleY;
    else if (self2.bottom > parent.bottom)
      container.scrollTop += (self2.bottom - parent.bottom) / scaleY;
  }
  function score(option) {
    return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) + (option.type ? 1 : 0);
  }
  function sortOptions(active, state) {
    let options = [];
    let sections = null;
    let addOption = (option) => {
      options.push(option);
      let { section } = option.completion;
      if (section) {
        if (!sections)
          sections = [];
        let name2 = typeof section == "string" ? section : section.name;
        if (!sections.some((s) => s.name == name2))
          sections.push(typeof section == "string" ? { name: name2 } : section);
      }
    };
    for (let a of active)
      if (a.hasResult()) {
        let getMatch = a.result.getMatch;
        if (a.result.filter === false) {
          for (let option of a.result.options) {
            addOption(new Option(option, a.source, getMatch ? getMatch(option) : [], 1e9 - options.length));
          }
        } else {
          let matcher = new FuzzyMatcher(state.sliceDoc(a.from, a.to));
          for (let option of a.result.options)
            if (matcher.match(option.label)) {
              let matched = !option.displayLabel ? matcher.matched : getMatch ? getMatch(option, matcher.matched) : [];
              addOption(new Option(option, a.source, matched, matcher.score + (option.boost || 0)));
            }
        }
      }
    if (sections) {
      let sectionOrder = Object.create(null), pos = 0;
      let cmp = (a, b) => {
        var _a2, _b;
        return ((_a2 = a.rank) !== null && _a2 !== void 0 ? _a2 : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a.name < b.name ? -1 : 1);
      };
      for (let s of sections.sort(cmp)) {
        pos -= 1e5;
        sectionOrder[s.name] = pos;
      }
      for (let option of options) {
        let { section } = option.completion;
        if (section)
          option.score += sectionOrder[typeof section == "string" ? section : section.name];
      }
    }
    let result = [], prev = null;
    let compare2 = state.facet(completionConfig).compareCompletions;
    for (let opt of options.sort((a, b) => b.score - a.score || compare2(a.completion, b.completion))) {
      let cur2 = opt.completion;
      if (!prev || prev.label != cur2.label || prev.detail != cur2.detail || prev.type != null && cur2.type != null && prev.type != cur2.type || prev.apply != cur2.apply || prev.boost != cur2.boost)
        result.push(opt);
      else if (score(opt.completion) > score(prev))
        result[result.length - 1] = opt;
      prev = opt.completion;
    }
    return result;
  }
  class CompletionDialog {
    constructor(options, attrs, tooltip, timestamp, selected, disabled) {
      this.options = options;
      this.attrs = attrs;
      this.tooltip = tooltip;
      this.timestamp = timestamp;
      this.selected = selected;
      this.disabled = disabled;
    }
    setSelected(selected, id2) {
      return selected == this.selected || selected >= this.options.length ? this : new CompletionDialog(this.options, makeAttrs(id2, selected), this.tooltip, this.timestamp, selected, this.disabled);
    }
    static build(active, state, id2, prev, conf) {
      let options = sortOptions(active, state);
      if (!options.length) {
        return prev && active.some((a) => a.state == 1) ? new CompletionDialog(prev.options, prev.attrs, prev.tooltip, prev.timestamp, prev.selected, true) : null;
      }
      let selected = state.facet(completionConfig).selectOnOpen ? 0 : -1;
      if (prev && prev.selected != selected && prev.selected != -1) {
        let selectedValue = prev.options[prev.selected].completion;
        for (let i2 = 0; i2 < options.length; i2++)
          if (options[i2].completion == selectedValue) {
            selected = i2;
            break;
          }
      }
      return new CompletionDialog(options, makeAttrs(id2, selected), {
        pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8),
        create: createTooltip,
        above: conf.aboveCursor
      }, prev ? prev.timestamp : Date.now(), selected, false);
    }
    map(changes) {
      return new CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled);
    }
  }
  class CompletionState {
    constructor(active, id2, open2) {
      this.active = active;
      this.id = id2;
      this.open = open2;
    }
    static start() {
      return new CompletionState(none, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
    }
    update(tr) {
      let { state } = tr, conf = state.facet(completionConfig);
      let sources = conf.override || state.languageDataAt("autocomplete", cur(state)).map(asSource);
      let active = sources.map((source) => {
        let value2 = this.active.find((s) => s.source == source) || new ActiveSource(source, this.active.some((a) => a.state != 0) ? 1 : 0);
        return value2.update(tr, conf);
      });
      if (active.length == this.active.length && active.every((a, i2) => a == this.active[i2]))
        active = this.active;
      let open2 = this.open;
      if (open2 && tr.docChanged)
        open2 = open2.map(tr.changes);
      if (tr.selection || active.some((a) => a.hasResult() && tr.changes.touchesRange(a.from, a.to)) || !sameResults(active, this.active))
        open2 = CompletionDialog.build(active, state, this.id, open2, conf);
      else if (open2 && open2.disabled && !active.some((a) => a.state == 1))
        open2 = null;
      if (!open2 && active.every((a) => a.state != 1) && active.some((a) => a.hasResult()))
        active = active.map((a) => a.hasResult() ? new ActiveSource(a.source, 0) : a);
      for (let effect of tr.effects)
        if (effect.is(setSelectedEffect))
          open2 = open2 && open2.setSelected(effect.value, this.id);
      return active == this.active && open2 == this.open ? this : new CompletionState(active, this.id, open2);
    }
    get tooltip() {
      return this.open ? this.open.tooltip : null;
    }
    get attrs() {
      return this.open ? this.open.attrs : baseAttrs;
    }
  }
  function sameResults(a, b) {
    if (a == b)
      return true;
    for (let iA = 0, iB = 0; ; ) {
      while (iA < a.length && !a[iA].hasResult)
        iA++;
      while (iB < b.length && !b[iB].hasResult)
        iB++;
      let endA = iA == a.length, endB = iB == b.length;
      if (endA || endB)
        return endA == endB;
      if (a[iA++].result != b[iB++].result)
        return false;
    }
  }
  const baseAttrs = {
    "aria-autocomplete": "list"
  };
  function makeAttrs(id2, selected) {
    let result = {
      "aria-autocomplete": "list",
      "aria-haspopup": "listbox",
      "aria-controls": id2
    };
    if (selected > -1)
      result["aria-activedescendant"] = id2 + "-" + selected;
    return result;
  }
  const none = [];
  function getUserEvent(tr) {
    return tr.isUserEvent("input.type") ? "input" : tr.isUserEvent("delete.backward") ? "delete" : null;
  }
  class ActiveSource {
    constructor(source, state, explicitPos = -1) {
      this.source = source;
      this.state = state;
      this.explicitPos = explicitPos;
    }
    hasResult() {
      return false;
    }
    update(tr, conf) {
      let event = getUserEvent(tr), value2 = this;
      if (event)
        value2 = value2.handleUserEvent(tr, event, conf);
      else if (tr.docChanged)
        value2 = value2.handleChange(tr);
      else if (tr.selection && value2.state != 0)
        value2 = new ActiveSource(value2.source, 0);
      for (let effect of tr.effects) {
        if (effect.is(startCompletionEffect))
          value2 = new ActiveSource(value2.source, 1, effect.value ? cur(tr.state) : -1);
        else if (effect.is(closeCompletionEffect))
          value2 = new ActiveSource(value2.source, 0);
        else if (effect.is(setActiveEffect)) {
          for (let active of effect.value)
            if (active.source == value2.source)
              value2 = active;
        }
      }
      return value2;
    }
    handleUserEvent(tr, type, conf) {
      return type == "delete" || !conf.activateOnTyping ? this.map(tr.changes) : new ActiveSource(this.source, 1);
    }
    handleChange(tr) {
      return tr.changes.touchesRange(cur(tr.startState)) ? new ActiveSource(this.source, 0) : this.map(tr.changes);
    }
    map(changes) {
      return changes.empty || this.explicitPos < 0 ? this : new ActiveSource(this.source, this.state, changes.mapPos(this.explicitPos));
    }
  }
  class ActiveResult extends ActiveSource {
    constructor(source, explicitPos, result, from, to) {
      super(source, 2, explicitPos);
      this.result = result;
      this.from = from;
      this.to = to;
    }
    hasResult() {
      return true;
    }
    handleUserEvent(tr, type, conf) {
      var _a2;
      let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);
      let pos = cur(tr.state);
      if ((this.explicitPos < 0 ? pos <= from : pos < this.from) || pos > to || type == "delete" && cur(tr.startState) == this.from)
        return new ActiveSource(this.source, type == "input" && conf.activateOnTyping ? 1 : 0);
      let explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos), updated;
      if (checkValid(this.result.validFor, tr.state, from, to))
        return new ActiveResult(this.source, explicitPos, this.result, from, to);
      if (this.result.update && (updated = this.result.update(this.result, from, to, new CompletionContext(tr.state, pos, explicitPos >= 0))))
        return new ActiveResult(this.source, explicitPos, updated, updated.from, (_a2 = updated.to) !== null && _a2 !== void 0 ? _a2 : cur(tr.state));
      return new ActiveSource(this.source, 1, explicitPos);
    }
    handleChange(tr) {
      return tr.changes.touchesRange(this.from, this.to) ? new ActiveSource(this.source, 0) : this.map(tr.changes);
    }
    map(mapping) {
      return mapping.empty ? this : new ActiveResult(this.source, this.explicitPos < 0 ? -1 : mapping.mapPos(this.explicitPos), this.result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));
    }
  }
  function checkValid(validFor, state, from, to) {
    if (!validFor)
      return false;
    let text = state.sliceDoc(from, to);
    return typeof validFor == "function" ? validFor(text, from, to, state) : ensureAnchor(validFor, true).test(text);
  }
  const setActiveEffect = /* @__PURE__ */ StateEffect.define({
    map(sources, mapping) {
      return sources.map((s) => s.map(mapping));
    }
  });
  const setSelectedEffect = /* @__PURE__ */ StateEffect.define();
  const completionState = /* @__PURE__ */ StateField.define({
    create() {
      return CompletionState.start();
    },
    update(value2, tr) {
      return value2.update(tr);
    },
    provide: (f) => [
      showTooltip.from(f, (val) => val.tooltip),
      EditorView.contentAttributes.from(f, (state) => state.attrs)
    ]
  });
  function applyCompletion(view, option) {
    const apply = option.completion.apply || option.completion.label;
    let result = view.state.field(completionState).active.find((a) => a.source == option.source);
    if (!(result instanceof ActiveResult))
      return false;
    if (typeof apply == "string")
      view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, apply, result.from, result.to)), { annotations: pickedCompletion.of(option.completion) }));
    else
      apply(view, option.completion, result.from, result.to);
    return true;
  }
  const createTooltip = /* @__PURE__ */ completionTooltip(completionState, applyCompletion);
  function moveCompletionSelection(forward, by = "option") {
    return (view) => {
      let cState = view.state.field(completionState, false);
      if (!cState || !cState.open || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
        return false;
      let step = 1, tooltip;
      if (by == "page" && (tooltip = getTooltip(view, cState.open.tooltip)))
        step = Math.max(2, Math.floor(tooltip.dom.offsetHeight / tooltip.dom.querySelector("li").offsetHeight) - 1);
      let { length } = cState.open.options;
      let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length - 1;
      if (selected < 0)
        selected = by == "page" ? 0 : length - 1;
      else if (selected >= length)
        selected = by == "page" ? length - 1 : 0;
      view.dispatch({ effects: setSelectedEffect.of(selected) });
      return true;
    };
  }
  const acceptCompletion = (view) => {
    let cState = view.state.field(completionState, false);
    if (view.state.readOnly || !cState || !cState.open || cState.open.selected < 0 || cState.open.disabled || Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)
      return false;
    return applyCompletion(view, cState.open.options[cState.open.selected]);
  };
  const startCompletion = (view) => {
    let cState = view.state.field(completionState, false);
    if (!cState)
      return false;
    view.dispatch({ effects: startCompletionEffect.of(true) });
    return true;
  };
  const closeCompletion = (view) => {
    let cState = view.state.field(completionState, false);
    if (!cState || !cState.active.some((a) => a.state != 0))
      return false;
    view.dispatch({ effects: closeCompletionEffect.of(null) });
    return true;
  };
  class RunningQuery {
    constructor(active, context) {
      this.active = active;
      this.context = context;
      this.time = Date.now();
      this.updates = [];
      this.done = void 0;
    }
  }
  const MaxUpdateCount = 50, MinAbortTime = 1e3;
  const completionPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
    constructor(view) {
      this.view = view;
      this.debounceUpdate = -1;
      this.running = [];
      this.debounceAccept = -1;
      this.composing = 0;
      for (let active of view.state.field(completionState).active)
        if (active.state == 1)
          this.startQuery(active);
    }
    update(update) {
      let cState = update.state.field(completionState);
      if (!update.selectionSet && !update.docChanged && update.startState.field(completionState) == cState)
        return;
      let doesReset = update.transactions.some((tr) => {
        return (tr.selection || tr.docChanged) && !getUserEvent(tr);
      });
      for (let i2 = 0; i2 < this.running.length; i2++) {
        let query = this.running[i2];
        if (doesReset || query.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query.time > MinAbortTime) {
          for (let handler of query.context.abortListeners) {
            try {
              handler();
            } catch (e) {
              logException(this.view.state, e);
            }
          }
          query.context.abortListeners = null;
          this.running.splice(i2--, 1);
        } else {
          query.updates.push(...update.transactions);
        }
      }
      if (this.debounceUpdate > -1)
        clearTimeout(this.debounceUpdate);
      this.debounceUpdate = cState.active.some((a) => a.state == 1 && !this.running.some((q) => q.active.source == a.source)) ? setTimeout(() => this.startUpdate(), 50) : -1;
      if (this.composing != 0)
        for (let tr of update.transactions) {
          if (getUserEvent(tr) == "input")
            this.composing = 2;
          else if (this.composing == 2 && tr.selection)
            this.composing = 3;
        }
    }
    startUpdate() {
      this.debounceUpdate = -1;
      let { state } = this.view, cState = state.field(completionState);
      for (let active of cState.active) {
        if (active.state == 1 && !this.running.some((r) => r.active.source == active.source))
          this.startQuery(active);
      }
    }
    startQuery(active) {
      let { state } = this.view, pos = cur(state);
      let context = new CompletionContext(state, pos, active.explicitPos == pos);
      let pending = new RunningQuery(active, context);
      this.running.push(pending);
      Promise.resolve(active.source(context)).then((result) => {
        if (!pending.context.aborted) {
          pending.done = result || null;
          this.scheduleAccept();
        }
      }, (err) => {
        this.view.dispatch({ effects: closeCompletionEffect.of(null) });
        logException(this.view.state, err);
      });
    }
    scheduleAccept() {
      if (this.running.every((q) => q.done !== void 0))
        this.accept();
      else if (this.debounceAccept < 0)
        this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);
    }
    accept() {
      var _a2;
      if (this.debounceAccept > -1)
        clearTimeout(this.debounceAccept);
      this.debounceAccept = -1;
      let updated = [];
      let conf = this.view.state.facet(completionConfig);
      for (let i2 = 0; i2 < this.running.length; i2++) {
        let query = this.running[i2];
        if (query.done === void 0)
          continue;
        this.running.splice(i2--, 1);
        if (query.done) {
          let active = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_a2 = query.done.to) !== null && _a2 !== void 0 ? _a2 : cur(query.updates.length ? query.updates[0].startState : this.view.state));
          for (let tr of query.updates)
            active = active.update(tr, conf);
          if (active.hasResult()) {
            updated.push(active);
            continue;
          }
        }
        let current = this.view.state.field(completionState).active.find((a) => a.source == query.active.source);
        if (current && current.state == 1) {
          if (query.done == null) {
            let active = new ActiveSource(query.active.source, 0);
            for (let tr of query.updates)
              active = active.update(tr, conf);
            if (active.state != 1)
              updated.push(active);
          } else {
            this.startQuery(current);
          }
        }
      }
      if (updated.length)
        this.view.dispatch({ effects: setActiveEffect.of(updated) });
    }
  }, {
    eventHandlers: {
      blur(event) {
        let state = this.view.state.field(completionState, false);
        if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {
          let dialog = state.open && getTooltip(this.view, state.open.tooltip);
          if (!dialog || !dialog.dom.contains(event.relatedTarget))
            this.view.dispatch({ effects: closeCompletionEffect.of(null) });
        }
      },
      compositionstart() {
        this.composing = 1;
      },
      compositionend() {
        if (this.composing == 3) {
          setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20);
        }
        this.composing = 0;
      }
    }
  });
  const baseTheme$2 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-tooltip.cm-tooltip-autocomplete": {
      "& > ul": {
        fontFamily: "monospace",
        whiteSpace: "nowrap",
        overflow: "hidden auto",
        maxWidth_fallback: "700px",
        maxWidth: "min(700px, 95vw)",
        minWidth: "250px",
        maxHeight: "10em",
        height: "100%",
        listStyle: "none",
        margin: 0,
        padding: 0,
        "& > li, & > completion-section": {
          padding: "1px 3px",
          lineHeight: 1.2
        },
        "& > li": {
          overflowX: "hidden",
          textOverflow: "ellipsis",
          cursor: "pointer"
        },
        "& > completion-section": {
          display: "list-item",
          borderBottom: "1px solid silver",
          paddingLeft: "0.5em",
          opacity: 0.7
        }
      }
    },
    "&light .cm-tooltip-autocomplete ul li[aria-selected]": {
      background: "#17c",
      color: "white"
    },
    "&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
      background: "#777"
    },
    "&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
      background: "#347",
      color: "white"
    },
    "&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
      background: "#444"
    },
    ".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after": {
      content: '"\xB7\xB7\xB7"',
      opacity: 0.5,
      display: "block",
      textAlign: "center"
    },
    ".cm-tooltip.cm-completionInfo": {
      position: "absolute",
      padding: "3px 9px",
      width: "max-content",
      maxWidth: `${400}px`,
      boxSizing: "border-box"
    },
    ".cm-completionInfo.cm-completionInfo-left": { right: "100%" },
    ".cm-completionInfo.cm-completionInfo-right": { left: "100%" },
    ".cm-completionInfo.cm-completionInfo-left-narrow": { right: `${30}px` },
    ".cm-completionInfo.cm-completionInfo-right-narrow": { left: `${30}px` },
    "&light .cm-snippetField": { backgroundColor: "#00000022" },
    "&dark .cm-snippetField": { backgroundColor: "#ffffff22" },
    ".cm-snippetFieldPosition": {
      verticalAlign: "text-top",
      width: 0,
      height: "1.15em",
      display: "inline-block",
      margin: "0 -0.7px -.7em",
      borderLeft: "1.4px dotted #888"
    },
    ".cm-completionMatchedText": {
      textDecoration: "underline"
    },
    ".cm-completionDetail": {
      marginLeft: "0.5em",
      fontStyle: "italic"
    },
    ".cm-completionIcon": {
      fontSize: "90%",
      width: ".8em",
      display: "inline-block",
      textAlign: "center",
      paddingRight: ".6em",
      opacity: "0.6",
      boxSizing: "content-box"
    },
    ".cm-completionIcon-function, .cm-completionIcon-method": {
      "&:after": { content: "'\u0192'" }
    },
    ".cm-completionIcon-class": {
      "&:after": { content: "'\u25CB'" }
    },
    ".cm-completionIcon-interface": {
      "&:after": { content: "'\u25CC'" }
    },
    ".cm-completionIcon-variable": {
      "&:after": { content: "'\u{1D465}'" }
    },
    ".cm-completionIcon-constant": {
      "&:after": { content: "'\u{1D436}'" }
    },
    ".cm-completionIcon-type": {
      "&:after": { content: "'\u{1D461}'" }
    },
    ".cm-completionIcon-enum": {
      "&:after": { content: "'\u222A'" }
    },
    ".cm-completionIcon-property": {
      "&:after": { content: "'\u25A1'" }
    },
    ".cm-completionIcon-keyword": {
      "&:after": { content: "'\u{1F511}\uFE0E'" }
    },
    ".cm-completionIcon-namespace": {
      "&:after": { content: "'\u25A2'" }
    },
    ".cm-completionIcon-text": {
      "&:after": { content: "'abc'", fontSize: "50%", verticalAlign: "middle" }
    }
  });
  class FieldPos {
    constructor(field, line, from, to) {
      this.field = field;
      this.line = line;
      this.from = from;
      this.to = to;
    }
  }
  class FieldRange {
    constructor(field, from, to) {
      this.field = field;
      this.from = from;
      this.to = to;
    }
    map(changes) {
      let from = changes.mapPos(this.from, -1, MapMode.TrackDel);
      let to = changes.mapPos(this.to, 1, MapMode.TrackDel);
      return from == null || to == null ? null : new FieldRange(this.field, from, to);
    }
  }
  class Snippet {
    constructor(lines, fieldPositions) {
      this.lines = lines;
      this.fieldPositions = fieldPositions;
    }
    instantiate(state, pos) {
      let text = [], lineStart = [pos];
      let lineObj = state.doc.lineAt(pos), baseIndent = /^\s*/.exec(lineObj.text)[0];
      for (let line of this.lines) {
        if (text.length) {
          let indent = baseIndent, tabs = /^\t*/.exec(line)[0].length;
          for (let i2 = 0; i2 < tabs; i2++)
            indent += state.facet(indentUnit);
          lineStart.push(pos + indent.length - tabs);
          line = indent + line.slice(tabs);
        }
        text.push(line);
        pos += line.length + 1;
      }
      let ranges = this.fieldPositions.map((pos2) => new FieldRange(pos2.field, lineStart[pos2.line] + pos2.from, lineStart[pos2.line] + pos2.to));
      return { text, ranges };
    }
    static parse(template) {
      let fields = [];
      let lines = [], positions = [], m;
      for (let line of template.split(/\r\n?|\n/)) {
        while (m = /[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)) {
          let seq = m[1] ? +m[1] : null, name2 = m[2] || m[3] || "", found = -1;
          for (let i2 = 0; i2 < fields.length; i2++) {
            if (seq != null ? fields[i2].seq == seq : name2 ? fields[i2].name == name2 : false)
              found = i2;
          }
          if (found < 0) {
            let i2 = 0;
            while (i2 < fields.length && (seq == null || fields[i2].seq != null && fields[i2].seq < seq))
              i2++;
            fields.splice(i2, 0, { seq, name: name2 });
            found = i2;
            for (let pos of positions)
              if (pos.field >= found)
                pos.field++;
          }
          positions.push(new FieldPos(found, lines.length, m.index, m.index + name2.length));
          line = line.slice(0, m.index) + name2 + line.slice(m.index + m[0].length);
        }
        for (let esc; esc = /\\([{}])/.exec(line); ) {
          line = line.slice(0, esc.index) + esc[1] + line.slice(esc.index + esc[0].length);
          for (let pos of positions)
            if (pos.line == lines.length && pos.from > esc.index) {
              pos.from--;
              pos.to--;
            }
        }
        lines.push(line);
      }
      return new Snippet(lines, positions);
    }
  }
  let fieldMarker = /* @__PURE__ */ Decoration.widget({ widget: /* @__PURE__ */ new class extends WidgetType {
    toDOM() {
      let span = document.createElement("span");
      span.className = "cm-snippetFieldPosition";
      return span;
    }
    ignoreEvent() {
      return false;
    }
  }() });
  let fieldRange = /* @__PURE__ */ Decoration.mark({ class: "cm-snippetField" });
  class ActiveSnippet {
    constructor(ranges, active) {
      this.ranges = ranges;
      this.active = active;
      this.deco = Decoration.set(ranges.map((r) => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)));
    }
    map(changes) {
      let ranges = [];
      for (let r of this.ranges) {
        let mapped = r.map(changes);
        if (!mapped)
          return null;
        ranges.push(mapped);
      }
      return new ActiveSnippet(ranges, this.active);
    }
    selectionInsideField(sel) {
      return sel.ranges.every((range) => this.ranges.some((r) => r.field == this.active && r.from <= range.from && r.to >= range.to));
    }
  }
  const setActive = /* @__PURE__ */ StateEffect.define({
    map(value2, changes) {
      return value2 && value2.map(changes);
    }
  });
  const moveToField = /* @__PURE__ */ StateEffect.define();
  const snippetState = /* @__PURE__ */ StateField.define({
    create() {
      return null;
    },
    update(value2, tr) {
      for (let effect of tr.effects) {
        if (effect.is(setActive))
          return effect.value;
        if (effect.is(moveToField) && value2)
          return new ActiveSnippet(value2.ranges, effect.value);
      }
      if (value2 && tr.docChanged)
        value2 = value2.map(tr.changes);
      if (value2 && tr.selection && !value2.selectionInsideField(tr.selection))
        value2 = null;
      return value2;
    },
    provide: (f) => EditorView.decorations.from(f, (val) => val ? val.deco : Decoration.none)
  });
  function fieldSelection(ranges, field) {
    return EditorSelection.create(ranges.filter((r) => r.field == field).map((r) => EditorSelection.range(r.from, r.to)));
  }
  function snippet(template) {
    let snippet2 = Snippet.parse(template);
    return (editor, completion, from, to) => {
      let { text, ranges } = snippet2.instantiate(editor.state, from);
      let spec = {
        changes: { from, to, insert: Text$1.of(text) },
        scrollIntoView: true,
        annotations: completion ? pickedCompletion.of(completion) : void 0
      };
      if (ranges.length)
        spec.selection = fieldSelection(ranges, 0);
      if (ranges.length > 1) {
        let active = new ActiveSnippet(ranges, 0);
        let effects = spec.effects = [setActive.of(active)];
        if (editor.state.field(snippetState, false) === void 0)
          effects.push(StateEffect.appendConfig.of([snippetState, addSnippetKeymap, snippetPointerHandler, baseTheme$2]));
      }
      editor.dispatch(editor.state.update(spec));
    };
  }
  function moveField(dir) {
    return ({ state, dispatch }) => {
      let active = state.field(snippetState, false);
      if (!active || dir < 0 && active.active == 0)
        return false;
      let next = active.active + dir, last = dir > 0 && !active.ranges.some((r) => r.field == next + dir);
      dispatch(state.update({
        selection: fieldSelection(active.ranges, next),
        effects: setActive.of(last ? null : new ActiveSnippet(active.ranges, next)),
        scrollIntoView: true
      }));
      return true;
    };
  }
  const clearSnippet = ({ state, dispatch }) => {
    let active = state.field(snippetState, false);
    if (!active)
      return false;
    dispatch(state.update({ effects: setActive.of(null) }));
    return true;
  };
  const nextSnippetField = /* @__PURE__ */ moveField(1);
  const prevSnippetField = /* @__PURE__ */ moveField(-1);
  const defaultSnippetKeymap = [
    { key: "Tab", run: nextSnippetField, shift: prevSnippetField },
    { key: "Escape", run: clearSnippet }
  ];
  const snippetKeymap = /* @__PURE__ */ Facet.define({
    combine(maps) {
      return maps.length ? maps[0] : defaultSnippetKeymap;
    }
  });
  const addSnippetKeymap = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.compute([snippetKeymap], (state) => state.facet(snippetKeymap)));
  function snippetCompletion(template, completion) {
    return Object.assign(Object.assign({}, completion), { apply: snippet(template) });
  }
  const snippetPointerHandler = /* @__PURE__ */ EditorView.domEventHandlers({
    mousedown(event, view) {
      let active = view.state.field(snippetState, false), pos;
      if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)
        return false;
      let match = active.ranges.find((r) => r.from <= pos && r.to >= pos);
      if (!match || match.field == active.active)
        return false;
      view.dispatch({
        selection: fieldSelection(active.ranges, match.field),
        effects: setActive.of(active.ranges.some((r) => r.field > match.field) ? new ActiveSnippet(active.ranges, match.field) : null),
        scrollIntoView: true
      });
      return true;
    }
  });
  const defaults$1 = {
    brackets: ["(", "[", "{", "'", '"'],
    before: ")]}:;>",
    stringPrefixes: []
  };
  const closeBracketEffect = /* @__PURE__ */ StateEffect.define({
    map(value2, mapping) {
      let mapped = mapping.mapPos(value2, -1, MapMode.TrackAfter);
      return mapped == null ? void 0 : mapped;
    }
  });
  const closedBracket = /* @__PURE__ */ new class extends RangeValue {
  }();
  closedBracket.startSide = 1;
  closedBracket.endSide = -1;
  const bracketState = /* @__PURE__ */ StateField.define({
    create() {
      return RangeSet.empty;
    },
    update(value2, tr) {
      if (tr.selection) {
        let line = tr.state.doc.lineAt(tr.selection.main.head);
        value2 = value2.update({ filter: (from) => from >= line.from && from <= line.to });
      }
      value2 = value2.map(tr.changes);
      for (let effect of tr.effects)
        if (effect.is(closeBracketEffect))
          value2 = value2.update({ add: [closedBracket.range(effect.value, effect.value + 1)] });
      return value2;
    }
  });
  function closeBrackets() {
    return [inputHandler, bracketState];
  }
  const definedClosing = "()[]{}<>";
  function closing(ch) {
    for (let i2 = 0; i2 < definedClosing.length; i2 += 2)
      if (definedClosing.charCodeAt(i2) == ch)
        return definedClosing.charAt(i2 + 1);
    return fromCodePoint(ch < 128 ? ch : ch + 1);
  }
  function config(state, pos) {
    return state.languageDataAt("closeBrackets", pos)[0] || defaults$1;
  }
  const android$1 = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent);
  const inputHandler = /* @__PURE__ */ EditorView.inputHandler.of((view, from, to, insert2) => {
    if ((android$1 ? view.composing : view.compositionStarted) || view.state.readOnly)
      return false;
    let sel = view.state.selection.main;
    if (insert2.length > 2 || insert2.length == 2 && codePointSize(codePointAt(insert2, 0)) == 1 || from != sel.from || to != sel.to)
      return false;
    let tr = insertBracket(view.state, insert2);
    if (!tr)
      return false;
    view.dispatch(tr);
    return true;
  });
  const deleteBracketPair = ({ state, dispatch }) => {
    if (state.readOnly)
      return false;
    let conf = config(state, state.selection.main.head);
    let tokens = conf.brackets || defaults$1.brackets;
    let dont = null, changes = state.changeByRange((range) => {
      if (range.empty) {
        let before = prevChar(state.doc, range.head);
        for (let token of tokens) {
          if (token == before && nextChar(state.doc, range.head) == closing(codePointAt(token, 0)))
            return {
              changes: { from: range.head - token.length, to: range.head + token.length },
              range: EditorSelection.cursor(range.head - token.length)
            };
        }
      }
      return { range: dont = range };
    });
    if (!dont)
      dispatch(state.update(changes, { scrollIntoView: true, userEvent: "delete.backward" }));
    return !dont;
  };
  const closeBracketsKeymap = [
    { key: "Backspace", run: deleteBracketPair }
  ];
  function insertBracket(state, bracket2) {
    let conf = config(state, state.selection.main.head);
    let tokens = conf.brackets || defaults$1.brackets;
    for (let tok of tokens) {
      let closed = closing(codePointAt(tok, 0));
      if (bracket2 == tok)
        return closed == tok ? handleSame(state, tok, tokens.indexOf(tok + tok + tok) > -1, conf) : handleOpen(state, tok, closed, conf.before || defaults$1.before);
      if (bracket2 == closed && closedBracketAt(state, state.selection.main.from))
        return handleClose(state, tok, closed);
    }
    return null;
  }
  function closedBracketAt(state, pos) {
    let found = false;
    state.field(bracketState).between(0, state.doc.length, (from) => {
      if (from == pos)
        found = true;
    });
    return found;
  }
  function nextChar(doc2, pos) {
    let next = doc2.sliceString(pos, pos + 2);
    return next.slice(0, codePointSize(codePointAt(next, 0)));
  }
  function prevChar(doc2, pos) {
    let prev = doc2.sliceString(pos - 2, pos);
    return codePointSize(codePointAt(prev, 0)) == prev.length ? prev : prev.slice(1);
  }
  function handleOpen(state, open2, close, closeBefore) {
    let dont = null, changes = state.changeByRange((range) => {
      if (!range.empty)
        return {
          changes: [{ insert: open2, from: range.from }, { insert: close, from: range.to }],
          effects: closeBracketEffect.of(range.to + open2.length),
          range: EditorSelection.range(range.anchor + open2.length, range.head + open2.length)
        };
      let next = nextChar(state.doc, range.head);
      if (!next || /\s/.test(next) || closeBefore.indexOf(next) > -1)
        return {
          changes: { insert: open2 + close, from: range.head },
          effects: closeBracketEffect.of(range.head + open2.length),
          range: EditorSelection.cursor(range.head + open2.length)
        };
      return { range: dont = range };
    });
    return dont ? null : state.update(changes, {
      scrollIntoView: true,
      userEvent: "input.type"
    });
  }
  function handleClose(state, _open, close) {
    let dont = null, changes = state.changeByRange((range) => {
      if (range.empty && nextChar(state.doc, range.head) == close)
        return {
          changes: { from: range.head, to: range.head + close.length, insert: close },
          range: EditorSelection.cursor(range.head + close.length)
        };
      return dont = { range };
    });
    return dont ? null : state.update(changes, {
      scrollIntoView: true,
      userEvent: "input.type"
    });
  }
  function handleSame(state, token, allowTriple, config2) {
    let stringPrefixes = config2.stringPrefixes || defaults$1.stringPrefixes;
    let dont = null, changes = state.changeByRange((range) => {
      if (!range.empty)
        return {
          changes: [{ insert: token, from: range.from }, { insert: token, from: range.to }],
          effects: closeBracketEffect.of(range.to + token.length),
          range: EditorSelection.range(range.anchor + token.length, range.head + token.length)
        };
      let pos = range.head, next = nextChar(state.doc, pos), start;
      if (next == token) {
        if (nodeStart(state, pos)) {
          return {
            changes: { insert: token + token, from: pos },
            effects: closeBracketEffect.of(pos + token.length),
            range: EditorSelection.cursor(pos + token.length)
          };
        } else if (closedBracketAt(state, pos)) {
          let isTriple = allowTriple && state.sliceDoc(pos, pos + token.length * 3) == token + token + token;
          let content2 = isTriple ? token + token + token : token;
          return {
            changes: { from: pos, to: pos + content2.length, insert: content2 },
            range: EditorSelection.cursor(pos + content2.length)
          };
        }
      } else if (allowTriple && state.sliceDoc(pos - 2 * token.length, pos) == token + token && (start = canStartStringAt(state, pos - 2 * token.length, stringPrefixes)) > -1 && nodeStart(state, start)) {
        return {
          changes: { insert: token + token + token + token, from: pos },
          effects: closeBracketEffect.of(pos + token.length),
          range: EditorSelection.cursor(pos + token.length)
        };
      } else if (state.charCategorizer(pos)(next) != CharCategory.Word) {
        if (canStartStringAt(state, pos, stringPrefixes) > -1 && !probablyInString(state, pos, token, stringPrefixes))
          return {
            changes: { insert: token + token, from: pos },
            effects: closeBracketEffect.of(pos + token.length),
            range: EditorSelection.cursor(pos + token.length)
          };
      }
      return { range: dont = range };
    });
    return dont ? null : state.update(changes, {
      scrollIntoView: true,
      userEvent: "input.type"
    });
  }
  function nodeStart(state, pos) {
    let tree = syntaxTree(state).resolveInner(pos + 1);
    return tree.parent && tree.from == pos;
  }
  function probablyInString(state, pos, quoteToken, prefixes) {
    let node = syntaxTree(state).resolveInner(pos, -1);
    let maxPrefix = prefixes.reduce((m, p) => Math.max(m, p.length), 0);
    for (let i2 = 0; i2 < 5; i2++) {
      let start = state.sliceDoc(node.from, Math.min(node.to, node.from + quoteToken.length + maxPrefix));
      let quotePos = start.indexOf(quoteToken);
      if (!quotePos || quotePos > -1 && prefixes.indexOf(start.slice(0, quotePos)) > -1) {
        let first = node.firstChild;
        while (first && first.from == node.from && first.to - first.from > quoteToken.length + quotePos) {
          if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)
            return false;
          first = first.firstChild;
        }
        return true;
      }
      let parent = node.to == pos && node.parent;
      if (!parent)
        break;
      node = parent;
    }
    return false;
  }
  function canStartStringAt(state, pos, prefixes) {
    let charCat = state.charCategorizer(pos);
    if (charCat(state.sliceDoc(pos - 1, pos)) != CharCategory.Word)
      return pos;
    for (let prefix of prefixes) {
      let start = pos - prefix.length;
      if (state.sliceDoc(start, pos) == prefix && charCat(state.sliceDoc(start - 1, start)) != CharCategory.Word)
        return start;
    }
    return -1;
  }
  function autocompletion(config2 = {}) {
    return [
      completionState,
      completionConfig.of(config2),
      completionPlugin,
      completionKeymapExt,
      baseTheme$2
    ];
  }
  const completionKeymap = [
    { key: "Ctrl-Space", run: startCompletion },
    { key: "Escape", run: closeCompletion },
    { key: "ArrowDown", run: /* @__PURE__ */ moveCompletionSelection(true) },
    { key: "ArrowUp", run: /* @__PURE__ */ moveCompletionSelection(false) },
    { key: "PageDown", run: /* @__PURE__ */ moveCompletionSelection(true, "page") },
    { key: "PageUp", run: /* @__PURE__ */ moveCompletionSelection(false, "page") },
    { key: "Enter", run: acceptCompletion }
  ];
  const completionKeymapExt = /* @__PURE__ */ Prec.highest(/* @__PURE__ */ keymap.computeN([completionConfig], (state) => state.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));
  class SelectedDiagnostic {
    constructor(from, to, diagnostic) {
      this.from = from;
      this.to = to;
      this.diagnostic = diagnostic;
    }
  }
  class LintState {
    constructor(diagnostics, panel, selected) {
      this.diagnostics = diagnostics;
      this.panel = panel;
      this.selected = selected;
    }
    static init(diagnostics, panel, state) {
      let markedDiagnostics = diagnostics;
      let diagnosticFilter = state.facet(lintConfig).markerFilter;
      if (diagnosticFilter)
        markedDiagnostics = diagnosticFilter(markedDiagnostics);
      let ranges = Decoration.set(markedDiagnostics.map((d) => {
        return d.from == d.to || d.from == d.to - 1 && state.doc.lineAt(d.from).to == d.from ? Decoration.widget({
          widget: new DiagnosticWidget(d),
          diagnostic: d
        }).range(d.from) : Decoration.mark({
          attributes: { class: "cm-lintRange cm-lintRange-" + d.severity + (d.markClass ? " " + d.markClass : "") },
          diagnostic: d
        }).range(d.from, d.to);
      }), true);
      return new LintState(ranges, panel, findDiagnostic(ranges));
    }
  }
  function findDiagnostic(diagnostics, diagnostic = null, after = 0) {
    let found = null;
    diagnostics.between(after, 1e9, (from, to, { spec }) => {
      if (diagnostic && spec.diagnostic != diagnostic)
        return;
      found = new SelectedDiagnostic(from, to, spec.diagnostic);
      return false;
    });
    return found;
  }
  function hideTooltip(tr, tooltip) {
    let line = tr.startState.doc.lineAt(tooltip.pos);
    return !!(tr.effects.some((e) => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, line.to));
  }
  function maybeEnableLint(state, effects) {
    return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of(lintExtensions));
  }
  const setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define();
  const togglePanel = /* @__PURE__ */ StateEffect.define();
  const movePanelSelection = /* @__PURE__ */ StateEffect.define();
  const lintState = /* @__PURE__ */ StateField.define({
    create() {
      return new LintState(Decoration.none, null, null);
    },
    update(value2, tr) {
      if (tr.docChanged) {
        let mapped = value2.diagnostics.map(tr.changes), selected = null;
        if (value2.selected) {
          let selPos = tr.changes.mapPos(value2.selected.from, 1);
          selected = findDiagnostic(mapped, value2.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);
        }
        value2 = new LintState(mapped, value2.panel, selected);
      }
      for (let effect of tr.effects) {
        if (effect.is(setDiagnosticsEffect)) {
          value2 = LintState.init(effect.value, value2.panel, tr.state);
        } else if (effect.is(togglePanel)) {
          value2 = new LintState(value2.diagnostics, effect.value ? LintPanel.open : null, value2.selected);
        } else if (effect.is(movePanelSelection)) {
          value2 = new LintState(value2.diagnostics, value2.panel, effect.value);
        }
      }
      return value2;
    },
    provide: (f) => [
      showPanel.from(f, (val) => val.panel),
      EditorView.decorations.from(f, (s) => s.diagnostics)
    ]
  });
  const activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
  function lintTooltip(view, pos, side) {
    let { diagnostics } = view.state.field(lintState);
    let found = [], stackStart = 2e8, stackEnd = 0;
    diagnostics.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from, to, { spec }) => {
      if (pos >= from && pos <= to && (from == to || (pos > from || side > 0) && (pos < to || side < 0))) {
        found.push(spec.diagnostic);
        stackStart = Math.min(from, stackStart);
        stackEnd = Math.max(to, stackEnd);
      }
    });
    let diagnosticFilter = view.state.facet(lintConfig).tooltipFilter;
    if (diagnosticFilter)
      found = diagnosticFilter(found);
    if (!found.length)
      return null;
    return {
      pos: stackStart,
      end: stackEnd,
      above: view.state.doc.lineAt(stackStart).to < stackEnd,
      create() {
        return { dom: diagnosticsTooltip(view, found) };
      }
    };
  }
  function diagnosticsTooltip(view, diagnostics) {
    return crelt("ul", { class: "cm-tooltip-lint" }, diagnostics.map((d) => renderDiagnostic(view, d, false)));
  }
  const openLintPanel = (view) => {
    let field = view.state.field(lintState, false);
    if (!field || !field.panel)
      view.dispatch({ effects: maybeEnableLint(view.state, [togglePanel.of(true)]) });
    let panel = getPanel(view, LintPanel.open);
    if (panel)
      panel.dom.querySelector(".cm-panel-lint ul").focus();
    return true;
  };
  const closeLintPanel = (view) => {
    let field = view.state.field(lintState, false);
    if (!field || !field.panel)
      return false;
    view.dispatch({ effects: togglePanel.of(false) });
    return true;
  };
  const nextDiagnostic = (view) => {
    let field = view.state.field(lintState, false);
    if (!field)
      return false;
    let sel = view.state.selection.main, next = field.diagnostics.iter(sel.to + 1);
    if (!next.value) {
      next = field.diagnostics.iter(0);
      if (!next.value || next.from == sel.from && next.to == sel.to)
        return false;
    }
    view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });
    return true;
  };
  const lintKeymap = [
    { key: "Mod-Shift-m", run: openLintPanel, preventDefault: true },
    { key: "F8", run: nextDiagnostic }
  ];
  const lintConfig = /* @__PURE__ */ Facet.define({
    combine(input) {
      return Object.assign({ sources: input.map((i2) => i2.source) }, combineConfig(input.map((i2) => i2.config), {
        delay: 750,
        markerFilter: null,
        tooltipFilter: null,
        needsRefresh: null
      }, {
        needsRefresh: (a, b) => !a ? b : !b ? a : (u) => a(u) || b(u)
      }));
    }
  });
  function assignKeys(actions) {
    let assigned = [];
    if (actions)
      actions:
        for (let { name: name2 } of actions) {
          for (let i2 = 0; i2 < name2.length; i2++) {
            let ch = name2[i2];
            if (/[a-zA-Z]/.test(ch) && !assigned.some((c) => c.toLowerCase() == ch.toLowerCase())) {
              assigned.push(ch);
              continue actions;
            }
          }
          assigned.push("");
        }
    return assigned;
  }
  function renderDiagnostic(view, diagnostic, inPanel) {
    var _a2;
    let keys2 = inPanel ? assignKeys(diagnostic.actions) : [];
    return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + diagnostic.severity }, crelt("span", { class: "cm-diagnosticText" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a2 = diagnostic.actions) === null || _a2 === void 0 ? void 0 : _a2.map((action, i2) => {
      let fired = false, click = (e) => {
        e.preventDefault();
        if (fired)
          return;
        fired = true;
        let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic);
        if (found)
          action.apply(view, found.from, found.to);
      };
      let { name: name2 } = action, keyIndex = keys2[i2] ? name2.indexOf(keys2[i2]) : -1;
      let nameElt = keyIndex < 0 ? name2 : [
        name2.slice(0, keyIndex),
        crelt("u", name2.slice(keyIndex, keyIndex + 1)),
        name2.slice(keyIndex + 1)
      ];
      return crelt("button", {
        type: "button",
        class: "cm-diagnosticAction",
        onclick: click,
        onmousedown: click,
        "aria-label": ` Action: ${name2}${keyIndex < 0 ? "" : ` (access key "${keys2[i2]})"`}.`
      }, nameElt);
    }), diagnostic.source && crelt("div", { class: "cm-diagnosticSource" }, diagnostic.source));
  }
  class DiagnosticWidget extends WidgetType {
    constructor(diagnostic) {
      super();
      this.diagnostic = diagnostic;
    }
    eq(other) {
      return other.diagnostic == this.diagnostic;
    }
    toDOM() {
      return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.diagnostic.severity });
    }
  }
  class PanelItem {
    constructor(view, diagnostic) {
      this.diagnostic = diagnostic;
      this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16);
      this.dom = renderDiagnostic(view, diagnostic, true);
      this.dom.id = this.id;
      this.dom.setAttribute("role", "option");
    }
  }
  class LintPanel {
    constructor(view) {
      this.view = view;
      this.items = [];
      let onkeydown = (event) => {
        if (event.keyCode == 27) {
          closeLintPanel(this.view);
          this.view.focus();
        } else if (event.keyCode == 38 || event.keyCode == 33) {
          this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
        } else if (event.keyCode == 40 || event.keyCode == 34) {
          this.moveSelection((this.selectedIndex + 1) % this.items.length);
        } else if (event.keyCode == 36) {
          this.moveSelection(0);
        } else if (event.keyCode == 35) {
          this.moveSelection(this.items.length - 1);
        } else if (event.keyCode == 13) {
          this.view.focus();
        } else if (event.keyCode >= 65 && event.keyCode <= 90 && this.selectedIndex >= 0) {
          let { diagnostic } = this.items[this.selectedIndex], keys2 = assignKeys(diagnostic.actions);
          for (let i2 = 0; i2 < keys2.length; i2++)
            if (keys2[i2].toUpperCase().charCodeAt(0) == event.keyCode) {
              let found = findDiagnostic(this.view.state.field(lintState).diagnostics, diagnostic);
              if (found)
                diagnostic.actions[i2].apply(view, found.from, found.to);
            }
        } else {
          return;
        }
        event.preventDefault();
      };
      let onclick = (event) => {
        for (let i2 = 0; i2 < this.items.length; i2++) {
          if (this.items[i2].dom.contains(event.target))
            this.moveSelection(i2);
        }
      };
      this.list = crelt("ul", {
        tabIndex: 0,
        role: "listbox",
        "aria-label": this.view.state.phrase("Diagnostics"),
        onkeydown,
        onclick
      });
      this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
        type: "button",
        name: "close",
        "aria-label": this.view.state.phrase("close"),
        onclick: () => closeLintPanel(this.view)
      }, "\xD7"));
      this.update();
    }
    get selectedIndex() {
      let selected = this.view.state.field(lintState).selected;
      if (!selected)
        return -1;
      for (let i2 = 0; i2 < this.items.length; i2++)
        if (this.items[i2].diagnostic == selected.diagnostic)
          return i2;
      return -1;
    }
    update() {
      let { diagnostics, selected } = this.view.state.field(lintState);
      let i2 = 0, needsSync = false, newSelectedItem = null;
      diagnostics.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {
        let found = -1, item;
        for (let j = i2; j < this.items.length; j++)
          if (this.items[j].diagnostic == spec.diagnostic) {
            found = j;
            break;
          }
        if (found < 0) {
          item = new PanelItem(this.view, spec.diagnostic);
          this.items.splice(i2, 0, item);
          needsSync = true;
        } else {
          item = this.items[found];
          if (found > i2) {
            this.items.splice(i2, found - i2);
            needsSync = true;
          }
        }
        if (selected && item.diagnostic == selected.diagnostic) {
          if (!item.dom.hasAttribute("aria-selected")) {
            item.dom.setAttribute("aria-selected", "true");
            newSelectedItem = item;
          }
        } else if (item.dom.hasAttribute("aria-selected")) {
          item.dom.removeAttribute("aria-selected");
        }
        i2++;
      });
      while (i2 < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0)) {
        needsSync = true;
        this.items.pop();
      }
      if (this.items.length == 0) {
        this.items.push(new PanelItem(this.view, {
          from: -1,
          to: -1,
          severity: "info",
          message: this.view.state.phrase("No diagnostics")
        }));
        needsSync = true;
      }
      if (newSelectedItem) {
        this.list.setAttribute("aria-activedescendant", newSelectedItem.id);
        this.view.requestMeasure({
          key: this,
          read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),
          write: ({ sel, panel }) => {
            let scaleY = panel.height / this.list.offsetHeight;
            if (sel.top < panel.top)
              this.list.scrollTop -= (panel.top - sel.top) / scaleY;
            else if (sel.bottom > panel.bottom)
              this.list.scrollTop += (sel.bottom - panel.bottom) / scaleY;
          }
        });
      } else if (this.selectedIndex < 0) {
        this.list.removeAttribute("aria-activedescendant");
      }
      if (needsSync)
        this.sync();
    }
    sync() {
      let domPos = this.list.firstChild;
      function rm2() {
        let prev = domPos;
        domPos = prev.nextSibling;
        prev.remove();
      }
      for (let item of this.items) {
        if (item.dom.parentNode == this.list) {
          while (domPos != item.dom)
            rm2();
          domPos = item.dom.nextSibling;
        } else {
          this.list.insertBefore(item.dom, domPos);
        }
      }
      while (domPos)
        rm2();
    }
    moveSelection(selectedIndex) {
      if (this.selectedIndex < 0)
        return;
      let field = this.view.state.field(lintState);
      let selection = findDiagnostic(field.diagnostics, this.items[selectedIndex].diagnostic);
      if (!selection)
        return;
      this.view.dispatch({
        selection: { anchor: selection.from, head: selection.to },
        scrollIntoView: true,
        effects: movePanelSelection.of(selection)
      });
    }
    static open(view) {
      return new LintPanel(view);
    }
  }
  function svg(content2, attrs = `viewBox="0 0 40 40"`) {
    return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${attrs}>${encodeURIComponent(content2)}</svg>')`;
  }
  function underline(color) {
    return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${color}" fill="none" stroke-width=".7"/>`, `width="6" height="3"`);
  }
  const baseTheme$1 = /* @__PURE__ */ EditorView.baseTheme({
    ".cm-diagnostic": {
      padding: "3px 6px 3px 8px",
      marginLeft: "-1px",
      display: "block",
      whiteSpace: "pre-wrap"
    },
    ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
    ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
    ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
    ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
    ".cm-diagnosticAction": {
      font: "inherit",
      border: "none",
      padding: "2px 4px",
      backgroundColor: "#444",
      color: "white",
      borderRadius: "3px",
      marginLeft: "8px",
      cursor: "pointer"
    },
    ".cm-diagnosticSource": {
      fontSize: "70%",
      opacity: 0.7
    },
    ".cm-lintRange": {
      backgroundPosition: "left bottom",
      backgroundRepeat: "repeat-x",
      paddingBottom: "0.7px"
    },
    ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ underline("#d11") },
    ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ underline("orange") },
    ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ underline("#999") },
    ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ underline("#66d") },
    ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
    ".cm-tooltip-lint": {
      padding: 0,
      margin: 0
    },
    ".cm-lintPoint": {
      position: "relative",
      "&:after": {
        content: '""',
        position: "absolute",
        bottom: 0,
        left: "-2px",
        borderLeft: "3px solid transparent",
        borderRight: "3px solid transparent",
        borderBottom: "4px solid #d11"
      }
    },
    ".cm-lintPoint-warning": {
      "&:after": { borderBottomColor: "orange" }
    },
    ".cm-lintPoint-info": {
      "&:after": { borderBottomColor: "#999" }
    },
    ".cm-lintPoint-hint": {
      "&:after": { borderBottomColor: "#66d" }
    },
    ".cm-panel.cm-panel-lint": {
      position: "relative",
      "& ul": {
        maxHeight: "100px",
        overflowY: "auto",
        "& [aria-selected]": {
          backgroundColor: "#ddd",
          "& u": { textDecoration: "underline" }
        },
        "&:focus [aria-selected]": {
          background_fallback: "#bdf",
          backgroundColor: "Highlight",
          color_fallback: "white",
          color: "HighlightText"
        },
        "& u": { textDecoration: "none" },
        padding: 0,
        margin: 0
      },
      "& [name=close]": {
        position: "absolute",
        top: "0",
        right: "2px",
        background: "inherit",
        border: "none",
        font: "inherit",
        padding: 0,
        margin: 0
      }
    }
  });
  const lintExtensions = [
    lintState,
    /* @__PURE__ */ EditorView.decorations.compute([lintState], (state) => {
      let { selected, panel } = state.field(lintState);
      return !selected || !panel || selected.from == selected.to ? Decoration.none : Decoration.set([
        activeMark.range(selected.from, selected.to)
      ]);
    }),
    /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
    baseTheme$1
  ];
  const basicSetup = /* @__PURE__ */ (() => [
    lineNumbers(),
    highlightActiveLineGutter(),
    highlightSpecialChars(),
    history(),
    foldGutter(),
    drawSelection(),
    dropCursor(),
    EditorState.allowMultipleSelections.of(true),
    indentOnInput(),
    syntaxHighlighting(defaultHighlightStyle, { fallback: true }),
    bracketMatching(),
    closeBrackets(),
    autocompletion(),
    rectangularSelection(),
    crosshairCursor(),
    highlightActiveLine(),
    highlightSelectionMatches(),
    keymap.of([
      ...closeBracketsKeymap,
      ...defaultKeymap,
      ...searchKeymap,
      ...historyKeymap,
      ...foldKeymap,
      ...completionKeymap,
      ...lintKeymap
    ])
  ])();
  class PlaceholderWidget extends WidgetType {
    constructor(text) {
      super();
      __publicField(this, "field");
      __publicField(this, "text");
      __publicField(this, "type");
      if (text) {
        const [field, mText, type] = text.split(".");
        this.text = mText;
        this.type = type;
        this.field = field;
      }
    }
    eq(other) {
      return this.text === other.text;
    }
    toDOM() {
      let elt = document.createElement("span");
      if (!this.text)
        return elt;
      elt.className = this.type === "func" ? "cm-function" : "cm-field";
      elt.textContent = this.text;
      return elt;
    }
    ignoreEvent() {
      return true;
    }
  }
  const FORMULA_REG_EXP = /\{\{(\w+\.[^.]+\.\w+)}}/g;
  const placeholderMatcher = new MatchDecorator({
    regexp: /\{\{(.+?)}}/g,
    decoration: (match) => Decoration.replace({
      widget: new PlaceholderWidget(match[1])
    })
  });
  const placeholders = ViewPlugin.fromClass(class {
    constructor(view) {
      __publicField(this, "placeholders");
      this.placeholders = placeholderMatcher.createDeco(view);
    }
    update(update) {
      this.placeholders = placeholderMatcher.updateDeco(update, this.placeholders);
    }
  }, {
    decorations: (instance2) => instance2.placeholders,
    provide: (plugin) => EditorView.atomicRanges.of((view) => {
      var _a2;
      return ((_a2 = view.plugin(plugin)) == null ? void 0 : _a2.placeholders) || Decoration.none;
    })
  });
  const baseTheme = EditorView.baseTheme({
    ".cm-function": {
      paddingLeft: "6px",
      paddingRight: "6px",
      paddingTop: "3px",
      paddingBottom: "3px",
      marginLeft: "3px",
      marginRight: "3px",
      backgroundColor: "#ffcdcc",
      borderRadius: "4px"
    },
    ".cm-field": {
      paddingLeft: "6px",
      paddingRight: "6px",
      paddingTop: "3px",
      paddingBottom: "3px",
      marginLeft: "3px",
      marginRight: "3px",
      backgroundColor: "#f8e7a0",
      borderRadius: "4px"
    }
  });
  function calculateFormula(VFR, DSV, formulaJs, formulaFieldRef, changedFieldRef) {
    if (!!formulaFieldRef.subFormItemFlag && !!changedFieldRef.subFormItemFlag) {
      if (changedFieldRef.subFormRowId !== formulaFieldRef.subFormRowId) {
        return;
      }
    }
    let formula = formulaFieldRef.field.options.formula;
    formula = replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, changedFieldRef);
    const matchResult = formula.match(/[A-Za-z]*/g);
    if (!!matchResult) {
      matchResult.forEach((mi) => {
        if (!!mi && findCalFunStartIndex(mi) !== -1) {
          const funcName = mi.toUpperCase();
          formula = formula.replace(mi, "formulaJs." + funcName);
        }
      });
    }
    const formulaValue = evalFn(formula, DSV, VFR, formulaJs);
    formulaFieldRef.setValue(formulaValue);
  }
  function fieldIsUsedInFormula(fieldName, formula, VFR) {
    const matchResult = formula.match(FORMULA_REG_EXP);
    if (!matchResult) {
      return false;
    }
    let foundResult = false;
    matchResult.forEach((mi) => {
      const thirdPart = mi.split(".")[2];
      const nodeType = thirdPart.substring(0, thirdPart.length - 2);
      if (nodeType === "func") {
        return;
      }
      const firstPart = mi.split(".")[0];
      const fieldId = firstPart.substring(2, firstPart.length);
      const fieldSchema = getFieldWidgetById(VFR.formJsonObj.widgetList, fieldId, false);
      if (fieldSchema.options.name === fieldName) {
        foundResult = true;
      }
    });
    return foundResult;
  }
  function replaceFieldsAndFunctionsOfFormula(VFR, formulaFieldRef, changedFieldRef) {
    let formula = formulaFieldRef.field.options.formula;
    const matchResult = formula.match(FORMULA_REG_EXP);
    if (!matchResult) {
      return formula;
    }
    let resultFormula = formula;
    matchResult.forEach((mi) => {
      const thirdPart = mi.split(".")[2];
      const nodeType = thirdPart.substring(0, thirdPart.length - 2);
      if (nodeType === "func") {
        const funcName = mi.split(".")[1];
        resultFormula = resultFormula.replace(mi, funcName);
        return;
      }
      const firstPart = mi.split(".")[0];
      const fieldId = firstPart.substring(2, firstPart.length);
      const fieldSchema = getFieldWidgetById(VFR.formJsonObj.widgetList, fieldId, false);
      if (!!fieldSchema) {
        let fieldRef = VFR.getWidgetRef(fieldSchema.options.name);
        if (!!fieldRef) {
          resultFormula = resultFormula.replace(mi, fieldRef.getValue());
        } else {
          if (!!changedFieldRef.subFormItemFlag) {
            if (!formulaFieldRef.subFormItemFlag) {
              const subFormValue = VFR.formDataModel[changedFieldRef.subFormName];
              let allSubFieldValues = "";
              const subFieldName = fieldSchema.options.name;
              subFormValue.forEach((vi, idx) => {
                allSubFieldValues = idx === 0 ? vi[subFieldName] : allSubFieldValues + ", " + vi[subFieldName];
              });
              resultFormula = resultFormula.replaceAll(mi, allSubFieldValues);
            } else {
              let subFormRowId = changedFieldRef.subFormRowId;
              fieldRef = VFR.getWidgetRef(fieldSchema.options.name + "@row" + subFormRowId);
              if (!!fieldRef) {
                resultFormula = resultFormula.replaceAll(mi, fieldRef.getValue());
              }
            }
          }
        }
      }
    });
    return resultFormula;
  }
  function findCalFunStartIndex(formula) {
    let startIndex = -1;
    for (let i2 = 0; i2 < FORMULA_JS_FUNCTIONS.length; i2++) {
      let index2 = formula.indexOf(FORMULA_JS_FUNCTIONS[i2]);
      if (index2 !== -1) {
        return index2;
      }
    }
    return startIndex;
  }
  const FORMULA_JS_FUNCTIONS = [
    "INT",
    "SUM",
    "AVERAGE",
    "MAX",
    "MIN",
    "ABS",
    "ROUND",
    "CEILING",
    "LOG",
    "MOD",
    "POWER",
    "AND",
    "IF",
    "IFS",
    "IFERROR",
    "IFNA",
    "NOT",
    "OR",
    "SWITCH",
    "XOR",
    "YEAR",
    "MONTH",
    "DAY",
    "TODAY",
    "NOW",
    "EMONTH",
    "EDAY",
    "FIND",
    "LEFT",
    "RIGHT",
    "LEN",
    "LOWER",
    "UPPER",
    "MID",
    "TRIM"
  ];
  const formulas = [
    {
      fClass: "designer.hint.formulaFunctionMaths",
      flist: [
        {
          fName: "INT",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaINT"
        },
        {
          fName: "SUM",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaSUM"
        },
        {
          fName: "AVERAGE",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaAVERAGE"
        },
        {
          fName: "MAX",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaMAX"
        },
        {
          fName: "MIN",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaMIN"
        },
        {
          fName: "ABS",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaABS"
        },
        {
          fName: "ROUND",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaROUND"
        },
        {
          fName: "CEILING",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaCEILING"
        },
        {
          fName: "LOG",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaLOG"
        },
        {
          fName: "MOD",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaMOD"
        },
        {
          fName: "POWER",
          fType: "designer.hint.formulaNumber",
          fIntro: "designer.hint.formulaPOWER"
        }
      ]
    }
  ];
  var fieldMixin = {
    inject: [
      "refList",
      "getFormConfig",
      "globalOptionData",
      "globalModel",
      "getOptionData",
      "getGlobalDsv",
      "getReadMode",
      "getSubFormFieldFlag",
      "getSubFormName",
      "getDSResultCache",
      "getObjectFieldFlag",
      "getObjectName"
    ],
    data() {
      return {
        fieldReadonlyFlag: false,
        dataSetLoadedFlag: false
      };
    },
    computed: {
      formConfig() {
        return this.getFormConfig();
      },
      subFormName() {
        return !!this.getSubFormName ? this.getSubFormName() : "";
      },
      subFormItemFlag() {
        return !!this.getSubFormFieldFlag ? this.getSubFormFieldFlag() : false;
      },
      formModel: {
        cache: false,
        get() {
          return this.globalModel.formModel;
        }
      },
      isReadMode() {
        return !!this.getReadMode() ? true : this.fieldReadonlyFlag;
      },
      optionLabel() {
        if (this.fieldModel === null) {
          return "--";
        } else {
          let resultContent = "--";
          this.field.options.optionItems.forEach((oItem) => {
            if (oItem.value === this.fieldModel || this.findInArray(this.fieldModel, oItem.value) !== -1) {
              resultContent = resultContent === "--" ? oItem.label : resultContent + " " + oItem.label;
            } else if (oItem.value === this.fieldModel.value || this.findInArray(this.fieldModel.value, oItem.value) !== -1) {
              resultContent = resultContent === "--" ? oItem.label : resultContent + " " + oItem.label;
            }
          });
          return resultContent;
        }
      },
      fieldKeyName() {
        let fieldKeyName = this.field.options.name;
        return this.field.options.keyNameEnabled ? this.field.options.keyName || fieldKeyName : fieldKeyName;
      },
      getSubFormRowIndex() {
        return this.subFormRowIndex;
      }
    },
    methods: {
      findInArray(arrayObject, element) {
        if (!Array.isArray(arrayObject)) {
          return -1;
        }
        let foundIdx = -1;
        arrayObject.forEach((aItem, aIdx) => {
          if (aItem === element) {
            foundIdx = aIdx;
          }
        });
        return foundIdx;
      },
      getPropName() {
        if (this.subFormItemFlag && !this.designState) {
          return this.subFormName + "." + this.subFormRowIndex + "." + this.fieldKeyName;
        } else if (this.getObjectFieldFlag() && !this.designState) {
          return this.getObjectName() + "." + this.fieldKeyName;
        } else {
          return this.fieldKeyName;
        }
      },
      getObjectModel() {
        let objectChains = this.getObjectName().split(".");
        let objectModel = this.formModel;
        objectChains.forEach((key) => {
          if (!key)
            return;
          if (objectModel[key] === void 0) {
            objectModel[key] = {};
          }
          objectModel = objectModel[key];
        });
        return objectModel;
      },
      initFieldModel() {
        if (!this.field.formItemFlag) {
          return;
        }
        if (!!this.getObjectFieldFlag() && !this.designState) {
          const objectModel = this.getObjectModel();
          this.fieldModel = objectModel === void 0 ? null : objectModel[this.fieldKeyName];
          this.oldFieldValue = deepClone(this.fieldModel);
          this.initFileList();
          return;
        }
        if (!!this.subFormItemFlag && !this.designState) {
          let subFormData = this.formModel[this.subFormName];
          if ((subFormData === void 0 || subFormData[this.subFormRowIndex] === void 0 || subFormData[this.subFormRowIndex][this.fieldKeyName] === void 0) && this.field.options.defaultValue !== void 0) {
            this.fieldModel = this.field.options.defaultValue;
            subFormData[this.subFormRowIndex][this.fieldKeyName] = this.field.options.defaultValue;
          } else if (subFormData[this.subFormRowIndex][this.fieldKeyName] === void 0) {
            this.fieldModel = null;
            subFormData[this.subFormRowIndex][this.fieldKeyName] = null;
          } else {
            this.fieldModel = subFormData[this.subFormRowIndex][this.fieldKeyName];
          }
          setTimeout(() => {
            this.handleOnChangeForSubForm(this.fieldModel, this.oldFieldValue, subFormData, this.subFormRowId);
          }, 800);
          this.oldFieldValue = deepClone(this.fieldModel);
          this.initFileList();
          return;
        }
        if (this.formModel[this.fieldKeyName] === void 0 && this.field.options.defaultValue !== void 0) {
          this.fieldModel = this.field.options.defaultValue;
        } else if (this.formModel[this.fieldKeyName] === void 0) {
          this.formModel[this.fieldKeyName] = null;
        } else {
          this.fieldModel = this.formModel[this.fieldKeyName];
        }
        this.oldFieldValue = deepClone(this.fieldModel);
        this.initFileList();
      },
      initFileList() {
        if (this.field.type !== "picture-upload" && this.field.type !== "file-upload" || this.designState === true) {
          return;
        }
        if (!!this.fieldModel) {
          if (Array.isArray(this.fieldModel)) {
            this.fileList = deepClone(this.fieldModel);
          } else {
            this.fileList.splice(0, 0, deepClone(this.fieldModel));
          }
        }
      },
      initEventHandler() {
        if (this.designState) {
          return;
        }
        this.on$("setFormData", (newFormData) => {
          if (!this.subFormItemFlag) {
            if (!!this.getObjectFieldFlag() && !this.designState) {
              const objectModel = this.getObjectModel();
              this.setValue(objectModel === void 0 ? null : objectModel[this.fieldKeyName]);
            } else {
              this.setValue(newFormData[this.fieldKeyName]);
            }
          }
        });
        this.on$("field-value-changed", (values) => {
          if (!!this.subFormItemFlag) {
            let subFormData = this.formModel[this.subFormName];
            this.handleOnChangeForSubForm(values[0], values[1], subFormData, this.subFormRowId);
          } else {
            this.handleOnChange(values[0], values[1]);
          }
        });
        this.on$("sync-field-value", (params) => {
          const pName = params[0], pKeyName = params[1];
          if (this.field.options.name === pName) {
            return;
          }
          if (!pKeyName && this.field.options.keyName !== pName) {
            return;
          }
          if (!this.field.options.keyName && this.field.options.name !== pKeyName) {
            return;
          }
          if (!!this.field.options.keyName && !!pKeyName && this.field.options.keyName !== pKeyName) {
            return;
          }
          const objectName = params[5];
          if (objectName !== this.getObjectName()) {
            return;
          }
          const pSubFormName = params[2], pSubFormRowId = params[3], newValue = params[4];
          if (!this.subFormName && !pSubFormName) {
            this.setValue(newValue, true);
          } else if (this.subFormName === pSubFormName && this.subFormRowId === pSubFormRowId) {
            this.setValue(newValue, true);
          }
        });
        this.on$("calculate-formula", (params) => {
          if (!!this.field.options.formulaEnabled && !!this.field.options.formula) {
            let changedFieldRef = params[1];
            const changedFieldName = params[1].field.options.name;
            if (fieldIsUsedInFormula(changedFieldName, this.field.options.formula, this.getFormRef())) {
              calculateFormula(this.getFormRef(), this.getGlobalDsv(), formulajs, this, changedFieldRef);
            }
          }
        });
        this.on$("loadOptionItemsFromDataSet", (dsName) => {
          this.loadOptionItemsFromDataSet(dsName);
          this.dataSetLoadedFlag = true;
        });
        this.on$("reloadOptionItems", (widgetNames) => {
          if (widgetNames.length === 0 || widgetNames.indexOf(this.field.options.name) > -1) {
            this.initOptionItems(true);
          }
        });
      },
      handleOnCreated() {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onCreated) {
          let customFunc = new Function(this.field.options.onCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onMounted) {
          let mountFunc = new Function(this.field.options.onMounted);
          mountFunc.call(this);
        }
      },
      registerToRefList(oldRefName) {
        if (this.refList !== null && !!this.field.options.name) {
          if (this.subFormItemFlag && !this.designState) {
            if (!!oldRefName) {
              delete this.refList[oldRefName + "@row" + this.subFormRowId];
            }
            this.refList[this.field.options.name + "@row" + this.subFormRowId] = this;
          } else {
            if (!!oldRefName) {
              delete this.refList[oldRefName];
            }
            this.refList[this.field.options.name] = this;
          }
        }
      },
      unregisterFromRefList() {
        if (this.refList !== null && !!this.field.options.name) {
          let oldRefName = this.field.options.name;
          if (this.subFormItemFlag && !this.designState) {
            delete this.refList[oldRefName + "@row" + this.subFormRowId];
          } else {
            delete this.refList[oldRefName];
          }
        }
      },
      async initOptionItems(keepSelected) {
        if (this.designState)
          ;
        if (this.field.type === "radio" || this.field.type === "checkbox" || this.field.type === "select" || this.field.type === "cascader") {
          if (this.field.options.eboDictCode && this.field.options.eboDictCode != "") {
            this.field.options.optionItems.splice(0, this.field.options.optionItems.length);
            let eboDictCode = this.field.options.eboDictCode;
            let EboDictData = localStorage.getItem("EboDictData");
            if (EboDictData) {
              var dictData = JSON.parse(EboDictData);
              var t_dict = [];
              for (var i2 = 0; i2 < dictData.length; i2++) {
                if (dictData[i2].dictType == eboDictCode) {
                  t_dict = dictData[i2].dataList;
                  break;
                }
              }
              if (this.field.options.eboDisabledKey && this.field.options.eboDisabledKey != "") {
                debugger;
                var keyss = this.field.options.eboDisabledKey.split(",");
                console.log("t_dict=", t_dict);
                t_dict.forEach((item) => {
                  for (var i3 = 0; i3 < keyss.length; i3++) {
                    if (keyss[i3] === item["dictValue"]) {
                      item["disabled"] = true;
                    }
                  }
                });
              }
              this.field.options.labelKey = "dictLabel";
              this.field.options.valueKey = "dictValue";
              this.loadOptions(t_dict);
            }
            return;
          }
          if (!!this.field.options.dsEnabled) {
            this.field.options.optionItems.splice(0, this.field.options.optionItems.length);
            let curDSName = this.field.options.dsName;
            let curDSetName = this.field.options.dataSetName;
            let curDS = getDSByName(this.formConfig, curDSName);
            if (!!curDS && !curDSetName) {
              let gDsv = this.getGlobalDsv() || {};
              let localDsv = new Object({});
              overwriteObj(localDsv, gDsv);
              localDsv["widgetName"] = this.field.options.name;
              localDsv["widgetKeyName"] = this.fieldKeyName;
              let dsResult = null;
              try {
                dsResult = await runDataSourceRequest(curDS, localDsv, this.getFormRef(), false, this.$message);
                this.loadOptions(dsResult);
              } catch (err) {
                this.$message.error(err.message);
              }
            } else if (!!curDS && !!curDSetName && !this.dataSetLoadedFlag) {
              this.loadOptionItemsFromDataSet(curDSName);
            }
            return;
          }
          const newOptionItems = this.getOptionData();
          if (!!newOptionItems && newOptionItems.hasOwnProperty(this.fieldKeyName)) {
            if (!!keepSelected) {
              this.reloadOptions(newOptionItems[this.fieldKeyName]);
            } else {
              this.loadOptions(newOptionItems[this.fieldKeyName]);
            }
            return;
          }
          if (this.field.type !== "cascader") {
            this.translateOptionItemsValue();
          }
        }
      },
      translateOptionItemsValue() {
        let valueType = this.field.options.optionValueType;
        this.field.options.optionItems.forEach((opt, idx) => {
          let optValue = opt.value + "";
          if (valueType === "String") {
            opt.value = optValue;
          } else if (valueType === "Number") {
            opt.value = Number(optValue);
          } else if (valueType === "Boolean") {
            if (optValue.toLowerCase() === "false" || optValue === "0") {
              opt.value = false;
            } else if (optValue.toLowerCase() === "true" || optValue === "1") {
              opt.value = true;
            } else {
              opt.value = null;
            }
          }
        });
      },
      loadOptionItemsFromDataSet(dsName) {
        if (this.designState) {
          return;
        }
        if (this.field.type !== "radio" && this.field.type !== "checkbox" && this.field.type !== "select" && this.field.type !== "cascader") {
          return;
        }
        if (this.field.options.eboDictCode && this.field.options.eboDictCode != "") {
          this.field.options.optionItems.splice(0, this.field.options.optionItems.length);
          let eboDictCode = this.field.options.eboDictCode;
          let EboDictData = localStorage.getItem("EboDictData");
          if (EboDictData) {
            var dictData = JSON.parse(EboDictData);
            var t_dict = [];
            for (var i2 = 0; i2 < dictData.length; i2++) {
              if (dictData[i2].dictType == eboDictCode) {
                t_dict = dictData[i2].dataList;
                break;
              }
            }
            this.field.options.labelKey = "dictLabel";
            this.field.options.valueKey = "dictValue";
            if (this.field.options.eboDisabledKey && this.field.options.eboDisabledKey != "") {
              debugger;
              var keyss = this.field.options.eboDisabledKey.split(",");
              console.log("t_dict=", t_dict);
              t_dict.forEach((item) => {
                for (var i3 = 0; i3 < keyss.length; i3++) {
                  if (keyss[i3] === item["dictValue"]) {
                    item["disabled"] = true;
                  }
                }
              });
            }
            this.loadOptions(t_dict);
          }
          return;
        }
        if (!this.field.options.dsEnabled || !this.field.options.dsName || !this.field.options.dataSetName || this.field.options.dsName !== dsName) {
          return;
        }
        const dataCache = this.getDSResultCache();
        const dSetName = this.field.options.dataSetName;
        if (!!dataCache && !!dataCache[dsName] && !!dataCache[dsName][dSetName]) {
          this.field.options.optionItems.splice(0, this.field.options.optionItems.length);
          this.loadOptions(dataCache[dsName][dSetName]);
        }
      },
      refreshDefaultValue() {
        if (this.designState === true && this.field.options.defaultValue !== void 0) {
          this.fieldModel = this.field.options.defaultValue;
        }
      },
      clearFieldRules() {
        if (!this.field.formItemFlag) {
          return;
        }
        this.rules.splice(0, this.rules.length);
      },
      buildFieldRules() {
        if (!this.field.formItemFlag || this.field.options.hidden) {
          return;
        }
        this.rules.splice(0, this.rules.length);
        if (!!this.field.options.required) {
          this.rules.push({
            required: true,
            trigger: ["blur"],
            message: this.field.options.requiredHint || this.i18nt("render.hint.fieldRequired")
          });
        }
        if (!!this.field.options.validation) {
          let vldName2 = this.field.options.validation;
          if (!!FormValidators[vldName2]) {
            this.rules.push({
              validator: FormValidators[vldName2],
              trigger: ["blur", "change"],
              label: this.field.options.label,
              errorMsg: this.field.options.validationHint
            });
          } else {
            this.rules.push({
              validator: FormValidators["regExp"],
              trigger: ["blur", "change"],
              regExp: vldName2,
              label: this.field.options.label,
              errorMsg: this.field.options.validationHint
            });
          }
        }
        if (!!this.field.options.onValidate) {
          let customFn = (rule, value2, callback) => {
            let tmpFunc = new Function("rule", "value", "callback", this.field.options.onValidate);
            return tmpFunc.call(this, rule, value2, callback);
          };
          this.rules.push({
            validator: customFn,
            trigger: ["blur", "change"],
            label: this.field.options.label
          });
        }
      },
      disableChangeValidate() {
        if (!this.rules) {
          return;
        }
        this.rules.forEach((rule) => {
          if (!!rule.trigger) {
            rule.trigger.splice(0, rule.trigger.length);
          }
        });
      },
      enableChangeValidate() {
        if (!this.rules) {
          return;
        }
        this.rules.forEach((rule) => {
          if (!!rule.trigger) {
            rule.trigger.push("blur");
            rule.trigger.push("change");
          }
        });
      },
      disableOptionOfList(optionList, optionValue) {
        if (!!optionList && optionList.length > 0) {
          optionList.forEach((opt) => {
            if (opt.value === optionValue) {
              opt.disabled = true;
            }
            if (opt.children && Array.isArray(opt.children)) {
              this.disableOptionOfList(opt.children, optionValue);
            }
          });
        }
      },
      enableOptionOfList(optionList, optionValue) {
        if (!!optionList && optionList.length > 0) {
          optionList.forEach((opt) => {
            if (opt.value === optionValue) {
              opt.disabled = false;
            }
            if (opt.children && Array.isArray(opt.children)) {
              this.enableOptionOfList(opt.children, optionValue);
            }
          });
        }
      },
      emitFieldDataChange(newValue, oldValue) {
        this.emit$("field-value-changed", [newValue, oldValue]);
        this.broadcast("FieldWidget", "sync-field-value", [
          this.field.options.name,
          this.field.options.keyName,
          this.subFormName,
          this.subFormRowId,
          newValue,
          this.getObjectName()
        ]);
        this.getFormRef().broadcast("FieldWidget", "calculate-formula", [newValue, this]);
        this.dispatch("VFormRender", "fieldChange", [this.field.options.name, newValue, oldValue, this.subFormName, this.subFormRowIndex]);
      },
      syncUpdateFormModel(value2) {
        if (!!this.designState) {
          return;
        }
        if (!!this.subFormItemFlag) {
          let subFormData = this.formModel[this.subFormName] || [{}];
          let subFormDataRow = subFormData[this.subFormRowIndex];
          if (!!subFormDataRow) {
            subFormDataRow[this.fieldKeyName] = value2;
          }
        } else if (!!this.getObjectFieldFlag()) {
          const objectModel = this.getObjectModel();
          objectModel[this.fieldKeyName] = value2;
        } else {
          this.formModel[this.fieldKeyName] = value2;
        }
      },
      handleChangeEvent(value2) {
        if (!!this.designState) {
          return;
        }
        this.syncUpdateFormModel(value2);
        this.emitFieldDataChange(value2, this.oldFieldValue);
        this.oldFieldValue = deepClone(value2);
        this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
      },
      handleFocusCustomEvent(event) {
        if (!!this.designState) {
          return;
        }
        this.oldFieldValue = deepClone(this.fieldModel);
        if (!!this.field.options.onFocus) {
          let customFn = new Function("event", this.field.options.onFocus);
          customFn.call(this, event);
        }
      },
      handleBlurCustomEvent(event) {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onBlur) {
          let customFn = new Function("event", this.field.options.onBlur);
          customFn.call(this, event);
        }
      },
      handleInputCustomEvent(value2) {
        if (!!this.designState) {
          return;
        }
        this.syncUpdateFormModel(value2);
        this.dispatch("VFormRender", "fieldValidation", [this.getPropName()]);
        if (!!this.field.options.onInput) {
          let customFn = new Function("value", this.field.options.onInput);
          customFn.call(this, value2);
        }
      },
      emitAppendButtonClick() {
        if (!!this.designState) {
          return;
        }
        this.btnQueryForm = {};
        if (!!this.field.options.onAppendButtonClick) {
          let customFn = new Function(this.field.options.onAppendButtonClick);
          var ok = customFn.call(this);
          if (ok) {
            this.dispatch("VFormRender", "appendButtonClick", [this]);
          }
        } else {
          Object.assign(this.btnQueryForm, this.formModel);
          this.dispatch("VFormRender", "appendButtonClick", [this]);
        }
      },
      handleOnChange(val, oldVal) {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onChange) {
          let changeFn = new Function("value", "oldValue", this.field.options.onChange);
          changeFn.call(this, val, oldVal);
        }
      },
      handleOnChangeForSubForm(val, oldVal, subFormData, rowId2) {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onChange) {
          let changeFn = new Function("value", "oldValue", "subFormData", "rowId", this.field.options.onChange);
          changeFn.call(this, val, oldVal, subFormData, rowId2);
        }
      },
      handleButtonWidgetClick() {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onClick) {
          let customFn = new Function(this.field.options.onClick);
          customFn.call(this);
        } else {
          this.dispatch("VFormRender", "buttonClick", [this]);
        }
      },
      remoteQuery(keyword2) {
        if (!!this.designState) {
          return;
        }
        if (!!this.field.options.onRemoteQuery) {
          let remoteFn = new Function("keyword", this.field.options.onRemoteQuery);
          remoteFn.call(this, keyword2);
        }
      },
      getFormRef() {
        return this.refList["v_form_ref"];
      },
      getWidgetRef(widgetName, showError) {
        let foundRef = this.refList[widgetName];
        if (!foundRef && !!showError) {
          this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
        }
        return foundRef;
      },
      getFieldEditor() {
        return this.$refs["fieldEditor"];
      },
      setValue(newValue, disableChangeEvent = false) {
        if (!!this.field.formItemFlag) {
          let oldValue = deepClone(this.fieldModel);
          this.fieldModel = newValue;
          this.initFileList();
          this.syncUpdateFormModel(newValue);
          if (!disableChangeEvent) {
            this.emitFieldDataChange(newValue, oldValue);
          }
        }
      },
      getValue() {
        return this.fieldModel;
      },
      getSelectedLabel() {
      },
      resetField(disableChangeEvent = false) {
        let defaultValue = this.field.options.defaultValue;
        this.setValue(defaultValue, disableChangeEvent);
        this.$nextTick(() => {
        });
        if (this.field.type === "picture-upload" || this.field.type === "file-upload") {
          if (!!this.$refs["fieldEditor"]) {
            this.$refs["fieldEditor"].clearFiles();
          }
          this.fileList.splice(0, this.fileList.length);
        }
      },
      setWidgetOption(optionName, optionValue) {
        if (this.field.options.hasOwnProperty(optionName)) {
          this.field.options[optionName] = optionValue;
        }
      },
      setReadonly(flag) {
        this.field.options.readonly = flag;
      },
      setDisabled(flag) {
        this.field.options.disabled = flag;
      },
      setAppendButtonVisible(flag) {
        this.field.options.appendButton = flag;
      },
      setAppendButtonDisabled(flag) {
        this.field.options.appendButtonDisabled = flag;
      },
      setHidden(flag) {
        this.field.options.hidden = flag;
        if (!!flag) {
          this.clearFieldRules();
        } else {
          this.buildFieldRules();
        }
      },
      setRequired(flag) {
        this.field.options.required = flag;
        this.buildFieldRules();
        if (!this.designState && !flag) {
          this.clearValidate();
        }
      },
      clearValidate() {
        if (!!this.designState) {
          return;
        }
        this.getFormRef().getNativeForm().clearValidate(this.getPropName());
      },
      setLabel(newLabel) {
        this.field.options.label = newLabel;
      },
      focus() {
        if (!!this.getFieldEditor() && !!this.getFieldEditor().focus) {
          this.getFieldEditor().focus();
        }
      },
      clearSelectedOptions() {
        if (this.field.type !== "checkbox" && this.field.type !== "radio" && this.field.type !== "select") {
          return;
        }
        if (this.field.type === "checkbox" || this.field.type === "select" && this.field.options.multiple) {
          this.fieldModel = [];
        } else {
          this.fieldModel = "";
        }
      },
      loadOptions(options) {
        this.field.options.optionItems = translateOptionItems(options, this.field.type, this.field.options.labelKey || "label", this.field.options.valueKey || "value");
      },
      reloadOptions(options) {
        this.field.options.optionItems = translateOptionItems(options, this.field.type, this.field.options.labelKey || "label", this.field.options.valueKey || "value");
      },
      disableOption(optionValue) {
        this.disableOptionOfList(this.field.options.optionItems, optionValue);
      },
      enableOption(optionValue) {
        this.enableOptionOfList(this.field.options.optionItems, optionValue);
      },
      getOptionItems() {
        return this.field.options.optionItems;
      },
      setUploadHeader(name2, value2) {
        this.uploadHeaders[name2] = value2;
      },
      setUploadData(name2, value2) {
        this.uploadData[name2] = value2;
      },
      setToolbar(customToolbar) {
        this.customToolbar = customToolbar;
      },
      isSubFormItem() {
        return this.subFormItemFlag;
      },
      isSubFormField() {
        return this.subFormItemFlag;
      },
      setReadMode(readonlyFlag = true) {
        this.fieldReadonlyFlag = readonlyFlag;
      },
      addCssClass(className) {
        if (!this.field.options.customClass) {
          this.field.options.customClass = [className];
        } else {
          this.field.options.customClass.push(className);
        }
      },
      removeCssClass(className) {
        if (!this.field.options.customClass) {
          return;
        }
        let foundIdx = -1;
        this.field.options.customClass.map((cc, idx) => {
          if (cc === className) {
            foundIdx = idx;
          }
        });
        if (foundIdx > -1) {
          this.field.options.customClass.splice(foundIdx, 1);
        }
      }
    }
  };
  var buttonWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4p = {
    name: "button-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  function _sfc_render$4p(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "display-style": $props.field.options.displayStyle,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          ref: "fieldEditor",
          type: $props.field.options.type,
          size: $props.field.options.size,
          class: require$$0$1.normalizeClass([$props.field.options.label === "" ? "hide-text-span" : ""]),
          plain: $props.field.options.plain,
          round: $props.field.options.round,
          circle: $props.field.options.circle,
          icon: $props.field.options.icon,
          disabled: $props.field.options.disabled,
          onClick: _ctx.handleButtonWidgetClick
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString($props.field.options.label), 1)
          ]),
          _: 1
        }, 8, ["type", "size", "class", "plain", "round", "circle", "icon", "disabled", "onClick"])
      ]),
      _: 1
    }, 8, ["designer", "field", "design-state", "display-style", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var buttonWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4p, [["render", _sfc_render$4p], ["__scopeId", "data-v-04532474"]]);
  var __glob_0_0$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var formItemWrapper_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4o = {
    name: "form-item-wrapper",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      field: Object,
      designer: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      },
      rules: Array
    },
    inject: ["getFormConfig", "getSubFormFieldFlag", "getSubFormName", "getObjectFieldFlag", "getObjectName"],
    computed: {
      formConfig() {
        return this.getFormConfig();
      },
      selected() {
        return !!this.designer && this.field.id === this.designer.selectedId;
      },
      label() {
        if (!!this.field.options.labelHidden) {
          return "";
        }
        return this.field.options.label;
      },
      labelWidth() {
        if (!!this.field.options.labelHidden) {
          return 0;
        }
        if (!!this.field.options.labelWidth) {
          return this.field.options.labelWidth;
        }
        if (!!this.designer) {
          return this.designer.formConfig.labelWidth;
        } else {
          return this.formConfig.labelWidth;
        }
      },
      labelAlign() {
        if (!!this.field.options.labelAlign) {
          return this.field.options.labelAlign;
        }
        if (!!this.designer) {
          return this.designer.formConfig.labelAlign || "label-left-align";
        } else {
          return this.formConfig.labelAlign || "label-left-align";
        }
      },
      customClass() {
        return !!this.field.options.customClass ? this.field.options.customClass.join(" ") : "";
      },
      subFormName() {
        return !!this.getSubFormName ? this.getSubFormName() : "";
      },
      subFormItemFlag() {
        return !!this.getSubFormFieldFlag ? this.getSubFormFieldFlag() : false;
      }
    },
    created() {
    },
    methods: {
      selectField(field) {
        if (!!this.designer) {
          this.designer.setSelected(field);
          this.designer.emitEvent("field-selected", this.parentWidget);
        }
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      cloneField(field) {
        this.designer.cloneFieldWidget(field, this.parentList);
        this.designer.emitHistoryChange();
      },
      removeFieldWidget() {
        if (!!this.parentList) {
          const fieldRefName = this.designer.selectedWidgetName;
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.formWidget.deleteWidgetRef(fieldRefName);
            this.designer.emitHistoryChange();
            this.designer.emitEvent("canvas-remove-field", fieldRefName);
          });
        }
      },
      getPropName() {
        let fieldKeyName = this.field.options.name;
        fieldKeyName = this.field.options.keyNameEnabled ? this.field.options.keyName || fieldKeyName : fieldKeyName;
        if (this.subFormItemFlag && !this.designState) {
          return this.subFormName + "." + this.subFormRowIndex + "." + fieldKeyName;
        } else if (this.getObjectFieldFlag() && !this.designState) {
          return this.getObjectName() + "." + fieldKeyName;
        } else {
          return fieldKeyName;
        }
      }
    }
  };
  const _hoisted_1$Z = {
    key: 0,
    class: "custom-label"
  };
  const _hoisted_2$p = {
    key: 0,
    class: "field-action"
  };
  const _hoisted_3$h = ["title"];
  const _hoisted_4$g = ["title"];
  const _hoisted_5$d = ["title"];
  const _hoisted_6$d = ["title"];
  const _hoisted_7$a = ["title"];
  const _hoisted_8$9 = {
    key: 1,
    class: "drag-handler background-opacity"
  };
  const _hoisted_9$8 = ["title"];
  const _hoisted_10$8 = { key: 0 };
  function _sfc_render$4o(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
      class: require$$0$1.normalizeClass(["field-wrapper", { "design-time-bottom-margin": !!this.designer }])
    }, [
      !!$props.field.formItemFlag && (!$props.field.options.hidden || $props.designState === true) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: $options.label,
        "label-width": $options.labelWidth + "px",
        title: $props.field.options.labelTooltip,
        size: $props.field.options.size,
        rules: $props.rules,
        prop: $options.getPropName(),
        class: require$$0$1.normalizeClass([$options.selected ? "selected" : "", $options.labelAlign, $options.customClass, $props.field.options.required ? "required" : "", !!$props.field.options.labelWrap ? "label-wrap" : ""]),
        onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => $options.selectField($props.field), ["stop"]))
      }, {
        label: require$$0$1.withCtx(() => [
          !!$props.field.options.labelIconClass ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$Z, [
            $props.field.options.labelIconPosition === "front" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
              !!$props.field.options.labelTooltip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
                require$$0$1.createVNode(_component_el_tooltip, {
                  content: $props.field.options.labelTooltip,
                  effect: "light"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_icon, null, {
                      default: require$$0$1.withCtx(() => [
                        (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.field.options.labelIconClass)))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["content"]),
                require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.label), 1)
              ], 64)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.field.options.labelIconClass)))
                  ]),
                  _: 1
                }),
                require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.label), 1)
              ], 64))
            ], 64)) : $props.field.options.labelIconPosition === "rear" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
              !!$props.field.options.labelTooltip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.label), 1),
                require$$0$1.createVNode(_component_el_tooltip, {
                  content: $props.field.options.labelTooltip,
                  effect: "light"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_icon, null, {
                      default: require$$0$1.withCtx(() => [
                        (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.field.options.labelIconClass)))
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }, 8, ["content"])
              ], 64)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.label), 1),
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.field.options.labelIconClass)))
                  ]),
                  _: 1
                })
              ], 64))
            ], 64)) : require$$0$1.createCommentVNode("", true)
          ])) : require$$0$1.createCommentVNode("", true)
        ]),
        default: require$$0$1.withCtx(() => [
          require$$0$1.renderSlot(_ctx.$slots, "default", {}, void 0, true)
        ]),
        _: 3
      }, 8, ["label", "label-width", "title", "size", "rules", "prop", "class"])) : require$$0$1.createCommentVNode("", true),
      !!this.designer ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
        $props.designer.selectedId === $props.field.id ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_2$p, [
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.selectParentWidget"),
            onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => $options.selectParentWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-back" })
          ], 8, _hoisted_3$h),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 0,
            title: _ctx.i18nt("designer.hint.moveUpWidget"),
            onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.moveUpWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-up" })
          ], 8, _hoisted_4$g)) : require$$0$1.createCommentVNode("", true),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 1,
            title: _ctx.i18nt("designer.hint.moveDownWidget"),
            onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => $options.moveDownWidget($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-down" })
          ], 8, _hoisted_5$d)) : require$$0$1.createCommentVNode("", true),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.cloneWidget"),
            onClick: _cache[4] || (_cache[4] = require$$0$1.withModifiers(($event) => $options.cloneField($props.field), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-clone" })
          ], 8, _hoisted_6$d),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.remove"),
            onClick: _cache[5] || (_cache[5] = require$$0$1.withModifiers((...args) => $options.removeFieldWidget && $options.removeFieldWidget(...args), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
          ], 8, _hoisted_7$a)
        ])) : require$$0$1.createCommentVNode("", true),
        $props.designer.selectedId === $props.field.id ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_8$9, [
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.dragHandler")
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-drag-move" })
          ], 8, _hoisted_9$8),
          require$$0$1.createElementVNode("i", null, require$$0$1.toDisplayString(_ctx.i18n2t(`designer.widgetLabel.${$props.field.type}`, `extension.widgetLabel.${$props.field.type}`)), 1),
          $props.field.options.hidden === true ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", _hoisted_10$8, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-hide" })
          ])) : require$$0$1.createCommentVNode("", true)
        ])) : require$$0$1.createCommentVNode("", true)
      ], 64)) : require$$0$1.createCommentVNode("", true)
    ], 2);
  }
  var FormItemWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$4o, [["render", _sfc_render$4o], ["__scopeId", "data-v-70ede2a0"]]);
  var __glob_0_8$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": FormItemWrapper
  }, Symbol.toStringTag, { value: "Module" }));
  var cascaderWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4n = {
    name: "cascader-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      labelKey() {
        return this.field.options.labelKey || "label";
      },
      valueKey() {
        return this.field.options.valueKey || "value";
      },
      childrenKey() {
        return this.field.options.childrenKey || "children";
      },
      showFullPath() {
        return this.field.options.showAllLevels === void 0 || !!this.field.options.showAllLevels;
      },
      contentForReadMode() {
        let onlyLeafFlag = !this.field.options.checkStrictly;
        let checkedNodes = this.$refs.fieldEditor.getCheckedNodes(onlyLeafFlag);
        if (!checkedNodes || checkedNodes.length <= 0) {
          return "--";
        } else {
          return checkedNodes.map((nodeItem) => nodeItem.text).join(", ");
        }
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initOptionItems();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      hideDropDownOnClick() {
        setTimeout(() => {
          document.querySelectorAll(".el-cascader-panel .el-radio").forEach((el) => {
            el.onclick = () => {
              console.log("test====", 1111);
              this.$refs.fieldEditor.popperVisible = false;
            };
          });
        }, 100);
      }
    }
  };
  const _hoisted_1$Y = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4n(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_cascader = require$$0$1.resolveComponent("el-cascader");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["full-width-input", { "readonly-mode-cascader": _ctx.isReadMode }])
        }, [
          require$$0$1.createVNode(_component_el_cascader, {
            ref: "fieldEditor",
            options: $props.field.options.optionItems,
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            disabled: $props.field.options.disabled || _ctx.isReadMode,
            clearable: $props.field.options.clearable,
            filterable: $props.field.options.filterable,
            placeholder: $props.field.options.placeholder || _ctx.i18nt("render.hint.selectPlaceholder"),
            "show-all-levels": $options.showFullPath,
            props: { checkStrictly: $props.field.options.checkStrictly, multiple: $props.field.options.multiple, expandTrigger: "hover", value: $options.valueKey, label: $options.labelKey, children: $options.childrenKey },
            onVisibleChange: $options.hideDropDownOnClick,
            onExpandChange: $options.hideDropDownOnClick,
            onFocus: _ctx.handleFocusCustomEvent,
            onBlur: _ctx.handleBlurCustomEvent,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["options", "modelValue", "disabled", "clearable", "filterable", "placeholder", "show-all-levels", "props", "onVisibleChange", "onExpandChange", "onFocus", "onBlur", "onChange"]),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$Y, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var cascaderWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4n, [["render", _sfc_render$4n], ["__scopeId", "data-v-4d4f31ec"]]);
  var __glob_0_1$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cascaderWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var checkboxWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4m = {
    name: "checkbox-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initOptionItems();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$X = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4m(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_checkbox_button = require$$0$1.resolveComponent("el-checkbox-button");
    const _component_el_checkbox = require$$0$1.resolveComponent("el-checkbox");
    const _component_el_checkbox_group = require$$0$1.resolveComponent("el-checkbox-group");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_checkbox_group, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          disabled: $props.field.options.disabled,
          onChange: _ctx.handleChangeEvent
        }, {
          default: require$$0$1.withCtx(() => [
            !!$props.field.options.buttonStyle ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, require$$0$1.renderList($props.field.options.optionItems, (item, index2) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_checkbox_button, {
                key: index2,
                label: item.value,
                disabled: item.disabled,
                border: $props.field.options.border,
                style: require$$0$1.normalizeStyle({ display: $props.field.options.displayStyle })
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(item.label), 1)
                ]),
                _: 2
              }, 1032, ["label", "disabled", "border", "style"]);
            }), 128)) : (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, require$$0$1.renderList($props.field.options.optionItems, (item, index2) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_checkbox, {
                key: index2,
                label: item.value,
                disabled: item.disabled,
                border: $props.field.options.border,
                style: require$$0$1.normalizeStyle({ display: $props.field.options.displayStyle })
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(item.label), 1)
                ]),
                _: 2
              }, 1032, ["label", "disabled", "border", "style"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "onChange"]), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$X, require$$0$1.toDisplayString(_ctx.optionLabel), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var checkboxWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4m, [["render", _sfc_render$4m], ["__scopeId", "data-v-6268a390"]]);
  var __glob_0_2$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": checkboxWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var colorWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4l = {
    name: "color-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$W = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4l(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_color_picker = require$$0$1.resolveComponent("el-color-picker");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([_ctx.isReadMode ? "readonly-mode-color" : ""])
        }, [
          require$$0$1.createVNode(_component_el_color_picker, {
            ref: "fieldEditor",
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            disabled: $props.field.options.disabled,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["modelValue", "disabled", "onChange"]),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$W, require$$0$1.toDisplayString($data.fieldModel), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var colorWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4l, [["render", _sfc_render$4l], ["__scopeId", "data-v-15ad9a07"]]);
  var __glob_0_3$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": colorWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var dateRangeWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4k = {
    name: "date-range-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      contentForReadMode() {
        if (!this.fieldModel) {
          return "--";
        } else {
          return this.fieldModel[0] + " - " + this.fieldModel[1];
        }
      },
      dateRangeKey() {
        return this.widgetKey || this.field.id;
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      refreshWidgetKey() {
        this.widgetKey = "date-range-key-" + generateId();
      }
    }
  };
  const _hoisted_1$V = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4k(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_date_picker = require$$0$1.resolveComponent("el-date-picker");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : "", _ctx.isReadMode ? "readonly-mode-date-range" : ""])
        }, [
          (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_date_picker, {
            ref: "fieldEditor",
            type: $props.field.options.type,
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            key: $options.dateRangeKey,
            class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : ""]),
            disabled: $props.field.options.disabled,
            readonly: $props.field.options.readonly,
            clearable: $props.field.options.clearable,
            editable: $props.field.options.editable,
            format: $props.field.options.format,
            "value-format": $props.field.options.valueFormat,
            "start-placeholder": $props.field.options.startPlaceholder || _ctx.i18nt("render.hint.startDatePlaceholder"),
            "end-placeholder": $props.field.options.endPlaceholder || _ctx.i18nt("render.hint.endDatePlaceholder"),
            onFocus: _ctx.handleFocusCustomEvent,
            onBlur: _ctx.handleBlurCustomEvent,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["type", "modelValue", "class", "disabled", "readonly", "clearable", "editable", "format", "value-format", "start-placeholder", "end-placeholder", "onFocus", "onBlur", "onChange"])),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$V, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var dateRangeWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4k, [["render", _sfc_render$4k], ["__scopeId", "data-v-70e6b868"]]);
  var __glob_0_4$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateRangeWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var dateWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4j = {
    name: "date-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$U = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4j(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_date_picker = require$$0$1.resolveComponent("el-date-picker");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : "", _ctx.isReadMode ? "readonly-mode-date" : ""])
        }, [
          require$$0$1.createVNode(_component_el_date_picker, {
            ref: "fieldEditor",
            type: $props.field.options.type,
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : ""]),
            readonly: $props.field.options.readonly,
            disabled: $props.field.options.disabled,
            clearable: $props.field.options.clearable,
            editable: $props.field.options.editable,
            format: $props.field.options.format,
            "value-format": $props.field.options.valueFormat,
            placeholder: $props.field.options.placeholder || _ctx.i18nt("render.hint.datePlaceholder"),
            onFocus: _ctx.handleFocusCustomEvent,
            onBlur: _ctx.handleBlurCustomEvent,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["type", "modelValue", "class", "readonly", "disabled", "clearable", "editable", "format", "value-format", "placeholder", "onFocus", "onBlur", "onChange"]),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$U, require$$0$1.toDisplayString($data.fieldModel), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var dateWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["render", _sfc_render$4j], ["__scopeId", "data-v-92bf9a96"]]);
  var __glob_0_5$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var dividerWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4i = {
    name: "divider-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  function _sfc_render$4i(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_divider, {
          ref: "fieldEditor",
          direction: $props.field.options.direction,
          "content-position": $props.field.options.contentPosition
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString($props.field.options.label), 1)
          ]),
          _: 1
        }, 8, ["direction", "content-position"])
      ]),
      _: 1
    }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var dividerWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4i, [["render", _sfc_render$4i], ["__scopeId", "data-v-6604df59"]]);
  var __glob_0_6$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dividerWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var fileUploadWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  let selectFileText = "'" + translate("render.hint.selectFile") + "'";
  const _sfc_main$4h = {
    name: "file-upload-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      SvgIcon,
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: [],
        rules: [],
        uploadHeaders: {},
        uploadData: {
          key: ""
        },
        fileList: [],
        styleVariables: {
          "--select-file-action": selectFileText
        }
      };
    },
    computed: {
      realUploadURL() {
        let uploadURL = this.field.options.uploadURL;
        if (!!uploadURL && (uploadURL.indexOf("DSV.") > -1 || uploadURL.indexOf("DSV[") > -1)) {
          let DSV = this.getGlobalDsv();
          console.log("test DSV: ", DSV);
          return evalFn(this.field.options.uploadURL, DSV);
        }
        return this.field.options.uploadURL;
      },
      uploadBtnHidden() {
        return !this.fileList || this.fileList.length >= this.field.options.limit;
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      handleFileExceed() {
        let uploadLimit = this.field.options.limit;
        this.$message.warning(this.i18nt("render.hint.uploadExceed").replace("${uploadLimit}", uploadLimit));
      },
      beforeFileUpload(file) {
        let fileTypeCheckResult = false;
        let extFileName = file.name.substring(file.name.lastIndexOf(".") + 1);
        if (!!this.field.options && !!this.field.options.fileTypes) {
          let uploadFileTypes = this.field.options.fileTypes;
          if (uploadFileTypes.length > 0) {
            fileTypeCheckResult = uploadFileTypes.some((ft) => {
              return extFileName.toLowerCase() === ft.toLowerCase();
            });
          }
        }
        if (!fileTypeCheckResult) {
          this.$message.error(this.i18nt("render.hint.unsupportedFileType") + extFileName);
          return false;
        }
        let fileSizeCheckResult = false;
        let uploadFileMaxSize = 5;
        if (!!this.field.options && !!this.field.options.fileMaxSize) {
          uploadFileMaxSize = this.field.options.fileMaxSize;
        }
        fileSizeCheckResult = file.size / 1024 / 1024 <= uploadFileMaxSize;
        if (!fileSizeCheckResult) {
          this.$message.error(this.i18nt("render.hint.fileSizeExceed") + uploadFileMaxSize + "MB");
          return false;
        }
        this.uploadData.key = file.name;
        return this.handleOnBeforeUpload(file);
      },
      handleOnBeforeUpload(file) {
        if (!!this.field.options.onBeforeUpload) {
          let bfFunc = new Function("file", this.field.options.onBeforeUpload);
          let result = bfFunc.call(this, file);
          if (typeof result === "boolean") {
            return result;
          } else {
            return true;
          }
        }
        return true;
      },
      updateFieldModelAndEmitDataChangeForUpload(fileList, customResult, defaultResult) {
        this.fieldModel = this.fieldModel || [];
        let oldValue = deepClone(this.fieldModel);
        if (!!customResult && !!customResult.name && !!customResult.url) {
          this.fieldModel.push({
            name: customResult.name,
            url: customResult.url
          });
        } else if (!!defaultResult && !!defaultResult.name && !!defaultResult.url) {
          this.fieldModel.push({
            name: defaultResult.name,
            url: defaultResult.url
          });
        } else if (!!defaultResult && !!defaultResult.data && !!defaultResult.data.name && !!defaultResult.data.url) {
          this.fieldModel.push({
            name: defaultResult.data.name,
            url: defaultResult.data.url
          });
        } else {
          this.fieldModel = deepClone(fileList);
        }
        this.syncUpdateFormModel(this.fieldModel);
        this.emitFieldDataChange(this.fieldModel, oldValue);
      },
      handleFileUpload(res, file, fileList) {
        if (file.status === "success") {
          let customResult = null;
          if (!!this.field.options.onUploadSuccess) {
            let mountFunc = new Function("result", "file", "fileList", this.field.options.onUploadSuccess);
            customResult = mountFunc.call(this, res, file, fileList);
          }
          this.updateFieldModelAndEmitDataChangeForUpload(fileList, customResult, res);
          if (!!customResult && !!customResult.name) {
            file.name = customResult.name;
          } else {
            file.name = file.name || res.name || res.fileName || res.filename;
          }
          if (!!customResult && !!customResult.url) {
            file.url = customResult.url;
          } else {
            file.url = file.url || res.url;
          }
          this.fileList = deepClone(fileList);
          this.$nextTick(() => {
            this.clearValidate();
          });
        }
      },
      updateFieldModelAndEmitDataChangeForRemove(deletedFileIdx, fileList) {
        let oldValue = deepClone(this.fieldModel);
        this.fieldModel.splice(deletedFileIdx, 1);
        this.syncUpdateFormModel(this.fieldModel);
        this.emitFieldDataChange(this.fieldModel, oldValue);
      },
      removeUploadFile(fileName, fileUrl, fileUid) {
        let foundIdx = -1;
        let foundFile = null;
        this.fileList.forEach((file, idx) => {
          if (file.name === fileName && (file.url === fileUrl || !!fileUid && file.uid === fileUid)) {
            foundIdx = idx;
            foundFile = file;
          }
        });
        if (foundIdx >= 0) {
          this.fileList.splice(foundIdx, 1);
          this.updateFieldModelAndEmitDataChangeForRemove(foundIdx, this.fileList);
          if (!!this.field.options.onFileRemove) {
            let customFn = new Function("file", "fileList", this.field.options.onFileRemove);
            customFn.call(this, foundFile, this.fileList);
          }
        }
      },
      handleUploadError(err, file, fileList) {
        if (!!this.field.options.onUploadError) {
          let customFn = new Function("error", "file", "fileList", this.field.options.onUploadError);
          customFn.call(this, err, file, fileList);
        } else {
          this.$message({
            message: this.i18nt("render.hint.uploadError") + err,
            duration: 3e3,
            type: "error"
          });
        }
      }
    }
  };
  const _withScopeId$7 = (n) => (require$$0$1.pushScopeId("data-v-3a8735ee"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$T = {
    key: 0,
    class: "el-upload__tip"
  };
  const _hoisted_2$o = /* @__PURE__ */ _withScopeId$7(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "el-icon-plus avatar-uploader-icon" }, null, -1));
  const _hoisted_3$g = { class: "upload-file-list" };
  const _hoisted_4$f = ["title"];
  const _hoisted_5$c = ["href"];
  const _hoisted_6$c = ["title"];
  const _hoisted_7$9 = ["title", "onClick"];
  function _sfc_render$4h(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_upload = require$$0$1.resolveComponent("el-upload");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_upload, {
          ref: "fieldEditor",
          disabled: $props.field.options.disabled || _ctx.isReadMode,
          style: require$$0$1.normalizeStyle($data.styleVariables),
          class: require$$0$1.normalizeClass(["dynamicPseudoAfter", { "hideUploadDiv": $options.uploadBtnHidden || _ctx.isReadMode }]),
          action: $options.realUploadURL,
          headers: $data.uploadHeaders,
          data: $data.uploadData,
          "with-credentials": $props.field.options.withCredentials,
          multiple: $props.field.options.multipleSelect,
          "file-list": $data.fileList,
          "show-file-list": $props.field.options.showFileList,
          limit: $props.field.options.limit,
          "on-exceed": $options.handleFileExceed,
          "before-upload": $options.beforeFileUpload,
          "on-success": $options.handleFileUpload,
          "on-error": $options.handleUploadError
        }, {
          tip: require$$0$1.withCtx(() => [
            !!$props.field.options.uploadTip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$T, require$$0$1.toDisplayString($props.field.options.uploadTip), 1)) : require$$0$1.createCommentVNode("", true)
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" }),
            _hoisted_2$o
          ]),
          file: require$$0$1.withCtx(({ file }) => [
            require$$0$1.createElementVNode("div", _hoisted_3$g, [
              require$$0$1.createElementVNode("span", {
                class: "upload-file-name",
                title: file.name
              }, require$$0$1.toDisplayString(file.name), 9, _hoisted_4$f),
              require$$0$1.createElementVNode("a", {
                href: file.url,
                download: "",
                target: "_blank"
              }, [
                require$$0$1.createElementVNode("span", {
                  class: "el-icon-download file-action",
                  title: _ctx.i18nt("render.hint.downloadFile")
                }, [
                  require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-download" })
                ], 8, _hoisted_6$c)
              ], 8, _hoisted_5$c),
              !$props.field.options.disabled && !_ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", {
                key: 0,
                class: "file-action",
                title: _ctx.i18nt("render.hint.removeFile"),
                onClick: ($event) => $options.removeUploadFile(file.name, file.url, file.uid)
              }, [
                require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
              ], 8, _hoisted_7$9)) : require$$0$1.createCommentVNode("", true)
            ])
          ]),
          _: 1
        }, 8, ["disabled", "style", "action", "headers", "data", "with-credentials", "multiple", "file-list", "show-file-list", "class", "limit", "on-exceed", "before-upload", "on-success", "on-error"])
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var fileUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4h, [["render", _sfc_render$4h], ["__scopeId", "data-v-3a8735ee"]]);
  var __glob_0_7$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": fileUploadWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var htmlTextWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4g = {
    name: "html-text-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$S = ["innerHTML"];
  function _sfc_render$4g(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          ref: "fieldEditor",
          innerHTML: $props.field.options.htmlContent
        }, null, 8, _hoisted_1$S)
      ]),
      _: 1
    }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var htmlTextWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4g, [["render", _sfc_render$4g], ["__scopeId", "data-v-a0d236d6"]]);
  var __glob_0_9$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": htmlTextWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var inputWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4f = {
    name: "input-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper,
      SvgIcon
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      inputType() {
        if (this.field.options.type === "number") {
          return "text";
        }
        return this.field.options.type;
      },
      contentForReadMode() {
        return this.fieldModel ? this.fieldModel : "--";
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$R = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4f(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_input, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          disabled: $props.field.options.disabled,
          readonly: $props.field.options.readonly,
          size: $props.field.options.size,
          class: "hide-spin-button",
          type: $options.inputType,
          "show-password": $props.field.options.showPassword,
          placeholder: $props.field.options.placeholder,
          clearable: $props.field.options.clearable,
          minlength: $props.field.options.minLength,
          maxlength: $props.field.options.maxLength,
          "show-word-limit": $props.field.options.showWordLimit,
          "prefix-icon": $props.field.options.prefixIcon,
          "suffix-icon": $props.field.options.suffixIcon,
          onFocus: _ctx.handleFocusCustomEvent,
          onBlur: _ctx.handleBlurCustomEvent,
          onInput: _ctx.handleInputCustomEvent,
          onChange: _ctx.handleChangeEvent
        }, require$$0$1.createSlots({ _: 2 }, [
          $props.field.options.appendButton ? {
            name: "append",
            fn: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_button, {
                disabled: $props.field.options.disabled || $props.field.options.appendButtonDisabled,
                onClick: _ctx.emitAppendButtonClick
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_icon, null, {
                    default: require$$0$1.withCtx(() => [
                      (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.field.options.buttonIcon)))
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["disabled", "onClick"])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["modelValue", "disabled", "readonly", "size", "type", "show-password", "placeholder", "clearable", "minlength", "maxlength", "show-word-limit", "prefix-icon", "suffix-icon", "onFocus", "onBlur", "onInput", "onChange"]), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$R, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var inputWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4f, [["render", _sfc_render$4f], ["__scopeId", "data-v-89e3b0d6"]]);
  var __glob_0_10$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": inputWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var numberWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4e = {
    name: "number-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      showControls() {
        return this.field.options.controls === void 0 ? true : this.field.options.controls;
      },
      contentForReadMode() {
        return this.fieldModel === null || this.fieldModel === void 0 ? "--" : this.fieldModel;
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$Q = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4e(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_input_number, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          class: "full-width-input",
          disabled: $props.field.options.disabled,
          controls: $options.showControls,
          "controls-position": $props.field.options.controlsPosition,
          placeholder: $props.field.options.placeholder,
          min: $props.field.options.min,
          max: $props.field.options.max,
          precision: $props.field.options.precision,
          step: $props.field.options.step,
          onFocus: _ctx.handleFocusCustomEvent,
          onBlur: _ctx.handleBlurCustomEvent,
          onChange: _ctx.handleChangeEvent
        }, null, 8, ["modelValue", "disabled", "controls", "controls-position", "placeholder", "min", "max", "precision", "step", "onFocus", "onBlur", "onChange"]), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$Q, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var numberWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4e, [["render", _sfc_render$4e], ["__scopeId", "data-v-aae6021c"]]);
  var __glob_0_11$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": numberWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var pictureUploadWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4d = {
    name: "picture-upload-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper,
      SvgIcon
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: [],
        rules: [],
        uploadHeaders: {},
        uploadData: {
          key: ""
        },
        fileList: [],
        fileListBeforeRemove: [],
        previewUrl: "",
        showPreviewDialogFlag: false
      };
    },
    computed: {
      realUploadURL() {
        let uploadURL = this.field.options.uploadURL;
        if (!!uploadURL && (uploadURL.indexOf("DSV.") > -1 || uploadURL.indexOf("DSV[") > -1)) {
          let DSV = this.getGlobalDsv();
          console.log("test DSV: ", DSV);
          return evalFn(this.field.options.uploadURL, DSV);
        }
        return this.field.options.uploadURL;
      },
      uploadBtnHidden() {
        return !this.fileList || this.fileList.length >= this.field.options.limit;
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      handlePictureExceed() {
        let uploadLimit = this.field.options.limit;
        this.$message.warning(this.i18nt("render.hint.uploadExceed").replace("${uploadLimit}", uploadLimit));
      },
      handlePicturePreview(file) {
        this.previewUrl = file.url;
        this.showPreviewDialogFlag = true;
      },
      beforePictureUpload(file) {
        let fileTypeCheckResult = false;
        if (!!this.field.options && !!this.field.options.fileTypes) {
          let uploadFileTypes = this.field.options.fileTypes;
          if (uploadFileTypes.length > 0) {
            fileTypeCheckResult = uploadFileTypes.some((ft) => {
              return file.type === "image/" + ft;
            });
          }
        }
        if (!fileTypeCheckResult) {
          this.$message.error(this.i18nt("render.hint.unsupportedFileType") + file.type);
          return false;
        }
        let fileSizeCheckResult = false;
        let uploadFileMaxSize = 5;
        if (!!this.field.options && !!this.field.options.fileMaxSize) {
          uploadFileMaxSize = this.field.options.fileMaxSize;
        }
        fileSizeCheckResult = file.size / 1024 / 1024 <= uploadFileMaxSize;
        if (!fileSizeCheckResult) {
          this.$message.error(this.$("render.hint.fileSizeExceed") + uploadFileMaxSize + "MB");
          return false;
        }
        this.uploadData.key = file.name;
        return this.handleOnBeforeUpload(file);
      },
      handleOnBeforeUpload(file) {
        if (!!this.field.options.onBeforeUpload) {
          let bfFunc = new Function("file", this.field.options.onBeforeUpload);
          let result = bfFunc.call(this, file);
          if (typeof result === "boolean") {
            return result;
          } else {
            return true;
          }
        }
        return true;
      },
      updateFieldModelAndEmitDataChangeForUpload(fileList, customResult, defaultResult) {
        this.fieldModel = this.fieldModel || [];
        let oldValue = deepClone(this.fieldModel);
        if (!!customResult && !!customResult.name && !!customResult.url) {
          this.fieldModel.push({
            name: customResult.name,
            url: customResult.url
          });
        } else if (!!defaultResult && !!defaultResult.name && !!defaultResult.url) {
          this.fieldModel.push({
            name: defaultResult.name,
            url: defaultResult.url
          });
        } else if (!!defaultResult && !!defaultResult.data && !!defaultResult.data.name && !!defaultResult.data.url) {
          this.fieldModel.push({
            name: defaultResult.data.name,
            url: defaultResult.data.url
          });
        } else {
          this.fieldModel = deepClone(fileList);
        }
        this.syncUpdateFormModel(this.fieldModel);
        this.emitFieldDataChange(this.fieldModel, oldValue);
      },
      handlePictureUpload(res, file, fileList) {
        if (file.status === "success") {
          let customResult = null;
          if (!!this.field.options.onUploadSuccess) {
            let customFn = new Function("result", "file", "fileList", this.field.options.onUploadSuccess);
            customResult = customFn.call(this, res, file, fileList);
          }
          this.updateFieldModelAndEmitDataChangeForUpload(fileList, customResult, res);
          this.fileList = deepClone(fileList);
          this.$nextTick(() => {
            this.clearValidate();
          });
        }
      },
      updateFieldModelAndEmitDataChangeForRemove(file, fileList) {
        let oldValue = deepClone(this.fieldModel);
        let foundFileIdx = -1;
        this.fileListBeforeRemove.map((fi, idx) => {
          if (fi.name === file.name && (fi.url === file.url || !!fi.uid && fi.uid === file.uid)) {
            foundFileIdx = idx;
          }
        });
        if (foundFileIdx > -1) {
          this.fieldModel.splice(foundFileIdx, 1);
        }
        this.syncUpdateFormModel(this.fieldModel);
        this.emitFieldDataChange(this.fieldModel, oldValue);
      },
      handleBeforeRemove(file, fileList) {
        this.fileListBeforeRemove = deepClone(fileList);
      },
      handlePictureRemove(file, fileList) {
        this.updateFieldModelAndEmitDataChangeForRemove(file, fileList);
        this.fileList = deepClone(fileList);
        if (!!this.field.options.onFileRemove) {
          let customFn = new Function("file", "fileList", this.field.options.onFileRemove);
          customFn.call(this, file, fileList);
        }
      },
      handleUploadError(err, file, fileList) {
        if (!!this.field.options.onUploadError) {
          let customFn = new Function("error", "file", "fileList", this.field.options.onUploadError);
          customFn.call(this, err, file, fileList);
        } else {
          this.$message({
            message: this.i18nt("render.hint.uploadError") + err,
            duration: 3e3,
            type: "error"
          });
        }
      }
    }
  };
  const _hoisted_1$P = {
    key: 0,
    class: "el-upload__tip"
  };
  const _hoisted_2$n = { class: "uploader-icon" };
  const _hoisted_3$f = { key: 0 };
  const _hoisted_4$e = ["src"];
  function _sfc_render$4d(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_upload = require$$0$1.resolveComponent("el-upload");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_upload, {
          ref: "fieldEditor",
          disabled: $props.field.options.disabled || _ctx.isReadMode,
          action: $options.realUploadURL,
          headers: $data.uploadHeaders,
          data: $data.uploadData,
          "with-credentials": $props.field.options.withCredentials,
          multiple: $props.field.options.multipleSelect,
          "file-list": $data.fileList,
          "show-file-list": $props.field.options.showFileList,
          "list-type": "picture-card",
          class: require$$0$1.normalizeClass({ "hideUploadDiv": $options.uploadBtnHidden || _ctx.isReadMode }),
          limit: $props.field.options.limit,
          "on-exceed": $options.handlePictureExceed,
          "on-preview": $options.handlePicturePreview,
          "before-upload": $options.beforePictureUpload,
          "on-success": $options.handlePictureUpload,
          "on-error": $options.handleUploadError,
          "before-remove": $options.handleBeforeRemove,
          "on-remove": $options.handlePictureRemove
        }, {
          tip: require$$0$1.withCtx(() => [
            !!$props.field.options.uploadTip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$P, require$$0$1.toDisplayString($props.field.options.uploadTip), 1)) : require$$0$1.createCommentVNode("", true)
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_2$n, [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" })
            ])
          ]),
          _: 1
        }, 8, ["disabled", "action", "headers", "data", "with-credentials", "multiple", "file-list", "show-file-list", "class", "limit", "on-exceed", "on-preview", "before-upload", "on-success", "on-error", "before-remove", "on-remove"]),
        $data.showPreviewDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_3$f, [
          require$$0$1.createVNode(_component_el_dialog, {
            title: "",
            modelValue: $data.showPreviewDialogFlag,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.showPreviewDialogFlag = $event),
            "append-to-body": "",
            width: "60%",
            "show-close": true,
            class: "drag-dialog small-padding-dialog",
            "close-on-click-modal": true,
            "close-on-press-escape": true,
            "destroy-on-close": true
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("img", {
                src: $data.previewUrl,
                style: { "width": "100%" },
                alt: ""
              }, null, 8, _hoisted_4$e)
            ]),
            _: 1
          }, 8, ["modelValue"])
        ])), [
          [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
        ]) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var pictureUploadWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4d, [["render", _sfc_render$4d], ["__scopeId", "data-v-265b55dc"]]);
  var __glob_0_12$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": pictureUploadWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var radioWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$4c = {
    name: "radio-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initOptionItems();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$O = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$4c(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio = require$$0$1.resolveComponent("el-radio");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_radio_group, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          disabled: $props.field.options.disabled,
          style: require$$0$1.normalizeStyle({ display: $props.field.options.displayStyle + " !important" }),
          onChange: _ctx.handleChangeEvent
        }, {
          default: require$$0$1.withCtx(() => [
            !!$props.field.options.buttonStyle ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, require$$0$1.renderList($props.field.options.optionItems, (item, index2) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_radio_button, {
                key: index2,
                label: item.value,
                disabled: item.disabled,
                border: $props.field.options.border,
                style: require$$0$1.normalizeStyle({ display: $props.field.options.displayStyle })
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(item.label), 1)
                ]),
                _: 2
              }, 1032, ["label", "disabled", "border", "style"]);
            }), 128)) : (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, require$$0$1.renderList($props.field.options.optionItems, (item, index2) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_radio, {
                key: index2,
                label: item.value,
                disabled: item.disabled,
                border: $props.field.options.border,
                style: require$$0$1.normalizeStyle({ display: $props.field.options.displayStyle })
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(item.label), 1)
                ]),
                _: 2
              }, 1032, ["label", "disabled", "border", "style"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "style", "onChange"]), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$O, require$$0$1.toDisplayString(_ctx.optionLabel), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var radioWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4c, [["render", _sfc_render$4c], ["__scopeId", "data-v-5da89272"]]);
  var __glob_0_13$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": radioWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var rateWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  var rateWidget_vue_vue_type_style_index_1_lang = "";
  const _sfc_main$4b = {
    name: "rate-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  function _sfc_render$4b(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_rate = require$$0$1.resolveComponent("el-rate");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_rate, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          class: "no-margin-top",
          disabled: $props.field.options.disabled || _ctx.isReadMode,
          max: $props.field.options.max,
          "low-threshold": $props.field.options.lowThreshold,
          "high-threshold": $props.field.options.highThreshold,
          "allow-half": $props.field.options.allowHalf,
          "show-text": $props.field.options.showText,
          "show-score": $props.field.options.showScore,
          onChange: _ctx.handleChangeEvent
        }, null, 8, ["modelValue", "disabled", "max", "low-threshold", "high-threshold", "allow-half", "show-text", "show-score", "onChange"])
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var rateWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4b, [["render", _sfc_render$4b], ["__scopeId", "data-v-c0a3bf96"]]);
  var __glob_0_14$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": rateWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var quill = { exports: {} };
  /*!
   * Quill Editor v1.3.7
   * https://quilljs.com/
   * Copyright (c) 2014, Jason Chen
   * Copyright (c) 2013, salesforce.com
   */
  (function(module2, exports2) {
    (function webpackUniversalModuleDefinition(root, factory) {
      module2.exports = factory();
    })(typeof self !== "undefined" ? self : commonjsGlobal, function() {
      return function(modules2) {
        var installedModules = {};
        function __webpack_require__(moduleId) {
          if (installedModules[moduleId]) {
            return installedModules[moduleId].exports;
          }
          var module3 = installedModules[moduleId] = {
            i: moduleId,
            l: false,
            exports: {}
          };
          modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
          module3.l = true;
          return module3.exports;
        }
        __webpack_require__.m = modules2;
        __webpack_require__.c = installedModules;
        __webpack_require__.d = function(exports3, name2, getter) {
          if (!__webpack_require__.o(exports3, name2)) {
            Object.defineProperty(exports3, name2, {
              configurable: false,
              enumerable: true,
              get: getter
            });
          }
        };
        __webpack_require__.n = function(module3) {
          var getter = module3 && module3.__esModule ? function getDefault() {
            return module3["default"];
          } : function getModuleExports() {
            return module3;
          };
          __webpack_require__.d(getter, "a", getter);
          return getter;
        };
        __webpack_require__.o = function(object, property) {
          return Object.prototype.hasOwnProperty.call(object, property);
        };
        __webpack_require__.p = "";
        return __webpack_require__(__webpack_require__.s = 109);
      }([
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          var container_1 = __webpack_require__(17);
          var format_1 = __webpack_require__(18);
          var leaf_1 = __webpack_require__(19);
          var scroll_1 = __webpack_require__(45);
          var inline_1 = __webpack_require__(46);
          var block_1 = __webpack_require__(47);
          var embed_1 = __webpack_require__(48);
          var text_1 = __webpack_require__(49);
          var attributor_1 = __webpack_require__(12);
          var class_1 = __webpack_require__(32);
          var style_1 = __webpack_require__(33);
          var store_1 = __webpack_require__(31);
          var Registry = __webpack_require__(1);
          var Parchment = {
            Scope: Registry.Scope,
            create: Registry.create,
            find: Registry.find,
            query: Registry.query,
            register: Registry.register,
            Container: container_1.default,
            Format: format_1.default,
            Leaf: leaf_1.default,
            Embed: embed_1.default,
            Scroll: scroll_1.default,
            Block: block_1.default,
            Inline: inline_1.default,
            Text: text_1.default,
            Attributor: {
              Attribute: attributor_1.default,
              Class: class_1.default,
              Style: style_1.default,
              Store: store_1.default
            }
          };
          exports3.default = Parchment;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var ParchmentError = function(_super) {
            __extends(ParchmentError2, _super);
            function ParchmentError2(message) {
              var _this = this;
              message = "[Parchment] " + message;
              _this = _super.call(this, message) || this;
              _this.message = message;
              _this.name = _this.constructor.name;
              return _this;
            }
            return ParchmentError2;
          }(Error);
          exports3.ParchmentError = ParchmentError;
          var attributes = {};
          var classes = {};
          var tags2 = {};
          var types2 = {};
          exports3.DATA_KEY = "__blot";
          var Scope;
          (function(Scope2) {
            Scope2[Scope2["TYPE"] = 3] = "TYPE";
            Scope2[Scope2["LEVEL"] = 12] = "LEVEL";
            Scope2[Scope2["ATTRIBUTE"] = 13] = "ATTRIBUTE";
            Scope2[Scope2["BLOT"] = 14] = "BLOT";
            Scope2[Scope2["INLINE"] = 7] = "INLINE";
            Scope2[Scope2["BLOCK"] = 11] = "BLOCK";
            Scope2[Scope2["BLOCK_BLOT"] = 10] = "BLOCK_BLOT";
            Scope2[Scope2["INLINE_BLOT"] = 6] = "INLINE_BLOT";
            Scope2[Scope2["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE";
            Scope2[Scope2["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE";
            Scope2[Scope2["ANY"] = 15] = "ANY";
          })(Scope = exports3.Scope || (exports3.Scope = {}));
          function create(input, value2) {
            var match = query(input);
            if (match == null) {
              throw new ParchmentError("Unable to create " + input + " blot");
            }
            var BlotClass = match;
            var node = input instanceof Node || input["nodeType"] === Node.TEXT_NODE ? input : BlotClass.create(value2);
            return new BlotClass(node, value2);
          }
          exports3.create = create;
          function find2(node, bubble) {
            if (bubble === void 0) {
              bubble = false;
            }
            if (node == null)
              return null;
            if (node[exports3.DATA_KEY] != null)
              return node[exports3.DATA_KEY].blot;
            if (bubble)
              return find2(node.parentNode, bubble);
            return null;
          }
          exports3.find = find2;
          function query(query2, scope) {
            if (scope === void 0) {
              scope = Scope.ANY;
            }
            var match;
            if (typeof query2 === "string") {
              match = types2[query2] || attributes[query2];
            } else if (query2 instanceof Text || query2["nodeType"] === Node.TEXT_NODE) {
              match = types2["text"];
            } else if (typeof query2 === "number") {
              if (query2 & Scope.LEVEL & Scope.BLOCK) {
                match = types2["block"];
              } else if (query2 & Scope.LEVEL & Scope.INLINE) {
                match = types2["inline"];
              }
            } else if (query2 instanceof HTMLElement) {
              var names = (query2.getAttribute("class") || "").split(/\s+/);
              for (var i2 in names) {
                match = classes[names[i2]];
                if (match)
                  break;
              }
              match = match || tags2[query2.tagName];
            }
            if (match == null)
              return null;
            if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)
              return match;
            return null;
          }
          exports3.query = query;
          function register() {
            var Definitions = [];
            for (var _i = 0; _i < arguments.length; _i++) {
              Definitions[_i] = arguments[_i];
            }
            if (Definitions.length > 1) {
              return Definitions.map(function(d) {
                return register(d);
              });
            }
            var Definition = Definitions[0];
            if (typeof Definition.blotName !== "string" && typeof Definition.attrName !== "string") {
              throw new ParchmentError("Invalid definition");
            } else if (Definition.blotName === "abstract") {
              throw new ParchmentError("Cannot register abstract class");
            }
            types2[Definition.blotName || Definition.attrName] = Definition;
            if (typeof Definition.keyName === "string") {
              attributes[Definition.keyName] = Definition;
            } else {
              if (Definition.className != null) {
                classes[Definition.className] = Definition;
              }
              if (Definition.tagName != null) {
                if (Array.isArray(Definition.tagName)) {
                  Definition.tagName = Definition.tagName.map(function(tagName) {
                    return tagName.toUpperCase();
                  });
                } else {
                  Definition.tagName = Definition.tagName.toUpperCase();
                }
                var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];
                tagNames.forEach(function(tag) {
                  if (tags2[tag] == null || Definition.className == null) {
                    tags2[tag] = Definition;
                  }
                });
              }
            }
            return Definition;
          }
          exports3.register = register;
        },
        function(module3, exports3, __webpack_require__) {
          var diff = __webpack_require__(51);
          var equal = __webpack_require__(11);
          var extend2 = __webpack_require__(3);
          var op = __webpack_require__(20);
          var NULL_CHARACTER = String.fromCharCode(0);
          var Delta = function(ops) {
            if (Array.isArray(ops)) {
              this.ops = ops;
            } else if (ops != null && Array.isArray(ops.ops)) {
              this.ops = ops.ops;
            } else {
              this.ops = [];
            }
          };
          Delta.prototype.insert = function(text, attributes) {
            var newOp = {};
            if (text.length === 0)
              return this;
            newOp.insert = text;
            if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
              newOp.attributes = attributes;
            }
            return this.push(newOp);
          };
          Delta.prototype["delete"] = function(length) {
            if (length <= 0)
              return this;
            return this.push({ "delete": length });
          };
          Delta.prototype.retain = function(length, attributes) {
            if (length <= 0)
              return this;
            var newOp = { retain: length };
            if (attributes != null && typeof attributes === "object" && Object.keys(attributes).length > 0) {
              newOp.attributes = attributes;
            }
            return this.push(newOp);
          };
          Delta.prototype.push = function(newOp) {
            var index2 = this.ops.length;
            var lastOp = this.ops[index2 - 1];
            newOp = extend2(true, {}, newOp);
            if (typeof lastOp === "object") {
              if (typeof newOp["delete"] === "number" && typeof lastOp["delete"] === "number") {
                this.ops[index2 - 1] = { "delete": lastOp["delete"] + newOp["delete"] };
                return this;
              }
              if (typeof lastOp["delete"] === "number" && newOp.insert != null) {
                index2 -= 1;
                lastOp = this.ops[index2 - 1];
                if (typeof lastOp !== "object") {
                  this.ops.unshift(newOp);
                  return this;
                }
              }
              if (equal(newOp.attributes, lastOp.attributes)) {
                if (typeof newOp.insert === "string" && typeof lastOp.insert === "string") {
                  this.ops[index2 - 1] = { insert: lastOp.insert + newOp.insert };
                  if (typeof newOp.attributes === "object")
                    this.ops[index2 - 1].attributes = newOp.attributes;
                  return this;
                } else if (typeof newOp.retain === "number" && typeof lastOp.retain === "number") {
                  this.ops[index2 - 1] = { retain: lastOp.retain + newOp.retain };
                  if (typeof newOp.attributes === "object")
                    this.ops[index2 - 1].attributes = newOp.attributes;
                  return this;
                }
              }
            }
            if (index2 === this.ops.length) {
              this.ops.push(newOp);
            } else {
              this.ops.splice(index2, 0, newOp);
            }
            return this;
          };
          Delta.prototype.chop = function() {
            var lastOp = this.ops[this.ops.length - 1];
            if (lastOp && lastOp.retain && !lastOp.attributes) {
              this.ops.pop();
            }
            return this;
          };
          Delta.prototype.filter = function(predicate) {
            return this.ops.filter(predicate);
          };
          Delta.prototype.forEach = function(predicate) {
            this.ops.forEach(predicate);
          };
          Delta.prototype.map = function(predicate) {
            return this.ops.map(predicate);
          };
          Delta.prototype.partition = function(predicate) {
            var passed = [], failed = [];
            this.forEach(function(op2) {
              var target = predicate(op2) ? passed : failed;
              target.push(op2);
            });
            return [passed, failed];
          };
          Delta.prototype.reduce = function(predicate, initial2) {
            return this.ops.reduce(predicate, initial2);
          };
          Delta.prototype.changeLength = function() {
            return this.reduce(function(length, elem) {
              if (elem.insert) {
                return length + op.length(elem);
              } else if (elem.delete) {
                return length - elem.delete;
              }
              return length;
            }, 0);
          };
          Delta.prototype.length = function() {
            return this.reduce(function(length, elem) {
              return length + op.length(elem);
            }, 0);
          };
          Delta.prototype.slice = function(start, end) {
            start = start || 0;
            if (typeof end !== "number")
              end = Infinity;
            var ops = [];
            var iter = op.iterator(this.ops);
            var index2 = 0;
            while (index2 < end && iter.hasNext()) {
              var nextOp;
              if (index2 < start) {
                nextOp = iter.next(start - index2);
              } else {
                nextOp = iter.next(end - index2);
                ops.push(nextOp);
              }
              index2 += op.length(nextOp);
            }
            return new Delta(ops);
          };
          Delta.prototype.compose = function(other) {
            var thisIter = op.iterator(this.ops);
            var otherIter = op.iterator(other.ops);
            var ops = [];
            var firstOther = otherIter.peek();
            if (firstOther != null && typeof firstOther.retain === "number" && firstOther.attributes == null) {
              var firstLeft = firstOther.retain;
              while (thisIter.peekType() === "insert" && thisIter.peekLength() <= firstLeft) {
                firstLeft -= thisIter.peekLength();
                ops.push(thisIter.next());
              }
              if (firstOther.retain - firstLeft > 0) {
                otherIter.next(firstOther.retain - firstLeft);
              }
            }
            var delta = new Delta(ops);
            while (thisIter.hasNext() || otherIter.hasNext()) {
              if (otherIter.peekType() === "insert") {
                delta.push(otherIter.next());
              } else if (thisIter.peekType() === "delete") {
                delta.push(thisIter.next());
              } else {
                var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
                var thisOp = thisIter.next(length);
                var otherOp = otherIter.next(length);
                if (typeof otherOp.retain === "number") {
                  var newOp = {};
                  if (typeof thisOp.retain === "number") {
                    newOp.retain = length;
                  } else {
                    newOp.insert = thisOp.insert;
                  }
                  var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === "number");
                  if (attributes)
                    newOp.attributes = attributes;
                  delta.push(newOp);
                  if (!otherIter.hasNext() && equal(delta.ops[delta.ops.length - 1], newOp)) {
                    var rest2 = new Delta(thisIter.rest());
                    return delta.concat(rest2).chop();
                  }
                } else if (typeof otherOp["delete"] === "number" && typeof thisOp.retain === "number") {
                  delta.push(otherOp);
                }
              }
            }
            return delta.chop();
          };
          Delta.prototype.concat = function(other) {
            var delta = new Delta(this.ops.slice());
            if (other.ops.length > 0) {
              delta.push(other.ops[0]);
              delta.ops = delta.ops.concat(other.ops.slice(1));
            }
            return delta;
          };
          Delta.prototype.diff = function(other, index2) {
            if (this.ops === other.ops) {
              return new Delta();
            }
            var strings = [this, other].map(function(delta2) {
              return delta2.map(function(op2) {
                if (op2.insert != null) {
                  return typeof op2.insert === "string" ? op2.insert : NULL_CHARACTER;
                }
                var prep = delta2 === other ? "on" : "with";
                throw new Error("diff() called " + prep + " non-document");
              }).join("");
            });
            var delta = new Delta();
            var diffResult = diff(strings[0], strings[1], index2);
            var thisIter = op.iterator(this.ops);
            var otherIter = op.iterator(other.ops);
            diffResult.forEach(function(component) {
              var length = component[1].length;
              while (length > 0) {
                var opLength = 0;
                switch (component[0]) {
                  case diff.INSERT:
                    opLength = Math.min(otherIter.peekLength(), length);
                    delta.push(otherIter.next(opLength));
                    break;
                  case diff.DELETE:
                    opLength = Math.min(length, thisIter.peekLength());
                    thisIter.next(opLength);
                    delta["delete"](opLength);
                    break;
                  case diff.EQUAL:
                    opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);
                    var thisOp = thisIter.next(opLength);
                    var otherOp = otherIter.next(opLength);
                    if (equal(thisOp.insert, otherOp.insert)) {
                      delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));
                    } else {
                      delta.push(otherOp)["delete"](opLength);
                    }
                    break;
                }
                length -= opLength;
              }
            });
            return delta.chop();
          };
          Delta.prototype.eachLine = function(predicate, newline2) {
            newline2 = newline2 || "\n";
            var iter = op.iterator(this.ops);
            var line = new Delta();
            var i2 = 0;
            while (iter.hasNext()) {
              if (iter.peekType() !== "insert")
                return;
              var thisOp = iter.peek();
              var start = op.length(thisOp) - iter.peekLength();
              var index2 = typeof thisOp.insert === "string" ? thisOp.insert.indexOf(newline2, start) - start : -1;
              if (index2 < 0) {
                line.push(iter.next());
              } else if (index2 > 0) {
                line.push(iter.next(index2));
              } else {
                if (predicate(line, iter.next(1).attributes || {}, i2) === false) {
                  return;
                }
                i2 += 1;
                line = new Delta();
              }
            }
            if (line.length() > 0) {
              predicate(line, {}, i2);
            }
          };
          Delta.prototype.transform = function(other, priority) {
            priority = !!priority;
            if (typeof other === "number") {
              return this.transformPosition(other, priority);
            }
            var thisIter = op.iterator(this.ops);
            var otherIter = op.iterator(other.ops);
            var delta = new Delta();
            while (thisIter.hasNext() || otherIter.hasNext()) {
              if (thisIter.peekType() === "insert" && (priority || otherIter.peekType() !== "insert")) {
                delta.retain(op.length(thisIter.next()));
              } else if (otherIter.peekType() === "insert") {
                delta.push(otherIter.next());
              } else {
                var length = Math.min(thisIter.peekLength(), otherIter.peekLength());
                var thisOp = thisIter.next(length);
                var otherOp = otherIter.next(length);
                if (thisOp["delete"]) {
                  continue;
                } else if (otherOp["delete"]) {
                  delta.push(otherOp);
                } else {
                  delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));
                }
              }
            }
            return delta.chop();
          };
          Delta.prototype.transformPosition = function(index2, priority) {
            priority = !!priority;
            var thisIter = op.iterator(this.ops);
            var offset = 0;
            while (thisIter.hasNext() && offset <= index2) {
              var length = thisIter.peekLength();
              var nextType = thisIter.peekType();
              thisIter.next();
              if (nextType === "delete") {
                index2 -= Math.min(length, index2 - offset);
                continue;
              } else if (nextType === "insert" && (offset < index2 || !priority)) {
                index2 += length;
              }
              offset += length;
            }
            return index2;
          };
          module3.exports = Delta;
        },
        function(module3, exports3) {
          var hasOwn = Object.prototype.hasOwnProperty;
          var toStr = Object.prototype.toString;
          var defineProperty = Object.defineProperty;
          var gOPD = Object.getOwnPropertyDescriptor;
          var isArray2 = function isArray3(arr) {
            if (typeof Array.isArray === "function") {
              return Array.isArray(arr);
            }
            return toStr.call(arr) === "[object Array]";
          };
          var isPlainObject2 = function isPlainObject3(obj) {
            if (!obj || toStr.call(obj) !== "[object Object]") {
              return false;
            }
            var hasOwnConstructor = hasOwn.call(obj, "constructor");
            var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf");
            if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
              return false;
            }
            var key;
            for (key in obj) {
            }
            return typeof key === "undefined" || hasOwn.call(obj, key);
          };
          var setProperty = function setProperty2(target, options) {
            if (defineProperty && options.name === "__proto__") {
              defineProperty(target, options.name, {
                enumerable: true,
                configurable: true,
                value: options.newValue,
                writable: true
              });
            } else {
              target[options.name] = options.newValue;
            }
          };
          var getProperty = function getProperty2(obj, name2) {
            if (name2 === "__proto__") {
              if (!hasOwn.call(obj, name2)) {
                return void 0;
              } else if (gOPD) {
                return gOPD(obj, name2).value;
              }
            }
            return obj[name2];
          };
          module3.exports = function extend2() {
            var options, name2, src, copy, copyIsArray, clone2;
            var target = arguments[0];
            var i2 = 1;
            var length = arguments.length;
            var deep = false;
            if (typeof target === "boolean") {
              deep = target;
              target = arguments[1] || {};
              i2 = 2;
            }
            if (target == null || typeof target !== "object" && typeof target !== "function") {
              target = {};
            }
            for (; i2 < length; ++i2) {
              options = arguments[i2];
              if (options != null) {
                for (name2 in options) {
                  src = getProperty(target, name2);
                  copy = getProperty(options, name2);
                  if (target !== copy) {
                    if (deep && copy && (isPlainObject2(copy) || (copyIsArray = isArray2(copy)))) {
                      if (copyIsArray) {
                        copyIsArray = false;
                        clone2 = src && isArray2(src) ? src : [];
                      } else {
                        clone2 = src && isPlainObject2(src) ? src : {};
                      }
                      setProperty(target, { name: name2, newValue: extend2(deep, clone2, copy) });
                    } else if (typeof copy !== "undefined") {
                      setProperty(target, { name: name2, newValue: copy });
                    }
                  }
                }
              }
            }
            return target;
          };
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.BlockEmbed = exports3.bubbleFormats = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _break = __webpack_require__(16);
          var _break2 = _interopRequireDefault(_break);
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var NEWLINE_LENGTH = 1;
          var BlockEmbed = function(_Parchment$Embed) {
            _inherits(BlockEmbed2, _Parchment$Embed);
            function BlockEmbed2() {
              _classCallCheck(this, BlockEmbed2);
              return _possibleConstructorReturn(this, (BlockEmbed2.__proto__ || Object.getPrototypeOf(BlockEmbed2)).apply(this, arguments));
            }
            _createClass(BlockEmbed2, [{
              key: "attach",
              value: function attach() {
                _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "attach", this).call(this);
                this.attributes = new _parchment2.default.Attributor.Store(this.domNode);
              }
            }, {
              key: "delta",
              value: function delta() {
                return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));
              }
            }, {
              key: "format",
              value: function format(name2, value2) {
                var attribute = _parchment2.default.query(name2, _parchment2.default.Scope.BLOCK_ATTRIBUTE);
                if (attribute != null) {
                  this.attributes.attribute(attribute, value2);
                }
              }
            }, {
              key: "formatAt",
              value: function formatAt(index2, length, name2, value2) {
                this.format(name2, value2);
              }
            }, {
              key: "insertAt",
              value: function insertAt(index2, value2, def) {
                if (typeof value2 === "string" && value2.endsWith("\n")) {
                  var block = _parchment2.default.create(Block.blotName);
                  this.parent.insertBefore(block, index2 === 0 ? this : this.next);
                  block.insertAt(0, value2.slice(0, -1));
                } else {
                  _get(BlockEmbed2.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed2.prototype), "insertAt", this).call(this, index2, value2, def);
                }
              }
            }]);
            return BlockEmbed2;
          }(_parchment2.default.Embed);
          BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;
          var Block = function(_Parchment$Block) {
            _inherits(Block2, _Parchment$Block);
            function Block2(domNode) {
              _classCallCheck(this, Block2);
              var _this2 = _possibleConstructorReturn(this, (Block2.__proto__ || Object.getPrototypeOf(Block2)).call(this, domNode));
              _this2.cache = {};
              return _this2;
            }
            _createClass(Block2, [{
              key: "delta",
              value: function delta() {
                if (this.cache.delta == null) {
                  this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function(delta2, leaf) {
                    if (leaf.length() === 0) {
                      return delta2;
                    } else {
                      return delta2.insert(leaf.value(), bubbleFormats(leaf));
                    }
                  }, new _quillDelta2.default()).insert("\n", bubbleFormats(this));
                }
                return this.cache.delta;
              }
            }, {
              key: "deleteAt",
              value: function deleteAt(index2, length) {
                _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "deleteAt", this).call(this, index2, length);
                this.cache = {};
              }
            }, {
              key: "formatAt",
              value: function formatAt(index2, length, name2, value2) {
                if (length <= 0)
                  return;
                if (_parchment2.default.query(name2, _parchment2.default.Scope.BLOCK)) {
                  if (index2 + length === this.length()) {
                    this.format(name2, value2);
                  }
                } else {
                  _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "formatAt", this).call(this, index2, Math.min(length, this.length() - index2 - 1), name2, value2);
                }
                this.cache = {};
              }
            }, {
              key: "insertAt",
              value: function insertAt(index2, value2, def) {
                if (def != null)
                  return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, index2, value2, def);
                if (value2.length === 0)
                  return;
                var lines = value2.split("\n");
                var text = lines.shift();
                if (text.length > 0) {
                  if (index2 < this.length() - 1 || this.children.tail == null) {
                    _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertAt", this).call(this, Math.min(index2, this.length() - 1), text);
                  } else {
                    this.children.tail.insertAt(this.children.tail.length(), text);
                  }
                  this.cache = {};
                }
                var block = this;
                lines.reduce(function(index3, line) {
                  block = block.split(index3, true);
                  block.insertAt(0, line);
                  return line.length;
                }, index2 + text.length);
              }
            }, {
              key: "insertBefore",
              value: function insertBefore(blot, ref2) {
                var head = this.children.head;
                _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "insertBefore", this).call(this, blot, ref2);
                if (head instanceof _break2.default) {
                  head.remove();
                }
                this.cache = {};
              }
            }, {
              key: "length",
              value: function length() {
                if (this.cache.length == null) {
                  this.cache.length = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "length", this).call(this) + NEWLINE_LENGTH;
                }
                return this.cache.length;
              }
            }, {
              key: "moveChildren",
              value: function moveChildren(target, ref2) {
                _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "moveChildren", this).call(this, target, ref2);
                this.cache = {};
              }
            }, {
              key: "optimize",
              value: function optimize(context) {
                _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "optimize", this).call(this, context);
                this.cache = {};
              }
            }, {
              key: "path",
              value: function path(index2) {
                return _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "path", this).call(this, index2, true);
              }
            }, {
              key: "removeChild",
              value: function removeChild(child) {
                _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "removeChild", this).call(this, child);
                this.cache = {};
              }
            }, {
              key: "split",
              value: function split(index2) {
                var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                if (force && (index2 === 0 || index2 >= this.length() - NEWLINE_LENGTH)) {
                  var clone2 = this.clone();
                  if (index2 === 0) {
                    this.parent.insertBefore(clone2, this);
                    return this;
                  } else {
                    this.parent.insertBefore(clone2, this.next);
                    return clone2;
                  }
                } else {
                  var next = _get(Block2.prototype.__proto__ || Object.getPrototypeOf(Block2.prototype), "split", this).call(this, index2, force);
                  this.cache = {};
                  return next;
                }
              }
            }]);
            return Block2;
          }(_parchment2.default.Block);
          Block.blotName = "block";
          Block.tagName = "P";
          Block.defaultChild = "break";
          Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];
          function bubbleFormats(blot) {
            var formats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
            if (blot == null)
              return formats;
            if (typeof blot.formats === "function") {
              formats = (0, _extend2.default)(formats, blot.formats());
            }
            if (blot.parent == null || blot.parent.blotName == "scroll" || blot.parent.statics.scope !== blot.statics.scope) {
              return formats;
            }
            return bubbleFormats(blot.parent, formats);
          }
          exports3.bubbleFormats = bubbleFormats;
          exports3.BlockEmbed = BlockEmbed;
          exports3.default = Block;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.overload = exports3.expandConfig = void 0;
          var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
          } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
          };
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          __webpack_require__(50);
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _editor = __webpack_require__(14);
          var _editor2 = _interopRequireDefault(_editor);
          var _emitter3 = __webpack_require__(8);
          var _emitter4 = _interopRequireDefault(_emitter3);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _selection = __webpack_require__(15);
          var _selection2 = _interopRequireDefault(_selection);
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          var _theme = __webpack_require__(34);
          var _theme2 = _interopRequireDefault(_theme);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var debug = (0, _logger2.default)("quill");
          var Quill2 = function() {
            _createClass(Quill3, null, [{
              key: "debug",
              value: function debug2(limit) {
                if (limit === true) {
                  limit = "log";
                }
                _logger2.default.level(limit);
              }
            }, {
              key: "find",
              value: function find2(node) {
                return node.__quill || _parchment2.default.find(node);
              }
            }, {
              key: "import",
              value: function _import(name2) {
                if (this.imports[name2] == null) {
                  debug.error("Cannot import " + name2 + ". Are you sure it was registered?");
                }
                return this.imports[name2];
              }
            }, {
              key: "register",
              value: function register(path, target) {
                var _this = this;
                var overwrite = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
                if (typeof path !== "string") {
                  var name2 = path.attrName || path.blotName;
                  if (typeof name2 === "string") {
                    this.register("formats/" + name2, path, target);
                  } else {
                    Object.keys(path).forEach(function(key) {
                      _this.register(key, path[key], target);
                    });
                  }
                } else {
                  if (this.imports[path] != null && !overwrite) {
                    debug.warn("Overwriting " + path + " with", target);
                  }
                  this.imports[path] = target;
                  if ((path.startsWith("blots/") || path.startsWith("formats/")) && target.blotName !== "abstract") {
                    _parchment2.default.register(target);
                  } else if (path.startsWith("modules") && typeof target.register === "function") {
                    target.register();
                  }
                }
              }
            }]);
            function Quill3(container) {
              var _this2 = this;
              var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
              _classCallCheck(this, Quill3);
              this.options = expandConfig(container, options);
              this.container = this.options.container;
              if (this.container == null) {
                return debug.error("Invalid Quill container", container);
              }
              if (this.options.debug) {
                Quill3.debug(this.options.debug);
              }
              var html = this.container.innerHTML.trim();
              this.container.classList.add("ql-container");
              this.container.innerHTML = "";
              this.container.__quill = this;
              this.root = this.addContainer("ql-editor");
              this.root.classList.add("ql-blank");
              this.root.setAttribute("data-gramm", false);
              this.scrollingContainer = this.options.scrollingContainer || this.root;
              this.emitter = new _emitter4.default();
              this.scroll = _parchment2.default.create(this.root, {
                emitter: this.emitter,
                whitelist: this.options.formats
              });
              this.editor = new _editor2.default(this.scroll);
              this.selection = new _selection2.default(this.scroll, this.emitter);
              this.theme = new this.options.theme(this, this.options);
              this.keyboard = this.theme.addModule("keyboard");
              this.clipboard = this.theme.addModule("clipboard");
              this.history = this.theme.addModule("history");
              this.theme.init();
              this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type) {
                if (type === _emitter4.default.events.TEXT_CHANGE) {
                  _this2.root.classList.toggle("ql-blank", _this2.editor.isBlank());
                }
              });
              this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function(source, mutations) {
                var range = _this2.selection.lastRange;
                var index2 = range && range.length === 0 ? range.index : void 0;
                modify.call(_this2, function() {
                  return _this2.editor.update(null, mutations, index2);
                }, source);
              });
              var contents = this.clipboard.convert(`<div class='ql-editor' style="white-space: normal;">` + html + "<p><br></p></div>");
              this.setContents(contents);
              this.history.clear();
              if (this.options.placeholder) {
                this.root.setAttribute("data-placeholder", this.options.placeholder);
              }
              if (this.options.readOnly) {
                this.disable();
              }
            }
            _createClass(Quill3, [{
              key: "addContainer",
              value: function addContainer(container) {
                var refNode = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
                if (typeof container === "string") {
                  var className = container;
                  container = document.createElement("div");
                  container.classList.add(className);
                }
                this.container.insertBefore(container, refNode);
                return container;
              }
            }, {
              key: "blur",
              value: function blur() {
                this.selection.setRange(null);
              }
            }, {
              key: "deleteText",
              value: function deleteText(index2, length, source) {
                var _this3 = this;
                var _overload = overload(index2, length, source);
                var _overload2 = _slicedToArray(_overload, 4);
                index2 = _overload2[0];
                length = _overload2[1];
                source = _overload2[3];
                return modify.call(this, function() {
                  return _this3.editor.deleteText(index2, length);
                }, source, index2, -1 * length);
              }
            }, {
              key: "disable",
              value: function disable() {
                this.enable(false);
              }
            }, {
              key: "enable",
              value: function enable() {
                var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
                this.scroll.enable(enabled);
                this.container.classList.toggle("ql-disabled", !enabled);
              }
            }, {
              key: "focus",
              value: function focus() {
                var scrollTop = this.scrollingContainer.scrollTop;
                this.selection.focus();
                this.scrollingContainer.scrollTop = scrollTop;
                this.scrollIntoView();
              }
            }, {
              key: "format",
              value: function format(name2, value2) {
                var _this4 = this;
                var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
                return modify.call(this, function() {
                  var range = _this4.getSelection(true);
                  var change = new _quillDelta2.default();
                  if (range == null) {
                    return change;
                  } else if (_parchment2.default.query(name2, _parchment2.default.Scope.BLOCK)) {
                    change = _this4.editor.formatLine(range.index, range.length, _defineProperty2({}, name2, value2));
                  } else if (range.length === 0) {
                    _this4.selection.format(name2, value2);
                    return change;
                  } else {
                    change = _this4.editor.formatText(range.index, range.length, _defineProperty2({}, name2, value2));
                  }
                  _this4.setSelection(range, _emitter4.default.sources.SILENT);
                  return change;
                }, source);
              }
            }, {
              key: "formatLine",
              value: function formatLine(index2, length, name2, value2, source) {
                var _this5 = this;
                var formats = void 0;
                var _overload3 = overload(index2, length, name2, value2, source);
                var _overload4 = _slicedToArray(_overload3, 4);
                index2 = _overload4[0];
                length = _overload4[1];
                formats = _overload4[2];
                source = _overload4[3];
                return modify.call(this, function() {
                  return _this5.editor.formatLine(index2, length, formats);
                }, source, index2, 0);
              }
            }, {
              key: "formatText",
              value: function formatText(index2, length, name2, value2, source) {
                var _this6 = this;
                var formats = void 0;
                var _overload5 = overload(index2, length, name2, value2, source);
                var _overload6 = _slicedToArray(_overload5, 4);
                index2 = _overload6[0];
                length = _overload6[1];
                formats = _overload6[2];
                source = _overload6[3];
                return modify.call(this, function() {
                  return _this6.editor.formatText(index2, length, formats);
                }, source, index2, 0);
              }
            }, {
              key: "getBounds",
              value: function getBounds(index2) {
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                var bounds = void 0;
                if (typeof index2 === "number") {
                  bounds = this.selection.getBounds(index2, length);
                } else {
                  bounds = this.selection.getBounds(index2.index, index2.length);
                }
                var containerBounds = this.container.getBoundingClientRect();
                return {
                  bottom: bounds.bottom - containerBounds.top,
                  height: bounds.height,
                  left: bounds.left - containerBounds.left,
                  right: bounds.right - containerBounds.left,
                  top: bounds.top - containerBounds.top,
                  width: bounds.width
                };
              }
            }, {
              key: "getContents",
              value: function getContents() {
                var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index2;
                var _overload7 = overload(index2, length);
                var _overload8 = _slicedToArray(_overload7, 2);
                index2 = _overload8[0];
                length = _overload8[1];
                return this.editor.getContents(index2, length);
              }
            }, {
              key: "getFormat",
              value: function getFormat() {
                var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.getSelection(true);
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                if (typeof index2 === "number") {
                  return this.editor.getFormat(index2, length);
                } else {
                  return this.editor.getFormat(index2.index, index2.length);
                }
              }
            }, {
              key: "getIndex",
              value: function getIndex(blot) {
                return blot.offset(this.scroll);
              }
            }, {
              key: "getLength",
              value: function getLength() {
                return this.scroll.length();
              }
            }, {
              key: "getLeaf",
              value: function getLeaf(index2) {
                return this.scroll.leaf(index2);
              }
            }, {
              key: "getLine",
              value: function getLine(index2) {
                return this.scroll.line(index2);
              }
            }, {
              key: "getLines",
              value: function getLines() {
                var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
                if (typeof index2 !== "number") {
                  return this.scroll.lines(index2.index, index2.length);
                } else {
                  return this.scroll.lines(index2, length);
                }
              }
            }, {
              key: "getModule",
              value: function getModule(name2) {
                return this.theme.modules[name2];
              }
            }, {
              key: "getSelection",
              value: function getSelection2() {
                var focus = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
                if (focus)
                  this.focus();
                this.update();
                return this.selection.getRange()[0];
              }
            }, {
              key: "getText",
              value: function getText() {
                var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.getLength() - index2;
                var _overload9 = overload(index2, length);
                var _overload10 = _slicedToArray(_overload9, 2);
                index2 = _overload10[0];
                length = _overload10[1];
                return this.editor.getText(index2, length);
              }
            }, {
              key: "hasFocus",
              value: function hasFocus() {
                return this.selection.hasFocus();
              }
            }, {
              key: "insertEmbed",
              value: function insertEmbed(index2, embed, value2) {
                var _this7 = this;
                var source = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : Quill3.sources.API;
                return modify.call(this, function() {
                  return _this7.editor.insertEmbed(index2, embed, value2);
                }, source, index2);
              }
            }, {
              key: "insertText",
              value: function insertText(index2, text, name2, value2, source) {
                var _this8 = this;
                var formats = void 0;
                var _overload11 = overload(index2, 0, name2, value2, source);
                var _overload12 = _slicedToArray(_overload11, 4);
                index2 = _overload12[0];
                formats = _overload12[2];
                source = _overload12[3];
                return modify.call(this, function() {
                  return _this8.editor.insertText(index2, text, formats);
                }, source, index2, text.length);
              }
            }, {
              key: "isEnabled",
              value: function isEnabled() {
                return !this.container.classList.contains("ql-disabled");
              }
            }, {
              key: "off",
              value: function off2() {
                return this.emitter.off.apply(this.emitter, arguments);
              }
            }, {
              key: "on",
              value: function on2() {
                return this.emitter.on.apply(this.emitter, arguments);
              }
            }, {
              key: "once",
              value: function once() {
                return this.emitter.once.apply(this.emitter, arguments);
              }
            }, {
              key: "pasteHTML",
              value: function pasteHTML(index2, html, source) {
                this.clipboard.dangerouslyPasteHTML(index2, html, source);
              }
            }, {
              key: "removeFormat",
              value: function removeFormat(index2, length, source) {
                var _this9 = this;
                var _overload13 = overload(index2, length, source);
                var _overload14 = _slicedToArray(_overload13, 4);
                index2 = _overload14[0];
                length = _overload14[1];
                source = _overload14[3];
                return modify.call(this, function() {
                  return _this9.editor.removeFormat(index2, length);
                }, source, index2);
              }
            }, {
              key: "scrollIntoView",
              value: function scrollIntoView2() {
                this.selection.scrollIntoView(this.scrollingContainer);
              }
            }, {
              key: "setContents",
              value: function setContents(delta) {
                var _this10 = this;
                var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                return modify.call(this, function() {
                  delta = new _quillDelta2.default(delta);
                  var length = _this10.getLength();
                  var deleted = _this10.editor.deleteText(0, length);
                  var applied = _this10.editor.applyDelta(delta);
                  var lastOp = applied.ops[applied.ops.length - 1];
                  if (lastOp != null && typeof lastOp.insert === "string" && lastOp.insert[lastOp.insert.length - 1] === "\n") {
                    _this10.editor.deleteText(_this10.getLength() - 1, 1);
                    applied.delete(1);
                  }
                  var ret = deleted.compose(applied);
                  return ret;
                }, source);
              }
            }, {
              key: "setSelection",
              value: function setSelection(index2, length, source) {
                if (index2 == null) {
                  this.selection.setRange(null, length || Quill3.sources.API);
                } else {
                  var _overload15 = overload(index2, length, source);
                  var _overload16 = _slicedToArray(_overload15, 4);
                  index2 = _overload16[0];
                  length = _overload16[1];
                  source = _overload16[3];
                  this.selection.setRange(new _selection.Range(index2, length), source);
                  if (source !== _emitter4.default.sources.SILENT) {
                    this.selection.scrollIntoView(this.scrollingContainer);
                  }
                }
              }
            }, {
              key: "setText",
              value: function setText(text) {
                var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                var delta = new _quillDelta2.default().insert(text);
                return this.setContents(delta, source);
              }
            }, {
              key: "update",
              value: function update() {
                var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
                var change = this.scroll.update(source);
                this.selection.update(source);
                return change;
              }
            }, {
              key: "updateContents",
              value: function updateContents(delta) {
                var _this11 = this;
                var source = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _emitter4.default.sources.API;
                return modify.call(this, function() {
                  delta = new _quillDelta2.default(delta);
                  return _this11.editor.applyDelta(delta, source);
                }, source, true);
              }
            }]);
            return Quill3;
          }();
          Quill2.DEFAULTS = {
            bounds: null,
            formats: null,
            modules: {},
            placeholder: "",
            readOnly: false,
            scrollingContainer: null,
            strict: true,
            theme: "default"
          };
          Quill2.events = _emitter4.default.events;
          Quill2.sources = _emitter4.default.sources;
          Quill2.version = "1.3.7";
          Quill2.imports = {
            "delta": _quillDelta2.default,
            "parchment": _parchment2.default,
            "core/module": _module2.default,
            "core/theme": _theme2.default
          };
          function expandConfig(container, userConfig) {
            userConfig = (0, _extend2.default)(true, {
              container,
              modules: {
                clipboard: true,
                keyboard: true,
                history: true
              }
            }, userConfig);
            if (!userConfig.theme || userConfig.theme === Quill2.DEFAULTS.theme) {
              userConfig.theme = _theme2.default;
            } else {
              userConfig.theme = Quill2.import("themes/" + userConfig.theme);
              if (userConfig.theme == null) {
                throw new Error("Invalid theme " + userConfig.theme + ". Did you register it?");
              }
            }
            var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);
            [themeConfig, userConfig].forEach(function(config2) {
              config2.modules = config2.modules || {};
              Object.keys(config2.modules).forEach(function(module4) {
                if (config2.modules[module4] === true) {
                  config2.modules[module4] = {};
                }
              });
            });
            var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));
            var moduleConfig = moduleNames.reduce(function(config2, name2) {
              var moduleClass = Quill2.import("modules/" + name2);
              if (moduleClass == null) {
                debug.error("Cannot load " + name2 + " module. Are you sure you registered it?");
              } else {
                config2[name2] = moduleClass.DEFAULTS || {};
              }
              return config2;
            }, {});
            if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {
              userConfig.modules.toolbar = {
                container: userConfig.modules.toolbar
              };
            }
            userConfig = (0, _extend2.default)(true, {}, Quill2.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);
            ["bounds", "container", "scrollingContainer"].forEach(function(key) {
              if (typeof userConfig[key] === "string") {
                userConfig[key] = document.querySelector(userConfig[key]);
              }
            });
            userConfig.modules = Object.keys(userConfig.modules).reduce(function(config2, name2) {
              if (userConfig.modules[name2]) {
                config2[name2] = userConfig.modules[name2];
              }
              return config2;
            }, {});
            return userConfig;
          }
          function modify(modifier, source, index2, shift2) {
            if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {
              return new _quillDelta2.default();
            }
            var range = index2 == null ? null : this.getSelection();
            var oldDelta = this.editor.delta;
            var change = modifier();
            if (range != null) {
              if (index2 === true)
                index2 = range.index;
              if (shift2 == null) {
                range = shiftRange(range, change, source);
              } else if (shift2 !== 0) {
                range = shiftRange(range, index2, shift2, source);
              }
              this.setSelection(range, _emitter4.default.sources.SILENT);
            }
            if (change.length() > 0) {
              var _emitter;
              var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];
              (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
              if (source !== _emitter4.default.sources.SILENT) {
                var _emitter2;
                (_emitter2 = this.emitter).emit.apply(_emitter2, args);
              }
            }
            return change;
          }
          function overload(index2, length, name2, value2, source) {
            var formats = {};
            if (typeof index2.index === "number" && typeof index2.length === "number") {
              if (typeof length !== "number") {
                source = value2, value2 = name2, name2 = length, length = index2.length, index2 = index2.index;
              } else {
                length = index2.length, index2 = index2.index;
              }
            } else if (typeof length !== "number") {
              source = value2, value2 = name2, name2 = length, length = 0;
            }
            if ((typeof name2 === "undefined" ? "undefined" : _typeof2(name2)) === "object") {
              formats = name2;
              source = value2;
            } else if (typeof name2 === "string") {
              if (value2 != null) {
                formats[name2] = value2;
              } else {
                source = name2;
              }
            }
            source = source || _emitter4.default.sources.API;
            return [index2, length, formats, source];
          }
          function shiftRange(range, index2, length, source) {
            if (range == null)
              return null;
            var start = void 0, end = void 0;
            if (index2 instanceof _quillDelta2.default) {
              var _map = [range.index, range.index + range.length].map(function(pos) {
                return index2.transformPosition(pos, source !== _emitter4.default.sources.USER);
              });
              var _map2 = _slicedToArray(_map, 2);
              start = _map2[0];
              end = _map2[1];
            } else {
              var _map3 = [range.index, range.index + range.length].map(function(pos) {
                if (pos < index2 || pos === index2 && source === _emitter4.default.sources.USER)
                  return pos;
                if (length >= 0) {
                  return pos + length;
                } else {
                  return Math.max(index2, pos + length);
                }
              });
              var _map4 = _slicedToArray(_map3, 2);
              start = _map4[0];
              end = _map4[1];
            }
            return new _selection.Range(start, end - start);
          }
          exports3.expandConfig = expandConfig;
          exports3.overload = overload;
          exports3.default = Quill2;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Inline = function(_Parchment$Inline) {
            _inherits(Inline2, _Parchment$Inline);
            function Inline2() {
              _classCallCheck(this, Inline2);
              return _possibleConstructorReturn(this, (Inline2.__proto__ || Object.getPrototypeOf(Inline2)).apply(this, arguments));
            }
            _createClass(Inline2, [{
              key: "formatAt",
              value: function formatAt(index2, length, name2, value2) {
                if (Inline2.compare(this.statics.blotName, name2) < 0 && _parchment2.default.query(name2, _parchment2.default.Scope.BLOT)) {
                  var blot = this.isolate(index2, length);
                  if (value2) {
                    blot.wrap(name2, value2);
                  }
                } else {
                  _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "formatAt", this).call(this, index2, length, name2, value2);
                }
              }
            }, {
              key: "optimize",
              value: function optimize(context) {
                _get(Inline2.prototype.__proto__ || Object.getPrototypeOf(Inline2.prototype), "optimize", this).call(this, context);
                if (this.parent instanceof Inline2 && Inline2.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {
                  var parent = this.parent.isolate(this.offset(), this.length());
                  this.moveChildren(parent);
                  parent.wrap(this);
                }
              }
            }], [{
              key: "compare",
              value: function compare2(self2, other) {
                var selfIndex = Inline2.order.indexOf(self2);
                var otherIndex = Inline2.order.indexOf(other);
                if (selfIndex >= 0 || otherIndex >= 0) {
                  return selfIndex - otherIndex;
                } else if (self2 === other) {
                  return 0;
                } else if (self2 < other) {
                  return -1;
                } else {
                  return 1;
                }
              }
            }]);
            return Inline2;
          }(_parchment2.default.Inline);
          Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];
          Inline.order = [
            "cursor",
            "inline",
            "underline",
            "strike",
            "italic",
            "bold",
            "script",
            "link",
            "code"
          ];
          exports3.default = Inline;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var TextBlot = function(_Parchment$Text) {
            _inherits(TextBlot2, _Parchment$Text);
            function TextBlot2() {
              _classCallCheck(this, TextBlot2);
              return _possibleConstructorReturn(this, (TextBlot2.__proto__ || Object.getPrototypeOf(TextBlot2)).apply(this, arguments));
            }
            return TextBlot2;
          }(_parchment2.default.Text);
          exports3.default = TextBlot;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _eventemitter = __webpack_require__(54);
          var _eventemitter2 = _interopRequireDefault(_eventemitter);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var debug = (0, _logger2.default)("quill:events");
          var EVENTS = ["selectionchange", "mousedown", "mouseup", "click"];
          EVENTS.forEach(function(eventName) {
            document.addEventListener(eventName, function() {
              for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
                args[_key] = arguments[_key];
              }
              [].slice.call(document.querySelectorAll(".ql-container")).forEach(function(node) {
                if (node.__quill && node.__quill.emitter) {
                  var _node$__quill$emitter;
                  (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);
                }
              });
            });
          });
          var Emitter = function(_EventEmitter) {
            _inherits(Emitter2, _EventEmitter);
            function Emitter2() {
              _classCallCheck(this, Emitter2);
              var _this = _possibleConstructorReturn(this, (Emitter2.__proto__ || Object.getPrototypeOf(Emitter2)).call(this));
              _this.listeners = {};
              _this.on("error", debug.error);
              return _this;
            }
            _createClass(Emitter2, [{
              key: "emit",
              value: function emit() {
                debug.log.apply(debug, arguments);
                _get(Emitter2.prototype.__proto__ || Object.getPrototypeOf(Emitter2.prototype), "emit", this).apply(this, arguments);
              }
            }, {
              key: "handleDOM",
              value: function handleDOM(event) {
                for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
                  args[_key2 - 1] = arguments[_key2];
                }
                (this.listeners[event.type] || []).forEach(function(_ref) {
                  var node = _ref.node, handler = _ref.handler;
                  if (event.target === node || node.contains(event.target)) {
                    handler.apply(void 0, [event].concat(args));
                  }
                });
              }
            }, {
              key: "listenDOM",
              value: function listenDOM(eventName, node, handler) {
                if (!this.listeners[eventName]) {
                  this.listeners[eventName] = [];
                }
                this.listeners[eventName].push({ node, handler });
              }
            }]);
            return Emitter2;
          }(_eventemitter2.default);
          Emitter.events = {
            EDITOR_CHANGE: "editor-change",
            SCROLL_BEFORE_UPDATE: "scroll-before-update",
            SCROLL_OPTIMIZE: "scroll-optimize",
            SCROLL_UPDATE: "scroll-update",
            SELECTION_CHANGE: "selection-change",
            TEXT_CHANGE: "text-change"
          };
          Emitter.sources = {
            API: "api",
            SILENT: "silent",
            USER: "user"
          };
          exports3.default = Emitter;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var Module = function Module2(quill2) {
            var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
            _classCallCheck(this, Module2);
            this.quill = quill2;
            this.options = options;
          };
          Module.DEFAULTS = {};
          exports3.default = Module;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var levels = ["error", "warn", "log", "info"];
          var level = "warn";
          function debug(method) {
            if (levels.indexOf(method) <= levels.indexOf(level)) {
              var _console;
              for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                args[_key - 1] = arguments[_key];
              }
              (_console = console)[method].apply(_console, args);
            }
          }
          function namespace(ns) {
            return levels.reduce(function(logger, method) {
              logger[method] = debug.bind(console, method, ns);
              return logger;
            }, {});
          }
          debug.level = namespace.level = function(newLevel) {
            level = newLevel;
          };
          exports3.default = namespace;
        },
        function(module3, exports3, __webpack_require__) {
          var pSlice = Array.prototype.slice;
          var objectKeys = __webpack_require__(52);
          var isArguments = __webpack_require__(53);
          var deepEqual = module3.exports = function(actual, expected, opts) {
            if (!opts)
              opts = {};
            if (actual === expected) {
              return true;
            } else if (actual instanceof Date && expected instanceof Date) {
              return actual.getTime() === expected.getTime();
            } else if (!actual || !expected || typeof actual != "object" && typeof expected != "object") {
              return opts.strict ? actual === expected : actual == expected;
            } else {
              return objEquiv(actual, expected, opts);
            }
          };
          function isUndefinedOrNull(value2) {
            return value2 === null || value2 === void 0;
          }
          function isBuffer2(x) {
            if (!x || typeof x !== "object" || typeof x.length !== "number")
              return false;
            if (typeof x.copy !== "function" || typeof x.slice !== "function") {
              return false;
            }
            if (x.length > 0 && typeof x[0] !== "number")
              return false;
            return true;
          }
          function objEquiv(a, b, opts) {
            var i2, key;
            if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
              return false;
            if (a.prototype !== b.prototype)
              return false;
            if (isArguments(a)) {
              if (!isArguments(b)) {
                return false;
              }
              a = pSlice.call(a);
              b = pSlice.call(b);
              return deepEqual(a, b, opts);
            }
            if (isBuffer2(a)) {
              if (!isBuffer2(b)) {
                return false;
              }
              if (a.length !== b.length)
                return false;
              for (i2 = 0; i2 < a.length; i2++) {
                if (a[i2] !== b[i2])
                  return false;
              }
              return true;
            }
            try {
              var ka = objectKeys(a), kb = objectKeys(b);
            } catch (e) {
              return false;
            }
            if (ka.length != kb.length)
              return false;
            ka.sort();
            kb.sort();
            for (i2 = ka.length - 1; i2 >= 0; i2--) {
              if (ka[i2] != kb[i2])
                return false;
            }
            for (i2 = ka.length - 1; i2 >= 0; i2--) {
              key = ka[i2];
              if (!deepEqual(a[key], b[key], opts))
                return false;
            }
            return typeof a === typeof b;
          }
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          var Registry = __webpack_require__(1);
          var Attributor = function() {
            function Attributor2(attrName, keyName2, options) {
              if (options === void 0) {
                options = {};
              }
              this.attrName = attrName;
              this.keyName = keyName2;
              var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;
              if (options.scope != null) {
                this.scope = options.scope & Registry.Scope.LEVEL | attributeBit;
              } else {
                this.scope = Registry.Scope.ATTRIBUTE;
              }
              if (options.whitelist != null)
                this.whitelist = options.whitelist;
            }
            Attributor2.keys = function(node) {
              return [].map.call(node.attributes, function(item) {
                return item.name;
              });
            };
            Attributor2.prototype.add = function(node, value2) {
              if (!this.canAdd(node, value2))
                return false;
              node.setAttribute(this.keyName, value2);
              return true;
            };
            Attributor2.prototype.canAdd = function(node, value2) {
              var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));
              if (match == null)
                return false;
              if (this.whitelist == null)
                return true;
              if (typeof value2 === "string") {
                return this.whitelist.indexOf(value2.replace(/["']/g, "")) > -1;
              } else {
                return this.whitelist.indexOf(value2) > -1;
              }
            };
            Attributor2.prototype.remove = function(node) {
              node.removeAttribute(this.keyName);
            };
            Attributor2.prototype.value = function(node) {
              var value2 = node.getAttribute(this.keyName);
              if (this.canAdd(node, value2) && value2) {
                return value2;
              }
              return "";
            };
            return Attributor2;
          }();
          exports3.default = Attributor;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.Code = void 0;
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Code = function(_Inline) {
            _inherits(Code2, _Inline);
            function Code2() {
              _classCallCheck(this, Code2);
              return _possibleConstructorReturn(this, (Code2.__proto__ || Object.getPrototypeOf(Code2)).apply(this, arguments));
            }
            return Code2;
          }(_inline2.default);
          Code.blotName = "code";
          Code.tagName = "CODE";
          var CodeBlock = function(_Block) {
            _inherits(CodeBlock2, _Block);
            function CodeBlock2() {
              _classCallCheck(this, CodeBlock2);
              return _possibleConstructorReturn(this, (CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2)).apply(this, arguments));
            }
            _createClass(CodeBlock2, [{
              key: "delta",
              value: function delta() {
                var _this3 = this;
                var text = this.domNode.textContent;
                if (text.endsWith("\n")) {
                  text = text.slice(0, -1);
                }
                return text.split("\n").reduce(function(delta2, frag) {
                  return delta2.insert(frag).insert("\n", _this3.formats());
                }, new _quillDelta2.default());
              }
            }, {
              key: "format",
              value: function format(name2, value2) {
                if (name2 === this.statics.blotName && value2)
                  return;
                var _descendant = this.descendant(_text2.default, this.length() - 1), _descendant2 = _slicedToArray(_descendant, 1), text = _descendant2[0];
                if (text != null) {
                  text.deleteAt(text.length() - 1, 1);
                }
                _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "format", this).call(this, name2, value2);
              }
            }, {
              key: "formatAt",
              value: function formatAt(index2, length, name2, value2) {
                if (length === 0)
                  return;
                if (_parchment2.default.query(name2, _parchment2.default.Scope.BLOCK) == null || name2 === this.statics.blotName && value2 === this.statics.formats(this.domNode)) {
                  return;
                }
                var nextNewline = this.newlineIndex(index2);
                if (nextNewline < 0 || nextNewline >= index2 + length)
                  return;
                var prevNewline = this.newlineIndex(index2, true) + 1;
                var isolateLength = nextNewline - prevNewline + 1;
                var blot = this.isolate(prevNewline, isolateLength);
                var next = blot.next;
                blot.format(name2, value2);
                if (next instanceof CodeBlock2) {
                  next.formatAt(0, index2 - prevNewline + length - isolateLength, name2, value2);
                }
              }
            }, {
              key: "insertAt",
              value: function insertAt(index2, value2, def) {
                if (def != null)
                  return;
                var _descendant3 = this.descendant(_text2.default, index2), _descendant4 = _slicedToArray(_descendant3, 2), text = _descendant4[0], offset = _descendant4[1];
                text.insertAt(offset, value2);
              }
            }, {
              key: "length",
              value: function length() {
                var length2 = this.domNode.textContent.length;
                if (!this.domNode.textContent.endsWith("\n")) {
                  return length2 + 1;
                }
                return length2;
              }
            }, {
              key: "newlineIndex",
              value: function newlineIndex(searchIndex) {
                var reverse = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                if (!reverse) {
                  var offset = this.domNode.textContent.slice(searchIndex).indexOf("\n");
                  return offset > -1 ? searchIndex + offset : -1;
                } else {
                  return this.domNode.textContent.slice(0, searchIndex).lastIndexOf("\n");
                }
              }
            }, {
              key: "optimize",
              value: function optimize(context) {
                if (!this.domNode.textContent.endsWith("\n")) {
                  this.appendChild(_parchment2.default.create("text", "\n"));
                }
                _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "optimize", this).call(this, context);
                var next = this.next;
                if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {
                  next.optimize(context);
                  next.moveChildren(this);
                  next.remove();
                }
              }
            }, {
              key: "replace",
              value: function replace(target) {
                _get(CodeBlock2.prototype.__proto__ || Object.getPrototypeOf(CodeBlock2.prototype), "replace", this).call(this, target);
                [].slice.call(this.domNode.querySelectorAll("*")).forEach(function(node) {
                  var blot = _parchment2.default.find(node);
                  if (blot == null) {
                    node.parentNode.removeChild(node);
                  } else if (blot instanceof _parchment2.default.Embed) {
                    blot.remove();
                  } else {
                    blot.unwrap();
                  }
                });
              }
            }], [{
              key: "create",
              value: function create(value2) {
                var domNode = _get(CodeBlock2.__proto__ || Object.getPrototypeOf(CodeBlock2), "create", this).call(this, value2);
                domNode.setAttribute("spellcheck", false);
                return domNode;
              }
            }, {
              key: "formats",
              value: function formats() {
                return true;
              }
            }]);
            return CodeBlock2;
          }(_block2.default);
          CodeBlock.blotName = "code-block";
          CodeBlock.tagName = "PRE";
          CodeBlock.TAB = "  ";
          exports3.Code = Code;
          exports3.default = CodeBlock;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
          } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
          };
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _op = __webpack_require__(20);
          var _op2 = _interopRequireDefault(_op);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _code = __webpack_require__(13);
          var _code2 = _interopRequireDefault(_code);
          var _cursor = __webpack_require__(24);
          var _cursor2 = _interopRequireDefault(_cursor);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          var _break = __webpack_require__(16);
          var _break2 = _interopRequireDefault(_break);
          var _clone = __webpack_require__(21);
          var _clone2 = _interopRequireDefault(_clone);
          var _deepEqual = __webpack_require__(11);
          var _deepEqual2 = _interopRequireDefault(_deepEqual);
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var ASCII = /^[ -~]*$/;
          var Editor = function() {
            function Editor2(scroll) {
              _classCallCheck(this, Editor2);
              this.scroll = scroll;
              this.delta = this.getDelta();
            }
            _createClass(Editor2, [{
              key: "applyDelta",
              value: function applyDelta(delta) {
                var _this = this;
                var consumeNextNewline = false;
                this.scroll.update();
                var scrollLength = this.scroll.length();
                this.scroll.batchStart();
                delta = normalizeDelta(delta);
                delta.reduce(function(index2, op) {
                  var length = op.retain || op.delete || op.insert.length || 1;
                  var attributes = op.attributes || {};
                  if (op.insert != null) {
                    if (typeof op.insert === "string") {
                      var text = op.insert;
                      if (text.endsWith("\n") && consumeNextNewline) {
                        consumeNextNewline = false;
                        text = text.slice(0, -1);
                      }
                      if (index2 >= scrollLength && !text.endsWith("\n")) {
                        consumeNextNewline = true;
                      }
                      _this.scroll.insertAt(index2, text);
                      var _scroll$line = _this.scroll.line(index2), _scroll$line2 = _slicedToArray(_scroll$line, 2), line = _scroll$line2[0], offset = _scroll$line2[1];
                      var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));
                      if (line instanceof _block2.default) {
                        var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), _line$descendant2 = _slicedToArray(_line$descendant, 1), leaf = _line$descendant2[0];
                        formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));
                      }
                      attributes = _op2.default.attributes.diff(formats, attributes) || {};
                    } else if (_typeof2(op.insert) === "object") {
                      var key = Object.keys(op.insert)[0];
                      if (key == null)
                        return index2;
                      _this.scroll.insertAt(index2, key, op.insert[key]);
                    }
                    scrollLength += length;
                  }
                  Object.keys(attributes).forEach(function(name2) {
                    _this.scroll.formatAt(index2, length, name2, attributes[name2]);
                  });
                  return index2 + length;
                }, 0);
                delta.reduce(function(index2, op) {
                  if (typeof op.delete === "number") {
                    _this.scroll.deleteAt(index2, op.delete);
                    return index2;
                  }
                  return index2 + (op.retain || op.insert.length || 1);
                }, 0);
                this.scroll.batchEnd();
                return this.update(delta);
              }
            }, {
              key: "deleteText",
              value: function deleteText(index2, length) {
                this.scroll.deleteAt(index2, length);
                return this.update(new _quillDelta2.default().retain(index2).delete(length));
              }
            }, {
              key: "formatLine",
              value: function formatLine(index2, length) {
                var _this2 = this;
                var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                this.scroll.update();
                Object.keys(formats).forEach(function(format) {
                  if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format])
                    return;
                  var lines = _this2.scroll.lines(index2, Math.max(length, 1));
                  var lengthRemaining = length;
                  lines.forEach(function(line) {
                    var lineLength = line.length();
                    if (!(line instanceof _code2.default)) {
                      line.format(format, formats[format]);
                    } else {
                      var codeIndex = index2 - line.offset(_this2.scroll);
                      var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;
                      line.formatAt(codeIndex, codeLength, format, formats[format]);
                    }
                    lengthRemaining -= lineLength;
                  });
                });
                this.scroll.optimize();
                return this.update(new _quillDelta2.default().retain(index2).retain(length, (0, _clone2.default)(formats)));
              }
            }, {
              key: "formatText",
              value: function formatText(index2, length) {
                var _this3 = this;
                var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                Object.keys(formats).forEach(function(format) {
                  _this3.scroll.formatAt(index2, length, format, formats[format]);
                });
                return this.update(new _quillDelta2.default().retain(index2).retain(length, (0, _clone2.default)(formats)));
              }
            }, {
              key: "getContents",
              value: function getContents(index2, length) {
                return this.delta.slice(index2, index2 + length);
              }
            }, {
              key: "getDelta",
              value: function getDelta() {
                return this.scroll.lines().reduce(function(delta, line) {
                  return delta.concat(line.delta());
                }, new _quillDelta2.default());
              }
            }, {
              key: "getFormat",
              value: function getFormat(index2) {
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                var lines = [], leaves = [];
                if (length === 0) {
                  this.scroll.path(index2).forEach(function(path) {
                    var _path = _slicedToArray(path, 1), blot = _path[0];
                    if (blot instanceof _block2.default) {
                      lines.push(blot);
                    } else if (blot instanceof _parchment2.default.Leaf) {
                      leaves.push(blot);
                    }
                  });
                } else {
                  lines = this.scroll.lines(index2, length);
                  leaves = this.scroll.descendants(_parchment2.default.Leaf, index2, length);
                }
                var formatsArr = [lines, leaves].map(function(blots) {
                  if (blots.length === 0)
                    return {};
                  var formats = (0, _block.bubbleFormats)(blots.shift());
                  while (Object.keys(formats).length > 0) {
                    var blot = blots.shift();
                    if (blot == null)
                      return formats;
                    formats = combineFormats((0, _block.bubbleFormats)(blot), formats);
                  }
                  return formats;
                });
                return _extend2.default.apply(_extend2.default, formatsArr);
              }
            }, {
              key: "getText",
              value: function getText(index2, length) {
                return this.getContents(index2, length).filter(function(op) {
                  return typeof op.insert === "string";
                }).map(function(op) {
                  return op.insert;
                }).join("");
              }
            }, {
              key: "insertEmbed",
              value: function insertEmbed(index2, embed, value2) {
                this.scroll.insertAt(index2, embed, value2);
                return this.update(new _quillDelta2.default().retain(index2).insert(_defineProperty2({}, embed, value2)));
              }
            }, {
              key: "insertText",
              value: function insertText(index2, text) {
                var _this4 = this;
                var formats = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                text = text.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
                this.scroll.insertAt(index2, text);
                Object.keys(formats).forEach(function(format) {
                  _this4.scroll.formatAt(index2, text.length, format, formats[format]);
                });
                return this.update(new _quillDelta2.default().retain(index2).insert(text, (0, _clone2.default)(formats)));
              }
            }, {
              key: "isBlank",
              value: function isBlank() {
                if (this.scroll.children.length == 0)
                  return true;
                if (this.scroll.children.length > 1)
                  return false;
                var block = this.scroll.children.head;
                if (block.statics.blotName !== _block2.default.blotName)
                  return false;
                if (block.children.length > 1)
                  return false;
                return block.children.head instanceof _break2.default;
              }
            }, {
              key: "removeFormat",
              value: function removeFormat(index2, length) {
                var text = this.getText(index2, length);
                var _scroll$line3 = this.scroll.line(index2 + length), _scroll$line4 = _slicedToArray(_scroll$line3, 2), line = _scroll$line4[0], offset = _scroll$line4[1];
                var suffixLength = 0, suffix = new _quillDelta2.default();
                if (line != null) {
                  if (!(line instanceof _code2.default)) {
                    suffixLength = line.length() - offset;
                  } else {
                    suffixLength = line.newlineIndex(offset) - offset + 1;
                  }
                  suffix = line.delta().slice(offset, offset + suffixLength - 1).insert("\n");
                }
                var contents = this.getContents(index2, length + suffixLength);
                var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));
                var delta = new _quillDelta2.default().retain(index2).concat(diff);
                return this.applyDelta(delta);
              }
            }, {
              key: "update",
              value: function update(change) {
                var mutations = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
                var cursorIndex = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
                var oldDelta = this.delta;
                if (mutations.length === 1 && mutations[0].type === "characterData" && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {
                  var textBlot = _parchment2.default.find(mutations[0].target);
                  var formats = (0, _block.bubbleFormats)(textBlot);
                  var index2 = textBlot.offset(this.scroll);
                  var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, "");
                  var oldText = new _quillDelta2.default().insert(oldValue);
                  var newText = new _quillDelta2.default().insert(textBlot.value());
                  var diffDelta = new _quillDelta2.default().retain(index2).concat(oldText.diff(newText, cursorIndex));
                  change = diffDelta.reduce(function(delta, op) {
                    if (op.insert) {
                      return delta.insert(op.insert, formats);
                    } else {
                      return delta.push(op);
                    }
                  }, new _quillDelta2.default());
                  this.delta = oldDelta.compose(change);
                } else {
                  this.delta = this.getDelta();
                  if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {
                    change = oldDelta.diff(this.delta, cursorIndex);
                  }
                }
                return change;
              }
            }]);
            return Editor2;
          }();
          function combineFormats(formats, combined) {
            return Object.keys(combined).reduce(function(merged, name2) {
              if (formats[name2] == null)
                return merged;
              if (combined[name2] === formats[name2]) {
                merged[name2] = combined[name2];
              } else if (Array.isArray(combined[name2])) {
                if (combined[name2].indexOf(formats[name2]) < 0) {
                  merged[name2] = combined[name2].concat([formats[name2]]);
                }
              } else {
                merged[name2] = [combined[name2], formats[name2]];
              }
              return merged;
            }, {});
          }
          function normalizeDelta(delta) {
            return delta.reduce(function(delta2, op) {
              if (op.insert === 1) {
                var attributes = (0, _clone2.default)(op.attributes);
                delete attributes["image"];
                return delta2.insert({ image: op.attributes.image }, attributes);
              }
              if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {
                op = (0, _clone2.default)(op);
                if (op.attributes.list) {
                  op.attributes.list = "ordered";
                } else {
                  op.attributes.list = "bullet";
                  delete op.attributes.bullet;
                }
              }
              if (typeof op.insert === "string") {
                var text = op.insert.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
                return delta2.insert(text, op.attributes);
              }
              return delta2.push(op);
            }, new _quillDelta2.default());
          }
          exports3.default = Editor;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.Range = void 0;
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _clone = __webpack_require__(21);
          var _clone2 = _interopRequireDefault(_clone);
          var _deepEqual = __webpack_require__(11);
          var _deepEqual2 = _interopRequireDefault(_deepEqual);
          var _emitter3 = __webpack_require__(8);
          var _emitter4 = _interopRequireDefault(_emitter3);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _toConsumableArray(arr) {
            if (Array.isArray(arr)) {
              for (var i2 = 0, arr2 = Array(arr.length); i2 < arr.length; i2++) {
                arr2[i2] = arr[i2];
              }
              return arr2;
            } else {
              return Array.from(arr);
            }
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var debug = (0, _logger2.default)("quill:selection");
          var Range2 = function Range3(index2) {
            var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
            _classCallCheck(this, Range3);
            this.index = index2;
            this.length = length;
          };
          var Selection = function() {
            function Selection2(scroll, emitter2) {
              var _this = this;
              _classCallCheck(this, Selection2);
              this.emitter = emitter2;
              this.scroll = scroll;
              this.composing = false;
              this.mouseDown = false;
              this.root = this.scroll.domNode;
              this.cursor = _parchment2.default.create("cursor", this);
              this.lastRange = this.savedRange = new Range2(0, 0);
              this.handleComposition();
              this.handleDragging();
              this.emitter.listenDOM("selectionchange", document, function() {
                if (!_this.mouseDown) {
                  setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);
                }
              });
              this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function(type, delta) {
                if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {
                  _this.update(_emitter4.default.sources.SILENT);
                }
              });
              this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function() {
                if (!_this.hasFocus())
                  return;
                var native = _this.getNativeRange();
                if (native == null)
                  return;
                if (native.start.node === _this.cursor.textNode)
                  return;
                _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function() {
                  try {
                    _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);
                  } catch (ignored) {
                  }
                });
              });
              this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function(mutations, context) {
                if (context.range) {
                  var _context$range = context.range, startNode = _context$range.startNode, startOffset = _context$range.startOffset, endNode = _context$range.endNode, endOffset = _context$range.endOffset;
                  _this.setNativeRange(startNode, startOffset, endNode, endOffset);
                }
              });
              this.update(_emitter4.default.sources.SILENT);
            }
            _createClass(Selection2, [{
              key: "handleComposition",
              value: function handleComposition() {
                var _this2 = this;
                this.root.addEventListener("compositionstart", function() {
                  _this2.composing = true;
                });
                this.root.addEventListener("compositionend", function() {
                  _this2.composing = false;
                  if (_this2.cursor.parent) {
                    var range = _this2.cursor.restore();
                    if (!range)
                      return;
                    setTimeout(function() {
                      _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);
                    }, 1);
                  }
                });
              }
            }, {
              key: "handleDragging",
              value: function handleDragging() {
                var _this3 = this;
                this.emitter.listenDOM("mousedown", document.body, function() {
                  _this3.mouseDown = true;
                });
                this.emitter.listenDOM("mouseup", document.body, function() {
                  _this3.mouseDown = false;
                  _this3.update(_emitter4.default.sources.USER);
                });
              }
            }, {
              key: "focus",
              value: function focus() {
                if (this.hasFocus())
                  return;
                this.root.focus();
                this.setRange(this.savedRange);
              }
            }, {
              key: "format",
              value: function format(_format, value2) {
                if (this.scroll.whitelist != null && !this.scroll.whitelist[_format])
                  return;
                this.scroll.update();
                var nativeRange = this.getNativeRange();
                if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK))
                  return;
                if (nativeRange.start.node !== this.cursor.textNode) {
                  var blot = _parchment2.default.find(nativeRange.start.node, false);
                  if (blot == null)
                    return;
                  if (blot instanceof _parchment2.default.Leaf) {
                    var after = blot.split(nativeRange.start.offset);
                    blot.parent.insertBefore(this.cursor, after);
                  } else {
                    blot.insertBefore(this.cursor, nativeRange.start.node);
                  }
                  this.cursor.attach();
                }
                this.cursor.format(_format, value2);
                this.scroll.optimize();
                this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);
                this.update();
              }
            }, {
              key: "getBounds",
              value: function getBounds(index2) {
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
                var scrollLength = this.scroll.length();
                index2 = Math.min(index2, scrollLength - 1);
                length = Math.min(index2 + length, scrollLength - 1) - index2;
                var node = void 0, _scroll$leaf = this.scroll.leaf(index2), _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), leaf = _scroll$leaf2[0], offset = _scroll$leaf2[1];
                if (leaf == null)
                  return null;
                var _leaf$position = leaf.position(offset, true);
                var _leaf$position2 = _slicedToArray(_leaf$position, 2);
                node = _leaf$position2[0];
                offset = _leaf$position2[1];
                var range = document.createRange();
                if (length > 0) {
                  range.setStart(node, offset);
                  var _scroll$leaf3 = this.scroll.leaf(index2 + length);
                  var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);
                  leaf = _scroll$leaf4[0];
                  offset = _scroll$leaf4[1];
                  if (leaf == null)
                    return null;
                  var _leaf$position3 = leaf.position(offset, true);
                  var _leaf$position4 = _slicedToArray(_leaf$position3, 2);
                  node = _leaf$position4[0];
                  offset = _leaf$position4[1];
                  range.setEnd(node, offset);
                  return range.getBoundingClientRect();
                } else {
                  var side = "left";
                  var rect = void 0;
                  if (node instanceof Text) {
                    if (offset < node.data.length) {
                      range.setStart(node, offset);
                      range.setEnd(node, offset + 1);
                    } else {
                      range.setStart(node, offset - 1);
                      range.setEnd(node, offset);
                      side = "right";
                    }
                    rect = range.getBoundingClientRect();
                  } else {
                    rect = leaf.domNode.getBoundingClientRect();
                    if (offset > 0)
                      side = "right";
                  }
                  return {
                    bottom: rect.top + rect.height,
                    height: rect.height,
                    left: rect[side],
                    right: rect[side],
                    top: rect.top,
                    width: 0
                  };
                }
              }
            }, {
              key: "getNativeRange",
              value: function getNativeRange() {
                var selection = document.getSelection();
                if (selection == null || selection.rangeCount <= 0)
                  return null;
                var nativeRange = selection.getRangeAt(0);
                if (nativeRange == null)
                  return null;
                var range = this.normalizeNative(nativeRange);
                debug.info("getNativeRange", range);
                return range;
              }
            }, {
              key: "getRange",
              value: function getRange() {
                var normalized = this.getNativeRange();
                if (normalized == null)
                  return [null, null];
                var range = this.normalizedToRange(normalized);
                return [range, normalized];
              }
            }, {
              key: "hasFocus",
              value: function hasFocus() {
                return document.activeElement === this.root;
              }
            }, {
              key: "normalizedToRange",
              value: function normalizedToRange(range) {
                var _this4 = this;
                var positions = [[range.start.node, range.start.offset]];
                if (!range.native.collapsed) {
                  positions.push([range.end.node, range.end.offset]);
                }
                var indexes = positions.map(function(position) {
                  var _position = _slicedToArray(position, 2), node = _position[0], offset = _position[1];
                  var blot = _parchment2.default.find(node, true);
                  var index2 = blot.offset(_this4.scroll);
                  if (offset === 0) {
                    return index2;
                  } else if (blot instanceof _parchment2.default.Container) {
                    return index2 + blot.length();
                  } else {
                    return index2 + blot.index(node, offset);
                  }
                });
                var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);
                var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));
                return new Range2(start, end - start);
              }
            }, {
              key: "normalizeNative",
              value: function normalizeNative(nativeRange) {
                if (!contains2(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains2(this.root, nativeRange.endContainer)) {
                  return null;
                }
                var range = {
                  start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },
                  end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },
                  native: nativeRange
                };
                [range.start, range.end].forEach(function(position) {
                  var node = position.node, offset = position.offset;
                  while (!(node instanceof Text) && node.childNodes.length > 0) {
                    if (node.childNodes.length > offset) {
                      node = node.childNodes[offset];
                      offset = 0;
                    } else if (node.childNodes.length === offset) {
                      node = node.lastChild;
                      offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;
                    } else {
                      break;
                    }
                  }
                  position.node = node, position.offset = offset;
                });
                return range;
              }
            }, {
              key: "rangeToNative",
              value: function rangeToNative(range) {
                var _this5 = this;
                var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];
                var args = [];
                var scrollLength = this.scroll.length();
                indexes.forEach(function(index2, i2) {
                  index2 = Math.min(scrollLength - 1, index2);
                  var node = void 0, _scroll$leaf5 = _this5.scroll.leaf(index2), _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), leaf = _scroll$leaf6[0], offset = _scroll$leaf6[1];
                  var _leaf$position5 = leaf.position(offset, i2 !== 0);
                  var _leaf$position6 = _slicedToArray(_leaf$position5, 2);
                  node = _leaf$position6[0];
                  offset = _leaf$position6[1];
                  args.push(node, offset);
                });
                if (args.length < 2) {
                  args = args.concat(args);
                }
                return args;
              }
            }, {
              key: "scrollIntoView",
              value: function scrollIntoView2(scrollingContainer) {
                var range = this.lastRange;
                if (range == null)
                  return;
                var bounds = this.getBounds(range.index, range.length);
                if (bounds == null)
                  return;
                var limit = this.scroll.length() - 1;
                var _scroll$line = this.scroll.line(Math.min(range.index, limit)), _scroll$line2 = _slicedToArray(_scroll$line, 1), first = _scroll$line2[0];
                var last = first;
                if (range.length > 0) {
                  var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));
                  var _scroll$line4 = _slicedToArray(_scroll$line3, 1);
                  last = _scroll$line4[0];
                }
                if (first == null || last == null)
                  return;
                var scrollBounds = scrollingContainer.getBoundingClientRect();
                if (bounds.top < scrollBounds.top) {
                  scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;
                } else if (bounds.bottom > scrollBounds.bottom) {
                  scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;
                }
              }
            }, {
              key: "setNativeRange",
              value: function setNativeRange(startNode, startOffset) {
                var endNode = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : startNode;
                var endOffset = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : startOffset;
                var force = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false;
                debug.info("setNativeRange", startNode, startOffset, endNode, endOffset);
                if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {
                  return;
                }
                var selection = document.getSelection();
                if (selection == null)
                  return;
                if (startNode != null) {
                  if (!this.hasFocus())
                    this.root.focus();
                  var native = (this.getNativeRange() || {}).native;
                  if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {
                    if (startNode.tagName == "BR") {
                      startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);
                      startNode = startNode.parentNode;
                    }
                    if (endNode.tagName == "BR") {
                      endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);
                      endNode = endNode.parentNode;
                    }
                    var range = document.createRange();
                    range.setStart(startNode, startOffset);
                    range.setEnd(endNode, endOffset);
                    selection.removeAllRanges();
                    selection.addRange(range);
                  }
                } else {
                  selection.removeAllRanges();
                  this.root.blur();
                  document.body.focus();
                }
              }
            }, {
              key: "setRange",
              value: function setRange(range) {
                var force = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _emitter4.default.sources.API;
                if (typeof force === "string") {
                  source = force;
                  force = false;
                }
                debug.info("setRange", range);
                if (range != null) {
                  var args = this.rangeToNative(range);
                  this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));
                } else {
                  this.setNativeRange(null);
                }
                this.update(source);
              }
            }, {
              key: "update",
              value: function update() {
                var source = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : _emitter4.default.sources.USER;
                var oldRange = this.lastRange;
                var _getRange = this.getRange(), _getRange2 = _slicedToArray(_getRange, 2), lastRange = _getRange2[0], nativeRange = _getRange2[1];
                this.lastRange = lastRange;
                if (this.lastRange != null) {
                  this.savedRange = this.lastRange;
                }
                if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {
                  var _emitter;
                  if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {
                    this.cursor.restore();
                  }
                  var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];
                  (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));
                  if (source !== _emitter4.default.sources.SILENT) {
                    var _emitter2;
                    (_emitter2 = this.emitter).emit.apply(_emitter2, args);
                  }
                }
              }
            }]);
            return Selection2;
          }();
          function contains2(parent, descendant) {
            try {
              descendant.parentNode;
            } catch (e) {
              return false;
            }
            if (descendant instanceof Text) {
              descendant = descendant.parentNode;
            }
            return parent.contains(descendant);
          }
          exports3.Range = Range2;
          exports3.default = Selection;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Break2 = function(_Parchment$Embed) {
            _inherits(Break3, _Parchment$Embed);
            function Break3() {
              _classCallCheck(this, Break3);
              return _possibleConstructorReturn(this, (Break3.__proto__ || Object.getPrototypeOf(Break3)).apply(this, arguments));
            }
            _createClass(Break3, [{
              key: "insertInto",
              value: function insertInto(parent, ref2) {
                if (parent.children.length === 0) {
                  _get(Break3.prototype.__proto__ || Object.getPrototypeOf(Break3.prototype), "insertInto", this).call(this, parent, ref2);
                } else {
                  this.remove();
                }
              }
            }, {
              key: "length",
              value: function length() {
                return 0;
              }
            }, {
              key: "value",
              value: function value2() {
                return "";
              }
            }], [{
              key: "value",
              value: function value2() {
                return void 0;
              }
            }]);
            return Break3;
          }(_parchment2.default.Embed);
          Break2.blotName = "break";
          Break2.tagName = "BR";
          exports3.default = Break2;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var linked_list_1 = __webpack_require__(44);
          var shadow_1 = __webpack_require__(30);
          var Registry = __webpack_require__(1);
          var ContainerBlot = function(_super) {
            __extends(ContainerBlot2, _super);
            function ContainerBlot2(domNode) {
              var _this = _super.call(this, domNode) || this;
              _this.build();
              return _this;
            }
            ContainerBlot2.prototype.appendChild = function(other) {
              this.insertBefore(other);
            };
            ContainerBlot2.prototype.attach = function() {
              _super.prototype.attach.call(this);
              this.children.forEach(function(child) {
                child.attach();
              });
            };
            ContainerBlot2.prototype.build = function() {
              var _this = this;
              this.children = new linked_list_1.default();
              [].slice.call(this.domNode.childNodes).reverse().forEach(function(node) {
                try {
                  var child = makeBlot(node);
                  _this.insertBefore(child, _this.children.head || void 0);
                } catch (err) {
                  if (err instanceof Registry.ParchmentError)
                    return;
                  else
                    throw err;
                }
              });
            };
            ContainerBlot2.prototype.deleteAt = function(index2, length) {
              if (index2 === 0 && length === this.length()) {
                return this.remove();
              }
              this.children.forEachAt(index2, length, function(child, offset, length2) {
                child.deleteAt(offset, length2);
              });
            };
            ContainerBlot2.prototype.descendant = function(criteria, index2) {
              var _a2 = this.children.find(index2), child = _a2[0], offset = _a2[1];
              if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
                return [child, offset];
              } else if (child instanceof ContainerBlot2) {
                return child.descendant(criteria, offset);
              } else {
                return [null, -1];
              }
            };
            ContainerBlot2.prototype.descendants = function(criteria, index2, length) {
              if (index2 === void 0) {
                index2 = 0;
              }
              if (length === void 0) {
                length = Number.MAX_VALUE;
              }
              var descendants = [];
              var lengthLeft = length;
              this.children.forEachAt(index2, length, function(child, index3, length2) {
                if (criteria.blotName == null && criteria(child) || criteria.blotName != null && child instanceof criteria) {
                  descendants.push(child);
                }
                if (child instanceof ContainerBlot2) {
                  descendants = descendants.concat(child.descendants(criteria, index3, lengthLeft));
                }
                lengthLeft -= length2;
              });
              return descendants;
            };
            ContainerBlot2.prototype.detach = function() {
              this.children.forEach(function(child) {
                child.detach();
              });
              _super.prototype.detach.call(this);
            };
            ContainerBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              this.children.forEachAt(index2, length, function(child, offset, length2) {
                child.formatAt(offset, length2, name2, value2);
              });
            };
            ContainerBlot2.prototype.insertAt = function(index2, value2, def) {
              var _a2 = this.children.find(index2), child = _a2[0], offset = _a2[1];
              if (child) {
                child.insertAt(offset, value2, def);
              } else {
                var blot = def == null ? Registry.create("text", value2) : Registry.create(value2, def);
                this.appendChild(blot);
              }
            };
            ContainerBlot2.prototype.insertBefore = function(childBlot, refBlot) {
              if (this.statics.allowedChildren != null && !this.statics.allowedChildren.some(function(child) {
                return childBlot instanceof child;
              })) {
                throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName);
              }
              childBlot.insertInto(this, refBlot);
            };
            ContainerBlot2.prototype.length = function() {
              return this.children.reduce(function(memo, child) {
                return memo + child.length();
              }, 0);
            };
            ContainerBlot2.prototype.moveChildren = function(targetParent, refNode) {
              this.children.forEach(function(child) {
                targetParent.insertBefore(child, refNode);
              });
            };
            ContainerBlot2.prototype.optimize = function(context) {
              _super.prototype.optimize.call(this, context);
              if (this.children.length === 0) {
                if (this.statics.defaultChild != null) {
                  var child = Registry.create(this.statics.defaultChild);
                  this.appendChild(child);
                  child.optimize(context);
                } else {
                  this.remove();
                }
              }
            };
            ContainerBlot2.prototype.path = function(index2, inclusive) {
              if (inclusive === void 0) {
                inclusive = false;
              }
              var _a2 = this.children.find(index2, inclusive), child = _a2[0], offset = _a2[1];
              var position = [[this, index2]];
              if (child instanceof ContainerBlot2) {
                return position.concat(child.path(offset, inclusive));
              } else if (child != null) {
                position.push([child, offset]);
              }
              return position;
            };
            ContainerBlot2.prototype.removeChild = function(child) {
              this.children.remove(child);
            };
            ContainerBlot2.prototype.replace = function(target) {
              if (target instanceof ContainerBlot2) {
                target.moveChildren(this);
              }
              _super.prototype.replace.call(this, target);
            };
            ContainerBlot2.prototype.split = function(index2, force) {
              if (force === void 0) {
                force = false;
              }
              if (!force) {
                if (index2 === 0)
                  return this;
                if (index2 === this.length())
                  return this.next;
              }
              var after = this.clone();
              this.parent.insertBefore(after, this.next);
              this.children.forEachAt(index2, this.length(), function(child, offset, length) {
                child = child.split(offset, force);
                after.appendChild(child);
              });
              return after;
            };
            ContainerBlot2.prototype.unwrap = function() {
              this.moveChildren(this.parent, this.next);
              this.remove();
            };
            ContainerBlot2.prototype.update = function(mutations, context) {
              var _this = this;
              var addedNodes = [];
              var removedNodes = [];
              mutations.forEach(function(mutation) {
                if (mutation.target === _this.domNode && mutation.type === "childList") {
                  addedNodes.push.apply(addedNodes, mutation.addedNodes);
                  removedNodes.push.apply(removedNodes, mutation.removedNodes);
                }
              });
              removedNodes.forEach(function(node) {
                if (node.parentNode != null && node.tagName !== "IFRAME" && document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
                  return;
                }
                var blot = Registry.find(node);
                if (blot == null)
                  return;
                if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {
                  blot.detach();
                }
              });
              addedNodes.filter(function(node) {
                return node.parentNode == _this.domNode;
              }).sort(function(a, b) {
                if (a === b)
                  return 0;
                if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {
                  return 1;
                }
                return -1;
              }).forEach(function(node) {
                var refBlot = null;
                if (node.nextSibling != null) {
                  refBlot = Registry.find(node.nextSibling);
                }
                var blot = makeBlot(node);
                if (blot.next != refBlot || blot.next == null) {
                  if (blot.parent != null) {
                    blot.parent.removeChild(_this);
                  }
                  _this.insertBefore(blot, refBlot || void 0);
                }
              });
            };
            return ContainerBlot2;
          }(shadow_1.default);
          function makeBlot(node) {
            var blot = Registry.find(node);
            if (blot == null) {
              try {
                blot = Registry.create(node);
              } catch (e) {
                blot = Registry.create(Registry.Scope.INLINE);
                [].slice.call(node.childNodes).forEach(function(child) {
                  blot.domNode.appendChild(child);
                });
                if (node.parentNode) {
                  node.parentNode.replaceChild(blot.domNode, node);
                }
                blot.attach();
              }
            }
            return blot;
          }
          exports3.default = ContainerBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var attributor_1 = __webpack_require__(12);
          var store_1 = __webpack_require__(31);
          var container_1 = __webpack_require__(17);
          var Registry = __webpack_require__(1);
          var FormatBlot = function(_super) {
            __extends(FormatBlot2, _super);
            function FormatBlot2(domNode) {
              var _this = _super.call(this, domNode) || this;
              _this.attributes = new store_1.default(_this.domNode);
              return _this;
            }
            FormatBlot2.formats = function(domNode) {
              if (typeof this.tagName === "string") {
                return true;
              } else if (Array.isArray(this.tagName)) {
                return domNode.tagName.toLowerCase();
              }
              return void 0;
            };
            FormatBlot2.prototype.format = function(name2, value2) {
              var format = Registry.query(name2);
              if (format instanceof attributor_1.default) {
                this.attributes.attribute(format, value2);
              } else if (value2) {
                if (format != null && (name2 !== this.statics.blotName || this.formats()[name2] !== value2)) {
                  this.replaceWith(name2, value2);
                }
              }
            };
            FormatBlot2.prototype.formats = function() {
              var formats = this.attributes.values();
              var format = this.statics.formats(this.domNode);
              if (format != null) {
                formats[this.statics.blotName] = format;
              }
              return formats;
            };
            FormatBlot2.prototype.replaceWith = function(name2, value2) {
              var replacement = _super.prototype.replaceWith.call(this, name2, value2);
              this.attributes.copy(replacement);
              return replacement;
            };
            FormatBlot2.prototype.update = function(mutations, context) {
              var _this = this;
              _super.prototype.update.call(this, mutations, context);
              if (mutations.some(function(mutation) {
                return mutation.target === _this.domNode && mutation.type === "attributes";
              })) {
                this.attributes.build();
              }
            };
            FormatBlot2.prototype.wrap = function(name2, value2) {
              var wrapper = _super.prototype.wrap.call(this, name2, value2);
              if (wrapper instanceof FormatBlot2 && wrapper.statics.scope === this.statics.scope) {
                this.attributes.move(wrapper);
              }
              return wrapper;
            };
            return FormatBlot2;
          }(container_1.default);
          exports3.default = FormatBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var shadow_1 = __webpack_require__(30);
          var Registry = __webpack_require__(1);
          var LeafBlot = function(_super) {
            __extends(LeafBlot2, _super);
            function LeafBlot2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            LeafBlot2.value = function(domNode) {
              return true;
            };
            LeafBlot2.prototype.index = function(node, offset) {
              if (this.domNode === node || this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {
                return Math.min(offset, 1);
              }
              return -1;
            };
            LeafBlot2.prototype.position = function(index2, inclusive) {
              var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);
              if (index2 > 0)
                offset += 1;
              return [this.parent.domNode, offset];
            };
            LeafBlot2.prototype.value = function() {
              var _a2;
              return _a2 = {}, _a2[this.statics.blotName] = this.statics.value(this.domNode) || true, _a2;
            };
            LeafBlot2.scope = Registry.Scope.INLINE_BLOT;
            return LeafBlot2;
          }(shadow_1.default);
          exports3.default = LeafBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var equal = __webpack_require__(11);
          var extend2 = __webpack_require__(3);
          var lib = {
            attributes: {
              compose: function(a, b, keepNull) {
                if (typeof a !== "object")
                  a = {};
                if (typeof b !== "object")
                  b = {};
                var attributes = extend2(true, {}, b);
                if (!keepNull) {
                  attributes = Object.keys(attributes).reduce(function(copy, key2) {
                    if (attributes[key2] != null) {
                      copy[key2] = attributes[key2];
                    }
                    return copy;
                  }, {});
                }
                for (var key in a) {
                  if (a[key] !== void 0 && b[key] === void 0) {
                    attributes[key] = a[key];
                  }
                }
                return Object.keys(attributes).length > 0 ? attributes : void 0;
              },
              diff: function(a, b) {
                if (typeof a !== "object")
                  a = {};
                if (typeof b !== "object")
                  b = {};
                var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function(attributes2, key) {
                  if (!equal(a[key], b[key])) {
                    attributes2[key] = b[key] === void 0 ? null : b[key];
                  }
                  return attributes2;
                }, {});
                return Object.keys(attributes).length > 0 ? attributes : void 0;
              },
              transform: function(a, b, priority) {
                if (typeof a !== "object")
                  return b;
                if (typeof b !== "object")
                  return void 0;
                if (!priority)
                  return b;
                var attributes = Object.keys(b).reduce(function(attributes2, key) {
                  if (a[key] === void 0)
                    attributes2[key] = b[key];
                  return attributes2;
                }, {});
                return Object.keys(attributes).length > 0 ? attributes : void 0;
              }
            },
            iterator: function(ops) {
              return new Iterator(ops);
            },
            length: function(op) {
              if (typeof op["delete"] === "number") {
                return op["delete"];
              } else if (typeof op.retain === "number") {
                return op.retain;
              } else {
                return typeof op.insert === "string" ? op.insert.length : 1;
              }
            }
          };
          function Iterator(ops) {
            this.ops = ops;
            this.index = 0;
            this.offset = 0;
          }
          Iterator.prototype.hasNext = function() {
            return this.peekLength() < Infinity;
          };
          Iterator.prototype.next = function(length) {
            if (!length)
              length = Infinity;
            var nextOp = this.ops[this.index];
            if (nextOp) {
              var offset = this.offset;
              var opLength = lib.length(nextOp);
              if (length >= opLength - offset) {
                length = opLength - offset;
                this.index += 1;
                this.offset = 0;
              } else {
                this.offset += length;
              }
              if (typeof nextOp["delete"] === "number") {
                return { "delete": length };
              } else {
                var retOp = {};
                if (nextOp.attributes) {
                  retOp.attributes = nextOp.attributes;
                }
                if (typeof nextOp.retain === "number") {
                  retOp.retain = length;
                } else if (typeof nextOp.insert === "string") {
                  retOp.insert = nextOp.insert.substr(offset, length);
                } else {
                  retOp.insert = nextOp.insert;
                }
                return retOp;
              }
            } else {
              return { retain: Infinity };
            }
          };
          Iterator.prototype.peek = function() {
            return this.ops[this.index];
          };
          Iterator.prototype.peekLength = function() {
            if (this.ops[this.index]) {
              return lib.length(this.ops[this.index]) - this.offset;
            } else {
              return Infinity;
            }
          };
          Iterator.prototype.peekType = function() {
            if (this.ops[this.index]) {
              if (typeof this.ops[this.index]["delete"] === "number") {
                return "delete";
              } else if (typeof this.ops[this.index].retain === "number") {
                return "retain";
              } else {
                return "insert";
              }
            }
            return "retain";
          };
          Iterator.prototype.rest = function() {
            if (!this.hasNext()) {
              return [];
            } else if (this.offset === 0) {
              return this.ops.slice(this.index);
            } else {
              var offset = this.offset;
              var index2 = this.index;
              var next = this.next();
              var rest2 = this.ops.slice(this.index);
              this.offset = offset;
              this.index = index2;
              return [next].concat(rest2);
            }
          };
          module3.exports = lib;
        },
        function(module3, exports3) {
          var clone2 = function() {
            function _instanceof(obj, type) {
              return type != null && obj instanceof type;
            }
            var nativeMap;
            try {
              nativeMap = Map;
            } catch (_) {
              nativeMap = function() {
              };
            }
            var nativeSet;
            try {
              nativeSet = Set;
            } catch (_) {
              nativeSet = function() {
              };
            }
            var nativePromise;
            try {
              nativePromise = Promise;
            } catch (_) {
              nativePromise = function() {
              };
            }
            function clone3(parent, circular, depth, prototype, includeNonEnumerable) {
              if (typeof circular === "object") {
                depth = circular.depth;
                prototype = circular.prototype;
                includeNonEnumerable = circular.includeNonEnumerable;
                circular = circular.circular;
              }
              var allParents = [];
              var allChildren = [];
              var useBuffer = typeof Buffer != "undefined";
              if (typeof circular == "undefined")
                circular = true;
              if (typeof depth == "undefined")
                depth = Infinity;
              function _clone(parent2, depth2) {
                if (parent2 === null)
                  return null;
                if (depth2 === 0)
                  return parent2;
                var child;
                var proto;
                if (typeof parent2 != "object") {
                  return parent2;
                }
                if (_instanceof(parent2, nativeMap)) {
                  child = new nativeMap();
                } else if (_instanceof(parent2, nativeSet)) {
                  child = new nativeSet();
                } else if (_instanceof(parent2, nativePromise)) {
                  child = new nativePromise(function(resolve, reject) {
                    parent2.then(function(value2) {
                      resolve(_clone(value2, depth2 - 1));
                    }, function(err) {
                      reject(_clone(err, depth2 - 1));
                    });
                  });
                } else if (clone3.__isArray(parent2)) {
                  child = [];
                } else if (clone3.__isRegExp(parent2)) {
                  child = new RegExp(parent2.source, __getRegExpFlags(parent2));
                  if (parent2.lastIndex)
                    child.lastIndex = parent2.lastIndex;
                } else if (clone3.__isDate(parent2)) {
                  child = new Date(parent2.getTime());
                } else if (useBuffer && Buffer.isBuffer(parent2)) {
                  if (Buffer.allocUnsafe) {
                    child = Buffer.allocUnsafe(parent2.length);
                  } else {
                    child = new Buffer(parent2.length);
                  }
                  parent2.copy(child);
                  return child;
                } else if (_instanceof(parent2, Error)) {
                  child = Object.create(parent2);
                } else {
                  if (typeof prototype == "undefined") {
                    proto = Object.getPrototypeOf(parent2);
                    child = Object.create(proto);
                  } else {
                    child = Object.create(prototype);
                    proto = prototype;
                  }
                }
                if (circular) {
                  var index2 = allParents.indexOf(parent2);
                  if (index2 != -1) {
                    return allChildren[index2];
                  }
                  allParents.push(parent2);
                  allChildren.push(child);
                }
                if (_instanceof(parent2, nativeMap)) {
                  parent2.forEach(function(value2, key) {
                    var keyChild = _clone(key, depth2 - 1);
                    var valueChild = _clone(value2, depth2 - 1);
                    child.set(keyChild, valueChild);
                  });
                }
                if (_instanceof(parent2, nativeSet)) {
                  parent2.forEach(function(value2) {
                    var entryChild = _clone(value2, depth2 - 1);
                    child.add(entryChild);
                  });
                }
                for (var i2 in parent2) {
                  var attrs;
                  if (proto) {
                    attrs = Object.getOwnPropertyDescriptor(proto, i2);
                  }
                  if (attrs && attrs.set == null) {
                    continue;
                  }
                  child[i2] = _clone(parent2[i2], depth2 - 1);
                }
                if (Object.getOwnPropertySymbols) {
                  var symbols2 = Object.getOwnPropertySymbols(parent2);
                  for (var i2 = 0; i2 < symbols2.length; i2++) {
                    var symbol = symbols2[i2];
                    var descriptor = Object.getOwnPropertyDescriptor(parent2, symbol);
                    if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {
                      continue;
                    }
                    child[symbol] = _clone(parent2[symbol], depth2 - 1);
                    if (!descriptor.enumerable) {
                      Object.defineProperty(child, symbol, {
                        enumerable: false
                      });
                    }
                  }
                }
                if (includeNonEnumerable) {
                  var allPropertyNames = Object.getOwnPropertyNames(parent2);
                  for (var i2 = 0; i2 < allPropertyNames.length; i2++) {
                    var propertyName2 = allPropertyNames[i2];
                    var descriptor = Object.getOwnPropertyDescriptor(parent2, propertyName2);
                    if (descriptor && descriptor.enumerable) {
                      continue;
                    }
                    child[propertyName2] = _clone(parent2[propertyName2], depth2 - 1);
                    Object.defineProperty(child, propertyName2, {
                      enumerable: false
                    });
                  }
                }
                return child;
              }
              return _clone(parent, depth);
            }
            clone3.clonePrototype = function clonePrototype(parent) {
              if (parent === null)
                return null;
              var c = function() {
              };
              c.prototype = parent;
              return new c();
            };
            function __objToStr(o) {
              return Object.prototype.toString.call(o);
            }
            clone3.__objToStr = __objToStr;
            function __isDate(o) {
              return typeof o === "object" && __objToStr(o) === "[object Date]";
            }
            clone3.__isDate = __isDate;
            function __isArray(o) {
              return typeof o === "object" && __objToStr(o) === "[object Array]";
            }
            clone3.__isArray = __isArray;
            function __isRegExp(o) {
              return typeof o === "object" && __objToStr(o) === "[object RegExp]";
            }
            clone3.__isRegExp = __isRegExp;
            function __getRegExpFlags(re) {
              var flags = "";
              if (re.global)
                flags += "g";
              if (re.ignoreCase)
                flags += "i";
              if (re.multiline)
                flags += "m";
              return flags;
            }
            clone3.__getRegExpFlags = __getRegExpFlags;
            return clone3;
          }();
          if (typeof module3 === "object" && module3.exports) {
            module3.exports = clone2;
          }
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _emitter = __webpack_require__(8);
          var _emitter2 = _interopRequireDefault(_emitter);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          var _break = __webpack_require__(16);
          var _break2 = _interopRequireDefault(_break);
          var _code = __webpack_require__(13);
          var _code2 = _interopRequireDefault(_code);
          var _container = __webpack_require__(25);
          var _container2 = _interopRequireDefault(_container);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          function isLine(blot) {
            return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;
          }
          var Scroll = function(_Parchment$Scroll) {
            _inherits(Scroll2, _Parchment$Scroll);
            function Scroll2(domNode, config2) {
              _classCallCheck(this, Scroll2);
              var _this = _possibleConstructorReturn(this, (Scroll2.__proto__ || Object.getPrototypeOf(Scroll2)).call(this, domNode));
              _this.emitter = config2.emitter;
              if (Array.isArray(config2.whitelist)) {
                _this.whitelist = config2.whitelist.reduce(function(whitelist, format) {
                  whitelist[format] = true;
                  return whitelist;
                }, {});
              }
              _this.domNode.addEventListener("DOMNodeInserted", function() {
              });
              _this.optimize();
              _this.enable();
              return _this;
            }
            _createClass(Scroll2, [{
              key: "batchStart",
              value: function batchStart() {
                this.batch = true;
              }
            }, {
              key: "batchEnd",
              value: function batchEnd() {
                this.batch = false;
                this.optimize();
              }
            }, {
              key: "deleteAt",
              value: function deleteAt(index2, length) {
                var _line = this.line(index2), _line2 = _slicedToArray(_line, 2), first = _line2[0], offset = _line2[1];
                var _line3 = this.line(index2 + length), _line4 = _slicedToArray(_line3, 1), last = _line4[0];
                _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "deleteAt", this).call(this, index2, length);
                if (last != null && first !== last && offset > 0) {
                  if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {
                    this.optimize();
                    return;
                  }
                  if (first instanceof _code2.default) {
                    var newlineIndex = first.newlineIndex(first.length(), true);
                    if (newlineIndex > -1) {
                      first = first.split(newlineIndex + 1);
                      if (first === last) {
                        this.optimize();
                        return;
                      }
                    }
                  } else if (last instanceof _code2.default) {
                    var _newlineIndex = last.newlineIndex(0);
                    if (_newlineIndex > -1) {
                      last.split(_newlineIndex + 1);
                    }
                  }
                  var ref2 = last.children.head instanceof _break2.default ? null : last.children.head;
                  first.moveChildren(last, ref2);
                  first.remove();
                }
                this.optimize();
              }
            }, {
              key: "enable",
              value: function enable() {
                var enabled = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : true;
                this.domNode.setAttribute("contenteditable", enabled);
              }
            }, {
              key: "formatAt",
              value: function formatAt(index2, length, format, value2) {
                if (this.whitelist != null && !this.whitelist[format])
                  return;
                _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "formatAt", this).call(this, index2, length, format, value2);
                this.optimize();
              }
            }, {
              key: "insertAt",
              value: function insertAt(index2, value2, def) {
                if (def != null && this.whitelist != null && !this.whitelist[value2])
                  return;
                if (index2 >= this.length()) {
                  if (def == null || _parchment2.default.query(value2, _parchment2.default.Scope.BLOCK) == null) {
                    var blot = _parchment2.default.create(this.statics.defaultChild);
                    this.appendChild(blot);
                    if (def == null && value2.endsWith("\n")) {
                      value2 = value2.slice(0, -1);
                    }
                    blot.insertAt(0, value2, def);
                  } else {
                    var embed = _parchment2.default.create(value2, def);
                    this.appendChild(embed);
                  }
                } else {
                  _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertAt", this).call(this, index2, value2, def);
                }
                this.optimize();
              }
            }, {
              key: "insertBefore",
              value: function insertBefore(blot, ref2) {
                if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {
                  var wrapper = _parchment2.default.create(this.statics.defaultChild);
                  wrapper.appendChild(blot);
                  blot = wrapper;
                }
                _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "insertBefore", this).call(this, blot, ref2);
              }
            }, {
              key: "leaf",
              value: function leaf(index2) {
                return this.path(index2).pop() || [null, -1];
              }
            }, {
              key: "line",
              value: function line(index2) {
                if (index2 === this.length()) {
                  return this.line(index2 - 1);
                }
                return this.descendant(isLine, index2);
              }
            }, {
              key: "lines",
              value: function lines() {
                var index2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
                var length = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Number.MAX_VALUE;
                var getLines = function getLines2(blot, index3, length2) {
                  var lines2 = [], lengthLeft = length2;
                  blot.children.forEachAt(index3, length2, function(child, index4, length3) {
                    if (isLine(child)) {
                      lines2.push(child);
                    } else if (child instanceof _parchment2.default.Container) {
                      lines2 = lines2.concat(getLines2(child, index4, lengthLeft));
                    }
                    lengthLeft -= length3;
                  });
                  return lines2;
                };
                return getLines(this, index2, length);
              }
            }, {
              key: "optimize",
              value: function optimize() {
                var mutations = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
                var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
                if (this.batch === true)
                  return;
                _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "optimize", this).call(this, mutations, context);
                if (mutations.length > 0) {
                  this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);
                }
              }
            }, {
              key: "path",
              value: function path(index2) {
                return _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "path", this).call(this, index2).slice(1);
              }
            }, {
              key: "update",
              value: function update(mutations) {
                if (this.batch === true)
                  return;
                var source = _emitter2.default.sources.USER;
                if (typeof mutations === "string") {
                  source = mutations;
                }
                if (!Array.isArray(mutations)) {
                  mutations = this.observer.takeRecords();
                }
                if (mutations.length > 0) {
                  this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);
                }
                _get(Scroll2.prototype.__proto__ || Object.getPrototypeOf(Scroll2.prototype), "update", this).call(this, mutations.concat([]));
                if (mutations.length > 0) {
                  this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);
                }
              }
            }]);
            return Scroll2;
          }(_parchment2.default.Scroll);
          Scroll.blotName = "scroll";
          Scroll.className = "ql-editor";
          Scroll.tagName = "DIV";
          Scroll.defaultChild = "block";
          Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];
          exports3.default = Scroll;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.SHORTKEY = exports3.default = void 0;
          var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
          } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
          };
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _clone = __webpack_require__(21);
          var _clone2 = _interopRequireDefault(_clone);
          var _deepEqual = __webpack_require__(11);
          var _deepEqual2 = _interopRequireDefault(_deepEqual);
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _op = __webpack_require__(20);
          var _op2 = _interopRequireDefault(_op);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var debug = (0, _logger2.default)("quill:keyboard");
          var SHORTKEY = /Mac/i.test(navigator.platform) ? "metaKey" : "ctrlKey";
          var Keyboard = function(_Module) {
            _inherits(Keyboard2, _Module);
            _createClass(Keyboard2, null, [{
              key: "match",
              value: function match(evt, binding) {
                binding = normalize(binding);
                if (["altKey", "ctrlKey", "metaKey", "shiftKey"].some(function(key) {
                  return !!binding[key] !== evt[key] && binding[key] !== null;
                })) {
                  return false;
                }
                return binding.key === (evt.which || evt.keyCode);
              }
            }]);
            function Keyboard2(quill2, options) {
              _classCallCheck(this, Keyboard2);
              var _this = _possibleConstructorReturn(this, (Keyboard2.__proto__ || Object.getPrototypeOf(Keyboard2)).call(this, quill2, options));
              _this.bindings = {};
              Object.keys(_this.options.bindings).forEach(function(name2) {
                if (name2 === "list autofill" && quill2.scroll.whitelist != null && !quill2.scroll.whitelist["list"]) {
                  return;
                }
                if (_this.options.bindings[name2]) {
                  _this.addBinding(_this.options.bindings[name2]);
                }
              });
              _this.addBinding({ key: Keyboard2.keys.ENTER, shiftKey: null }, handleEnter);
              _this.addBinding({ key: Keyboard2.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {
              });
              if (/Firefox/i.test(navigator.userAgent)) {
                _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true }, handleBackspace);
                _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true }, handleDelete);
              } else {
                _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);
                _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);
              }
              _this.addBinding({ key: Keyboard2.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);
              _this.addBinding({ key: Keyboard2.keys.DELETE }, { collapsed: false }, handleDeleteRange);
              _this.addBinding({ key: Keyboard2.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);
              _this.listen();
              return _this;
            }
            _createClass(Keyboard2, [{
              key: "addBinding",
              value: function addBinding(key) {
                var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
                var handler = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
                var binding = normalize(key);
                if (binding == null || binding.key == null) {
                  return debug.warn("Attempted to add invalid keyboard binding", binding);
                }
                if (typeof context === "function") {
                  context = { handler: context };
                }
                if (typeof handler === "function") {
                  handler = { handler };
                }
                binding = (0, _extend2.default)(binding, context, handler);
                this.bindings[binding.key] = this.bindings[binding.key] || [];
                this.bindings[binding.key].push(binding);
              }
            }, {
              key: "listen",
              value: function listen() {
                var _this2 = this;
                this.quill.root.addEventListener("keydown", function(evt) {
                  if (evt.defaultPrevented)
                    return;
                  var which = evt.which || evt.keyCode;
                  var bindings = (_this2.bindings[which] || []).filter(function(binding) {
                    return Keyboard2.match(evt, binding);
                  });
                  if (bindings.length === 0)
                    return;
                  var range = _this2.quill.getSelection();
                  if (range == null || !_this2.quill.hasFocus())
                    return;
                  var _quill$getLine = _this2.quill.getLine(range.index), _quill$getLine2 = _slicedToArray(_quill$getLine, 2), line = _quill$getLine2[0], offset = _quill$getLine2[1];
                  var _quill$getLeaf = _this2.quill.getLeaf(range.index), _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), leafStart = _quill$getLeaf2[0], offsetStart = _quill$getLeaf2[1];
                  var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), _ref2 = _slicedToArray(_ref, 2), leafEnd = _ref2[0], offsetEnd = _ref2[1];
                  var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : "";
                  var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : "";
                  var curContext = {
                    collapsed: range.length === 0,
                    empty: range.length === 0 && line.length() <= 1,
                    format: _this2.quill.getFormat(range),
                    offset,
                    prefix: prefixText,
                    suffix: suffixText
                  };
                  var prevented = bindings.some(function(binding) {
                    if (binding.collapsed != null && binding.collapsed !== curContext.collapsed)
                      return false;
                    if (binding.empty != null && binding.empty !== curContext.empty)
                      return false;
                    if (binding.offset != null && binding.offset !== curContext.offset)
                      return false;
                    if (Array.isArray(binding.format)) {
                      if (binding.format.every(function(name2) {
                        return curContext.format[name2] == null;
                      })) {
                        return false;
                      }
                    } else if (_typeof2(binding.format) === "object") {
                      if (!Object.keys(binding.format).every(function(name2) {
                        if (binding.format[name2] === true)
                          return curContext.format[name2] != null;
                        if (binding.format[name2] === false)
                          return curContext.format[name2] == null;
                        return (0, _deepEqual2.default)(binding.format[name2], curContext.format[name2]);
                      })) {
                        return false;
                      }
                    }
                    if (binding.prefix != null && !binding.prefix.test(curContext.prefix))
                      return false;
                    if (binding.suffix != null && !binding.suffix.test(curContext.suffix))
                      return false;
                    return binding.handler.call(_this2, range, curContext) !== true;
                  });
                  if (prevented) {
                    evt.preventDefault();
                  }
                });
              }
            }]);
            return Keyboard2;
          }(_module2.default);
          Keyboard.keys = {
            BACKSPACE: 8,
            TAB: 9,
            ENTER: 13,
            ESCAPE: 27,
            LEFT: 37,
            UP: 38,
            RIGHT: 39,
            DOWN: 40,
            DELETE: 46
          };
          Keyboard.DEFAULTS = {
            bindings: {
              "bold": makeFormatHandler("bold"),
              "italic": makeFormatHandler("italic"),
              "underline": makeFormatHandler("underline"),
              "indent": {
                key: Keyboard.keys.TAB,
                format: ["blockquote", "indent", "list"],
                handler: function handler(range, context) {
                  if (context.collapsed && context.offset !== 0)
                    return true;
                  this.quill.format("indent", "+1", _quill2.default.sources.USER);
                }
              },
              "outdent": {
                key: Keyboard.keys.TAB,
                shiftKey: true,
                format: ["blockquote", "indent", "list"],
                handler: function handler(range, context) {
                  if (context.collapsed && context.offset !== 0)
                    return true;
                  this.quill.format("indent", "-1", _quill2.default.sources.USER);
                }
              },
              "outdent backspace": {
                key: Keyboard.keys.BACKSPACE,
                collapsed: true,
                shiftKey: null,
                metaKey: null,
                ctrlKey: null,
                altKey: null,
                format: ["indent", "list"],
                offset: 0,
                handler: function handler(range, context) {
                  if (context.format.indent != null) {
                    this.quill.format("indent", "-1", _quill2.default.sources.USER);
                  } else if (context.format.list != null) {
                    this.quill.format("list", false, _quill2.default.sources.USER);
                  }
                }
              },
              "indent code-block": makeCodeBlockHandler(true),
              "outdent code-block": makeCodeBlockHandler(false),
              "remove tab": {
                key: Keyboard.keys.TAB,
                shiftKey: true,
                collapsed: true,
                prefix: /\t$/,
                handler: function handler(range) {
                  this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);
                }
              },
              "tab": {
                key: Keyboard.keys.TAB,
                handler: function handler(range) {
                  this.quill.history.cutoff();
                  var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert("	");
                  this.quill.updateContents(delta, _quill2.default.sources.USER);
                  this.quill.history.cutoff();
                  this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                }
              },
              "list empty enter": {
                key: Keyboard.keys.ENTER,
                collapsed: true,
                format: ["list"],
                empty: true,
                handler: function handler(range, context) {
                  this.quill.format("list", false, _quill2.default.sources.USER);
                  if (context.format.indent) {
                    this.quill.format("indent", false, _quill2.default.sources.USER);
                  }
                }
              },
              "checklist enter": {
                key: Keyboard.keys.ENTER,
                collapsed: true,
                format: { list: "checked" },
                handler: function handler(range) {
                  var _quill$getLine3 = this.quill.getLine(range.index), _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), line = _quill$getLine4[0], offset = _quill$getLine4[1];
                  var formats = (0, _extend2.default)({}, line.formats(), { list: "checked" });
                  var delta = new _quillDelta2.default().retain(range.index).insert("\n", formats).retain(line.length() - offset - 1).retain(1, { list: "unchecked" });
                  this.quill.updateContents(delta, _quill2.default.sources.USER);
                  this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                  this.quill.scrollIntoView();
                }
              },
              "header enter": {
                key: Keyboard.keys.ENTER,
                collapsed: true,
                format: ["header"],
                suffix: /^$/,
                handler: function handler(range, context) {
                  var _quill$getLine5 = this.quill.getLine(range.index), _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), line = _quill$getLine6[0], offset = _quill$getLine6[1];
                  var delta = new _quillDelta2.default().retain(range.index).insert("\n", context.format).retain(line.length() - offset - 1).retain(1, { header: null });
                  this.quill.updateContents(delta, _quill2.default.sources.USER);
                  this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
                  this.quill.scrollIntoView();
                }
              },
              "list autofill": {
                key: " ",
                collapsed: true,
                format: { list: false },
                prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,
                handler: function handler(range, context) {
                  var length = context.prefix.length;
                  var _quill$getLine7 = this.quill.getLine(range.index), _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), line = _quill$getLine8[0], offset = _quill$getLine8[1];
                  if (offset > length)
                    return true;
                  var value2 = void 0;
                  switch (context.prefix.trim()) {
                    case "[]":
                    case "[ ]":
                      value2 = "unchecked";
                      break;
                    case "[x]":
                      value2 = "checked";
                      break;
                    case "-":
                    case "*":
                      value2 = "bullet";
                      break;
                    default:
                      value2 = "ordered";
                  }
                  this.quill.insertText(range.index, " ", _quill2.default.sources.USER);
                  this.quill.history.cutoff();
                  var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value2 });
                  this.quill.updateContents(delta, _quill2.default.sources.USER);
                  this.quill.history.cutoff();
                  this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);
                }
              },
              "code exit": {
                key: Keyboard.keys.ENTER,
                collapsed: true,
                format: ["code-block"],
                prefix: /\n\n$/,
                suffix: /^\s+$/,
                handler: function handler(range) {
                  var _quill$getLine9 = this.quill.getLine(range.index), _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), line = _quill$getLine10[0], offset = _quill$getLine10[1];
                  var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { "code-block": null }).delete(1);
                  this.quill.updateContents(delta, _quill2.default.sources.USER);
                }
              },
              "embed left": makeEmbedArrowHandler(Keyboard.keys.LEFT, false),
              "embed left shift": makeEmbedArrowHandler(Keyboard.keys.LEFT, true),
              "embed right": makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),
              "embed right shift": makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)
            }
          };
          function makeEmbedArrowHandler(key, shiftKey) {
            var _ref3;
            var where = key === Keyboard.keys.LEFT ? "prefix" : "suffix";
            return _ref3 = {
              key,
              shiftKey,
              altKey: null
            }, _defineProperty2(_ref3, where, /^$/), _defineProperty2(_ref3, "handler", function handler(range) {
              var index2 = range.index;
              if (key === Keyboard.keys.RIGHT) {
                index2 += range.length + 1;
              }
              var _quill$getLeaf3 = this.quill.getLeaf(index2), _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), leaf = _quill$getLeaf4[0];
              if (!(leaf instanceof _parchment2.default.Embed))
                return true;
              if (key === Keyboard.keys.LEFT) {
                if (shiftKey) {
                  this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);
                } else {
                  this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);
                }
              } else {
                if (shiftKey) {
                  this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);
                } else {
                  this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);
                }
              }
              return false;
            }), _ref3;
          }
          function handleBackspace(range, context) {
            if (range.index === 0 || this.quill.getLength() <= 1)
              return;
            var _quill$getLine11 = this.quill.getLine(range.index), _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), line = _quill$getLine12[0];
            var formats = {};
            if (context.offset === 0) {
              var _quill$getLine13 = this.quill.getLine(range.index - 1), _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), prev = _quill$getLine14[0];
              if (prev != null && prev.length() > 1) {
                var curFormats = line.formats();
                var prevFormats = this.quill.getFormat(range.index - 1, 1);
                formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};
              }
            }
            var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1;
            this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);
            if (Object.keys(formats).length > 0) {
              this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);
            }
            this.quill.focus();
          }
          function handleDelete(range, context) {
            var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1;
            if (range.index >= this.quill.getLength() - length)
              return;
            var formats = {}, nextLength = 0;
            var _quill$getLine15 = this.quill.getLine(range.index), _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), line = _quill$getLine16[0];
            if (context.offset >= line.length() - 1) {
              var _quill$getLine17 = this.quill.getLine(range.index + 1), _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), next = _quill$getLine18[0];
              if (next) {
                var curFormats = line.formats();
                var nextFormats = this.quill.getFormat(range.index, 1);
                formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};
                nextLength = next.length();
              }
            }
            this.quill.deleteText(range.index, length, _quill2.default.sources.USER);
            if (Object.keys(formats).length > 0) {
              this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);
            }
          }
          function handleDeleteRange(range) {
            var lines = this.quill.getLines(range);
            var formats = {};
            if (lines.length > 1) {
              var firstFormats = lines[0].formats();
              var lastFormats = lines[lines.length - 1].formats();
              formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};
            }
            this.quill.deleteText(range, _quill2.default.sources.USER);
            if (Object.keys(formats).length > 0) {
              this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);
            }
            this.quill.setSelection(range.index, _quill2.default.sources.SILENT);
            this.quill.focus();
          }
          function handleEnter(range, context) {
            var _this3 = this;
            if (range.length > 0) {
              this.quill.scroll.deleteAt(range.index, range.length);
            }
            var lineFormats = Object.keys(context.format).reduce(function(lineFormats2, format) {
              if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {
                lineFormats2[format] = context.format[format];
              }
              return lineFormats2;
            }, {});
            this.quill.insertText(range.index, "\n", lineFormats, _quill2.default.sources.USER);
            this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);
            this.quill.focus();
            Object.keys(context.format).forEach(function(name2) {
              if (lineFormats[name2] != null)
                return;
              if (Array.isArray(context.format[name2]))
                return;
              if (name2 === "link")
                return;
              _this3.quill.format(name2, context.format[name2], _quill2.default.sources.USER);
            });
          }
          function makeCodeBlockHandler(indent) {
            return {
              key: Keyboard.keys.TAB,
              shiftKey: !indent,
              format: { "code-block": true },
              handler: function handler(range) {
                var CodeBlock = _parchment2.default.query("code-block");
                var index2 = range.index, length = range.length;
                var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index2), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), block = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
                if (block == null)
                  return;
                var scrollIndex = this.quill.getIndex(block);
                var start = block.newlineIndex(offset, true) + 1;
                var end = block.newlineIndex(scrollIndex + offset + length);
                var lines = block.domNode.textContent.slice(start, end).split("\n");
                offset = 0;
                lines.forEach(function(line, i2) {
                  if (indent) {
                    block.insertAt(start + offset, CodeBlock.TAB);
                    offset += CodeBlock.TAB.length;
                    if (i2 === 0) {
                      index2 += CodeBlock.TAB.length;
                    } else {
                      length += CodeBlock.TAB.length;
                    }
                  } else if (line.startsWith(CodeBlock.TAB)) {
                    block.deleteAt(start + offset, CodeBlock.TAB.length);
                    offset -= CodeBlock.TAB.length;
                    if (i2 === 0) {
                      index2 -= CodeBlock.TAB.length;
                    } else {
                      length -= CodeBlock.TAB.length;
                    }
                  }
                  offset += line.length + 1;
                });
                this.quill.update(_quill2.default.sources.USER);
                this.quill.setSelection(index2, length, _quill2.default.sources.SILENT);
              }
            };
          }
          function makeFormatHandler(format) {
            return {
              key: format[0].toUpperCase(),
              shortKey: true,
              handler: function handler(range, context) {
                this.quill.format(format, !context.format[format], _quill2.default.sources.USER);
              }
            };
          }
          function normalize(binding) {
            if (typeof binding === "string" || typeof binding === "number") {
              return normalize({ key: binding });
            }
            if ((typeof binding === "undefined" ? "undefined" : _typeof2(binding)) === "object") {
              binding = (0, _clone2.default)(binding, false);
            }
            if (typeof binding.key === "string") {
              if (Keyboard.keys[binding.key.toUpperCase()] != null) {
                binding.key = Keyboard.keys[binding.key.toUpperCase()];
              } else if (binding.key.length === 1) {
                binding.key = binding.key.toUpperCase().charCodeAt(0);
              } else {
                return null;
              }
            }
            if (binding.shortKey) {
              binding[SHORTKEY] = binding.shortKey;
              delete binding.shortKey;
            }
            return binding;
          }
          exports3.default = Keyboard;
          exports3.SHORTKEY = SHORTKEY;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Cursor = function(_Parchment$Embed) {
            _inherits(Cursor2, _Parchment$Embed);
            _createClass(Cursor2, null, [{
              key: "value",
              value: function value2() {
                return void 0;
              }
            }]);
            function Cursor2(domNode, selection) {
              _classCallCheck(this, Cursor2);
              var _this = _possibleConstructorReturn(this, (Cursor2.__proto__ || Object.getPrototypeOf(Cursor2)).call(this, domNode));
              _this.selection = selection;
              _this.textNode = document.createTextNode(Cursor2.CONTENTS);
              _this.domNode.appendChild(_this.textNode);
              _this._length = 0;
              return _this;
            }
            _createClass(Cursor2, [{
              key: "detach",
              value: function detach() {
                if (this.parent != null)
                  this.parent.removeChild(this);
              }
            }, {
              key: "format",
              value: function format(name2, value2) {
                if (this._length !== 0) {
                  return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "format", this).call(this, name2, value2);
                }
                var target = this, index2 = 0;
                while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {
                  index2 += target.offset(target.parent);
                  target = target.parent;
                }
                if (target != null) {
                  this._length = Cursor2.CONTENTS.length;
                  target.optimize();
                  target.formatAt(index2, Cursor2.CONTENTS.length, name2, value2);
                  this._length = 0;
                }
              }
            }, {
              key: "index",
              value: function index2(node, offset) {
                if (node === this.textNode)
                  return 0;
                return _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "index", this).call(this, node, offset);
              }
            }, {
              key: "length",
              value: function length() {
                return this._length;
              }
            }, {
              key: "position",
              value: function position() {
                return [this.textNode, this.textNode.data.length];
              }
            }, {
              key: "remove",
              value: function remove2() {
                _get(Cursor2.prototype.__proto__ || Object.getPrototypeOf(Cursor2.prototype), "remove", this).call(this);
                this.parent = null;
              }
            }, {
              key: "restore",
              value: function restore() {
                if (this.selection.composing || this.parent == null)
                  return;
                var textNode = this.textNode;
                var range = this.selection.getNativeRange();
                var restoreText = void 0, start = void 0, end = void 0;
                if (range != null && range.start.node === textNode && range.end.node === textNode) {
                  var _ref = [textNode, range.start.offset, range.end.offset];
                  restoreText = _ref[0];
                  start = _ref[1];
                  end = _ref[2];
                }
                while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {
                  this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);
                }
                if (this.textNode.data !== Cursor2.CONTENTS) {
                  var text = this.textNode.data.split(Cursor2.CONTENTS).join("");
                  if (this.next instanceof _text2.default) {
                    restoreText = this.next.domNode;
                    this.next.insertAt(0, text);
                    this.textNode.data = Cursor2.CONTENTS;
                  } else {
                    this.textNode.data = text;
                    this.parent.insertBefore(_parchment2.default.create(this.textNode), this);
                    this.textNode = document.createTextNode(Cursor2.CONTENTS);
                    this.domNode.appendChild(this.textNode);
                  }
                }
                this.remove();
                if (start != null) {
                  var _map = [start, end].map(function(offset) {
                    return Math.max(0, Math.min(restoreText.data.length, offset - 1));
                  });
                  var _map2 = _slicedToArray(_map, 2);
                  start = _map2[0];
                  end = _map2[1];
                  return {
                    startNode: restoreText,
                    startOffset: start,
                    endNode: restoreText,
                    endOffset: end
                  };
                }
              }
            }, {
              key: "update",
              value: function update(mutations, context) {
                var _this2 = this;
                if (mutations.some(function(mutation) {
                  return mutation.type === "characterData" && mutation.target === _this2.textNode;
                })) {
                  var range = this.restore();
                  if (range)
                    context.range = range;
                }
              }
            }, {
              key: "value",
              value: function value2() {
                return "";
              }
            }]);
            return Cursor2;
          }(_parchment2.default.Embed);
          Cursor.blotName = "cursor";
          Cursor.className = "ql-cursor";
          Cursor.tagName = "span";
          Cursor.CONTENTS = "\uFEFF";
          exports3.default = Cursor;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Container = function(_Parchment$Container) {
            _inherits(Container2, _Parchment$Container);
            function Container2() {
              _classCallCheck(this, Container2);
              return _possibleConstructorReturn(this, (Container2.__proto__ || Object.getPrototypeOf(Container2)).apply(this, arguments));
            }
            return Container2;
          }(_parchment2.default.Container);
          Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container];
          exports3.default = Container;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.ColorStyle = exports3.ColorClass = exports3.ColorAttributor = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ColorAttributor = function(_Parchment$Attributor) {
            _inherits(ColorAttributor2, _Parchment$Attributor);
            function ColorAttributor2() {
              _classCallCheck(this, ColorAttributor2);
              return _possibleConstructorReturn(this, (ColorAttributor2.__proto__ || Object.getPrototypeOf(ColorAttributor2)).apply(this, arguments));
            }
            _createClass(ColorAttributor2, [{
              key: "value",
              value: function value2(domNode) {
                var value3 = _get(ColorAttributor2.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor2.prototype), "value", this).call(this, domNode);
                if (!value3.startsWith("rgb("))
                  return value3;
                value3 = value3.replace(/^[^\d]+/, "").replace(/[^\d]+$/, "");
                return "#" + value3.split(",").map(function(component) {
                  return ("00" + parseInt(component).toString(16)).slice(-2);
                }).join("");
              }
            }]);
            return ColorAttributor2;
          }(_parchment2.default.Attributor.Style);
          var ColorClass = new _parchment2.default.Attributor.Class("color", "ql-color", {
            scope: _parchment2.default.Scope.INLINE
          });
          var ColorStyle = new ColorAttributor("color", "color", {
            scope: _parchment2.default.Scope.INLINE
          });
          exports3.ColorAttributor = ColorAttributor;
          exports3.ColorClass = ColorClass;
          exports3.ColorStyle = ColorStyle;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.sanitize = exports3.default = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Link = function(_Inline) {
            _inherits(Link2, _Inline);
            function Link2() {
              _classCallCheck(this, Link2);
              return _possibleConstructorReturn(this, (Link2.__proto__ || Object.getPrototypeOf(Link2)).apply(this, arguments));
            }
            _createClass(Link2, [{
              key: "format",
              value: function format(name2, value2) {
                if (name2 !== this.statics.blotName || !value2)
                  return _get(Link2.prototype.__proto__ || Object.getPrototypeOf(Link2.prototype), "format", this).call(this, name2, value2);
                value2 = this.constructor.sanitize(value2);
                this.domNode.setAttribute("href", value2);
              }
            }], [{
              key: "create",
              value: function create(value2) {
                var node = _get(Link2.__proto__ || Object.getPrototypeOf(Link2), "create", this).call(this, value2);
                value2 = this.sanitize(value2);
                node.setAttribute("href", value2);
                node.setAttribute("rel", "noopener noreferrer");
                node.setAttribute("target", "_blank");
                return node;
              }
            }, {
              key: "formats",
              value: function formats(domNode) {
                return domNode.getAttribute("href");
              }
            }, {
              key: "sanitize",
              value: function sanitize(url) {
                return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;
              }
            }]);
            return Link2;
          }(_inline2.default);
          Link.blotName = "link";
          Link.tagName = "A";
          Link.SANITIZED_URL = "about:blank";
          Link.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel"];
          function _sanitize(url, protocols) {
            var anchor = document.createElement("a");
            anchor.href = url;
            var protocol = anchor.href.slice(0, anchor.href.indexOf(":"));
            return protocols.indexOf(protocol) > -1;
          }
          exports3.default = Link;
          exports3.sanitize = _sanitize;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
          } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
          };
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _keyboard = __webpack_require__(23);
          var _keyboard2 = _interopRequireDefault(_keyboard);
          var _dropdown = __webpack_require__(107);
          var _dropdown2 = _interopRequireDefault(_dropdown);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var optionsCounter = 0;
          function toggleAriaAttribute(element, attribute) {
            element.setAttribute(attribute, !(element.getAttribute(attribute) === "true"));
          }
          var Picker = function() {
            function Picker2(select) {
              var _this = this;
              _classCallCheck(this, Picker2);
              this.select = select;
              this.container = document.createElement("span");
              this.buildPicker();
              this.select.style.display = "none";
              this.select.parentNode.insertBefore(this.container, this.select);
              this.label.addEventListener("mousedown", function() {
                _this.togglePicker();
              });
              this.label.addEventListener("keydown", function(event) {
                switch (event.keyCode) {
                  case _keyboard2.default.keys.ENTER:
                    _this.togglePicker();
                    break;
                  case _keyboard2.default.keys.ESCAPE:
                    _this.escape();
                    event.preventDefault();
                    break;
                }
              });
              this.select.addEventListener("change", this.update.bind(this));
            }
            _createClass(Picker2, [{
              key: "togglePicker",
              value: function togglePicker() {
                this.container.classList.toggle("ql-expanded");
                toggleAriaAttribute(this.label, "aria-expanded");
                toggleAriaAttribute(this.options, "aria-hidden");
              }
            }, {
              key: "buildItem",
              value: function buildItem(option) {
                var _this2 = this;
                var item = document.createElement("span");
                item.tabIndex = "0";
                item.setAttribute("role", "button");
                item.classList.add("ql-picker-item");
                if (option.hasAttribute("value")) {
                  item.setAttribute("data-value", option.getAttribute("value"));
                }
                if (option.textContent) {
                  item.setAttribute("data-label", option.textContent);
                }
                item.addEventListener("click", function() {
                  _this2.selectItem(item, true);
                });
                item.addEventListener("keydown", function(event) {
                  switch (event.keyCode) {
                    case _keyboard2.default.keys.ENTER:
                      _this2.selectItem(item, true);
                      event.preventDefault();
                      break;
                    case _keyboard2.default.keys.ESCAPE:
                      _this2.escape();
                      event.preventDefault();
                      break;
                  }
                });
                return item;
              }
            }, {
              key: "buildLabel",
              value: function buildLabel() {
                var label = document.createElement("span");
                label.classList.add("ql-picker-label");
                label.innerHTML = _dropdown2.default;
                label.tabIndex = "0";
                label.setAttribute("role", "button");
                label.setAttribute("aria-expanded", "false");
                this.container.appendChild(label);
                return label;
              }
            }, {
              key: "buildOptions",
              value: function buildOptions() {
                var _this3 = this;
                var options = document.createElement("span");
                options.classList.add("ql-picker-options");
                options.setAttribute("aria-hidden", "true");
                options.tabIndex = "-1";
                options.id = "ql-picker-options-" + optionsCounter;
                optionsCounter += 1;
                this.label.setAttribute("aria-controls", options.id);
                this.options = options;
                [].slice.call(this.select.options).forEach(function(option) {
                  var item = _this3.buildItem(option);
                  options.appendChild(item);
                  if (option.selected === true) {
                    _this3.selectItem(item);
                  }
                });
                this.container.appendChild(options);
              }
            }, {
              key: "buildPicker",
              value: function buildPicker() {
                var _this4 = this;
                [].slice.call(this.select.attributes).forEach(function(item) {
                  _this4.container.setAttribute(item.name, item.value);
                });
                this.container.classList.add("ql-picker");
                this.label = this.buildLabel();
                this.buildOptions();
              }
            }, {
              key: "escape",
              value: function escape() {
                var _this5 = this;
                this.close();
                setTimeout(function() {
                  return _this5.label.focus();
                }, 1);
              }
            }, {
              key: "close",
              value: function close() {
                this.container.classList.remove("ql-expanded");
                this.label.setAttribute("aria-expanded", "false");
                this.options.setAttribute("aria-hidden", "true");
              }
            }, {
              key: "selectItem",
              value: function selectItem(item) {
                var trigger = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
                var selected = this.container.querySelector(".ql-selected");
                if (item === selected)
                  return;
                if (selected != null) {
                  selected.classList.remove("ql-selected");
                }
                if (item == null)
                  return;
                item.classList.add("ql-selected");
                this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);
                if (item.hasAttribute("data-value")) {
                  this.label.setAttribute("data-value", item.getAttribute("data-value"));
                } else {
                  this.label.removeAttribute("data-value");
                }
                if (item.hasAttribute("data-label")) {
                  this.label.setAttribute("data-label", item.getAttribute("data-label"));
                } else {
                  this.label.removeAttribute("data-label");
                }
                if (trigger) {
                  if (typeof Event === "function") {
                    this.select.dispatchEvent(new Event("change"));
                  } else if ((typeof Event === "undefined" ? "undefined" : _typeof2(Event)) === "object") {
                    var event = document.createEvent("Event");
                    event.initEvent("change", true, true);
                    this.select.dispatchEvent(event);
                  }
                  this.close();
                }
              }
            }, {
              key: "update",
              value: function update() {
                var option = void 0;
                if (this.select.selectedIndex > -1) {
                  var item = this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];
                  option = this.select.options[this.select.selectedIndex];
                  this.selectItem(item);
                } else {
                  this.selectItem(null);
                }
                var isActive = option != null && option !== this.select.querySelector("option[selected]");
                this.label.classList.toggle("ql-active", isActive);
              }
            }]);
            return Picker2;
          }();
          exports3.default = Picker;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          var _break = __webpack_require__(16);
          var _break2 = _interopRequireDefault(_break);
          var _container = __webpack_require__(25);
          var _container2 = _interopRequireDefault(_container);
          var _cursor = __webpack_require__(24);
          var _cursor2 = _interopRequireDefault(_cursor);
          var _embed = __webpack_require__(35);
          var _embed2 = _interopRequireDefault(_embed);
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          var _scroll = __webpack_require__(22);
          var _scroll2 = _interopRequireDefault(_scroll);
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          var _clipboard = __webpack_require__(55);
          var _clipboard2 = _interopRequireDefault(_clipboard);
          var _history = __webpack_require__(42);
          var _history2 = _interopRequireDefault(_history);
          var _keyboard = __webpack_require__(23);
          var _keyboard2 = _interopRequireDefault(_keyboard);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          _quill2.default.register({
            "blots/block": _block2.default,
            "blots/block/embed": _block.BlockEmbed,
            "blots/break": _break2.default,
            "blots/container": _container2.default,
            "blots/cursor": _cursor2.default,
            "blots/embed": _embed2.default,
            "blots/inline": _inline2.default,
            "blots/scroll": _scroll2.default,
            "blots/text": _text2.default,
            "modules/clipboard": _clipboard2.default,
            "modules/history": _history2.default,
            "modules/keyboard": _keyboard2.default
          });
          _parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);
          exports3.default = _quill2.default;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          var Registry = __webpack_require__(1);
          var ShadowBlot = function() {
            function ShadowBlot2(domNode) {
              this.domNode = domNode;
              this.domNode[Registry.DATA_KEY] = { blot: this };
            }
            Object.defineProperty(ShadowBlot2.prototype, "statics", {
              get: function() {
                return this.constructor;
              },
              enumerable: true,
              configurable: true
            });
            ShadowBlot2.create = function(value2) {
              if (this.tagName == null) {
                throw new Registry.ParchmentError("Blot definition missing tagName");
              }
              var node;
              if (Array.isArray(this.tagName)) {
                if (typeof value2 === "string") {
                  value2 = value2.toUpperCase();
                  if (parseInt(value2).toString() === value2) {
                    value2 = parseInt(value2);
                  }
                }
                if (typeof value2 === "number") {
                  node = document.createElement(this.tagName[value2 - 1]);
                } else if (this.tagName.indexOf(value2) > -1) {
                  node = document.createElement(value2);
                } else {
                  node = document.createElement(this.tagName[0]);
                }
              } else {
                node = document.createElement(this.tagName);
              }
              if (this.className) {
                node.classList.add(this.className);
              }
              return node;
            };
            ShadowBlot2.prototype.attach = function() {
              if (this.parent != null) {
                this.scroll = this.parent.scroll;
              }
            };
            ShadowBlot2.prototype.clone = function() {
              var domNode = this.domNode.cloneNode(false);
              return Registry.create(domNode);
            };
            ShadowBlot2.prototype.detach = function() {
              if (this.parent != null)
                this.parent.removeChild(this);
              delete this.domNode[Registry.DATA_KEY];
            };
            ShadowBlot2.prototype.deleteAt = function(index2, length) {
              var blot = this.isolate(index2, length);
              blot.remove();
            };
            ShadowBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              var blot = this.isolate(index2, length);
              if (Registry.query(name2, Registry.Scope.BLOT) != null && value2) {
                blot.wrap(name2, value2);
              } else if (Registry.query(name2, Registry.Scope.ATTRIBUTE) != null) {
                var parent = Registry.create(this.statics.scope);
                blot.wrap(parent);
                parent.format(name2, value2);
              }
            };
            ShadowBlot2.prototype.insertAt = function(index2, value2, def) {
              var blot = def == null ? Registry.create("text", value2) : Registry.create(value2, def);
              var ref2 = this.split(index2);
              this.parent.insertBefore(blot, ref2);
            };
            ShadowBlot2.prototype.insertInto = function(parentBlot, refBlot) {
              if (refBlot === void 0) {
                refBlot = null;
              }
              if (this.parent != null) {
                this.parent.children.remove(this);
              }
              var refDomNode = null;
              parentBlot.children.insertBefore(this, refBlot);
              if (refBlot != null) {
                refDomNode = refBlot.domNode;
              }
              if (this.domNode.parentNode != parentBlot.domNode || this.domNode.nextSibling != refDomNode) {
                parentBlot.domNode.insertBefore(this.domNode, refDomNode);
              }
              this.parent = parentBlot;
              this.attach();
            };
            ShadowBlot2.prototype.isolate = function(index2, length) {
              var target = this.split(index2);
              target.split(length);
              return target;
            };
            ShadowBlot2.prototype.length = function() {
              return 1;
            };
            ShadowBlot2.prototype.offset = function(root) {
              if (root === void 0) {
                root = this.parent;
              }
              if (this.parent == null || this == root)
                return 0;
              return this.parent.children.offset(this) + this.parent.offset(root);
            };
            ShadowBlot2.prototype.optimize = function(context) {
              if (this.domNode[Registry.DATA_KEY] != null) {
                delete this.domNode[Registry.DATA_KEY].mutations;
              }
            };
            ShadowBlot2.prototype.remove = function() {
              if (this.domNode.parentNode != null) {
                this.domNode.parentNode.removeChild(this.domNode);
              }
              this.detach();
            };
            ShadowBlot2.prototype.replace = function(target) {
              if (target.parent == null)
                return;
              target.parent.insertBefore(this, target.next);
              target.remove();
            };
            ShadowBlot2.prototype.replaceWith = function(name2, value2) {
              var replacement = typeof name2 === "string" ? Registry.create(name2, value2) : name2;
              replacement.replace(this);
              return replacement;
            };
            ShadowBlot2.prototype.split = function(index2, force) {
              return index2 === 0 ? this : this.next;
            };
            ShadowBlot2.prototype.update = function(mutations, context) {
            };
            ShadowBlot2.prototype.wrap = function(name2, value2) {
              var wrapper = typeof name2 === "string" ? Registry.create(name2, value2) : name2;
              if (this.parent != null) {
                this.parent.insertBefore(wrapper, this.next);
              }
              wrapper.appendChild(this);
              return wrapper;
            };
            ShadowBlot2.blotName = "abstract";
            return ShadowBlot2;
          }();
          exports3.default = ShadowBlot;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          var attributor_1 = __webpack_require__(12);
          var class_1 = __webpack_require__(32);
          var style_1 = __webpack_require__(33);
          var Registry = __webpack_require__(1);
          var AttributorStore = function() {
            function AttributorStore2(domNode) {
              this.attributes = {};
              this.domNode = domNode;
              this.build();
            }
            AttributorStore2.prototype.attribute = function(attribute, value2) {
              if (value2) {
                if (attribute.add(this.domNode, value2)) {
                  if (attribute.value(this.domNode) != null) {
                    this.attributes[attribute.attrName] = attribute;
                  } else {
                    delete this.attributes[attribute.attrName];
                  }
                }
              } else {
                attribute.remove(this.domNode);
                delete this.attributes[attribute.attrName];
              }
            };
            AttributorStore2.prototype.build = function() {
              var _this = this;
              this.attributes = {};
              var attributes = attributor_1.default.keys(this.domNode);
              var classes = class_1.default.keys(this.domNode);
              var styles = style_1.default.keys(this.domNode);
              attributes.concat(classes).concat(styles).forEach(function(name2) {
                var attr = Registry.query(name2, Registry.Scope.ATTRIBUTE);
                if (attr instanceof attributor_1.default) {
                  _this.attributes[attr.attrName] = attr;
                }
              });
            };
            AttributorStore2.prototype.copy = function(target) {
              var _this = this;
              Object.keys(this.attributes).forEach(function(key) {
                var value2 = _this.attributes[key].value(_this.domNode);
                target.format(key, value2);
              });
            };
            AttributorStore2.prototype.move = function(target) {
              var _this = this;
              this.copy(target);
              Object.keys(this.attributes).forEach(function(key) {
                _this.attributes[key].remove(_this.domNode);
              });
              this.attributes = {};
            };
            AttributorStore2.prototype.values = function() {
              var _this = this;
              return Object.keys(this.attributes).reduce(function(attributes, name2) {
                attributes[name2] = _this.attributes[name2].value(_this.domNode);
                return attributes;
              }, {});
            };
            return AttributorStore2;
          }();
          exports3.default = AttributorStore;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var attributor_1 = __webpack_require__(12);
          function match(node, prefix) {
            var className = node.getAttribute("class") || "";
            return className.split(/\s+/).filter(function(name2) {
              return name2.indexOf(prefix + "-") === 0;
            });
          }
          var ClassAttributor = function(_super) {
            __extends(ClassAttributor2, _super);
            function ClassAttributor2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            ClassAttributor2.keys = function(node) {
              return (node.getAttribute("class") || "").split(/\s+/).map(function(name2) {
                return name2.split("-").slice(0, -1).join("-");
              });
            };
            ClassAttributor2.prototype.add = function(node, value2) {
              if (!this.canAdd(node, value2))
                return false;
              this.remove(node);
              node.classList.add(this.keyName + "-" + value2);
              return true;
            };
            ClassAttributor2.prototype.remove = function(node) {
              var matches2 = match(node, this.keyName);
              matches2.forEach(function(name2) {
                node.classList.remove(name2);
              });
              if (node.classList.length === 0) {
                node.removeAttribute("class");
              }
            };
            ClassAttributor2.prototype.value = function(node) {
              var result = match(node, this.keyName)[0] || "";
              var value2 = result.slice(this.keyName.length + 1);
              return this.canAdd(node, value2) ? value2 : "";
            };
            return ClassAttributor2;
          }(attributor_1.default);
          exports3.default = ClassAttributor;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var attributor_1 = __webpack_require__(12);
          function camelize(name2) {
            var parts = name2.split("-");
            var rest2 = parts.slice(1).map(function(part) {
              return part[0].toUpperCase() + part.slice(1);
            }).join("");
            return parts[0] + rest2;
          }
          var StyleAttributor = function(_super) {
            __extends(StyleAttributor2, _super);
            function StyleAttributor2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            StyleAttributor2.keys = function(node) {
              return (node.getAttribute("style") || "").split(";").map(function(value2) {
                var arr = value2.split(":");
                return arr[0].trim();
              });
            };
            StyleAttributor2.prototype.add = function(node, value2) {
              if (!this.canAdd(node, value2))
                return false;
              node.style[camelize(this.keyName)] = value2;
              return true;
            };
            StyleAttributor2.prototype.remove = function(node) {
              node.style[camelize(this.keyName)] = "";
              if (!node.getAttribute("style")) {
                node.removeAttribute("style");
              }
            };
            StyleAttributor2.prototype.value = function(node) {
              var value2 = node.style[camelize(this.keyName)];
              return this.canAdd(node, value2) ? value2 : "";
            };
            return StyleAttributor2;
          }(attributor_1.default);
          exports3.default = StyleAttributor;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var Theme = function() {
            function Theme2(quill2, options) {
              _classCallCheck(this, Theme2);
              this.quill = quill2;
              this.options = options;
              this.modules = {};
            }
            _createClass(Theme2, [{
              key: "init",
              value: function init() {
                var _this = this;
                Object.keys(this.options.modules).forEach(function(name2) {
                  if (_this.modules[name2] == null) {
                    _this.addModule(name2);
                  }
                });
              }
            }, {
              key: "addModule",
              value: function addModule(name2) {
                var moduleClass = this.quill.constructor.import("modules/" + name2);
                this.modules[name2] = new moduleClass(this.quill, this.options.modules[name2] || {});
                return this.modules[name2];
              }
            }]);
            return Theme2;
          }();
          Theme.DEFAULTS = {
            modules: {}
          };
          Theme.themes = {
            "default": Theme
          };
          exports3.default = Theme;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _text = __webpack_require__(7);
          var _text2 = _interopRequireDefault(_text);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var GUARD_TEXT = "\uFEFF";
          var Embed = function(_Parchment$Embed) {
            _inherits(Embed2, _Parchment$Embed);
            function Embed2(node) {
              _classCallCheck(this, Embed2);
              var _this = _possibleConstructorReturn(this, (Embed2.__proto__ || Object.getPrototypeOf(Embed2)).call(this, node));
              _this.contentNode = document.createElement("span");
              _this.contentNode.setAttribute("contenteditable", false);
              [].slice.call(_this.domNode.childNodes).forEach(function(childNode) {
                _this.contentNode.appendChild(childNode);
              });
              _this.leftGuard = document.createTextNode(GUARD_TEXT);
              _this.rightGuard = document.createTextNode(GUARD_TEXT);
              _this.domNode.appendChild(_this.leftGuard);
              _this.domNode.appendChild(_this.contentNode);
              _this.domNode.appendChild(_this.rightGuard);
              return _this;
            }
            _createClass(Embed2, [{
              key: "index",
              value: function index2(node, offset) {
                if (node === this.leftGuard)
                  return 0;
                if (node === this.rightGuard)
                  return 1;
                return _get(Embed2.prototype.__proto__ || Object.getPrototypeOf(Embed2.prototype), "index", this).call(this, node, offset);
              }
            }, {
              key: "restore",
              value: function restore(node) {
                var range = void 0, textNode = void 0;
                var text = node.data.split(GUARD_TEXT).join("");
                if (node === this.leftGuard) {
                  if (this.prev instanceof _text2.default) {
                    var prevLength = this.prev.length();
                    this.prev.insertAt(prevLength, text);
                    range = {
                      startNode: this.prev.domNode,
                      startOffset: prevLength + text.length
                    };
                  } else {
                    textNode = document.createTextNode(text);
                    this.parent.insertBefore(_parchment2.default.create(textNode), this);
                    range = {
                      startNode: textNode,
                      startOffset: text.length
                    };
                  }
                } else if (node === this.rightGuard) {
                  if (this.next instanceof _text2.default) {
                    this.next.insertAt(0, text);
                    range = {
                      startNode: this.next.domNode,
                      startOffset: text.length
                    };
                  } else {
                    textNode = document.createTextNode(text);
                    this.parent.insertBefore(_parchment2.default.create(textNode), this.next);
                    range = {
                      startNode: textNode,
                      startOffset: text.length
                    };
                  }
                }
                node.data = GUARD_TEXT;
                return range;
              }
            }, {
              key: "update",
              value: function update(mutations, context) {
                var _this2 = this;
                mutations.forEach(function(mutation) {
                  if (mutation.type === "characterData" && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {
                    var range = _this2.restore(mutation.target);
                    if (range)
                      context.range = range;
                  }
                });
              }
            }]);
            return Embed2;
          }(_parchment2.default.Embed);
          exports3.default = Embed;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.AlignStyle = exports3.AlignClass = exports3.AlignAttribute = void 0;
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          var config2 = {
            scope: _parchment2.default.Scope.BLOCK,
            whitelist: ["right", "center", "justify"]
          };
          var AlignAttribute = new _parchment2.default.Attributor.Attribute("align", "align", config2);
          var AlignClass = new _parchment2.default.Attributor.Class("align", "ql-align", config2);
          var AlignStyle = new _parchment2.default.Attributor.Style("align", "text-align", config2);
          exports3.AlignAttribute = AlignAttribute;
          exports3.AlignClass = AlignClass;
          exports3.AlignStyle = AlignStyle;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.BackgroundStyle = exports3.BackgroundClass = void 0;
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _color = __webpack_require__(26);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          var BackgroundClass = new _parchment2.default.Attributor.Class("background", "ql-bg", {
            scope: _parchment2.default.Scope.INLINE
          });
          var BackgroundStyle = new _color.ColorAttributor("background", "background-color", {
            scope: _parchment2.default.Scope.INLINE
          });
          exports3.BackgroundClass = BackgroundClass;
          exports3.BackgroundStyle = BackgroundStyle;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.DirectionStyle = exports3.DirectionClass = exports3.DirectionAttribute = void 0;
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          var config2 = {
            scope: _parchment2.default.Scope.BLOCK,
            whitelist: ["rtl"]
          };
          var DirectionAttribute = new _parchment2.default.Attributor.Attribute("direction", "dir", config2);
          var DirectionClass = new _parchment2.default.Attributor.Class("direction", "ql-direction", config2);
          var DirectionStyle = new _parchment2.default.Attributor.Style("direction", "direction", config2);
          exports3.DirectionAttribute = DirectionAttribute;
          exports3.DirectionClass = DirectionClass;
          exports3.DirectionStyle = DirectionStyle;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.FontClass = exports3.FontStyle = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var config2 = {
            scope: _parchment2.default.Scope.INLINE,
            whitelist: ["serif", "monospace"]
          };
          var FontClass = new _parchment2.default.Attributor.Class("font", "ql-font", config2);
          var FontStyleAttributor = function(_Parchment$Attributor) {
            _inherits(FontStyleAttributor2, _Parchment$Attributor);
            function FontStyleAttributor2() {
              _classCallCheck(this, FontStyleAttributor2);
              return _possibleConstructorReturn(this, (FontStyleAttributor2.__proto__ || Object.getPrototypeOf(FontStyleAttributor2)).apply(this, arguments));
            }
            _createClass(FontStyleAttributor2, [{
              key: "value",
              value: function value2(node) {
                return _get(FontStyleAttributor2.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor2.prototype), "value", this).call(this, node).replace(/["']/g, "");
              }
            }]);
            return FontStyleAttributor2;
          }(_parchment2.default.Attributor.Style);
          var FontStyle = new FontStyleAttributor("font", "font-family", config2);
          exports3.FontStyle = FontStyle;
          exports3.FontClass = FontClass;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.SizeStyle = exports3.SizeClass = void 0;
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          var SizeClass = new _parchment2.default.Attributor.Class("size", "ql-size", {
            scope: _parchment2.default.Scope.INLINE,
            whitelist: ["small", "large", "huge"]
          });
          var SizeStyle = new _parchment2.default.Attributor.Style("size", "font-size", {
            scope: _parchment2.default.Scope.INLINE,
            whitelist: ["10px", "18px", "32px"]
          });
          exports3.SizeClass = SizeClass;
          exports3.SizeStyle = SizeStyle;
        },
        function(module3, exports3, __webpack_require__) {
          module3.exports = {
            "align": {
              "": __webpack_require__(76),
              "center": __webpack_require__(77),
              "right": __webpack_require__(78),
              "justify": __webpack_require__(79)
            },
            "background": __webpack_require__(80),
            "blockquote": __webpack_require__(81),
            "bold": __webpack_require__(82),
            "clean": __webpack_require__(83),
            "code": __webpack_require__(58),
            "code-block": __webpack_require__(58),
            "color": __webpack_require__(84),
            "direction": {
              "": __webpack_require__(85),
              "rtl": __webpack_require__(86)
            },
            "float": {
              "center": __webpack_require__(87),
              "full": __webpack_require__(88),
              "left": __webpack_require__(89),
              "right": __webpack_require__(90)
            },
            "formula": __webpack_require__(91),
            "header": {
              "1": __webpack_require__(92),
              "2": __webpack_require__(93)
            },
            "italic": __webpack_require__(94),
            "image": __webpack_require__(95),
            "indent": {
              "+1": __webpack_require__(96),
              "-1": __webpack_require__(97)
            },
            "link": __webpack_require__(98),
            "list": {
              "ordered": __webpack_require__(99),
              "bullet": __webpack_require__(100),
              "check": __webpack_require__(101)
            },
            "script": {
              "sub": __webpack_require__(102),
              "super": __webpack_require__(103)
            },
            "strike": __webpack_require__(104),
            "underline": __webpack_require__(105),
            "video": __webpack_require__(106)
          };
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.getLastChangeIndex = exports3.default = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var History = function(_Module) {
            _inherits(History2, _Module);
            function History2(quill2, options) {
              _classCallCheck(this, History2);
              var _this = _possibleConstructorReturn(this, (History2.__proto__ || Object.getPrototypeOf(History2)).call(this, quill2, options));
              _this.lastRecorded = 0;
              _this.ignoreChange = false;
              _this.clear();
              _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(eventName, delta, oldDelta, source) {
                if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange)
                  return;
                if (!_this.options.userOnly || source === _quill2.default.sources.USER) {
                  _this.record(delta, oldDelta);
                } else {
                  _this.transform(delta);
                }
              });
              _this.quill.keyboard.addBinding({ key: "Z", shortKey: true }, _this.undo.bind(_this));
              _this.quill.keyboard.addBinding({ key: "Z", shortKey: true, shiftKey: true }, _this.redo.bind(_this));
              if (/Win/i.test(navigator.platform)) {
                _this.quill.keyboard.addBinding({ key: "Y", shortKey: true }, _this.redo.bind(_this));
              }
              return _this;
            }
            _createClass(History2, [{
              key: "change",
              value: function change(source, dest) {
                if (this.stack[source].length === 0)
                  return;
                var delta = this.stack[source].pop();
                this.stack[dest].push(delta);
                this.lastRecorded = 0;
                this.ignoreChange = true;
                this.quill.updateContents(delta[source], _quill2.default.sources.USER);
                this.ignoreChange = false;
                var index2 = getLastChangeIndex(delta[source]);
                this.quill.setSelection(index2);
              }
            }, {
              key: "clear",
              value: function clear() {
                this.stack = { undo: [], redo: [] };
              }
            }, {
              key: "cutoff",
              value: function cutoff() {
                this.lastRecorded = 0;
              }
            }, {
              key: "record",
              value: function record(changeDelta, oldDelta) {
                if (changeDelta.ops.length === 0)
                  return;
                this.stack.redo = [];
                var undoDelta = this.quill.getContents().diff(oldDelta);
                var timestamp = Date.now();
                if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {
                  var delta = this.stack.undo.pop();
                  undoDelta = undoDelta.compose(delta.undo);
                  changeDelta = delta.redo.compose(changeDelta);
                } else {
                  this.lastRecorded = timestamp;
                }
                this.stack.undo.push({
                  redo: changeDelta,
                  undo: undoDelta
                });
                if (this.stack.undo.length > this.options.maxStack) {
                  this.stack.undo.shift();
                }
              }
            }, {
              key: "redo",
              value: function redo2() {
                this.change("redo", "undo");
              }
            }, {
              key: "transform",
              value: function transform(delta) {
                this.stack.undo.forEach(function(change) {
                  change.undo = delta.transform(change.undo, true);
                  change.redo = delta.transform(change.redo, true);
                });
                this.stack.redo.forEach(function(change) {
                  change.undo = delta.transform(change.undo, true);
                  change.redo = delta.transform(change.redo, true);
                });
              }
            }, {
              key: "undo",
              value: function undo2() {
                this.change("undo", "redo");
              }
            }]);
            return History2;
          }(_module2.default);
          History.DEFAULTS = {
            delay: 1e3,
            maxStack: 100,
            userOnly: false
          };
          function endsWithNewlineChange(delta) {
            var lastOp = delta.ops[delta.ops.length - 1];
            if (lastOp == null)
              return false;
            if (lastOp.insert != null) {
              return typeof lastOp.insert === "string" && lastOp.insert.endsWith("\n");
            }
            if (lastOp.attributes != null) {
              return Object.keys(lastOp.attributes).some(function(attr) {
                return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;
              });
            }
            return false;
          }
          function getLastChangeIndex(delta) {
            var deleteLength = delta.reduce(function(length, op) {
              length += op.delete || 0;
              return length;
            }, 0);
            var changeIndex = delta.length() - deleteLength;
            if (endsWithNewlineChange(delta)) {
              changeIndex -= 1;
            }
            return changeIndex;
          }
          exports3.default = History;
          exports3.getLastChangeIndex = getLastChangeIndex;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.BaseTooltip = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _emitter = __webpack_require__(8);
          var _emitter2 = _interopRequireDefault(_emitter);
          var _keyboard = __webpack_require__(23);
          var _keyboard2 = _interopRequireDefault(_keyboard);
          var _theme = __webpack_require__(34);
          var _theme2 = _interopRequireDefault(_theme);
          var _colorPicker = __webpack_require__(59);
          var _colorPicker2 = _interopRequireDefault(_colorPicker);
          var _iconPicker = __webpack_require__(60);
          var _iconPicker2 = _interopRequireDefault(_iconPicker);
          var _picker = __webpack_require__(28);
          var _picker2 = _interopRequireDefault(_picker);
          var _tooltip = __webpack_require__(61);
          var _tooltip2 = _interopRequireDefault(_tooltip);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ALIGNS = [false, "center", "right", "justify"];
          var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"];
          var FONTS = [false, "serif", "monospace"];
          var HEADERS = ["1", "2", "3", false];
          var SIZES = ["small", false, "large", "huge"];
          var BaseTheme = function(_Theme) {
            _inherits(BaseTheme2, _Theme);
            function BaseTheme2(quill2, options) {
              _classCallCheck(this, BaseTheme2);
              var _this = _possibleConstructorReturn(this, (BaseTheme2.__proto__ || Object.getPrototypeOf(BaseTheme2)).call(this, quill2, options));
              var listener = function listener2(e) {
                if (!document.body.contains(quill2.root)) {
                  return document.body.removeEventListener("click", listener2);
                }
                if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {
                  _this.tooltip.hide();
                }
                if (_this.pickers != null) {
                  _this.pickers.forEach(function(picker) {
                    if (!picker.container.contains(e.target)) {
                      picker.close();
                    }
                  });
                }
              };
              quill2.emitter.listenDOM("click", document.body, listener);
              return _this;
            }
            _createClass(BaseTheme2, [{
              key: "addModule",
              value: function addModule(name2) {
                var module4 = _get(BaseTheme2.prototype.__proto__ || Object.getPrototypeOf(BaseTheme2.prototype), "addModule", this).call(this, name2);
                if (name2 === "toolbar") {
                  this.extendToolbar(module4);
                }
                return module4;
              }
            }, {
              key: "buildButtons",
              value: function buildButtons(buttons, icons) {
                buttons.forEach(function(button) {
                  var className = button.getAttribute("class") || "";
                  className.split(/\s+/).forEach(function(name2) {
                    if (!name2.startsWith("ql-"))
                      return;
                    name2 = name2.slice("ql-".length);
                    if (icons[name2] == null)
                      return;
                    if (name2 === "direction") {
                      button.innerHTML = icons[name2][""] + icons[name2]["rtl"];
                    } else if (typeof icons[name2] === "string") {
                      button.innerHTML = icons[name2];
                    } else {
                      var value2 = button.value || "";
                      if (value2 != null && icons[name2][value2]) {
                        button.innerHTML = icons[name2][value2];
                      }
                    }
                  });
                });
              }
            }, {
              key: "buildPickers",
              value: function buildPickers(selects, icons) {
                var _this2 = this;
                this.pickers = selects.map(function(select) {
                  if (select.classList.contains("ql-align")) {
                    if (select.querySelector("option") == null) {
                      fillSelect(select, ALIGNS);
                    }
                    return new _iconPicker2.default(select, icons.align);
                  } else if (select.classList.contains("ql-background") || select.classList.contains("ql-color")) {
                    var format = select.classList.contains("ql-background") ? "background" : "color";
                    if (select.querySelector("option") == null) {
                      fillSelect(select, COLORS, format === "background" ? "#ffffff" : "#000000");
                    }
                    return new _colorPicker2.default(select, icons[format]);
                  } else {
                    if (select.querySelector("option") == null) {
                      if (select.classList.contains("ql-font")) {
                        fillSelect(select, FONTS);
                      } else if (select.classList.contains("ql-header")) {
                        fillSelect(select, HEADERS);
                      } else if (select.classList.contains("ql-size")) {
                        fillSelect(select, SIZES);
                      }
                    }
                    return new _picker2.default(select);
                  }
                });
                var update = function update2() {
                  _this2.pickers.forEach(function(picker) {
                    picker.update();
                  });
                };
                this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);
              }
            }]);
            return BaseTheme2;
          }(_theme2.default);
          BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {
            modules: {
              toolbar: {
                handlers: {
                  formula: function formula() {
                    this.quill.theme.tooltip.edit("formula");
                  },
                  image: function image() {
                    var _this3 = this;
                    var fileInput = this.container.querySelector("input.ql-image[type=file]");
                    if (fileInput == null) {
                      fileInput = document.createElement("input");
                      fileInput.setAttribute("type", "file");
                      fileInput.setAttribute("accept", "image/png, image/gif, image/jpeg, image/bmp, image/x-icon");
                      fileInput.classList.add("ql-image");
                      fileInput.addEventListener("change", function() {
                        if (fileInput.files != null && fileInput.files[0] != null) {
                          var reader = new FileReader();
                          reader.onload = function(e) {
                            var range = _this3.quill.getSelection(true);
                            _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);
                            _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);
                            fileInput.value = "";
                          };
                          reader.readAsDataURL(fileInput.files[0]);
                        }
                      });
                      this.container.appendChild(fileInput);
                    }
                    fileInput.click();
                  },
                  video: function video() {
                    this.quill.theme.tooltip.edit("video");
                  }
                }
              }
            }
          });
          var BaseTooltip = function(_Tooltip) {
            _inherits(BaseTooltip2, _Tooltip);
            function BaseTooltip2(quill2, boundsContainer) {
              _classCallCheck(this, BaseTooltip2);
              var _this4 = _possibleConstructorReturn(this, (BaseTooltip2.__proto__ || Object.getPrototypeOf(BaseTooltip2)).call(this, quill2, boundsContainer));
              _this4.textbox = _this4.root.querySelector('input[type="text"]');
              _this4.listen();
              return _this4;
            }
            _createClass(BaseTooltip2, [{
              key: "listen",
              value: function listen() {
                var _this5 = this;
                this.textbox.addEventListener("keydown", function(event) {
                  if (_keyboard2.default.match(event, "enter")) {
                    _this5.save();
                    event.preventDefault();
                  } else if (_keyboard2.default.match(event, "escape")) {
                    _this5.cancel();
                    event.preventDefault();
                  }
                });
              }
            }, {
              key: "cancel",
              value: function cancel() {
                this.hide();
              }
            }, {
              key: "edit",
              value: function edit() {
                var mode = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "link";
                var preview = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
                this.root.classList.remove("ql-hidden");
                this.root.classList.add("ql-editing");
                if (preview != null) {
                  this.textbox.value = preview;
                } else if (mode !== this.root.getAttribute("data-mode")) {
                  this.textbox.value = "";
                }
                this.position(this.quill.getBounds(this.quill.selection.savedRange));
                this.textbox.select();
                this.textbox.setAttribute("placeholder", this.textbox.getAttribute("data-" + mode) || "");
                this.root.setAttribute("data-mode", mode);
              }
            }, {
              key: "restoreFocus",
              value: function restoreFocus() {
                var scrollTop = this.quill.scrollingContainer.scrollTop;
                this.quill.focus();
                this.quill.scrollingContainer.scrollTop = scrollTop;
              }
            }, {
              key: "save",
              value: function save() {
                var value2 = this.textbox.value;
                switch (this.root.getAttribute("data-mode")) {
                  case "link": {
                    var scrollTop = this.quill.root.scrollTop;
                    if (this.linkRange) {
                      this.quill.formatText(this.linkRange, "link", value2, _emitter2.default.sources.USER);
                      delete this.linkRange;
                    } else {
                      this.restoreFocus();
                      this.quill.format("link", value2, _emitter2.default.sources.USER);
                    }
                    this.quill.root.scrollTop = scrollTop;
                    break;
                  }
                  case "video": {
                    value2 = extractVideoUrl(value2);
                  }
                  case "formula": {
                    if (!value2)
                      break;
                    var range = this.quill.getSelection(true);
                    if (range != null) {
                      var index2 = range.index + range.length;
                      this.quill.insertEmbed(index2, this.root.getAttribute("data-mode"), value2, _emitter2.default.sources.USER);
                      if (this.root.getAttribute("data-mode") === "formula") {
                        this.quill.insertText(index2 + 1, " ", _emitter2.default.sources.USER);
                      }
                      this.quill.setSelection(index2 + 2, _emitter2.default.sources.USER);
                    }
                    break;
                  }
                }
                this.textbox.value = "";
                this.hide();
              }
            }]);
            return BaseTooltip2;
          }(_tooltip2.default);
          function extractVideoUrl(url) {
            var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
            if (match) {
              return (match[1] || "https") + "://www.youtube.com/embed/" + match[2] + "?showinfo=0";
            }
            if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) {
              return (match[1] || "https") + "://player.vimeo.com/video/" + match[2] + "/";
            }
            return url;
          }
          function fillSelect(select, values) {
            var defaultValue = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
            values.forEach(function(value2) {
              var option = document.createElement("option");
              if (value2 === defaultValue) {
                option.setAttribute("selected", "selected");
              } else {
                option.setAttribute("value", value2);
              }
              select.appendChild(option);
            });
          }
          exports3.BaseTooltip = BaseTooltip;
          exports3.default = BaseTheme;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", { value: true });
          var LinkedList = function() {
            function LinkedList2() {
              this.head = this.tail = null;
              this.length = 0;
            }
            LinkedList2.prototype.append = function() {
              var nodes = [];
              for (var _i = 0; _i < arguments.length; _i++) {
                nodes[_i] = arguments[_i];
              }
              this.insertBefore(nodes[0], null);
              if (nodes.length > 1) {
                this.append.apply(this, nodes.slice(1));
              }
            };
            LinkedList2.prototype.contains = function(node) {
              var cur2, next = this.iterator();
              while (cur2 = next()) {
                if (cur2 === node)
                  return true;
              }
              return false;
            };
            LinkedList2.prototype.insertBefore = function(node, refNode) {
              if (!node)
                return;
              node.next = refNode;
              if (refNode != null) {
                node.prev = refNode.prev;
                if (refNode.prev != null) {
                  refNode.prev.next = node;
                }
                refNode.prev = node;
                if (refNode === this.head) {
                  this.head = node;
                }
              } else if (this.tail != null) {
                this.tail.next = node;
                node.prev = this.tail;
                this.tail = node;
              } else {
                node.prev = null;
                this.head = this.tail = node;
              }
              this.length += 1;
            };
            LinkedList2.prototype.offset = function(target) {
              var index2 = 0, cur2 = this.head;
              while (cur2 != null) {
                if (cur2 === target)
                  return index2;
                index2 += cur2.length();
                cur2 = cur2.next;
              }
              return -1;
            };
            LinkedList2.prototype.remove = function(node) {
              if (!this.contains(node))
                return;
              if (node.prev != null)
                node.prev.next = node.next;
              if (node.next != null)
                node.next.prev = node.prev;
              if (node === this.head)
                this.head = node.next;
              if (node === this.tail)
                this.tail = node.prev;
              this.length -= 1;
            };
            LinkedList2.prototype.iterator = function(curNode) {
              if (curNode === void 0) {
                curNode = this.head;
              }
              return function() {
                var ret = curNode;
                if (curNode != null)
                  curNode = curNode.next;
                return ret;
              };
            };
            LinkedList2.prototype.find = function(index2, inclusive) {
              if (inclusive === void 0) {
                inclusive = false;
              }
              var cur2, next = this.iterator();
              while (cur2 = next()) {
                var length = cur2.length();
                if (index2 < length || inclusive && index2 === length && (cur2.next == null || cur2.next.length() !== 0)) {
                  return [cur2, index2];
                }
                index2 -= length;
              }
              return [null, 0];
            };
            LinkedList2.prototype.forEach = function(callback) {
              var cur2, next = this.iterator();
              while (cur2 = next()) {
                callback(cur2);
              }
            };
            LinkedList2.prototype.forEachAt = function(index2, length, callback) {
              if (length <= 0)
                return;
              var _a2 = this.find(index2), startNode = _a2[0], offset = _a2[1];
              var cur2, curIndex = index2 - offset, next = this.iterator(startNode);
              while ((cur2 = next()) && curIndex < index2 + length) {
                var curLength = cur2.length();
                if (index2 > curIndex) {
                  callback(cur2, index2 - curIndex, Math.min(length, curIndex + curLength - index2));
                } else {
                  callback(cur2, 0, Math.min(curLength, index2 + length - curIndex));
                }
                curIndex += curLength;
              }
            };
            LinkedList2.prototype.map = function(callback) {
              return this.reduce(function(memo, cur2) {
                memo.push(callback(cur2));
                return memo;
              }, []);
            };
            LinkedList2.prototype.reduce = function(callback, memo) {
              var cur2, next = this.iterator();
              while (cur2 = next()) {
                memo = callback(memo, cur2);
              }
              return memo;
            };
            return LinkedList2;
          }();
          exports3.default = LinkedList;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var container_1 = __webpack_require__(17);
          var Registry = __webpack_require__(1);
          var OBSERVER_CONFIG = {
            attributes: true,
            characterData: true,
            characterDataOldValue: true,
            childList: true,
            subtree: true
          };
          var MAX_OPTIMIZE_ITERATIONS = 100;
          var ScrollBlot = function(_super) {
            __extends(ScrollBlot2, _super);
            function ScrollBlot2(node) {
              var _this = _super.call(this, node) || this;
              _this.scroll = _this;
              _this.observer = new MutationObserver(function(mutations) {
                _this.update(mutations);
              });
              _this.observer.observe(_this.domNode, OBSERVER_CONFIG);
              _this.attach();
              return _this;
            }
            ScrollBlot2.prototype.detach = function() {
              _super.prototype.detach.call(this);
              this.observer.disconnect();
            };
            ScrollBlot2.prototype.deleteAt = function(index2, length) {
              this.update();
              if (index2 === 0 && length === this.length()) {
                this.children.forEach(function(child) {
                  child.remove();
                });
              } else {
                _super.prototype.deleteAt.call(this, index2, length);
              }
            };
            ScrollBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              this.update();
              _super.prototype.formatAt.call(this, index2, length, name2, value2);
            };
            ScrollBlot2.prototype.insertAt = function(index2, value2, def) {
              this.update();
              _super.prototype.insertAt.call(this, index2, value2, def);
            };
            ScrollBlot2.prototype.optimize = function(mutations, context) {
              var _this = this;
              if (mutations === void 0) {
                mutations = [];
              }
              if (context === void 0) {
                context = {};
              }
              _super.prototype.optimize.call(this, context);
              var records = [].slice.call(this.observer.takeRecords());
              while (records.length > 0)
                mutations.push(records.pop());
              var mark = function(blot, markParent) {
                if (markParent === void 0) {
                  markParent = true;
                }
                if (blot == null || blot === _this)
                  return;
                if (blot.domNode.parentNode == null)
                  return;
                if (blot.domNode[Registry.DATA_KEY].mutations == null) {
                  blot.domNode[Registry.DATA_KEY].mutations = [];
                }
                if (markParent)
                  mark(blot.parent);
              };
              var optimize = function(blot) {
                if (blot.domNode[Registry.DATA_KEY] == null || blot.domNode[Registry.DATA_KEY].mutations == null) {
                  return;
                }
                if (blot instanceof container_1.default) {
                  blot.children.forEach(optimize);
                }
                blot.optimize(context);
              };
              var remaining = mutations;
              for (var i2 = 0; remaining.length > 0; i2 += 1) {
                if (i2 >= MAX_OPTIMIZE_ITERATIONS) {
                  throw new Error("[Parchment] Maximum optimize iterations reached");
                }
                remaining.forEach(function(mutation) {
                  var blot = Registry.find(mutation.target, true);
                  if (blot == null)
                    return;
                  if (blot.domNode === mutation.target) {
                    if (mutation.type === "childList") {
                      mark(Registry.find(mutation.previousSibling, false));
                      [].forEach.call(mutation.addedNodes, function(node) {
                        var child = Registry.find(node, false);
                        mark(child, false);
                        if (child instanceof container_1.default) {
                          child.children.forEach(function(grandChild) {
                            mark(grandChild, false);
                          });
                        }
                      });
                    } else if (mutation.type === "attributes") {
                      mark(blot.prev);
                    }
                  }
                  mark(blot);
                });
                this.children.forEach(optimize);
                remaining = [].slice.call(this.observer.takeRecords());
                records = remaining.slice();
                while (records.length > 0)
                  mutations.push(records.pop());
              }
            };
            ScrollBlot2.prototype.update = function(mutations, context) {
              var _this = this;
              if (context === void 0) {
                context = {};
              }
              mutations = mutations || this.observer.takeRecords();
              mutations.map(function(mutation) {
                var blot = Registry.find(mutation.target, true);
                if (blot == null)
                  return null;
                if (blot.domNode[Registry.DATA_KEY].mutations == null) {
                  blot.domNode[Registry.DATA_KEY].mutations = [mutation];
                  return blot;
                } else {
                  blot.domNode[Registry.DATA_KEY].mutations.push(mutation);
                  return null;
                }
              }).forEach(function(blot) {
                if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)
                  return;
                blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);
              });
              if (this.domNode[Registry.DATA_KEY].mutations != null) {
                _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);
              }
              this.optimize(mutations, context);
            };
            ScrollBlot2.blotName = "scroll";
            ScrollBlot2.defaultChild = "block";
            ScrollBlot2.scope = Registry.Scope.BLOCK_BLOT;
            ScrollBlot2.tagName = "DIV";
            return ScrollBlot2;
          }(container_1.default);
          exports3.default = ScrollBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var format_1 = __webpack_require__(18);
          var Registry = __webpack_require__(1);
          function isEqual(obj1, obj2) {
            if (Object.keys(obj1).length !== Object.keys(obj2).length)
              return false;
            for (var prop in obj1) {
              if (obj1[prop] !== obj2[prop])
                return false;
            }
            return true;
          }
          var InlineBlot = function(_super) {
            __extends(InlineBlot2, _super);
            function InlineBlot2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            InlineBlot2.formats = function(domNode) {
              if (domNode.tagName === InlineBlot2.tagName)
                return void 0;
              return _super.formats.call(this, domNode);
            };
            InlineBlot2.prototype.format = function(name2, value2) {
              var _this = this;
              if (name2 === this.statics.blotName && !value2) {
                this.children.forEach(function(child) {
                  if (!(child instanceof format_1.default)) {
                    child = child.wrap(InlineBlot2.blotName, true);
                  }
                  _this.attributes.copy(child);
                });
                this.unwrap();
              } else {
                _super.prototype.format.call(this, name2, value2);
              }
            };
            InlineBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              if (this.formats()[name2] != null || Registry.query(name2, Registry.Scope.ATTRIBUTE)) {
                var blot = this.isolate(index2, length);
                blot.format(name2, value2);
              } else {
                _super.prototype.formatAt.call(this, index2, length, name2, value2);
              }
            };
            InlineBlot2.prototype.optimize = function(context) {
              _super.prototype.optimize.call(this, context);
              var formats = this.formats();
              if (Object.keys(formats).length === 0) {
                return this.unwrap();
              }
              var next = this.next;
              if (next instanceof InlineBlot2 && next.prev === this && isEqual(formats, next.formats())) {
                next.moveChildren(this);
                next.remove();
              }
            };
            InlineBlot2.blotName = "inline";
            InlineBlot2.scope = Registry.Scope.INLINE_BLOT;
            InlineBlot2.tagName = "SPAN";
            return InlineBlot2;
          }(format_1.default);
          exports3.default = InlineBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var format_1 = __webpack_require__(18);
          var Registry = __webpack_require__(1);
          var BlockBlot = function(_super) {
            __extends(BlockBlot2, _super);
            function BlockBlot2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            BlockBlot2.formats = function(domNode) {
              var tagName = Registry.query(BlockBlot2.blotName).tagName;
              if (domNode.tagName === tagName)
                return void 0;
              return _super.formats.call(this, domNode);
            };
            BlockBlot2.prototype.format = function(name2, value2) {
              if (Registry.query(name2, Registry.Scope.BLOCK) == null) {
                return;
              } else if (name2 === this.statics.blotName && !value2) {
                this.replaceWith(BlockBlot2.blotName);
              } else {
                _super.prototype.format.call(this, name2, value2);
              }
            };
            BlockBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              if (Registry.query(name2, Registry.Scope.BLOCK) != null) {
                this.format(name2, value2);
              } else {
                _super.prototype.formatAt.call(this, index2, length, name2, value2);
              }
            };
            BlockBlot2.prototype.insertAt = function(index2, value2, def) {
              if (def == null || Registry.query(value2, Registry.Scope.INLINE) != null) {
                _super.prototype.insertAt.call(this, index2, value2, def);
              } else {
                var after = this.split(index2);
                var blot = Registry.create(value2, def);
                after.parent.insertBefore(blot, after);
              }
            };
            BlockBlot2.prototype.update = function(mutations, context) {
              if (navigator.userAgent.match(/Trident/)) {
                this.build();
              } else {
                _super.prototype.update.call(this, mutations, context);
              }
            };
            BlockBlot2.blotName = "block";
            BlockBlot2.scope = Registry.Scope.BLOCK_BLOT;
            BlockBlot2.tagName = "P";
            return BlockBlot2;
          }(format_1.default);
          exports3.default = BlockBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var leaf_1 = __webpack_require__(19);
          var EmbedBlot = function(_super) {
            __extends(EmbedBlot2, _super);
            function EmbedBlot2() {
              return _super !== null && _super.apply(this, arguments) || this;
            }
            EmbedBlot2.formats = function(domNode) {
              return void 0;
            };
            EmbedBlot2.prototype.format = function(name2, value2) {
              _super.prototype.formatAt.call(this, 0, this.length(), name2, value2);
            };
            EmbedBlot2.prototype.formatAt = function(index2, length, name2, value2) {
              if (index2 === 0 && length === this.length()) {
                this.format(name2, value2);
              } else {
                _super.prototype.formatAt.call(this, index2, length, name2, value2);
              }
            };
            EmbedBlot2.prototype.formats = function() {
              return this.statics.formats(this.domNode);
            };
            return EmbedBlot2;
          }(leaf_1.default);
          exports3.default = EmbedBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var __extends = this && this.__extends || function() {
            var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
              d.__proto__ = b;
            } || function(d, b) {
              for (var p in b)
                if (b.hasOwnProperty(p))
                  d[p] = b[p];
            };
            return function(d, b) {
              extendStatics(d, b);
              function __() {
                this.constructor = d;
              }
              d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
            };
          }();
          Object.defineProperty(exports3, "__esModule", { value: true });
          var leaf_1 = __webpack_require__(19);
          var Registry = __webpack_require__(1);
          var TextBlot = function(_super) {
            __extends(TextBlot2, _super);
            function TextBlot2(node) {
              var _this = _super.call(this, node) || this;
              _this.text = _this.statics.value(_this.domNode);
              return _this;
            }
            TextBlot2.create = function(value2) {
              return document.createTextNode(value2);
            };
            TextBlot2.value = function(domNode) {
              var text = domNode.data;
              if (text["normalize"])
                text = text["normalize"]();
              return text;
            };
            TextBlot2.prototype.deleteAt = function(index2, length) {
              this.domNode.data = this.text = this.text.slice(0, index2) + this.text.slice(index2 + length);
            };
            TextBlot2.prototype.index = function(node, offset) {
              if (this.domNode === node) {
                return offset;
              }
              return -1;
            };
            TextBlot2.prototype.insertAt = function(index2, value2, def) {
              if (def == null) {
                this.text = this.text.slice(0, index2) + value2 + this.text.slice(index2);
                this.domNode.data = this.text;
              } else {
                _super.prototype.insertAt.call(this, index2, value2, def);
              }
            };
            TextBlot2.prototype.length = function() {
              return this.text.length;
            };
            TextBlot2.prototype.optimize = function(context) {
              _super.prototype.optimize.call(this, context);
              this.text = this.statics.value(this.domNode);
              if (this.text.length === 0) {
                this.remove();
              } else if (this.next instanceof TextBlot2 && this.next.prev === this) {
                this.insertAt(this.length(), this.next.value());
                this.next.remove();
              }
            };
            TextBlot2.prototype.position = function(index2, inclusive) {
              return [this.domNode, index2];
            };
            TextBlot2.prototype.split = function(index2, force) {
              if (force === void 0) {
                force = false;
              }
              if (!force) {
                if (index2 === 0)
                  return this;
                if (index2 === this.length())
                  return this.next;
              }
              var after = Registry.create(this.domNode.splitText(index2));
              this.parent.insertBefore(after, this.next);
              this.text = this.statics.value(this.domNode);
              return after;
            };
            TextBlot2.prototype.update = function(mutations, context) {
              var _this = this;
              if (mutations.some(function(mutation) {
                return mutation.type === "characterData" && mutation.target === _this.domNode;
              })) {
                this.text = this.statics.value(this.domNode);
              }
            };
            TextBlot2.prototype.value = function() {
              return this.text;
            };
            TextBlot2.blotName = "text";
            TextBlot2.scope = Registry.Scope.INLINE_BLOT;
            return TextBlot2;
          }(leaf_1.default);
          exports3.default = TextBlot;
        },
        function(module3, exports3, __webpack_require__) {
          var elem = document.createElement("div");
          elem.classList.toggle("test-class", false);
          if (elem.classList.contains("test-class")) {
            var _toggle = DOMTokenList.prototype.toggle;
            DOMTokenList.prototype.toggle = function(token, force) {
              if (arguments.length > 1 && !this.contains(token) === !force) {
                return force;
              } else {
                return _toggle.call(this, token);
              }
            };
          }
          if (!String.prototype.startsWith) {
            String.prototype.startsWith = function(searchString, position) {
              position = position || 0;
              return this.substr(position, searchString.length) === searchString;
            };
          }
          if (!String.prototype.endsWith) {
            String.prototype.endsWith = function(searchString, position) {
              var subjectString = this.toString();
              if (typeof position !== "number" || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {
                position = subjectString.length;
              }
              position -= searchString.length;
              var lastIndex = subjectString.indexOf(searchString, position);
              return lastIndex !== -1 && lastIndex === position;
            };
          }
          if (!Array.prototype.find) {
            Object.defineProperty(Array.prototype, "find", {
              value: function value2(predicate) {
                if (this === null) {
                  throw new TypeError("Array.prototype.find called on null or undefined");
                }
                if (typeof predicate !== "function") {
                  throw new TypeError("predicate must be a function");
                }
                var list = Object(this);
                var length = list.length >>> 0;
                var thisArg = arguments[1];
                var value3;
                for (var i2 = 0; i2 < length; i2++) {
                  value3 = list[i2];
                  if (predicate.call(thisArg, value3, i2, list)) {
                    return value3;
                  }
                }
                return void 0;
              }
            });
          }
          document.addEventListener("DOMContentLoaded", function() {
            document.execCommand("enableObjectResizing", false, false);
            document.execCommand("autoUrlDetect", false, false);
          });
        },
        function(module3, exports3) {
          var DIFF_DELETE = -1;
          var DIFF_INSERT = 1;
          var DIFF_EQUAL = 0;
          function diff_main(text1, text2, cursor_pos) {
            if (text1 == text2) {
              if (text1) {
                return [[DIFF_EQUAL, text1]];
              }
              return [];
            }
            if (cursor_pos < 0 || text1.length < cursor_pos) {
              cursor_pos = null;
            }
            var commonlength = diff_commonPrefix(text1, text2);
            var commonprefix = text1.substring(0, commonlength);
            text1 = text1.substring(commonlength);
            text2 = text2.substring(commonlength);
            commonlength = diff_commonSuffix(text1, text2);
            var commonsuffix = text1.substring(text1.length - commonlength);
            text1 = text1.substring(0, text1.length - commonlength);
            text2 = text2.substring(0, text2.length - commonlength);
            var diffs = diff_compute_(text1, text2);
            if (commonprefix) {
              diffs.unshift([DIFF_EQUAL, commonprefix]);
            }
            if (commonsuffix) {
              diffs.push([DIFF_EQUAL, commonsuffix]);
            }
            diff_cleanupMerge(diffs);
            if (cursor_pos != null) {
              diffs = fix_cursor(diffs, cursor_pos);
            }
            diffs = fix_emoji(diffs);
            return diffs;
          }
          function diff_compute_(text1, text2) {
            var diffs;
            if (!text1) {
              return [[DIFF_INSERT, text2]];
            }
            if (!text2) {
              return [[DIFF_DELETE, text1]];
            }
            var longtext = text1.length > text2.length ? text1 : text2;
            var shorttext = text1.length > text2.length ? text2 : text1;
            var i2 = longtext.indexOf(shorttext);
            if (i2 != -1) {
              diffs = [
                [DIFF_INSERT, longtext.substring(0, i2)],
                [DIFF_EQUAL, shorttext],
                [DIFF_INSERT, longtext.substring(i2 + shorttext.length)]
              ];
              if (text1.length > text2.length) {
                diffs[0][0] = diffs[2][0] = DIFF_DELETE;
              }
              return diffs;
            }
            if (shorttext.length == 1) {
              return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
            }
            var hm = diff_halfMatch_(text1, text2);
            if (hm) {
              var text1_a = hm[0];
              var text1_b = hm[1];
              var text2_a = hm[2];
              var text2_b = hm[3];
              var mid_common = hm[4];
              var diffs_a = diff_main(text1_a, text2_a);
              var diffs_b = diff_main(text1_b, text2_b);
              return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);
            }
            return diff_bisect_(text1, text2);
          }
          function diff_bisect_(text1, text2) {
            var text1_length = text1.length;
            var text2_length = text2.length;
            var max_d = Math.ceil((text1_length + text2_length) / 2);
            var v_offset = max_d;
            var v_length = 2 * max_d;
            var v1 = new Array(v_length);
            var v2 = new Array(v_length);
            for (var x = 0; x < v_length; x++) {
              v1[x] = -1;
              v2[x] = -1;
            }
            v1[v_offset + 1] = 0;
            v2[v_offset + 1] = 0;
            var delta = text1_length - text2_length;
            var front = delta % 2 != 0;
            var k1start = 0;
            var k1end = 0;
            var k2start = 0;
            var k2end = 0;
            for (var d = 0; d < max_d; d++) {
              for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
                var k1_offset = v_offset + k1;
                var x1;
                if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
                  x1 = v1[k1_offset + 1];
                } else {
                  x1 = v1[k1_offset - 1] + 1;
                }
                var y1 = x1 - k1;
                while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) {
                  x1++;
                  y1++;
                }
                v1[k1_offset] = x1;
                if (x1 > text1_length) {
                  k1end += 2;
                } else if (y1 > text2_length) {
                  k1start += 2;
                } else if (front) {
                  var k2_offset = v_offset + delta - k1;
                  if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
                    var x2 = text1_length - v2[k2_offset];
                    if (x1 >= x2) {
                      return diff_bisectSplit_(text1, text2, x1, y1);
                    }
                  }
                }
              }
              for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
                var k2_offset = v_offset + k2;
                var x2;
                if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
                  x2 = v2[k2_offset + 1];
                } else {
                  x2 = v2[k2_offset - 1] + 1;
                }
                var y2 = x2 - k2;
                while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) {
                  x2++;
                  y2++;
                }
                v2[k2_offset] = x2;
                if (x2 > text1_length) {
                  k2end += 2;
                } else if (y2 > text2_length) {
                  k2start += 2;
                } else if (!front) {
                  var k1_offset = v_offset + delta - k2;
                  if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
                    var x1 = v1[k1_offset];
                    var y1 = v_offset + x1 - k1_offset;
                    x2 = text1_length - x2;
                    if (x1 >= x2) {
                      return diff_bisectSplit_(text1, text2, x1, y1);
                    }
                  }
                }
              }
            }
            return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];
          }
          function diff_bisectSplit_(text1, text2, x, y) {
            var text1a = text1.substring(0, x);
            var text2a = text2.substring(0, y);
            var text1b = text1.substring(x);
            var text2b = text2.substring(y);
            var diffs = diff_main(text1a, text2a);
            var diffsb = diff_main(text1b, text2b);
            return diffs.concat(diffsb);
          }
          function diff_commonPrefix(text1, text2) {
            if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
              return 0;
            }
            var pointermin = 0;
            var pointermax = Math.min(text1.length, text2.length);
            var pointermid = pointermax;
            var pointerstart = 0;
            while (pointermin < pointermid) {
              if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
                pointermin = pointermid;
                pointerstart = pointermin;
              } else {
                pointermax = pointermid;
              }
              pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
            }
            return pointermid;
          }
          function diff_commonSuffix(text1, text2) {
            if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
              return 0;
            }
            var pointermin = 0;
            var pointermax = Math.min(text1.length, text2.length);
            var pointermid = pointermax;
            var pointerend = 0;
            while (pointermin < pointermid) {
              if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
                pointermin = pointermid;
                pointerend = pointermin;
              } else {
                pointermax = pointermid;
              }
              pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
            }
            return pointermid;
          }
          function diff_halfMatch_(text1, text2) {
            var longtext = text1.length > text2.length ? text1 : text2;
            var shorttext = text1.length > text2.length ? text2 : text1;
            if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
              return null;
            }
            function diff_halfMatchI_(longtext2, shorttext2, i2) {
              var seed = longtext2.substring(i2, i2 + Math.floor(longtext2.length / 4));
              var j = -1;
              var best_common = "";
              var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
              while ((j = shorttext2.indexOf(seed, j + 1)) != -1) {
                var prefixLength = diff_commonPrefix(longtext2.substring(i2), shorttext2.substring(j));
                var suffixLength = diff_commonSuffix(longtext2.substring(0, i2), shorttext2.substring(0, j));
                if (best_common.length < suffixLength + prefixLength) {
                  best_common = shorttext2.substring(j - suffixLength, j) + shorttext2.substring(j, j + prefixLength);
                  best_longtext_a = longtext2.substring(0, i2 - suffixLength);
                  best_longtext_b = longtext2.substring(i2 + prefixLength);
                  best_shorttext_a = shorttext2.substring(0, j - suffixLength);
                  best_shorttext_b = shorttext2.substring(j + prefixLength);
                }
              }
              if (best_common.length * 2 >= longtext2.length) {
                return [
                  best_longtext_a,
                  best_longtext_b,
                  best_shorttext_a,
                  best_shorttext_b,
                  best_common
                ];
              } else {
                return null;
              }
            }
            var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));
            var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
            var hm;
            if (!hm1 && !hm2) {
              return null;
            } else if (!hm2) {
              hm = hm1;
            } else if (!hm1) {
              hm = hm2;
            } else {
              hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
            }
            var text1_a, text1_b, text2_a, text2_b;
            if (text1.length > text2.length) {
              text1_a = hm[0];
              text1_b = hm[1];
              text2_a = hm[2];
              text2_b = hm[3];
            } else {
              text2_a = hm[0];
              text2_b = hm[1];
              text1_a = hm[2];
              text1_b = hm[3];
            }
            var mid_common = hm[4];
            return [text1_a, text1_b, text2_a, text2_b, mid_common];
          }
          function diff_cleanupMerge(diffs) {
            diffs.push([DIFF_EQUAL, ""]);
            var pointer = 0;
            var count_delete = 0;
            var count_insert = 0;
            var text_delete = "";
            var text_insert = "";
            var commonlength;
            while (pointer < diffs.length) {
              switch (diffs[pointer][0]) {
                case DIFF_INSERT:
                  count_insert++;
                  text_insert += diffs[pointer][1];
                  pointer++;
                  break;
                case DIFF_DELETE:
                  count_delete++;
                  text_delete += diffs[pointer][1];
                  pointer++;
                  break;
                case DIFF_EQUAL:
                  if (count_delete + count_insert > 1) {
                    if (count_delete !== 0 && count_insert !== 0) {
                      commonlength = diff_commonPrefix(text_insert, text_delete);
                      if (commonlength !== 0) {
                        if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
                          diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
                        } else {
                          diffs.splice(0, 0, [
                            DIFF_EQUAL,
                            text_insert.substring(0, commonlength)
                          ]);
                          pointer++;
                        }
                        text_insert = text_insert.substring(commonlength);
                        text_delete = text_delete.substring(commonlength);
                      }
                      commonlength = diff_commonSuffix(text_insert, text_delete);
                      if (commonlength !== 0) {
                        diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
                        text_insert = text_insert.substring(0, text_insert.length - commonlength);
                        text_delete = text_delete.substring(0, text_delete.length - commonlength);
                      }
                    }
                    if (count_delete === 0) {
                      diffs.splice(pointer - count_insert, count_delete + count_insert, [DIFF_INSERT, text_insert]);
                    } else if (count_insert === 0) {
                      diffs.splice(pointer - count_delete, count_delete + count_insert, [DIFF_DELETE, text_delete]);
                    } else {
                      diffs.splice(pointer - count_delete - count_insert, count_delete + count_insert, [DIFF_DELETE, text_delete], [DIFF_INSERT, text_insert]);
                    }
                    pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
                  } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
                    diffs[pointer - 1][1] += diffs[pointer][1];
                    diffs.splice(pointer, 1);
                  } else {
                    pointer++;
                  }
                  count_insert = 0;
                  count_delete = 0;
                  text_delete = "";
                  text_insert = "";
                  break;
              }
            }
            if (diffs[diffs.length - 1][1] === "") {
              diffs.pop();
            }
            var changes = false;
            pointer = 1;
            while (pointer < diffs.length - 1) {
              if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
                  diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
                  diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
                  diffs.splice(pointer - 1, 1);
                  changes = true;
                } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
                  diffs[pointer - 1][1] += diffs[pointer + 1][1];
                  diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
                  diffs.splice(pointer + 1, 1);
                  changes = true;
                }
              }
              pointer++;
            }
            if (changes) {
              diff_cleanupMerge(diffs);
            }
          }
          var diff = diff_main;
          diff.INSERT = DIFF_INSERT;
          diff.DELETE = DIFF_DELETE;
          diff.EQUAL = DIFF_EQUAL;
          module3.exports = diff;
          function cursor_normalize_diff(diffs, cursor_pos) {
            if (cursor_pos === 0) {
              return [DIFF_EQUAL, diffs];
            }
            for (var current_pos = 0, i2 = 0; i2 < diffs.length; i2++) {
              var d = diffs[i2];
              if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {
                var next_pos = current_pos + d[1].length;
                if (cursor_pos === next_pos) {
                  return [i2 + 1, diffs];
                } else if (cursor_pos < next_pos) {
                  diffs = diffs.slice();
                  var split_pos = cursor_pos - current_pos;
                  var d_left = [d[0], d[1].slice(0, split_pos)];
                  var d_right = [d[0], d[1].slice(split_pos)];
                  diffs.splice(i2, 1, d_left, d_right);
                  return [i2 + 1, diffs];
                } else {
                  current_pos = next_pos;
                }
              }
            }
            throw new Error("cursor_pos is out of bounds!");
          }
          function fix_cursor(diffs, cursor_pos) {
            var norm = cursor_normalize_diff(diffs, cursor_pos);
            var ndiffs = norm[1];
            var cursor_pointer = norm[0];
            var d = ndiffs[cursor_pointer];
            var d_next = ndiffs[cursor_pointer + 1];
            if (d == null) {
              return diffs;
            } else if (d[0] !== DIFF_EQUAL) {
              return diffs;
            } else {
              if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {
                ndiffs.splice(cursor_pointer, 2, d_next, d);
                return merge_tuples(ndiffs, cursor_pointer, 2);
              } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {
                ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);
                var suffix = d_next[1].slice(d[1].length);
                if (suffix.length > 0) {
                  ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);
                }
                return merge_tuples(ndiffs, cursor_pointer, 3);
              } else {
                return diffs;
              }
            }
          }
          function fix_emoji(diffs) {
            var compact2 = false;
            var starts_with_pair_end = function(str) {
              return str.charCodeAt(0) >= 56320 && str.charCodeAt(0) <= 57343;
            };
            var ends_with_pair_start = function(str) {
              return str.charCodeAt(str.length - 1) >= 55296 && str.charCodeAt(str.length - 1) <= 56319;
            };
            for (var i2 = 2; i2 < diffs.length; i2 += 1) {
              if (diffs[i2 - 2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i2 - 2][1]) && diffs[i2 - 1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i2 - 1][1]) && diffs[i2][0] === DIFF_INSERT && starts_with_pair_end(diffs[i2][1])) {
                compact2 = true;
                diffs[i2 - 1][1] = diffs[i2 - 2][1].slice(-1) + diffs[i2 - 1][1];
                diffs[i2][1] = diffs[i2 - 2][1].slice(-1) + diffs[i2][1];
                diffs[i2 - 2][1] = diffs[i2 - 2][1].slice(0, -1);
              }
            }
            if (!compact2) {
              return diffs;
            }
            var fixed_diffs = [];
            for (var i2 = 0; i2 < diffs.length; i2 += 1) {
              if (diffs[i2][1].length > 0) {
                fixed_diffs.push(diffs[i2]);
              }
            }
            return fixed_diffs;
          }
          function merge_tuples(diffs, start, length) {
            for (var i2 = start + length - 1; i2 >= 0 && i2 >= start - 1; i2--) {
              if (i2 + 1 < diffs.length) {
                var left_d = diffs[i2];
                var right_d = diffs[i2 + 1];
                if (left_d[0] === right_d[1]) {
                  diffs.splice(i2, 2, [left_d[0], left_d[1] + right_d[1]]);
                }
              }
            }
            return diffs;
          }
        },
        function(module3, exports3) {
          exports3 = module3.exports = typeof Object.keys === "function" ? Object.keys : shim;
          exports3.shim = shim;
          function shim(obj) {
            var keys2 = [];
            for (var key in obj)
              keys2.push(key);
            return keys2;
          }
        },
        function(module3, exports3) {
          var supportsArgumentsClass = function() {
            return Object.prototype.toString.call(arguments);
          }() == "[object Arguments]";
          exports3 = module3.exports = supportsArgumentsClass ? supported : unsupported;
          exports3.supported = supported;
          function supported(object) {
            return Object.prototype.toString.call(object) == "[object Arguments]";
          }
          exports3.unsupported = unsupported;
          function unsupported(object) {
            return object && typeof object == "object" && typeof object.length == "number" && Object.prototype.hasOwnProperty.call(object, "callee") && !Object.prototype.propertyIsEnumerable.call(object, "callee") || false;
          }
        },
        function(module3, exports3) {
          var has = Object.prototype.hasOwnProperty, prefix = "~";
          function Events() {
          }
          if (Object.create) {
            Events.prototype = Object.create(null);
            if (!new Events().__proto__)
              prefix = false;
          }
          function EE(fn, context, once) {
            this.fn = fn;
            this.context = context;
            this.once = once || false;
          }
          function EventEmitter() {
            this._events = new Events();
            this._eventsCount = 0;
          }
          EventEmitter.prototype.eventNames = function eventNames() {
            var names = [], events, name2;
            if (this._eventsCount === 0)
              return names;
            for (name2 in events = this._events) {
              if (has.call(events, name2))
                names.push(prefix ? name2.slice(1) : name2);
            }
            if (Object.getOwnPropertySymbols) {
              return names.concat(Object.getOwnPropertySymbols(events));
            }
            return names;
          };
          EventEmitter.prototype.listeners = function listeners(event, exists) {
            var evt = prefix ? prefix + event : event, available = this._events[evt];
            if (exists)
              return !!available;
            if (!available)
              return [];
            if (available.fn)
              return [available.fn];
            for (var i2 = 0, l = available.length, ee = new Array(l); i2 < l; i2++) {
              ee[i2] = available[i2].fn;
            }
            return ee;
          };
          EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
            var evt = prefix ? prefix + event : event;
            if (!this._events[evt])
              return false;
            var listeners = this._events[evt], len = arguments.length, args, i2;
            if (listeners.fn) {
              if (listeners.once)
                this.removeListener(event, listeners.fn, void 0, true);
              switch (len) {
                case 1:
                  return listeners.fn.call(listeners.context), true;
                case 2:
                  return listeners.fn.call(listeners.context, a1), true;
                case 3:
                  return listeners.fn.call(listeners.context, a1, a2), true;
                case 4:
                  return listeners.fn.call(listeners.context, a1, a2, a3), true;
                case 5:
                  return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
                case 6:
                  return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
              }
              for (i2 = 1, args = new Array(len - 1); i2 < len; i2++) {
                args[i2 - 1] = arguments[i2];
              }
              listeners.fn.apply(listeners.context, args);
            } else {
              var length = listeners.length, j;
              for (i2 = 0; i2 < length; i2++) {
                if (listeners[i2].once)
                  this.removeListener(event, listeners[i2].fn, void 0, true);
                switch (len) {
                  case 1:
                    listeners[i2].fn.call(listeners[i2].context);
                    break;
                  case 2:
                    listeners[i2].fn.call(listeners[i2].context, a1);
                    break;
                  case 3:
                    listeners[i2].fn.call(listeners[i2].context, a1, a2);
                    break;
                  case 4:
                    listeners[i2].fn.call(listeners[i2].context, a1, a2, a3);
                    break;
                  default:
                    if (!args)
                      for (j = 1, args = new Array(len - 1); j < len; j++) {
                        args[j - 1] = arguments[j];
                      }
                    listeners[i2].fn.apply(listeners[i2].context, args);
                }
              }
            }
            return true;
          };
          EventEmitter.prototype.on = function on2(event, fn, context) {
            var listener = new EE(fn, context || this), evt = prefix ? prefix + event : event;
            if (!this._events[evt])
              this._events[evt] = listener, this._eventsCount++;
            else if (!this._events[evt].fn)
              this._events[evt].push(listener);
            else
              this._events[evt] = [this._events[evt], listener];
            return this;
          };
          EventEmitter.prototype.once = function once(event, fn, context) {
            var listener = new EE(fn, context || this, true), evt = prefix ? prefix + event : event;
            if (!this._events[evt])
              this._events[evt] = listener, this._eventsCount++;
            else if (!this._events[evt].fn)
              this._events[evt].push(listener);
            else
              this._events[evt] = [this._events[evt], listener];
            return this;
          };
          EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {
            var evt = prefix ? prefix + event : event;
            if (!this._events[evt])
              return this;
            if (!fn) {
              if (--this._eventsCount === 0)
                this._events = new Events();
              else
                delete this._events[evt];
              return this;
            }
            var listeners = this._events[evt];
            if (listeners.fn) {
              if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
                if (--this._eventsCount === 0)
                  this._events = new Events();
                else
                  delete this._events[evt];
              }
            } else {
              for (var i2 = 0, events = [], length = listeners.length; i2 < length; i2++) {
                if (listeners[i2].fn !== fn || once && !listeners[i2].once || context && listeners[i2].context !== context) {
                  events.push(listeners[i2]);
                }
              }
              if (events.length)
                this._events[evt] = events.length === 1 ? events[0] : events;
              else if (--this._eventsCount === 0)
                this._events = new Events();
              else
                delete this._events[evt];
            }
            return this;
          };
          EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {
            var evt;
            if (event) {
              evt = prefix ? prefix + event : event;
              if (this._events[evt]) {
                if (--this._eventsCount === 0)
                  this._events = new Events();
                else
                  delete this._events[evt];
              }
            } else {
              this._events = new Events();
              this._eventsCount = 0;
            }
            return this;
          };
          EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
          EventEmitter.prototype.addListener = EventEmitter.prototype.on;
          EventEmitter.prototype.setMaxListeners = function setMaxListeners() {
            return this;
          };
          EventEmitter.prefixed = prefix;
          EventEmitter.EventEmitter = EventEmitter;
          if (typeof module3 !== "undefined") {
            module3.exports = EventEmitter;
          }
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.matchText = exports3.matchSpacing = exports3.matchNewline = exports3.matchBlot = exports3.matchAttributor = exports3.default = void 0;
          var _typeof2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
            return typeof obj;
          } : function(obj) {
            return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
          };
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _extend2 = __webpack_require__(3);
          var _extend3 = _interopRequireDefault(_extend2);
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          var _align = __webpack_require__(36);
          var _background = __webpack_require__(37);
          var _code = __webpack_require__(13);
          var _code2 = _interopRequireDefault(_code);
          var _color = __webpack_require__(26);
          var _direction = __webpack_require__(38);
          var _font = __webpack_require__(39);
          var _size = __webpack_require__(40);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var debug = (0, _logger2.default)("quill:clipboard");
          var DOM_KEY = "__ql-matcher";
          var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ["br", matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ["li", matchIndent], ["b", matchAlias.bind(matchAlias, "bold")], ["i", matchAlias.bind(matchAlias, "italic")], ["style", matchIgnore]];
          var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function(memo, attr) {
            memo[attr.keyName] = attr;
            return memo;
          }, {});
          var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function(memo, attr) {
            memo[attr.keyName] = attr;
            return memo;
          }, {});
          var Clipboard2 = function(_Module) {
            _inherits(Clipboard3, _Module);
            function Clipboard3(quill2, options) {
              _classCallCheck(this, Clipboard3);
              var _this = _possibleConstructorReturn(this, (Clipboard3.__proto__ || Object.getPrototypeOf(Clipboard3)).call(this, quill2, options));
              _this.quill.root.addEventListener("paste", _this.onPaste.bind(_this));
              _this.container = _this.quill.addContainer("ql-clipboard");
              _this.container.setAttribute("contenteditable", true);
              _this.container.setAttribute("tabindex", -1);
              _this.matchers = [];
              CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function(_ref) {
                var _ref2 = _slicedToArray(_ref, 2), selector = _ref2[0], matcher = _ref2[1];
                if (!options.matchVisual && matcher === matchSpacing)
                  return;
                _this.addMatcher(selector, matcher);
              });
              return _this;
            }
            _createClass(Clipboard3, [{
              key: "addMatcher",
              value: function addMatcher(selector, matcher) {
                this.matchers.push([selector, matcher]);
              }
            }, {
              key: "convert",
              value: function convert(html) {
                if (typeof html === "string") {
                  this.container.innerHTML = html.replace(/\>\r?\n +\</g, "><");
                  return this.convert();
                }
                var formats = this.quill.getFormat(this.quill.selection.savedRange.index);
                if (formats[_code2.default.blotName]) {
                  var text = this.container.innerText;
                  this.container.innerHTML = "";
                  return new _quillDelta2.default().insert(text, _defineProperty2({}, _code2.default.blotName, formats[_code2.default.blotName]));
                }
                var _prepareMatching = this.prepareMatching(), _prepareMatching2 = _slicedToArray(_prepareMatching, 2), elementMatchers = _prepareMatching2[0], textMatchers = _prepareMatching2[1];
                var delta = traverse(this.container, elementMatchers, textMatchers);
                if (deltaEndsWith(delta, "\n") && delta.ops[delta.ops.length - 1].attributes == null) {
                  delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));
                }
                debug.log("convert", this.container.innerHTML, delta);
                this.container.innerHTML = "";
                return delta;
              }
            }, {
              key: "dangerouslyPasteHTML",
              value: function dangerouslyPasteHTML(index2, html) {
                var source = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : _quill2.default.sources.API;
                if (typeof index2 === "string") {
                  this.quill.setContents(this.convert(index2), html);
                  this.quill.setSelection(0, _quill2.default.sources.SILENT);
                } else {
                  var paste = this.convert(html);
                  this.quill.updateContents(new _quillDelta2.default().retain(index2).concat(paste), source);
                  this.quill.setSelection(index2 + paste.length(), _quill2.default.sources.SILENT);
                }
              }
            }, {
              key: "onPaste",
              value: function onPaste(e) {
                var _this2 = this;
                if (e.defaultPrevented || !this.quill.isEnabled())
                  return;
                var range = this.quill.getSelection();
                var delta = new _quillDelta2.default().retain(range.index);
                var scrollTop = this.quill.scrollingContainer.scrollTop;
                this.container.focus();
                this.quill.selection.update(_quill2.default.sources.SILENT);
                setTimeout(function() {
                  delta = delta.concat(_this2.convert()).delete(range.length);
                  _this2.quill.updateContents(delta, _quill2.default.sources.USER);
                  _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);
                  _this2.quill.scrollingContainer.scrollTop = scrollTop;
                  _this2.quill.focus();
                }, 1);
              }
            }, {
              key: "prepareMatching",
              value: function prepareMatching() {
                var _this3 = this;
                var elementMatchers = [], textMatchers = [];
                this.matchers.forEach(function(pair2) {
                  var _pair = _slicedToArray(pair2, 2), selector = _pair[0], matcher = _pair[1];
                  switch (selector) {
                    case Node.TEXT_NODE:
                      textMatchers.push(matcher);
                      break;
                    case Node.ELEMENT_NODE:
                      elementMatchers.push(matcher);
                      break;
                    default:
                      [].forEach.call(_this3.container.querySelectorAll(selector), function(node) {
                        node[DOM_KEY] = node[DOM_KEY] || [];
                        node[DOM_KEY].push(matcher);
                      });
                      break;
                  }
                });
                return [elementMatchers, textMatchers];
              }
            }]);
            return Clipboard3;
          }(_module2.default);
          Clipboard2.DEFAULTS = {
            matchers: [],
            matchVisual: true
          };
          function applyFormat(delta, format, value2) {
            if ((typeof format === "undefined" ? "undefined" : _typeof2(format)) === "object") {
              return Object.keys(format).reduce(function(delta2, key) {
                return applyFormat(delta2, key, format[key]);
              }, delta);
            } else {
              return delta.reduce(function(delta2, op) {
                if (op.attributes && op.attributes[format]) {
                  return delta2.push(op);
                } else {
                  return delta2.insert(op.insert, (0, _extend3.default)({}, _defineProperty2({}, format, value2), op.attributes));
                }
              }, new _quillDelta2.default());
            }
          }
          function computeStyle(node) {
            if (node.nodeType !== Node.ELEMENT_NODE)
              return {};
            var DOM_KEY2 = "__ql-computed-style";
            return node[DOM_KEY2] || (node[DOM_KEY2] = window.getComputedStyle(node));
          }
          function deltaEndsWith(delta, text) {
            var endText = "";
            for (var i2 = delta.ops.length - 1; i2 >= 0 && endText.length < text.length; --i2) {
              var op = delta.ops[i2];
              if (typeof op.insert !== "string")
                break;
              endText = op.insert + endText;
            }
            return endText.slice(-1 * text.length) === text;
          }
          function isLine(node) {
            if (node.childNodes.length === 0)
              return false;
            var style = computeStyle(node);
            return ["block", "list-item"].indexOf(style.display) > -1;
          }
          function traverse(node, elementMatchers, textMatchers) {
            if (node.nodeType === node.TEXT_NODE) {
              return textMatchers.reduce(function(delta, matcher) {
                return matcher(node, delta);
              }, new _quillDelta2.default());
            } else if (node.nodeType === node.ELEMENT_NODE) {
              return [].reduce.call(node.childNodes || [], function(delta, childNode) {
                var childrenDelta = traverse(childNode, elementMatchers, textMatchers);
                if (childNode.nodeType === node.ELEMENT_NODE) {
                  childrenDelta = elementMatchers.reduce(function(childrenDelta2, matcher) {
                    return matcher(childNode, childrenDelta2);
                  }, childrenDelta);
                  childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta2, matcher) {
                    return matcher(childNode, childrenDelta2);
                  }, childrenDelta);
                }
                return delta.concat(childrenDelta);
              }, new _quillDelta2.default());
            } else {
              return new _quillDelta2.default();
            }
          }
          function matchAlias(format, node, delta) {
            return applyFormat(delta, format, true);
          }
          function matchAttributor(node, delta) {
            var attributes = _parchment2.default.Attributor.Attribute.keys(node);
            var classes = _parchment2.default.Attributor.Class.keys(node);
            var styles = _parchment2.default.Attributor.Style.keys(node);
            var formats = {};
            attributes.concat(classes).concat(styles).forEach(function(name2) {
              var attr = _parchment2.default.query(name2, _parchment2.default.Scope.ATTRIBUTE);
              if (attr != null) {
                formats[attr.attrName] = attr.value(node);
                if (formats[attr.attrName])
                  return;
              }
              attr = ATTRIBUTE_ATTRIBUTORS[name2];
              if (attr != null && (attr.attrName === name2 || attr.keyName === name2)) {
                formats[attr.attrName] = attr.value(node) || void 0;
              }
              attr = STYLE_ATTRIBUTORS[name2];
              if (attr != null && (attr.attrName === name2 || attr.keyName === name2)) {
                attr = STYLE_ATTRIBUTORS[name2];
                formats[attr.attrName] = attr.value(node) || void 0;
              }
            });
            if (Object.keys(formats).length > 0) {
              delta = applyFormat(delta, formats);
            }
            return delta;
          }
          function matchBlot(node, delta) {
            var match = _parchment2.default.query(node);
            if (match == null)
              return delta;
            if (match.prototype instanceof _parchment2.default.Embed) {
              var embed = {};
              var value2 = match.value(node);
              if (value2 != null) {
                embed[match.blotName] = value2;
                delta = new _quillDelta2.default().insert(embed, match.formats(node));
              }
            } else if (typeof match.formats === "function") {
              delta = applyFormat(delta, match.blotName, match.formats(node));
            }
            return delta;
          }
          function matchBreak(node, delta) {
            if (!deltaEndsWith(delta, "\n")) {
              delta.insert("\n");
            }
            return delta;
          }
          function matchIgnore() {
            return new _quillDelta2.default();
          }
          function matchIndent(node, delta) {
            var match = _parchment2.default.query(node);
            if (match == null || match.blotName !== "list-item" || !deltaEndsWith(delta, "\n")) {
              return delta;
            }
            var indent = -1, parent = node.parentNode;
            while (!parent.classList.contains("ql-clipboard")) {
              if ((_parchment2.default.query(parent) || {}).blotName === "list") {
                indent += 1;
              }
              parent = parent.parentNode;
            }
            if (indent <= 0)
              return delta;
            return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent }));
          }
          function matchNewline(node, delta) {
            if (!deltaEndsWith(delta, "\n")) {
              if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {
                delta.insert("\n");
              }
            }
            return delta;
          }
          function matchSpacing(node, delta) {
            if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, "\n\n")) {
              var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);
              if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {
                delta.insert("\n");
              }
            }
            return delta;
          }
          function matchStyles(node, delta) {
            var formats = {};
            var style = node.style || {};
            if (style.fontStyle && computeStyle(node).fontStyle === "italic") {
              formats.italic = true;
            }
            if (style.fontWeight && (computeStyle(node).fontWeight.startsWith("bold") || parseInt(computeStyle(node).fontWeight) >= 700)) {
              formats.bold = true;
            }
            if (Object.keys(formats).length > 0) {
              delta = applyFormat(delta, formats);
            }
            if (parseFloat(style.textIndent || 0) > 0) {
              delta = new _quillDelta2.default().insert("	").concat(delta);
            }
            return delta;
          }
          function matchText(node, delta) {
            var text = node.data;
            if (node.parentNode.tagName === "O:P") {
              return delta.insert(text.trim());
            }
            if (text.trim().length === 0 && node.parentNode.classList.contains("ql-clipboard")) {
              return delta;
            }
            if (!computeStyle(node.parentNode).whiteSpace.startsWith("pre")) {
              var replacer = function replacer2(collapse, match) {
                match = match.replace(/[^\u00a0]/g, "");
                return match.length < 1 && collapse ? " " : match;
              };
              text = text.replace(/\r\n/g, " ").replace(/\n/g, " ");
              text = text.replace(/\s\s+/g, replacer.bind(replacer, true));
              if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {
                text = text.replace(/^\s+/, replacer.bind(replacer, false));
              }
              if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {
                text = text.replace(/\s+$/, replacer.bind(replacer, false));
              }
            }
            return delta.insert(text);
          }
          exports3.default = Clipboard2;
          exports3.matchAttributor = matchAttributor;
          exports3.matchBlot = matchBlot;
          exports3.matchNewline = matchNewline;
          exports3.matchSpacing = matchSpacing;
          exports3.matchText = matchText;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Bold = function(_Inline) {
            _inherits(Bold2, _Inline);
            function Bold2() {
              _classCallCheck(this, Bold2);
              return _possibleConstructorReturn(this, (Bold2.__proto__ || Object.getPrototypeOf(Bold2)).apply(this, arguments));
            }
            _createClass(Bold2, [{
              key: "optimize",
              value: function optimize(context) {
                _get(Bold2.prototype.__proto__ || Object.getPrototypeOf(Bold2.prototype), "optimize", this).call(this, context);
                if (this.domNode.tagName !== this.statics.tagName[0]) {
                  this.replaceWith(this.statics.blotName);
                }
              }
            }], [{
              key: "create",
              value: function create() {
                return _get(Bold2.__proto__ || Object.getPrototypeOf(Bold2), "create", this).call(this);
              }
            }, {
              key: "formats",
              value: function formats() {
                return true;
              }
            }]);
            return Bold2;
          }(_inline2.default);
          Bold.blotName = "bold";
          Bold.tagName = ["STRONG", "B"];
          exports3.default = Bold;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.addControls = exports3.default = void 0;
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _quillDelta = __webpack_require__(2);
          var _quillDelta2 = _interopRequireDefault(_quillDelta);
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _logger = __webpack_require__(10);
          var _logger2 = _interopRequireDefault(_logger);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var debug = (0, _logger2.default)("quill:toolbar");
          var Toolbar = function(_Module) {
            _inherits(Toolbar2, _Module);
            function Toolbar2(quill2, options) {
              _classCallCheck(this, Toolbar2);
              var _this = _possibleConstructorReturn(this, (Toolbar2.__proto__ || Object.getPrototypeOf(Toolbar2)).call(this, quill2, options));
              if (Array.isArray(_this.options.container)) {
                var container = document.createElement("div");
                addControls(container, _this.options.container);
                quill2.container.parentNode.insertBefore(container, quill2.container);
                _this.container = container;
              } else if (typeof _this.options.container === "string") {
                _this.container = document.querySelector(_this.options.container);
              } else {
                _this.container = _this.options.container;
              }
              if (!(_this.container instanceof HTMLElement)) {
                var _ret;
                return _ret = debug.error("Container required for toolbar", _this.options), _possibleConstructorReturn(_this, _ret);
              }
              _this.container.classList.add("ql-toolbar");
              _this.controls = [];
              _this.handlers = {};
              Object.keys(_this.options.handlers).forEach(function(format) {
                _this.addHandler(format, _this.options.handlers[format]);
              });
              [].forEach.call(_this.container.querySelectorAll("button, select"), function(input) {
                _this.attach(input);
              });
              _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function(type, range) {
                if (type === _quill2.default.events.SELECTION_CHANGE) {
                  _this.update(range);
                }
              });
              _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
                var _this$quill$selection = _this.quill.selection.getRange(), _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), range = _this$quill$selection2[0];
                _this.update(range);
              });
              return _this;
            }
            _createClass(Toolbar2, [{
              key: "addHandler",
              value: function addHandler(format, handler) {
                this.handlers[format] = handler;
              }
            }, {
              key: "attach",
              value: function attach(input) {
                var _this2 = this;
                var format = [].find.call(input.classList, function(className) {
                  return className.indexOf("ql-") === 0;
                });
                if (!format)
                  return;
                format = format.slice("ql-".length);
                if (input.tagName === "BUTTON") {
                  input.setAttribute("type", "button");
                }
                if (this.handlers[format] == null) {
                  if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {
                    debug.warn("ignoring attaching to disabled format", format, input);
                    return;
                  }
                  if (_parchment2.default.query(format) == null) {
                    debug.warn("ignoring attaching to nonexistent format", format, input);
                    return;
                  }
                }
                var eventName = input.tagName === "SELECT" ? "change" : "click";
                input.addEventListener(eventName, function(e) {
                  var value2 = void 0;
                  if (input.tagName === "SELECT") {
                    if (input.selectedIndex < 0)
                      return;
                    var selected = input.options[input.selectedIndex];
                    if (selected.hasAttribute("selected")) {
                      value2 = false;
                    } else {
                      value2 = selected.value || false;
                    }
                  } else {
                    if (input.classList.contains("ql-active")) {
                      value2 = false;
                    } else {
                      value2 = input.value || !input.hasAttribute("value");
                    }
                    e.preventDefault();
                  }
                  _this2.quill.focus();
                  var _quill$selection$getR = _this2.quill.selection.getRange(), _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), range = _quill$selection$getR2[0];
                  if (_this2.handlers[format] != null) {
                    _this2.handlers[format].call(_this2, value2);
                  } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {
                    value2 = prompt("Enter " + format);
                    if (!value2)
                      return;
                    _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty2({}, format, value2)), _quill2.default.sources.USER);
                  } else {
                    _this2.quill.format(format, value2, _quill2.default.sources.USER);
                  }
                  _this2.update(range);
                });
                this.controls.push([format, input]);
              }
            }, {
              key: "update",
              value: function update(range) {
                var formats = range == null ? {} : this.quill.getFormat(range);
                this.controls.forEach(function(pair2) {
                  var _pair = _slicedToArray(pair2, 2), format = _pair[0], input = _pair[1];
                  if (input.tagName === "SELECT") {
                    var option = void 0;
                    if (range == null) {
                      option = null;
                    } else if (formats[format] == null) {
                      option = input.querySelector("option[selected]");
                    } else if (!Array.isArray(formats[format])) {
                      var value2 = formats[format];
                      if (typeof value2 === "string") {
                        value2 = value2.replace(/\"/g, '\\"');
                      }
                      option = input.querySelector('option[value="' + value2 + '"]');
                    }
                    if (option == null) {
                      input.value = "";
                      input.selectedIndex = -1;
                    } else {
                      option.selected = true;
                    }
                  } else {
                    if (range == null) {
                      input.classList.remove("ql-active");
                    } else if (input.hasAttribute("value")) {
                      var isActive = formats[format] === input.getAttribute("value") || formats[format] != null && formats[format].toString() === input.getAttribute("value") || formats[format] == null && !input.getAttribute("value");
                      input.classList.toggle("ql-active", isActive);
                    } else {
                      input.classList.toggle("ql-active", formats[format] != null);
                    }
                  }
                });
              }
            }]);
            return Toolbar2;
          }(_module2.default);
          Toolbar.DEFAULTS = {};
          function addButton(container, format, value2) {
            var input = document.createElement("button");
            input.setAttribute("type", "button");
            input.classList.add("ql-" + format);
            if (value2 != null) {
              input.value = value2;
            }
            container.appendChild(input);
          }
          function addControls(container, groups) {
            if (!Array.isArray(groups[0])) {
              groups = [groups];
            }
            groups.forEach(function(controls) {
              var group = document.createElement("span");
              group.classList.add("ql-formats");
              controls.forEach(function(control) {
                if (typeof control === "string") {
                  addButton(group, control);
                } else {
                  var format = Object.keys(control)[0];
                  var value2 = control[format];
                  if (Array.isArray(value2)) {
                    addSelect(group, format, value2);
                  } else {
                    addButton(group, format, value2);
                  }
                }
              });
              container.appendChild(group);
            });
          }
          function addSelect(container, format, values) {
            var input = document.createElement("select");
            input.classList.add("ql-" + format);
            values.forEach(function(value2) {
              var option = document.createElement("option");
              if (value2 !== false) {
                option.setAttribute("value", value2);
              } else {
                option.setAttribute("selected", "selected");
              }
              input.appendChild(option);
            });
            container.appendChild(input);
          }
          Toolbar.DEFAULTS = {
            container: null,
            handlers: {
              clean: function clean() {
                var _this3 = this;
                var range = this.quill.getSelection();
                if (range == null)
                  return;
                if (range.length == 0) {
                  var formats = this.quill.getFormat();
                  Object.keys(formats).forEach(function(name2) {
                    if (_parchment2.default.query(name2, _parchment2.default.Scope.INLINE) != null) {
                      _this3.quill.format(name2, false);
                    }
                  });
                } else {
                  this.quill.removeFormat(range, _quill2.default.sources.USER);
                }
              },
              direction: function direction(value2) {
                var align = this.quill.getFormat()["align"];
                if (value2 === "rtl" && align == null) {
                  this.quill.format("align", "right", _quill2.default.sources.USER);
                } else if (!value2 && align === "right") {
                  this.quill.format("align", false, _quill2.default.sources.USER);
                }
                this.quill.format("direction", value2, _quill2.default.sources.USER);
              },
              indent: function indent(value2) {
                var range = this.quill.getSelection();
                var formats = this.quill.getFormat(range);
                var indent2 = parseInt(formats.indent || 0);
                if (value2 === "+1" || value2 === "-1") {
                  var modifier = value2 === "+1" ? 1 : -1;
                  if (formats.direction === "rtl")
                    modifier *= -1;
                  this.quill.format("indent", indent2 + modifier, _quill2.default.sources.USER);
                }
              },
              link: function link(value2) {
                if (value2 === true) {
                  value2 = prompt("Enter link URL:");
                }
                this.quill.format("link", value2, _quill2.default.sources.USER);
              },
              list: function list(value2) {
                var range = this.quill.getSelection();
                var formats = this.quill.getFormat(range);
                if (value2 === "check") {
                  if (formats["list"] === "checked" || formats["list"] === "unchecked") {
                    this.quill.format("list", false, _quill2.default.sources.USER);
                  } else {
                    this.quill.format("list", "unchecked", _quill2.default.sources.USER);
                  }
                } else {
                  this.quill.format("list", value2, _quill2.default.sources.USER);
                }
              }
            }
          };
          exports3.default = Toolbar;
          exports3.addControls = addControls;
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"></polyline> <polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"></polyline> <line class=ql-stroke x1=10 x2=8 y1=5 y2=13></line> </svg>';
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _picker = __webpack_require__(28);
          var _picker2 = _interopRequireDefault(_picker);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ColorPicker = function(_Picker) {
            _inherits(ColorPicker2, _Picker);
            function ColorPicker2(select, label) {
              _classCallCheck(this, ColorPicker2);
              var _this = _possibleConstructorReturn(this, (ColorPicker2.__proto__ || Object.getPrototypeOf(ColorPicker2)).call(this, select));
              _this.label.innerHTML = label;
              _this.container.classList.add("ql-color-picker");
              [].slice.call(_this.container.querySelectorAll(".ql-picker-item"), 0, 7).forEach(function(item) {
                item.classList.add("ql-primary");
              });
              return _this;
            }
            _createClass(ColorPicker2, [{
              key: "buildItem",
              value: function buildItem(option) {
                var item = _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "buildItem", this).call(this, option);
                item.style.backgroundColor = option.getAttribute("value") || "";
                return item;
              }
            }, {
              key: "selectItem",
              value: function selectItem(item, trigger) {
                _get(ColorPicker2.prototype.__proto__ || Object.getPrototypeOf(ColorPicker2.prototype), "selectItem", this).call(this, item, trigger);
                var colorLabel = this.label.querySelector(".ql-color-label");
                var value2 = item ? item.getAttribute("data-value") || "" : "";
                if (colorLabel) {
                  if (colorLabel.tagName === "line") {
                    colorLabel.style.stroke = value2;
                  } else {
                    colorLabel.style.fill = value2;
                  }
                }
              }
            }]);
            return ColorPicker2;
          }(_picker2.default);
          exports3.default = ColorPicker;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _picker = __webpack_require__(28);
          var _picker2 = _interopRequireDefault(_picker);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var IconPicker2 = function(_Picker) {
            _inherits(IconPicker3, _Picker);
            function IconPicker3(select, icons) {
              _classCallCheck(this, IconPicker3);
              var _this = _possibleConstructorReturn(this, (IconPicker3.__proto__ || Object.getPrototypeOf(IconPicker3)).call(this, select));
              _this.container.classList.add("ql-icon-picker");
              [].forEach.call(_this.container.querySelectorAll(".ql-picker-item"), function(item) {
                item.innerHTML = icons[item.getAttribute("data-value") || ""];
              });
              _this.defaultItem = _this.container.querySelector(".ql-selected");
              _this.selectItem(_this.defaultItem);
              return _this;
            }
            _createClass(IconPicker3, [{
              key: "selectItem",
              value: function selectItem(item, trigger) {
                _get(IconPicker3.prototype.__proto__ || Object.getPrototypeOf(IconPicker3.prototype), "selectItem", this).call(this, item, trigger);
                item = item || this.defaultItem;
                this.label.innerHTML = item.innerHTML;
              }
            }]);
            return IconPicker3;
          }(_picker2.default);
          exports3.default = IconPicker2;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          var Tooltip = function() {
            function Tooltip2(quill2, boundsContainer) {
              var _this = this;
              _classCallCheck(this, Tooltip2);
              this.quill = quill2;
              this.boundsContainer = boundsContainer || document.body;
              this.root = quill2.addContainer("ql-tooltip");
              this.root.innerHTML = this.constructor.TEMPLATE;
              if (this.quill.root === this.quill.scrollingContainer) {
                this.quill.root.addEventListener("scroll", function() {
                  _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + "px";
                });
              }
              this.hide();
            }
            _createClass(Tooltip2, [{
              key: "hide",
              value: function hide() {
                this.root.classList.add("ql-hidden");
              }
            }, {
              key: "position",
              value: function position(reference) {
                var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;
                var top2 = reference.bottom + this.quill.root.scrollTop;
                this.root.style.left = left + "px";
                this.root.style.top = top2 + "px";
                this.root.classList.remove("ql-flip");
                var containerBounds = this.boundsContainer.getBoundingClientRect();
                var rootBounds = this.root.getBoundingClientRect();
                var shift2 = 0;
                if (rootBounds.right > containerBounds.right) {
                  shift2 = containerBounds.right - rootBounds.right;
                  this.root.style.left = left + shift2 + "px";
                }
                if (rootBounds.left < containerBounds.left) {
                  shift2 = containerBounds.left - rootBounds.left;
                  this.root.style.left = left + shift2 + "px";
                }
                if (rootBounds.bottom > containerBounds.bottom) {
                  var height = rootBounds.bottom - rootBounds.top;
                  var verticalShift = reference.bottom - reference.top + height;
                  this.root.style.top = top2 - verticalShift + "px";
                  this.root.classList.add("ql-flip");
                }
                return shift2;
              }
            }, {
              key: "show",
              value: function show() {
                this.root.classList.remove("ql-editing");
                this.root.classList.remove("ql-hidden");
              }
            }]);
            return Tooltip2;
          }();
          exports3.default = Tooltip;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _slicedToArray = function() {
            function sliceIterator(arr, i2) {
              var _arr = [];
              var _n = true;
              var _d = false;
              var _e = void 0;
              try {
                for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                  _arr.push(_s.value);
                  if (i2 && _arr.length === i2)
                    break;
                }
              } catch (err) {
                _d = true;
                _e = err;
              } finally {
                try {
                  if (!_n && _i["return"])
                    _i["return"]();
                } finally {
                  if (_d)
                    throw _e;
                }
              }
              return _arr;
            }
            return function(arr, i2) {
              if (Array.isArray(arr)) {
                return arr;
              } else if (Symbol.iterator in Object(arr)) {
                return sliceIterator(arr, i2);
              } else {
                throw new TypeError("Invalid attempt to destructure non-iterable instance");
              }
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _emitter = __webpack_require__(8);
          var _emitter2 = _interopRequireDefault(_emitter);
          var _base = __webpack_require__(43);
          var _base2 = _interopRequireDefault(_base);
          var _link = __webpack_require__(27);
          var _link2 = _interopRequireDefault(_link);
          var _selection = __webpack_require__(15);
          var _icons = __webpack_require__(41);
          var _icons2 = _interopRequireDefault(_icons);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var TOOLBAR_CONFIG = [[{ header: ["1", "2", "3", false] }], ["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]];
          var SnowTheme = function(_BaseTheme) {
            _inherits(SnowTheme2, _BaseTheme);
            function SnowTheme2(quill2, options) {
              _classCallCheck(this, SnowTheme2);
              if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
                options.modules.toolbar.container = TOOLBAR_CONFIG;
              }
              var _this = _possibleConstructorReturn(this, (SnowTheme2.__proto__ || Object.getPrototypeOf(SnowTheme2)).call(this, quill2, options));
              _this.quill.container.classList.add("ql-snow");
              return _this;
            }
            _createClass(SnowTheme2, [{
              key: "extendToolbar",
              value: function extendToolbar(toolbar) {
                toolbar.container.classList.add("ql-snow");
                this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
                this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
                this.tooltip = new SnowTooltip(this.quill, this.options.bounds);
                if (toolbar.container.querySelector(".ql-link")) {
                  this.quill.keyboard.addBinding({ key: "K", shortKey: true }, function(range, context) {
                    toolbar.handlers["link"].call(toolbar, !context.format.link);
                  });
                }
              }
            }]);
            return SnowTheme2;
          }(_base2.default);
          SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
            modules: {
              toolbar: {
                handlers: {
                  link: function link(value2) {
                    if (value2) {
                      var range = this.quill.getSelection();
                      if (range == null || range.length == 0)
                        return;
                      var preview = this.quill.getText(range);
                      if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf("mailto:") !== 0) {
                        preview = "mailto:" + preview;
                      }
                      var tooltip = this.quill.theme.tooltip;
                      tooltip.edit("link", preview);
                    } else {
                      this.quill.format("link", false);
                    }
                  }
                }
              }
            }
          });
          var SnowTooltip = function(_BaseTooltip) {
            _inherits(SnowTooltip2, _BaseTooltip);
            function SnowTooltip2(quill2, bounds) {
              _classCallCheck(this, SnowTooltip2);
              var _this2 = _possibleConstructorReturn(this, (SnowTooltip2.__proto__ || Object.getPrototypeOf(SnowTooltip2)).call(this, quill2, bounds));
              _this2.preview = _this2.root.querySelector("a.ql-preview");
              return _this2;
            }
            _createClass(SnowTooltip2, [{
              key: "listen",
              value: function listen() {
                var _this3 = this;
                _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "listen", this).call(this);
                this.root.querySelector("a.ql-action").addEventListener("click", function(event) {
                  if (_this3.root.classList.contains("ql-editing")) {
                    _this3.save();
                  } else {
                    _this3.edit("link", _this3.preview.textContent);
                  }
                  event.preventDefault();
                });
                this.root.querySelector("a.ql-remove").addEventListener("click", function(event) {
                  if (_this3.linkRange != null) {
                    var range = _this3.linkRange;
                    _this3.restoreFocus();
                    _this3.quill.formatText(range, "link", false, _emitter2.default.sources.USER);
                    delete _this3.linkRange;
                  }
                  event.preventDefault();
                  _this3.hide();
                });
                this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function(range, oldRange, source) {
                  if (range == null)
                    return;
                  if (range.length === 0 && source === _emitter2.default.sources.USER) {
                    var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), link = _quill$scroll$descend2[0], offset = _quill$scroll$descend2[1];
                    if (link != null) {
                      _this3.linkRange = new _selection.Range(range.index - offset, link.length());
                      var preview = _link2.default.formats(link.domNode);
                      _this3.preview.textContent = preview;
                      _this3.preview.setAttribute("href", preview);
                      _this3.show();
                      _this3.position(_this3.quill.getBounds(_this3.linkRange));
                      return;
                    }
                  } else {
                    delete _this3.linkRange;
                  }
                  _this3.hide();
                });
              }
            }, {
              key: "show",
              value: function show() {
                _get(SnowTooltip2.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip2.prototype), "show", this).call(this);
                this.root.removeAttribute("data-mode");
              }
            }]);
            return SnowTooltip2;
          }(_base.BaseTooltip);
          SnowTooltip.TEMPLATE = ['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-action"></a>', '<a class="ql-remove"></a>'].join("");
          exports3.default = SnowTheme;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _core = __webpack_require__(29);
          var _core2 = _interopRequireDefault(_core);
          var _align = __webpack_require__(36);
          var _direction = __webpack_require__(38);
          var _indent = __webpack_require__(64);
          var _blockquote = __webpack_require__(65);
          var _blockquote2 = _interopRequireDefault(_blockquote);
          var _header = __webpack_require__(66);
          var _header2 = _interopRequireDefault(_header);
          var _list = __webpack_require__(67);
          var _list2 = _interopRequireDefault(_list);
          var _background = __webpack_require__(37);
          var _color = __webpack_require__(26);
          var _font = __webpack_require__(39);
          var _size = __webpack_require__(40);
          var _bold = __webpack_require__(56);
          var _bold2 = _interopRequireDefault(_bold);
          var _italic = __webpack_require__(68);
          var _italic2 = _interopRequireDefault(_italic);
          var _link = __webpack_require__(27);
          var _link2 = _interopRequireDefault(_link);
          var _script = __webpack_require__(69);
          var _script2 = _interopRequireDefault(_script);
          var _strike = __webpack_require__(70);
          var _strike2 = _interopRequireDefault(_strike);
          var _underline = __webpack_require__(71);
          var _underline2 = _interopRequireDefault(_underline);
          var _image = __webpack_require__(72);
          var _image2 = _interopRequireDefault(_image);
          var _video = __webpack_require__(73);
          var _video2 = _interopRequireDefault(_video);
          var _code = __webpack_require__(13);
          var _code2 = _interopRequireDefault(_code);
          var _formula = __webpack_require__(74);
          var _formula2 = _interopRequireDefault(_formula);
          var _syntax = __webpack_require__(75);
          var _syntax2 = _interopRequireDefault(_syntax);
          var _toolbar = __webpack_require__(57);
          var _toolbar2 = _interopRequireDefault(_toolbar);
          var _icons = __webpack_require__(41);
          var _icons2 = _interopRequireDefault(_icons);
          var _picker = __webpack_require__(28);
          var _picker2 = _interopRequireDefault(_picker);
          var _colorPicker = __webpack_require__(59);
          var _colorPicker2 = _interopRequireDefault(_colorPicker);
          var _iconPicker = __webpack_require__(60);
          var _iconPicker2 = _interopRequireDefault(_iconPicker);
          var _tooltip = __webpack_require__(61);
          var _tooltip2 = _interopRequireDefault(_tooltip);
          var _bubble = __webpack_require__(108);
          var _bubble2 = _interopRequireDefault(_bubble);
          var _snow = __webpack_require__(62);
          var _snow2 = _interopRequireDefault(_snow);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          _core2.default.register({
            "attributors/attribute/direction": _direction.DirectionAttribute,
            "attributors/class/align": _align.AlignClass,
            "attributors/class/background": _background.BackgroundClass,
            "attributors/class/color": _color.ColorClass,
            "attributors/class/direction": _direction.DirectionClass,
            "attributors/class/font": _font.FontClass,
            "attributors/class/size": _size.SizeClass,
            "attributors/style/align": _align.AlignStyle,
            "attributors/style/background": _background.BackgroundStyle,
            "attributors/style/color": _color.ColorStyle,
            "attributors/style/direction": _direction.DirectionStyle,
            "attributors/style/font": _font.FontStyle,
            "attributors/style/size": _size.SizeStyle
          }, true);
          _core2.default.register({
            "formats/align": _align.AlignClass,
            "formats/direction": _direction.DirectionClass,
            "formats/indent": _indent.IndentClass,
            "formats/background": _background.BackgroundStyle,
            "formats/color": _color.ColorStyle,
            "formats/font": _font.FontClass,
            "formats/size": _size.SizeClass,
            "formats/blockquote": _blockquote2.default,
            "formats/code-block": _code2.default,
            "formats/header": _header2.default,
            "formats/list": _list2.default,
            "formats/bold": _bold2.default,
            "formats/code": _code.Code,
            "formats/italic": _italic2.default,
            "formats/link": _link2.default,
            "formats/script": _script2.default,
            "formats/strike": _strike2.default,
            "formats/underline": _underline2.default,
            "formats/image": _image2.default,
            "formats/video": _video2.default,
            "formats/list/item": _list.ListItem,
            "modules/formula": _formula2.default,
            "modules/syntax": _syntax2.default,
            "modules/toolbar": _toolbar2.default,
            "themes/bubble": _bubble2.default,
            "themes/snow": _snow2.default,
            "ui/icons": _icons2.default,
            "ui/picker": _picker2.default,
            "ui/icon-picker": _iconPicker2.default,
            "ui/color-picker": _colorPicker2.default,
            "ui/tooltip": _tooltip2.default
          }, true);
          exports3.default = _core2.default;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.IndentClass = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var IdentAttributor = function(_Parchment$Attributor) {
            _inherits(IdentAttributor2, _Parchment$Attributor);
            function IdentAttributor2() {
              _classCallCheck(this, IdentAttributor2);
              return _possibleConstructorReturn(this, (IdentAttributor2.__proto__ || Object.getPrototypeOf(IdentAttributor2)).apply(this, arguments));
            }
            _createClass(IdentAttributor2, [{
              key: "add",
              value: function add2(node, value2) {
                if (value2 === "+1" || value2 === "-1") {
                  var indent = this.value(node) || 0;
                  value2 = value2 === "+1" ? indent + 1 : indent - 1;
                }
                if (value2 === 0) {
                  this.remove(node);
                  return true;
                } else {
                  return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "add", this).call(this, node, value2);
                }
              }
            }, {
              key: "canAdd",
              value: function canAdd(node, value2) {
                return _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, value2) || _get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "canAdd", this).call(this, node, parseInt(value2));
              }
            }, {
              key: "value",
              value: function value2(node) {
                return parseInt(_get(IdentAttributor2.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor2.prototype), "value", this).call(this, node)) || void 0;
              }
            }]);
            return IdentAttributor2;
          }(_parchment2.default.Attributor.Class);
          var IndentClass = new IdentAttributor("indent", "ql-indent", {
            scope: _parchment2.default.Scope.BLOCK,
            whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
          });
          exports3.IndentClass = IndentClass;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Blockquote = function(_Block) {
            _inherits(Blockquote2, _Block);
            function Blockquote2() {
              _classCallCheck(this, Blockquote2);
              return _possibleConstructorReturn(this, (Blockquote2.__proto__ || Object.getPrototypeOf(Blockquote2)).apply(this, arguments));
            }
            return Blockquote2;
          }(_block2.default);
          Blockquote.blotName = "blockquote";
          Blockquote.tagName = "blockquote";
          exports3.default = Blockquote;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Header = function(_Block) {
            _inherits(Header2, _Block);
            function Header2() {
              _classCallCheck(this, Header2);
              return _possibleConstructorReturn(this, (Header2.__proto__ || Object.getPrototypeOf(Header2)).apply(this, arguments));
            }
            _createClass(Header2, null, [{
              key: "formats",
              value: function formats(domNode) {
                return this.tagName.indexOf(domNode.tagName) + 1;
              }
            }]);
            return Header2;
          }(_block2.default);
          Header.blotName = "header";
          Header.tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
          exports3.default = Header;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.ListItem = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _block = __webpack_require__(4);
          var _block2 = _interopRequireDefault(_block);
          var _container = __webpack_require__(25);
          var _container2 = _interopRequireDefault(_container);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, { value: value2, enumerable: true, configurable: true, writable: true });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ListItem = function(_Block) {
            _inherits(ListItem2, _Block);
            function ListItem2() {
              _classCallCheck(this, ListItem2);
              return _possibleConstructorReturn(this, (ListItem2.__proto__ || Object.getPrototypeOf(ListItem2)).apply(this, arguments));
            }
            _createClass(ListItem2, [{
              key: "format",
              value: function format(name2, value2) {
                if (name2 === List.blotName && !value2) {
                  this.replaceWith(_parchment2.default.create(this.statics.scope));
                } else {
                  _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "format", this).call(this, name2, value2);
                }
              }
            }, {
              key: "remove",
              value: function remove2() {
                if (this.prev == null && this.next == null) {
                  this.parent.remove();
                } else {
                  _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "remove", this).call(this);
                }
              }
            }, {
              key: "replaceWith",
              value: function replaceWith(name2, value2) {
                this.parent.isolate(this.offset(this.parent), this.length());
                if (name2 === this.parent.statics.blotName) {
                  this.parent.replaceWith(name2, value2);
                  return this;
                } else {
                  this.parent.unwrap();
                  return _get(ListItem2.prototype.__proto__ || Object.getPrototypeOf(ListItem2.prototype), "replaceWith", this).call(this, name2, value2);
                }
              }
            }], [{
              key: "formats",
              value: function formats(domNode) {
                return domNode.tagName === this.tagName ? void 0 : _get(ListItem2.__proto__ || Object.getPrototypeOf(ListItem2), "formats", this).call(this, domNode);
              }
            }]);
            return ListItem2;
          }(_block2.default);
          ListItem.blotName = "list-item";
          ListItem.tagName = "LI";
          var List = function(_Container) {
            _inherits(List2, _Container);
            _createClass(List2, null, [{
              key: "create",
              value: function create(value2) {
                var tagName = value2 === "ordered" ? "OL" : "UL";
                var node = _get(List2.__proto__ || Object.getPrototypeOf(List2), "create", this).call(this, tagName);
                if (value2 === "checked" || value2 === "unchecked") {
                  node.setAttribute("data-checked", value2 === "checked");
                }
                return node;
              }
            }, {
              key: "formats",
              value: function formats(domNode) {
                if (domNode.tagName === "OL")
                  return "ordered";
                if (domNode.tagName === "UL") {
                  if (domNode.hasAttribute("data-checked")) {
                    return domNode.getAttribute("data-checked") === "true" ? "checked" : "unchecked";
                  } else {
                    return "bullet";
                  }
                }
                return void 0;
              }
            }]);
            function List2(domNode) {
              _classCallCheck(this, List2);
              var _this2 = _possibleConstructorReturn(this, (List2.__proto__ || Object.getPrototypeOf(List2)).call(this, domNode));
              var listEventHandler = function listEventHandler2(e) {
                if (e.target.parentNode !== domNode)
                  return;
                var format = _this2.statics.formats(domNode);
                var blot = _parchment2.default.find(e.target);
                if (format === "checked") {
                  blot.format("list", "unchecked");
                } else if (format === "unchecked") {
                  blot.format("list", "checked");
                }
              };
              domNode.addEventListener("touchstart", listEventHandler);
              domNode.addEventListener("mousedown", listEventHandler);
              return _this2;
            }
            _createClass(List2, [{
              key: "format",
              value: function format(name2, value2) {
                if (this.children.length > 0) {
                  this.children.tail.format(name2, value2);
                }
              }
            }, {
              key: "formats",
              value: function formats() {
                return _defineProperty2({}, this.statics.blotName, this.statics.formats(this.domNode));
              }
            }, {
              key: "insertBefore",
              value: function insertBefore(blot, ref2) {
                if (blot instanceof ListItem) {
                  _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "insertBefore", this).call(this, blot, ref2);
                } else {
                  var index2 = ref2 == null ? this.length() : ref2.offset(this);
                  var after = this.split(index2);
                  after.parent.insertBefore(blot, after);
                }
              }
            }, {
              key: "optimize",
              value: function optimize(context) {
                _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "optimize", this).call(this, context);
                var next = this.next;
                if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute("data-checked") === this.domNode.getAttribute("data-checked")) {
                  next.moveChildren(this);
                  next.remove();
                }
              }
            }, {
              key: "replace",
              value: function replace(target) {
                if (target.statics.blotName !== this.statics.blotName) {
                  var item = _parchment2.default.create(this.statics.defaultChild);
                  target.moveChildren(item);
                  this.appendChild(item);
                }
                _get(List2.prototype.__proto__ || Object.getPrototypeOf(List2.prototype), "replace", this).call(this, target);
              }
            }]);
            return List2;
          }(_container2.default);
          List.blotName = "list";
          List.scope = _parchment2.default.Scope.BLOCK_BLOT;
          List.tagName = ["OL", "UL"];
          List.defaultChild = "list-item";
          List.allowedChildren = [ListItem];
          exports3.ListItem = ListItem;
          exports3.default = List;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _bold = __webpack_require__(56);
          var _bold2 = _interopRequireDefault(_bold);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Italic = function(_Bold) {
            _inherits(Italic2, _Bold);
            function Italic2() {
              _classCallCheck(this, Italic2);
              return _possibleConstructorReturn(this, (Italic2.__proto__ || Object.getPrototypeOf(Italic2)).apply(this, arguments));
            }
            return Italic2;
          }(_bold2.default);
          Italic.blotName = "italic";
          Italic.tagName = ["EM", "I"];
          exports3.default = Italic;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Script = function(_Inline) {
            _inherits(Script2, _Inline);
            function Script2() {
              _classCallCheck(this, Script2);
              return _possibleConstructorReturn(this, (Script2.__proto__ || Object.getPrototypeOf(Script2)).apply(this, arguments));
            }
            _createClass(Script2, null, [{
              key: "create",
              value: function create(value2) {
                if (value2 === "super") {
                  return document.createElement("sup");
                } else if (value2 === "sub") {
                  return document.createElement("sub");
                } else {
                  return _get(Script2.__proto__ || Object.getPrototypeOf(Script2), "create", this).call(this, value2);
                }
              }
            }, {
              key: "formats",
              value: function formats(domNode) {
                if (domNode.tagName === "SUB")
                  return "sub";
                if (domNode.tagName === "SUP")
                  return "super";
                return void 0;
              }
            }]);
            return Script2;
          }(_inline2.default);
          Script.blotName = "script";
          Script.tagName = ["SUB", "SUP"];
          exports3.default = Script;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Strike = function(_Inline) {
            _inherits(Strike2, _Inline);
            function Strike2() {
              _classCallCheck(this, Strike2);
              return _possibleConstructorReturn(this, (Strike2.__proto__ || Object.getPrototypeOf(Strike2)).apply(this, arguments));
            }
            return Strike2;
          }(_inline2.default);
          Strike.blotName = "strike";
          Strike.tagName = "S";
          exports3.default = Strike;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _inline = __webpack_require__(6);
          var _inline2 = _interopRequireDefault(_inline);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var Underline = function(_Inline) {
            _inherits(Underline2, _Inline);
            function Underline2() {
              _classCallCheck(this, Underline2);
              return _possibleConstructorReturn(this, (Underline2.__proto__ || Object.getPrototypeOf(Underline2)).apply(this, arguments));
            }
            return Underline2;
          }(_inline2.default);
          Underline.blotName = "underline";
          Underline.tagName = "U";
          exports3.default = Underline;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _link = __webpack_require__(27);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ATTRIBUTES = ["alt", "height", "width"];
          var Image = function(_Parchment$Embed) {
            _inherits(Image2, _Parchment$Embed);
            function Image2() {
              _classCallCheck(this, Image2);
              return _possibleConstructorReturn(this, (Image2.__proto__ || Object.getPrototypeOf(Image2)).apply(this, arguments));
            }
            _createClass(Image2, [{
              key: "format",
              value: function format(name2, value2) {
                if (ATTRIBUTES.indexOf(name2) > -1) {
                  if (value2) {
                    this.domNode.setAttribute(name2, value2);
                  } else {
                    this.domNode.removeAttribute(name2);
                  }
                } else {
                  _get(Image2.prototype.__proto__ || Object.getPrototypeOf(Image2.prototype), "format", this).call(this, name2, value2);
                }
              }
            }], [{
              key: "create",
              value: function create(value2) {
                var node = _get(Image2.__proto__ || Object.getPrototypeOf(Image2), "create", this).call(this, value2);
                if (typeof value2 === "string") {
                  node.setAttribute("src", this.sanitize(value2));
                }
                return node;
              }
            }, {
              key: "formats",
              value: function formats(domNode) {
                return ATTRIBUTES.reduce(function(formats2, attribute) {
                  if (domNode.hasAttribute(attribute)) {
                    formats2[attribute] = domNode.getAttribute(attribute);
                  }
                  return formats2;
                }, {});
              }
            }, {
              key: "match",
              value: function match(url) {
                return /\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url);
              }
            }, {
              key: "sanitize",
              value: function sanitize(url) {
                return (0, _link.sanitize)(url, ["http", "https", "data"]) ? url : "//:0";
              }
            }, {
              key: "value",
              value: function value2(domNode) {
                return domNode.getAttribute("src");
              }
            }]);
            return Image2;
          }(_parchment2.default.Embed);
          Image.blotName = "image";
          Image.tagName = "IMG";
          exports3.default = Image;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _block = __webpack_require__(4);
          var _link = __webpack_require__(27);
          var _link2 = _interopRequireDefault(_link);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var ATTRIBUTES = ["height", "width"];
          var Video = function(_BlockEmbed) {
            _inherits(Video2, _BlockEmbed);
            function Video2() {
              _classCallCheck(this, Video2);
              return _possibleConstructorReturn(this, (Video2.__proto__ || Object.getPrototypeOf(Video2)).apply(this, arguments));
            }
            _createClass(Video2, [{
              key: "format",
              value: function format(name2, value2) {
                if (ATTRIBUTES.indexOf(name2) > -1) {
                  if (value2) {
                    this.domNode.setAttribute(name2, value2);
                  } else {
                    this.domNode.removeAttribute(name2);
                  }
                } else {
                  _get(Video2.prototype.__proto__ || Object.getPrototypeOf(Video2.prototype), "format", this).call(this, name2, value2);
                }
              }
            }], [{
              key: "create",
              value: function create(value2) {
                var node = _get(Video2.__proto__ || Object.getPrototypeOf(Video2), "create", this).call(this, value2);
                node.setAttribute("frameborder", "0");
                node.setAttribute("allowfullscreen", true);
                node.setAttribute("src", this.sanitize(value2));
                return node;
              }
            }, {
              key: "formats",
              value: function formats(domNode) {
                return ATTRIBUTES.reduce(function(formats2, attribute) {
                  if (domNode.hasAttribute(attribute)) {
                    formats2[attribute] = domNode.getAttribute(attribute);
                  }
                  return formats2;
                }, {});
              }
            }, {
              key: "sanitize",
              value: function sanitize(url) {
                return _link2.default.sanitize(url);
              }
            }, {
              key: "value",
              value: function value2(domNode) {
                return domNode.getAttribute("src");
              }
            }]);
            return Video2;
          }(_block.BlockEmbed);
          Video.blotName = "video";
          Video.className = "ql-video";
          Video.tagName = "IFRAME";
          exports3.default = Video;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.FormulaBlot = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _embed = __webpack_require__(35);
          var _embed2 = _interopRequireDefault(_embed);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var FormulaBlot = function(_Embed) {
            _inherits(FormulaBlot2, _Embed);
            function FormulaBlot2() {
              _classCallCheck(this, FormulaBlot2);
              return _possibleConstructorReturn(this, (FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2)).apply(this, arguments));
            }
            _createClass(FormulaBlot2, null, [{
              key: "create",
              value: function create(value2) {
                var node = _get(FormulaBlot2.__proto__ || Object.getPrototypeOf(FormulaBlot2), "create", this).call(this, value2);
                if (typeof value2 === "string") {
                  window.katex.render(value2, node, {
                    throwOnError: false,
                    errorColor: "#f00"
                  });
                  node.setAttribute("data-value", value2);
                }
                return node;
              }
            }, {
              key: "value",
              value: function value2(domNode) {
                return domNode.getAttribute("data-value");
              }
            }]);
            return FormulaBlot2;
          }(_embed2.default);
          FormulaBlot.blotName = "formula";
          FormulaBlot.className = "ql-formula";
          FormulaBlot.tagName = "SPAN";
          var Formula = function(_Module) {
            _inherits(Formula2, _Module);
            _createClass(Formula2, null, [{
              key: "register",
              value: function register() {
                _quill2.default.register(FormulaBlot, true);
              }
            }]);
            function Formula2() {
              _classCallCheck(this, Formula2);
              var _this2 = _possibleConstructorReturn(this, (Formula2.__proto__ || Object.getPrototypeOf(Formula2)).call(this));
              if (window.katex == null) {
                throw new Error("Formula module requires KaTeX.");
              }
              return _this2;
            }
            return Formula2;
          }(_module2.default);
          exports3.FormulaBlot = FormulaBlot;
          exports3.default = Formula;
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.CodeToken = exports3.CodeBlock = void 0;
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _parchment = __webpack_require__(0);
          var _parchment2 = _interopRequireDefault(_parchment);
          var _quill = __webpack_require__(5);
          var _quill2 = _interopRequireDefault(_quill);
          var _module = __webpack_require__(9);
          var _module2 = _interopRequireDefault(_module);
          var _code = __webpack_require__(13);
          var _code2 = _interopRequireDefault(_code);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var SyntaxCodeBlock = function(_CodeBlock) {
            _inherits(SyntaxCodeBlock2, _CodeBlock);
            function SyntaxCodeBlock2() {
              _classCallCheck(this, SyntaxCodeBlock2);
              return _possibleConstructorReturn(this, (SyntaxCodeBlock2.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2)).apply(this, arguments));
            }
            _createClass(SyntaxCodeBlock2, [{
              key: "replaceWith",
              value: function replaceWith(block) {
                this.domNode.textContent = this.domNode.textContent;
                this.attach();
                _get(SyntaxCodeBlock2.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock2.prototype), "replaceWith", this).call(this, block);
              }
            }, {
              key: "highlight",
              value: function highlight(_highlight) {
                var text = this.domNode.textContent;
                if (this.cachedText !== text) {
                  if (text.trim().length > 0 || this.cachedText == null) {
                    this.domNode.innerHTML = _highlight(text);
                    this.domNode.normalize();
                    this.attach();
                  }
                  this.cachedText = text;
                }
              }
            }]);
            return SyntaxCodeBlock2;
          }(_code2.default);
          SyntaxCodeBlock.className = "ql-syntax";
          var CodeToken = new _parchment2.default.Attributor.Class("token", "hljs", {
            scope: _parchment2.default.Scope.INLINE
          });
          var Syntax = function(_Module) {
            _inherits(Syntax2, _Module);
            _createClass(Syntax2, null, [{
              key: "register",
              value: function register() {
                _quill2.default.register(CodeToken, true);
                _quill2.default.register(SyntaxCodeBlock, true);
              }
            }]);
            function Syntax2(quill2, options) {
              _classCallCheck(this, Syntax2);
              var _this2 = _possibleConstructorReturn(this, (Syntax2.__proto__ || Object.getPrototypeOf(Syntax2)).call(this, quill2, options));
              if (typeof _this2.options.highlight !== "function") {
                throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");
              }
              var timer = null;
              _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function() {
                clearTimeout(timer);
                timer = setTimeout(function() {
                  _this2.highlight();
                  timer = null;
                }, _this2.options.interval);
              });
              _this2.highlight();
              return _this2;
            }
            _createClass(Syntax2, [{
              key: "highlight",
              value: function highlight() {
                var _this3 = this;
                if (this.quill.selection.composing)
                  return;
                this.quill.update(_quill2.default.sources.USER);
                var range = this.quill.getSelection();
                this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function(code2) {
                  code2.highlight(_this3.options.highlight);
                });
                this.quill.update(_quill2.default.sources.SILENT);
                if (range != null) {
                  this.quill.setSelection(range, _quill2.default.sources.SILENT);
                }
              }
            }]);
            return Syntax2;
          }(_module2.default);
          Syntax.DEFAULTS = {
            highlight: function() {
              if (window.hljs == null)
                return null;
              return function(text) {
                var result = window.hljs.highlightAuto(text);
                return result.value;
              };
            }(),
            interval: 1e3
          };
          exports3.CodeBlock = SyntaxCodeBlock;
          exports3.CodeToken = CodeToken;
          exports3.default = Syntax;
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=13 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=9 y1=4 y2=4></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=14 x2=4 y1=14 y2=14></line> <line class=ql-stroke x1=12 x2=6 y1=4 y2=4></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=5 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=9 y1=4 y2=4></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=15 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=15 x2=3 y1=14 y2=14></line> <line class=ql-stroke x1=15 x2=3 y1=4 y2=4></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <g class="ql-fill ql-color-label"> <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon> <rect height=1 width=1 x=4 y=4></rect> <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon> <rect height=1 width=1 x=2 y=6></rect> <rect height=1 width=1 x=3 y=5></rect> <rect height=1 width=1 x=4 y=7></rect> <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon> <rect height=1 width=1 x=2 y=12></rect> <rect height=1 width=1 x=2 y=9></rect> <rect height=1 width=1 x=2 y=15></rect> <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon> <rect height=1 width=1 x=3 y=8></rect> <path d=M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z></path> <path d=M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z></path> <path d=M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z></path> <rect height=1 width=1 x=12 y=2></rect> <rect height=1 width=1 x=11 y=3></rect> <path d=M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z></path> <rect height=1 width=1 x=2 y=3></rect> <rect height=1 width=1 x=6 y=2></rect> <rect height=1 width=1 x=3 y=2></rect> <rect height=1 width=1 x=5 y=3></rect> <rect height=1 width=1 x=9 y=2></rect> <rect height=1 width=1 x=15 y=14></rect> <polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"></polygon> <rect height=1 width=1 x=13 y=7></rect> <rect height=1 width=1 x=15 y=5></rect> <rect height=1 width=1 x=14 y=6></rect> <rect height=1 width=1 x=15 y=8></rect> <rect height=1 width=1 x=14 y=9></rect> <path d=M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z></path> <rect height=1 width=1 x=14 y=3></rect> <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon> <rect height=1 width=1 x=15 y=2></rect> <rect height=1 width=1 x=12 y=5></rect> <rect height=1 width=1 x=13 y=4></rect> <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon> <rect height=1 width=1 x=9 y=14></rect> <rect height=1 width=1 x=8 y=15></rect> <path d=M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z></path> <rect height=1 width=1 x=5 y=15></rect> <path d=M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z></path> <rect height=1 width=1 x=11 y=15></rect> <path d=M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z></path> <rect height=1 width=1 x=14 y=15></rect> <rect height=1 width=1 x=15 y=11></rect> </g> <polyline class=ql-stroke points="5.5 13 9 5 12.5 13"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=11 y2=11></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <rect class="ql-fill ql-stroke" height=3 width=3 x=4 y=5></rect> <rect class="ql-fill ql-stroke" height=3 width=3 x=11 y=5></rect> <path class="ql-even ql-fill ql-stroke" d=M7,8c0,4.031-3,5-3,5></path> <path class="ql-even ql-fill ql-stroke" d=M14,8c0,4.031-3,5-3,5></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z></path> <path class=ql-stroke d=M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=5 x2=13 y1=3 y2=3></line> <line class=ql-stroke x1=6 x2=9.35 y1=12 y2=3></line> <line class=ql-stroke x1=11 x2=15 y1=11 y2=15></line> <line class=ql-stroke x1=15 x2=11 y1=11 y2=15></line> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=7 x=2 y=14></rect> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class="ql-color-label ql-stroke ql-transparent" x1=3 x2=15 y1=15 y2=15></line> <polyline class=ql-stroke points="5.5 11 9 3 12.5 11"></polyline> <line class=ql-stroke x1=11.63 x2=6.38 y1=9 y2=9></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"></polygon> <line class="ql-stroke ql-fill" x1=15 x2=11 y1=4 y2=4></line> <path class=ql-fill d=M11,3a3,3,0,0,0,0,6h1V3H11Z></path> <rect class=ql-fill height=11 width=1 x=11 y=4></rect> <rect class=ql-fill height=11 width=1 x=13 y=4></rect> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"></polygon> <line class="ql-stroke ql-fill" x1=9 x2=5 y1=4 y2=4></line> <path class=ql-fill d=M5,3A3,3,0,0,0,5,9H6V3H5Z></path> <rect class=ql-fill height=11 width=1 x=5 y=4></rect> <rect class=ql-fill height=11 width=1 x=7 y=4></rect> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M14,16H4a1,1,0,0,1,0-2H14A1,1,0,0,1,14,16Z /> <path class=ql-fill d=M14,4H4A1,1,0,0,1,4,2H14A1,1,0,0,1,14,4Z /> <rect class=ql-fill x=3 y=6 width=12 height=6 rx=1 ry=1 /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M13,16H5a1,1,0,0,1,0-2h8A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H5A1,1,0,0,1,5,2h8A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=2 y=6 width=14 height=6 rx=1 ry=1 /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15,8H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,8Z /> <path class=ql-fill d=M15,12H13a1,1,0,0,1,0-2h2A1,1,0,0,1,15,12Z /> <path class=ql-fill d=M15,16H5a1,1,0,0,1,0-2H15A1,1,0,0,1,15,16Z /> <path class=ql-fill d=M15,4H5A1,1,0,0,1,5,2H15A1,1,0,0,1,15,4Z /> <rect class=ql-fill x=2 y=6 width=8 height=6 rx=1 ry=1 /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M5,8H3A1,1,0,0,1,3,6H5A1,1,0,0,1,5,8Z /> <path class=ql-fill d=M5,12H3a1,1,0,0,1,0-2H5A1,1,0,0,1,5,12Z /> <path class=ql-fill d=M13,16H3a1,1,0,0,1,0-2H13A1,1,0,0,1,13,16Z /> <path class=ql-fill d=M13,4H3A1,1,0,0,1,3,2H13A1,1,0,0,1,13,4Z /> <rect class=ql-fill x=8 y=6 width=8 height=6 rx=1 ry=1 transform="translate(24 18) rotate(-180)"/> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z></path> <rect class=ql-fill height=1.6 rx=0.8 ry=0.8 width=5 x=5.15 y=6.2></rect> <path class=ql-fill d=M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewBox="0 0 18 18"> <path class=ql-fill d=M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=13 y1=4 y2=4></line> <line class=ql-stroke x1=5 x2=11 y1=14 y2=14></line> <line class=ql-stroke x1=8 x2=10 y1=14 y2=4></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=10 width=12 x=3 y=4></rect> <circle class=ql-fill cx=6 cy=7 r=1></circle> <polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"></polyline> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"></polyline> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=3 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="5 7 5 11 3 9 5 7"></polyline> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=11 y1=7 y2=11></line> <path class="ql-even ql-stroke" d=M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z></path> <path class="ql-even ql-stroke" d=M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=7 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=7 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=7 x2=15 y1=14 y2=14></line> <line class="ql-stroke ql-thin" x1=2.5 x2=4.5 y1=5.5 y2=5.5></line> <path class=ql-fill d=M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z></path> <path class="ql-stroke ql-thin" d=M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156></path> <path class="ql-stroke ql-thin" d=M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class=ql-stroke x1=6 x2=15 y1=4 y2=4></line> <line class=ql-stroke x1=6 x2=15 y1=9 y2=9></line> <line class=ql-stroke x1=6 x2=15 y1=14 y2=14></line> <line class=ql-stroke x1=3 x2=3 y1=4 y2=4></line> <line class=ql-stroke x1=3 x2=3 y1=9 y2=9></line> <line class=ql-stroke x1=3 x2=3 y1=14 y2=14></line> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg class="" viewbox="0 0 18 18"> <line class=ql-stroke x1=9 x2=15 y1=4 y2=4></line> <polyline class=ql-stroke points="3 4 4 5 6 3"></polyline> <line class=ql-stroke x1=9 x2=15 y1=14 y2=14></line> <polyline class=ql-stroke points="3 14 4 15 6 13"></polyline> <line class=ql-stroke x1=9 x2=15 y1=9 y2=9></line> <polyline class=ql-stroke points="3 9 4 10 6 8"></polyline> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z /> <path class=ql-fill d=M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-fill d=M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z /> <path class=ql-fill d=M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z /> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <line class="ql-stroke ql-thin" x1=15.5 x2=2.5 y1=8.5 y2=9.5></line> <path class=ql-fill d=M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z></path> <path class=ql-fill d=M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z></path> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <path class=ql-stroke d=M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3></path> <rect class=ql-fill height=1 rx=0.5 ry=0.5 width=12 x=3 y=15></rect> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <rect class=ql-stroke height=12 width=12 x=3 y=3></rect> <rect class=ql-fill height=12 width=1 x=5 y=3></rect> <rect class=ql-fill height=12 width=1 x=12 y=3></rect> <rect class=ql-fill height=2 width=8 x=5 y=8></rect> <rect class=ql-fill height=1 width=3 x=3 y=5></rect> <rect class=ql-fill height=1 width=3 x=3 y=7></rect> <rect class=ql-fill height=1 width=3 x=3 y=10></rect> <rect class=ql-fill height=1 width=3 x=3 y=12></rect> <rect class=ql-fill height=1 width=3 x=12 y=5></rect> <rect class=ql-fill height=1 width=3 x=12 y=7></rect> <rect class=ql-fill height=1 width=3 x=12 y=10></rect> <rect class=ql-fill height=1 width=3 x=12 y=12></rect> </svg>';
        },
        function(module3, exports3) {
          module3.exports = '<svg viewbox="0 0 18 18"> <polygon class=ql-stroke points="7 11 9 13 11 11 7 11"></polygon> <polygon class=ql-stroke points="7 7 9 5 11 7 7 7"></polygon> </svg>';
        },
        function(module3, exports3, __webpack_require__) {
          Object.defineProperty(exports3, "__esModule", {
            value: true
          });
          exports3.default = exports3.BubbleTooltip = void 0;
          var _get = function get2(object, property, receiver) {
            if (object === null)
              object = Function.prototype;
            var desc = Object.getOwnPropertyDescriptor(object, property);
            if (desc === void 0) {
              var parent = Object.getPrototypeOf(object);
              if (parent === null) {
                return void 0;
              } else {
                return get2(parent, property, receiver);
              }
            } else if ("value" in desc) {
              return desc.value;
            } else {
              var getter = desc.get;
              if (getter === void 0) {
                return void 0;
              }
              return getter.call(receiver);
            }
          };
          var _createClass = function() {
            function defineProperties(target, props) {
              for (var i2 = 0; i2 < props.length; i2++) {
                var descriptor = props[i2];
                descriptor.enumerable = descriptor.enumerable || false;
                descriptor.configurable = true;
                if ("value" in descriptor)
                  descriptor.writable = true;
                Object.defineProperty(target, descriptor.key, descriptor);
              }
            }
            return function(Constructor, protoProps, staticProps) {
              if (protoProps)
                defineProperties(Constructor.prototype, protoProps);
              if (staticProps)
                defineProperties(Constructor, staticProps);
              return Constructor;
            };
          }();
          var _extend = __webpack_require__(3);
          var _extend2 = _interopRequireDefault(_extend);
          var _emitter = __webpack_require__(8);
          var _emitter2 = _interopRequireDefault(_emitter);
          var _base = __webpack_require__(43);
          var _base2 = _interopRequireDefault(_base);
          var _selection = __webpack_require__(15);
          var _icons = __webpack_require__(41);
          var _icons2 = _interopRequireDefault(_icons);
          function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : { default: obj };
          }
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _possibleConstructorReturn(self2, call) {
            if (!self2) {
              throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            }
            return call && (typeof call === "object" || typeof call === "function") ? call : self2;
          }
          function _inherits(subClass, superClass) {
            if (typeof superClass !== "function" && superClass !== null) {
              throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
            }
            subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });
            if (superClass)
              Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
          }
          var TOOLBAR_CONFIG = [["bold", "italic", "link"], [{ header: 1 }, { header: 2 }, "blockquote"]];
          var BubbleTheme = function(_BaseTheme) {
            _inherits(BubbleTheme2, _BaseTheme);
            function BubbleTheme2(quill2, options) {
              _classCallCheck(this, BubbleTheme2);
              if (options.modules.toolbar != null && options.modules.toolbar.container == null) {
                options.modules.toolbar.container = TOOLBAR_CONFIG;
              }
              var _this = _possibleConstructorReturn(this, (BubbleTheme2.__proto__ || Object.getPrototypeOf(BubbleTheme2)).call(this, quill2, options));
              _this.quill.container.classList.add("ql-bubble");
              return _this;
            }
            _createClass(BubbleTheme2, [{
              key: "extendToolbar",
              value: function extendToolbar(toolbar) {
                this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);
                this.tooltip.root.appendChild(toolbar.container);
                this.buildButtons([].slice.call(toolbar.container.querySelectorAll("button")), _icons2.default);
                this.buildPickers([].slice.call(toolbar.container.querySelectorAll("select")), _icons2.default);
              }
            }]);
            return BubbleTheme2;
          }(_base2.default);
          BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {
            modules: {
              toolbar: {
                handlers: {
                  link: function link(value2) {
                    if (!value2) {
                      this.quill.format("link", false);
                    } else {
                      this.quill.theme.tooltip.edit();
                    }
                  }
                }
              }
            }
          });
          var BubbleTooltip = function(_BaseTooltip) {
            _inherits(BubbleTooltip2, _BaseTooltip);
            function BubbleTooltip2(quill2, bounds) {
              _classCallCheck(this, BubbleTooltip2);
              var _this2 = _possibleConstructorReturn(this, (BubbleTooltip2.__proto__ || Object.getPrototypeOf(BubbleTooltip2)).call(this, quill2, bounds));
              _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function(type, range, oldRange, source) {
                if (type !== _emitter2.default.events.SELECTION_CHANGE)
                  return;
                if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {
                  _this2.show();
                  _this2.root.style.left = "0px";
                  _this2.root.style.width = "";
                  _this2.root.style.width = _this2.root.offsetWidth + "px";
                  var lines = _this2.quill.getLines(range.index, range.length);
                  if (lines.length === 1) {
                    _this2.position(_this2.quill.getBounds(range));
                  } else {
                    var lastLine = lines[lines.length - 1];
                    var index2 = _this2.quill.getIndex(lastLine);
                    var length = Math.min(lastLine.length() - 1, range.index + range.length - index2);
                    var _bounds = _this2.quill.getBounds(new _selection.Range(index2, length));
                    _this2.position(_bounds);
                  }
                } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {
                  _this2.hide();
                }
              });
              return _this2;
            }
            _createClass(BubbleTooltip2, [{
              key: "listen",
              value: function listen() {
                var _this3 = this;
                _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "listen", this).call(this);
                this.root.querySelector(".ql-close").addEventListener("click", function() {
                  _this3.root.classList.remove("ql-editing");
                });
                this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function() {
                  setTimeout(function() {
                    if (_this3.root.classList.contains("ql-hidden"))
                      return;
                    var range = _this3.quill.getSelection();
                    if (range != null) {
                      _this3.position(_this3.quill.getBounds(range));
                    }
                  }, 1);
                });
              }
            }, {
              key: "cancel",
              value: function cancel() {
                this.show();
              }
            }, {
              key: "position",
              value: function position(reference) {
                var shift2 = _get(BubbleTooltip2.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip2.prototype), "position", this).call(this, reference);
                var arrow = this.root.querySelector(".ql-tooltip-arrow");
                arrow.style.marginLeft = "";
                if (shift2 === 0)
                  return shift2;
                arrow.style.marginLeft = -1 * shift2 - arrow.offsetWidth / 2 + "px";
              }
            }]);
            return BubbleTooltip2;
          }(_base.BaseTooltip);
          BubbleTooltip.TEMPLATE = ['<span class="ql-tooltip-arrow"></span>', '<div class="ql-tooltip-editor">', '<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">', '<a class="ql-close"></a>', "</div>"].join("");
          exports3.BubbleTooltip = BubbleTooltip;
          exports3.default = BubbleTheme;
        },
        function(module3, exports3, __webpack_require__) {
          module3.exports = __webpack_require__(63);
        }
      ])["default"];
    });
  })(quill);
  var Quill = /* @__PURE__ */ getDefaultExportFromCjs(quill.exports);
  var quill_core = "";
  var quill_snow = "";
  var quill_bubble = "";
  const defaultOptions = {
    theme: "snow",
    boundary: document.body,
    modules: {
      toolbar: [
        ["bold", "italic", "underline", "strike"],
        ["blockquote", "code-block"],
        [{ header: 1 }, { header: 2 }],
        [{ list: "ordered" }, { list: "bullet" }],
        [{ script: "sub" }, { script: "super" }],
        [{ indent: "-1" }, { indent: "+1" }],
        [{ direction: "rtl" }],
        [{ size: ["small", false, "large", "huge"] }],
        [{ header: [1, 2, 3, 4, 5, 6, false] }],
        [{ color: [] }, { background: [] }],
        [{ font: [] }],
        [{ align: [] }],
        ["clean"],
        ["link", "image", "video"]
      ]
    },
    placeholder: "Insert content here ...",
    readOnly: false
  };
  const _sfc_main$4a = {
    name: "quill-editor",
    props: {
      content: String,
      value: String,
      disabled: {
        type: Boolean,
        default: false
      },
      options: {
        type: Object,
        required: false,
        default: () => ({})
      }
    },
    emits: ["ready", "change", "input", "blur", "focus", "update:value"],
    setup(props, context) {
      const state = {
        editorOption: {},
        quill: null
      };
      let _content = "";
      require$$0$1.watch(() => props.value, (val) => {
        if (state.quill) {
          if (val && val !== _content) {
            _content = val;
            state.quill.pasteHTML(val);
          } else if (!val) {
            state.quill.setText("");
          }
        }
      });
      require$$0$1.watch(() => props.content, (val) => {
        if (state.quill) {
          if (val && val !== _content) {
            _content = val;
            state.quill.pasteHTML(val);
          } else if (!val) {
            state.quill.setText("");
          }
        }
      });
      require$$0$1.watch(() => props.disabled, (val) => {
        if (state.quill) {
          state.quill.enable(!val);
        }
      });
      const editor = require$$0$1.ref(null);
      const mergeOptions = (def, custom) => {
        for (const key in custom) {
          if (!def[key] || key !== "modules") {
            def[key] = custom[key];
          } else {
            mergeOptions(def[key], custom[key]);
          }
        }
        return def;
      };
      const initialize = () => {
        if (editor.value) {
          state.editorOption = mergeOptions(defaultOptions, props.options);
          state.editorOption.readOnly = props.disabled ? true : false;
          state.quill = new Quill(editor.value, state.editorOption);
          if (props.value) {
            state.quill.pasteHTML(props.value);
          }
          state.quill.on("selection-change", (range) => {
            if (!range) {
              context.emit("blur", state.quill);
            } else {
              context.emit("focus", state.quill);
            }
          });
          state.quill.on("text-change", () => {
            if (props.disabled) {
              state.quill.enable(false);
            }
            let html = editor.value.children[0].innerHTML;
            const quill2 = state.quill;
            const text = state.quill.getText();
            if (html === "<p><br></p>")
              html = "";
            _content = html;
            context.emit("update:value", _content);
            context.emit("change", { html, text, quill: quill2 });
          });
          context.emit("ready", state.quill);
        }
      };
      require$$0$1.onBeforeUnmount(() => {
        const editorToolbar = editor.value.previousSibling;
        if (editorToolbar && editorToolbar.className.indexOf("ql-toolbar") > -1) {
          editorToolbar.parentNode.removeChild(editorToolbar);
        }
      });
      require$$0$1.onMounted(() => {
        initialize();
      });
      require$$0$1.onUnmounted(() => {
        state.quill = null;
      });
      return { editor };
    }
  };
  const _hoisted_1$N = { ref: "editor" };
  function _sfc_render$4a(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("section", _hoisted_1$N, null, 512);
  }
  var quillEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4a, [["render", _sfc_render$4a]]);
  quillEditor.install = function(app) {
    app.component(quillEditor.name, quillEditor);
  };
  var richEditorWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$49 = {
    name: "rich-editor-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper,
      quillEditor
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: [],
        customToolbar: [],
        valueChangedFlag: false
      };
    },
    computed: {
      editorOption() {
        return {
          placeholder: this.field.options.placeholder,
          modules: {}
        };
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      handleRichEditorChangeEvent() {
        this.valueChangedFlag = true;
        this.syncUpdateFormModel(this.fieldModel);
      },
      handleRichEditorFocusEvent() {
        this.oldFieldValue = deepClone(this.fieldModel);
      },
      handleRichEditorBlurEvent() {
        if (this.valueChangedFlag) {
          this.emitFieldDataChange(this.fieldModel, this.oldFieldValue);
          this.valueChangedFlag = false;
        }
      }
    }
  };
  function _sfc_render$49(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_quill_editor = require$$0$1.resolveComponent("quill-editor");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass({ "readonly-mode-rich-editor": _ctx.isReadMode })
        }, [
          require$$0$1.createVNode(_component_quill_editor, {
            ref: "fieldEditor",
            value: $data.fieldModel,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            options: $options.editorOption,
            disabled: $props.field.options.disabled || _ctx.isReadMode,
            onBlur: $options.handleRichEditorBlurEvent,
            onFocus: $options.handleRichEditorFocusEvent,
            onChange: $options.handleRichEditorChangeEvent,
            style: require$$0$1.normalizeStyle(!!$props.field.options.contentHeight ? `height: ${$props.field.options.contentHeight};` : "")
          }, null, 8, ["value", "options", "disabled", "onBlur", "onFocus", "onChange", "style"])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var richEditorWidget = /* @__PURE__ */ _export_sfc(_sfc_main$49, [["render", _sfc_render$49], ["__scopeId", "data-v-7f02fd9e"]]);
  var __glob_0_15$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": richEditorWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var selectWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$48 = {
    name: "select-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: [],
        widgetKey: ""
      };
    },
    computed: {
      allowDefaultFirstOption() {
        return !!this.field.options.filterable || !!this.field.options.remote;
      },
      remoteMethod() {
        if (!!this.field.options.remote && !!this.field.options.onRemoteQuery) {
          return this.remoteQuery;
        } else {
          return void 0;
        }
      },
      selectKey() {
        return this.widgetKey || this.field.id;
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initOptionItems();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      getSelectedLabel() {
        return this.$refs.fieldEditor.selectedLabel;
      },
      refreshWidgetKey() {
        this.widgetKey = "select-key-" + generateId();
      }
    }
  };
  const _hoisted_1$M = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$48(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          class: "full-width-input",
          key: $options.selectKey,
          disabled: $props.field.options.disabled,
          clearable: $props.field.options.clearable,
          filterable: $props.field.options.filterable,
          "allow-create": $props.field.options.allowCreate,
          "default-first-option": $options.allowDefaultFirstOption,
          "reserve-keyword": false,
          "automatic-dropdown": $props.field.options.automaticDropdown,
          multiple: $props.field.options.multiple,
          "multiple-limit": $props.field.options.multipleLimit,
          "collapse-tags": $props.field.options.collapseTags,
          placeholder: $props.field.options.placeholder || _ctx.i18nt("render.hint.selectPlaceholder"),
          remote: $props.field.options.remote,
          "remote-method": $options.remoteMethod,
          onFocus: _ctx.handleFocusCustomEvent,
          onBlurCapture: _ctx.handleBlurCustomEvent,
          onChange: _ctx.handleChangeEvent
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.field.options.optionItems, (item) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: item.value,
                label: item.label,
                value: item.value,
                disabled: item.disabled
              }, null, 8, ["label", "value", "disabled"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "clearable", "filterable", "allow-create", "default-first-option", "automatic-dropdown", "multiple", "multiple-limit", "collapse-tags", "placeholder", "remote", "remote-method", "onFocus", "onBlurCapture", "onChange"])), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$M, require$$0$1.toDisplayString(_ctx.optionLabel), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var selectWidget = /* @__PURE__ */ _export_sfc(_sfc_main$48, [["render", _sfc_render$48], ["__scopeId", "data-v-4d79e768"]]);
  var __glob_0_16$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": selectWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var sliderWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$47 = {
    name: "slider-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$L = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$47(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_slider = require$$0$1.resolveComponent("el-slider");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_slider, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          disabled: $props.field.options.disabled,
          "show-stops": $props.field.options.showStops,
          min: $props.field.options.min,
          max: $props.field.options.max,
          step: $props.field.options.step,
          range: $props.field.options.range,
          vertical: $props.field.options.vertical,
          onChange: _ctx.handleChangeEvent
        }, null, 8, ["modelValue", "disabled", "show-stops", "min", "max", "step", "range", "vertical", "onChange"]), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$L, require$$0$1.toDisplayString($data.fieldModel), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var sliderWidget = /* @__PURE__ */ _export_sfc(_sfc_main$47, [["render", _sfc_render$47], ["__scopeId", "data-v-d9d184c4"]]);
  var __glob_0_17$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": sliderWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var slotWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$46 = {
    name: "slot-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$K = {
    key: 0,
    class: "slot-title"
  };
  function _sfc_render$46(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([!!$props.designState ? "slot-wrapper-design" : "slot-wrapper-render"])
        }, [
          require$$0$1.renderSlot(_ctx.$slots, $props.field.options.name, { formModel: _ctx.formModel }, void 0, true),
          !!$props.designState ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$K, require$$0$1.toDisplayString($props.field.options.label), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 3
    }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var slotWidget = /* @__PURE__ */ _export_sfc(_sfc_main$46, [["render", _sfc_render$46], ["__scopeId", "data-v-1b458525"]]);
  var __glob_0_18$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": slotWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var staticTextWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$45 = {
    name: "static-text-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  function _sfc_render$45(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          ref: "fieldEditor",
          style: require$$0$1.normalizeStyle(!!$props.field.options.fontSize ? `font-size: ${$props.field.options.fontSize};` : "")
        }, [
          require$$0$1.createElementVNode("pre", {
            style: require$$0$1.normalizeStyle({ "white-space": !!$props.field.options.preWrap ? "pre-wrap" : "pre", "text-align": !!$props.field.options.textAlign ? $props.field.options.textAlign : "left" })
          }, require$$0$1.toDisplayString($props.field.options.textContent), 5)
        ], 4)
      ]),
      _: 1
    }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var staticTextWidget = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["render", _sfc_render$45], ["__scopeId", "data-v-990dcae8"]]);
  var __glob_0_20$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": staticTextWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var switchWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$44 = {
    name: "switch-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      contentForReadMode() {
        if (!!this.fieldModel) {
          return this.field.options.activeText || this.i18nt("render.hint.defaultActiveText");
        }
        return this.field.options.inactiveText || this.i18nt("render.hint.defaultInactiveText");
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$J = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$44(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          class: require$$0$1.normalizeClass([_ctx.isReadMode ? "readonly-mode-switch" : ""]),
          disabled: $props.field.options.disabled,
          "active-text": $props.field.options.activeText,
          "inactive-text": $props.field.options.inactiveText,
          "active-color": $props.field.options.activeColor,
          "inactive-color": $props.field.options.inactiveColor,
          width: $props.field.options.switchWidth,
          onChange: _ctx.handleChangeEvent
        }, null, 8, ["modelValue", "class", "disabled", "active-text", "inactive-text", "active-color", "inactive-color", "width", "onChange"]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$J, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var switchWidget = /* @__PURE__ */ _export_sfc(_sfc_main$44, [["render", _sfc_render$44], ["__scopeId", "data-v-5732c178"]]);
  var __glob_0_21$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": switchWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var textareaWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$43 = {
    name: "textarea-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: [],
        widgetKey: ""
      };
    },
    computed: {
      textareaKey() {
        return this.widgetKey || this.field.id;
      },
      contentForReadMode() {
        return this.fieldModel ? this.fieldModel : "--";
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      refreshWidgetKey() {
        this.widgetKey = "textarea-key-" + generateId();
      }
    }
  };
  const _hoisted_1$I = ["innerHTML"];
  function _sfc_render$43(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
          type: "textarea",
          ref: "fieldEditor",
          modelValue: $data.fieldModel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
          disabled: $props.field.options.disabled,
          readonly: $props.field.options.readonly,
          placeholder: $props.field.options.placeholder,
          rows: $props.field.options.rows,
          key: $options.textareaKey,
          autosize: $props.field.options.autosize,
          minlength: $props.field.options.minLength,
          maxlength: $props.field.options.maxLength,
          "show-word-limit": $props.field.options.showWordLimit,
          onFocus: _ctx.handleFocusCustomEvent,
          onBlur: _ctx.handleBlurCustomEvent,
          onInput: _ctx.handleInputCustomEvent,
          onChange: _ctx.handleChangeEvent
        }, null, 8, ["modelValue", "disabled", "readonly", "placeholder", "rows", "autosize", "minlength", "maxlength", "show-word-limit", "onFocus", "onBlur", "onInput", "onChange"])), [
          [require$$0$1.vShow, !_ctx.isReadMode]
        ]),
        _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
          key: 0,
          innerHTML: $options.contentForReadMode,
          class: "readonly-mode-field"
        }, null, 8, _hoisted_1$I)) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var textareaWidget = /* @__PURE__ */ _export_sfc(_sfc_main$43, [["render", _sfc_render$43], ["__scopeId", "data-v-21f9c4f0"]]);
  var __glob_0_22$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": textareaWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var timeRangeWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$42 = {
    name: "time-range-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {
      contentForReadMode() {
        if (!this.fieldModel) {
          return "--";
        } else {
          return this.fieldModel[0] + " - " + this.fieldModel[1];
        }
      }
    },
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$H = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$42(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_time_picker = require$$0$1.resolveComponent("el-time-picker");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : "", _ctx.isReadMode ? "readonly-mode-time-range" : ""])
        }, [
          require$$0$1.createVNode(_component_el_time_picker, {
            ref: "fieldEditor",
            "is-range": "",
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "full-width-input" : ""]),
            disabled: $props.field.options.disabled,
            readonly: $props.field.options.readonly,
            clearable: $props.field.options.clearable,
            editable: $props.field.options.editable,
            format: $props.field.options.format,
            "value-format": "HH:mm:ss",
            "start-placeholder": $props.field.options.startPlaceholder || _ctx.i18nt("render.hint.startTimePlaceholder"),
            "end-placeholder": $props.field.options.endPlaceholder || _ctx.i18nt("render.hint.endTimePlaceholder"),
            onFocus: _ctx.handleFocusCustomEvent,
            onBlur: _ctx.handleBlurCustomEvent,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["modelValue", "class", "disabled", "readonly", "clearable", "editable", "format", "start-placeholder", "end-placeholder", "onFocus", "onBlur", "onChange"]),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$H, require$$0$1.toDisplayString($options.contentForReadMode), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var timeRangeWidget = /* @__PURE__ */ _export_sfc(_sfc_main$42, [["render", _sfc_render$42], ["__scopeId", "data-v-68faa871"]]);
  var __glob_0_23$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeRangeWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var timeWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$41 = {
    name: "time-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      FormItemWrapper
    },
    data() {
      return {
        oldFieldValue: null,
        fieldModel: null,
        rules: []
      };
    },
    computed: {},
    beforeCreate() {
    },
    created() {
      this.registerToRefList();
      this.initFieldModel();
      this.initEventHandler();
      this.buildFieldRules();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$G = {
    key: 0,
    class: "readonly-mode-field"
  };
  function _sfc_render$41(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_time_picker = require$$0$1.resolveComponent("el-time-picker");
    const _component_form_item_wrapper = require$$0$1.resolveComponent("form-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_form_item_wrapper, {
      designer: $props.designer,
      field: $props.field,
      rules: $data.rules,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass([!!$props.field.options.autoFullWidth ? "auto-full-width" : "", _ctx.isReadMode ? "readonly-mode-time" : ""])
        }, [
          require$$0$1.createVNode(_component_el_time_picker, {
            ref: "fieldEditor",
            modelValue: $data.fieldModel,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.fieldModel = $event),
            disabled: $props.field.options.disabled,
            readonly: $props.field.options.readonly,
            clearable: $props.field.options.clearable,
            editable: $props.field.options.editable,
            format: $props.field.options.format,
            "value-format": "HH:mm:ss",
            placeholder: $props.field.options.placeholder || _ctx.i18nt("render.hint.timePlaceholder"),
            onFocus: _ctx.handleFocusCustomEvent,
            onBlur: _ctx.handleBlurCustomEvent,
            onChange: _ctx.handleChangeEvent
          }, null, 8, ["modelValue", "disabled", "readonly", "clearable", "editable", "format", "placeholder", "onFocus", "onBlur", "onChange"]),
          _ctx.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$G, require$$0$1.toDisplayString($data.fieldModel), 1)) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "field", "rules", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var timeWidget = /* @__PURE__ */ _export_sfc(_sfc_main$41, [["render", _sfc_render$41], ["__scopeId", "data-v-03e270d6"]]);
  var __glob_0_24$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeWidget
  }, Symbol.toStringTag, { value: "Module" }));
  let comps$1 = {};
  const modules$3 = { "./button-widget.vue": __glob_0_0$2, "./cascader-widget.vue": __glob_0_1$2, "./checkbox-widget.vue": __glob_0_2$3, "./color-widget.vue": __glob_0_3$3, "./date-range-widget.vue": __glob_0_4$3, "./date-widget.vue": __glob_0_5$3, "./divider-widget.vue": __glob_0_6$3, "./file-upload-widget.vue": __glob_0_7$3, "./form-item-wrapper.vue": __glob_0_8$3, "./html-text-widget.vue": __glob_0_9$3, "./input-widget.vue": __glob_0_10$3, "./number-widget.vue": __glob_0_11$3, "./picture-upload-widget.vue": __glob_0_12$3, "./radio-widget.vue": __glob_0_13$3, "./rate-widget.vue": __glob_0_14$1, "./rich-editor-widget.vue": __glob_0_15$1, "./select-widget.vue": __glob_0_16$1, "./slider-widget.vue": __glob_0_17$1, "./slot-widget.vue": __glob_0_18$1, "./static-content-wrapper.vue": __glob_0_19$1, "./static-text-widget.vue": __glob_0_20$1, "./switch-widget.vue": __glob_0_21$1, "./textarea-widget.vue": __glob_0_22$1, "./time-range-widget.vue": __glob_0_23$1, "./time-widget.vue": __glob_0_24$1 };
  for (const path in modules$3) {
    let cname = modules$3[path].default.name;
    comps$1[cname] = modules$3[path].default;
  }
  var TableColumnCustomRender = {
    name: "table-column-custom-render",
    props: {
      row: Object,
      column: Object,
      rowIndex: Number,
      columnIndex: Number,
      dataTableRef: Object,
      renderFn: Function
    },
    render() {
      const params = {
        row: this.row,
        column: this.column,
        rowIndex: this.rowIndex,
        columnIndex: this.columnIndex,
        dataTableRef: this.dataTableRef
      };
      const components2 = this.$root.$.appContext.components;
      return this.renderFn(require$$0$1.h, params, components2);
    }
  };
  const _sfc_main$40 = {
    name: "table-high-level-column",
    props: {
      columnSchema: {
        type: Object
      },
      dataTableRef: {
        type: Object
      },
      columnIndex: {
        type: Number
      },
      tableOptions: {
        type: Object
      }
    },
    components: {
      TableColumnCustomRender
    },
    computed: {
      colMinWidth() {
        return this.tableOptions.autoColumnWidthDisabled === true ? void 0 : this.columnSchema.width;
      },
      colWidth() {
        return this.tableOptions.autoColumnWidthDisabled === true ? this.columnSchema.width : void 0;
      }
    },
    methods: {
      getSortable(column) {
        return !column.sortable ? false : !!column.customSort ? "custom" : true;
      },
      formatterValue(row, column, cellValue) {
        if (!cellValue) {
          return "";
        }
        if (!!column.formatS && !!column.show) {
          switch (column.formatS) {
            case "d1":
              return formatDate1(cellValue);
            case "d2":
              return formatDate2(cellValue);
            case "d3":
              return formatDate3(cellValue);
            case "d4":
              return formatDate4(cellValue);
            case "d5":
              return formatDate5(cellValue);
            case "n1":
              return formatNumber1(cellValue);
            case "n2":
              return formatNumber2(cellValue);
            case "n3":
              return formatNumber3(cellValue);
            case "n4":
              return formatNumber4(cellValue);
            case "n5":
              return formatNumber5(cellValue);
            case "n6":
              return formatNumber6(cellValue);
            case "n7":
              return formatNumber7(cellValue);
          }
        }
        return cellValue;
      },
      getColumnRender(row, column) {
        return new Function("h", "params", "components", column.render);
      }
    }
  };
  const _hoisted_1$F = { key: 1 };
  const _hoisted_2$m = { key: 2 };
  function _sfc_render$40(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_table_high_level_column = require$$0$1.resolveComponent("table-high-level-column", true);
    const _component_el_table_column = require$$0$1.resolveComponent("el-table-column");
    const _component_table_column_custom_render = require$$0$1.resolveComponent("table-column-custom-render");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
      !!$props.columnSchema.headerFlag && (!!$props.columnSchema.children && $props.columnSchema.children.length > 0) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
        key: 0,
        label: $props.columnSchema.label,
        align: $props.columnSchema.align ? $props.columnSchema.align : "center"
      }, {
        default: require$$0$1.withCtx(() => [
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.columnSchema.children, (child, idx) => {
            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_high_level_column, {
              "column-schema": child,
              "data-table-ref": $props.dataTableRef,
              "column-index": idx,
              "table-options": $props.tableOptions
            }, null, 8, ["column-schema", "data-table-ref", "column-index", "table-options"]);
          }), 256))
        ]),
        _: 1
      }, 8, ["label", "align"])) : require$$0$1.createCommentVNode("", true),
      !$props.columnSchema.headerFlag && $props.columnSchema.show !== false && !$props.columnSchema.children ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
        key: $props.columnSchema.columnId,
        prop: $props.columnSchema.prop,
        label: $props.columnSchema.label,
        sortable: $options.getSortable($props.columnSchema),
        fixed: !$props.columnSchema.fixed ? false : $props.columnSchema.fixed,
        align: $props.columnSchema.align ? $props.columnSchema.align : "center",
        formatter: $options.formatterValue,
        format: $props.columnSchema.format,
        "show-overflow-tooltip": true,
        "min-width": $options.colMinWidth,
        width: $options.colWidth
      }, {
        default: require$$0$1.withCtx((scope) => [
          $props.columnSchema.formatS === "render" && !!$props.columnSchema.render ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_column_custom_render, {
            key: 0,
            row: scope.row,
            column: $props.columnSchema,
            "data-table-ref": $props.dataTableRef,
            "row-index": scope.$index,
            "column-index": $props.columnIndex,
            renderFn: $options.getColumnRender(scope.row, $props.columnSchema)
          }, null, 8, ["row", "column", "data-table-ref", "row-index", "column-index", "renderFn"])) : !!$props.columnSchema.formatS && $props.columnSchema.formatS !== "renders" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$F, require$$0$1.toDisplayString($options.formatterValue(scope.row, $props.columnSchema, scope.row[$props.columnSchema.prop])), 1)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_2$m, require$$0$1.toDisplayString(scope.row[$props.columnSchema.prop]), 1))
        ]),
        _: 1
      }, 8, ["prop", "label", "sortable", "fixed", "align", "formatter", "format", "min-width", "width"])) : require$$0$1.createCommentVNode("", true)
    ], 64);
  }
  var TableHighLevelColumn = /* @__PURE__ */ _export_sfc(_sfc_main$40, [["render", _sfc_render$40]]);
  var dataTableItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3$ = {
    name: "DataTableItem",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadValues({
      TableHighLevelColumn,
      ContainerItemWrapper,
      TableColumnCustomRender
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "sfRefList", "globalModel", "getFormConfig", "getGlobalDsv"],
    data() {
      return {
        selectAllFlag: false,
        selectedIndices: [],
        selectedRows: [],
        pageSize: this.widget.options.pagination.pageSize,
        pageSizes: this.widget.options.pagination.pageSizes,
        currentPage: this.widget.options.pagination.currentPage,
        total: this.widget.options.pagination.total,
        skipSelectionChangeEvent: false,
        loadingFlag: false
      };
    },
    computed: {
      formConfig() {
        return this.getFormConfig();
      },
      paginationLayout() {
        return !!this.widget.options.smallPagination ? "prev, pager, next" : "total, sizes, prev, pager, next, jumper";
      },
      customClass() {
        return this.widget.options.customClass || "";
      },
      widgetSize() {
        return this.widget.options.tableSize || "default";
      },
      singleRowSelectFlag() {
        return !this.widget.options.showCheckBox;
      },
      buttonsColumnFixed() {
        if (this.widget.options.buttonsColumnFixed === void 0) {
          return "right";
        }
        return !this.widget.options.buttonsColumnFixed ? false : this.widget.options.buttonsColumnFixed;
      },
      tableHeight() {
        return this.widget.options.tableHeight || void 0;
      },
      selectionWidth() {
        return !this.widget.options.showSummary ? !this.widget.options.treeDataEnabled ? 42 : 70 : 53;
      },
      getDataTableRef() {
        return this;
      },
      tableRowKey() {
        return !this.widget.options.rowKey ? null : this.widget.options.rowKey;
      },
      paginationAlign() {
        let alignType = !this.widget.options.paginationAlign ? "left" : this.widget.options.paginationAlign;
        return "align-" + alignType;
      }
    },
    created() {
      this.initRefList();
      this.handleOnCreated();
    },
    mounted() {
      if (!!this.widget.options.dsEnabled) {
        this.loadDataFromDS({});
      }
      this.$nextTick(() => {
        this.handleOnMounted();
      });
    },
    beforeDestroy() {
      this.unregisterFromRefList();
    },
    methods: {
      formatter(row, column, cellValue) {
        return cellValue;
      },
      formatterValue(row, column, cellValue) {
        if (!cellValue) {
          return "";
        }
        if (!!column.formatS && !!column.show) {
          switch (column.formatS) {
            case "d1":
              return formatDate1(cellValue);
            case "d2":
              return formatDate2(cellValue);
            case "d3":
              return formatDate3(cellValue);
            case "d4":
              return formatDate4(cellValue);
            case "d5":
              return formatDate5(cellValue);
            case "n1":
              return formatNumber1(cellValue);
            case "n2":
              return formatNumber2(cellValue);
            case "n3":
              return formatNumber3(cellValue);
            case "n4":
              return formatNumber4(cellValue);
            case "n5":
              return formatNumber5(cellValue);
            case "n6":
              return formatNumber6(cellValue);
            case "n7":
              return formatNumber7(cellValue);
          }
        }
        return cellValue;
      },
      getColumnRender(row, column) {
        return new Function("h", "params", "components", column.render);
      },
      getRowIndex(row) {
        return this.widget.options.tableData.lastIndexOf(row);
      },
      findColumnAndSetHidden(columnName, hiddenFlag) {
        this.widget.options.tableColumns.forEach((tc) => {
          if (tc.prop === columnName) {
            tc.show = !hiddenFlag;
          }
        });
      },
      handleOnCreated() {
        if (!!this.widget.options.onCreated) {
          let customFunc = new Function(this.widget.options.onCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.widget.options.onMounted) {
          let customFunc = new Function(this.widget.options.onMounted);
          customFunc.call(this);
        }
      },
      handleCurrentChange(currentRow, oldCurrentRow) {
        if (!!this.skipSelectionChangeEvent) {
          return;
        }
        if (!!this.widget.options.showCheckBox) {
          return;
        }
        this.selectedIndices.length = 0;
        this.selectedRows.length = 0;
        let rowIndex = this.getRowIndex(currentRow);
        this.selectedIndices.push(rowIndex);
        this.selectedRows.push(currentRow);
        if (!!this.widget.options.onSelectionChange) {
          let customFn = new Function("selection", "selectedIndices", this.widget.options.onSelectionChange);
          customFn.call(this, [currentRow], this.selectedIndices);
        } else {
          this.dispatch("VFormRender", "dataTableSelectionChange", [this, [currentRow], this.selectedIndices]);
        }
      },
      handleSelectionChange(selection) {
        if (!!this.skipSelectionChangeEvent) {
          return;
        }
        this.selectedIndices.length = 0;
        this.selectedRows.length = 0;
        selection.map((row) => {
          let rowIndex = this.getRowIndex(row);
          this.selectedIndices.push(rowIndex);
          this.selectedRows.push(row);
        });
        if (!!this.widget.options.onSelectionChange) {
          let customFn = new Function("selection", "selectedIndices", this.widget.options.onSelectionChange);
          customFn.call(this, selection, this.selectedIndices);
        } else {
          this.dispatch("VFormRender", "dataTableSelectionChange", [this, selection, this.selectedIndices]);
        }
      },
      handleSortChange({ column, prop, order }) {
        if (!!this.widget.options.onSortChange) {
          let customFn = new Function("column", "prop", "order", "pageSize", "currentPage", this.widget.options.onSortChange);
          customFn.call(this, column, prop, order, this.pageSize, this.currentPage);
        } else {
          this.dispatch("VFormRender", "dataTableSortChange", [this, column, prop, order, this.pageSize, this.currentPage]);
        }
      },
      handlePageSizeChange(pageSize) {
        this.pageSize = pageSize;
        if (!!this.widget.options.dsEnabled && !!this.widget.options.dsName) {
          this.loadDataFromDS();
        }
        if (!!this.widget.options.onPageSizeChange) {
          let customFn = new Function("pageSize", "currentPage", this.widget.options.onPageSizeChange);
          customFn.call(this, pageSize, this.currentPage);
        } else {
          this.dispatch("VFormRender", "dataTablePageSizeChange", [this, pageSize, this.currentPage]);
        }
      },
      handleCurrentPageChange(currentPage) {
        this.currentPage = currentPage;
        if (!!this.widget.options.dsEnabled && !!this.widget.options.dsName) {
          this.loadDataFromDS();
        }
        if (!!this.widget.options.onCurrentPageChange) {
          let customFn = new Function("pageSize", "currentPage", this.widget.options.onCurrentPageChange);
          customFn.call(this, this.pageSize, currentPage);
        } else {
          this.dispatch("VFormRender", "dataTablePageChange", [this, this.pageSize, currentPage]);
        }
      },
      handleOperationButtonClick(btnName, rowIndex, row) {
        this.skipSelectionChangeEvent = true;
        try {
          if (!!this.widget.options.onOperationButtonClick) {
            let customFn = new Function("buttonName", "rowIndex", "row", this.widget.options.onOperationButtonClick);
            customFn.call(this, btnName, rowIndex, row);
          } else {
            this.dispatch("VFormRender", "operationButtonClick", [this, btnName, rowIndex, row]);
          }
        } finally {
          this.skipSelectionChangeEvent = false;
        }
      },
      showOperationButton(buttonConfig, rowIndex, row) {
        if (!!this.widget.options.onHideOperationButton) {
          let customFn = new Function("buttonConfig", "rowIndex", "row", this.widget.options.onHideOperationButton);
          return !customFn.call(this, buttonConfig, rowIndex, row);
        } else {
          return !buttonConfig.hidden;
        }
      },
      disableOperationButton(buttonConfig, rowIndex, row) {
        if (!!this.widget.options.onDisableOperationButton) {
          let customFn = new Function("buttonConfig", "rowIndex", "row", this.widget.options.onDisableOperationButton);
          return customFn.call(this, buttonConfig, rowIndex, row);
        } else {
          return buttonConfig.disabled;
        }
      },
      getOperationButtonLabel(buttonConfig, rowIndex, row) {
        if (!!this.widget.options.onGetOperationButtonLabel) {
          let customFn = new Function("buttonConfig", "rowIndex", "row", this.widget.options.onGetOperationButtonLabel);
          return customFn.call(this, buttonConfig, rowIndex, row);
        } else {
          return buttonConfig.label;
        }
      },
      getRowClassName({ row, rowIndex }) {
        if (!!this.widget.options.onGetRowClassName) {
          let customFn = new Function("rowIndex", "row", this.widget.options.onGetRowClassName);
          return customFn.call(this, rowIndex, row);
        } else {
          return "";
        }
      },
      getSpanMethod({ row, column, rowIndex, columnIndex }) {
        if (!!this.widget.options.onGetSpanMethod) {
          let customFn = new Function("row", "column", "rowIndex", "columnIndex", this.widget.options.onGetSpanMethod);
          return customFn.call(this, row, column, rowIndex, columnIndex);
        }
      },
      handleHeaderClick(column, event) {
        if (!!this.widget.options.onHeaderClick) {
          let customFn = new Function("column", "event", this.widget.options.onHeaderClick);
          return customFn.call(this, column, event);
        }
      },
      handleRowClick(row, column, event) {
        if (!!this.widget.options.onRowClick) {
          let customFn = new Function("row", "column", "event", this.widget.options.onRowClick);
          return customFn.call(this, row, column, event);
        }
      },
      handleRowDoubleClick(row, column, event) {
        if (!!this.widget.options.onRowDoubleClick) {
          let customFn = new Function("row", "column", "event", this.widget.options.onRowDoubleClick);
          return customFn.call(this, row, column, event);
        }
      },
      handleCellClick(row, column, cell, event) {
        if (!!this.widget.options.onCellClick) {
          let customFn = new Function("row", "column", "cell", "event", this.widget.options.onCellClick);
          return customFn.call(this, row, column, cell, event);
        }
      },
      handleCellDoubleClick(row, column, cell, event) {
        if (!!this.widget.options.onCellDoubleClick) {
          let customFn = new Function("row", "column", "cell", "event", this.widget.options.onCellDoubleClick);
          return customFn.call(this, row, column, cell, event);
        }
      },
      getOperationButtonType(operationButton) {
        if (operationButton.type !== "text") {
          return operationButton.type;
        } else {
          return "primary";
        }
      },
      isLinkOperationButton(operationButton) {
        return operationButton.type === "text";
      },
      getTableColumns() {
        return this.widget.options.tableColumns;
      },
      setTableColumns(tableColumns) {
        this.widget.options.tableColumns = tableColumns;
        this.$nextTick(() => {
          this.$refs.dataTable.doLayout();
        });
      },
      setTableColumn(tableColumns) {
        this.setTableColumns(tableColumns);
      },
      loadColumnsFromDS(localDsv = {}, dsName) {
        let curDS = getDSByName(this.formConfig, dsName);
        if (!!curDS) {
          let gDsv = this.getGlobalDsv() || {};
          let newDsv = new Object({});
          overwriteObj(newDsv, gDsv);
          overwriteObj(newDsv, localDsv);
          newDsv.widgetName = this.widget.options.name;
          this.loadingFlag = true;
          runDataSourceRequest(curDS, newDsv, this.getFormRef(), false, this.$message).then((res) => {
            this.setTableColumns(res);
            this.loadingFlag = false;
          }).catch((err) => {
            this.$message.error(err.message);
            this.loadingFlag = false;
          });
        }
      },
      setTableColumnsHidden(columnNames, hiddenFlag) {
        if (!!columnNames) {
          if (typeof columnNames === "string") {
            this.findColumnAndSetHidden(columnNames, hiddenFlag);
          } else if (Array.isArray(columnNames)) {
            columnNames.forEach((cn) => {
              this.findColumnAndSetHidden(cn, hiddenFlag);
            });
          }
          this.$nextTick(() => {
            this.$refs.dataTable.doLayout();
          });
        }
      },
      getTableData() {
        return this.widget.options.tableData;
      },
      setTableData(tableData) {
        this.loadingFlag = true;
        this.widget.options.tableData = tableData;
        this.loadingFlag = false;
      },
      loadDataFromDS(localDsv = {}, dsName = "") {
        let curDSName = dsName || this.widget.options.dsName;
        let curDSetName = this.widget.options.dataSetName;
        let curDS = getDSByName(this.formConfig, curDSName);
        if (!!curDS) {
          let gDsv = this.getGlobalDsv() || {};
          let newDsv = new Object({});
          overwriteObj(newDsv, gDsv);
          overwriteObj(newDsv, localDsv);
          newDsv.widgetName = this.widget.options.name;
          newDsv.pageSize = this.pageSize;
          newDsv.currentPage = this.currentPage;
          this.loadingFlag = true;
          runDataSourceRequest(curDS, newDsv, this.getFormRef(), false, this.$message).then((res) => {
            if (!!curDSetName && res.hasOwnProperty(curDSetName)) {
              this.setTableData(res[curDSetName]);
            } else {
              this.setTableData(res);
            }
            this.loadingFlag = false;
          }).catch((err) => {
            this.$message.error(err.message);
            this.loadingFlag = false;
          });
        }
      },
      setPagination(pagination) {
        if (pagination.currentPage !== void 0) {
          this.currentPage = pagination.currentPage;
          this.widget.options.pagination.currentPage = pagination.currentPage;
        }
        if (pagination.pageSize !== void 0) {
          this.pageSize = pagination.pageSize;
          this.widget.options.pagination.pageSize = pagination.pageSize;
        }
        if (pagination.pageSizes !== void 0) {
          this.pageSizes = pagination.pageSizes;
          this.widget.options.pagination.pageSizes = pagination.pageSizes;
        }
        if (pagination.total !== void 0) {
          this.total = pagination.total;
          this.widget.options.pagination.total = pagination.total;
        }
      },
      getPagination() {
        return {
          currentPage: this.widget.options.pagination.currentPage,
          pageSize: this.widget.options.pagination.pageSize,
          total: this.widget.options.pagination.total
        };
      },
      getSelectedRow() {
        return this.selectedRows;
      },
      getSelectedIndex() {
        return this.selectedIndices;
      },
      getNativeTable() {
        return this.$refs.dataTable;
      }
    }
  };
  function _sfc_render$3$(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_table_column = require$$0$1.resolveComponent("el-table-column");
    const _component_table_high_level_column = require$$0$1.resolveComponent("table-high-level-column");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_table = require$$0$1.resolveComponent("el-table");
    const _component_el_pagination = require$$0$1.resolveComponent("el-pagination");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    const _directive_loading = require$$0$1.resolveDirective("loading");
    return require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table, {
          ref: "dataTable",
          data: $props.widget.options.tableData,
          class: require$$0$1.normalizeClass([$options.customClass]),
          height: $options.tableHeight,
          style: require$$0$1.normalizeStyle({ "width": $props.widget.options.tableWidth }),
          border: $props.widget.options.border,
          "show-summary": $props.widget.options.showSummary,
          "row-key": $options.tableRowKey,
          "tree-props": { children: $props.widget.options.childrenKey },
          size: $options.widgetSize,
          stripe: $props.widget.options.stripe,
          "highlight-current-row": $options.singleRowSelectFlag,
          "row-class-name": $options.getRowClassName,
          "span-method": $options.getSpanMethod,
          onCurrentChange: $options.handleCurrentChange,
          onSelectionChange: $options.handleSelectionChange,
          onSortChange: $options.handleSortChange,
          onHeaderClick: $options.handleHeaderClick,
          onRowClick: $options.handleRowClick,
          onRowDblclick: $options.handleRowDoubleClick,
          onCellClick: $options.handleCellClick,
          onCellDblclick: $options.handleCellDoubleClick,
          "cell-style": { padding: $props.widget.options.rowSpacing + "px 0" }
        }, {
          default: require$$0$1.withCtx(() => [
            $props.widget.options.showIndex ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
              key: 0,
              type: "index",
              width: "60",
              fixed: "left",
              label: _ctx.i18nt("designer.setting.lineNumber")
            }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
            $props.widget.options.showCheckBox ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
              key: 1,
              type: "selection",
              width: $options.selectionWidth,
              fixed: "left"
            }, null, 8, ["width"])) : require$$0$1.createCommentVNode("", true),
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.tableColumns, (item, index2) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_high_level_column, {
                "column-schema": item,
                "data-table-ref": $options.getDataTableRef,
                "column-index": index2,
                "table-options": $props.widget.options
              }, null, 8, ["column-schema", "data-table-ref", "column-index", "table-options"]);
            }), 256)),
            !!$props.widget.options.showButtonsColumn ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
              key: 2,
              fixed: $options.buttonsColumnFixed,
              "class-name": "data-table-buttons-column",
              align: "center",
              label: $props.widget.options.buttonsColumnTitle,
              width: $props.widget.options.buttonsColumnWidth
            }, {
              default: require$$0$1.withCtx((scope) => [
                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.operationButtons, (ob) => {
                  return require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                    type: $options.getOperationButtonType(ob),
                    link: $options.isLinkOperationButton(ob),
                    size: ob.size,
                    round: ob.round,
                    disabled: $options.disableOperationButton(ob, scope.$index, scope.row),
                    onClick: ($event) => $options.handleOperationButtonClick(ob.name, scope.$index, scope.row),
                    class: require$$0$1.normalizeClass(["data-table-" + ob.name + "-button"])
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.getOperationButtonLabel(ob, scope.$index, scope.row)), 1)
                    ]),
                    _: 2
                  }, 1032, ["type", "link", "size", "round", "disabled", "onClick", "class"])), [
                    [require$$0$1.vShow, $options.showOperationButton(ob, scope.$index, scope.row)]
                  ]);
                }), 256))
              ]),
              _: 1
            }, 8, ["fixed", "label", "width"])) : require$$0$1.createCommentVNode("", true)
          ]),
          _: 1
        }, 8, ["data", "class", "height", "style", "border", "show-summary", "row-key", "tree-props", "size", "stripe", "highlight-current-row", "row-class-name", "span-method", "onCurrentChange", "onSelectionChange", "onSortChange", "onHeaderClick", "onRowClick", "onRowDblclick", "onCellClick", "onCellDblclick", "cell-style"])), [
          [_directive_loading, $data.loadingFlag]
        ]),
        $props.widget.options.showPagination ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_pagination, {
          key: 0,
          class: require$$0$1.normalizeClass($options.paginationAlign),
          small: $props.widget.options.smallPagination,
          "current-page": $data.currentPage,
          "page-sizes": $data.pageSizes,
          "page-size": $data.pageSize,
          layout: $options.paginationLayout,
          total: $data.total,
          onSizeChange: $options.handlePageSizeChange,
          onCurrentChange: $options.handleCurrentPageChange
        }, null, 8, ["class", "small", "current-page", "page-sizes", "page-size", "layout", "total", "onSizeChange", "onCurrentChange"])) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["widget"])), [
      [require$$0$1.vShow, !$props.widget.options.hidden]
    ]);
  }
  var dataTableItem = /* @__PURE__ */ _export_sfc(_sfc_main$3$, [["render", _sfc_render$3$], ["__scopeId", "data-v-5cac62c0"]]);
  var __glob_0_2$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dataTableItem
  }, Symbol.toStringTag, { value: "Module" }));
  var gridColItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3_ = {
    name: "GridColItem",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin],
    components: __spreadValues({}, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      colHeight: {
        type: String,
        default: null
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "globalModel", "getFormConfig", "previewState"],
    data() {
      return {
        layoutProps: {
          span: this.widget.options.span,
          md: this.widget.options.md || 12,
          sm: this.widget.options.sm || 12,
          xs: this.widget.options.xs || 12,
          offset: this.widget.options.offset || 0,
          push: this.widget.options.push || 0,
          pull: this.widget.options.pull || 0
        }
      };
    },
    computed: {
      formConfig() {
        return this.getFormConfig();
      },
      customClass() {
        return this.widget.options.customClass || "";
      },
      colHeightStyle() {
        return !!this.colHeight ? { height: this.colHeight + "px" } : {};
      }
    },
    created() {
      this.initLayoutProps();
      this.initRefList();
      this.callSetHidden();
    },
    methods: {
      initLayoutProps() {
        if (!!this.widget.options.responsive) {
          if (!!this.previewState) {
            this.layoutProps.md = void 0;
            this.layoutProps.sm = void 0;
            this.layoutProps.xs = void 0;
            let lyType = this.formConfig.layoutType;
            if (lyType === "H5") {
              this.layoutProps.span = this.widget.options.xs || 12;
            } else if (lyType === "Pad") {
              this.layoutProps.span = this.widget.options.sm || 12;
            } else {
              this.layoutProps.span = this.widget.options.md || 12;
            }
          } else {
            this.layoutProps.span = void 0;
          }
        } else {
          this.layoutProps.md = void 0;
          this.layoutProps.sm = void 0;
          this.layoutProps.xs = void 0;
        }
      },
      callSetHidden() {
        if (this.widget.options.hidden === true) {
          this.setHidden(true);
        }
      },
      setHidden(flag) {
        this.widget.options.hidden = flag;
        let clearRulesFn = (fieldWidget2) => {
          let fwName = fieldWidget2.options.name;
          let fwRef = this.getWidgetRef(fwName);
          if (flag && !!fwRef && !!fwRef.clearFieldRules) {
            fwRef.clearFieldRules();
          }
          if (!flag && !!fwRef && !!fwRef.buildFieldRules) {
            fwRef.buildFieldRules();
          }
        };
        traverseFieldWidgetsOfContainer(this.widget, clearRulesFn);
      }
    }
  };
  const _hoisted_1$E = { class: "blank-cell" };
  const _hoisted_2$l = { class: "invisible-content" };
  function _sfc_render$3_(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    return require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_col, require$$0$1.mergeProps({
      class: ["grid-cell", [$options.customClass]]
    }, $data.layoutProps, { style: $options.colHeightStyle }), {
      default: require$$0$1.withCtx(() => [
        !!$props.widget.widgetList && $props.widget.widgetList.length > 0 ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
          return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
            subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
              widget: subWidget,
              key: swIdx,
              "parent-list": $props.widget.widgetList,
              "index-of-parent-list": swIdx,
              "parent-widget": $props.widget,
              "sub-form-row-id": $props.subFormRowId,
              "sub-form-row-index": $props.subFormRowIndex,
              "sub-form-col-index": $props.subFormColIndex
            }, require$$0$1.createSlots({ _: 2 }, [
              require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                return {
                  name: slot,
                  fn: require$$0$1.withCtx((scope) => [
                    require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                  ])
                };
              })
            ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
              field: subWidget,
              designer: null,
              key: swIdx,
              "parent-list": $props.widget.widgetList,
              "index-of-parent-list": swIdx,
              "parent-widget": $props.widget,
              "sub-form-row-id": $props.subFormRowId,
              "sub-form-row-index": $props.subFormRowIndex,
              "sub-form-col-index": $props.subFormColIndex
            }, require$$0$1.createSlots({ _: 2 }, [
              require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                return {
                  name: slot,
                  fn: require$$0$1.withCtx((scope) => [
                    require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                  ])
                };
              })
            ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
          ], 64);
        }), 256)) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_col, { key: 1 }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_1$E, [
              require$$0$1.createElementVNode("span", _hoisted_2$l, require$$0$1.toDisplayString(_ctx.i18nt("render.hint.blankCellContent")), 1)
            ])
          ]),
          _: 1
        }))
      ]),
      _: 3
    }, 16, ["class", "style"])), [
      [require$$0$1.vShow, !$props.widget.options.hidden]
    ]);
  }
  var GridColItem = /* @__PURE__ */ _export_sfc(_sfc_main$3_, [["render", _sfc_render$3_], ["__scopeId", "data-v-9d9176c6"]]);
  var __glob_0_3$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": GridColItem
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3Z = {
    name: "vf-grid-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: {
      ContainerItemWrapper,
      GridColItem
    },
    props: {
      widget: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "sfRefList", "globalModel"],
    created() {
      this.initRefList();
    },
    mounted() {
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  function _sfc_render$3Z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_grid_col_item = require$$0$1.resolveComponent("grid-col-item");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
          key: $props.widget.id,
          gutter: $props.widget.options.gutter,
          class: require$$0$1.normalizeClass(["grid-container", [_ctx.customClass]]),
          ref: $props.widget.id
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.cols, (colWidget, colIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_grid_col_item, {
                key: colIdx,
                widget: colWidget,
                "parent-list": $props.widget.cols,
                "index-of-parent-list": colIdx,
                "parent-widget": $props.widget,
                "col-height": $props.widget.options.colHeight,
                "sub-form-row-id": $props.subFormRowId,
                "sub-form-row-index": $props.subFormRowIndex,
                "sub-form-col-index": $props.subFormColIndex
              }, require$$0$1.createSlots({ _: 2 }, [
                require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                  return {
                    name: slot,
                    fn: require$$0$1.withCtx((scope) => [
                      require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)))
                    ])
                  };
                })
              ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "col-height", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]);
            }), 128))
          ]),
          _: 3
        }, 8, ["gutter", "class"])), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 3
    }, 8, ["widget"]);
  }
  var gridItem = /* @__PURE__ */ _export_sfc(_sfc_main$3Z, [["render", _sfc_render$3Z]]);
  var __glob_0_4$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridItem
  }, Symbol.toStringTag, { value: "Module" }));
  var gridSubFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3Y = {
    name: "grid-sub-form-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadValues({
      ContainerItemWrapper
    }, comps$1),
    props: {
      widget: Object
    },
    provide() {
      return {
        getSubFormFieldFlag: () => true,
        getSubFormName: () => this.widget.options.name
      };
    },
    inject: ["refList", "sfRefList", "globalModel", "getReadMode"],
    data() {
      return {
        rowIdData: [],
        widgetSchemaData: [],
        actionDisabled: false,
        insertDisabled: false,
        deleteDisabled: false,
        fieldWidgetList: []
      };
    },
    computed: {
      isReadMode() {
        return this.getReadMode();
      },
      leftActionColumn() {
        return (this.widget.options.actionColumnPosition || "left") === "left";
      },
      widgetDisabled() {
        return !!this.widget.options.disabled;
      },
      disabledClass() {
        return !!this.widget.options.disabled ? "sub-form-disabled" : "";
      },
      readModeClass() {
        return !!this.getReadMode() ? "sub-form-read-mode" : "";
      }
    },
    created() {
      this.initRefList();
      this.registerSubFormToRefList();
      this.initRowIdData(true);
      this.initWidgetSchemaData();
      this.initEventHandler();
    },
    mounted() {
      this.extractFieldWidgetList();
      this.handleSubFormFirstRowAdd();
    },
    beforeDestroy() {
      this.unregisterFromRefList();
    },
    methods: {
      extractFieldWidgetList() {
        this.fieldWidgetList.splice(0, this.fieldWidgetList.length);
        let fieldListFn = (fw) => {
          this.fieldWidgetList.push(fw);
        };
        traverseFieldWidgetsOfContainer(this.widget, fieldListFn);
      },
      getLabelAlign(widget, subWidget) {
        return subWidget.options.labelAlign || widget.options.labelAlign;
      },
      registerSubFormToRefList() {
        if (this.widget.type === "grid-sub-form") {
          this.sfRefList[this.widget.options.name] = this;
        }
      },
      initRowIdData(initFlag) {
        if (this.widget.type === "grid-sub-form") {
          this.rowIdData.splice(0, this.rowIdData.length);
          let subFormModel = this.formModel[this.widget.options.name];
          if (!!subFormModel && subFormModel.length > 0) {
            subFormModel.forEach(() => {
              this.rowIdData.push("id" + generateId());
            });
            if (!!initFlag) {
              setTimeout(() => {
                this.handleSubFormRowChange(subFormModel);
              }, 800);
            }
          }
        }
      },
      addToRowIdData() {
        this.rowIdData.push("id" + generateId());
      },
      insertToRowIdData(rowIndex) {
        this.rowIdData.splice(rowIndex, 0, "id" + generateId());
      },
      deleteFromRowIdData(rowIndex) {
        this.rowIdData.splice(rowIndex, 1);
      },
      getRowIdData() {
        return this.rowIdData;
      },
      getWidgetRefOfSubForm(widgetName, rowIndex) {
        let realWidgetName = widgetName + "@row" + this.rowIdData[rowIndex];
        return this.getWidgetRef(realWidgetName);
      },
      initWidgetSchemaData() {
        if (this.widget.type !== "grid-sub-form") {
          return;
        }
        let rowLength = this.rowIdData.length;
        this.widgetSchemaData.splice(0, this.widgetSchemaData.length);
        if (rowLength > 0) {
          for (let i2 = 0; i2 < rowLength; i2++) {
            let widgetSchemas = [];
            this.widget.widgetList.forEach((swItem) => {
              widgetSchemas.push(this.cloneSchemaOfWidget(swItem));
            });
            this.widgetSchemaData.push(widgetSchemas);
          }
        }
      },
      addToWidgetSchemaData(rowIndex) {
        let widgetSchemas = [];
        this.widget.widgetList.forEach((swItem) => {
          widgetSchemas.push(this.cloneSchemaOfWidget(swItem));
        });
        if (rowIndex === void 0) {
          this.widgetSchemaData.push(widgetSchemas);
        } else {
          this.widgetSchemaData.splice(rowIndex, 0, widgetSchemas);
        }
      },
      deleteFromWidgetSchemaData(rowIndex) {
        this.widgetSchemaData.splice(rowIndex, 1);
      },
      cloneSchemaOfWidget(widget) {
        let newWidgetSchema = deepClone(widget);
        newWidgetSchema.id = widget.type + generateId();
        return newWidgetSchema;
      },
      initEventHandler() {
        if (this.widget.type !== "grid-sub-form") {
          return;
        }
        this.on$("setFormData", (newFormData) => {
          this.initRowIdData(false);
          this.initWidgetSchemaData();
          let subFormData = newFormData[this.widget.options.name] || [];
          setTimeout(() => {
            this.handleSubFormRowChange(subFormData);
          }, 800);
        });
      },
      handleSubFormFirstRowAdd() {
        if (this.widget.type !== "grid-sub-form") {
          return;
        }
        if (!!this.widget.options.showBlankRow && this.rowIdData.length === 1) {
          let oldSubFormData = this.formModel[this.widget.options.name] || [];
          this.$nextTick(() => {
            this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[0]);
            this.handleSubFormRowChange(oldSubFormData);
            if (!!this.widget.options.disabled) {
              this.disableSubForm();
            }
          });
        }
      },
      addSubFormRow() {
        let newSubFormDataRow = {};
        this.fieldWidgetList.forEach((subFormItem2) => {
          if (!!subFormItem2.formItemFlag) {
            let fieldKeyName = subFormItem2.options.name;
            fieldKeyName = subFormItem2.options.keyNameEnabled ? subFormItem2.options.keyName || fieldKeyName : fieldKeyName;
            newSubFormDataRow[fieldKeyName] = subFormItem2.options.defaultValue;
          }
        });
        let oldSubFormData = this.formModel[this.widget.options.name] || [];
        oldSubFormData.push(newSubFormDataRow);
        this.addToRowIdData();
        this.addToWidgetSchemaData();
        this.$nextTick(() => {
          this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[oldSubFormData.length - 1]);
          this.handleSubFormRowChange(oldSubFormData);
        });
      },
      insertSubFormRow(beforeFormRowIndex) {
        let newSubFormDataRow = {};
        this.fieldWidgetList.forEach((subFormItem2) => {
          if (!!subFormItem2.formItemFlag) {
            let fieldKeyName = subFormItem2.options.name;
            fieldKeyName = subFormItem2.options.keyNameEnabled ? subFormItem2.options.keyName || fieldKeyName : fieldKeyName;
            newSubFormDataRow[fieldKeyName] = subFormItem2.options.defaultValue;
          }
        });
        let oldSubFormData = this.formModel[this.widget.options.name] || [];
        oldSubFormData.splice(beforeFormRowIndex, 0, newSubFormDataRow);
        this.insertToRowIdData(beforeFormRowIndex);
        this.addToWidgetSchemaData(beforeFormRowIndex);
        this.$nextTick(() => {
          this.handleSubFormRowInsert(oldSubFormData, this.rowIdData[beforeFormRowIndex]);
          this.handleSubFormRowChange(oldSubFormData);
        });
      },
      deleteSubFormRow(formRowIndex) {
        this.$confirm(this.i18nt("render.hint.deleteSubFormRow") + "?", this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          let oldSubFormData = this.formModel[this.widget.options.name] || [];
          let deletedDataRow = deepClone(oldSubFormData[formRowIndex]);
          oldSubFormData.splice(formRowIndex, 1);
          this.deleteFromRowIdData(formRowIndex);
          this.deleteFromWidgetSchemaData(formRowIndex);
          this.$nextTick(() => {
            this.handleSubFormRowDelete(oldSubFormData, deletedDataRow);
            this.handleSubFormRowChange(oldSubFormData);
          });
        }).catch(() => {
        });
      },
      handleSubFormRowChange(subFormData) {
        if (!!this.widget.options.onSubFormRowChange) {
          let customFunc = new Function("subFormData", this.widget.options.onSubFormRowChange);
          customFunc.call(this, subFormData);
        }
      },
      handleSubFormRowAdd(subFormData, newRowId) {
        if (!!this.widget.options.onSubFormRowAdd) {
          let customFunc = new Function("subFormData", "newRowId", this.widget.options.onSubFormRowAdd);
          customFunc.call(this, subFormData, newRowId);
        }
      },
      handleSubFormRowInsert(subFormData, newRowId) {
        if (!!this.widget.options.onSubFormRowInsert) {
          let customFunc = new Function("subFormData", "newRowId", this.widget.options.onSubFormRowInsert);
          customFunc.call(this, subFormData, newRowId);
        }
      },
      handleSubFormRowDelete(subFormData, deletedDataRow) {
        if (!!this.widget.options.onSubFormRowDelete) {
          let customFunc = new Function("subFormData", "deletedDataRow", this.widget.options.onSubFormRowDelete);
          customFunc.call(this, subFormData, deletedDataRow);
        }
      },
      setDisabled(flag) {
        this.widget.options.disabled = flag;
        if (!!flag) {
          this.disableGridSubForm();
        } else {
          this.enableGridSubForm();
        }
      },
      setInsertDisabled(flag) {
        this.insertDisabled = flag;
      },
      setDeleteDisabled(flag) {
        this.deleteDisabled = flag;
      },
      setSubFormValues(subFormValues) {
        this.globalModel.formModel[this.widget.options.name] = subFormValues;
        this.initRowIdData(false);
        this.initWidgetSchemaData();
        setTimeout(() => {
          this.handleSubFormRowChange(subFormValues);
        }, 800);
      },
      setSubFormFieldValue(fieldName, fieldValue, rowIndex) {
        const subFormData = this.globalModel.formModel[this.widget.options.name];
        subFormData[rowIndex][fieldName] = fieldValue;
        this.handleSubFormRowChange(subFormData);
      }
    }
  };
  const _withScopeId$6 = (n) => (require$$0$1.pushScopeId("data-v-5ccd1e74"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$D = { class: "action-header-column" };
  const _hoisted_2$k = { class: "action-label" };
  const _hoisted_3$e = /* @__PURE__ */ _withScopeId$6(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "el-icon-plus el-icon-right" }, null, -1));
  const _hoisted_4$d = {
    key: 0,
    class: "sub-form-action-column hide-label"
  };
  const _hoisted_5$b = { class: "action-button-column" };
  const _hoisted_6$b = {
    key: 0,
    class: "row-number-span"
  };
  const _hoisted_7$8 = {
    key: 1,
    class: "row-no-column"
  };
  const _hoisted_8$8 = {
    key: 0,
    class: "row-number-span"
  };
  const _hoisted_9$7 = { class: "grid-sub-form-data-row" };
  const _hoisted_10$7 = {
    key: 2,
    class: "sub-form-action-column hide-label"
  };
  const _hoisted_11$6 = { class: "action-button-column" };
  function _sfc_render$3Y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["sub-form-container", $options.disabledClass, $options.readModeClass])
        }, [
          require$$0$1.createVNode(_component_el_row, { class: "header-row" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", _hoisted_1$D, [
                require$$0$1.createElementVNode("span", _hoisted_2$k, require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAction")), 1),
                !$options.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                  key: 0,
                  disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                  round: "",
                  type: "primary",
                  size: "small",
                  class: "action-button",
                  onClick: $options.addSubFormRow,
                  title: _ctx.i18nt("render.hint.subFormAddActionHint")
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAddAction")), 1),
                    _hoisted_3$e
                  ]),
                  _: 1
                }, 8, ["disabled", "onClick", "title"])) : require$$0$1.createCommentVNode("", true)
              ])
            ]),
            _: 1
          }),
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.rowIdData, (subFormRowId, sfrIdx) => {
            return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
              class: "sub-form-row",
              key: subFormRowId
            }, [
              $options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_4$d, [
                require$$0$1.createElementVNode("div", _hoisted_5$b, [
                  require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                    disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                    circle: "",
                    type: "",
                    icon: "el-icon-circle-plus-outline",
                    onClick: ($event) => $options.insertSubFormRow(sfrIdx),
                    title: _ctx.i18nt("render.hint.insertSubFormRow")
                  }, null, 8, ["disabled", "onClick", "title"]), [
                    [require$$0$1.vShow, !$options.isReadMode]
                  ]),
                  require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                    disabled: $options.widgetDisabled || $data.actionDisabled || $data.deleteDisabled,
                    circle: "",
                    type: "",
                    icon: "el-icon-delete",
                    onClick: ($event) => $options.deleteSubFormRow(sfrIdx),
                    title: _ctx.i18nt("render.hint.deleteSubFormRow")
                  }, null, 8, ["disabled", "onClick", "title"]), [
                    [require$$0$1.vShow, !$options.isReadMode]
                  ]),
                  $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_6$b, "#" + require$$0$1.toDisplayString(sfrIdx + 1), 1)) : require$$0$1.createCommentVNode("", true)
                ])
              ])) : require$$0$1.createCommentVNode("", true),
              !$options.leftActionColumn && $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_7$8, [
                $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_8$8, "#" + require$$0$1.toDisplayString(sfrIdx + 1), 1)) : require$$0$1.createCommentVNode("", true)
              ])) : require$$0$1.createCommentVNode("", true),
              require$$0$1.createElementVNode("div", _hoisted_9$7, [
                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
                  return require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
                    key: $data.widgetSchemaData[sfrIdx][swIdx].id,
                    widget: $data.widgetSchemaData[sfrIdx][swIdx],
                    "parent-list": $props.widget.widgetList,
                    "index-of-parent-list": swIdx,
                    "parent-widget": $props.widget,
                    "sub-form-row-id": subFormRowId,
                    "sub-form-row-index": sfrIdx,
                    "sub-form-col-index": swIdx
                  }, null, 8, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]);
                }), 128))
              ]),
              !$options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_10$7, [
                require$$0$1.createElementVNode("div", _hoisted_11$6, [
                  require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                    disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                    circle: "",
                    type: "",
                    icon: "el-icon-circle-plus-outline",
                    onClick: ($event) => $options.insertSubFormRow(sfrIdx),
                    title: _ctx.i18nt("render.hint.insertSubFormRow")
                  }, null, 8, ["disabled", "onClick", "title"]), [
                    [require$$0$1.vShow, !$options.isReadMode]
                  ]),
                  require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                    disabled: $options.widgetDisabled || $data.actionDisabled || $data.deleteDisabled,
                    circle: "",
                    type: "",
                    icon: "el-icon-delete",
                    onClick: ($event) => $options.deleteSubFormRow(sfrIdx),
                    title: _ctx.i18nt("render.hint.deleteSubFormRow")
                  }, null, 8, ["disabled", "onClick", "title"]), [
                    [require$$0$1.vShow, !$options.isReadMode]
                  ])
                ])
              ])) : require$$0$1.createCommentVNode("", true)
            ]);
          }), 128))
        ], 2), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 1
    }, 8, ["widget"]);
  }
  var gridSubFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$3Y, [["render", _sfc_render$3Y], ["__scopeId", "data-v-5ccd1e74"]]);
  var __glob_0_5$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridSubFormItem
  }, Symbol.toStringTag, { value: "Module" }));
  var objectGroupItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3X = {
    name: "object-group-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadValues({
      ContainerItemWrapper
    }, comps$1),
    props: {
      widget: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      },
      parentObjectName: {
        type: String,
        default: ""
      }
    },
    provide() {
      return {
        getObjectFieldFlag: () => true,
        getObjectName: () => this.widget.options.objectName
      };
    },
    inject: ["refList", "globalModel"],
    data() {
      return {};
    },
    created() {
      this.initRefList();
      this.handleOnCreated();
    },
    mounted() {
      this.handleOnMounted();
    },
    methods: {
      handleOnCreated() {
        if (!!this.widget.options.onCreated) {
          let customFunc = new Function(this.widget.options.onCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.widget.options.onMounted) {
          let customFunc = new Function(this.widget.options.onMounted);
          customFunc.call(this);
        }
      }
    }
  };
  const _hoisted_1$C = { class: "object-group-container" };
  function _sfc_render$3X(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createElementVNode("div", _hoisted_1$C, [
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
            return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
              subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
                widget: subWidget,
                key: swIdx,
                "parent-list": $props.widget.widgetList,
                "index-of-parent-list": swIdx,
                "parent-widget": $props.widget,
                "parent-object-name": $props.widget.options.objectName,
                "sub-form-row-id": $props.subFormRowId,
                "sub-form-row-index": $props.subFormRowIndex,
                "sub-form-col-index": $props.subFormColIndex
              }, require$$0$1.createSlots({ _: 2 }, [
                require$$0$1.renderList(Object.keys(_ctx.$scopedSlots), (slot) => {
                  return {
                    name: slot,
                    fn: require$$0$1.withCtx((scope) => [
                      require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                    ])
                  };
                })
              ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "parent-object-name", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                field: subWidget,
                key: swIdx,
                "parent-list": $props.widget.widgetList,
                "index-of-parent-list": swIdx,
                "parent-widget": $props.widget,
                "sub-form-row-id": $props.subFormRowId,
                "sub-form-row-index": $props.subFormRowIndex,
                "sub-form-col-index": $props.subFormColIndex
              }, require$$0$1.createSlots({ _: 2 }, [
                require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                  return {
                    name: slot,
                    fn: require$$0$1.withCtx((scope) => [
                      require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                    ])
                  };
                })
              ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
            ], 64);
          }), 256))
        ], 512), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 3
    }, 8, ["widget"]);
  }
  var objectGroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$3X, [["render", _sfc_render$3X], ["__scopeId", "data-v-57bcc1e4"]]);
  var __glob_0_6$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": objectGroupItem
  }, Symbol.toStringTag, { value: "Module" }));
  var subFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3W = {
    name: "sub-form-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadProps(__spreadValues({
      ContainerItemWrapper
    }, comps$1), {
      SvgIcon
    }),
    props: {
      widget: Object
    },
    provide() {
      return {
        getSubFormFieldFlag: () => true,
        getSubFormName: () => this.widget.options.name
      };
    },
    inject: ["refList", "sfRefList", "globalModel", "getReadMode"],
    data() {
      return {
        rowIdData: [],
        fieldSchemaData: [],
        actionDisabled: false,
        insertDisabled: false,
        deleteDisabled: false
      };
    },
    computed: {
      isReadMode() {
        return this.getReadMode();
      },
      leftActionColumn() {
        return (this.widget.options.actionColumnPosition || "left") === "left";
      },
      widgetDisabled() {
        return !!this.widget.options.disabled;
      },
      disabledClass() {
        return !!this.widget.options.disabled ? "sub-form-disabled" : "";
      },
      readModeClass() {
        return !!this.getReadMode() ? "sub-form-read-mode" : "";
      }
    },
    created() {
      this.initRefList();
      this.registerSubFormToRefList();
      this.initRowIdData(true);
      this.initFieldSchemaData();
      this.initEventHandler();
    },
    mounted() {
      this.handleSubFormFirstRowAdd();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      getLabelAlign(widget, subWidget) {
        return subWidget.options.labelAlign || widget.options.labelAlign;
      },
      registerSubFormToRefList() {
        if (this.widget.type === "sub-form") {
          this.sfRefList[this.widget.options.name] = this;
        }
      },
      initRowIdData(initFlag) {
        if (this.widget.type === "sub-form") {
          this.rowIdData.splice(0, this.rowIdData.length);
          let subFormModel = this.formModel[this.widget.options.name];
          if (!!subFormModel && subFormModel.length > 0) {
            subFormModel.forEach(() => {
              this.rowIdData.push("id" + generateId());
            });
            if (!!initFlag) {
              setTimeout(() => {
                this.handleSubFormRowChange(subFormModel);
              }, 800);
            }
          }
        }
      },
      addToRowIdData() {
        this.rowIdData.push("id" + generateId());
      },
      insertToRowIdData(rowIndex) {
        this.rowIdData.splice(rowIndex, 0, "id" + generateId());
      },
      deleteFromRowIdData(rowIndex) {
        this.rowIdData.splice(rowIndex, 1);
      },
      getRowIdData() {
        return this.rowIdData;
      },
      getWidgetRefOfSubForm(widgetName, rowIndex) {
        let realWidgetName = widgetName + "@row" + this.rowIdData[rowIndex];
        return this.getWidgetRef(realWidgetName);
      },
      initFieldSchemaData() {
        if (this.widget.type !== "sub-form") {
          return;
        }
        let rowLength = this.rowIdData.length;
        this.fieldSchemaData.splice(0, this.fieldSchemaData.length);
        if (rowLength > 0) {
          for (let i2 = 0; i2 < rowLength; i2++) {
            let fieldSchemas = [];
            this.widget.widgetList.forEach((swItem) => {
              fieldSchemas.push(this.cloneFieldSchema(swItem));
            });
            this.fieldSchemaData.push(fieldSchemas);
          }
        }
      },
      addToFieldSchemaData(rowIndex) {
        let fieldSchemas = [];
        this.widget.widgetList.forEach((swItem) => {
          fieldSchemas.push(this.cloneFieldSchema(swItem));
        });
        if (rowIndex === void 0) {
          this.fieldSchemaData.push(fieldSchemas);
        } else {
          this.fieldSchemaData.splice(rowIndex, 0, fieldSchemas);
        }
      },
      deleteFromFieldSchemaData(rowIndex) {
        this.fieldSchemaData.splice(rowIndex, 1);
      },
      cloneFieldSchema(fieldWidget2) {
        let newFieldSchema = deepClone(fieldWidget2);
        newFieldSchema.id = fieldWidget2.type + generateId();
        return newFieldSchema;
      },
      initEventHandler() {
        if (this.widget.type !== "sub-form") {
          return;
        }
        this.on$("setFormData", (newFormData) => {
          this.initRowIdData(false);
          this.initFieldSchemaData();
          let subFormData = newFormData[this.widget.options.name] || [];
          setTimeout(() => {
            this.handleSubFormRowChange(subFormData);
          }, 800);
        });
      },
      handleSubFormFirstRowAdd() {
        if (this.widget.type !== "sub-form") {
          return;
        }
        if (!!this.widget.options.showBlankRow && this.rowIdData.length === 1) {
          let oldSubFormData = this.formModel[this.widget.options.name] || [];
          this.$nextTick(() => {
            this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[0]);
            this.handleSubFormRowChange(oldSubFormData);
            if (!!this.widget.options.disabled) {
              this.disableSubForm();
            }
          });
        }
      },
      addSubFormRow() {
        let newSubFormDataRow = {};
        this.widget.widgetList.forEach((subFormItem2) => {
          if (!!subFormItem2.formItemFlag) {
            let fieldKeyName = subFormItem2.options.name;
            fieldKeyName = subFormItem2.options.keyNameEnabled ? subFormItem2.options.keyName || fieldKeyName : fieldKeyName;
            newSubFormDataRow[fieldKeyName] = subFormItem2.options.defaultValue;
          }
        });
        let oldSubFormData = this.formModel[this.widget.options.name] || [];
        oldSubFormData.push(newSubFormDataRow);
        this.addToRowIdData();
        this.addToFieldSchemaData();
        this.handleSubFormRowAdd(oldSubFormData, this.rowIdData[oldSubFormData.length - 1]);
        this.handleSubFormRowChange(oldSubFormData);
      },
      insertSubFormRow(beforeFormRowIndex) {
        let newSubFormDataRow = {};
        this.widget.widgetList.forEach((subFormItem2) => {
          if (!!subFormItem2.formItemFlag) {
            let fieldKeyName = subFormItem2.options.name;
            fieldKeyName = subFormItem2.options.keyNameEnabled ? subFormItem2.options.keyName || fieldKeyName : fieldKeyName;
            newSubFormDataRow[fieldKeyName] = subFormItem2.options.defaultValue;
          }
        });
        let oldSubFormData = this.formModel[this.widget.options.name] || [];
        oldSubFormData.splice(beforeFormRowIndex, 0, newSubFormDataRow);
        this.insertToRowIdData(beforeFormRowIndex);
        this.addToFieldSchemaData(beforeFormRowIndex);
        this.handleSubFormRowInsert(oldSubFormData, this.rowIdData[beforeFormRowIndex]);
        this.handleSubFormRowChange(oldSubFormData);
      },
      deleteSubFormRow(formRowIndex) {
        this.$confirm(this.i18nt("render.hint.deleteSubFormRow") + "?", this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          let oldSubFormData = this.formModel[this.widget.options.name] || [];
          let deletedDataRow = deepClone(oldSubFormData[formRowIndex]);
          oldSubFormData.splice(formRowIndex, 1);
          this.deleteFromRowIdData(formRowIndex);
          this.deleteFromFieldSchemaData(formRowIndex);
          this.handleSubFormRowDelete(oldSubFormData, deletedDataRow);
          this.handleSubFormRowChange(oldSubFormData);
        }).catch(() => {
        });
      },
      handleSubFormRowChange(subFormData) {
        if (!!this.widget.options.onSubFormRowChange) {
          let customFunc = new Function("subFormData", this.widget.options.onSubFormRowChange);
          customFunc.call(this, subFormData);
        }
      },
      handleSubFormRowAdd(subFormData, newRowId) {
        if (!!this.widget.options.onSubFormRowAdd) {
          let customFunc = new Function("subFormData", "newRowId", this.widget.options.onSubFormRowAdd);
          customFunc.call(this, subFormData, newRowId);
        }
      },
      handleSubFormRowInsert(subFormData, newRowId) {
        if (!!this.widget.options.onSubFormRowInsert) {
          let customFunc = new Function("subFormData", "newRowId", this.widget.options.onSubFormRowInsert);
          customFunc.call(this, subFormData, newRowId);
        }
      },
      handleSubFormRowDelete(subFormData, deletedDataRow) {
        if (!!this.widget.options.onSubFormRowDelete) {
          let customFunc = new Function("subFormData", "deletedDataRow", this.widget.options.onSubFormRowDelete);
          customFunc.call(this, subFormData, deletedDataRow);
        }
      },
      setDisabled(flag) {
        this.widget.options.disabled = flag;
        if (!!flag) {
          this.disableSubForm();
        } else {
          this.enableSubForm();
        }
      },
      setInsertDisabled(flag) {
        this.insertDisabled = flag;
      },
      setDeleteDisabled(flag) {
        this.deleteDisabled = flag;
      },
      setSubFormValues(subFormValues) {
        this.globalModel.formModel[this.widget.options.name] = subFormValues;
        this.initRowIdData(false);
        this.initFieldSchemaData();
        setTimeout(() => {
          this.handleSubFormRowChange(subFormValues);
        }, 800);
      },
      setSubFormFieldValue(fieldName, fieldValue, rowIndex) {
        const subFormData = this.globalModel.formModel[this.widget.options.name];
        subFormData[rowIndex][fieldName] = fieldValue;
        this.handleSubFormRowChange(subFormData);
      }
    }
  };
  const _hoisted_1$B = {
    key: 0,
    class: "action-header-column"
  };
  const _hoisted_2$j = { class: "action-label" };
  const _hoisted_3$d = {
    key: 1,
    class: "row-no-header-column"
  };
  const _hoisted_4$c = {
    key: 0,
    class: "custom-label"
  };
  const _hoisted_5$a = ["title"];
  const _hoisted_6$a = {
    key: 2,
    class: "action-header-column"
  };
  const _hoisted_7$7 = { class: "action-label" };
  const _hoisted_8$7 = {
    key: 0,
    class: "sub-form-action-column hide-label"
  };
  const _hoisted_9$6 = { class: "action-button-column" };
  const _hoisted_10$6 = {
    key: 0,
    class: "row-number-span"
  };
  const _hoisted_11$5 = {
    key: 1,
    class: "row-no-column"
  };
  const _hoisted_12$4 = {
    key: 0,
    class: "row-number-span"
  };
  const _hoisted_13$4 = {
    key: 2,
    class: "sub-form-action-column hide-label"
  };
  const _hoisted_14$3 = { class: "action-button-column" };
  function _sfc_render$3W(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["sub-form-container", $options.disabledClass, $options.readModeClass])
        }, [
          require$$0$1.createVNode(_component_el_row, { class: "header-row" }, {
            default: require$$0$1.withCtx(() => [
              $options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$B, [
                require$$0$1.createElementVNode("span", _hoisted_2$j, require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAction")), 1),
                !$options.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                  key: 0,
                  disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                  round: "",
                  type: "primary",
                  size: "small",
                  class: "action-button",
                  onClick: $options.addSubFormRow,
                  title: _ctx.i18nt("render.hint.subFormAddActionHint")
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAddAction")), 1),
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" })
                  ]),
                  _: 1
                }, 8, ["disabled", "onClick", "title"])) : require$$0$1.createCommentVNode("", true)
              ])) : require$$0$1.createCommentVNode("", true),
              !$options.leftActionColumn && $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_3$d, [
                require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormRowNo")), 1)
              ])) : require$$0$1.createCommentVNode("", true),
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.widgetList, (subWidget) => {
                return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, {
                  key: subWidget.id + "thc"
                }, [
                  !subWidget.options.hidden ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
                    key: 0,
                    class: require$$0$1.normalizeClass(["field-header-column", [$options.getLabelAlign($props.widget, subWidget), !!subWidget.options.required ? "is-required" : ""]]),
                    style: require$$0$1.normalizeStyle({ width: subWidget.options.columnWidth })
                  }, [
                    !!subWidget.options.labelIconClass ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_4$c, [
                      subWidget.options.labelIconPosition === "front" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
                        !!subWidget.options.labelTooltip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
                          require$$0$1.createVNode(_component_el_tooltip, {
                            content: subWidget.options.labelTooltip,
                            effect: "light"
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createVNode(_component_svg_icon, {
                                "icon-class": subWidget.options.labelIconClass
                              }, null, 8, ["icon-class"])
                            ]),
                            _: 2
                          }, 1032, ["content"]),
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(subWidget.options.label), 1)
                        ], 64)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
                          require$$0$1.createVNode(_component_svg_icon, {
                            "icon-class": subWidget.options.labelIconClass
                          }, null, 8, ["icon-class"]),
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(subWidget.options.label), 1)
                        ], 64))
                      ], 64)) : subWidget.options.labelIconPosition === "rear" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
                        !!subWidget.options.labelTooltip ? (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(subWidget.options.label), 1),
                          require$$0$1.createVNode(_component_el_tooltip, {
                            content: subWidget.options.labelTooltip,
                            effect: "light"
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createVNode(_component_svg_icon, {
                                "icon-class": subWidget.options.labelIconClass
                              }, null, 8, ["icon-class"])
                            ]),
                            _: 2
                          }, 1032, ["content"])
                        ], 64)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(subWidget.options.label), 1),
                          require$$0$1.createVNode(_component_svg_icon, {
                            "icon-class": subWidget.options.labelIconClass
                          }, null, 8, ["icon-class"])
                        ], 64))
                      ], 64)) : require$$0$1.createCommentVNode("", true)
                    ])) : (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", {
                      key: 1,
                      title: subWidget.options.labelTooltip
                    }, require$$0$1.toDisplayString(subWidget.options.label), 9, _hoisted_5$a))
                  ], 6)) : require$$0$1.createCommentVNode("", true)
                ], 64);
              }), 128)),
              !$options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_6$a, [
                require$$0$1.createElementVNode("span", _hoisted_7$7, require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAction")), 1),
                !$options.isReadMode ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                  key: 0,
                  disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                  round: "",
                  type: "primary",
                  size: "small",
                  class: "action-button",
                  onClick: $options.addSubFormRow,
                  title: _ctx.i18nt("render.hint.subFormAddActionHint")
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("render.hint.subFormAddAction")), 1),
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" })
                  ]),
                  _: 1
                }, 8, ["disabled", "onClick", "title"])) : require$$0$1.createCommentVNode("", true)
              ])) : require$$0$1.createCommentVNode("", true)
            ]),
            _: 1
          }),
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.rowIdData, (subFormRowId, sfrIdx) => {
            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
              class: "sub-form-row",
              key: subFormRowId
            }, {
              default: require$$0$1.withCtx(() => [
                $options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_8$7, [
                  require$$0$1.createElementVNode("div", _hoisted_9$6, [
                    require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                      disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                      circle: "",
                      onClick: ($event) => $options.insertSubFormRow(sfrIdx),
                      title: _ctx.i18nt("render.hint.insertSubFormRow")
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" })
                      ]),
                      _: 2
                    }, 1032, ["disabled", "onClick", "title"]), [
                      [require$$0$1.vShow, !$options.isReadMode]
                    ]),
                    require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                      disabled: $options.widgetDisabled || $data.actionDisabled || $data.deleteDisabled,
                      circle: "",
                      onClick: ($event) => $options.deleteSubFormRow(sfrIdx),
                      title: _ctx.i18nt("render.hint.deleteSubFormRow")
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
                      ]),
                      _: 2
                    }, 1032, ["disabled", "onClick", "title"]), [
                      [require$$0$1.vShow, !$options.isReadMode]
                    ]),
                    $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_10$6, "#" + require$$0$1.toDisplayString(sfrIdx + 1), 1)) : require$$0$1.createCommentVNode("", true)
                  ])
                ])) : require$$0$1.createCommentVNode("", true),
                !$options.leftActionColumn && $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_11$5, [
                  $props.widget.options.showRowNumber ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_12$4, "#" + require$$0$1.toDisplayString(sfrIdx + 1), 1)) : require$$0$1.createCommentVNode("", true)
                ])) : require$$0$1.createCommentVNode("", true),
                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
                  return require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
                    key: $data.fieldSchemaData[sfrIdx][swIdx].id,
                    class: "sub-form-table-column hide-label",
                    style: require$$0$1.normalizeStyle({ width: subWidget.options.columnWidth })
                  }, [
                    (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                      field: $data.fieldSchemaData[sfrIdx][swIdx],
                      "parent-list": $props.widget.widgetList,
                      "index-of-parent-list": swIdx,
                      "parent-widget": $props.widget,
                      "sub-form-row-id": subFormRowId,
                      "sub-form-row-index": sfrIdx,
                      "sub-form-col-index": swIdx
                    }, null, 8, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
                  ], 4)), [
                    [require$$0$1.vShow, !subWidget.options.hidden]
                  ]);
                }), 128)),
                !$options.leftActionColumn ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_13$4, [
                  require$$0$1.createElementVNode("div", _hoisted_14$3, [
                    require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                      disabled: $options.widgetDisabled || $data.actionDisabled || $data.insertDisabled,
                      circle: "",
                      onClick: ($event) => $options.insertSubFormRow(sfrIdx),
                      title: _ctx.i18nt("render.hint.insertSubFormRow")
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-plus" })
                      ]),
                      _: 2
                    }, 1032, ["disabled", "onClick", "title"]), [
                      [require$$0$1.vShow, !$options.isReadMode]
                    ]),
                    require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_button, {
                      disabled: $options.widgetDisabled || $data.actionDisabled || $data.deleteDisabled,
                      circle: "",
                      onClick: ($event) => $options.deleteSubFormRow(sfrIdx),
                      title: _ctx.i18nt("render.hint.deleteSubFormRow")
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
                      ]),
                      _: 2
                    }, 1032, ["disabled", "onClick", "title"]), [
                      [require$$0$1.vShow, !$options.isReadMode]
                    ])
                  ])
                ])) : require$$0$1.createCommentVNode("", true)
              ]),
              _: 2
            }, 1024);
          }), 128))
        ], 2), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 1
    }, 8, ["widget"]);
  }
  var subFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$3W, [["render", _sfc_render$3W], ["__scopeId", "data-v-5810c836"]]);
  var __glob_0_7$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": subFormItem
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3V = {
    name: "tab-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadValues({
      ContainerItemWrapper
    }, comps$1),
    props: {
      widget: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "sfRefList", "globalModel"],
    data() {
      return {
        activeTabName: ""
      };
    },
    computed: {
      tabDisplayType() {
        return !this.widget.options.tabType ? "border-card" : this.widget.options.tabType;
      },
      visibleTabs() {
        return this.widget.tabs.filter((tp) => {
          return !tp.options.hidden;
        });
      }
    },
    created() {
      this.initRefList();
    },
    mounted() {
      this.initActiveTab();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      initActiveTab() {
        if (this.widget.type === "tab" && this.widget.tabs.length > 0) {
          let activePanes = this.widget.tabs.filter((tp) => {
            return tp.options.active === true;
          });
          if (activePanes.length > 0) {
            this.activeTabName = activePanes[0].options.name;
          } else {
            this.activeTabName = this.widget.tabs[0].options.name;
          }
        }
      },
      handleTabClick(tab) {
        if (!!this.widget.options.onTabClick) {
          let customFn = new Function("tab", this.widget.options.onTabClick);
          customFn.call(this, tab);
        }
      },
      getActiveTabIndex() {
        let foundIndex = -1;
        this.widget.tabs.forEach((tp, idx) => {
          if (tp.options.name === this.activeTabName) {
            foundIndex = idx;
          }
        });
        return foundIndex;
      }
    }
  };
  const _hoisted_1$A = { class: "tab-container" };
  function _sfc_render$3V(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createElementVNode("div", _hoisted_1$A, [
          require$$0$1.createVNode(_component_el_tabs, {
            modelValue: $data.activeTabName,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.activeTabName = $event),
            type: $options.tabDisplayType,
            "tab-position": $props.widget.options.tabPosition,
            ref: $props.widget.id,
            class: require$$0$1.normalizeClass([_ctx.customClass]),
            onTabClick: $options.handleTabClick
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.visibleTabs, (tab, index2) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                  key: index2,
                  label: tab.options.label,
                  disabled: tab.options.disabled,
                  name: tab.options.name
                }, {
                  default: require$$0$1.withCtx(() => [
                    (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(tab.widgetList, (subWidget, swIdx) => {
                      return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                        subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
                          widget: subWidget,
                          key: swIdx,
                          "parent-list": tab.widgetList,
                          "index-of-parent-list": swIdx,
                          "parent-widget": $props.widget,
                          "sub-form-row-id": $props.subFormRowId,
                          "sub-form-row-index": $props.subFormRowIndex,
                          "sub-form-col-index": $props.subFormColIndex
                        }, require$$0$1.createSlots({ _: 2 }, [
                          require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                            return {
                              name: slot,
                              fn: require$$0$1.withCtx((scope) => [
                                require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)))
                              ])
                            };
                          })
                        ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                          field: subWidget,
                          key: swIdx,
                          "parent-list": tab.widgetList,
                          "index-of-parent-list": swIdx,
                          "parent-widget": $props.widget,
                          "sub-form-row-id": $props.subFormRowId,
                          "sub-form-row-index": $props.subFormRowIndex,
                          "sub-form-col-index": $props.subFormColIndex
                        }, require$$0$1.createSlots({ _: 2 }, [
                          require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                            return {
                              name: slot,
                              fn: require$$0$1.withCtx((scope) => [
                                require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)))
                              ])
                            };
                          })
                        ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
                      ], 64);
                    }), 256))
                  ]),
                  _: 2
                }, 1032, ["label", "disabled", "name"]);
              }), 128))
            ]),
            _: 3
          }, 8, ["modelValue", "type", "tab-position", "class", "onTabClick"])
        ], 512), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 3
    }, 8, ["widget"]);
  }
  var tabItem = /* @__PURE__ */ _export_sfc(_sfc_main$3V, [["render", _sfc_render$3V]]);
  var __glob_0_8$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tabItem
  }, Symbol.toStringTag, { value: "Module" }));
  var tableCellItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3U = {
    name: "TableCellItem",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin],
    components: __spreadValues({}, comps$1),
    props: {
      widget: Object,
      rowIndex: Number,
      colIndex: Number,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "globalModel"],
    computed: {
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
    },
    methods: {}
  };
  const _hoisted_1$z = ["colspan", "rowspan"];
  function _sfc_render$3U(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("td", {
      class: require$$0$1.normalizeClass(["table-cell", [$options.customClass]]),
      colspan: $props.widget.options.colspan || 1,
      rowspan: $props.widget.options.rowspan || 1,
      style: require$$0$1.normalizeStyle({ width: $props.widget.options.cellWidth + " !important" || "", height: $props.widget.options.cellHeight + " !important" || "", "word-break": !!$props.widget.options.wordBreak ? "break-all" : "normal" })
    }, [
      (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
        return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
          subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
            widget: subWidget,
            key: swIdx,
            "parent-list": $props.widget.widgetList,
            "index-of-parent-list": swIdx,
            "parent-widget": $props.widget,
            "sub-form-row-id": $props.subFormRowId,
            "sub-form-row-index": $props.subFormRowIndex,
            "sub-form-col-index": $props.subFormColIndex
          }, require$$0$1.createSlots({ _: 2 }, [
            require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
              return {
                name: slot,
                fn: require$$0$1.withCtx((scope) => [
                  require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                ])
              };
            })
          ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
            field: subWidget,
            key: swIdx,
            "parent-list": $props.widget.widgetList,
            "index-of-parent-list": swIdx,
            "parent-widget": $props.widget,
            "sub-form-row-id": $props.subFormRowId,
            "sub-form-row-index": $props.subFormRowIndex,
            "sub-form-col-index": $props.subFormColIndex
          }, require$$0$1.createSlots({ _: 2 }, [
            require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
              return {
                name: slot,
                fn: require$$0$1.withCtx((scope) => [
                  require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                ])
              };
            })
          ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"]))
        ], 64);
      }), 256))
    ], 14, _hoisted_1$z);
  }
  var TableCellItem = /* @__PURE__ */ _export_sfc(_sfc_main$3U, [["render", _sfc_render$3U], ["__scopeId", "data-v-16fa7af9"]]);
  var __glob_0_9$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": TableCellItem
  }, Symbol.toStringTag, { value: "Module" }));
  var tableItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3T = {
    name: "table-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: {
      ContainerItemWrapper,
      TableCellItem
    },
    props: {
      widget: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "sfRefList", "globalModel"],
    created() {
      this.initRefList();
    },
    mounted() {
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {}
  };
  const _hoisted_1$y = { class: "table-container" };
  function _sfc_render$3T(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_table_cell_item = require$$0$1.resolveComponent("table-cell-item");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createElementVNode("div", _hoisted_1$y, [
          require$$0$1.createElementVNode("table", {
            ref: $props.widget.id,
            class: require$$0$1.normalizeClass(["table-layout", [_ctx.customClass]])
          }, [
            require$$0$1.createElementVNode("tbody", null, [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.rows, (row, rowIdx) => {
                return require$$0$1.openBlock(), require$$0$1.createElementBlock("tr", {
                  key: row.id
                }, [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(row.cols, (colWidget, colIdx) => {
                    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                      !colWidget.merged ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_cell_item, {
                        widget: colWidget,
                        key: colIdx,
                        "parent-list": $props.widget.cols,
                        "row-index": rowIdx,
                        "col-index": colIdx,
                        "parent-widget": $props.widget,
                        "sub-form-row-id": $props.subFormRowId,
                        "sub-form-row-index": $props.subFormRowIndex,
                        "sub-form-col-index": $props.subFormColIndex
                      }, require$$0$1.createSlots({ _: 2 }, [
                        require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                          return {
                            name: slot,
                            fn: require$$0$1.withCtx((scope) => [
                              require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                            ])
                          };
                        })
                      ]), 1032, ["widget", "parent-list", "row-index", "col-index", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : require$$0$1.createCommentVNode("", true)
                    ], 64);
                  }), 256))
                ]);
              }), 128))
            ])
          ], 2)
        ], 512), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 3
    }, 8, ["widget"]);
  }
  var tableItem = /* @__PURE__ */ _export_sfc(_sfc_main$3T, [["render", _sfc_render$3T], ["__scopeId", "data-v-4d4f1738"]]);
  var __glob_0_10$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tableItem
  }, Symbol.toStringTag, { value: "Module" }));
  var treeItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  let id$2 = 1e3;
  const _sfc_main$3S = {
    name: "TreeItem",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadValues({
      ContainerItemWrapper
    }, comps$1),
    inject: ["refList", "sfRefList", "globalModel", "getFormConfig", "getGlobalDsv"],
    data() {
      return {
        isExpanded: true,
        isChecked: false,
        currentKey: "",
        filterText: "",
        loadingFlag: false,
        defaultProps: {
          children: "children",
          label: "label",
          disabled: this.isDisabled
        }
      };
    },
    computed: {
      formConfig() {
        return this.getFormConfig();
      }
    },
    watch: {
      filterText(val) {
        this.$refs.tree.filter(val);
      }
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    created() {
      this.initRefList();
      this.handleOnCreated();
    },
    mounted() {
      if (!!this.widget.options.dsEnabled) {
        this.loadDataFromDS({});
      }
      this.$nextTick(() => {
        this.handleOnMounted();
      });
    },
    beforeDestroy() {
      this.unregisterFromRefList();
    },
    methods: {
      isDisabled() {
        return this.widget.options.disabled;
      },
      append(data2) {
        this.$prompt(this.i18nt("designer.setting.inputNodeName"), this.i18nt("designer.setting.tips"), {
          confirmButtonText: this.i18nt("designer.hint.confirm"),
          cancelButtonText: this.i18nt("designer.hint.cancel")
        }).then(({ value: value2 }) => {
          const newChild = { id: id$2++, label: value2, children: [] };
          if (!data2.children) {
            data2.children = [];
          }
          data2.children.push(newChild);
        }).catch((err) => {
          console.error(err);
        });
      },
      remove(node, data2) {
        this.$confirm(this.i18nt("designer.setting.deleteNode"), this.i18nt("designer.setting.tips"), {
          confirmButtonText: this.i18nt("designer.hint.confirm"),
          cancelButtonText: this.i18nt("designer.hint.cancel"),
          type: "warning"
        }).then(() => {
          const parent = node.parent;
          const children = parent.data.children || parent.data;
          const index2 = children.findIndex((d) => d.id === data2.id);
          children.splice(index2, 1);
          this.$message({
            type: "success",
            message: this.i18nt("designer.setting.nodeDeleted")
          });
        }).catch((err) => {
          console.error(err);
        });
      },
      filterNode(value2, data2) {
        if (!value2)
          return true;
        return data2.label.indexOf(value2) !== -1;
      },
      handleOnCreated() {
        if (!!this.widget.options.onCreated) {
          let customFunc = new Function(this.widget.options.onCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.widget.options.onMounted) {
          let customFunc = new Function(this.widget.options.onMounted);
          customFunc.call(this);
        }
      },
      handleTreeNodeClick(data2, node, el) {
        if (!!this.widget.options.onNodeClick) {
          let customFn = new Function("data", "node", "el", this.widget.options.onNodeClick);
          customFn.call(this, data2, node, el);
        }
      },
      handleTreeNodeContextmenu(event, data2, node, el) {
        if (!!this.widget.options.onNodeContextmenu) {
          let customFn = new Function("event", "data", "node", "el", this.widget.options.onNodeContextmenu);
          customFn.call(this, event, data2, node, el);
        }
      },
      handleTreeNodeCheck(data2, treeState) {
        if (!!this.widget.options.onNodeCheck) {
          let customFn = new Function("data", "treeState", this.widget.options.onNodeCheck);
          customFn.call(this, data2, treeState);
        }
      },
      handleCheckChange(data2, checked, indeterminate) {
        if (!!this.widget.options.onCheckChange) {
          let customFn = new Function("data", "checked", "indeterminate", this.widget.options.onCheckChange);
          customFn.call(this, data2, checked, indeterminate);
        }
      },
      setNodeExpanded(node, flag) {
        node.expanded = flag;
        for (let i2 = 0; i2 < node.childNodes.length; i2++) {
          node.childNodes[i2].expanded = flag;
          if (node.childNodes[i2].childNodes.length > 0) {
            this.setNodeExpanded(node.childNodes[i2], flag);
          }
        }
      },
      setNodeChecked(node, flag) {
        node.checked = flag;
        for (let i2 = 0; i2 < node.childNodes.length; i2++) {
          node.childNodes[i2].checked = flag;
          if (node.childNodes[i2].childNodes.length > 0) {
            this.setNodeChecked(node.childNodes[i2], flag);
          }
        }
      },
      getNativeTree() {
        return this.$refs.tree;
      },
      setTreeData(data2) {
        this.widget.options.treeData = data2;
        if (data2 && data2.length > 0) {
          this.currentKey = data2[0].id;
        }
      },
      getTreeData() {
        return this.widget.options.treeData;
      },
      expandAllNodes(flag) {
        this.isExpanded = flag || !this.isExpanded;
        this.setNodeExpanded(this.$refs.tree.store.root, this.isExpanded);
      },
      checkAllNodes(flag) {
        this.isChecked = flag || !this.isChecked;
        this.setNodeChecked(this.$refs.tree.store.root, this.isChecked);
      },
      setCheckedNodes(nodes) {
        this.$refs.tree.setCheckedNodes(nodes);
      },
      getCheckedNodes(leafOnly, includeHalfChecked) {
        return this.$refs.tree.getCheckedNodes(leafOnly, includeHalfChecked);
      },
      getCurrentNode() {
        return this.$refs.tree.getCurrentNode();
      },
      setCurrentNode(node) {
        return this.$refs.tree.setCurrentNode(node);
      },
      loadDataFromDS(localDsv = {}, dsName = "") {
        let curDSName = dsName || this.widget.options.dsName;
        let curDSetName = this.widget.options.dataSetName;
        let curDS = getDSByName(this.formConfig, curDSName);
        if (!!curDS) {
          let gDsv = this.getGlobalDsv() || {};
          let newDsv = new Object({});
          overwriteObj(newDsv, gDsv);
          overwriteObj(newDsv, localDsv);
          newDsv.widgetName = this.widget.options.name;
          this.loadingFlag = true;
          runDataSourceRequest(curDS, newDsv, this.getFormRef(), false, this.$message).then((res) => {
            if (!!curDSetName && res.hasOwnProperty(curDSetName)) {
              this.setTreeData(res[curDSetName]);
            } else {
              this.setTreeData(res);
            }
            this.loadingFlag = false;
          }).catch((err) => {
            this.$message.error(err.message);
            this.loadingFlag = false;
          });
        }
      }
    }
  };
  const _hoisted_1$x = { class: "custom-tree-node" };
  const _hoisted_2$i = { key: 0 };
  function _sfc_render$3S(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_el_tree = require$$0$1.resolveComponent("el-tree");
    const _component_el_main = require$$0$1.resolveComponent("el-main");
    const _component_el_container = require$$0$1.resolveComponent("el-container");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    const _directive_loading = require$$0$1.resolveDirective("loading");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_container, null, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_main, { style: { "align-items": "baseline" } }, {
              default: require$$0$1.withCtx(() => [
                $props.widget.options.filter ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
                  key: 0,
                  size: $props.widget.options.size,
                  placeholder: _ctx.i18nt("designer.setting.enterForQuery"),
                  modelValue: $data.filterText,
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.filterText = $event)
                }, null, 8, ["size", "placeholder", "modelValue"])) : require$$0$1.createCommentVNode("", true),
                require$$0$1.createVNode(_component_el_button_group, null, {
                  default: require$$0$1.withCtx(() => [
                    $props.widget.options.expandRetractAllNode ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                      key: 0,
                      type: "primary",
                      round: "",
                      plain: "",
                      size: $props.widget.options.size,
                      onClick: _cache[1] || (_cache[1] = ($event) => $options.expandAllNodes())
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.expandRetractAllNode")), 1)
                      ]),
                      _: 1
                    }, 8, ["size"])) : require$$0$1.createCommentVNode("", true),
                    $props.widget.options.selectClearAllNode && $props.widget.options.showCheckBox ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                      key: 1,
                      type: "primary",
                      round: "",
                      plain: "",
                      size: $props.widget.options.size,
                      onClick: _cache[2] || (_cache[2] = ($event) => $options.checkAllNodes())
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.selectClearAllNode")), 1)
                      ]),
                      _: 1
                    }, 8, ["size"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }),
                require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tree, {
                  data: $props.widget.options.treeData,
                  props: $data.defaultProps,
                  ref: "tree",
                  border: "",
                  lazy: $props.widget.options.lazy,
                  "node-key": "id",
                  "highlight-current": "",
                  "current-node-key": $data.currentKey,
                  "show-checkbox": $props.widget.options.showCheckBox,
                  "expand-on-click-node": $props.widget.options.expandOnClickNode,
                  "default-expand-all": $props.widget.options.defaultExpandAllNode,
                  draggable: $props.widget.options.draggable,
                  "check-strictly": $props.widget.options.checkStrictly,
                  onNodeClick: $options.handleTreeNodeClick,
                  onNodeContextmenu: $options.handleTreeNodeContextmenu,
                  onCheck: $options.handleTreeNodeCheck,
                  onCheckChange: $options.handleCheckChange,
                  "filter-node-method": $options.filterNode
                }, {
                  default: require$$0$1.withCtx(({ node, data: data2 }) => [
                    require$$0$1.createElementVNode("span", _hoisted_1$x, [
                      require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(node.label), 1),
                      $props.widget.options.nodeEdit ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_2$i, [
                        require$$0$1.createVNode(_component_el_button, {
                          type: "primary",
                          link: "",
                          size: $props.widget.options.size,
                          onClick: ($event) => $options.append(data2)
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.add")), 1)
                          ]),
                          _: 2
                        }, 1032, ["size", "onClick"]),
                        require$$0$1.createVNode(_component_el_button, {
                          type: "primary",
                          link: "",
                          size: $props.widget.options.size,
                          onClick: ($event) => $options.remove(node, data2)
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.delete")), 1)
                          ]),
                          _: 2
                        }, 1032, ["size", "onClick"])
                      ])) : require$$0$1.createCommentVNode("", true)
                    ])
                  ]),
                  _: 1
                }, 8, ["data", "props", "lazy", "current-node-key", "show-checkbox", "expand-on-click-node", "default-expand-all", "draggable", "check-strictly", "onNodeClick", "onNodeContextmenu", "onCheck", "onCheckChange", "filter-node-method"])), [
                  [_directive_loading, $data.loadingFlag]
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        })
      ]),
      _: 1
    }, 8, ["widget"]);
  }
  var treeItem = /* @__PURE__ */ _export_sfc(_sfc_main$3S, [["render", _sfc_render$3S], ["__scopeId", "data-v-ab886da8"]]);
  var __glob_0_11$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeItem
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3R = {
    name: "vf-dialog-item"
  };
  function _sfc_render$3R(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.createCommentVNode("", true);
  }
  var vfDialogItem = /* @__PURE__ */ _export_sfc(_sfc_main$3R, [["render", _sfc_render$3R]]);
  var __glob_0_12$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDialogItem
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3Q = {
    name: "vf-drawer-item"
  };
  function _sfc_render$3Q(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.createCommentVNode("", true);
  }
  var vfDrawerItem = /* @__PURE__ */ _export_sfc(_sfc_main$3Q, [["render", _sfc_render$3Q]]);
  var __glob_0_13$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDrawerItem
  }, Symbol.toStringTag, { value: "Module" }));
  const modules$2 = { "./button-group-item.vue": __glob_0_0$3, "./container-item-wrapper.vue": __glob_0_1$3, "./data-table-item.vue": __glob_0_2$2, "./grid-col-item.vue": __glob_0_3$2, "./grid-item.vue": __glob_0_4$2, "./grid-sub-form-item.vue": __glob_0_5$2, "./object-group-item.vue": __glob_0_6$2, "./sub-form-item.vue": __glob_0_7$2, "./tab-item.vue": __glob_0_8$2, "./table-cell-item.vue": __glob_0_9$2, "./table-item.vue": __glob_0_10$2, "./tree-item.vue": __glob_0_11$2, "./vf-dialog-item.vue": __glob_0_12$2, "./vf-drawer-item.vue": __glob_0_13$2 };
  var ContainerItems = {
    install(app) {
      for (const path in modules$2) {
        let cname = modules$2[path].default.name;
        app.component(cname, modules$2[path].default);
      }
    }
  };
  const _sfc_main$3P = {
    name: "dynamic-dialog",
    mixins: [i18n$1],
    props: {
      options: {
        type: Object,
        default: () => ({})
      },
      formJson: {
        type: Object
      },
      formData: {
        type: Object,
        default: () => ({})
      },
      optionData: {
        type: Object,
        default: () => ({})
      },
      globalDsv: {
        type: Object,
        default: () => ({})
      },
      parentFormRef: {
        type: Object,
        default: null
      },
      extraData: {
        type: Object,
        default: () => ({})
      },
      wrapperId: {
        type: String,
        default: null
      },
      title: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        dialogVisible: false
      };
    },
    computed: {
      cancelBtnLabel() {
        return this.options.cancelButtonLabel || this.i18nt("designer.hint.cancel");
      },
      okBtnLabel() {
        return this.options.okButtonLabel || this.i18nt("designer.hint.confirm");
      },
      newTitle() {
        return this.title || this.options.title;
      }
    },
    created() {
    },
    mounted() {
    },
    beforeDestroy() {
      this.parentFormRef.setChildFormRef(null);
    },
    methods: {
      show() {
        this.dialogVisible = true;
        this.$nextTick(() => {
          this.$refs["dFormRef"].setFormData(this.formData);
          this.$nextTick(() => {
            if (!!this.options.readMode) {
              this.$refs["dFormRef"].setReadMode(true);
            }
          });
          this.$refs["dFormRef"].setDialogOrDrawerRef(this);
          this.parentFormRef.setChildFormRef(this.$refs["dFormRef"]);
        });
        return this;
      },
      close() {
        if (!!this.options.onDialogBeforeClose) {
          let customFn = new Function("done", this.options.onDialogBeforeClose);
          let closeResult = customFn.call(this);
          if (closeResult === false) {
            return;
          }
        }
        this.dialogVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      deleteWrapperNode() {
        let wrapperNode = document.getElementById("vf-dynamic-dialog-wrapper" + this.wrapperId);
        if (!!wrapperNode) {
          document.body.removeChild(wrapperNode);
        }
      },
      handleBeforeClose(done) {
        if (!!this.options.onDialogBeforeClose) {
          let customFn = new Function("done", this.options.onDialogBeforeClose);
          let closeResult = customFn.call(this);
          return closeResult === false ? closeResult : done();
        }
        return done();
      },
      handleCloseEvent() {
        this.dialogVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      handleOpenedEvent() {
        if (!!this.options.onDialogOpened) {
          let customFn = new Function(this.options.onDialogOpened);
          customFn.call(this);
        }
      },
      handleCancelClick() {
        if (!!this.options.onCancelButtonClick) {
          let customFn = new Function(this.options.onCancelButtonClick);
          let clickResult = customFn.call(this);
          if (clickResult === false) {
            return;
          }
        }
        this.dialogVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      handleOkClick() {
        if (!!this.options.onOkButtonClick) {
          let customFn = new Function(this.options.onOkButtonClick);
          let clickResult = customFn.call(this);
          if (clickResult === false) {
            return;
          }
        }
        this.dialogVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      getParentFormRef() {
        return this.parentFormRef;
      },
      getTopFormRef() {
        if (!this.parentFormRef.parentForm) {
          return this.parentFormRef;
        }
        let topFormRef = this.parentFormRef;
        while (topFormRef.parentForm) {
          topFormRef = topFormRef.parentForm;
        }
        return topFormRef;
      },
      getFormRef() {
        return this.$refs["dFormRef"];
      },
      getWidgetRef(widgetName, showError = false) {
        return this.$refs["dFormRef"].getWidgetRef(widgetName, showError);
      },
      getExtraData() {
        return this.extraData;
      }
    }
  };
  function _sfc_render$3P(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_VFormRender = require$$0$1.resolveComponent("VFormRender");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_dialog, {
      title: $options.newTitle,
      modelValue: $data.dialogVisible,
      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.dialogVisible = $event),
      "append-to-body": "",
      "destroy-on-close": "",
      draggable: "",
      width: $props.options.width,
      fullscreen: $props.options.fullscreen,
      modal: $props.options.showModal,
      "show-close": $props.options.showClose,
      "close-on-click-modal": $props.options.closeOnClickModal,
      "close-on-press-escape": $props.options.closeOnPressEscape,
      center: $props.options.center,
      "before-close": $options.handleBeforeClose,
      onClose: $options.handleCloseEvent,
      onOpened: $options.handleOpenedEvent
    }, {
      footer: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", null, [
          !$props.options.cancelButtonHidden ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
            key: 0,
            onClick: $options.handleCancelClick
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.cancelBtnLabel), 1)
            ]),
            _: 1
          }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
          !$props.options.okButtonHidden ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
            key: 1,
            type: "primary",
            onClick: $options.handleOkClick
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.okBtnLabel), 1)
            ]),
            _: 1
          }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true)
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_VFormRender, {
          ref: "dFormRef",
          "form-json": $props.formJson,
          "option-data": $props.optionData,
          "global-dsv": $props.globalDsv,
          "parent-form": $props.parentFormRef,
          "disabled-mode": $props.options.disabledMode,
          "dynamic-creation": true
        }, require$$0$1.createSlots({ _: 2 }, [
          require$$0$1.renderList(_ctx.$slots, (slot, name2) => {
            return {
              name: name2,
              fn: require$$0$1.withCtx(() => [
                require$$0$1.renderSlot(_ctx.$slots, name2)
              ])
            };
          })
        ]), 1032, ["form-json", "option-data", "global-dsv", "parent-form", "disabled-mode"])
      ]),
      _: 3
    }, 8, ["title", "modelValue", "width", "fullscreen", "modal", "show-close", "close-on-click-modal", "close-on-press-escape", "center", "before-close", "onClose", "onOpened"]);
  }
  var DynamicDialog = /* @__PURE__ */ _export_sfc(_sfc_main$3P, [["render", _sfc_render$3P]]);
  var dynamicDrawer_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3O = {
    name: "dynamic-drawer",
    mixins: [i18n$1],
    props: {
      options: {
        type: Object,
        default: () => ({})
      },
      formJson: {
        type: Object
      },
      formData: {
        type: Object,
        default: () => ({})
      },
      optionData: {
        type: Object,
        default: () => ({})
      },
      globalDsv: {
        type: Object,
        default: () => ({})
      },
      parentFormRef: {
        type: Object,
        default: null
      },
      extraData: {
        type: Object,
        default: () => ({})
      },
      wrapperId: {
        type: String,
        default: null
      },
      title: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        drawerVisible: false
      };
    },
    computed: {
      cancelBtnLabel() {
        return this.options.cancelButtonLabel || this.i18nt("designer.hint.cancel");
      },
      okBtnLabel() {
        return this.options.okButtonLabel || this.i18nt("designer.hint.confirm");
      },
      newTitle() {
        return this.title || this.options.title;
      }
    },
    created() {
    },
    mounted() {
    },
    beforeDestroy() {
      this.parentFormRef.setChildFormRef(null);
    },
    methods: {
      show() {
        this.drawerVisible = true;
        this.$nextTick(() => {
          this.$refs["dFormRef"].setFormData(this.formData);
          this.$nextTick(() => {
            if (!!this.options.readMode) {
              this.$refs["dFormRef"].setReadMode(true);
            }
          });
          this.$refs["dFormRef"].setDialogOrDrawerRef(this);
          this.parentFormRef.setChildFormRef(this.$refs["dFormRef"]);
        });
        return this;
      },
      close() {
        if (!!this.options.onDrawerBeforeClose) {
          let customFn = new Function(this.options.onDrawerBeforeClose);
          let closeResult = customFn.call(this);
          if (closeResult === false) {
            return;
          }
        }
        this.drawerVisible = false;
        this.$refs["drawerRef"].handleClose();
        setTimeout(this.deleteWrapperNode, 150);
      },
      deleteWrapperNode() {
        let wrapperNode = document.getElementById("vf-dynamic-drawer-wrapper" + this.wrapperId);
        if (!!wrapperNode) {
          document.body.removeChild(wrapperNode);
        }
      },
      handleBeforeClose(done) {
        if (!!this.options.onDrawerBeforeClose) {
          let customFn = new Function(this.options.onDrawerBeforeClose);
          let closeResult = customFn.call(this);
          return closeResult === false ? closeResult : done();
        }
        return done();
      },
      handleCloseEvent() {
        this.drawerVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      handleOpenedEvent() {
        if (!!this.options.onDrawerOpened) {
          let customFn = new Function(this.options.onDrawerOpened);
          customFn.call(this);
        }
      },
      handleCancelClick() {
        if (!!this.options.onCancelButtonClick) {
          let customFn = new Function(this.options.onCancelButtonClick);
          let clickResult = customFn.call(this);
          if (clickResult === false) {
            return;
          }
        }
        this.drawerVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      handleOkClick() {
        if (!!this.options.onOkButtonClick) {
          let customFn = new Function(this.options.onOkButtonClick);
          let clickResult = customFn.call(this);
          if (clickResult === false) {
            return;
          }
        }
        this.drawerVisible = false;
        setTimeout(this.deleteWrapperNode, 150);
      },
      getParentFormRef() {
        return this.parentFormRef;
      },
      getTopFormRef() {
        if (!this.parentFormRef.parentForm) {
          return this.parentFormRef;
        }
        let topFormRef = this.parentFormRef;
        while (topFormRef.parentForm) {
          topFormRef = topFormRef.parentForm;
        }
        return topFormRef;
      },
      getFormRef() {
        return this.$refs["dFormRef"];
      },
      getWidgetRef(widgetName, showError = false) {
        return this.$refs["dFormRef"].getWidgetRef(widgetName, showError);
      },
      getExtraData() {
        return this.extraData;
      }
    }
  };
  const _hoisted_1$w = { style: { "float": "right" } };
  function _sfc_render$3O(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_VFormRender = require$$0$1.resolveComponent("VFormRender");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_drawer = require$$0$1.resolveComponent("el-drawer");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_drawer, {
      ref: "drawerRef",
      title: $options.newTitle,
      modelValue: $data.drawerVisible,
      "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.drawerVisible = $event),
      class: "dynamic-drawer",
      "append-to-body": "",
      "destroy-on-close": "",
      size: $props.options.size,
      modal: $props.options.showModal,
      direction: $props.options.direction,
      "show-close": $props.options.showClose,
      "close-on-click-modal": $props.options.closeOnClickModal,
      "close-on-press-escape": $props.options.closeOnPressEscape,
      "before-close": $options.handleBeforeClose,
      onClose: $options.handleCloseEvent,
      onOpened: $options.handleOpenedEvent
    }, {
      footer: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", _hoisted_1$w, [
          !$props.options.cancelButtonHidden ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
            key: 0,
            onClick: $options.handleCancelClick
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.cancelBtnLabel), 1)
            ]),
            _: 1
          }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
          !$props.options.okButtonHidden ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
            key: 1,
            type: "primary",
            onClick: $options.handleOkClick
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString($options.okBtnLabel), 1)
            ]),
            _: 1
          }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true)
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_VFormRender, {
          ref: "dFormRef",
          "form-json": $props.formJson,
          "option-data": $props.optionData,
          "global-dsv": $props.globalDsv,
          "parent-form": $props.parentFormRef,
          "disabled-mode": $props.options.disabledMode,
          "dynamic-creation": true
        }, require$$0$1.createSlots({ _: 2 }, [
          require$$0$1.renderList(_ctx.$slots, (slot, name2) => {
            return {
              name: name2,
              fn: require$$0$1.withCtx(() => [
                require$$0$1.renderSlot(_ctx.$slots, name2, {}, void 0, true)
              ])
            };
          })
        ]), 1032, ["form-json", "option-data", "global-dsv", "parent-form", "disabled-mode"])
      ]),
      _: 3
    }, 8, ["title", "modelValue", "size", "modal", "direction", "show-close", "close-on-click-modal", "close-on-press-escape", "before-close", "onClose", "onOpened"]);
  }
  var DynamicDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$3O, [["render", _sfc_render$3O], ["__scopeId", "data-v-232db4b3"]]);
  var index_vue_vue_type_style_index_0_scoped_true_lang$6 = "";
  const _sfc_main$3N = {
    name: "VFormRender",
    componentName: "VFormRender",
    mixins: [emitter, i18n$1],
    components: __spreadValues({}, comps$1),
    props: {
      formJson: {
        type: Object,
        default: () => buildDefaultFormJson()
      },
      formData: {
        type: Object,
        default: () => ({})
      },
      optionData: {
        type: Object,
        default: () => ({})
      },
      previewState: {
        type: Boolean,
        default: false
      },
      disabledMode: {
        type: Boolean,
        default: false
      },
      renderConfig: {
        type: Object,
        default: () => {
          return {
            languageName: "zh-CN"
          };
        }
      },
      globalDsv: {
        type: Object,
        default: () => ({})
      },
      parentForm: {
        type: Object,
        default: null
      },
      dynamicCreation: {
        type: Boolean,
        default: false
      }
    },
    provide() {
      return {
        refList: this.widgetRefList,
        sfRefList: this.subFormRefList,
        getFormConfig: () => this.formJsonObj.formConfig,
        getGlobalDsv: () => this.globalDsv,
        globalOptionData: this.optionData,
        getOptionData: () => this.optionData,
        globalModel: {
          formModel: this.formDataModel
        },
        previewState: this.previewState,
        getReadMode: () => this.readModeFlag,
        getSubFormFieldFlag: () => false,
        getSubFormName: () => "",
        getObjectFieldFlag: () => false,
        getObjectName: () => "",
        getDSResultCache: () => this.dsResultCache
      };
    },
    data() {
      return {
        formJsonObj: this.formJson,
        formDataModel: {},
        widgetRefList: {},
        subFormRefList: {},
        formId: null,
        externalComponents: {},
        readModeFlag: false,
        dialogOrDrawerRef: null,
        childFormRef: null,
        dsResultCache: {}
      };
    },
    computed: {
      formConfig() {
        return this.formJsonObj.formConfig;
      },
      widgetList() {
        return this.formJsonObj.widgetList;
      },
      labelPosition() {
        if (!!this.formConfig && !!this.formConfig.labelPosition) {
          return this.formConfig.labelPosition;
        }
        return "left";
      },
      labelWidth() {
        if (!!this.formConfig && !!this.formConfig.labelWidth) {
          return this.formConfig.labelWidth + "px";
        }
        return "80px";
      },
      size() {
        if (!!this.formConfig && !!this.formConfig.size) {
          return this.formConfig.size;
        }
        return "default";
      },
      customClass() {
        return !!this.formConfig && !!this.formConfig.customClass ? this.formConfig.customClass : "";
      }
    },
    watch: {},
    created() {
      this.buildFormModel(!this.formJsonObj ? null : this.formJsonObj.widgetList);
      this.initFormObject();
    },
    mounted() {
      this.initLocale();
      this.initDataSetRequest();
      this.handleOnMounted();
    },
    beforeUnmount() {
      deleteCustomStyleAndScriptNode(this.previewState, this.formId);
    },
    methods: {
      initFormObject(insertHtmlCodeFlag = true) {
        this.formId = "vfRender" + generateId();
        if (!!insertHtmlCodeFlag && !this.dynamicCreation) {
          this.insertCustomStyleAndScriptNode();
        }
        this.addFieldChangeEventHandler();
        this.addFieldValidateEventHandler();
        this.registerFormToRefList();
        this.handleOnCreated();
        if (!!this.disabledMode) {
          this.$nextTick(() => {
            this.disableForm();
          });
        }
      },
      getContainerWidgetName(widget) {
        if (widget.type === "grid") {
          return "vf-grid-item";
        }
        return widget.type + "-item";
      },
      getWidgetName(widget) {
        return widget.type + "-widget";
      },
      initLocale() {
        let curLocale = localStorage.getItem("v_form_locale") || "zh-CN";
        this.changeLanguage(curLocale);
      },
      insertCustomStyleAndScriptNode() {
        if (!!this.formConfig && !!this.formConfig.cssCode) {
          insertCustomCssToHead(this.formConfig.cssCode, !!this.previewState ? "" : this.formId);
        }
        if (!!this.formConfig && !!this.formConfig.functions) {
          insertGlobalFunctionsToHtml(this.formConfig.functions, !!this.previewState ? "" : this.formId);
        }
      },
      buildFormModel(widgetList2) {
        if (!!widgetList2 && widgetList2.length > 0) {
          widgetList2.forEach((wItem) => {
            this.buildDataFromWidget(wItem);
          });
        }
      },
      getFieldKeyName(field) {
        let fieldKeyName = field.options.name;
        return field.options.keyNameEnabled ? field.options.keyName || fieldKeyName : fieldKeyName;
      },
      buildDataFromWidget(wItem) {
        if (wItem.category === "container") {
          if (wItem.type === "vf-dialog" || wItem.type === "vf-drawer")
            ;
          else if (wItem.type === "grid") {
            if (!!wItem.cols && wItem.cols.length > 0) {
              wItem.cols.forEach((childItem) => {
                this.buildDataFromWidget(childItem);
              });
            }
          } else if (wItem.type === "table") {
            if (!!wItem.rows && wItem.rows.length > 0) {
              wItem.rows.forEach((rowItem) => {
                if (!!rowItem.cols && rowItem.cols.length > 0) {
                  rowItem.cols.forEach((colItem) => {
                    this.buildDataFromWidget(colItem);
                  });
                }
              });
            }
          } else if (wItem.type === "tab") {
            if (!!wItem.tabs && wItem.tabs.length > 0) {
              wItem.tabs.forEach((tabItem2) => {
                if (!!tabItem2.widgetList && tabItem2.widgetList.length > 0) {
                  tabItem2.widgetList.forEach((childItem) => {
                    this.buildDataFromWidget(childItem);
                  });
                }
              });
            }
          } else if (wItem.type === "sub-form") {
            let subFormName = wItem.options.name;
            if (!this.formData.hasOwnProperty(subFormName)) {
              let subFormDataRow = {};
              if (wItem.options.showBlankRow) {
                wItem.widgetList.forEach((subFormItem2) => {
                  if (!!subFormItem2.formItemFlag) {
                    let sfiKeyName = this.getFieldKeyName(subFormItem2);
                    subFormDataRow[sfiKeyName] = subFormItem2.options.defaultValue;
                  }
                });
                this.formDataModel[subFormName] = [subFormDataRow];
              } else {
                this.formDataModel[subFormName] = [];
              }
            } else {
              let initialValue = this.formData[subFormName];
              this.formDataModel[subFormName] = deepClone(initialValue);
            }
          } else if (wItem.type === "grid-sub-form") {
            let gridSubFormName = wItem.options.name;
            if (!this.formData.hasOwnProperty(gridSubFormName)) {
              let gsfFWList = [];
              let fieldListFn = (fw) => {
                gsfFWList.push(fw);
              };
              traverseFieldWidgetsOfContainer(wItem, fieldListFn);
              let gridSubFormDataRow = {};
              if (wItem.options.showBlankRow) {
                gsfFWList.forEach((gridSubFormItem2) => {
                  let sfiKeyName = this.getFieldKeyName(gridSubFormItem2);
                  gridSubFormDataRow[sfiKeyName] = gridSubFormItem2.options.defaultValue;
                });
                this.formDataModel[gridSubFormName] = [gridSubFormDataRow];
              } else {
                this.formDataModel[gridSubFormName] = [];
              }
            } else {
              let initialValue = this.formData[gridSubFormName];
              this.formDataModel[gridSubFormName] = deepClone(initialValue);
            }
          } else if (wItem.type === "grid-col" || wItem.type === "table-cell") {
            if (!!wItem.widgetList && wItem.widgetList.length > 0) {
              wItem.widgetList.forEach((childItem) => {
                this.buildDataFromWidget(childItem);
              });
            }
          } else if (wItem.type === "object-group") {
            let objectFields = [];
            traverseFieldWidgetsOfContainer(wItem, (fld) => {
              if (!!fld.formItemFlag) {
                objectFields.push(fld.options.name);
              }
            });
            let objectName = wItem.options.objectName;
            objectFields.forEach((fieldName) => {
              let fieldSchema = getFieldWidgetByName(wItem.widgetList, fieldName, false);
              let objPath = objectName + "." + this.getFieldKeyName(fieldSchema);
              if (!hasPropertyOfObject(this.formData, objPath)) {
                setObjectValue(this.formDataModel, objPath, fieldSchema.options.defaultValue);
              } else {
                let initialValue = getObjectValue(this.formData, objPath);
                setObjectValue(this.formDataModel, objPath, initialValue);
              }
            });
          } else {
            if (!!wItem.widgetList && wItem.widgetList.length > 0) {
              wItem.widgetList.forEach((childItem) => {
                this.buildDataFromWidget(childItem);
              });
            }
          }
        } else if (!!wItem.formItemFlag) {
          let fKeyName = this.getFieldKeyName(wItem);
          if (!this.formData.hasOwnProperty(fKeyName)) {
            this.formDataModel[fKeyName] = wItem.options.defaultValue;
          } else {
            let initialValue = this.formData[fKeyName];
            this.formDataModel[fKeyName] = deepClone(initialValue);
          }
        }
      },
      addFieldChangeEventHandler() {
        this.off$("fieldChange");
        this.on$("fieldChange", ([fieldName, newValue, oldValue, subFormName, subFormRowIndex]) => {
          this.handleFieldDataChange(fieldName, newValue, oldValue, subFormName, subFormRowIndex);
          this.$emit("formChange", fieldName, newValue, oldValue, this.formDataModel, subFormName, subFormRowIndex);
        });
      },
      addFieldValidateEventHandler() {
        this.off$("fieldValidation");
        this.on$("fieldValidation", (fieldName) => {
          if (!!this.$refs.renderForm) {
            this.$refs.renderForm.validateField(fieldName);
          }
        });
      },
      registerFormToRefList() {
        this.widgetRefList["v_form_ref"] = this;
      },
      handleFieldDataChange(fieldName, newValue, oldValue, subFormName, subFormRowIndex) {
        if (!!this.formConfig && !!this.formConfig.onFormDataChange) {
          let customFunc = new Function("fieldName", "newValue", "oldValue", "formModel", "subFormName", "subFormRowIndex", "formThis", this.escape2Html(this.formConfig.onFormDataChange));
          customFunc.call(this, fieldName, newValue, oldValue, this.formDataModel, subFormName, subFormRowIndex, this);
        }
      },
      escape2Html(str) {
        var arrEntities = { "lt": "<", "gt": ">", "nbsp": " ", "amp": "&", "quot": '"' };
        return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t2) {
          return arrEntities[t2];
        });
      },
      handleOnCreated() {
        if (!!this.formConfig && !!this.formConfig.onFormCreated) {
          let customFunc = new Function(this.formConfig.onFormCreated);
          customFunc.call(this);
        }
      },
      handleOnMounted() {
        if (!!this.formConfig && !!this.formConfig.onFormMounted) {
          let customFunc = new Function(this.formConfig.onFormMounted);
          customFunc.call(this);
        }
      },
      findWidgetAndSetDisabled(widgetName, disabledFlag) {
        let foundW = this.getWidgetRef(widgetName);
        if (!!foundW && !!foundW.setDisabled) {
          foundW.setDisabled(disabledFlag);
        } else {
          this.findWidgetOfSubFormAndSetDisabled(widgetName, disabledFlag);
        }
      },
      findWidgetOfSubFormAndSetDisabled(widgetName, disabledFlag) {
        const widgetSchema = getFieldWidgetByName(this.formJsonObj.widgetList, widgetName, true);
        if (!!widgetSchema && !!widgetSchema.options && widgetSchema.options.hasOwnProperty("disabled")) {
          widgetSchema.options.disabled = disabledFlag;
        }
        this.findWidgetNameInSubForm(widgetName).forEach((wn) => {
          let sw = this.getWidgetRef(wn);
          if (!!sw && !!sw.setDisabled) {
            sw.setDisabled(disabledFlag);
          }
        });
      },
      findWidgetAndSetHidden(widgetName, hiddenFlag) {
        let foundW = this.getWidgetRef(widgetName);
        if (!!foundW && !!foundW.setHidden) {
          foundW.setHidden(hiddenFlag);
        } else {
          this.findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag);
        }
      },
      findWidgetOfSubFormAndSetHidden(widgetName, hiddenFlag) {
        const widgetSchema = getFieldWidgetByName(this.formJsonObj.widgetList, widgetName, true);
        if (!!widgetSchema && !!widgetSchema.options && widgetSchema.options.hasOwnProperty("hidden")) {
          widgetSchema.options.hidden = hiddenFlag;
        }
        this.findWidgetNameInSubForm(widgetName).forEach((wn) => {
          let sw = this.getWidgetRef(wn);
          if (!!sw && !!sw.setHidden) {
            sw.setHidden(hiddenFlag);
          }
        });
      },
      findWidgetNameInSubForm(widgetName) {
        let result = [];
        let subFormName = null;
        Object.keys(this.subFormRefList).forEach((sfName) => {
          const fwHandler = (fw) => {
            if (fw.options.name === widgetName) {
              subFormName = sfName;
            }
          };
          const sfRef = this.subFormRefList[sfName];
          traverseFieldWidgetsOfContainer(sfRef.widget, fwHandler);
        });
        if (!!subFormName) {
          let subFormRef = this.getWidgetRef(subFormName);
          if (!!subFormRef) {
            let rowIds = subFormRef.getRowIdData();
            if (!!rowIds && rowIds.length > 0) {
              rowIds.forEach((rid) => {
                result.push(widgetName + "@row" + rid);
              });
            }
          }
        }
        return result;
      },
      findFieldWidgetById(fieldId, staticWidgetsIncluded) {
        return getFieldWidgetById(this.formJsonObj.widgetList, fieldId, staticWidgetsIncluded);
      },
      initDataSetRequest() {
        let dsNameSet = new Set();
        this.getFieldWidgets().forEach((fw) => {
          if (!!fw.field.options.dsEnabled && !!fw.field.options.dsName && !!fw.field.options.dataSetName) {
            dsNameSet.add(fw.field.options.dsName);
          }
        });
        if (dsNameSet.size > 0) {
          dsNameSet.forEach(async (dsName) => {
            let curDS = getDSByName(this.formConfig, dsName);
            if (!!curDS) {
              let localDsv = new Object({});
              overwriteObj(localDsv, this.globalDsv || {});
              let dsResult = null;
              try {
                dsResult = await runDataSourceRequest(curDS, localDsv, this, false, this.$message);
                this.dsResultCache[dsName] = dsResult;
                this.broadcast("FieldWidget", "loadOptionItemsFromDataSet", dsName);
              } catch (err) {
                this.$message.error(err.message);
              }
            }
          });
        }
      },
      changeLanguage(langName) {
        changeLocale(langName);
      },
      getLanguageName() {
        return localStorage.getItem("v_form_locale") || "zh-CN";
      },
      getNativeForm() {
        return this.$refs["renderForm"];
      },
      getFormRef() {
        return this;
      },
      getWidgetRef(widgetName, showError = false) {
        let foundRef = this.widgetRefList[widgetName];
        if (!foundRef && !!showError) {
          this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
        }
        return foundRef;
      },
      clearFormDataModel() {
        for (let pkey in this.formDataModel) {
          delete this.formDataModel[pkey];
        }
      },
      getFormJson() {
        return this.formJsonObj;
      },
      setFormJson(newFormJson) {
        if (!!newFormJson) {
          if (typeof newFormJson === "string" || newFormJson.constructor === Object) {
            let newFormJsonObj = null;
            if (typeof newFormJson === "string") {
              newFormJsonObj = JSON.parse(newFormJson);
            } else {
              newFormJsonObj = newFormJson;
            }
            if (!newFormJsonObj.formConfig || !newFormJsonObj.widgetList) {
              this.$message.error("Invalid format of form json.");
              return;
            }
            this.clearFormDataModel();
            this.buildFormModel(newFormJsonObj.widgetList);
            this.formJsonObj["formConfig"] = newFormJsonObj.formConfig;
            this.formJsonObj["widgetList"] = newFormJsonObj.widgetList;
            this.insertCustomStyleAndScriptNode();
            this.$nextTick(() => {
              this.initFormObject(false);
              this.initDataSetRequest();
              this.handleOnMounted();
            });
          } else {
            this.$message.error("Set form json failed.");
          }
        }
      },
      reloadOptionData(widgetNames) {
        let eventParams = [];
        if (!!widgetNames && typeof widgetNames === "string") {
          eventParams = [widgetNames];
        } else if (!!widgetNames && Array.isArray(widgetNames)) {
          eventParams = [...widgetNames];
        }
        this.broadcast("FieldWidget", "reloadOptionItems", eventParams);
      },
      getFormData(needValidation = true) {
        if (!needValidation) {
          return this.formDataModel;
        }
        let callback = function nullFunc() {
        };
        let promise = new window.Promise(function(resolve, reject) {
          callback = function(formData, error2) {
            !error2 ? resolve(formData) : reject(error2);
          };
        });
        this.$refs["renderForm"].validate((valid, invalidFields) => {
          if (valid) {
            let customValid = this.doCustomValidation();
            if (customValid) {
              callback(this.formDataModel);
            } else {
              callback(this.formDataModel, this.i18nt("render.hint.validationFailed"));
            }
          } else {
            callback(this.formDataModel, this.i18nt("render.hint.validationFailed"));
          }
        });
        return promise;
      },
      setFormData(formData) {
        let formDataObj = formData;
        if (typeof formData === "string") {
          formDataObj = JSON.parse(formData);
        }
        Object.keys(this.formDataModel).forEach((propName) => {
          if (!!formDataObj && formDataObj.hasOwnProperty(propName)) {
            this.formDataModel[propName] = deepClone(formDataObj[propName]);
          }
        });
        this.broadcast("ContainerItem", "setFormData", this.formDataModel);
        this.broadcast("FieldWidget", "setFormData", this.formDataModel);
      },
      setSubFormDataByIndex(subName, rowIndex, fieldName, fieldValue) {
        this.formDataModel[subName][rowIndex][fieldName] = fieldValue;
        this.broadcast("ContainerItem", "setFormData", this.formDataModel);
        this.broadcast("FieldWidget", "setFormData", this.formDataModel);
      },
      getFieldValue(fieldName) {
        let fieldRef = this.getWidgetRef(fieldName);
        if (!!fieldRef && !!fieldRef.getValue) {
          return fieldRef.getValue();
        }
        if (!fieldRef) {
          let result = [];
          this.findWidgetNameInSubForm(fieldName).forEach((wn) => {
            let sw = this.getWidgetRef(wn);
            if (!!sw && !!sw.getValue) {
              result.push(sw.getValue());
            }
          });
          return result;
        }
      },
      setFieldValue(fieldName, fieldValue, disableChangeEvent = false) {
        let fieldRef = this.getWidgetRef(fieldName);
        if (!!fieldRef && !!fieldRef.setValue) {
          fieldRef.setValue(fieldValue, disableChangeEvent);
        }
        if (!fieldRef) {
          this.findWidgetNameInSubForm(fieldName).forEach((wn) => {
            let sw = this.getWidgetRef(wn);
            if (!!sw && !!sw.setValue) {
              sw.setValue(fieldValue, disableChangeEvent);
            }
          });
        }
      },
      getSubFormValues(subFormName, needValidation = true) {
        let foundSFRef = this.subFormRefList[subFormName];
        return foundSFRef.getSubFormValues(needValidation);
      },
      setSubFormValues(subFormName, subFormValues) {
        let foundSFRef = this.subFormRefList[subFormName];
        return foundSFRef.setSubFormValues(subFormValues);
      },
      disableForm() {
        let wNameList = Object.keys(this.widgetRefList);
        wNameList.forEach((wName) => {
          let foundW = this.getWidgetRef(wName);
          if (!!foundW) {
            if (!!foundW.widget && foundW.widget.type === "sub-form") {
              foundW.disableSubForm();
            } else if (!!foundW.widget && foundW.widget.type === "grid-sub-form") {
              foundW.disableGridSubForm();
            } else {
              !!foundW.setDisabled && foundW.setDisabled(true);
            }
          }
        });
      },
      enableForm() {
        let wNameList = Object.keys(this.widgetRefList);
        wNameList.forEach((wName) => {
          let foundW = this.getWidgetRef(wName);
          if (!!foundW) {
            if (!!foundW.widget && foundW.widget.type === "sub-form") {
              foundW.enableSubForm();
            } else if (!!foundW.widget && foundW.widget.type === "grid-sub-form") {
              foundW.enableGridSubForm();
            } else {
              !!foundW.setDisabled && foundW.setDisabled(false);
            }
          }
        });
      },
      resetForm(disableChangeEvent = false) {
        let subFormNames = Object.keys(this.subFormRefList);
        subFormNames.forEach((sfName) => {
          if (!!this.subFormRefList[sfName].resetSubForm) {
            this.subFormRefList[sfName].resetSubForm();
          }
        });
        let wNameList = Object.keys(this.widgetRefList);
        wNameList.forEach((wName) => {
          let foundW = this.getWidgetRef(wName);
          if (!!foundW && !foundW.subFormItemFlag && !!foundW.resetField) {
            foundW.resetField(disableChangeEvent);
          }
        });
        this.$nextTick(() => {
          this.clearValidate();
        });
      },
      clearValidate(props) {
        this.$refs.renderForm.clearValidate(props);
      },
      validateForm(callback) {
        this.$refs["renderForm"].validate((valid, obj) => {
          if (valid) {
            let customValid = this.doCustomValidation();
            if (callback) {
              callback(customValid, obj);
            }
          } else {
            if (callback) {
              callback(valid, obj);
            }
          }
        });
      },
      doCustomValidation() {
        if (!this.formConfig.onFormValidate) {
          return true;
        }
        let customFn = new Function("formModel", this.formConfig.onFormValidate);
        let result = customFn.call(this, this.formDataModel);
        return result === void 0 ? true : result;
      },
      validateFields() {
      },
      disableWidgets(widgetNames) {
        if (!!widgetNames) {
          if (typeof widgetNames === "string") {
            this.findWidgetAndSetDisabled(widgetNames, true);
          } else if (Array.isArray(widgetNames)) {
            widgetNames.forEach((wn) => {
              this.findWidgetAndSetDisabled(wn, true);
            });
          }
        }
      },
      enableWidgets(widgetNames) {
        if (!!widgetNames) {
          if (typeof widgetNames === "string") {
            this.findWidgetAndSetDisabled(widgetNames, false);
          } else if (Array.isArray(widgetNames)) {
            widgetNames.forEach((wn) => {
              this.findWidgetAndSetDisabled(wn, false);
            });
          }
        }
      },
      hideWidgets(widgetNames) {
        if (!!widgetNames) {
          if (typeof widgetNames === "string") {
            this.findWidgetAndSetHidden(widgetNames, true);
          } else if (Array.isArray(widgetNames)) {
            widgetNames.forEach((wn) => {
              this.findWidgetAndSetHidden(wn, true);
            });
          }
        }
      },
      showWidgets(widgetNames) {
        if (!!widgetNames) {
          if (typeof widgetNames === "string") {
            this.findWidgetAndSetHidden(widgetNames, false);
          } else if (Array.isArray(widgetNames)) {
            widgetNames.forEach((wn) => {
              this.findWidgetAndSetHidden(wn, false);
            });
          }
        }
      },
      setWidgetsRequired(widgetNames, required) {
        if (!!widgetNames) {
          if (typeof widgetNames === "string") {
            this.findWidgetAndSetRequired(widgetNames, required);
          } else if (Array.isArray(widgetNames)) {
            widgetNames.forEach((wn) => {
              this.findWidgetAndSetRequired(wn, required);
            });
          }
        }
      },
      findWidgetAndSetRequired(widgetName, required) {
        let foundW = this.getWidgetRef(widgetName);
        if (!!foundW && !!foundW.setRequired) {
          foundW.setRequired(required);
        } else {
          this.findWidgetOfSubFormAndSetRequired(widgetName, required);
        }
      },
      findWidgetOfSubFormAndSetRequired(widgetName, required) {
        const widgetSchema = getFieldWidgetByName(this.formJsonObj.widgetList, widgetName, true);
        if (!!widgetSchema && !!widgetSchema.options && widgetSchema.options.hasOwnProperty("required")) {
          widgetSchema.options.required = required;
        }
        this.findWidgetNameInSubForm(widgetName).forEach((wn) => {
          let sw = this.getWidgetRef(wn);
          if (!!sw && !!sw.setRequired) {
            sw.setRequired(required);
          }
        });
      },
      getFieldWidgets(staticWidgetsIncluded = false) {
        return getAllFieldWidgets(this.formJsonObj.widgetList, staticWidgetsIncluded);
      },
      getContainerWidgets() {
        return getAllContainerWidgets(this.formJsonObj.widgetList);
      },
      addEC(componentName, externalComponent) {
        this.externalComponents[componentName] = externalComponent;
      },
      hasEC(componentName) {
        return this.externalComponents.hasOwnProperty(componentName);
      },
      getEC(componentName) {
        return this.externalComponents[componentName];
      },
      setReadMode(readonlyFlag = true) {
        this.readModeFlag = readonlyFlag;
      },
      getReadMode() {
        return this.readModeFlag;
      },
      getGlobalDsv() {
        return this.globalDsv;
      },
      async executeDataSource(dsName, localDsv = {}) {
        let ds = getDSByName(this.formJsonObj.formConfig, dsName);
        let newDsv = new Object({});
        overwriteObj(newDsv, this.globalDsv);
        overwriteObj(newDsv, localDsv);
        return await runDataSourceRequest(ds, newDsv, this, false, this.$message);
      },
      getParentFormRef() {
        return this.parentForm;
      },
      getTopFormRef() {
        if (!this.parentForm) {
          return this;
        }
        let topFormRef = this.parentForm;
        while (topFormRef.parentForm) {
          topFormRef = topFormRef.parentForm;
        }
        return topFormRef;
      },
      setChildFormRef(childFormRef) {
        this.childFormRef = childFormRef;
      },
      getChildFormRef() {
        return this.childFormRef;
      },
      isDynamicCreation() {
        return this.dynamicCreation;
      },
      setDialogOrDrawerRef(ddRef) {
        this.dialogOrDrawerRef = ddRef;
      },
      getDialogOrDrawerRef() {
        return this.dialogOrDrawerRef;
      },
      showDialog(dialogName, formData = {}, extraData = {}, title = "") {
        let topFormRef = this.getTopFormRef();
        let dialogCon = getContainerWidgetByName(topFormRef.widgetList, dialogName);
        if (!dialogName || dialogCon.type !== "vf-dialog") {
          this.$message.error(this.i18nt("render.hint.refNotFound") + dialogName);
          return;
        }
        let dFormJson = {
          widgetList: deepClone(dialogCon.widgetList),
          formConfig: cloneFormConfigWithoutEventHandler(topFormRef.formConfig)
        };
        let wrapperDivId = generateId() + "";
        let dialogInstance = require$$0$1.createVNode(DynamicDialog, {
          options: dialogCon.options,
          formJson: dFormJson,
          formData: formData || {},
          optionData: topFormRef.optionData,
          globalDsv: topFormRef.globalDsv,
          parentFormRef: this,
          extraData,
          wrapperId: wrapperDivId,
          title
        }, this.$slots);
        dialogInstance.appContext = this.$root.$.appContext;
        let wrapperDiv = document.createElement("div");
        wrapperDiv.id = "vf-dynamic-dialog-wrapper" + wrapperDivId;
        document.body.appendChild(wrapperDiv);
        require$$0$1.render(dialogInstance, wrapperDiv);
        document.body.appendChild(dialogInstance.el);
        return dialogInstance.component.ctx.show();
      },
      showDrawer(drawerName, formData = {}, extraData = {}, title = "") {
        let topFormRef = this.getTopFormRef();
        let drawerCon = getContainerWidgetByName(topFormRef.widgetList, drawerName);
        if (!drawerCon || drawerCon.type !== "vf-drawer") {
          this.$message.error(this.i18nt("render.hint.refNotFound") + drawerName);
          return;
        }
        let dFormJson = {
          widgetList: deepClone(drawerCon.widgetList),
          formConfig: cloneFormConfigWithoutEventHandler(topFormRef.formConfig)
        };
        let wrapperDivId = generateId() + "";
        let drawerInstance = require$$0$1.createVNode(DynamicDrawer, {
          options: drawerCon.options,
          formJson: dFormJson,
          formData: formData || {},
          optionData: topFormRef.optionData,
          globalDsv: topFormRef.globalDsv,
          parentFormRef: this,
          extraData,
          wrapperId: wrapperDivId,
          title
        }, this.$slots);
        drawerInstance.appContext = this.$root.$.appContext;
        let wrapperDiv = document.createElement("div");
        wrapperDiv.id = "vf-dynamic-drawer-wrapper" + wrapperDivId;
        document.body.appendChild(wrapperDiv);
        require$$0$1.render(drawerInstance, wrapperDiv);
        document.body.appendChild(drawerInstance.el);
        return drawerInstance.component.ctx.show();
      },
      isPreviewState() {
        return this.previewState;
      },
      setFormJsonAndData(formJson, formData, disabledFlag = null) {
        this.setFormJson(formJson);
        this.$nextTick(() => {
          if (!!formData) {
            this.setFormData(formData);
            this.$nextTick(() => {
              if (!!disabledFlag) {
                this.disableForm();
              }
            });
          }
        });
      },
      setBlankFormJson() {
        let blankFormJson = {
          widgetList: [],
          formConfig: getDefaultFormConfig()
        };
        this.setFormJson(blankFormJson);
      }
    }
  };
  function _sfc_render$3N(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form, {
      "label-position": $options.labelPosition,
      size: $options.size,
      class: require$$0$1.normalizeClass([[$options.customClass, $data.readModeFlag ? "readonly-mode-form" : ""], "render-form"]),
      "label-width": $options.labelWidth,
      "validate-on-rule-change": false,
      model: $data.formDataModel,
      ref: "renderForm",
      onSubmit: _cache[0] || (_cache[0] = require$$0$1.withModifiers(() => {
      }, ["prevent"]))
    }, {
      default: require$$0$1.withCtx(() => [
        (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.widgetList, (widget, index2) => {
          return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
            widget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getContainerWidgetName(widget)), {
              widget,
              key: widget.id,
              "parent-list": $options.widgetList,
              "index-of-parent-list": index2,
              "parent-widget": null
            }, require$$0$1.createSlots({ _: 2 }, [
              require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                return {
                  name: slot,
                  fn: require$$0$1.withCtx((scope) => [
                    require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                  ])
                };
              })
            ]), 1032, ["widget", "parent-list", "index-of-parent-list"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getWidgetName(widget)), {
              field: widget,
              "form-model": $data.formDataModel,
              designer: null,
              key: widget.id,
              "parent-list": $options.widgetList,
              "index-of-parent-list": index2,
              "parent-widget": null
            }, require$$0$1.createSlots({ _: 2 }, [
              require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                return {
                  name: slot,
                  fn: require$$0$1.withCtx((scope) => [
                    require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                  ])
                };
              })
            ]), 1032, ["field", "form-model", "parent-list", "index-of-parent-list"]))
          ], 64);
        }), 256))
      ]),
      _: 3
    }, 8, ["label-position", "size", "class", "label-width", "model"]);
  }
  var VFormRender = /* @__PURE__ */ _export_sfc(_sfc_main$3N, [["render", _sfc_render$3N], ["__scopeId", "data-v-794464e9"]]);
  var ace$2 = { exports: {} };
  (function(module2, exports2) {
    (function() {
      var ACE_NAMESPACE = "ace";
      var global2 = function() {
        return this;
      }();
      if (!global2 && typeof window != "undefined")
        global2 = window;
      var define2 = function(module3, deps, payload) {
        if (typeof module3 !== "string") {
          if (define2.original)
            define2.original.apply(this, arguments);
          else {
            console.error("dropping module because define wasn't a string.");
            console.trace();
          }
          return;
        }
        if (arguments.length == 2)
          payload = deps;
        if (!define2.modules[module3]) {
          define2.payloads[module3] = payload;
          define2.modules[module3] = null;
        }
      };
      define2.modules = {};
      define2.payloads = {};
      var _require = function(parentId, module3, callback) {
        if (typeof module3 === "string") {
          var payload = lookup(parentId, module3);
          if (payload != void 0) {
            callback && callback();
            return payload;
          }
        } else if (Object.prototype.toString.call(module3) === "[object Array]") {
          var params = [];
          for (var i2 = 0, l = module3.length; i2 < l; ++i2) {
            var dep = lookup(parentId, module3[i2]);
            if (dep == void 0 && require2.original)
              return;
            params.push(dep);
          }
          return callback && callback.apply(null, params) || true;
        }
      };
      var require2 = function(module3, callback) {
        var packagedModule = _require("", module3, callback);
        if (packagedModule == void 0 && require2.original)
          return require2.original.apply(this, arguments);
        return packagedModule;
      };
      var normalizeModule = function(parentId, moduleName) {
        if (moduleName.indexOf("!") !== -1) {
          var chunks = moduleName.split("!");
          return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]);
        }
        if (moduleName.charAt(0) == ".") {
          var base2 = parentId.split("/").slice(0, -1).join("/");
          moduleName = base2 + "/" + moduleName;
          while (moduleName.indexOf(".") !== -1 && previous != moduleName) {
            var previous = moduleName;
            moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, "");
          }
        }
        return moduleName;
      };
      var lookup = function(parentId, moduleName) {
        moduleName = normalizeModule(parentId, moduleName);
        var module3 = define2.modules[moduleName];
        if (!module3) {
          module3 = define2.payloads[moduleName];
          if (typeof module3 === "function") {
            var exports3 = {};
            var mod = {
              id: moduleName,
              uri: "",
              exports: exports3,
              packaged: true
            };
            var req = function(module4, callback) {
              return _require(moduleName, module4, callback);
            };
            var returnValue = module3(req, exports3, mod);
            exports3 = returnValue || mod.exports;
            define2.modules[moduleName] = exports3;
            delete define2.payloads[moduleName];
          }
          module3 = define2.modules[moduleName] = exports3 || module3;
        }
        return module3;
      };
      function exportAce(ns) {
        var root = global2;
        if (ns) {
          if (!global2[ns])
            global2[ns] = {};
          root = global2[ns];
        }
        if (!root.define || !root.define.packaged) {
          define2.original = root.define;
          root.define = define2;
          root.define.packaged = true;
        }
        if (!root.require || !root.require.packaged) {
          require2.original = root.require;
          root.require = require2;
          root.require.packaged = true;
        }
      }
      exportAce(ACE_NAMESPACE);
    })();
    ace.define("ace/lib/es6-shim", ["require", "exports", "module"], function(require2, exports3, module3) {
      function defineProp(obj, name2, val) {
        Object.defineProperty(obj, name2, {
          value: val,
          enumerable: false,
          writable: true,
          configurable: true
        });
      }
      if (!String.prototype.startsWith) {
        defineProp(String.prototype, "startsWith", function(searchString, position) {
          position = position || 0;
          return this.lastIndexOf(searchString, position) === position;
        });
      }
      if (!String.prototype.endsWith) {
        defineProp(String.prototype, "endsWith", function(searchString, position) {
          var subjectString = this;
          if (position === void 0 || position > subjectString.length) {
            position = subjectString.length;
          }
          position -= searchString.length;
          var lastIndex = subjectString.indexOf(searchString, position);
          return lastIndex !== -1 && lastIndex === position;
        });
      }
      if (!String.prototype.repeat) {
        defineProp(String.prototype, "repeat", function(count) {
          var result = "";
          var string2 = this;
          while (count > 0) {
            if (count & 1)
              result += string2;
            if (count >>= 1)
              string2 += string2;
          }
          return result;
        });
      }
      if (!String.prototype.includes) {
        defineProp(String.prototype, "includes", function(str, position) {
          return this.indexOf(str, position) != -1;
        });
      }
      if (!Object.assign) {
        Object.assign = function(target) {
          if (target === void 0 || target === null) {
            throw new TypeError("Cannot convert undefined or null to object");
          }
          var output = Object(target);
          for (var index2 = 1; index2 < arguments.length; index2++) {
            var source = arguments[index2];
            if (source !== void 0 && source !== null) {
              Object.keys(source).forEach(function(key) {
                output[key] = source[key];
              });
            }
          }
          return output;
        };
      }
      if (!Object.values) {
        Object.values = function(o) {
          return Object.keys(o).map(function(k) {
            return o[k];
          });
        };
      }
      if (!Array.prototype.find) {
        defineProp(Array.prototype, "find", function(predicate) {
          var len = this.length;
          var thisArg = arguments[1];
          for (var k = 0; k < len; k++) {
            var kValue = this[k];
            if (predicate.call(thisArg, kValue, k, this)) {
              return kValue;
            }
          }
        });
      }
      if (!Array.prototype.findIndex) {
        defineProp(Array.prototype, "findIndex", function(predicate) {
          var len = this.length;
          var thisArg = arguments[1];
          for (var k = 0; k < len; k++) {
            var kValue = this[k];
            if (predicate.call(thisArg, kValue, k, this)) {
              return k;
            }
          }
        });
      }
      if (!Array.prototype.includes) {
        defineProp(Array.prototype, "includes", function(item, position) {
          return this.indexOf(item, position) != -1;
        });
      }
      if (!Array.prototype.fill) {
        defineProp(Array.prototype, "fill", function(value2) {
          var O = this;
          var len = O.length >>> 0;
          var start = arguments[1];
          var relativeStart = start >> 0;
          var k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
          var end = arguments[2];
          var relativeEnd = end === void 0 ? len : end >> 0;
          var final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);
          while (k < final) {
            O[k] = value2;
            k++;
          }
          return O;
        });
      }
      if (!Array.of) {
        defineProp(Array, "of", function() {
          return Array.prototype.slice.call(arguments);
        });
      }
    });
    ace.define("ace/lib/fixoldbrowsers", ["require", "exports", "module", "ace/lib/es6-shim"], function(require2, exports3, module3) {
      require2("./es6-shim");
    });
    ace.define("ace/lib/deep_copy", ["require", "exports", "module"], function(require2, exports3, module3) {
      exports3.deepCopy = function deepCopy(obj) {
        if (typeof obj !== "object" || !obj)
          return obj;
        var copy;
        if (Array.isArray(obj)) {
          copy = [];
          for (var key = 0; key < obj.length; key++) {
            copy[key] = deepCopy(obj[key]);
          }
          return copy;
        }
        if (Object.prototype.toString.call(obj) !== "[object Object]")
          return obj;
        copy = {};
        for (var key in obj)
          copy[key] = deepCopy(obj[key]);
        return copy;
      };
    });
    ace.define("ace/lib/lang", ["require", "exports", "module", "ace/lib/deep_copy"], function(require2, exports3, module3) {
      exports3.last = function(a) {
        return a[a.length - 1];
      };
      exports3.stringReverse = function(string2) {
        return string2.split("").reverse().join("");
      };
      exports3.stringRepeat = function(string2, count) {
        var result = "";
        while (count > 0) {
          if (count & 1)
            result += string2;
          if (count >>= 1)
            string2 += string2;
        }
        return result;
      };
      var trimBeginRegexp = /^\s\s*/;
      var trimEndRegexp = /\s\s*$/;
      exports3.stringTrimLeft = function(string2) {
        return string2.replace(trimBeginRegexp, "");
      };
      exports3.stringTrimRight = function(string2) {
        return string2.replace(trimEndRegexp, "");
      };
      exports3.copyObject = function(obj) {
        var copy = {};
        for (var key in obj) {
          copy[key] = obj[key];
        }
        return copy;
      };
      exports3.copyArray = function(array) {
        var copy = [];
        for (var i2 = 0, l = array.length; i2 < l; i2++) {
          if (array[i2] && typeof array[i2] == "object")
            copy[i2] = this.copyObject(array[i2]);
          else
            copy[i2] = array[i2];
        }
        return copy;
      };
      exports3.deepCopy = require2("./deep_copy").deepCopy;
      exports3.arrayToMap = function(arr) {
        var map = {};
        for (var i2 = 0; i2 < arr.length; i2++) {
          map[arr[i2]] = 1;
        }
        return map;
      };
      exports3.createMap = function(props) {
        var map = Object.create(null);
        for (var i2 in props) {
          map[i2] = props[i2];
        }
        return map;
      };
      exports3.arrayRemove = function(array, value2) {
        for (var i2 = 0; i2 <= array.length; i2++) {
          if (value2 === array[i2]) {
            array.splice(i2, 1);
          }
        }
      };
      exports3.escapeRegExp = function(str) {
        return str.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
      };
      exports3.escapeHTML = function(str) {
        return ("" + str).replace(/&/g, "&#38;").replace(/"/g, "&#34;").replace(/'/g, "&#39;").replace(/</g, "&#60;");
      };
      exports3.getMatchOffsets = function(string2, regExp) {
        var matches2 = [];
        string2.replace(regExp, function(str) {
          matches2.push({
            offset: arguments[arguments.length - 2],
            length: str.length
          });
        });
        return matches2;
      };
      exports3.deferredCall = function(fcn) {
        var timer = null;
        var callback = function() {
          timer = null;
          fcn();
        };
        var deferred = function(timeout) {
          deferred.cancel();
          timer = setTimeout(callback, timeout || 0);
          return deferred;
        };
        deferred.schedule = deferred;
        deferred.call = function() {
          this.cancel();
          fcn();
          return deferred;
        };
        deferred.cancel = function() {
          clearTimeout(timer);
          timer = null;
          return deferred;
        };
        deferred.isPending = function() {
          return timer;
        };
        return deferred;
      };
      exports3.delayedCall = function(fcn, defaultTimeout) {
        var timer = null;
        var callback = function() {
          timer = null;
          fcn();
        };
        var _self = function(timeout) {
          if (timer == null)
            timer = setTimeout(callback, timeout || defaultTimeout);
        };
        _self.delay = function(timeout) {
          timer && clearTimeout(timer);
          timer = setTimeout(callback, timeout || defaultTimeout);
        };
        _self.schedule = _self;
        _self.call = function() {
          this.cancel();
          fcn();
        };
        _self.cancel = function() {
          timer && clearTimeout(timer);
          timer = null;
        };
        _self.isPending = function() {
          return timer;
        };
        return _self;
      };
      exports3.supportsLookbehind = function() {
        try {
          new RegExp("(?<=.)");
        } catch (e) {
          return false;
        }
        return true;
      };
      exports3.supportsUnicodeFlag = function() {
        try {
          new RegExp("^.$", "u");
        } catch (error2) {
          return false;
        }
        return true;
      };
    });
    ace.define("ace/lib/useragent", ["require", "exports", "module"], function(require2, exports3, module3) {
      exports3.OS = {
        LINUX: "LINUX",
        MAC: "MAC",
        WINDOWS: "WINDOWS"
      };
      exports3.getOS = function() {
        if (exports3.isMac) {
          return exports3.OS.MAC;
        } else if (exports3.isLinux) {
          return exports3.OS.LINUX;
        } else {
          return exports3.OS.WINDOWS;
        }
      };
      var _navigator = typeof navigator == "object" ? navigator : {};
      var os = (/mac|win|linux/i.exec(_navigator.platform) || ["other"])[0].toLowerCase();
      var ua = _navigator.userAgent || "";
      var appName = _navigator.appName || "";
      exports3.isWin = os == "win";
      exports3.isMac = os == "mac";
      exports3.isLinux = os == "linux";
      exports3.isIE = appName == "Microsoft Internet Explorer" || appName.indexOf("MSAppHost") >= 0 ? parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]) : parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/) || [])[1]);
      exports3.isOldIE = exports3.isIE && exports3.isIE < 9;
      exports3.isGecko = exports3.isMozilla = ua.match(/ Gecko\/\d+/);
      exports3.isOpera = typeof opera == "object" && Object.prototype.toString.call(window.opera) == "[object Opera]";
      exports3.isWebKit = parseFloat(ua.split("WebKit/")[1]) || void 0;
      exports3.isChrome = parseFloat(ua.split(" Chrome/")[1]) || void 0;
      exports3.isEdge = parseFloat(ua.split(" Edge/")[1]) || void 0;
      exports3.isAIR = ua.indexOf("AdobeAIR") >= 0;
      exports3.isAndroid = ua.indexOf("Android") >= 0;
      exports3.isChromeOS = ua.indexOf(" CrOS ") >= 0;
      exports3.isIOS = /iPad|iPhone|iPod/.test(ua) && !window.MSStream;
      if (exports3.isIOS)
        exports3.isMac = true;
      exports3.isMobile = exports3.isIOS || exports3.isAndroid;
    });
    ace.define("ace/lib/dom", ["require", "exports", "module", "ace/lib/useragent"], function(require2, exports3, module3) {
      var useragent = require2("./useragent");
      var XHTML_NS = "http://www.w3.org/1999/xhtml";
      exports3.buildDom = function buildDom(arr, parent, refs) {
        if (typeof arr == "string" && arr) {
          var txt = document.createTextNode(arr);
          if (parent)
            parent.appendChild(txt);
          return txt;
        }
        if (!Array.isArray(arr)) {
          if (arr && arr.appendChild && parent)
            parent.appendChild(arr);
          return arr;
        }
        if (typeof arr[0] != "string" || !arr[0]) {
          var els = [];
          for (var i2 = 0; i2 < arr.length; i2++) {
            var ch = buildDom(arr[i2], parent, refs);
            ch && els.push(ch);
          }
          return els;
        }
        var el = document.createElement(arr[0]);
        var options = arr[1];
        var childIndex = 1;
        if (options && typeof options == "object" && !Array.isArray(options))
          childIndex = 2;
        for (var i2 = childIndex; i2 < arr.length; i2++)
          buildDom(arr[i2], el, refs);
        if (childIndex == 2) {
          Object.keys(options).forEach(function(n) {
            var val = options[n];
            if (n === "class") {
              el.className = Array.isArray(val) ? val.join(" ") : val;
            } else if (typeof val == "function" || n == "value" || n[0] == "$") {
              el[n] = val;
            } else if (n === "ref") {
              if (refs)
                refs[val] = el;
            } else if (n === "style") {
              if (typeof val == "string")
                el.style.cssText = val;
            } else if (val != null) {
              el.setAttribute(n, val);
            }
          });
        }
        if (parent)
          parent.appendChild(el);
        return el;
      };
      exports3.getDocumentHead = function(doc2) {
        if (!doc2)
          doc2 = document;
        return doc2.head || doc2.getElementsByTagName("head")[0] || doc2.documentElement;
      };
      exports3.createElement = function(tag, ns) {
        return document.createElementNS ? document.createElementNS(ns || XHTML_NS, tag) : document.createElement(tag);
      };
      exports3.removeChildren = function(element) {
        element.innerHTML = "";
      };
      exports3.createTextNode = function(textContent, element) {
        var doc2 = element ? element.ownerDocument : document;
        return doc2.createTextNode(textContent);
      };
      exports3.createFragment = function(element) {
        var doc2 = element ? element.ownerDocument : document;
        return doc2.createDocumentFragment();
      };
      exports3.hasCssClass = function(el, name2) {
        var classes = (el.className + "").split(/\s+/g);
        return classes.indexOf(name2) !== -1;
      };
      exports3.addCssClass = function(el, name2) {
        if (!exports3.hasCssClass(el, name2)) {
          el.className += " " + name2;
        }
      };
      exports3.removeCssClass = function(el, name2) {
        var classes = el.className.split(/\s+/g);
        while (true) {
          var index2 = classes.indexOf(name2);
          if (index2 == -1) {
            break;
          }
          classes.splice(index2, 1);
        }
        el.className = classes.join(" ");
      };
      exports3.toggleCssClass = function(el, name2) {
        var classes = el.className.split(/\s+/g), add2 = true;
        while (true) {
          var index2 = classes.indexOf(name2);
          if (index2 == -1) {
            break;
          }
          add2 = false;
          classes.splice(index2, 1);
        }
        if (add2)
          classes.push(name2);
        el.className = classes.join(" ");
        return add2;
      };
      exports3.setCssClass = function(node, className, include) {
        if (include) {
          exports3.addCssClass(node, className);
        } else {
          exports3.removeCssClass(node, className);
        }
      };
      exports3.hasCssString = function(id2, doc2) {
        var index2 = 0, sheets;
        doc2 = doc2 || document;
        if (sheets = doc2.querySelectorAll("style")) {
          while (index2 < sheets.length) {
            if (sheets[index2++].id === id2) {
              return true;
            }
          }
        }
      };
      exports3.removeElementById = function(id2, doc2) {
        doc2 = doc2 || document;
        if (doc2.getElementById(id2)) {
          doc2.getElementById(id2).remove();
        }
      };
      var strictCSP;
      var cssCache = [];
      exports3.useStrictCSP = function(value2) {
        strictCSP = value2;
        if (value2 == false)
          insertPendingStyles();
        else if (!cssCache)
          cssCache = [];
      };
      function insertPendingStyles() {
        var cache2 = cssCache;
        cssCache = null;
        cache2 && cache2.forEach(function(item) {
          importCssString(item[0], item[1]);
        });
      }
      function importCssString(cssText, id2, target) {
        if (typeof document == "undefined")
          return;
        if (cssCache) {
          if (target) {
            insertPendingStyles();
          } else if (target === false) {
            return cssCache.push([cssText, id2]);
          }
        }
        if (strictCSP)
          return;
        var container = target;
        if (!target || !target.getRootNode) {
          container = document;
        } else {
          container = target.getRootNode();
          if (!container || container == target)
            container = document;
        }
        var doc2 = container.ownerDocument || container;
        if (id2 && exports3.hasCssString(id2, container))
          return null;
        if (id2)
          cssText += "\n/*# sourceURL=ace/css/" + id2 + " */";
        var style = exports3.createElement("style");
        style.appendChild(doc2.createTextNode(cssText));
        if (id2)
          style.id = id2;
        if (container == doc2)
          container = exports3.getDocumentHead(doc2);
        container.insertBefore(style, container.firstChild);
      }
      exports3.importCssString = importCssString;
      exports3.importCssStylsheet = function(uri, doc2) {
        exports3.buildDom(["link", { rel: "stylesheet", href: uri }], exports3.getDocumentHead(doc2));
      };
      exports3.scrollbarWidth = function(doc2) {
        var inner = exports3.createElement("ace_inner");
        inner.style.width = "100%";
        inner.style.minWidth = "0px";
        inner.style.height = "200px";
        inner.style.display = "block";
        var outer = exports3.createElement("ace_outer");
        var style = outer.style;
        style.position = "absolute";
        style.left = "-10000px";
        style.overflow = "hidden";
        style.width = "200px";
        style.minWidth = "0px";
        style.height = "150px";
        style.display = "block";
        outer.appendChild(inner);
        var body = doc2 && doc2.documentElement || document && document.documentElement;
        if (!body)
          return 0;
        body.appendChild(outer);
        var noScrollbar = inner.offsetWidth;
        style.overflow = "scroll";
        var withScrollbar = inner.offsetWidth;
        if (noScrollbar === withScrollbar) {
          withScrollbar = outer.clientWidth;
        }
        body.removeChild(outer);
        return noScrollbar - withScrollbar;
      };
      exports3.computedStyle = function(element, style) {
        return window.getComputedStyle(element, "") || {};
      };
      exports3.setStyle = function(styles, property, value2) {
        if (styles[property] !== value2) {
          styles[property] = value2;
        }
      };
      exports3.HAS_CSS_ANIMATION = false;
      exports3.HAS_CSS_TRANSFORMS = false;
      exports3.HI_DPI = useragent.isWin ? typeof window !== "undefined" && window.devicePixelRatio >= 1.5 : true;
      if (useragent.isChromeOS)
        exports3.HI_DPI = false;
      if (typeof document !== "undefined") {
        var div = document.createElement("div");
        if (exports3.HI_DPI && div.style.transform !== void 0)
          exports3.HAS_CSS_TRANSFORMS = true;
        if (!useragent.isEdge && typeof div.style.animationName !== "undefined")
          exports3.HAS_CSS_ANIMATION = true;
        div = null;
      }
      if (exports3.HAS_CSS_TRANSFORMS) {
        exports3.translate = function(element, tx, ty) {
          element.style.transform = "translate(" + Math.round(tx) + "px, " + Math.round(ty) + "px)";
        };
      } else {
        exports3.translate = function(element, tx, ty) {
          element.style.top = Math.round(ty) + "px";
          element.style.left = Math.round(tx) + "px";
        };
      }
    });
    ace.define("ace/lib/net", ["require", "exports", "module", "ace/lib/dom"], function(require2, exports3, module3) {
      /*
      * based on code from:
      *
      * @license RequireJS text 0.25.0 Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
      * Available via the MIT or new BSD license.
      * see: http://github.com/jrburke/requirejs for details
      */
      var dom = require2("./dom");
      exports3.get = function(url, callback) {
        var xhr2 = new XMLHttpRequest();
        xhr2.open("GET", url, true);
        xhr2.onreadystatechange = function() {
          if (xhr2.readyState === 4) {
            callback(xhr2.responseText);
          }
        };
        xhr2.send(null);
      };
      exports3.loadScript = function(path, callback) {
        var head = dom.getDocumentHead();
        var s = document.createElement("script");
        s.src = path;
        head.appendChild(s);
        s.onload = s.onreadystatechange = function(_, isAbort) {
          if (isAbort || !s.readyState || s.readyState == "loaded" || s.readyState == "complete") {
            s = s.onload = s.onreadystatechange = null;
            if (!isAbort)
              callback();
          }
        };
      };
      exports3.qualifyURL = function(url) {
        var a = document.createElement("a");
        a.href = url;
        return a.href;
      };
    });
    ace.define("ace/lib/oop", ["require", "exports", "module"], function(require2, exports3, module3) {
      exports3.inherits = function(ctor, superCtor) {
        ctor.super_ = superCtor;
        ctor.prototype = Object.create(superCtor.prototype, {
          constructor: {
            value: ctor,
            enumerable: false,
            writable: true,
            configurable: true
          }
        });
      };
      exports3.mixin = function(obj, mixin) {
        for (var key in mixin) {
          obj[key] = mixin[key];
        }
        return obj;
      };
      exports3.implement = function(proto, mixin) {
        exports3.mixin(proto, mixin);
      };
    });
    ace.define("ace/lib/event_emitter", ["require", "exports", "module"], function(require2, exports3, module3) {
      var EventEmitter = {};
      var stopPropagation = function() {
        this.propagationStopped = true;
      };
      var preventDefault = function() {
        this.defaultPrevented = true;
      };
      EventEmitter._emit = EventEmitter._dispatchEvent = function(eventName, e) {
        this._eventRegistry || (this._eventRegistry = {});
        this._defaultHandlers || (this._defaultHandlers = {});
        var listeners = this._eventRegistry[eventName] || [];
        var defaultHandler = this._defaultHandlers[eventName];
        if (!listeners.length && !defaultHandler)
          return;
        if (typeof e != "object" || !e)
          e = {};
        if (!e.type)
          e.type = eventName;
        if (!e.stopPropagation)
          e.stopPropagation = stopPropagation;
        if (!e.preventDefault)
          e.preventDefault = preventDefault;
        listeners = listeners.slice();
        for (var i2 = 0; i2 < listeners.length; i2++) {
          listeners[i2](e, this);
          if (e.propagationStopped)
            break;
        }
        if (defaultHandler && !e.defaultPrevented)
          return defaultHandler(e, this);
      };
      EventEmitter._signal = function(eventName, e) {
        var listeners = (this._eventRegistry || {})[eventName];
        if (!listeners)
          return;
        listeners = listeners.slice();
        for (var i2 = 0; i2 < listeners.length; i2++)
          listeners[i2](e, this);
      };
      EventEmitter.once = function(eventName, callback) {
        var _self = this;
        this.on(eventName, function newCallback() {
          _self.off(eventName, newCallback);
          callback.apply(null, arguments);
        });
        if (!callback) {
          return new Promise(function(resolve) {
            callback = resolve;
          });
        }
      };
      EventEmitter.setDefaultHandler = function(eventName, callback) {
        var handlers2 = this._defaultHandlers;
        if (!handlers2)
          handlers2 = this._defaultHandlers = { _disabled_: {} };
        if (handlers2[eventName]) {
          var old = handlers2[eventName];
          var disabled = handlers2._disabled_[eventName];
          if (!disabled)
            handlers2._disabled_[eventName] = disabled = [];
          disabled.push(old);
          var i2 = disabled.indexOf(callback);
          if (i2 != -1)
            disabled.splice(i2, 1);
        }
        handlers2[eventName] = callback;
      };
      EventEmitter.removeDefaultHandler = function(eventName, callback) {
        var handlers2 = this._defaultHandlers;
        if (!handlers2)
          return;
        var disabled = handlers2._disabled_[eventName];
        if (handlers2[eventName] == callback) {
          if (disabled)
            this.setDefaultHandler(eventName, disabled.pop());
        } else if (disabled) {
          var i2 = disabled.indexOf(callback);
          if (i2 != -1)
            disabled.splice(i2, 1);
        }
      };
      EventEmitter.on = EventEmitter.addEventListener = function(eventName, callback, capturing) {
        this._eventRegistry = this._eventRegistry || {};
        var listeners = this._eventRegistry[eventName];
        if (!listeners)
          listeners = this._eventRegistry[eventName] = [];
        if (listeners.indexOf(callback) == -1)
          listeners[capturing ? "unshift" : "push"](callback);
        return callback;
      };
      EventEmitter.off = EventEmitter.removeListener = EventEmitter.removeEventListener = function(eventName, callback) {
        this._eventRegistry = this._eventRegistry || {};
        var listeners = this._eventRegistry[eventName];
        if (!listeners)
          return;
        var index2 = listeners.indexOf(callback);
        if (index2 !== -1)
          listeners.splice(index2, 1);
      };
      EventEmitter.removeAllListeners = function(eventName) {
        if (!eventName)
          this._eventRegistry = this._defaultHandlers = void 0;
        if (this._eventRegistry)
          this._eventRegistry[eventName] = void 0;
        if (this._defaultHandlers)
          this._defaultHandlers[eventName] = void 0;
      };
      exports3.EventEmitter = EventEmitter;
    });
    ace.define("ace/lib/report_error", ["require", "exports", "module"], function(require2, exports3, module3) {
      exports3.reportError = function reportError(msg, data2) {
        var e = new Error(msg);
        e.data = data2;
        if (typeof console == "object" && console.error)
          console.error(e);
        setTimeout(function() {
          throw e;
        });
      };
    });
    ace.define("ace/lib/app_config", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter", "ace/lib/report_error"], function(require2, exports3, module3) {
      "no use strict";
      var oop = require2("./oop");
      var EventEmitter = require2("./event_emitter").EventEmitter;
      var reportError = require2("./report_error").reportError;
      var optionsProvider = {
        setOptions: function(optList) {
          Object.keys(optList).forEach(function(key) {
            this.setOption(key, optList[key]);
          }, this);
        },
        getOptions: function(optionNames) {
          var result = {};
          if (!optionNames) {
            var options = this.$options;
            optionNames = Object.keys(options).filter(function(key) {
              return !options[key].hidden;
            });
          } else if (!Array.isArray(optionNames)) {
            result = optionNames;
            optionNames = Object.keys(result);
          }
          optionNames.forEach(function(key) {
            result[key] = this.getOption(key);
          }, this);
          return result;
        },
        setOption: function(name2, value2) {
          if (this["$" + name2] === value2)
            return;
          var opt = this.$options[name2];
          if (!opt) {
            return warn('misspelled option "' + name2 + '"');
          }
          if (opt.forwardTo)
            return this[opt.forwardTo] && this[opt.forwardTo].setOption(name2, value2);
          if (!opt.handlesSet)
            this["$" + name2] = value2;
          if (opt && opt.set)
            opt.set.call(this, value2);
        },
        getOption: function(name2) {
          var opt = this.$options[name2];
          if (!opt) {
            return warn('misspelled option "' + name2 + '"');
          }
          if (opt.forwardTo)
            return this[opt.forwardTo] && this[opt.forwardTo].getOption(name2);
          return opt && opt.get ? opt.get.call(this) : this["$" + name2];
        }
      };
      function warn(message) {
        if (typeof console != "undefined" && console.warn)
          console.warn.apply(console, arguments);
      }
      var messages;
      var AppConfig = function() {
        function AppConfig2() {
          this.$defaultOptions = {};
        }
        AppConfig2.prototype.defineOptions = function(obj, path, options) {
          if (!obj.$options)
            this.$defaultOptions[path] = obj.$options = {};
          Object.keys(options).forEach(function(key) {
            var opt = options[key];
            if (typeof opt == "string")
              opt = { forwardTo: opt };
            opt.name || (opt.name = key);
            obj.$options[opt.name] = opt;
            if ("initialValue" in opt)
              obj["$" + opt.name] = opt.initialValue;
          });
          oop.implement(obj, optionsProvider);
          return this;
        };
        AppConfig2.prototype.resetOptions = function(obj) {
          Object.keys(obj.$options).forEach(function(key) {
            var opt = obj.$options[key];
            if ("value" in opt)
              obj.setOption(key, opt.value);
          });
        };
        AppConfig2.prototype.setDefaultValue = function(path, name2, value2) {
          if (!path) {
            for (path in this.$defaultOptions)
              if (this.$defaultOptions[path][name2])
                break;
            if (!this.$defaultOptions[path][name2])
              return false;
          }
          var opts = this.$defaultOptions[path] || (this.$defaultOptions[path] = {});
          if (opts[name2]) {
            if (opts.forwardTo)
              this.setDefaultValue(opts.forwardTo, name2, value2);
            else
              opts[name2].value = value2;
          }
        };
        AppConfig2.prototype.setDefaultValues = function(path, optionHash) {
          Object.keys(optionHash).forEach(function(key) {
            this.setDefaultValue(path, key, optionHash[key]);
          }, this);
        };
        AppConfig2.prototype.setMessages = function(value2) {
          messages = value2;
        };
        AppConfig2.prototype.nls = function(string2, params) {
          if (messages && !messages[string2]) {
            warn("No message found for '" + string2 + "' in the provided messages, falling back to default English message.");
          }
          var translated = messages && messages[string2] || string2;
          if (params) {
            translated = translated.replace(/\$(\$|[\d]+)/g, function(_, name2) {
              if (name2 == "$")
                return "$";
              return params[name2];
            });
          }
          return translated;
        };
        return AppConfig2;
      }();
      AppConfig.prototype.warn = warn;
      AppConfig.prototype.reportError = reportError;
      oop.implement(AppConfig.prototype, EventEmitter);
      exports3.AppConfig = AppConfig;
    });
    ace.define("ace/theme/textmate-css", ["require", "exports", "module"], function(require2, exports3, module3) {
      module3.exports = '.ace-tm .ace_gutter {\n  background: #f0f0f0;\n  color: #333;\n}\n\n.ace-tm .ace_print-margin {\n  width: 1px;\n  background: #e8e8e8;\n}\n\n.ace-tm .ace_fold {\n    background-color: #6B72E6;\n}\n\n.ace-tm {\n  background-color: #FFFFFF;\n  color: black;\n}\n\n.ace-tm .ace_cursor {\n  color: black;\n}\n        \n.ace-tm .ace_invisible {\n  color: rgb(191, 191, 191);\n}\n\n.ace-tm .ace_storage,\n.ace-tm .ace_keyword {\n  color: blue;\n}\n\n.ace-tm .ace_constant {\n  color: rgb(197, 6, 11);\n}\n\n.ace-tm .ace_constant.ace_buildin {\n  color: rgb(88, 72, 246);\n}\n\n.ace-tm .ace_constant.ace_language {\n  color: rgb(88, 92, 246);\n}\n\n.ace-tm .ace_constant.ace_library {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_invalid {\n  background-color: rgba(255, 0, 0, 0.1);\n  color: red;\n}\n\n.ace-tm .ace_support.ace_function {\n  color: rgb(60, 76, 114);\n}\n\n.ace-tm .ace_support.ace_constant {\n  color: rgb(6, 150, 14);\n}\n\n.ace-tm .ace_support.ace_type,\n.ace-tm .ace_support.ace_class {\n  color: rgb(109, 121, 222);\n}\n\n.ace-tm .ace_keyword.ace_operator {\n  color: rgb(104, 118, 135);\n}\n\n.ace-tm .ace_string {\n  color: rgb(3, 106, 7);\n}\n\n.ace-tm .ace_comment {\n  color: rgb(76, 136, 107);\n}\n\n.ace-tm .ace_comment.ace_doc {\n  color: rgb(0, 102, 255);\n}\n\n.ace-tm .ace_comment.ace_doc.ace_tag {\n  color: rgb(128, 159, 191);\n}\n\n.ace-tm .ace_constant.ace_numeric {\n  color: rgb(0, 0, 205);\n}\n\n.ace-tm .ace_variable {\n  color: rgb(49, 132, 149);\n}\n\n.ace-tm .ace_xml-pe {\n  color: rgb(104, 104, 91);\n}\n\n.ace-tm .ace_entity.ace_name.ace_function {\n  color: #0000A2;\n}\n\n\n.ace-tm .ace_heading {\n  color: rgb(12, 7, 255);\n}\n\n.ace-tm .ace_list {\n  color:rgb(185, 6, 144);\n}\n\n.ace-tm .ace_meta.ace_tag {\n  color:rgb(0, 22, 142);\n}\n\n.ace-tm .ace_string.ace_regex {\n  color: rgb(255, 0, 0)\n}\n\n.ace-tm .ace_marker-layer .ace_selection {\n  background: rgb(181, 213, 255);\n}\n.ace-tm.ace_multiselect .ace_selection.ace_start {\n  box-shadow: 0 0 3px 0px white;\n}\n.ace-tm .ace_marker-layer .ace_step {\n  background: rgb(252, 255, 0);\n}\n\n.ace-tm .ace_marker-layer .ace_stack {\n  background: rgb(164, 229, 101);\n}\n\n.ace-tm .ace_marker-layer .ace_bracket {\n  margin: -1px 0 0 -1px;\n  border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-tm .ace_marker-layer .ace_active-line {\n  background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-tm .ace_gutter-active-line {\n    background-color : #dcdcdc;\n}\n\n.ace-tm .ace_marker-layer .ace_selected-word {\n  background: rgb(250, 250, 255);\n  border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-tm .ace_indent-guide {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-tm .ace_indent-guide-active {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n}\n';
    });
    ace.define("ace/theme/textmate", ["require", "exports", "module", "ace/theme/textmate-css", "ace/lib/dom"], function(require2, exports3, module3) {
      exports3.isDark = false;
      exports3.cssClass = "ace-tm";
      exports3.cssText = require2("./textmate-css");
      exports3.$id = "ace/theme/textmate";
      var dom = require2("../lib/dom");
      dom.importCssString(exports3.cssText, exports3.cssClass, false);
    });
    ace.define("ace/config", ["require", "exports", "module", "ace/lib/lang", "ace/lib/net", "ace/lib/dom", "ace/lib/app_config", "ace/theme/textmate"], function(require2, exports3, module3) {
      "no use strict";
      var lang = require2("./lib/lang");
      var net = require2("./lib/net");
      var dom = require2("./lib/dom");
      var AppConfig = require2("./lib/app_config").AppConfig;
      module3.exports = exports3 = new AppConfig();
      var options = {
        packaged: false,
        workerPath: null,
        modePath: null,
        themePath: null,
        basePath: "",
        suffix: ".js",
        $moduleUrls: {},
        loadWorkerFromBlob: true,
        sharedPopups: false,
        useStrictCSP: null
      };
      exports3.get = function(key) {
        if (!options.hasOwnProperty(key))
          throw new Error("Unknown config key: " + key);
        return options[key];
      };
      exports3.set = function(key, value2) {
        if (options.hasOwnProperty(key))
          options[key] = value2;
        else if (this.setDefaultValue("", key, value2) == false)
          throw new Error("Unknown config key: " + key);
        if (key == "useStrictCSP")
          dom.useStrictCSP(value2);
      };
      exports3.all = function() {
        return lang.copyObject(options);
      };
      exports3.$modes = {};
      exports3.moduleUrl = function(name2, component) {
        if (options.$moduleUrls[name2])
          return options.$moduleUrls[name2];
        var parts = name2.split("/");
        component = component || parts[parts.length - 2] || "";
        var sep = component == "snippets" ? "/" : "-";
        var base2 = parts[parts.length - 1];
        if (component == "worker" && sep == "-") {
          var re = new RegExp("^" + component + "[\\-_]|[\\-_]" + component + "$", "g");
          base2 = base2.replace(re, "");
        }
        if ((!base2 || base2 == component) && parts.length > 1)
          base2 = parts[parts.length - 2];
        var path = options[component + "Path"];
        if (path == null) {
          path = options.basePath;
        } else if (sep == "/") {
          component = sep = "";
        }
        if (path && path.slice(-1) != "/")
          path += "/";
        return path + component + sep + base2 + this.get("suffix");
      };
      exports3.setModuleUrl = function(name2, subst) {
        return options.$moduleUrls[name2] = subst;
      };
      var loader = function(moduleName, cb) {
        if (moduleName === "ace/theme/textmate" || moduleName === "./theme/textmate")
          return cb(null, require2("./theme/textmate"));
        if (customLoader)
          return customLoader(moduleName, cb);
        console.error("loader is not configured");
      };
      var customLoader;
      exports3.setLoader = function(cb) {
        customLoader = cb;
      };
      exports3.dynamicModules = Object.create(null);
      exports3.$loading = {};
      exports3.$loaded = {};
      exports3.loadModule = function(moduleName, onLoad) {
        var loadedModule, moduleType;
        if (Array.isArray(moduleName)) {
          moduleType = moduleName[0];
          moduleName = moduleName[1];
        }
        var load = function(module4) {
          if (module4 && !exports3.$loading[moduleName])
            return onLoad && onLoad(module4);
          if (!exports3.$loading[moduleName])
            exports3.$loading[moduleName] = [];
          exports3.$loading[moduleName].push(onLoad);
          if (exports3.$loading[moduleName].length > 1)
            return;
          var afterLoad = function() {
            loader(moduleName, function(err, module5) {
              if (module5)
                exports3.$loaded[moduleName] = module5;
              exports3._emit("load.module", { name: moduleName, module: module5 });
              var listeners = exports3.$loading[moduleName];
              exports3.$loading[moduleName] = null;
              listeners.forEach(function(onLoad2) {
                onLoad2 && onLoad2(module5);
              });
            });
          };
          if (!exports3.get("packaged"))
            return afterLoad();
          net.loadScript(exports3.moduleUrl(moduleName, moduleType), afterLoad);
          reportErrorIfPathIsNotConfigured();
        };
        if (exports3.dynamicModules[moduleName]) {
          exports3.dynamicModules[moduleName]().then(function(module4) {
            if (module4.default) {
              load(module4.default);
            } else {
              load(module4);
            }
          });
        } else {
          try {
            loadedModule = this.$require(moduleName);
          } catch (e) {
          }
          load(loadedModule || exports3.$loaded[moduleName]);
        }
      };
      exports3.$require = function(moduleName) {
        if (typeof module3.require == "function") {
          var req = "require";
          return module3[req](moduleName);
        }
      };
      exports3.setModuleLoader = function(moduleName, onLoad) {
        exports3.dynamicModules[moduleName] = onLoad;
      };
      var reportErrorIfPathIsNotConfigured = function() {
        if (!options.basePath && !options.workerPath && !options.modePath && !options.themePath && !Object.keys(options.$moduleUrls).length) {
          console.error("Unable to infer path to ace from script src,", "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes", "or with webpack use ace/webpack-resolver");
          reportErrorIfPathIsNotConfigured = function() {
          };
        }
      };
      exports3.version = "1.31.2";
    });
    ace.define("ace/loader_build", ["require", "exports", "module", "ace/lib/fixoldbrowsers", "ace/config"], function(require2, exports3, module3) {
      require2("./lib/fixoldbrowsers");
      var config2 = require2("./config");
      config2.setLoader(function(moduleName, cb) {
        require2([moduleName], function(module4) {
          cb(null, module4);
        });
      });
      var global2 = function() {
        return this || typeof window != "undefined" && window;
      }();
      module3.exports = function(ace2) {
        config2.init = init;
        config2.$require = require2;
        ace2.require = require2;
      };
      init(true);
      function init(packaged) {
        if (!global2 || !global2.document)
          return;
        config2.set("packaged", packaged || require2.packaged || module3.packaged || global2.define && (void 0).packaged);
        var scriptOptions = {};
        var scriptUrl = "";
        var currentScript = document.currentScript || document._currentScript;
        var currentDocument = currentScript && currentScript.ownerDocument || document;
        if (currentScript && currentScript.src) {
          scriptUrl = currentScript.src.split(/[?#]/)[0].split("/").slice(0, -1).join("/") || "";
        }
        var scripts = currentDocument.getElementsByTagName("script");
        for (var i2 = 0; i2 < scripts.length; i2++) {
          var script = scripts[i2];
          var src = script.src || script.getAttribute("src");
          if (!src)
            continue;
          var attributes = script.attributes;
          for (var j = 0, l = attributes.length; j < l; j++) {
            var attr = attributes[j];
            if (attr.name.indexOf("data-ace-") === 0) {
              scriptOptions[deHyphenate(attr.name.replace(/^data-ace-/, ""))] = attr.value;
            }
          }
          var m = src.match(/^(.*)\/ace([\-.]\w+)?\.js(\?|$)/);
          if (m)
            scriptUrl = m[1];
        }
        if (scriptUrl) {
          scriptOptions.base = scriptOptions.base || scriptUrl;
          scriptOptions.packaged = true;
        }
        scriptOptions.basePath = scriptOptions.base;
        scriptOptions.workerPath = scriptOptions.workerPath || scriptOptions.base;
        scriptOptions.modePath = scriptOptions.modePath || scriptOptions.base;
        scriptOptions.themePath = scriptOptions.themePath || scriptOptions.base;
        delete scriptOptions.base;
        for (var key in scriptOptions)
          if (typeof scriptOptions[key] !== "undefined")
            config2.set(key, scriptOptions[key]);
      }
      function deHyphenate(str) {
        return str.replace(/-(.)/g, function(m, m1) {
          return m1.toUpperCase();
        });
      }
    });
    ace.define("ace/range", ["require", "exports", "module"], function(require2, exports3, module3) {
      var comparePoints = function(p1, p2) {
        return p1.row - p2.row || p1.column - p2.column;
      };
      var Range2 = function() {
        function Range3(startRow, startColumn, endRow, endColumn) {
          this.start = {
            row: startRow,
            column: startColumn
          };
          this.end = {
            row: endRow,
            column: endColumn
          };
        }
        Range3.prototype.isEqual = function(range) {
          return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column;
        };
        Range3.prototype.toString = function() {
          return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]";
        };
        Range3.prototype.contains = function(row, column) {
          return this.compare(row, column) == 0;
        };
        Range3.prototype.compareRange = function(range) {
          var cmp, end = range.end, start = range.start;
          cmp = this.compare(end.row, end.column);
          if (cmp == 1) {
            cmp = this.compare(start.row, start.column);
            if (cmp == 1) {
              return 2;
            } else if (cmp == 0) {
              return 1;
            } else {
              return 0;
            }
          } else if (cmp == -1) {
            return -2;
          } else {
            cmp = this.compare(start.row, start.column);
            if (cmp == -1) {
              return -1;
            } else if (cmp == 1) {
              return 42;
            } else {
              return 0;
            }
          }
        };
        Range3.prototype.comparePoint = function(p) {
          return this.compare(p.row, p.column);
        };
        Range3.prototype.containsRange = function(range) {
          return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
        };
        Range3.prototype.intersects = function(range) {
          var cmp = this.compareRange(range);
          return cmp == -1 || cmp == 0 || cmp == 1;
        };
        Range3.prototype.isEnd = function(row, column) {
          return this.end.row == row && this.end.column == column;
        };
        Range3.prototype.isStart = function(row, column) {
          return this.start.row == row && this.start.column == column;
        };
        Range3.prototype.setStart = function(row, column) {
          if (typeof row == "object") {
            this.start.column = row.column;
            this.start.row = row.row;
          } else {
            this.start.row = row;
            this.start.column = column;
          }
        };
        Range3.prototype.setEnd = function(row, column) {
          if (typeof row == "object") {
            this.end.column = row.column;
            this.end.row = row.row;
          } else {
            this.end.row = row;
            this.end.column = column;
          }
        };
        Range3.prototype.inside = function(row, column) {
          if (this.compare(row, column) == 0) {
            if (this.isEnd(row, column) || this.isStart(row, column)) {
              return false;
            } else {
              return true;
            }
          }
          return false;
        };
        Range3.prototype.insideStart = function(row, column) {
          if (this.compare(row, column) == 0) {
            if (this.isEnd(row, column)) {
              return false;
            } else {
              return true;
            }
          }
          return false;
        };
        Range3.prototype.insideEnd = function(row, column) {
          if (this.compare(row, column) == 0) {
            if (this.isStart(row, column)) {
              return false;
            } else {
              return true;
            }
          }
          return false;
        };
        Range3.prototype.compare = function(row, column) {
          if (!this.isMultiLine()) {
            if (row === this.start.row) {
              return column < this.start.column ? -1 : column > this.end.column ? 1 : 0;
            }
          }
          if (row < this.start.row)
            return -1;
          if (row > this.end.row)
            return 1;
          if (this.start.row === row)
            return column >= this.start.column ? 0 : -1;
          if (this.end.row === row)
            return column <= this.end.column ? 0 : 1;
          return 0;
        };
        Range3.prototype.compareStart = function(row, column) {
          if (this.start.row == row && this.start.column == column) {
            return -1;
          } else {
            return this.compare(row, column);
          }
        };
        Range3.prototype.compareEnd = function(row, column) {
          if (this.end.row == row && this.end.column == column) {
            return 1;
          } else {
            return this.compare(row, column);
          }
        };
        Range3.prototype.compareInside = function(row, column) {
          if (this.end.row == row && this.end.column == column) {
            return 1;
          } else if (this.start.row == row && this.start.column == column) {
            return -1;
          } else {
            return this.compare(row, column);
          }
        };
        Range3.prototype.clipRows = function(firstRow, lastRow) {
          if (this.end.row > lastRow)
            var end = { row: lastRow + 1, column: 0 };
          else if (this.end.row < firstRow)
            var end = { row: firstRow, column: 0 };
          if (this.start.row > lastRow)
            var start = { row: lastRow + 1, column: 0 };
          else if (this.start.row < firstRow)
            var start = { row: firstRow, column: 0 };
          return Range3.fromPoints(start || this.start, end || this.end);
        };
        Range3.prototype.extend = function(row, column) {
          var cmp = this.compare(row, column);
          if (cmp == 0)
            return this;
          else if (cmp == -1)
            var start = { row, column };
          else
            var end = { row, column };
          return Range3.fromPoints(start || this.start, end || this.end);
        };
        Range3.prototype.isEmpty = function() {
          return this.start.row === this.end.row && this.start.column === this.end.column;
        };
        Range3.prototype.isMultiLine = function() {
          return this.start.row !== this.end.row;
        };
        Range3.prototype.clone = function() {
          return Range3.fromPoints(this.start, this.end);
        };
        Range3.prototype.collapseRows = function() {
          if (this.end.column == 0)
            return new Range3(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0);
          else
            return new Range3(this.start.row, 0, this.end.row, 0);
        };
        Range3.prototype.toScreenRange = function(session) {
          var screenPosStart = session.documentToScreenPosition(this.start);
          var screenPosEnd = session.documentToScreenPosition(this.end);
          return new Range3(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column);
        };
        Range3.prototype.moveBy = function(row, column) {
          this.start.row += row;
          this.start.column += column;
          this.end.row += row;
          this.end.column += column;
        };
        return Range3;
      }();
      Range2.fromPoints = function(start, end) {
        return new Range2(start.row, start.column, end.row, end.column);
      };
      Range2.comparePoints = comparePoints;
      Range2.comparePoints = function(p1, p2) {
        return p1.row - p2.row || p1.column - p2.column;
      };
      exports3.Range = Range2;
    });
    ace.define("ace/lib/keys", ["require", "exports", "module", "ace/lib/oop"], function(require2, exports3, module3) {
      /*! @license
      	==========================================================================
      	SproutCore -- JavaScript Application Framework
      	copyright 2006-2009, Sprout Systems Inc., Apple Inc. and contributors.
      
      	Permission is hereby granted, free of charge, to any person obtaining a
      	copy of this software and associated documentation files (the "Software"),
      	to deal in the Software without restriction, including without limitation
      	the rights to use, copy, modify, merge, publish, distribute, sublicense,
      	and/or sell copies of the Software, and to permit persons to whom the
      	Software is furnished to do so, subject to the following conditions:
      
      	The above copyright notice and this permission notice shall be included in
      	all copies or substantial portions of the Software.
      
      	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
      	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
      	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      	DEALINGS IN THE SOFTWARE.
      
      	SproutCore and the SproutCore logo are trademarks of Sprout Systems, Inc.
      
      	For more information about SproutCore, visit http://www.sproutcore.com
      
      
      	==========================================================================
      	@license */
      var oop = require2("./oop");
      var Keys = function() {
        var ret = {
          MODIFIER_KEYS: {
            16: "Shift",
            17: "Ctrl",
            18: "Alt",
            224: "Meta",
            91: "MetaLeft",
            92: "MetaRight",
            93: "ContextMenu"
          },
          KEY_MODS: {
            "ctrl": 1,
            "alt": 2,
            "option": 2,
            "shift": 4,
            "super": 8,
            "meta": 8,
            "command": 8,
            "cmd": 8,
            "control": 1
          },
          FUNCTION_KEYS: {
            8: "Backspace",
            9: "Tab",
            13: "Return",
            19: "Pause",
            27: "Esc",
            32: "Space",
            33: "PageUp",
            34: "PageDown",
            35: "End",
            36: "Home",
            37: "Left",
            38: "Up",
            39: "Right",
            40: "Down",
            44: "Print",
            45: "Insert",
            46: "Delete",
            96: "Numpad0",
            97: "Numpad1",
            98: "Numpad2",
            99: "Numpad3",
            100: "Numpad4",
            101: "Numpad5",
            102: "Numpad6",
            103: "Numpad7",
            104: "Numpad8",
            105: "Numpad9",
            "-13": "NumpadEnter",
            112: "F1",
            113: "F2",
            114: "F3",
            115: "F4",
            116: "F5",
            117: "F6",
            118: "F7",
            119: "F8",
            120: "F9",
            121: "F10",
            122: "F11",
            123: "F12",
            144: "Numlock",
            145: "Scrolllock"
          },
          PRINTABLE_KEYS: {
            32: " ",
            48: "0",
            49: "1",
            50: "2",
            51: "3",
            52: "4",
            53: "5",
            54: "6",
            55: "7",
            56: "8",
            57: "9",
            59: ";",
            61: "=",
            65: "a",
            66: "b",
            67: "c",
            68: "d",
            69: "e",
            70: "f",
            71: "g",
            72: "h",
            73: "i",
            74: "j",
            75: "k",
            76: "l",
            77: "m",
            78: "n",
            79: "o",
            80: "p",
            81: "q",
            82: "r",
            83: "s",
            84: "t",
            85: "u",
            86: "v",
            87: "w",
            88: "x",
            89: "y",
            90: "z",
            107: "+",
            109: "-",
            110: ".",
            186: ";",
            187: "=",
            188: ",",
            189: "-",
            190: ".",
            191: "/",
            192: "`",
            219: "[",
            220: "\\",
            221: "]",
            222: "'",
            111: "/",
            106: "*"
          }
        };
        ret.PRINTABLE_KEYS[173] = "-";
        var name2, i2;
        for (i2 in ret.FUNCTION_KEYS) {
          name2 = ret.FUNCTION_KEYS[i2].toLowerCase();
          ret[name2] = parseInt(i2, 10);
        }
        for (i2 in ret.PRINTABLE_KEYS) {
          name2 = ret.PRINTABLE_KEYS[i2].toLowerCase();
          ret[name2] = parseInt(i2, 10);
        }
        oop.mixin(ret, ret.MODIFIER_KEYS);
        oop.mixin(ret, ret.PRINTABLE_KEYS);
        oop.mixin(ret, ret.FUNCTION_KEYS);
        ret.enter = ret["return"];
        ret.escape = ret.esc;
        ret.del = ret["delete"];
        (function() {
          var mods = ["cmd", "ctrl", "alt", "shift"];
          for (var i3 = Math.pow(2, mods.length); i3--; ) {
            ret.KEY_MODS[i3] = mods.filter(function(x) {
              return i3 & ret.KEY_MODS[x];
            }).join("-") + "-";
          }
        })();
        ret.KEY_MODS[0] = "";
        ret.KEY_MODS[-1] = "input-";
        return ret;
      }();
      oop.mixin(exports3, Keys);
      exports3.default = exports3;
      exports3.keyCodeToString = function(keyCode) {
        var keyString = Keys[keyCode];
        if (typeof keyString != "string")
          keyString = String.fromCharCode(keyCode);
        return keyString.toLowerCase();
      };
    });
    ace.define("ace/lib/event", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function(require2, exports3, module3) {
      var keys2 = require2("./keys");
      var useragent = require2("./useragent");
      var pressedKeys = null;
      var ts = 0;
      var activeListenerOptions;
      function detectListenerOptionsSupport() {
        activeListenerOptions = false;
        try {
          document.createComment("").addEventListener("test", function() {
          }, {
            get passive() {
              activeListenerOptions = { passive: false };
            }
          });
        } catch (e) {
        }
      }
      function getListenerOptions() {
        if (activeListenerOptions == void 0)
          detectListenerOptionsSupport();
        return activeListenerOptions;
      }
      function EventListener(elem, type, callback) {
        this.elem = elem;
        this.type = type;
        this.callback = callback;
      }
      EventListener.prototype.destroy = function() {
        removeListener(this.elem, this.type, this.callback);
        this.elem = this.type = this.callback = void 0;
      };
      var addListener = exports3.addListener = function(elem, type, callback, destroyer) {
        elem.addEventListener(type, callback, getListenerOptions());
        if (destroyer)
          destroyer.$toDestroy.push(new EventListener(elem, type, callback));
      };
      var removeListener = exports3.removeListener = function(elem, type, callback) {
        elem.removeEventListener(type, callback, getListenerOptions());
      };
      exports3.stopEvent = function(e) {
        exports3.stopPropagation(e);
        exports3.preventDefault(e);
        return false;
      };
      exports3.stopPropagation = function(e) {
        if (e.stopPropagation)
          e.stopPropagation();
      };
      exports3.preventDefault = function(e) {
        if (e.preventDefault)
          e.preventDefault();
      };
      exports3.getButton = function(e) {
        if (e.type == "dblclick")
          return 0;
        if (e.type == "contextmenu" || useragent.isMac && (e.ctrlKey && !e.altKey && !e.shiftKey))
          return 2;
        return e.button;
      };
      exports3.capture = function(el, eventHandler, releaseCaptureHandler) {
        var ownerDocument = el && el.ownerDocument || document;
        function onMouseUp(e) {
          eventHandler && eventHandler(e);
          releaseCaptureHandler && releaseCaptureHandler(e);
          removeListener(ownerDocument, "mousemove", eventHandler);
          removeListener(ownerDocument, "mouseup", onMouseUp);
          removeListener(ownerDocument, "dragstart", onMouseUp);
        }
        addListener(ownerDocument, "mousemove", eventHandler);
        addListener(ownerDocument, "mouseup", onMouseUp);
        addListener(ownerDocument, "dragstart", onMouseUp);
        return onMouseUp;
      };
      exports3.addMouseWheelListener = function(el, callback, destroyer) {
        addListener(el, "wheel", function(e) {
          var factor = 0.15;
          var deltaX = e.deltaX || 0;
          var deltaY = e.deltaY || 0;
          switch (e.deltaMode) {
            case e.DOM_DELTA_PIXEL:
              e.wheelX = deltaX * factor;
              e.wheelY = deltaY * factor;
              break;
            case e.DOM_DELTA_LINE:
              var linePixels = 15;
              e.wheelX = deltaX * linePixels;
              e.wheelY = deltaY * linePixels;
              break;
            case e.DOM_DELTA_PAGE:
              var pagePixels = 150;
              e.wheelX = deltaX * pagePixels;
              e.wheelY = deltaY * pagePixels;
              break;
          }
          callback(e);
        }, destroyer);
      };
      exports3.addMultiMouseDownListener = function(elements, timeouts, eventHandler, callbackName, destroyer) {
        var clicks = 0;
        var startX, startY, timer;
        var eventNames = {
          2: "dblclick",
          3: "tripleclick",
          4: "quadclick"
        };
        function onMousedown(e) {
          if (exports3.getButton(e) !== 0) {
            clicks = 0;
          } else if (e.detail > 1) {
            clicks++;
            if (clicks > 4)
              clicks = 1;
          } else {
            clicks = 1;
          }
          if (useragent.isIE) {
            var isNewClick = Math.abs(e.clientX - startX) > 5 || Math.abs(e.clientY - startY) > 5;
            if (!timer || isNewClick)
              clicks = 1;
            if (timer)
              clearTimeout(timer);
            timer = setTimeout(function() {
              timer = null;
            }, timeouts[clicks - 1] || 600);
            if (clicks == 1) {
              startX = e.clientX;
              startY = e.clientY;
            }
          }
          e._clicks = clicks;
          eventHandler[callbackName]("mousedown", e);
          if (clicks > 4)
            clicks = 0;
          else if (clicks > 1)
            return eventHandler[callbackName](eventNames[clicks], e);
        }
        if (!Array.isArray(elements))
          elements = [elements];
        elements.forEach(function(el) {
          addListener(el, "mousedown", onMousedown, destroyer);
        });
      };
      var getModifierHash = function(e) {
        return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
      };
      exports3.getModifierString = function(e) {
        return keys2.KEY_MODS[getModifierHash(e)];
      };
      function normalizeCommandKeys(callback, e, keyCode) {
        var hashId = getModifierHash(e);
        if (!useragent.isMac && pressedKeys) {
          if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win")))
            hashId |= 8;
          if (pressedKeys.altGr) {
            if ((3 & hashId) != 3)
              pressedKeys.altGr = 0;
            else
              return;
          }
          if (keyCode === 18 || keyCode === 17) {
            var location2 = "location" in e ? e.location : e.keyLocation;
            if (keyCode === 17 && location2 === 1) {
              if (pressedKeys[keyCode] == 1)
                ts = e.timeStamp;
            } else if (keyCode === 18 && hashId === 3 && location2 === 2) {
              var dt = e.timeStamp - ts;
              if (dt < 50)
                pressedKeys.altGr = true;
            }
          }
        }
        if (keyCode in keys2.MODIFIER_KEYS) {
          keyCode = -1;
        }
        if (!hashId && keyCode === 13) {
          var location2 = "location" in e ? e.location : e.keyLocation;
          if (location2 === 3) {
            callback(e, hashId, -keyCode);
            if (e.defaultPrevented)
              return;
          }
        }
        if (useragent.isChromeOS && hashId & 8) {
          callback(e, hashId, keyCode);
          if (e.defaultPrevented)
            return;
          else
            hashId &= ~8;
        }
        if (!hashId && !(keyCode in keys2.FUNCTION_KEYS) && !(keyCode in keys2.PRINTABLE_KEYS)) {
          return false;
        }
        return callback(e, hashId, keyCode);
      }
      exports3.addCommandKeyListener = function(el, callback, destroyer) {
        if (useragent.isOldGecko || useragent.isOpera && !("KeyboardEvent" in window)) {
          var lastKeyDownKeyCode = null;
          addListener(el, "keydown", function(e) {
            lastKeyDownKeyCode = e.keyCode;
          }, destroyer);
          addListener(el, "keypress", function(e) {
            return normalizeCommandKeys(callback, e, lastKeyDownKeyCode);
          }, destroyer);
        } else {
          var lastDefaultPrevented = null;
          addListener(el, "keydown", function(e) {
            pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1;
            var result = normalizeCommandKeys(callback, e, e.keyCode);
            lastDefaultPrevented = e.defaultPrevented;
            return result;
          }, destroyer);
          addListener(el, "keypress", function(e) {
            if (lastDefaultPrevented && (e.ctrlKey || e.altKey || e.shiftKey || e.metaKey)) {
              exports3.stopEvent(e);
              lastDefaultPrevented = null;
            }
          }, destroyer);
          addListener(el, "keyup", function(e) {
            pressedKeys[e.keyCode] = null;
          }, destroyer);
          if (!pressedKeys) {
            resetPressedKeys();
            addListener(window, "focus", resetPressedKeys);
          }
        }
      };
      function resetPressedKeys() {
        pressedKeys = Object.create(null);
      }
      if (typeof window == "object" && window.postMessage && !useragent.isOldIE) {
        var postMessageId = 1;
        exports3.nextTick = function(callback, win) {
          win = win || window;
          var messageName = "zero-timeout-message-" + postMessageId++;
          var listener = function(e) {
            if (e.data == messageName) {
              exports3.stopPropagation(e);
              removeListener(win, "message", listener);
              callback();
            }
          };
          addListener(win, "message", listener);
          win.postMessage(messageName, "*");
        };
      }
      exports3.$idleBlocked = false;
      exports3.onIdle = function(cb, timeout) {
        return setTimeout(function handler() {
          if (!exports3.$idleBlocked) {
            cb();
          } else {
            setTimeout(handler, 100);
          }
        }, timeout);
      };
      exports3.$idleBlockId = null;
      exports3.blockIdle = function(delay) {
        if (exports3.$idleBlockId)
          clearTimeout(exports3.$idleBlockId);
        exports3.$idleBlocked = true;
        exports3.$idleBlockId = setTimeout(function() {
          exports3.$idleBlocked = false;
        }, delay || 100);
      };
      exports3.nextFrame = typeof window == "object" && (window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame);
      if (exports3.nextFrame)
        exports3.nextFrame = exports3.nextFrame.bind(window);
      else
        exports3.nextFrame = function(callback) {
          setTimeout(callback, 17);
        };
    });
    ace.define("ace/clipboard", ["require", "exports", "module"], function(require2, exports3, module3) {
      var $cancelT;
      module3.exports = {
        lineMode: false,
        pasteCancelled: function() {
          if ($cancelT && $cancelT > Date.now() - 50)
            return true;
          return $cancelT = false;
        },
        cancel: function() {
          $cancelT = Date.now();
        }
      };
    });
    ace.define("ace/keyboard/textinput", ["require", "exports", "module", "ace/lib/event", "ace/config", "ace/lib/useragent", "ace/lib/dom", "ace/lib/lang", "ace/clipboard", "ace/lib/keys"], function(require2, exports3, module3) {
      var event = require2("../lib/event");
      var nls = require2("../config").nls;
      var useragent = require2("../lib/useragent");
      var dom = require2("../lib/dom");
      var lang = require2("../lib/lang");
      var clipboard2 = require2("../clipboard");
      var BROKEN_SETDATA = useragent.isChrome < 18;
      var USE_IE_MIME_TYPE = useragent.isIE;
      var HAS_FOCUS_ARGS = useragent.isChrome > 63;
      var MAX_LINE_LENGTH = 400;
      var KEYS = require2("../lib/keys");
      var MODS = KEYS.KEY_MODS;
      var isIOS = useragent.isIOS;
      var valueResetRegex = isIOS ? /\s/ : /\n/;
      var isMobile = useragent.isMobile;
      var TextInput = function(parentNode, host) {
        var text = dom.createElement("textarea");
        text.className = "ace_text-input";
        text.setAttribute("wrap", "off");
        text.setAttribute("autocorrect", "off");
        text.setAttribute("autocapitalize", "off");
        text.setAttribute("spellcheck", false);
        text.style.opacity = "0";
        parentNode.insertBefore(text, parentNode.firstChild);
        var copied = false;
        var pasted = false;
        var inComposition = false;
        var sendingText = false;
        var tempStyle = "";
        if (!isMobile)
          text.style.fontSize = "1px";
        var commandMode = false;
        var ignoreFocusEvents = false;
        var lastValue = "";
        var lastSelectionStart = 0;
        var lastSelectionEnd = 0;
        var lastRestoreEnd = 0;
        var rowStart = Number.MAX_SAFE_INTEGER;
        var rowEnd = Number.MIN_SAFE_INTEGER;
        var numberOfExtraLines = 0;
        try {
          var isFocused = document.activeElement === text;
        } catch (e) {
        }
        this.setNumberOfExtraLines = function(number2) {
          rowStart = Number.MAX_SAFE_INTEGER;
          rowEnd = Number.MIN_SAFE_INTEGER;
          if (number2 < 0) {
            numberOfExtraLines = 0;
            return;
          }
          numberOfExtraLines = number2;
        };
        this.setAriaOptions = function(options) {
          if (options.activeDescendant) {
            text.setAttribute("aria-haspopup", "true");
            text.setAttribute("aria-autocomplete", options.inline ? "both" : "list");
            text.setAttribute("aria-activedescendant", options.activeDescendant);
          } else {
            text.setAttribute("aria-haspopup", "false");
            text.setAttribute("aria-autocomplete", "both");
            text.removeAttribute("aria-activedescendant");
          }
          if (options.role) {
            text.setAttribute("role", options.role);
          }
          if (options.setLabel) {
            text.setAttribute("aria-roledescription", nls("editor"));
            if (host.session) {
              var row = host.session.selection.cursor.row;
              text.setAttribute("aria-label", nls("Cursor at row $0", [row + 1]));
            }
          }
        };
        this.setAriaOptions({ role: "textbox" });
        event.addListener(text, "blur", function(e) {
          if (ignoreFocusEvents)
            return;
          host.onBlur(e);
          isFocused = false;
        }, host);
        event.addListener(text, "focus", function(e) {
          if (ignoreFocusEvents)
            return;
          isFocused = true;
          if (useragent.isEdge) {
            try {
              if (!document.hasFocus())
                return;
            } catch (e2) {
            }
          }
          host.onFocus(e);
          if (useragent.isEdge)
            setTimeout(resetSelection);
          else
            resetSelection();
        }, host);
        this.$focusScroll = false;
        this.focus = function() {
          this.setAriaOptions({
            setLabel: host.renderer.enableKeyboardAccessibility
          });
          if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == "browser")
            return text.focus({ preventScroll: true });
          var top2 = text.style.top;
          text.style.position = "fixed";
          text.style.top = "0px";
          try {
            var isTransformed = text.getBoundingClientRect().top != 0;
          } catch (e) {
            return;
          }
          var ancestors = [];
          if (isTransformed) {
            var t2 = text.parentElement;
            while (t2 && t2.nodeType == 1) {
              ancestors.push(t2);
              t2.setAttribute("ace_nocontext", true);
              if (!t2.parentElement && t2.getRootNode)
                t2 = t2.getRootNode().host;
              else
                t2 = t2.parentElement;
            }
          }
          text.focus({ preventScroll: true });
          if (isTransformed) {
            ancestors.forEach(function(p) {
              p.removeAttribute("ace_nocontext");
            });
          }
          setTimeout(function() {
            text.style.position = "";
            if (text.style.top == "0px")
              text.style.top = top2;
          }, 0);
        };
        this.blur = function() {
          text.blur();
        };
        this.isFocused = function() {
          return isFocused;
        };
        host.on("beforeEndOperation", function() {
          var curOp = host.curOp;
          var commandName = curOp && curOp.command && curOp.command.name;
          if (commandName == "insertstring")
            return;
          var isUserAction = commandName && (curOp.docChanged || curOp.selectionChanged);
          if (inComposition && isUserAction) {
            lastValue = text.value = "";
            onCompositionEnd();
          }
          resetSelection();
        });
        var positionToSelection = function(row, column) {
          var selection = column;
          for (var i2 = 1; i2 <= row - rowStart && i2 < 2 * numberOfExtraLines + 1; i2++) {
            selection += host.session.getLine(row - i2).length + 1;
          }
          return selection;
        };
        var resetSelection = isIOS ? function(value2) {
          if (!isFocused || copied && !value2 || sendingText)
            return;
          if (!value2)
            value2 = "";
          var newValue = "\n ab" + value2 + "cde fg\n";
          if (newValue != text.value)
            text.value = lastValue = newValue;
          var selectionStart = 4;
          var selectionEnd = 4 + (value2.length || (host.selection.isEmpty() ? 0 : 1));
          if (lastSelectionStart != selectionStart || lastSelectionEnd != selectionEnd) {
            text.setSelectionRange(selectionStart, selectionEnd);
          }
          lastSelectionStart = selectionStart;
          lastSelectionEnd = selectionEnd;
        } : function() {
          if (inComposition || sendingText)
            return;
          if (!isFocused && !afterContextMenu)
            return;
          inComposition = true;
          var selectionStart = 0;
          var selectionEnd = 0;
          var line = "";
          if (host.session) {
            var selection = host.selection;
            var range = selection.getRange();
            var row = selection.cursor.row;
            if (row === rowEnd + 1) {
              rowStart = rowEnd + 1;
              rowEnd = rowStart + 2 * numberOfExtraLines;
            } else if (row === rowStart - 1) {
              rowEnd = rowStart - 1;
              rowStart = rowEnd - 2 * numberOfExtraLines;
            } else if (row < rowStart - 1 || row > rowEnd + 1) {
              rowStart = row > numberOfExtraLines ? row - numberOfExtraLines : 0;
              rowEnd = row > numberOfExtraLines ? row + numberOfExtraLines : 2 * numberOfExtraLines;
            }
            var lines = [];
            for (var i2 = rowStart; i2 <= rowEnd; i2++) {
              lines.push(host.session.getLine(i2));
            }
            line = lines.join("\n");
            selectionStart = positionToSelection(range.start.row, range.start.column);
            selectionEnd = positionToSelection(range.end.row, range.end.column);
            if (range.start.row < rowStart) {
              var prevLine = host.session.getLine(rowStart - 1);
              selectionStart = range.start.row < rowStart - 1 ? 0 : selectionStart;
              selectionEnd += prevLine.length + 1;
              line = prevLine + "\n" + line;
            } else if (range.end.row > rowEnd) {
              var nextLine = host.session.getLine(rowEnd + 1);
              selectionEnd = range.end.row > rowEnd + 1 ? nextLine.length : range.end.column;
              selectionEnd += line.length + 1;
              line = line + "\n" + nextLine;
            } else if (isMobile && row > 0) {
              line = "\n" + line;
              selectionEnd += 1;
              selectionStart += 1;
            }
            if (line.length > MAX_LINE_LENGTH) {
              if (selectionStart < MAX_LINE_LENGTH && selectionEnd < MAX_LINE_LENGTH) {
                line = line.slice(0, MAX_LINE_LENGTH);
              } else {
                line = "\n";
                if (selectionStart == selectionEnd) {
                  selectionStart = selectionEnd = 0;
                } else {
                  selectionStart = 0;
                  selectionEnd = 1;
                }
              }
            }
            var newValue = line + "\n\n";
            if (newValue != lastValue) {
              text.value = lastValue = newValue;
              lastSelectionStart = lastSelectionEnd = newValue.length;
            }
          }
          if (afterContextMenu) {
            lastSelectionStart = text.selectionStart;
            lastSelectionEnd = text.selectionEnd;
          }
          if (lastSelectionEnd != selectionEnd || lastSelectionStart != selectionStart || text.selectionEnd != lastSelectionEnd) {
            try {
              text.setSelectionRange(selectionStart, selectionEnd);
              lastSelectionStart = selectionStart;
              lastSelectionEnd = selectionEnd;
            } catch (e) {
            }
          }
          inComposition = false;
        };
        this.resetSelection = resetSelection;
        if (isFocused)
          host.onFocus();
        var isAllSelected = function(text2) {
          return text2.selectionStart === 0 && text2.selectionEnd >= lastValue.length && text2.value === lastValue && lastValue && text2.selectionEnd !== lastSelectionEnd;
        };
        var onSelect = function(e) {
          if (inComposition)
            return;
          if (copied) {
            copied = false;
          } else if (isAllSelected(text)) {
            host.selectAll();
            resetSelection();
          } else if (isMobile && text.selectionStart != lastSelectionStart) {
            resetSelection();
          }
        };
        var inputHandler2 = null;
        this.setInputHandler = function(cb) {
          inputHandler2 = cb;
        };
        this.getInputHandler = function() {
          return inputHandler2;
        };
        var afterContextMenu = false;
        var sendText = function(value2, fromInput) {
          if (afterContextMenu)
            afterContextMenu = false;
          if (pasted) {
            resetSelection();
            if (value2)
              host.onPaste(value2);
            pasted = false;
            return "";
          } else {
            var selectionStart = text.selectionStart;
            var selectionEnd = text.selectionEnd;
            var extendLeft = lastSelectionStart;
            var extendRight = lastValue.length - lastSelectionEnd;
            var inserted = value2;
            var restoreStart = value2.length - selectionStart;
            var restoreEnd = value2.length - selectionEnd;
            var i2 = 0;
            while (extendLeft > 0 && lastValue[i2] == value2[i2]) {
              i2++;
              extendLeft--;
            }
            inserted = inserted.slice(i2);
            i2 = 1;
            while (extendRight > 0 && lastValue.length - i2 > lastSelectionStart - 1 && lastValue[lastValue.length - i2] == value2[value2.length - i2]) {
              i2++;
              extendRight--;
            }
            restoreStart -= i2 - 1;
            restoreEnd -= i2 - 1;
            var endIndex = inserted.length - i2 + 1;
            if (endIndex < 0) {
              extendLeft = -endIndex;
              endIndex = 0;
            }
            inserted = inserted.slice(0, endIndex);
            if (!fromInput && !inserted && !restoreStart && !extendLeft && !extendRight && !restoreEnd)
              return "";
            sendingText = true;
            var shouldReset = false;
            if (useragent.isAndroid && inserted == ". ") {
              inserted = "  ";
              shouldReset = true;
            }
            if (inserted && !extendLeft && !extendRight && !restoreStart && !restoreEnd || commandMode) {
              host.onTextInput(inserted);
            } else {
              host.onTextInput(inserted, {
                extendLeft,
                extendRight,
                restoreStart,
                restoreEnd
              });
            }
            sendingText = false;
            lastValue = value2;
            lastSelectionStart = selectionStart;
            lastSelectionEnd = selectionEnd;
            lastRestoreEnd = restoreEnd;
            return shouldReset ? "\n" : inserted;
          }
        };
        var onInput = function(e) {
          if (inComposition)
            return onCompositionUpdate();
          if (e && e.inputType) {
            if (e.inputType == "historyUndo")
              return host.execCommand("undo");
            if (e.inputType == "historyRedo")
              return host.execCommand("redo");
          }
          var data2 = text.value;
          var inserted = sendText(data2, true);
          if (data2.length > MAX_LINE_LENGTH + 100 || valueResetRegex.test(inserted) || isMobile && lastSelectionStart < 1 && lastSelectionStart == lastSelectionEnd) {
            resetSelection();
          }
        };
        var handleClipboardData = function(e, data2, forceIEMime) {
          var clipboardData = e.clipboardData || window.clipboardData;
          if (!clipboardData || BROKEN_SETDATA)
            return;
          var mime = USE_IE_MIME_TYPE || forceIEMime ? "Text" : "text/plain";
          try {
            if (data2) {
              return clipboardData.setData(mime, data2) !== false;
            } else {
              return clipboardData.getData(mime);
            }
          } catch (e2) {
            if (!forceIEMime)
              return handleClipboardData(e2, data2, true);
          }
        };
        var doCopy = function(e, isCut) {
          var data2 = host.getCopyText();
          if (!data2)
            return event.preventDefault(e);
          if (handleClipboardData(e, data2)) {
            if (isIOS) {
              resetSelection(data2);
              copied = data2;
              setTimeout(function() {
                copied = false;
              }, 10);
            }
            isCut ? host.onCut() : host.onCopy();
            event.preventDefault(e);
          } else {
            copied = true;
            text.value = data2;
            text.select();
            setTimeout(function() {
              copied = false;
              resetSelection();
              isCut ? host.onCut() : host.onCopy();
            });
          }
        };
        var onCut = function(e) {
          doCopy(e, true);
        };
        var onCopy = function(e) {
          doCopy(e, false);
        };
        var onPaste = function(e) {
          var data2 = handleClipboardData(e);
          if (clipboard2.pasteCancelled())
            return;
          if (typeof data2 == "string") {
            if (data2)
              host.onPaste(data2, e);
            if (useragent.isIE)
              setTimeout(resetSelection);
            event.preventDefault(e);
          } else {
            text.value = "";
            pasted = true;
          }
        };
        event.addCommandKeyListener(text, host.onCommandKey.bind(host), host);
        event.addListener(text, "select", onSelect, host);
        event.addListener(text, "input", onInput, host);
        event.addListener(text, "cut", onCut, host);
        event.addListener(text, "copy", onCopy, host);
        event.addListener(text, "paste", onPaste, host);
        if (!("oncut" in text) || !("oncopy" in text) || !("onpaste" in text)) {
          event.addListener(parentNode, "keydown", function(e) {
            if (useragent.isMac && !e.metaKey || !e.ctrlKey)
              return;
            switch (e.keyCode) {
              case 67:
                onCopy(e);
                break;
              case 86:
                onPaste(e);
                break;
              case 88:
                onCut(e);
                break;
            }
          }, host);
        }
        var onCompositionStart = function(e) {
          if (inComposition || !host.onCompositionStart || host.$readOnly)
            return;
          inComposition = {};
          if (commandMode)
            return;
          if (e.data)
            inComposition.useTextareaForIME = false;
          setTimeout(onCompositionUpdate, 0);
          host._signal("compositionStart");
          host.on("mousedown", cancelComposition);
          var range = host.getSelectionRange();
          range.end.row = range.start.row;
          range.end.column = range.start.column;
          inComposition.markerRange = range;
          inComposition.selectionStart = lastSelectionStart;
          host.onCompositionStart(inComposition);
          if (inComposition.useTextareaForIME) {
            lastValue = text.value = "";
            lastSelectionStart = 0;
            lastSelectionEnd = 0;
          } else {
            if (text.msGetInputContext)
              inComposition.context = text.msGetInputContext();
            if (text.getInputContext)
              inComposition.context = text.getInputContext();
          }
        };
        var onCompositionUpdate = function() {
          if (!inComposition || !host.onCompositionUpdate || host.$readOnly)
            return;
          if (commandMode)
            return cancelComposition();
          if (inComposition.useTextareaForIME) {
            host.onCompositionUpdate(text.value);
          } else {
            var data2 = text.value;
            sendText(data2);
            if (inComposition.markerRange) {
              if (inComposition.context) {
                inComposition.markerRange.start.column = inComposition.selectionStart = inComposition.context.compositionStartOffset;
              }
              inComposition.markerRange.end.column = inComposition.markerRange.start.column + lastSelectionEnd - inComposition.selectionStart + lastRestoreEnd;
            }
          }
        };
        var onCompositionEnd = function(e) {
          if (!host.onCompositionEnd || host.$readOnly)
            return;
          inComposition = false;
          host.onCompositionEnd();
          host.off("mousedown", cancelComposition);
          if (e)
            onInput();
        };
        function cancelComposition() {
          ignoreFocusEvents = true;
          text.blur();
          text.focus();
          ignoreFocusEvents = false;
        }
        var syncComposition = lang.delayedCall(onCompositionUpdate, 50).schedule.bind(null, null);
        function onKeyup(e) {
          if (e.keyCode == 27 && text.value.length < text.selectionStart) {
            if (!inComposition)
              lastValue = text.value;
            lastSelectionStart = lastSelectionEnd = -1;
            resetSelection();
          }
          syncComposition();
        }
        event.addListener(text, "compositionstart", onCompositionStart, host);
        event.addListener(text, "compositionupdate", onCompositionUpdate, host);
        event.addListener(text, "keyup", onKeyup, host);
        event.addListener(text, "keydown", syncComposition, host);
        event.addListener(text, "compositionend", onCompositionEnd, host);
        this.getElement = function() {
          return text;
        };
        this.setCommandMode = function(value2) {
          commandMode = value2;
          text.readOnly = false;
        };
        this.setReadOnly = function(readOnly2) {
          if (!commandMode)
            text.readOnly = readOnly2;
        };
        this.setCopyWithEmptySelection = function(value2) {
        };
        this.onContextMenu = function(e) {
          afterContextMenu = true;
          resetSelection();
          host._emit("nativecontextmenu", { target: host, domEvent: e });
          this.moveToMouse(e, true);
        };
        this.moveToMouse = function(e, bringToFront) {
          if (!tempStyle)
            tempStyle = text.style.cssText;
          text.style.cssText = (bringToFront ? "z-index:100000;" : "") + (useragent.isIE ? "opacity:0.1;" : "") + "text-indent: -" + (lastSelectionStart + lastSelectionEnd) * host.renderer.characterWidth * 0.5 + "px;";
          var rect = host.container.getBoundingClientRect();
          var style = dom.computedStyle(host.container);
          var top2 = rect.top + (parseInt(style.borderTopWidth) || 0);
          var left = rect.left + (parseInt(rect.borderLeftWidth) || 0);
          var maxTop = rect.bottom - top2 - text.clientHeight - 2;
          var move = function(e2) {
            dom.translate(text, e2.clientX - left - 2, Math.min(e2.clientY - top2 - 2, maxTop));
          };
          move(e);
          if (e.type != "mousedown")
            return;
          host.renderer.$isMousePressed = true;
          clearTimeout(closeTimeout);
          if (useragent.isWin)
            event.capture(host.container, move, onContextMenuClose);
        };
        this.onContextMenuClose = onContextMenuClose;
        var closeTimeout;
        function onContextMenuClose() {
          clearTimeout(closeTimeout);
          closeTimeout = setTimeout(function() {
            if (tempStyle) {
              text.style.cssText = tempStyle;
              tempStyle = "";
            }
            host.renderer.$isMousePressed = false;
            if (host.renderer.$keepTextAreaAtCursor)
              host.renderer.$moveTextAreaToCursor();
          }, 0);
        }
        var onContextMenu = function(e) {
          host.textInput.onContextMenu(e);
          onContextMenuClose();
        };
        event.addListener(text, "mouseup", onContextMenu, host);
        event.addListener(text, "mousedown", function(e) {
          e.preventDefault();
          onContextMenuClose();
        }, host);
        event.addListener(host.renderer.scroller, "contextmenu", onContextMenu, host);
        event.addListener(text, "contextmenu", onContextMenu, host);
        if (isIOS)
          addIosSelectionHandler(parentNode, host, text);
        function addIosSelectionHandler(parentNode2, host2, text2) {
          var typingResetTimeout = null;
          var typing = false;
          text2.addEventListener("keydown", function(e) {
            if (typingResetTimeout)
              clearTimeout(typingResetTimeout);
            typing = true;
          }, true);
          text2.addEventListener("keyup", function(e) {
            typingResetTimeout = setTimeout(function() {
              typing = false;
            }, 100);
          }, true);
          var detectArrowKeys = function(e) {
            if (document.activeElement !== text2)
              return;
            if (typing || inComposition || host2.$mouseHandler.isMousePressed)
              return;
            if (copied) {
              return;
            }
            var selectionStart = text2.selectionStart;
            var selectionEnd = text2.selectionEnd;
            var key = null;
            var modifier = 0;
            if (selectionStart == 0) {
              key = KEYS.up;
            } else if (selectionStart == 1) {
              key = KEYS.home;
            } else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd] == "\n") {
              key = KEYS.end;
            } else if (selectionStart < lastSelectionStart && lastValue[selectionStart - 1] == " ") {
              key = KEYS.left;
              modifier = MODS.option;
            } else if (selectionStart < lastSelectionStart || selectionStart == lastSelectionStart && lastSelectionEnd != lastSelectionStart && selectionStart == selectionEnd) {
              key = KEYS.left;
            } else if (selectionEnd > lastSelectionEnd && lastValue.slice(0, selectionEnd).split("\n").length > 2) {
              key = KEYS.down;
            } else if (selectionEnd > lastSelectionEnd && lastValue[selectionEnd - 1] == " ") {
              key = KEYS.right;
              modifier = MODS.option;
            } else if (selectionEnd > lastSelectionEnd || selectionEnd == lastSelectionEnd && lastSelectionEnd != lastSelectionStart && selectionStart == selectionEnd) {
              key = KEYS.right;
            }
            if (selectionStart !== selectionEnd)
              modifier |= MODS.shift;
            if (key) {
              var result = host2.onCommandKey({}, modifier, key);
              if (!result && host2.commands) {
                key = KEYS.keyCodeToString(key);
                var command2 = host2.commands.findKeyCommand(modifier, key);
                if (command2)
                  host2.execCommand(command2);
              }
              lastSelectionStart = selectionStart;
              lastSelectionEnd = selectionEnd;
              resetSelection("");
            }
          };
          document.addEventListener("selectionchange", detectArrowKeys);
          host2.on("destroy", function() {
            document.removeEventListener("selectionchange", detectArrowKeys);
          });
        }
        this.destroy = function() {
          if (text.parentElement)
            text.parentElement.removeChild(text);
        };
      };
      exports3.TextInput = TextInput;
      exports3.$setUserAgentForTests = function(_isMobile, _isIOS) {
        isMobile = _isMobile;
        isIOS = _isIOS;
      };
    });
    ace.define("ace/mouse/default_handlers", ["require", "exports", "module", "ace/lib/useragent"], function(require2, exports3, module3) {
      var useragent = require2("../lib/useragent");
      var DRAG_OFFSET = 0;
      var SCROLL_COOLDOWN_T = 550;
      var DefaultHandlers = function() {
        function DefaultHandlers2(mouseHandler) {
          mouseHandler.$clickSelection = null;
          var editor = mouseHandler.editor;
          editor.setDefaultHandler("mousedown", this.onMouseDown.bind(mouseHandler));
          editor.setDefaultHandler("dblclick", this.onDoubleClick.bind(mouseHandler));
          editor.setDefaultHandler("tripleclick", this.onTripleClick.bind(mouseHandler));
          editor.setDefaultHandler("quadclick", this.onQuadClick.bind(mouseHandler));
          editor.setDefaultHandler("mousewheel", this.onMouseWheel.bind(mouseHandler));
          var exports4 = [
            "select",
            "startSelect",
            "selectEnd",
            "selectAllEnd",
            "selectByWordsEnd",
            "selectByLinesEnd",
            "dragWait",
            "dragWaitEnd",
            "focusWait"
          ];
          exports4.forEach(function(x) {
            mouseHandler[x] = this[x];
          }, this);
          mouseHandler.selectByLines = this.extendSelectionBy.bind(mouseHandler, "getLineRange");
          mouseHandler.selectByWords = this.extendSelectionBy.bind(mouseHandler, "getWordRange");
        }
        DefaultHandlers2.prototype.onMouseDown = function(ev) {
          var inSelection = ev.inSelection();
          var pos = ev.getDocumentPosition();
          this.mousedownEvent = ev;
          var editor = this.editor;
          var button = ev.getButton();
          if (button !== 0) {
            var selectionRange = editor.getSelectionRange();
            var selectionEmpty = selectionRange.isEmpty();
            if (selectionEmpty || button == 1)
              editor.selection.moveToPosition(pos);
            if (button == 2) {
              editor.textInput.onContextMenu(ev.domEvent);
              if (!useragent.isMozilla)
                ev.preventDefault();
            }
            return;
          }
          this.mousedownEvent.time = Date.now();
          if (inSelection && !editor.isFocused()) {
            editor.focus();
            if (this.$focusTimeout && !this.$clickSelection && !editor.inMultiSelectMode) {
              this.setState("focusWait");
              this.captureMouse(ev);
              return;
            }
          }
          this.captureMouse(ev);
          this.startSelect(pos, ev.domEvent._clicks > 1);
          return ev.preventDefault();
        };
        DefaultHandlers2.prototype.startSelect = function(pos, waitForClickSelection) {
          pos = pos || this.editor.renderer.screenToTextCoordinates(this.x, this.y);
          var editor = this.editor;
          if (!this.mousedownEvent)
            return;
          if (this.mousedownEvent.getShiftKey())
            editor.selection.selectToPosition(pos);
          else if (!waitForClickSelection)
            editor.selection.moveToPosition(pos);
          if (!waitForClickSelection)
            this.select();
          editor.setStyle("ace_selecting");
          this.setState("select");
        };
        DefaultHandlers2.prototype.select = function() {
          var anchor, editor = this.editor;
          var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);
          if (this.$clickSelection) {
            var cmp = this.$clickSelection.comparePoint(cursor);
            if (cmp == -1) {
              anchor = this.$clickSelection.end;
            } else if (cmp == 1) {
              anchor = this.$clickSelection.start;
            } else {
              var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);
              cursor = orientedRange.cursor;
              anchor = orientedRange.anchor;
            }
            editor.selection.setSelectionAnchor(anchor.row, anchor.column);
          }
          editor.selection.selectToPosition(cursor);
          editor.renderer.scrollCursorIntoView();
        };
        DefaultHandlers2.prototype.extendSelectionBy = function(unitName) {
          var anchor, editor = this.editor;
          var cursor = editor.renderer.screenToTextCoordinates(this.x, this.y);
          var range = editor.selection[unitName](cursor.row, cursor.column);
          if (this.$clickSelection) {
            var cmpStart = this.$clickSelection.comparePoint(range.start);
            var cmpEnd = this.$clickSelection.comparePoint(range.end);
            if (cmpStart == -1 && cmpEnd <= 0) {
              anchor = this.$clickSelection.end;
              if (range.end.row != cursor.row || range.end.column != cursor.column)
                cursor = range.start;
            } else if (cmpEnd == 1 && cmpStart >= 0) {
              anchor = this.$clickSelection.start;
              if (range.start.row != cursor.row || range.start.column != cursor.column)
                cursor = range.end;
            } else if (cmpStart == -1 && cmpEnd == 1) {
              cursor = range.end;
              anchor = range.start;
            } else {
              var orientedRange = calcRangeOrientation(this.$clickSelection, cursor);
              cursor = orientedRange.cursor;
              anchor = orientedRange.anchor;
            }
            editor.selection.setSelectionAnchor(anchor.row, anchor.column);
          }
          editor.selection.selectToPosition(cursor);
          editor.renderer.scrollCursorIntoView();
        };
        DefaultHandlers2.prototype.selectByLinesEnd = function() {
          this.$clickSelection = null;
          this.editor.unsetStyle("ace_selecting");
        };
        DefaultHandlers2.prototype.focusWait = function() {
          var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
          var time = Date.now();
          if (distance > DRAG_OFFSET || time - this.mousedownEvent.time > this.$focusTimeout)
            this.startSelect(this.mousedownEvent.getDocumentPosition());
        };
        DefaultHandlers2.prototype.onDoubleClick = function(ev) {
          var pos = ev.getDocumentPosition();
          var editor = this.editor;
          var session = editor.session;
          var range = session.getBracketRange(pos);
          if (range) {
            if (range.isEmpty()) {
              range.start.column--;
              range.end.column++;
            }
            this.setState("select");
          } else {
            range = editor.selection.getWordRange(pos.row, pos.column);
            this.setState("selectByWords");
          }
          this.$clickSelection = range;
          this.select();
        };
        DefaultHandlers2.prototype.onTripleClick = function(ev) {
          var pos = ev.getDocumentPosition();
          var editor = this.editor;
          this.setState("selectByLines");
          var range = editor.getSelectionRange();
          if (range.isMultiLine() && range.contains(pos.row, pos.column)) {
            this.$clickSelection = editor.selection.getLineRange(range.start.row);
            this.$clickSelection.end = editor.selection.getLineRange(range.end.row).end;
          } else {
            this.$clickSelection = editor.selection.getLineRange(pos.row);
          }
          this.select();
        };
        DefaultHandlers2.prototype.onQuadClick = function(ev) {
          var editor = this.editor;
          editor.selectAll();
          this.$clickSelection = editor.getSelectionRange();
          this.setState("selectAll");
        };
        DefaultHandlers2.prototype.onMouseWheel = function(ev) {
          if (ev.getAccelKey())
            return;
          if (ev.getShiftKey() && ev.wheelY && !ev.wheelX) {
            ev.wheelX = ev.wheelY;
            ev.wheelY = 0;
          }
          var editor = this.editor;
          if (!this.$lastScroll)
            this.$lastScroll = { t: 0, vx: 0, vy: 0, allowed: 0 };
          var prevScroll = this.$lastScroll;
          var t2 = ev.domEvent.timeStamp;
          var dt = t2 - prevScroll.t;
          var vx = dt ? ev.wheelX / dt : prevScroll.vx;
          var vy = dt ? ev.wheelY / dt : prevScroll.vy;
          if (dt < SCROLL_COOLDOWN_T) {
            vx = (vx + prevScroll.vx) / 2;
            vy = (vy + prevScroll.vy) / 2;
          }
          var direction = Math.abs(vx / vy);
          var canScroll = false;
          if (direction >= 1 && editor.renderer.isScrollableBy(ev.wheelX * ev.speed, 0))
            canScroll = true;
          if (direction <= 1 && editor.renderer.isScrollableBy(0, ev.wheelY * ev.speed))
            canScroll = true;
          if (canScroll) {
            prevScroll.allowed = t2;
          } else if (t2 - prevScroll.allowed < SCROLL_COOLDOWN_T) {
            var isSlower = Math.abs(vx) <= 1.5 * Math.abs(prevScroll.vx) && Math.abs(vy) <= 1.5 * Math.abs(prevScroll.vy);
            if (isSlower) {
              canScroll = true;
              prevScroll.allowed = t2;
            } else {
              prevScroll.allowed = 0;
            }
          }
          prevScroll.t = t2;
          prevScroll.vx = vx;
          prevScroll.vy = vy;
          if (canScroll) {
            editor.renderer.scrollBy(ev.wheelX * ev.speed, ev.wheelY * ev.speed);
            return ev.stop();
          }
        };
        return DefaultHandlers2;
      }();
      DefaultHandlers.prototype.selectEnd = DefaultHandlers.prototype.selectByLinesEnd;
      DefaultHandlers.prototype.selectAllEnd = DefaultHandlers.prototype.selectByLinesEnd;
      DefaultHandlers.prototype.selectByWordsEnd = DefaultHandlers.prototype.selectByLinesEnd;
      exports3.DefaultHandlers = DefaultHandlers;
      function calcDistance(ax, ay, bx, by) {
        return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));
      }
      function calcRangeOrientation(range, cursor) {
        if (range.start.row == range.end.row)
          var cmp = 2 * cursor.column - range.start.column - range.end.column;
        else if (range.start.row == range.end.row - 1 && !range.start.column && !range.end.column)
          var cmp = cursor.column - 4;
        else
          var cmp = 2 * cursor.row - range.start.row - range.end.row;
        if (cmp < 0)
          return { cursor: range.start, anchor: range.end };
        else
          return { cursor: range.end, anchor: range.start };
      }
    });
    ace.define("ace/tooltip", ["require", "exports", "module", "ace/lib/dom", "ace/range"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 __values = this && this.__values || function(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.");
      };
      var dom = require2("./lib/dom");
      var Range2 = require2("./range").Range;
      var CLASSNAME = "ace_tooltip";
      var Tooltip = function() {
        function Tooltip2(parentNode) {
          this.isOpen = false;
          this.$element = null;
          this.$parentNode = parentNode;
        }
        Tooltip2.prototype.$init = function() {
          this.$element = dom.createElement("div");
          this.$element.className = CLASSNAME;
          this.$element.style.display = "none";
          this.$parentNode.appendChild(this.$element);
          return this.$element;
        };
        Tooltip2.prototype.getElement = function() {
          return this.$element || this.$init();
        };
        Tooltip2.prototype.setText = function(text) {
          this.getElement().textContent = text;
        };
        Tooltip2.prototype.setHtml = function(html) {
          this.getElement().innerHTML = html;
        };
        Tooltip2.prototype.setPosition = function(x, y) {
          this.getElement().style.left = x + "px";
          this.getElement().style.top = y + "px";
        };
        Tooltip2.prototype.setClassName = function(className) {
          dom.addCssClass(this.getElement(), className);
        };
        Tooltip2.prototype.setTheme = function(theme2) {
          this.$element.className = CLASSNAME + " " + (theme2.isDark ? "ace_dark " : "") + (theme2.cssClass || "");
        };
        Tooltip2.prototype.show = function(text, x, y) {
          if (text != null)
            this.setText(text);
          if (x != null && y != null)
            this.setPosition(x, y);
          if (!this.isOpen) {
            this.getElement().style.display = "block";
            this.isOpen = true;
          }
        };
        Tooltip2.prototype.hide = function() {
          if (this.isOpen) {
            this.getElement().style.display = "none";
            this.getElement().className = CLASSNAME;
            this.isOpen = false;
          }
        };
        Tooltip2.prototype.getHeight = function() {
          return this.getElement().offsetHeight;
        };
        Tooltip2.prototype.getWidth = function() {
          return this.getElement().offsetWidth;
        };
        Tooltip2.prototype.destroy = function() {
          this.isOpen = false;
          if (this.$element && this.$element.parentNode) {
            this.$element.parentNode.removeChild(this.$element);
          }
        };
        return Tooltip2;
      }();
      var PopupManager = function() {
        function PopupManager2() {
          this.popups = [];
        }
        PopupManager2.prototype.addPopup = function(popup) {
          this.popups.push(popup);
          this.updatePopups();
        };
        PopupManager2.prototype.removePopup = function(popup) {
          var index2 = this.popups.indexOf(popup);
          if (index2 !== -1) {
            this.popups.splice(index2, 1);
            this.updatePopups();
          }
        };
        PopupManager2.prototype.updatePopups = function() {
          var e_1, _a2, e_2, _b;
          this.popups.sort(function(a, b) {
            return b.priority - a.priority;
          });
          var visiblepopups = [];
          try {
            for (var _c = __values(this.popups), _d = _c.next(); !_d.done; _d = _c.next()) {
              var popup = _d.value;
              var shouldDisplay = true;
              try {
                for (var visiblepopups_1 = (e_2 = void 0, __values(visiblepopups)), visiblepopups_1_1 = visiblepopups_1.next(); !visiblepopups_1_1.done; visiblepopups_1_1 = visiblepopups_1.next()) {
                  var visiblePopup = visiblepopups_1_1.value;
                  if (this.doPopupsOverlap(visiblePopup, popup)) {
                    shouldDisplay = false;
                    break;
                  }
                }
              } catch (e_2_1) {
                e_2 = { error: e_2_1 };
              } finally {
                try {
                  if (visiblepopups_1_1 && !visiblepopups_1_1.done && (_b = visiblepopups_1.return))
                    _b.call(visiblepopups_1);
                } finally {
                  if (e_2)
                    throw e_2.error;
                }
              }
              if (shouldDisplay) {
                visiblepopups.push(popup);
              } else {
                popup.hide();
              }
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (_d && !_d.done && (_a2 = _c.return))
                _a2.call(_c);
            } finally {
              if (e_1)
                throw e_1.error;
            }
          }
        };
        PopupManager2.prototype.doPopupsOverlap = function(popupA, popupB) {
          var rectA = popupA.getElement().getBoundingClientRect();
          var rectB = popupB.getElement().getBoundingClientRect();
          return rectA.left < rectB.right && rectA.right > rectB.left && rectA.top < rectB.bottom && rectA.bottom > rectB.top;
        };
        return PopupManager2;
      }();
      var popupManager = new PopupManager();
      exports3.popupManager = popupManager;
      exports3.Tooltip = Tooltip;
      var HoverTooltip = function(_super) {
        __extends(HoverTooltip2, _super);
        function HoverTooltip2(parentNode) {
          if (parentNode === void 0) {
            parentNode = document.body;
          }
          var _this = _super.call(this, parentNode) || this;
          _this.timeout = void 0;
          _this.lastT = 0;
          _this.idleTime = 350;
          _this.lastEvent = void 0;
          _this.onMouseOut = _this.onMouseOut.bind(_this);
          _this.onMouseMove = _this.onMouseMove.bind(_this);
          _this.waitForHover = _this.waitForHover.bind(_this);
          _this.hide = _this.hide.bind(_this);
          var el = _this.getElement();
          el.style.whiteSpace = "pre-wrap";
          el.style.pointerEvents = "auto";
          el.addEventListener("mouseout", _this.onMouseOut);
          el.tabIndex = -1;
          el.addEventListener("blur", function() {
            if (!el.contains(document.activeElement))
              this.hide();
          }.bind(_this));
          return _this;
        }
        HoverTooltip2.prototype.addToEditor = function(editor) {
          editor.on("mousemove", this.onMouseMove);
          editor.on("mousedown", this.hide);
          editor.renderer.getMouseEventTarget().addEventListener("mouseout", this.onMouseOut, true);
        };
        HoverTooltip2.prototype.removeFromEditor = function(editor) {
          editor.off("mousemove", this.onMouseMove);
          editor.off("mousedown", this.hide);
          editor.renderer.getMouseEventTarget().removeEventListener("mouseout", this.onMouseOut, true);
          if (this.timeout) {
            clearTimeout(this.timeout);
            this.timeout = null;
          }
        };
        HoverTooltip2.prototype.onMouseMove = function(e, editor) {
          this.lastEvent = e;
          this.lastT = Date.now();
          var isMousePressed = editor.$mouseHandler.isMousePressed;
          if (this.isOpen) {
            var pos = this.lastEvent && this.lastEvent.getDocumentPosition();
            if (!this.range || !this.range.contains(pos.row, pos.column) || isMousePressed || this.isOutsideOfText(this.lastEvent)) {
              this.hide();
            }
          }
          if (this.timeout || isMousePressed)
            return;
          this.lastEvent = e;
          this.timeout = setTimeout(this.waitForHover, this.idleTime);
        };
        HoverTooltip2.prototype.waitForHover = function() {
          if (this.timeout)
            clearTimeout(this.timeout);
          var dt = Date.now() - this.lastT;
          if (this.idleTime - dt > 10) {
            this.timeout = setTimeout(this.waitForHover, this.idleTime - dt);
            return;
          }
          this.timeout = null;
          if (this.lastEvent && !this.isOutsideOfText(this.lastEvent)) {
            this.$gatherData(this.lastEvent, this.lastEvent.editor);
          }
        };
        HoverTooltip2.prototype.isOutsideOfText = function(e) {
          var editor = e.editor;
          var docPos = e.getDocumentPosition();
          var line = editor.session.getLine(docPos.row);
          if (docPos.column == line.length) {
            var screenPos = editor.renderer.pixelToScreenCoordinates(e.clientX, e.clientY);
            var clippedPos = editor.session.documentToScreenPosition(docPos.row, docPos.column);
            if (clippedPos.column != screenPos.column || clippedPos.row != screenPos.row) {
              return true;
            }
          }
          return false;
        };
        HoverTooltip2.prototype.setDataProvider = function(value2) {
          this.$gatherData = value2;
        };
        HoverTooltip2.prototype.showForRange = function(editor, range, domNode, startingEvent) {
          if (startingEvent && startingEvent != this.lastEvent)
            return;
          if (this.isOpen && document.activeElement == this.getElement())
            return;
          var renderer = editor.renderer;
          if (!this.isOpen) {
            popupManager.addPopup(this);
            this.$registerCloseEvents();
            this.setTheme(renderer.theme);
          }
          this.isOpen = true;
          this.addMarker(range, editor.session);
          this.range = Range2.fromPoints(range.start, range.end);
          var element = this.getElement();
          element.innerHTML = "";
          element.appendChild(domNode);
          element.style.display = "block";
          var position = renderer.textToScreenCoordinates(range.start.row, range.start.column);
          var labelHeight = element.clientHeight;
          var rect = renderer.scroller.getBoundingClientRect();
          var isAbove = true;
          if (position.pageY - labelHeight < 0) {
            isAbove = false;
          }
          if (isAbove) {
            position.pageY -= labelHeight;
          } else {
            position.pageY += renderer.lineHeight;
          }
          element.style.maxWidth = rect.width - (position.pageX - rect.left) + "px";
          this.setPosition(position.pageX, position.pageY);
        };
        HoverTooltip2.prototype.addMarker = function(range, session) {
          if (this.marker) {
            this.$markerSession.removeMarker(this.marker);
          }
          this.$markerSession = session;
          this.marker = session && session.addMarker(range, "ace_highlight-marker", "text");
        };
        HoverTooltip2.prototype.hide = function(e) {
          if (!e && document.activeElement == this.getElement())
            return;
          if (e && e.target && (e.type != "keydown" || e.ctrlKey || e.metaKey) && this.$element.contains(e.target))
            return;
          this.lastEvent = null;
          if (this.timeout)
            clearTimeout(this.timeout);
          this.timeout = null;
          this.addMarker(null);
          if (this.isOpen) {
            this.$removeCloseEvents();
            this.getElement().style.display = "none";
            this.isOpen = false;
            popupManager.removePopup(this);
          }
        };
        HoverTooltip2.prototype.$registerCloseEvents = function() {
          window.addEventListener("keydown", this.hide, true);
          window.addEventListener("mousewheel", this.hide, true);
          window.addEventListener("mousedown", this.hide, true);
        };
        HoverTooltip2.prototype.$removeCloseEvents = function() {
          window.removeEventListener("keydown", this.hide, true);
          window.removeEventListener("mousewheel", this.hide, true);
          window.removeEventListener("mousedown", this.hide, true);
        };
        HoverTooltip2.prototype.onMouseOut = function(e) {
          if (this.timeout) {
            clearTimeout(this.timeout);
            this.timeout = null;
          }
          this.lastEvent = null;
          if (!this.isOpen)
            return;
          if (!e.relatedTarget || e.relatedTarget == this.getElement())
            return;
          if (e && e.currentTarget.contains(e.relatedTarget))
            return;
          if (!e.relatedTarget.classList.contains("ace_content"))
            this.hide();
        };
        return HoverTooltip2;
      }(Tooltip);
      exports3.HoverTooltip = HoverTooltip;
    });
    ace.define("ace/mouse/default_gutter_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/tooltip", "ace/config"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 __values = this && this.__values || function(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.");
      };
      var dom = require2("../lib/dom");
      var event = require2("../lib/event");
      var Tooltip = require2("../tooltip").Tooltip;
      var nls = require2("../config").nls;
      function GutterHandler(mouseHandler) {
        var editor = mouseHandler.editor;
        var gutter2 = editor.renderer.$gutterLayer;
        var tooltip = new GutterTooltip(editor);
        mouseHandler.editor.setDefaultHandler("guttermousedown", function(e) {
          if (!editor.isFocused() || e.getButton() != 0)
            return;
          var gutterRegion = gutter2.getRegion(e);
          if (gutterRegion == "foldWidgets")
            return;
          var row = e.getDocumentPosition().row;
          var selection = editor.session.selection;
          if (e.getShiftKey())
            selection.selectTo(row, 0);
          else {
            if (e.domEvent.detail == 2) {
              editor.selectAll();
              return e.preventDefault();
            }
            mouseHandler.$clickSelection = editor.selection.getLineRange(row);
          }
          mouseHandler.setState("selectByLines");
          mouseHandler.captureMouse(e);
          return e.preventDefault();
        });
        var tooltipTimeout, mouseEvent;
        function showTooltip2() {
          var row = mouseEvent.getDocumentPosition().row;
          var maxRow = editor.session.getLength();
          if (row == maxRow) {
            var screenRow = editor.renderer.pixelToScreenCoordinates(0, mouseEvent.y).row;
            var pos = mouseEvent.$pos;
            if (screenRow > editor.session.documentToScreenRow(pos.row, pos.column))
              return hideTooltip2();
          }
          tooltip.showTooltip(row);
          if (!tooltip.isOpen)
            return;
          editor.on("mousewheel", hideTooltip2);
          if (mouseHandler.$tooltipFollowsMouse) {
            moveTooltip(mouseEvent);
          } else {
            var gutterRow = mouseEvent.getGutterRow();
            var gutterCell = gutter2.$lines.get(gutterRow);
            if (gutterCell) {
              var gutterElement = gutterCell.element.querySelector(".ace_gutter_annotation");
              var rect = gutterElement.getBoundingClientRect();
              var style = tooltip.getElement().style;
              style.left = rect.right + "px";
              style.top = rect.bottom + "px";
            } else {
              moveTooltip(mouseEvent);
            }
          }
        }
        function hideTooltip2() {
          if (tooltipTimeout)
            tooltipTimeout = clearTimeout(tooltipTimeout);
          if (tooltip.isOpen) {
            tooltip.hideTooltip();
            editor.off("mousewheel", hideTooltip2);
          }
        }
        function moveTooltip(e) {
          tooltip.setPosition(e.x, e.y);
        }
        mouseHandler.editor.setDefaultHandler("guttermousemove", function(e) {
          var target = e.domEvent.target || e.domEvent.srcElement;
          if (dom.hasCssClass(target, "ace_fold-widget"))
            return hideTooltip2();
          if (tooltip.isOpen && mouseHandler.$tooltipFollowsMouse)
            moveTooltip(e);
          mouseEvent = e;
          if (tooltipTimeout)
            return;
          tooltipTimeout = setTimeout(function() {
            tooltipTimeout = null;
            if (mouseEvent && !mouseHandler.isMousePressed)
              showTooltip2();
            else
              hideTooltip2();
          }, 50);
        });
        event.addListener(editor.renderer.$gutter, "mouseout", function(e) {
          mouseEvent = null;
          if (!tooltip.isOpen || tooltipTimeout)
            return;
          tooltipTimeout = setTimeout(function() {
            tooltipTimeout = null;
            hideTooltip2();
          }, 50);
        }, editor);
        editor.on("changeSession", hideTooltip2);
        editor.on("input", hideTooltip2);
      }
      exports3.GutterHandler = GutterHandler;
      var GutterTooltip = function(_super) {
        __extends(GutterTooltip2, _super);
        function GutterTooltip2(editor) {
          var _this = _super.call(this, editor.container) || this;
          _this.editor = editor;
          return _this;
        }
        GutterTooltip2.prototype.setPosition = function(x, y) {
          var windowWidth = window.innerWidth || document.documentElement.clientWidth;
          var windowHeight = window.innerHeight || document.documentElement.clientHeight;
          var width = this.getWidth();
          var height = this.getHeight();
          x += 15;
          y += 15;
          if (x + width > windowWidth) {
            x -= x + width - windowWidth;
          }
          if (y + height > windowHeight) {
            y -= 20 + height;
          }
          Tooltip.prototype.setPosition.call(this, x, y);
        };
        Object.defineProperty(GutterTooltip2, "annotationLabels", {
          get: function() {
            return {
              error: { singular: nls("error"), plural: nls("errors") },
              warning: { singular: nls("warning"), plural: nls("warnings") },
              info: { singular: nls("information message"), plural: nls("information messages") }
            };
          },
          enumerable: false,
          configurable: true
        });
        GutterTooltip2.prototype.showTooltip = function(row) {
          var gutter2 = this.editor.renderer.$gutterLayer;
          var annotationsInRow = gutter2.$annotations[row];
          var annotation;
          if (annotationsInRow)
            annotation = { text: Array.from(annotationsInRow.text), type: Array.from(annotationsInRow.type) };
          else
            annotation = { text: [], type: [] };
          var fold = gutter2.session.getFoldLine(row);
          if (fold && gutter2.$showFoldedAnnotations) {
            var annotationsInFold = { error: [], warning: [], info: [] };
            var mostSevereAnnotationInFoldType;
            for (var i2 = row + 1; i2 <= fold.end.row; i2++) {
              if (!gutter2.$annotations[i2])
                continue;
              for (var j = 0; j < gutter2.$annotations[i2].text.length; j++) {
                var annotationType = gutter2.$annotations[i2].type[j];
                annotationsInFold[annotationType].push(gutter2.$annotations[i2].text[j]);
                if (annotationType === "error") {
                  mostSevereAnnotationInFoldType = "error_fold";
                  continue;
                }
                if (annotationType === "warning") {
                  mostSevereAnnotationInFoldType = "warning_fold";
                  continue;
                }
              }
            }
            if (mostSevereAnnotationInFoldType === "error_fold" || mostSevereAnnotationInFoldType === "warning_fold") {
              var summaryFoldedAnnotations = "".concat(GutterTooltip2.annotationsToSummaryString(annotationsInFold), " in folded code.");
              annotation.text.push(summaryFoldedAnnotations);
              annotation.type.push(mostSevereAnnotationInFoldType);
            }
          }
          if (annotation.text.length === 0)
            return this.hide();
          var annotationMessages = { error: [], warning: [], info: [] };
          var iconClassName = gutter2.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon";
          for (var i2 = 0; i2 < annotation.text.length; i2++) {
            var line = "<span class='ace_".concat(annotation.type[i2], " ").concat(iconClassName, "' aria-label='").concat(GutterTooltip2.annotationLabels[annotation.type[i2].replace("_fold", "")].singular, "' role=img> </span> ").concat(annotation.text[i2]);
            annotationMessages[annotation.type[i2].replace("_fold", "")].push(line);
          }
          var tooltipContent = [].concat(annotationMessages.error, annotationMessages.warning, annotationMessages.info).join("<br>");
          this.setHtml(tooltipContent);
          this.$element.setAttribute("aria-live", "polite");
          if (!this.isOpen) {
            this.setTheme(this.editor.renderer.theme);
            this.setClassName("ace_gutter-tooltip");
          }
          this.show();
          this.editor._signal("showGutterTooltip", this);
        };
        GutterTooltip2.prototype.hideTooltip = function() {
          this.$element.removeAttribute("aria-live");
          this.hide();
          this.editor._signal("hideGutterTooltip", this);
        };
        GutterTooltip2.annotationsToSummaryString = function(annotations) {
          var e_1, _a2;
          var summary = [];
          var annotationTypes = ["error", "warning", "info"];
          try {
            for (var annotationTypes_1 = __values(annotationTypes), annotationTypes_1_1 = annotationTypes_1.next(); !annotationTypes_1_1.done; annotationTypes_1_1 = annotationTypes_1.next()) {
              var annotationType = annotationTypes_1_1.value;
              if (!annotations[annotationType].length)
                continue;
              var label = annotations[annotationType].length === 1 ? GutterTooltip2.annotationLabels[annotationType].singular : GutterTooltip2.annotationLabels[annotationType].plural;
              summary.push("".concat(annotations[annotationType].length, " ").concat(label));
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (annotationTypes_1_1 && !annotationTypes_1_1.done && (_a2 = annotationTypes_1.return))
                _a2.call(annotationTypes_1);
            } finally {
              if (e_1)
                throw e_1.error;
            }
          }
          return summary.join(", ");
        };
        return GutterTooltip2;
      }(Tooltip);
      exports3.GutterTooltip = GutterTooltip;
    });
    ace.define("ace/mouse/mouse_event", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function(require2, exports3, module3) {
      var event = require2("../lib/event");
      var useragent = require2("../lib/useragent");
      var MouseEvent2 = function() {
        function MouseEvent3(domEvent, editor) {
          this.domEvent = domEvent;
          this.editor = editor;
          this.x = this.clientX = domEvent.clientX;
          this.y = this.clientY = domEvent.clientY;
          this.$pos = null;
          this.$inSelection = null;
          this.propagationStopped = false;
          this.defaultPrevented = false;
        }
        MouseEvent3.prototype.stopPropagation = function() {
          event.stopPropagation(this.domEvent);
          this.propagationStopped = true;
        };
        MouseEvent3.prototype.preventDefault = function() {
          event.preventDefault(this.domEvent);
          this.defaultPrevented = true;
        };
        MouseEvent3.prototype.stop = function() {
          this.stopPropagation();
          this.preventDefault();
        };
        MouseEvent3.prototype.getDocumentPosition = function() {
          if (this.$pos)
            return this.$pos;
          this.$pos = this.editor.renderer.screenToTextCoordinates(this.clientX, this.clientY);
          return this.$pos;
        };
        MouseEvent3.prototype.getGutterRow = function() {
          var documentRow = this.getDocumentPosition().row;
          var screenRow = this.editor.session.documentToScreenRow(documentRow, 0);
          var screenTopRow = this.editor.session.documentToScreenRow(this.editor.renderer.$gutterLayer.$lines.get(0).row, 0);
          return screenRow - screenTopRow;
        };
        MouseEvent3.prototype.inSelection = function() {
          if (this.$inSelection !== null)
            return this.$inSelection;
          var editor = this.editor;
          var selectionRange = editor.getSelectionRange();
          if (selectionRange.isEmpty())
            this.$inSelection = false;
          else {
            var pos = this.getDocumentPosition();
            this.$inSelection = selectionRange.contains(pos.row, pos.column);
          }
          return this.$inSelection;
        };
        MouseEvent3.prototype.getButton = function() {
          return event.getButton(this.domEvent);
        };
        MouseEvent3.prototype.getShiftKey = function() {
          return this.domEvent.shiftKey;
        };
        MouseEvent3.prototype.getAccelKey = function() {
          return useragent.isMac ? this.domEvent.metaKey : this.domEvent.ctrlKey;
        };
        return MouseEvent3;
      }();
      exports3.MouseEvent = MouseEvent2;
    });
    ace.define("ace/mouse/dragdrop_handler", ["require", "exports", "module", "ace/lib/dom", "ace/lib/event", "ace/lib/useragent"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var event = require2("../lib/event");
      var useragent = require2("../lib/useragent");
      var AUTOSCROLL_DELAY = 200;
      var SCROLL_CURSOR_DELAY = 200;
      var SCROLL_CURSOR_HYSTERESIS = 5;
      function DragdropHandler(mouseHandler) {
        var editor = mouseHandler.editor;
        var dragImage = dom.createElement("div");
        dragImage.style.cssText = "top:-100px;position:absolute;z-index:2147483647;opacity:0.5";
        dragImage.textContent = "\xA0";
        var exports4 = ["dragWait", "dragWaitEnd", "startDrag", "dragReadyEnd", "onMouseDrag"];
        exports4.forEach(function(x2) {
          mouseHandler[x2] = this[x2];
        }, this);
        editor.on("mousedown", this.onMouseDown.bind(mouseHandler));
        var mouseTarget = editor.container;
        var dragSelectionMarker, x, y;
        var timerId, range;
        var dragCursor, counter = 0;
        var dragOperation;
        var isInternal;
        var autoScrollStartTime;
        var cursorMovedTime;
        var cursorPointOnCaretMoved;
        this.onDragStart = function(e) {
          if (this.cancelDrag || !mouseTarget.draggable) {
            var self2 = this;
            setTimeout(function() {
              self2.startSelect();
              self2.captureMouse(e);
            }, 0);
            return e.preventDefault();
          }
          range = editor.getSelectionRange();
          var dataTransfer = e.dataTransfer;
          dataTransfer.effectAllowed = editor.getReadOnly() ? "copy" : "copyMove";
          editor.container.appendChild(dragImage);
          dataTransfer.setDragImage && dataTransfer.setDragImage(dragImage, 0, 0);
          setTimeout(function() {
            editor.container.removeChild(dragImage);
          });
          dataTransfer.clearData();
          dataTransfer.setData("Text", editor.session.getTextRange());
          isInternal = true;
          this.setState("drag");
        };
        this.onDragEnd = function(e) {
          mouseTarget.draggable = false;
          isInternal = false;
          this.setState(null);
          if (!editor.getReadOnly()) {
            var dropEffect = e.dataTransfer.dropEffect;
            if (!dragOperation && dropEffect == "move")
              editor.session.remove(editor.getSelectionRange());
            editor.$resetCursorStyle();
          }
          this.editor.unsetStyle("ace_dragging");
          this.editor.renderer.setCursorStyle("");
        };
        this.onDragEnter = function(e) {
          if (editor.getReadOnly() || !canAccept(e.dataTransfer))
            return;
          x = e.clientX;
          y = e.clientY;
          if (!dragSelectionMarker)
            addDragMarker();
          counter++;
          e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);
          return event.preventDefault(e);
        };
        this.onDragOver = function(e) {
          if (editor.getReadOnly() || !canAccept(e.dataTransfer))
            return;
          x = e.clientX;
          y = e.clientY;
          if (!dragSelectionMarker) {
            addDragMarker();
            counter++;
          }
          if (onMouseMoveTimer !== null)
            onMouseMoveTimer = null;
          e.dataTransfer.dropEffect = dragOperation = getDropEffect(e);
          return event.preventDefault(e);
        };
        this.onDragLeave = function(e) {
          counter--;
          if (counter <= 0 && dragSelectionMarker) {
            clearDragMarker();
            dragOperation = null;
            return event.preventDefault(e);
          }
        };
        this.onDrop = function(e) {
          if (!dragCursor)
            return;
          var dataTransfer = e.dataTransfer;
          if (isInternal) {
            switch (dragOperation) {
              case "move":
                if (range.contains(dragCursor.row, dragCursor.column)) {
                  range = {
                    start: dragCursor,
                    end: dragCursor
                  };
                } else {
                  range = editor.moveText(range, dragCursor);
                }
                break;
              case "copy":
                range = editor.moveText(range, dragCursor, true);
                break;
            }
          } else {
            var dropData = dataTransfer.getData("Text");
            range = {
              start: dragCursor,
              end: editor.session.insert(dragCursor, dropData)
            };
            editor.focus();
            dragOperation = null;
          }
          clearDragMarker();
          return event.preventDefault(e);
        };
        event.addListener(mouseTarget, "dragstart", this.onDragStart.bind(mouseHandler), editor);
        event.addListener(mouseTarget, "dragend", this.onDragEnd.bind(mouseHandler), editor);
        event.addListener(mouseTarget, "dragenter", this.onDragEnter.bind(mouseHandler), editor);
        event.addListener(mouseTarget, "dragover", this.onDragOver.bind(mouseHandler), editor);
        event.addListener(mouseTarget, "dragleave", this.onDragLeave.bind(mouseHandler), editor);
        event.addListener(mouseTarget, "drop", this.onDrop.bind(mouseHandler), editor);
        function scrollCursorIntoView(cursor, prevCursor) {
          var now = Date.now();
          var vMovement = !prevCursor || cursor.row != prevCursor.row;
          var hMovement = !prevCursor || cursor.column != prevCursor.column;
          if (!cursorMovedTime || vMovement || hMovement) {
            editor.moveCursorToPosition(cursor);
            cursorMovedTime = now;
            cursorPointOnCaretMoved = { x, y };
          } else {
            var distance = calcDistance(cursorPointOnCaretMoved.x, cursorPointOnCaretMoved.y, x, y);
            if (distance > SCROLL_CURSOR_HYSTERESIS) {
              cursorMovedTime = null;
            } else if (now - cursorMovedTime >= SCROLL_CURSOR_DELAY) {
              editor.renderer.scrollCursorIntoView();
              cursorMovedTime = null;
            }
          }
        }
        function autoScroll2(cursor, prevCursor) {
          var now = Date.now();
          var lineHeight = editor.renderer.layerConfig.lineHeight;
          var characterWidth = editor.renderer.layerConfig.characterWidth;
          var editorRect = editor.renderer.scroller.getBoundingClientRect();
          var offsets = {
            x: {
              left: x - editorRect.left,
              right: editorRect.right - x
            },
            y: {
              top: y - editorRect.top,
              bottom: editorRect.bottom - y
            }
          };
          var nearestXOffset = Math.min(offsets.x.left, offsets.x.right);
          var nearestYOffset = Math.min(offsets.y.top, offsets.y.bottom);
          var scrollCursor = { row: cursor.row, column: cursor.column };
          if (nearestXOffset / characterWidth <= 2) {
            scrollCursor.column += offsets.x.left < offsets.x.right ? -3 : 2;
          }
          if (nearestYOffset / lineHeight <= 1) {
            scrollCursor.row += offsets.y.top < offsets.y.bottom ? -1 : 1;
          }
          var vScroll = cursor.row != scrollCursor.row;
          var hScroll = cursor.column != scrollCursor.column;
          var vMovement = !prevCursor || cursor.row != prevCursor.row;
          if (vScroll || hScroll && !vMovement) {
            if (!autoScrollStartTime)
              autoScrollStartTime = now;
            else if (now - autoScrollStartTime >= AUTOSCROLL_DELAY)
              editor.renderer.scrollCursorIntoView(scrollCursor);
          } else {
            autoScrollStartTime = null;
          }
        }
        function onDragInterval() {
          var prevCursor = dragCursor;
          dragCursor = editor.renderer.screenToTextCoordinates(x, y);
          scrollCursorIntoView(dragCursor, prevCursor);
          autoScroll2(dragCursor, prevCursor);
        }
        function addDragMarker() {
          range = editor.selection.toOrientedRange();
          dragSelectionMarker = editor.session.addMarker(range, "ace_selection", editor.getSelectionStyle());
          editor.clearSelection();
          if (editor.isFocused())
            editor.renderer.$cursorLayer.setBlinking(false);
          clearInterval(timerId);
          onDragInterval();
          timerId = setInterval(onDragInterval, 20);
          counter = 0;
          event.addListener(document, "mousemove", onMouseMove);
        }
        function clearDragMarker() {
          clearInterval(timerId);
          editor.session.removeMarker(dragSelectionMarker);
          dragSelectionMarker = null;
          editor.selection.fromOrientedRange(range);
          if (editor.isFocused() && !isInternal)
            editor.$resetCursorStyle();
          range = null;
          dragCursor = null;
          counter = 0;
          autoScrollStartTime = null;
          cursorMovedTime = null;
          event.removeListener(document, "mousemove", onMouseMove);
        }
        var onMouseMoveTimer = null;
        function onMouseMove() {
          if (onMouseMoveTimer == null) {
            onMouseMoveTimer = setTimeout(function() {
              if (onMouseMoveTimer != null && dragSelectionMarker)
                clearDragMarker();
            }, 20);
          }
        }
        function canAccept(dataTransfer) {
          var types2 = dataTransfer.types;
          return !types2 || Array.prototype.some.call(types2, function(type) {
            return type == "text/plain" || type == "Text";
          });
        }
        function getDropEffect(e) {
          var copyAllowed = ["copy", "copymove", "all", "uninitialized"];
          var moveAllowed = ["move", "copymove", "linkmove", "all", "uninitialized"];
          var copyModifierState = useragent.isMac ? e.altKey : e.ctrlKey;
          var effectAllowed = "uninitialized";
          try {
            effectAllowed = e.dataTransfer.effectAllowed.toLowerCase();
          } catch (e2) {
          }
          var dropEffect = "none";
          if (copyModifierState && copyAllowed.indexOf(effectAllowed) >= 0)
            dropEffect = "copy";
          else if (moveAllowed.indexOf(effectAllowed) >= 0)
            dropEffect = "move";
          else if (copyAllowed.indexOf(effectAllowed) >= 0)
            dropEffect = "copy";
          return dropEffect;
        }
      }
      (function() {
        this.dragWait = function() {
          var interval = Date.now() - this.mousedownEvent.time;
          if (interval > this.editor.getDragDelay())
            this.startDrag();
        };
        this.dragWaitEnd = function() {
          var target = this.editor.container;
          target.draggable = false;
          this.startSelect(this.mousedownEvent.getDocumentPosition());
          this.selectEnd();
        };
        this.dragReadyEnd = function(e) {
          this.editor.$resetCursorStyle();
          this.editor.unsetStyle("ace_dragging");
          this.editor.renderer.setCursorStyle("");
          this.dragWaitEnd();
        };
        this.startDrag = function() {
          this.cancelDrag = false;
          var editor = this.editor;
          var target = editor.container;
          target.draggable = true;
          editor.renderer.$cursorLayer.setBlinking(false);
          editor.setStyle("ace_dragging");
          var cursorStyle = useragent.isWin ? "default" : "move";
          editor.renderer.setCursorStyle(cursorStyle);
          this.setState("dragReady");
        };
        this.onMouseDrag = function(e) {
          var target = this.editor.container;
          if (useragent.isIE && this.state == "dragReady") {
            var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
            if (distance > 3)
              target.dragDrop();
          }
          if (this.state === "dragWait") {
            var distance = calcDistance(this.mousedownEvent.x, this.mousedownEvent.y, this.x, this.y);
            if (distance > 0) {
              target.draggable = false;
              this.startSelect(this.mousedownEvent.getDocumentPosition());
            }
          }
        };
        this.onMouseDown = function(e) {
          if (!this.$dragEnabled)
            return;
          this.mousedownEvent = e;
          var editor = this.editor;
          var inSelection = e.inSelection();
          var button = e.getButton();
          var clickCount = e.domEvent.detail || 1;
          if (clickCount === 1 && button === 0 && inSelection) {
            if (e.editor.inMultiSelectMode && (e.getAccelKey() || e.getShiftKey()))
              return;
            this.mousedownEvent.time = Date.now();
            var eventTarget = e.domEvent.target || e.domEvent.srcElement;
            if ("unselectable" in eventTarget)
              eventTarget.unselectable = "on";
            if (editor.getDragDelay()) {
              if (useragent.isWebKit) {
                this.cancelDrag = true;
                var mouseTarget = editor.container;
                mouseTarget.draggable = true;
              }
              this.setState("dragWait");
            } else {
              this.startDrag();
            }
            this.captureMouse(e, this.onMouseDrag.bind(this));
            e.defaultPrevented = true;
          }
        };
      }).call(DragdropHandler.prototype);
      function calcDistance(ax, ay, bx, by) {
        return Math.sqrt(Math.pow(bx - ax, 2) + Math.pow(by - ay, 2));
      }
      exports3.DragdropHandler = DragdropHandler;
    });
    ace.define("ace/mouse/touch_handler", ["require", "exports", "module", "ace/mouse/mouse_event", "ace/lib/event", "ace/lib/dom"], function(require2, exports3, module3) {
      var MouseEvent2 = require2("./mouse_event").MouseEvent;
      var event = require2("../lib/event");
      var dom = require2("../lib/dom");
      exports3.addTouchListeners = function(el, editor) {
        var mode = "scroll";
        var startX;
        var startY;
        var touchStartT;
        var lastT;
        var longTouchTimer;
        var animationTimer;
        var animationSteps = 0;
        var pos;
        var clickCount = 0;
        var vX = 0;
        var vY = 0;
        var pressed;
        var contextMenu;
        function createContextMenu() {
          var clipboard2 = window.navigator && window.navigator.clipboard;
          var isOpen = false;
          var updateMenu = function() {
            var selected = editor.getCopyText();
            var hasUndo = editor.session.getUndoManager().hasUndo();
            contextMenu.replaceChild(dom.buildDom(isOpen ? [
              "span",
              !selected && ["span", { class: "ace_mobile-button", action: "selectall" }, "Select All"],
              selected && ["span", { class: "ace_mobile-button", action: "copy" }, "Copy"],
              selected && ["span", { class: "ace_mobile-button", action: "cut" }, "Cut"],
              clipboard2 && ["span", { class: "ace_mobile-button", action: "paste" }, "Paste"],
              hasUndo && ["span", { class: "ace_mobile-button", action: "undo" }, "Undo"],
              ["span", { class: "ace_mobile-button", action: "find" }, "Find"],
              ["span", { class: "ace_mobile-button", action: "openCommandPalette" }, "Palette"]
            ] : ["span"]), contextMenu.firstChild);
          };
          var handleClick = function(e) {
            var action = e.target.getAttribute("action");
            if (action == "more" || !isOpen) {
              isOpen = !isOpen;
              return updateMenu();
            }
            if (action == "paste") {
              clipboard2.readText().then(function(text) {
                editor.execCommand(action, text);
              });
            } else if (action) {
              if (action == "cut" || action == "copy") {
                if (clipboard2)
                  clipboard2.writeText(editor.getCopyText());
                else
                  document.execCommand("copy");
              }
              editor.execCommand(action);
            }
            contextMenu.firstChild.style.display = "none";
            isOpen = false;
            if (action != "openCommandPalette")
              editor.focus();
          };
          contextMenu = dom.buildDom([
            "div",
            {
              class: "ace_mobile-menu",
              ontouchstart: function(e) {
                mode = "menu";
                e.stopPropagation();
                e.preventDefault();
                editor.textInput.focus();
              },
              ontouchend: function(e) {
                e.stopPropagation();
                e.preventDefault();
                handleClick(e);
              },
              onclick: handleClick
            },
            ["span"],
            ["span", { class: "ace_mobile-button", action: "more" }, "..."]
          ], editor.container);
        }
        function showContextMenu() {
          if (!contextMenu)
            createContextMenu();
          var cursor = editor.selection.cursor;
          var pagePos = editor.renderer.textToScreenCoordinates(cursor.row, cursor.column);
          var leftOffset = editor.renderer.textToScreenCoordinates(0, 0).pageX;
          var scrollLeft = editor.renderer.scrollLeft;
          var rect = editor.container.getBoundingClientRect();
          contextMenu.style.top = pagePos.pageY - rect.top - 3 + "px";
          if (pagePos.pageX - rect.left < rect.width - 70) {
            contextMenu.style.left = "";
            contextMenu.style.right = "10px";
          } else {
            contextMenu.style.right = "";
            contextMenu.style.left = leftOffset + scrollLeft - rect.left + "px";
          }
          contextMenu.style.display = "";
          contextMenu.firstChild.style.display = "none";
          editor.on("input", hideContextMenu);
        }
        function hideContextMenu(e) {
          if (contextMenu)
            contextMenu.style.display = "none";
          editor.off("input", hideContextMenu);
        }
        function handleLongTap() {
          longTouchTimer = null;
          clearTimeout(longTouchTimer);
          var range = editor.selection.getRange();
          var inSelection = range.contains(pos.row, pos.column);
          if (range.isEmpty() || !inSelection) {
            editor.selection.moveToPosition(pos);
            editor.selection.selectWord();
          }
          mode = "wait";
          showContextMenu();
        }
        function switchToSelectionMode() {
          longTouchTimer = null;
          clearTimeout(longTouchTimer);
          editor.selection.moveToPosition(pos);
          var range = clickCount >= 2 ? editor.selection.getLineRange(pos.row) : editor.session.getBracketRange(pos);
          if (range && !range.isEmpty()) {
            editor.selection.setRange(range);
          } else {
            editor.selection.selectWord();
          }
          mode = "wait";
        }
        event.addListener(el, "contextmenu", function(e) {
          if (!pressed)
            return;
          var textarea = editor.textInput.getElement();
          textarea.focus();
        }, editor);
        event.addListener(el, "touchstart", function(e) {
          var touches = e.touches;
          if (longTouchTimer || touches.length > 1) {
            clearTimeout(longTouchTimer);
            longTouchTimer = null;
            touchStartT = -1;
            mode = "zoom";
            return;
          }
          pressed = editor.$mouseHandler.isMousePressed = true;
          var h = editor.renderer.layerConfig.lineHeight;
          var w = editor.renderer.layerConfig.lineHeight;
          var t2 = e.timeStamp;
          lastT = t2;
          var touchObj = touches[0];
          var x = touchObj.clientX;
          var y = touchObj.clientY;
          if (Math.abs(startX - x) + Math.abs(startY - y) > h)
            touchStartT = -1;
          startX = e.clientX = x;
          startY = e.clientY = y;
          vX = vY = 0;
          var ev = new MouseEvent2(e, editor);
          pos = ev.getDocumentPosition();
          if (t2 - touchStartT < 500 && touches.length == 1 && !animationSteps) {
            clickCount++;
            e.preventDefault();
            e.button = 0;
            switchToSelectionMode();
          } else {
            clickCount = 0;
            var cursor = editor.selection.cursor;
            var anchor = editor.selection.isEmpty() ? cursor : editor.selection.anchor;
            var cursorPos = editor.renderer.$cursorLayer.getPixelPosition(cursor, true);
            var anchorPos = editor.renderer.$cursorLayer.getPixelPosition(anchor, true);
            var rect = editor.renderer.scroller.getBoundingClientRect();
            var offsetTop = editor.renderer.layerConfig.offset;
            var offsetLeft = editor.renderer.scrollLeft;
            var weightedDistance = function(x2, y2) {
              x2 = x2 / w;
              y2 = y2 / h - 0.75;
              return x2 * x2 + y2 * y2;
            };
            if (e.clientX < rect.left) {
              mode = "zoom";
              return;
            }
            var diff1 = weightedDistance(e.clientX - rect.left - cursorPos.left + offsetLeft, e.clientY - rect.top - cursorPos.top + offsetTop);
            var diff2 = weightedDistance(e.clientX - rect.left - anchorPos.left + offsetLeft, e.clientY - rect.top - anchorPos.top + offsetTop);
            if (diff1 < 3.5 && diff2 < 3.5)
              mode = diff1 > diff2 ? "cursor" : "anchor";
            if (diff2 < 3.5)
              mode = "anchor";
            else if (diff1 < 3.5)
              mode = "cursor";
            else
              mode = "scroll";
            longTouchTimer = setTimeout(handleLongTap, 450);
          }
          touchStartT = t2;
        }, editor);
        event.addListener(el, "touchend", function(e) {
          pressed = editor.$mouseHandler.isMousePressed = false;
          if (animationTimer)
            clearInterval(animationTimer);
          if (mode == "zoom") {
            mode = "";
            animationSteps = 0;
          } else if (longTouchTimer) {
            editor.selection.moveToPosition(pos);
            animationSteps = 0;
            showContextMenu();
          } else if (mode == "scroll") {
            animate();
            hideContextMenu();
          } else {
            showContextMenu();
          }
          clearTimeout(longTouchTimer);
          longTouchTimer = null;
        }, editor);
        event.addListener(el, "touchmove", function(e) {
          if (longTouchTimer) {
            clearTimeout(longTouchTimer);
            longTouchTimer = null;
          }
          var touches = e.touches;
          if (touches.length > 1 || mode == "zoom")
            return;
          var touchObj = touches[0];
          var wheelX = startX - touchObj.clientX;
          var wheelY = startY - touchObj.clientY;
          if (mode == "wait") {
            if (wheelX * wheelX + wheelY * wheelY > 4)
              mode = "cursor";
            else
              return e.preventDefault();
          }
          startX = touchObj.clientX;
          startY = touchObj.clientY;
          e.clientX = touchObj.clientX;
          e.clientY = touchObj.clientY;
          var t2 = e.timeStamp;
          var dt = t2 - lastT;
          lastT = t2;
          if (mode == "scroll") {
            var mouseEvent = new MouseEvent2(e, editor);
            mouseEvent.speed = 1;
            mouseEvent.wheelX = wheelX;
            mouseEvent.wheelY = wheelY;
            if (10 * Math.abs(wheelX) < Math.abs(wheelY))
              wheelX = 0;
            if (10 * Math.abs(wheelY) < Math.abs(wheelX))
              wheelY = 0;
            if (dt != 0) {
              vX = wheelX / dt;
              vY = wheelY / dt;
            }
            editor._emit("mousewheel", mouseEvent);
            if (!mouseEvent.propagationStopped) {
              vX = vY = 0;
            }
          } else {
            var ev = new MouseEvent2(e, editor);
            var pos2 = ev.getDocumentPosition();
            if (mode == "cursor")
              editor.selection.moveCursorToPosition(pos2);
            else if (mode == "anchor")
              editor.selection.setSelectionAnchor(pos2.row, pos2.column);
            editor.renderer.scrollCursorIntoView(pos2);
            e.preventDefault();
          }
        }, editor);
        function animate() {
          animationSteps += 60;
          animationTimer = setInterval(function() {
            if (animationSteps-- <= 0) {
              clearInterval(animationTimer);
              animationTimer = null;
            }
            if (Math.abs(vX) < 0.01)
              vX = 0;
            if (Math.abs(vY) < 0.01)
              vY = 0;
            if (animationSteps < 20)
              vX = 0.9 * vX;
            if (animationSteps < 20)
              vY = 0.9 * vY;
            var oldScrollTop = editor.session.getScrollTop();
            editor.renderer.scrollBy(10 * vX, 10 * vY);
            if (oldScrollTop == editor.session.getScrollTop())
              animationSteps = 0;
          }, 10);
        }
      };
    });
    ace.define("ace/mouse/mouse_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent", "ace/mouse/default_handlers", "ace/mouse/default_gutter_handler", "ace/mouse/mouse_event", "ace/mouse/dragdrop_handler", "ace/mouse/touch_handler", "ace/config"], function(require2, exports3, module3) {
      var event = require2("../lib/event");
      var useragent = require2("../lib/useragent");
      var DefaultHandlers = require2("./default_handlers").DefaultHandlers;
      var DefaultGutterHandler = require2("./default_gutter_handler").GutterHandler;
      var MouseEvent2 = require2("./mouse_event").MouseEvent;
      var DragdropHandler = require2("./dragdrop_handler").DragdropHandler;
      var addTouchListeners = require2("./touch_handler").addTouchListeners;
      var config2 = require2("../config");
      var MouseHandler = function() {
        function MouseHandler2(editor) {
          var _self = this;
          this.editor = editor;
          new DefaultHandlers(this);
          new DefaultGutterHandler(this);
          new DragdropHandler(this);
          var focusEditor = function(e) {
            var windowBlurred = !document.hasFocus || !document.hasFocus() || !editor.isFocused() && document.activeElement == (editor.textInput && editor.textInput.getElement());
            if (windowBlurred)
              window.focus();
            editor.focus();
            setTimeout(function() {
              if (!editor.isFocused())
                editor.focus();
            });
          };
          var mouseTarget = editor.renderer.getMouseEventTarget();
          event.addListener(mouseTarget, "click", this.onMouseEvent.bind(this, "click"), editor);
          event.addListener(mouseTarget, "mousemove", this.onMouseMove.bind(this, "mousemove"), editor);
          event.addMultiMouseDownListener([
            mouseTarget,
            editor.renderer.scrollBarV && editor.renderer.scrollBarV.inner,
            editor.renderer.scrollBarH && editor.renderer.scrollBarH.inner,
            editor.textInput && editor.textInput.getElement()
          ].filter(Boolean), [400, 300, 250], this, "onMouseEvent", editor);
          event.addMouseWheelListener(editor.container, this.onMouseWheel.bind(this, "mousewheel"), editor);
          addTouchListeners(editor.container, editor);
          var gutterEl = editor.renderer.$gutter;
          event.addListener(gutterEl, "mousedown", this.onMouseEvent.bind(this, "guttermousedown"), editor);
          event.addListener(gutterEl, "click", this.onMouseEvent.bind(this, "gutterclick"), editor);
          event.addListener(gutterEl, "dblclick", this.onMouseEvent.bind(this, "gutterdblclick"), editor);
          event.addListener(gutterEl, "mousemove", this.onMouseEvent.bind(this, "guttermousemove"), editor);
          event.addListener(mouseTarget, "mousedown", focusEditor, editor);
          event.addListener(gutterEl, "mousedown", focusEditor, editor);
          if (useragent.isIE && editor.renderer.scrollBarV) {
            event.addListener(editor.renderer.scrollBarV.element, "mousedown", focusEditor, editor);
            event.addListener(editor.renderer.scrollBarH.element, "mousedown", focusEditor, editor);
          }
          editor.on("mousemove", function(e) {
            if (_self.state || _self.$dragDelay || !_self.$dragEnabled)
              return;
            var character = editor.renderer.screenToTextCoordinates(e.x, e.y);
            var range = editor.session.selection.getRange();
            var renderer = editor.renderer;
            if (!range.isEmpty() && range.insideStart(character.row, character.column)) {
              renderer.setCursorStyle("default");
            } else {
              renderer.setCursorStyle("");
            }
          }, editor);
        }
        MouseHandler2.prototype.onMouseEvent = function(name2, e) {
          if (!this.editor.session)
            return;
          this.editor._emit(name2, new MouseEvent2(e, this.editor));
        };
        MouseHandler2.prototype.onMouseMove = function(name2, e) {
          var listeners = this.editor._eventRegistry && this.editor._eventRegistry.mousemove;
          if (!listeners || !listeners.length)
            return;
          this.editor._emit(name2, new MouseEvent2(e, this.editor));
        };
        MouseHandler2.prototype.onMouseWheel = function(name2, e) {
          var mouseEvent = new MouseEvent2(e, this.editor);
          mouseEvent.speed = this.$scrollSpeed * 2;
          mouseEvent.wheelX = e.wheelX;
          mouseEvent.wheelY = e.wheelY;
          this.editor._emit(name2, mouseEvent);
        };
        MouseHandler2.prototype.setState = function(state) {
          this.state = state;
        };
        MouseHandler2.prototype.captureMouse = function(ev, mouseMoveHandler) {
          this.x = ev.x;
          this.y = ev.y;
          this.isMousePressed = true;
          var editor = this.editor;
          var renderer = this.editor.renderer;
          renderer.$isMousePressed = true;
          var self2 = this;
          var onMouseMove = function(e) {
            if (!e)
              return;
            if (useragent.isWebKit && !e.which && self2.releaseMouse)
              return self2.releaseMouse();
            self2.x = e.clientX;
            self2.y = e.clientY;
            mouseMoveHandler && mouseMoveHandler(e);
            self2.mouseEvent = new MouseEvent2(e, self2.editor);
            self2.$mouseMoved = true;
          };
          var onCaptureEnd = function(e) {
            editor.off("beforeEndOperation", onOperationEnd);
            clearInterval(timerId);
            if (editor.session)
              onCaptureInterval();
            self2[self2.state + "End"] && self2[self2.state + "End"](e);
            self2.state = "";
            self2.isMousePressed = renderer.$isMousePressed = false;
            if (renderer.$keepTextAreaAtCursor)
              renderer.$moveTextAreaToCursor();
            self2.$onCaptureMouseMove = self2.releaseMouse = null;
            e && self2.onMouseEvent("mouseup", e);
            editor.endOperation();
          };
          var onCaptureInterval = function() {
            self2[self2.state] && self2[self2.state]();
            self2.$mouseMoved = false;
          };
          if (useragent.isOldIE && ev.domEvent.type == "dblclick") {
            return setTimeout(function() {
              onCaptureEnd(ev);
            });
          }
          var onOperationEnd = function(e) {
            if (!self2.releaseMouse)
              return;
            if (editor.curOp.command.name && editor.curOp.selectionChanged) {
              self2[self2.state + "End"] && self2[self2.state + "End"]();
              self2.state = "";
              self2.releaseMouse();
            }
          };
          editor.on("beforeEndOperation", onOperationEnd);
          editor.startOperation({ command: { name: "mouse" } });
          self2.$onCaptureMouseMove = onMouseMove;
          self2.releaseMouse = event.capture(this.editor.container, onMouseMove, onCaptureEnd);
          var timerId = setInterval(onCaptureInterval, 20);
        };
        MouseHandler2.prototype.cancelContextMenu = function() {
          var stop = function(e) {
            if (e && e.domEvent && e.domEvent.type != "contextmenu")
              return;
            this.editor.off("nativecontextmenu", stop);
            if (e && e.domEvent)
              event.stopEvent(e.domEvent);
          }.bind(this);
          setTimeout(stop, 10);
          this.editor.on("nativecontextmenu", stop);
        };
        MouseHandler2.prototype.destroy = function() {
          if (this.releaseMouse)
            this.releaseMouse();
        };
        return MouseHandler2;
      }();
      MouseHandler.prototype.releaseMouse = null;
      config2.defineOptions(MouseHandler.prototype, "mouseHandler", {
        scrollSpeed: { initialValue: 2 },
        dragDelay: { initialValue: useragent.isMac ? 150 : 0 },
        dragEnabled: { initialValue: true },
        focusTimeout: { initialValue: 0 },
        tooltipFollowsMouse: { initialValue: true }
      });
      exports3.MouseHandler = MouseHandler;
    });
    ace.define("ace/mouse/fold_handler", ["require", "exports", "module", "ace/lib/dom"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var FoldHandler = function() {
        function FoldHandler2(editor) {
          editor.on("click", function(e) {
            var position = e.getDocumentPosition();
            var session = editor.session;
            var fold = session.getFoldAt(position.row, position.column, 1);
            if (fold) {
              if (e.getAccelKey())
                session.removeFold(fold);
              else
                session.expandFold(fold);
              e.stop();
            }
            var target = e.domEvent && e.domEvent.target;
            if (target && dom.hasCssClass(target, "ace_inline_button")) {
              if (dom.hasCssClass(target, "ace_toggle_wrap")) {
                session.setOption("wrap", !session.getUseWrapMode());
                editor.renderer.scrollCursorIntoView();
              }
            }
          });
          editor.on("gutterclick", function(e) {
            var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);
            if (gutterRegion == "foldWidgets") {
              var row = e.getDocumentPosition().row;
              var session = editor.session;
              if (session.foldWidgets && session.foldWidgets[row])
                editor.session.onFoldWidgetClick(row, e);
              if (!editor.isFocused())
                editor.focus();
              e.stop();
            }
          });
          editor.on("gutterdblclick", function(e) {
            var gutterRegion = editor.renderer.$gutterLayer.getRegion(e);
            if (gutterRegion == "foldWidgets") {
              var row = e.getDocumentPosition().row;
              var session = editor.session;
              var data2 = session.getParentFoldRangeData(row, true);
              var range = data2.range || data2.firstRange;
              if (range) {
                row = range.start.row;
                var fold = session.getFoldAt(row, session.getLine(row).length, 1);
                if (fold) {
                  session.removeFold(fold);
                } else {
                  session.addFold("...", range);
                  editor.renderer.scrollCursorIntoView({ row: range.start.row, column: 0 });
                }
              }
              e.stop();
            }
          });
        }
        return FoldHandler2;
      }();
      exports3.FoldHandler = FoldHandler;
    });
    ace.define("ace/keyboard/keybinding", ["require", "exports", "module", "ace/lib/keys", "ace/lib/event"], function(require2, exports3, module3) {
      var keyUtil = require2("../lib/keys");
      var event = require2("../lib/event");
      var KeyBinding = function() {
        function KeyBinding2(editor) {
          this.$editor = editor;
          this.$data = { editor };
          this.$handlers = [];
          this.setDefaultHandler(editor.commands);
        }
        KeyBinding2.prototype.setDefaultHandler = function(kb) {
          this.removeKeyboardHandler(this.$defaultHandler);
          this.$defaultHandler = kb;
          this.addKeyboardHandler(kb, 0);
        };
        KeyBinding2.prototype.setKeyboardHandler = function(kb) {
          var h = this.$handlers;
          if (h[h.length - 1] == kb)
            return;
          while (h[h.length - 1] && h[h.length - 1] != this.$defaultHandler)
            this.removeKeyboardHandler(h[h.length - 1]);
          this.addKeyboardHandler(kb, 1);
        };
        KeyBinding2.prototype.addKeyboardHandler = function(kb, pos) {
          if (!kb)
            return;
          if (typeof kb == "function" && !kb.handleKeyboard)
            kb.handleKeyboard = kb;
          var i2 = this.$handlers.indexOf(kb);
          if (i2 != -1)
            this.$handlers.splice(i2, 1);
          if (pos == void 0)
            this.$handlers.push(kb);
          else
            this.$handlers.splice(pos, 0, kb);
          if (i2 == -1 && kb.attach)
            kb.attach(this.$editor);
        };
        KeyBinding2.prototype.removeKeyboardHandler = function(kb) {
          var i2 = this.$handlers.indexOf(kb);
          if (i2 == -1)
            return false;
          this.$handlers.splice(i2, 1);
          kb.detach && kb.detach(this.$editor);
          return true;
        };
        KeyBinding2.prototype.getKeyboardHandler = function() {
          return this.$handlers[this.$handlers.length - 1];
        };
        KeyBinding2.prototype.getStatusText = function() {
          var data2 = this.$data;
          var editor = data2.editor;
          return this.$handlers.map(function(h) {
            return h.getStatusText && h.getStatusText(editor, data2) || "";
          }).filter(Boolean).join(" ");
        };
        KeyBinding2.prototype.$callKeyboardHandlers = function(hashId, keyString, keyCode, e) {
          var toExecute;
          var success = false;
          var commands = this.$editor.commands;
          for (var i2 = this.$handlers.length; i2--; ) {
            toExecute = this.$handlers[i2].handleKeyboard(this.$data, hashId, keyString, keyCode, e);
            if (!toExecute || !toExecute.command)
              continue;
            if (toExecute.command == "null") {
              success = true;
            } else {
              success = commands.exec(toExecute.command, this.$editor, toExecute.args, e);
            }
            if (success && e && hashId != -1 && toExecute.passEvent != true && toExecute.command.passEvent != true) {
              event.stopEvent(e);
            }
            if (success)
              break;
          }
          if (!success && hashId == -1) {
            toExecute = { command: "insertstring" };
            success = commands.exec("insertstring", this.$editor, keyString);
          }
          if (success && this.$editor._signal)
            this.$editor._signal("keyboardActivity", toExecute);
          return success;
        };
        KeyBinding2.prototype.onCommandKey = function(e, hashId, keyCode) {
          var keyString = keyUtil.keyCodeToString(keyCode);
          return this.$callKeyboardHandlers(hashId, keyString, keyCode, e);
        };
        KeyBinding2.prototype.onTextInput = function(text) {
          return this.$callKeyboardHandlers(-1, text);
        };
        return KeyBinding2;
      }();
      exports3.KeyBinding = KeyBinding;
    });
    ace.define("ace/lib/bidiutil", ["require", "exports", "module"], function(require2, exports3, module3) {
      var dir = 0, hiLevel = 0;
      var lastArabic = false, hasUBAT_B = false, hasUBAT_S = false;
      var impTab_LTR = [
        [0, 3, 0, 1, 0, 0, 0],
        [0, 3, 0, 1, 2, 2, 0],
        [0, 3, 0, 17, 2, 0, 1],
        [0, 3, 5, 5, 4, 1, 0],
        [0, 3, 21, 21, 4, 0, 1],
        [0, 3, 5, 5, 4, 2, 0]
      ];
      var impTab_RTL = [
        [2, 0, 1, 1, 0, 1, 0],
        [2, 0, 1, 1, 0, 2, 0],
        [2, 0, 2, 1, 3, 2, 0],
        [2, 0, 2, 33, 3, 1, 1]
      ];
      var LTR2 = 0, RTL2 = 1;
      var L = 0;
      var R = 1;
      var EN = 2;
      var AN = 3;
      var ON = 4;
      var B = 5;
      var S = 6;
      var AL = 7;
      var WS = 8;
      var CS = 9;
      var ES = 10;
      var ET = 11;
      var NSM = 12;
      var LRE = 13;
      var RLE = 14;
      var PDF = 15;
      var LRO = 16;
      var RLO = 17;
      var BN = 18;
      var UnicodeTBL00 = [
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        S,
        B,
        S,
        WS,
        B,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        B,
        B,
        B,
        S,
        WS,
        ON,
        ON,
        ET,
        ET,
        ET,
        ON,
        ON,
        ON,
        ON,
        ON,
        ES,
        CS,
        ES,
        CS,
        CS,
        EN,
        EN,
        EN,
        EN,
        EN,
        EN,
        EN,
        EN,
        EN,
        EN,
        CS,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        L,
        ON,
        ON,
        ON,
        ON,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        B,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        BN,
        CS,
        ON,
        ET,
        ET,
        ET,
        ET,
        ON,
        ON,
        ON,
        ON,
        L,
        ON,
        ON,
        BN,
        ON,
        ON,
        ET,
        ET,
        EN,
        EN,
        ON,
        L,
        ON,
        ON,
        ON,
        EN,
        L,
        ON,
        ON,
        ON,
        ON,
        ON
      ];
      var UnicodeTBL20 = [
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        WS,
        BN,
        BN,
        BN,
        L,
        R,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        WS,
        B,
        LRE,
        RLE,
        PDF,
        LRO,
        RLO,
        CS,
        ET,
        ET,
        ET,
        ET,
        ET,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        CS,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        ON,
        WS
      ];
      function _computeLevels(chars, levels, len, charTypes) {
        var impTab = dir ? impTab_RTL : impTab_LTR, prevState = null, newClass = null, newLevel = null, newState = 0, action = null, cond = null, condPos = -1, i2 = null, ix = null, classes = [];
        if (!charTypes) {
          for (i2 = 0, charTypes = []; i2 < len; i2++) {
            charTypes[i2] = _getCharacterType(chars[i2]);
          }
        }
        hiLevel = dir;
        lastArabic = false;
        hasUBAT_B = false;
        hasUBAT_S = false;
        for (ix = 0; ix < len; ix++) {
          prevState = newState;
          classes[ix] = newClass = _getCharClass(chars, charTypes, classes, ix);
          newState = impTab[prevState][newClass];
          action = newState & 240;
          newState &= 15;
          levels[ix] = newLevel = impTab[newState][5];
          if (action > 0) {
            if (action == 16) {
              for (i2 = condPos; i2 < ix; i2++) {
                levels[i2] = 1;
              }
              condPos = -1;
            } else {
              condPos = -1;
            }
          }
          cond = impTab[newState][6];
          if (cond) {
            if (condPos == -1) {
              condPos = ix;
            }
          } else {
            if (condPos > -1) {
              for (i2 = condPos; i2 < ix; i2++) {
                levels[i2] = newLevel;
              }
              condPos = -1;
            }
          }
          if (charTypes[ix] == B) {
            levels[ix] = 0;
          }
          hiLevel |= newLevel;
        }
        if (hasUBAT_S) {
          for (i2 = 0; i2 < len; i2++) {
            if (charTypes[i2] == S) {
              levels[i2] = dir;
              for (var j = i2 - 1; j >= 0; j--) {
                if (charTypes[j] == WS) {
                  levels[j] = dir;
                } else {
                  break;
                }
              }
            }
          }
        }
      }
      function _invertLevel(lev, levels, _array) {
        if (hiLevel < lev) {
          return;
        }
        if (lev == 1 && dir == RTL2 && !hasUBAT_B) {
          _array.reverse();
          return;
        }
        var len = _array.length, start = 0, end, lo, hi, tmp;
        while (start < len) {
          if (levels[start] >= lev) {
            end = start + 1;
            while (end < len && levels[end] >= lev) {
              end++;
            }
            for (lo = start, hi = end - 1; lo < hi; lo++, hi--) {
              tmp = _array[lo];
              _array[lo] = _array[hi];
              _array[hi] = tmp;
            }
            start = end;
          }
          start++;
        }
      }
      function _getCharClass(chars, types2, classes, ix) {
        var cType = types2[ix], wType, nType, len, i2;
        switch (cType) {
          case L:
          case R:
            lastArabic = false;
          case ON:
          case AN:
            return cType;
          case EN:
            return lastArabic ? AN : EN;
          case AL:
            lastArabic = true;
            return R;
          case WS:
            return ON;
          case CS:
            if (ix < 1 || ix + 1 >= types2.length || (wType = classes[ix - 1]) != EN && wType != AN || (nType = types2[ix + 1]) != EN && nType != AN) {
              return ON;
            }
            if (lastArabic) {
              nType = AN;
            }
            return nType == wType ? nType : ON;
          case ES:
            wType = ix > 0 ? classes[ix - 1] : B;
            if (wType == EN && ix + 1 < types2.length && types2[ix + 1] == EN) {
              return EN;
            }
            return ON;
          case ET:
            if (ix > 0 && classes[ix - 1] == EN) {
              return EN;
            }
            if (lastArabic) {
              return ON;
            }
            i2 = ix + 1;
            len = types2.length;
            while (i2 < len && types2[i2] == ET) {
              i2++;
            }
            if (i2 < len && types2[i2] == EN) {
              return EN;
            }
            return ON;
          case NSM:
            len = types2.length;
            i2 = ix + 1;
            while (i2 < len && types2[i2] == NSM) {
              i2++;
            }
            if (i2 < len) {
              var c = chars[ix], rtlCandidate = c >= 1425 && c <= 2303 || c == 64286;
              wType = types2[i2];
              if (rtlCandidate && (wType == R || wType == AL)) {
                return R;
              }
            }
            if (ix < 1 || (wType = types2[ix - 1]) == B) {
              return ON;
            }
            return classes[ix - 1];
          case B:
            lastArabic = false;
            hasUBAT_B = true;
            return dir;
          case S:
            hasUBAT_S = true;
            return ON;
          case LRE:
          case RLE:
          case LRO:
          case RLO:
          case PDF:
            lastArabic = false;
          case BN:
            return ON;
        }
      }
      function _getCharacterType(ch) {
        var uc = ch.charCodeAt(0), hi = uc >> 8;
        if (hi == 0) {
          return uc > 191 ? L : UnicodeTBL00[uc];
        } else if (hi == 5) {
          return /[\u0591-\u05f4]/.test(ch) ? R : L;
        } else if (hi == 6) {
          if (/[\u0610-\u061a\u064b-\u065f\u06d6-\u06e4\u06e7-\u06ed]/.test(ch))
            return NSM;
          else if (/[\u0660-\u0669\u066b-\u066c]/.test(ch))
            return AN;
          else if (uc == 1642)
            return ET;
          else if (/[\u06f0-\u06f9]/.test(ch))
            return EN;
          else
            return AL;
        } else if (hi == 32 && uc <= 8287) {
          return UnicodeTBL20[uc & 255];
        } else if (hi == 254) {
          return uc >= 65136 ? AL : ON;
        }
        return ON;
      }
      exports3.L = L;
      exports3.R = R;
      exports3.EN = EN;
      exports3.ON_R = 3;
      exports3.AN = 4;
      exports3.R_H = 5;
      exports3.B = 6;
      exports3.RLE = 7;
      exports3.DOT = "\xB7";
      exports3.doBidiReorder = function(text, textCharTypes, isRtl) {
        if (text.length < 2)
          return {};
        var chars = text.split(""), logicalFromVisual = new Array(chars.length), bidiLevels = new Array(chars.length), levels = [];
        dir = isRtl ? RTL2 : LTR2;
        _computeLevels(chars, levels, chars.length, textCharTypes);
        for (var i2 = 0; i2 < logicalFromVisual.length; logicalFromVisual[i2] = i2, i2++)
          ;
        _invertLevel(2, levels, logicalFromVisual);
        _invertLevel(1, levels, logicalFromVisual);
        for (var i2 = 0; i2 < logicalFromVisual.length - 1; i2++) {
          if (textCharTypes[i2] === AN) {
            levels[i2] = exports3.AN;
          } else if (levels[i2] === R && (textCharTypes[i2] > AL && textCharTypes[i2] < LRE || textCharTypes[i2] === ON || textCharTypes[i2] === BN)) {
            levels[i2] = exports3.ON_R;
          } else if (i2 > 0 && chars[i2 - 1] === "\u0644" && /\u0622|\u0623|\u0625|\u0627/.test(chars[i2])) {
            levels[i2 - 1] = levels[i2] = exports3.R_H;
            i2++;
          }
        }
        if (chars[chars.length - 1] === exports3.DOT)
          levels[chars.length - 1] = exports3.B;
        if (chars[0] === "\u202B")
          levels[0] = exports3.RLE;
        for (var i2 = 0; i2 < logicalFromVisual.length; i2++) {
          bidiLevels[i2] = levels[logicalFromVisual[i2]];
        }
        return { "logicalFromVisual": logicalFromVisual, "bidiLevels": bidiLevels };
      };
      exports3.hasBidiCharacters = function(text, textCharTypes) {
        var ret = false;
        for (var i2 = 0; i2 < text.length; i2++) {
          textCharTypes[i2] = _getCharacterType(text.charAt(i2));
          if (!ret && (textCharTypes[i2] == R || textCharTypes[i2] == AL || textCharTypes[i2] == AN))
            ret = true;
        }
        return ret;
      };
      exports3.getVisualFromLogicalIdx = function(logIdx, rowMap) {
        for (var i2 = 0; i2 < rowMap.logicalFromVisual.length; i2++) {
          if (rowMap.logicalFromVisual[i2] == logIdx)
            return i2;
        }
        return 0;
      };
    });
    ace.define("ace/bidihandler", ["require", "exports", "module", "ace/lib/bidiutil", "ace/lib/lang"], function(require2, exports3, module3) {
      var bidiUtil = require2("./lib/bidiutil");
      var lang = require2("./lib/lang");
      var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\u202B]/;
      var BidiHandler = function() {
        function BidiHandler2(session) {
          this.session = session;
          this.bidiMap = {};
          this.currentRow = null;
          this.bidiUtil = bidiUtil;
          this.charWidths = [];
          this.EOL = "\xAC";
          this.showInvisibles = true;
          this.isRtlDir = false;
          this.$isRtl = false;
          this.line = "";
          this.wrapIndent = 0;
          this.EOF = "\xB6";
          this.RLE = "\u202B";
          this.contentWidth = 0;
          this.fontMetrics = null;
          this.rtlLineOffset = 0;
          this.wrapOffset = 0;
          this.isMoveLeftOperation = false;
          this.seenBidi = bidiRE.test(session.getValue());
        }
        BidiHandler2.prototype.isBidiRow = function(screenRow, docRow, splitIndex) {
          if (!this.seenBidi)
            return false;
          if (screenRow !== this.currentRow) {
            this.currentRow = screenRow;
            this.updateRowLine(docRow, splitIndex);
            this.updateBidiMap();
          }
          return this.bidiMap.bidiLevels;
        };
        BidiHandler2.prototype.onChange = function(delta) {
          if (!this.seenBidi) {
            if (delta.action == "insert" && bidiRE.test(delta.lines.join("\n"))) {
              this.seenBidi = true;
              this.currentRow = null;
            }
          } else {
            this.currentRow = null;
          }
        };
        BidiHandler2.prototype.getDocumentRow = function() {
          var docRow = 0;
          var rowCache = this.session.$screenRowCache;
          if (rowCache.length) {
            var index2 = this.session.$getRowCacheIndex(rowCache, this.currentRow);
            if (index2 >= 0)
              docRow = this.session.$docRowCache[index2];
          }
          return docRow;
        };
        BidiHandler2.prototype.getSplitIndex = function() {
          var splitIndex = 0;
          var rowCache = this.session.$screenRowCache;
          if (rowCache.length) {
            var currentIndex, prevIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow);
            while (this.currentRow - splitIndex > 0) {
              currentIndex = this.session.$getRowCacheIndex(rowCache, this.currentRow - splitIndex - 1);
              if (currentIndex !== prevIndex)
                break;
              prevIndex = currentIndex;
              splitIndex++;
            }
          } else {
            splitIndex = this.currentRow;
          }
          return splitIndex;
        };
        BidiHandler2.prototype.updateRowLine = function(docRow, splitIndex) {
          if (docRow === void 0)
            docRow = this.getDocumentRow();
          var isLastRow = docRow === this.session.getLength() - 1, endOfLine = isLastRow ? this.EOF : this.EOL;
          this.wrapIndent = 0;
          this.line = this.session.getLine(docRow);
          this.isRtlDir = this.$isRtl || this.line.charAt(0) === this.RLE;
          if (this.session.$useWrapMode) {
            var splits = this.session.$wrapData[docRow];
            if (splits) {
              if (splitIndex === void 0)
                splitIndex = this.getSplitIndex();
              if (splitIndex > 0 && splits.length) {
                this.wrapIndent = splits.indent;
                this.wrapOffset = this.wrapIndent * this.charWidths[bidiUtil.L];
                this.line = splitIndex < splits.length ? this.line.substring(splits[splitIndex - 1], splits[splitIndex]) : this.line.substring(splits[splits.length - 1]);
              } else {
                this.line = this.line.substring(0, splits[splitIndex]);
              }
              if (splitIndex == splits.length) {
                this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;
              }
            }
          } else {
            this.line += this.showInvisibles ? endOfLine : bidiUtil.DOT;
          }
          var session = this.session, shift2 = 0, size;
          this.line = this.line.replace(/\t|[\u1100-\u2029, \u202F-\uFFE6]/g, function(ch, i2) {
            if (ch === "	" || session.isFullWidth(ch.charCodeAt(0))) {
              size = ch === "	" ? session.getScreenTabSize(i2 + shift2) : 2;
              shift2 += size - 1;
              return lang.stringRepeat(bidiUtil.DOT, size);
            }
            return ch;
          });
          if (this.isRtlDir) {
            this.fontMetrics.$main.textContent = this.line.charAt(this.line.length - 1) == bidiUtil.DOT ? this.line.substr(0, this.line.length - 1) : this.line;
            this.rtlLineOffset = this.contentWidth - this.fontMetrics.$main.getBoundingClientRect().width;
          }
        };
        BidiHandler2.prototype.updateBidiMap = function() {
          var textCharTypes = [];
          if (bidiUtil.hasBidiCharacters(this.line, textCharTypes) || this.isRtlDir) {
            this.bidiMap = bidiUtil.doBidiReorder(this.line, textCharTypes, this.isRtlDir);
          } else {
            this.bidiMap = {};
          }
        };
        BidiHandler2.prototype.markAsDirty = function() {
          this.currentRow = null;
        };
        BidiHandler2.prototype.updateCharacterWidths = function(fontMetrics) {
          if (this.characterWidth === fontMetrics.$characterSize.width)
            return;
          this.fontMetrics = fontMetrics;
          var characterWidth = this.characterWidth = fontMetrics.$characterSize.width;
          var bidiCharWidth = fontMetrics.$measureCharWidth("\u05D4");
          this.charWidths[bidiUtil.L] = this.charWidths[bidiUtil.EN] = this.charWidths[bidiUtil.ON_R] = characterWidth;
          this.charWidths[bidiUtil.R] = this.charWidths[bidiUtil.AN] = bidiCharWidth;
          this.charWidths[bidiUtil.R_H] = bidiCharWidth * 0.45;
          this.charWidths[bidiUtil.B] = this.charWidths[bidiUtil.RLE] = 0;
          this.currentRow = null;
        };
        BidiHandler2.prototype.setShowInvisibles = function(showInvisibles) {
          this.showInvisibles = showInvisibles;
          this.currentRow = null;
        };
        BidiHandler2.prototype.setEolChar = function(eolChar) {
          this.EOL = eolChar;
        };
        BidiHandler2.prototype.setContentWidth = function(width) {
          this.contentWidth = width;
        };
        BidiHandler2.prototype.isRtlLine = function(row) {
          if (this.$isRtl)
            return true;
          if (row != void 0)
            return this.session.getLine(row).charAt(0) == this.RLE;
          else
            return this.isRtlDir;
        };
        BidiHandler2.prototype.setRtlDirection = function(editor, isRtlDir) {
          var cursor = editor.getCursorPosition();
          for (var row = editor.selection.getSelectionAnchor().row; row <= cursor.row; row++) {
            if (!isRtlDir && editor.session.getLine(row).charAt(0) === editor.session.$bidiHandler.RLE)
              editor.session.doc.removeInLine(row, 0, 1);
            else if (isRtlDir && editor.session.getLine(row).charAt(0) !== editor.session.$bidiHandler.RLE)
              editor.session.doc.insert({ column: 0, row }, editor.session.$bidiHandler.RLE);
          }
        };
        BidiHandler2.prototype.getPosLeft = function(col) {
          col -= this.wrapIndent;
          var leftBoundary = this.line.charAt(0) === this.RLE ? 1 : 0;
          var logicalIdx = col > leftBoundary ? this.session.getOverwrite() ? col : col - 1 : leftBoundary;
          var visualIdx = bidiUtil.getVisualFromLogicalIdx(logicalIdx, this.bidiMap), levels = this.bidiMap.bidiLevels, left = 0;
          if (!this.session.getOverwrite() && col <= leftBoundary && levels[visualIdx] % 2 !== 0)
            visualIdx++;
          for (var i2 = 0; i2 < visualIdx; i2++) {
            left += this.charWidths[levels[i2]];
          }
          if (!this.session.getOverwrite() && col > leftBoundary && levels[visualIdx] % 2 === 0)
            left += this.charWidths[levels[visualIdx]];
          if (this.wrapIndent)
            left += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset;
          if (this.isRtlDir)
            left += this.rtlLineOffset;
          return left;
        };
        BidiHandler2.prototype.getSelections = function(startCol, endCol) {
          var map = this.bidiMap, levels = map.bidiLevels, level, selections = [], offset = 0, selColMin = Math.min(startCol, endCol) - this.wrapIndent, selColMax = Math.max(startCol, endCol) - this.wrapIndent, isSelected = false, isSelectedPrev = false, selectionStart = 0;
          if (this.wrapIndent)
            offset += this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset;
          for (var logIdx, visIdx = 0; visIdx < levels.length; visIdx++) {
            logIdx = map.logicalFromVisual[visIdx];
            level = levels[visIdx];
            isSelected = logIdx >= selColMin && logIdx < selColMax;
            if (isSelected && !isSelectedPrev) {
              selectionStart = offset;
            } else if (!isSelected && isSelectedPrev) {
              selections.push({ left: selectionStart, width: offset - selectionStart });
            }
            offset += this.charWidths[level];
            isSelectedPrev = isSelected;
          }
          if (isSelected && visIdx === levels.length) {
            selections.push({ left: selectionStart, width: offset - selectionStart });
          }
          if (this.isRtlDir) {
            for (var i2 = 0; i2 < selections.length; i2++) {
              selections[i2].left += this.rtlLineOffset;
            }
          }
          return selections;
        };
        BidiHandler2.prototype.offsetToCol = function(posX) {
          if (this.isRtlDir)
            posX -= this.rtlLineOffset;
          var logicalIdx = 0, posX = Math.max(posX, 0), offset = 0, visualIdx = 0, levels = this.bidiMap.bidiLevels, charWidth = this.charWidths[levels[visualIdx]];
          if (this.wrapIndent)
            posX -= this.isRtlDir ? -1 * this.wrapOffset : this.wrapOffset;
          while (posX > offset + charWidth / 2) {
            offset += charWidth;
            if (visualIdx === levels.length - 1) {
              charWidth = 0;
              break;
            }
            charWidth = this.charWidths[levels[++visualIdx]];
          }
          if (visualIdx > 0 && levels[visualIdx - 1] % 2 !== 0 && levels[visualIdx] % 2 === 0) {
            if (posX < offset)
              visualIdx--;
            logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];
          } else if (visualIdx > 0 && levels[visualIdx - 1] % 2 === 0 && levels[visualIdx] % 2 !== 0) {
            logicalIdx = 1 + (posX > offset ? this.bidiMap.logicalFromVisual[visualIdx] : this.bidiMap.logicalFromVisual[visualIdx - 1]);
          } else if (this.isRtlDir && visualIdx === levels.length - 1 && charWidth === 0 && levels[visualIdx - 1] % 2 === 0 || !this.isRtlDir && visualIdx === 0 && levels[visualIdx] % 2 !== 0) {
            logicalIdx = 1 + this.bidiMap.logicalFromVisual[visualIdx];
          } else {
            if (visualIdx > 0 && levels[visualIdx - 1] % 2 !== 0 && charWidth !== 0)
              visualIdx--;
            logicalIdx = this.bidiMap.logicalFromVisual[visualIdx];
          }
          if (logicalIdx === 0 && this.isRtlDir)
            logicalIdx++;
          return logicalIdx + this.wrapIndent;
        };
        return BidiHandler2;
      }();
      exports3.BidiHandler = BidiHandler;
    });
    ace.define("ace/selection", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/range"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var lang = require2("./lib/lang");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var Range2 = require2("./range").Range;
      var Selection = function() {
        function Selection2(session) {
          this.session = session;
          this.doc = session.getDocument();
          this.clearSelection();
          this.cursor = this.lead = this.doc.createAnchor(0, 0);
          this.anchor = this.doc.createAnchor(0, 0);
          this.$silent = false;
          var self2 = this;
          this.cursor.on("change", function(e) {
            self2.$cursorChanged = true;
            if (!self2.$silent)
              self2._emit("changeCursor");
            if (!self2.$isEmpty && !self2.$silent)
              self2._emit("changeSelection");
            if (!self2.$keepDesiredColumnOnChange && e.old.column != e.value.column)
              self2.$desiredColumn = null;
          });
          this.anchor.on("change", function() {
            self2.$anchorChanged = true;
            if (!self2.$isEmpty && !self2.$silent)
              self2._emit("changeSelection");
          });
        }
        Selection2.prototype.isEmpty = function() {
          return this.$isEmpty || this.anchor.row == this.lead.row && this.anchor.column == this.lead.column;
        };
        Selection2.prototype.isMultiLine = function() {
          return !this.$isEmpty && this.anchor.row != this.cursor.row;
        };
        Selection2.prototype.getCursor = function() {
          return this.lead.getPosition();
        };
        Selection2.prototype.setAnchor = function(row, column) {
          this.$isEmpty = false;
          this.anchor.setPosition(row, column);
        };
        Selection2.prototype.getAnchor = function() {
          if (this.$isEmpty)
            return this.getSelectionLead();
          return this.anchor.getPosition();
        };
        Selection2.prototype.getSelectionLead = function() {
          return this.lead.getPosition();
        };
        Selection2.prototype.isBackwards = function() {
          var anchor = this.anchor;
          var lead = this.lead;
          return anchor.row > lead.row || anchor.row == lead.row && anchor.column > lead.column;
        };
        Selection2.prototype.getRange = function() {
          var anchor = this.anchor;
          var lead = this.lead;
          if (this.$isEmpty)
            return Range2.fromPoints(lead, lead);
          return this.isBackwards() ? Range2.fromPoints(lead, anchor) : Range2.fromPoints(anchor, lead);
        };
        Selection2.prototype.clearSelection = function() {
          if (!this.$isEmpty) {
            this.$isEmpty = true;
            this._emit("changeSelection");
          }
        };
        Selection2.prototype.selectAll = function() {
          this.$setSelection(0, 0, Number.MAX_VALUE, Number.MAX_VALUE);
        };
        Selection2.prototype.setRange = function(range, reverse) {
          var start = reverse ? range.end : range.start;
          var end = reverse ? range.start : range.end;
          this.$setSelection(start.row, start.column, end.row, end.column);
        };
        Selection2.prototype.$setSelection = function(anchorRow, anchorColumn, cursorRow, cursorColumn) {
          if (this.$silent)
            return;
          var wasEmpty = this.$isEmpty;
          var wasMultiselect = this.inMultiSelectMode;
          this.$silent = true;
          this.$cursorChanged = this.$anchorChanged = false;
          this.anchor.setPosition(anchorRow, anchorColumn);
          this.cursor.setPosition(cursorRow, cursorColumn);
          this.$isEmpty = !Range2.comparePoints(this.anchor, this.cursor);
          this.$silent = false;
          if (this.$cursorChanged)
            this._emit("changeCursor");
          if (this.$cursorChanged || this.$anchorChanged || wasEmpty != this.$isEmpty || wasMultiselect)
            this._emit("changeSelection");
        };
        Selection2.prototype.$moveSelection = function(mover) {
          var lead = this.lead;
          if (this.$isEmpty)
            this.setSelectionAnchor(lead.row, lead.column);
          mover.call(this);
        };
        Selection2.prototype.selectTo = function(row, column) {
          this.$moveSelection(function() {
            this.moveCursorTo(row, column);
          });
        };
        Selection2.prototype.selectToPosition = function(pos) {
          this.$moveSelection(function() {
            this.moveCursorToPosition(pos);
          });
        };
        Selection2.prototype.moveTo = function(row, column) {
          this.clearSelection();
          this.moveCursorTo(row, column);
        };
        Selection2.prototype.moveToPosition = function(pos) {
          this.clearSelection();
          this.moveCursorToPosition(pos);
        };
        Selection2.prototype.selectUp = function() {
          this.$moveSelection(this.moveCursorUp);
        };
        Selection2.prototype.selectDown = function() {
          this.$moveSelection(this.moveCursorDown);
        };
        Selection2.prototype.selectRight = function() {
          this.$moveSelection(this.moveCursorRight);
        };
        Selection2.prototype.selectLeft = function() {
          this.$moveSelection(this.moveCursorLeft);
        };
        Selection2.prototype.selectLineStart = function() {
          this.$moveSelection(this.moveCursorLineStart);
        };
        Selection2.prototype.selectLineEnd = function() {
          this.$moveSelection(this.moveCursorLineEnd);
        };
        Selection2.prototype.selectFileEnd = function() {
          this.$moveSelection(this.moveCursorFileEnd);
        };
        Selection2.prototype.selectFileStart = function() {
          this.$moveSelection(this.moveCursorFileStart);
        };
        Selection2.prototype.selectWordRight = function() {
          this.$moveSelection(this.moveCursorWordRight);
        };
        Selection2.prototype.selectWordLeft = function() {
          this.$moveSelection(this.moveCursorWordLeft);
        };
        Selection2.prototype.getWordRange = function(row, column) {
          if (typeof column == "undefined") {
            var cursor = row || this.lead;
            row = cursor.row;
            column = cursor.column;
          }
          return this.session.getWordRange(row, column);
        };
        Selection2.prototype.selectWord = function() {
          this.setSelectionRange(this.getWordRange());
        };
        Selection2.prototype.selectAWord = function() {
          var cursor = this.getCursor();
          var range = this.session.getAWordRange(cursor.row, cursor.column);
          this.setSelectionRange(range);
        };
        Selection2.prototype.getLineRange = function(row, excludeLastChar) {
          var rowStart = typeof row == "number" ? row : this.lead.row;
          var rowEnd;
          var foldLine = this.session.getFoldLine(rowStart);
          if (foldLine) {
            rowStart = foldLine.start.row;
            rowEnd = foldLine.end.row;
          } else {
            rowEnd = rowStart;
          }
          if (excludeLastChar === true)
            return new Range2(rowStart, 0, rowEnd, this.session.getLine(rowEnd).length);
          else
            return new Range2(rowStart, 0, rowEnd + 1, 0);
        };
        Selection2.prototype.selectLine = function() {
          this.setSelectionRange(this.getLineRange());
        };
        Selection2.prototype.moveCursorUp = function() {
          this.moveCursorBy(-1, 0);
        };
        Selection2.prototype.moveCursorDown = function() {
          this.moveCursorBy(1, 0);
        };
        Selection2.prototype.wouldMoveIntoSoftTab = function(cursor, tabSize, direction) {
          var start = cursor.column;
          var end = cursor.column + tabSize;
          if (direction < 0) {
            start = cursor.column - tabSize;
            end = cursor.column;
          }
          return this.session.isTabStop(cursor) && this.doc.getLine(cursor.row).slice(start, end).split(" ").length - 1 == tabSize;
        };
        Selection2.prototype.moveCursorLeft = function() {
          var cursor = this.lead.getPosition(), fold;
          if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {
            this.moveCursorTo(fold.start.row, fold.start.column);
          } else if (cursor.column === 0) {
            if (cursor.row > 0) {
              this.moveCursorTo(cursor.row - 1, this.doc.getLine(cursor.row - 1).length);
            }
          } else {
            var tabSize = this.session.getTabSize();
            if (this.wouldMoveIntoSoftTab(cursor, tabSize, -1) && !this.session.getNavigateWithinSoftTabs()) {
              this.moveCursorBy(0, -tabSize);
            } else {
              this.moveCursorBy(0, -1);
            }
          }
        };
        Selection2.prototype.moveCursorRight = function() {
          var cursor = this.lead.getPosition(), fold;
          if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {
            this.moveCursorTo(fold.end.row, fold.end.column);
          } else if (this.lead.column == this.doc.getLine(this.lead.row).length) {
            if (this.lead.row < this.doc.getLength() - 1) {
              this.moveCursorTo(this.lead.row + 1, 0);
            }
          } else {
            var tabSize = this.session.getTabSize();
            var cursor = this.lead;
            if (this.wouldMoveIntoSoftTab(cursor, tabSize, 1) && !this.session.getNavigateWithinSoftTabs()) {
              this.moveCursorBy(0, tabSize);
            } else {
              this.moveCursorBy(0, 1);
            }
          }
        };
        Selection2.prototype.moveCursorLineStart = function() {
          var row = this.lead.row;
          var column = this.lead.column;
          var screenRow = this.session.documentToScreenRow(row, column);
          var firstColumnPosition = this.session.screenToDocumentPosition(screenRow, 0);
          var beforeCursor = this.session.getDisplayLine(row, null, firstColumnPosition.row, firstColumnPosition.column);
          var leadingSpace = beforeCursor.match(/^\s*/);
          if (leadingSpace[0].length != column && !this.session.$useEmacsStyleLineStart)
            firstColumnPosition.column += leadingSpace[0].length;
          this.moveCursorToPosition(firstColumnPosition);
        };
        Selection2.prototype.moveCursorLineEnd = function() {
          var lead = this.lead;
          var lineEnd = this.session.getDocumentLastRowColumnPosition(lead.row, lead.column);
          if (this.lead.column == lineEnd.column) {
            var line = this.session.getLine(lineEnd.row);
            if (lineEnd.column == line.length) {
              var textEnd = line.search(/\s+$/);
              if (textEnd > 0)
                lineEnd.column = textEnd;
            }
          }
          this.moveCursorTo(lineEnd.row, lineEnd.column);
        };
        Selection2.prototype.moveCursorFileEnd = function() {
          var row = this.doc.getLength() - 1;
          var column = this.doc.getLine(row).length;
          this.moveCursorTo(row, column);
        };
        Selection2.prototype.moveCursorFileStart = function() {
          this.moveCursorTo(0, 0);
        };
        Selection2.prototype.moveCursorLongWordRight = function() {
          var row = this.lead.row;
          var column = this.lead.column;
          var line = this.doc.getLine(row);
          var rightOfCursor = line.substring(column);
          this.session.nonTokenRe.lastIndex = 0;
          this.session.tokenRe.lastIndex = 0;
          var fold = this.session.getFoldAt(row, column, 1);
          if (fold) {
            this.moveCursorTo(fold.end.row, fold.end.column);
            return;
          }
          if (this.session.nonTokenRe.exec(rightOfCursor)) {
            column += this.session.nonTokenRe.lastIndex;
            this.session.nonTokenRe.lastIndex = 0;
            rightOfCursor = line.substring(column);
          }
          if (column >= line.length) {
            this.moveCursorTo(row, line.length);
            this.moveCursorRight();
            if (row < this.doc.getLength() - 1)
              this.moveCursorWordRight();
            return;
          }
          if (this.session.tokenRe.exec(rightOfCursor)) {
            column += this.session.tokenRe.lastIndex;
            this.session.tokenRe.lastIndex = 0;
          }
          this.moveCursorTo(row, column);
        };
        Selection2.prototype.moveCursorLongWordLeft = function() {
          var row = this.lead.row;
          var column = this.lead.column;
          var fold;
          if (fold = this.session.getFoldAt(row, column, -1)) {
            this.moveCursorTo(fold.start.row, fold.start.column);
            return;
          }
          var str = this.session.getFoldStringAt(row, column, -1);
          if (str == null) {
            str = this.doc.getLine(row).substring(0, column);
          }
          var leftOfCursor = lang.stringReverse(str);
          this.session.nonTokenRe.lastIndex = 0;
          this.session.tokenRe.lastIndex = 0;
          if (this.session.nonTokenRe.exec(leftOfCursor)) {
            column -= this.session.nonTokenRe.lastIndex;
            leftOfCursor = leftOfCursor.slice(this.session.nonTokenRe.lastIndex);
            this.session.nonTokenRe.lastIndex = 0;
          }
          if (column <= 0) {
            this.moveCursorTo(row, 0);
            this.moveCursorLeft();
            if (row > 0)
              this.moveCursorWordLeft();
            return;
          }
          if (this.session.tokenRe.exec(leftOfCursor)) {
            column -= this.session.tokenRe.lastIndex;
            this.session.tokenRe.lastIndex = 0;
          }
          this.moveCursorTo(row, column);
        };
        Selection2.prototype.$shortWordEndIndex = function(rightOfCursor) {
          var index2 = 0, ch;
          var whitespaceRe = /\s/;
          var tokenRe = this.session.tokenRe;
          tokenRe.lastIndex = 0;
          if (this.session.tokenRe.exec(rightOfCursor)) {
            index2 = this.session.tokenRe.lastIndex;
          } else {
            while ((ch = rightOfCursor[index2]) && whitespaceRe.test(ch))
              index2++;
            if (index2 < 1) {
              tokenRe.lastIndex = 0;
              while ((ch = rightOfCursor[index2]) && !tokenRe.test(ch)) {
                tokenRe.lastIndex = 0;
                index2++;
                if (whitespaceRe.test(ch)) {
                  if (index2 > 2) {
                    index2--;
                    break;
                  } else {
                    while ((ch = rightOfCursor[index2]) && whitespaceRe.test(ch))
                      index2++;
                    if (index2 > 2)
                      break;
                  }
                }
              }
            }
          }
          tokenRe.lastIndex = 0;
          return index2;
        };
        Selection2.prototype.moveCursorShortWordRight = function() {
          var row = this.lead.row;
          var column = this.lead.column;
          var line = this.doc.getLine(row);
          var rightOfCursor = line.substring(column);
          var fold = this.session.getFoldAt(row, column, 1);
          if (fold)
            return this.moveCursorTo(fold.end.row, fold.end.column);
          if (column == line.length) {
            var l = this.doc.getLength();
            do {
              row++;
              rightOfCursor = this.doc.getLine(row);
            } while (row < l && /^\s*$/.test(rightOfCursor));
            if (!/^\s+/.test(rightOfCursor))
              rightOfCursor = "";
            column = 0;
          }
          var index2 = this.$shortWordEndIndex(rightOfCursor);
          this.moveCursorTo(row, column + index2);
        };
        Selection2.prototype.moveCursorShortWordLeft = function() {
          var row = this.lead.row;
          var column = this.lead.column;
          var fold;
          if (fold = this.session.getFoldAt(row, column, -1))
            return this.moveCursorTo(fold.start.row, fold.start.column);
          var line = this.session.getLine(row).substring(0, column);
          if (column === 0) {
            do {
              row--;
              line = this.doc.getLine(row);
            } while (row > 0 && /^\s*$/.test(line));
            column = line.length;
            if (!/\s+$/.test(line))
              line = "";
          }
          var leftOfCursor = lang.stringReverse(line);
          var index2 = this.$shortWordEndIndex(leftOfCursor);
          return this.moveCursorTo(row, column - index2);
        };
        Selection2.prototype.moveCursorWordRight = function() {
          if (this.session.$selectLongWords)
            this.moveCursorLongWordRight();
          else
            this.moveCursorShortWordRight();
        };
        Selection2.prototype.moveCursorWordLeft = function() {
          if (this.session.$selectLongWords)
            this.moveCursorLongWordLeft();
          else
            this.moveCursorShortWordLeft();
        };
        Selection2.prototype.moveCursorBy = function(rows, chars) {
          var screenPos = this.session.documentToScreenPosition(this.lead.row, this.lead.column);
          var offsetX;
          if (chars === 0) {
            if (rows !== 0) {
              if (this.session.$bidiHandler.isBidiRow(screenPos.row, this.lead.row)) {
                offsetX = this.session.$bidiHandler.getPosLeft(screenPos.column);
                screenPos.column = Math.round(offsetX / this.session.$bidiHandler.charWidths[0]);
              } else {
                offsetX = screenPos.column * this.session.$bidiHandler.charWidths[0];
              }
            }
            if (this.$desiredColumn)
              screenPos.column = this.$desiredColumn;
            else
              this.$desiredColumn = screenPos.column;
          }
          if (rows != 0 && this.session.lineWidgets && this.session.lineWidgets[this.lead.row]) {
            var widget = this.session.lineWidgets[this.lead.row];
            if (rows < 0)
              rows -= widget.rowsAbove || 0;
            else if (rows > 0)
              rows += widget.rowCount - (widget.rowsAbove || 0);
          }
          var docPos = this.session.screenToDocumentPosition(screenPos.row + rows, screenPos.column, offsetX);
          if (rows !== 0 && chars === 0 && docPos.row === this.lead.row && docPos.column === this.lead.column)
            ;
          this.moveCursorTo(docPos.row, docPos.column + chars, chars === 0);
        };
        Selection2.prototype.moveCursorToPosition = function(position) {
          this.moveCursorTo(position.row, position.column);
        };
        Selection2.prototype.moveCursorTo = function(row, column, keepDesiredColumn) {
          var fold = this.session.getFoldAt(row, column, 1);
          if (fold) {
            row = fold.start.row;
            column = fold.start.column;
          }
          this.$keepDesiredColumnOnChange = true;
          var line = this.session.getLine(row);
          if (/[\uDC00-\uDFFF]/.test(line.charAt(column)) && line.charAt(column - 1)) {
            if (this.lead.row == row && this.lead.column == column + 1)
              column = column - 1;
            else
              column = column + 1;
          }
          this.lead.setPosition(row, column);
          this.$keepDesiredColumnOnChange = false;
          if (!keepDesiredColumn)
            this.$desiredColumn = null;
        };
        Selection2.prototype.moveCursorToScreen = function(row, column, keepDesiredColumn) {
          var pos = this.session.screenToDocumentPosition(row, column);
          this.moveCursorTo(pos.row, pos.column, keepDesiredColumn);
        };
        Selection2.prototype.detach = function() {
          this.lead.detach();
          this.anchor.detach();
        };
        Selection2.prototype.fromOrientedRange = function(range) {
          this.setSelectionRange(range, range.cursor == range.start);
          this.$desiredColumn = range.desiredColumn || this.$desiredColumn;
        };
        Selection2.prototype.toOrientedRange = function(range) {
          var r = this.getRange();
          if (range) {
            range.start.column = r.start.column;
            range.start.row = r.start.row;
            range.end.column = r.end.column;
            range.end.row = r.end.row;
          } else {
            range = r;
          }
          range.cursor = this.isBackwards() ? range.start : range.end;
          range.desiredColumn = this.$desiredColumn;
          return range;
        };
        Selection2.prototype.getRangeOfMovements = function(func) {
          var start = this.getCursor();
          try {
            func(this);
            var end = this.getCursor();
            return Range2.fromPoints(start, end);
          } catch (e) {
            return Range2.fromPoints(start, start);
          } finally {
            this.moveCursorToPosition(start);
          }
        };
        Selection2.prototype.toJSON = function() {
          if (this.rangeCount) {
            var data2 = this.ranges.map(function(r) {
              var r1 = r.clone();
              r1.isBackwards = r.cursor == r.start;
              return r1;
            });
          } else {
            var data2 = this.getRange();
            data2.isBackwards = this.isBackwards();
          }
          return data2;
        };
        Selection2.prototype.fromJSON = function(data2) {
          if (data2.start == void 0) {
            if (this.rangeList && data2.length > 1) {
              this.toSingleRange(data2[0]);
              for (var i2 = data2.length; i2--; ) {
                var r = Range2.fromPoints(data2[i2].start, data2[i2].end);
                if (data2[i2].isBackwards)
                  r.cursor = r.start;
                this.addRange(r, true);
              }
              return;
            } else {
              data2 = data2[0];
            }
          }
          if (this.rangeList)
            this.toSingleRange(data2);
          this.setSelectionRange(data2, data2.isBackwards);
        };
        Selection2.prototype.isEqual = function(data2) {
          if ((data2.length || this.rangeCount) && data2.length != this.rangeCount)
            return false;
          if (!data2.length || !this.ranges)
            return this.getRange().isEqual(data2);
          for (var i2 = this.ranges.length; i2--; ) {
            if (!this.ranges[i2].isEqual(data2[i2]))
              return false;
          }
          return true;
        };
        return Selection2;
      }();
      Selection.prototype.setSelectionAnchor = Selection.prototype.setAnchor;
      Selection.prototype.getSelectionAnchor = Selection.prototype.getAnchor;
      Selection.prototype.setSelectionRange = Selection.prototype.setRange;
      oop.implement(Selection.prototype, EventEmitter);
      exports3.Selection = Selection;
    });
    ace.define("ace/tokenizer", ["require", "exports", "module", "ace/lib/report_error"], function(require2, exports3, module3) {
      var reportError = require2("./lib/report_error").reportError;
      var MAX_TOKEN_COUNT = 2e3;
      var Tokenizer = function() {
        function Tokenizer2(rules) {
          this.states = rules;
          this.regExps = {};
          this.matchMappings = {};
          for (var key in this.states) {
            var state = this.states[key];
            var ruleRegExps = [];
            var matchTotal = 0;
            var mapping = this.matchMappings[key] = { defaultToken: "text" };
            var flag = "g";
            var splitterRurles = [];
            for (var i2 = 0; i2 < state.length; i2++) {
              var rule = state[i2];
              if (rule.defaultToken)
                mapping.defaultToken = rule.defaultToken;
              if (rule.caseInsensitive && flag.indexOf("i") === -1)
                flag += "i";
              if (rule.unicode && flag.indexOf("u") === -1)
                flag += "u";
              if (rule.regex == null)
                continue;
              if (rule.regex instanceof RegExp)
                rule.regex = rule.regex.toString().slice(1, -1);
              var adjustedregex = rule.regex;
              var matchcount = new RegExp("(?:(" + adjustedregex + ")|(.))").exec("a").length - 2;
              if (Array.isArray(rule.token)) {
                if (rule.token.length == 1 || matchcount == 1) {
                  rule.token = rule.token[0];
                } else if (matchcount - 1 != rule.token.length) {
                  this.reportError("number of classes and regexp groups doesn't match", {
                    rule,
                    groupCount: matchcount - 1
                  });
                  rule.token = rule.token[0];
                } else {
                  rule.tokenArray = rule.token;
                  rule.token = null;
                  rule.onMatch = this.$arrayTokens;
                }
              } else if (typeof rule.token == "function" && !rule.onMatch) {
                if (matchcount > 1)
                  rule.onMatch = this.$applyToken;
                else
                  rule.onMatch = rule.token;
              }
              if (matchcount > 1) {
                if (/\\\d/.test(rule.regex)) {
                  adjustedregex = rule.regex.replace(/\\([0-9]+)/g, function(match, digit) {
                    return "\\" + (parseInt(digit, 10) + matchTotal + 1);
                  });
                } else {
                  matchcount = 1;
                  adjustedregex = this.removeCapturingGroups(rule.regex);
                }
                if (!rule.splitRegex && typeof rule.token != "string")
                  splitterRurles.push(rule);
              }
              mapping[matchTotal] = i2;
              matchTotal += matchcount;
              ruleRegExps.push(adjustedregex);
              if (!rule.onMatch)
                rule.onMatch = null;
            }
            if (!ruleRegExps.length) {
              mapping[0] = 0;
              ruleRegExps.push("$");
            }
            splitterRurles.forEach(function(rule2) {
              rule2.splitRegex = this.createSplitterRegexp(rule2.regex, flag);
            }, this);
            this.regExps[key] = new RegExp("(" + ruleRegExps.join(")|(") + ")|($)", flag);
          }
        }
        Tokenizer2.prototype.$setMaxTokenCount = function(m) {
          MAX_TOKEN_COUNT = m | 0;
        };
        Tokenizer2.prototype.$applyToken = function(str) {
          var values = this.splitRegex.exec(str).slice(1);
          var types2 = this.token.apply(this, values);
          if (typeof types2 === "string")
            return [{ type: types2, value: str }];
          var tokens = [];
          for (var i2 = 0, l = types2.length; i2 < l; i2++) {
            if (values[i2])
              tokens[tokens.length] = {
                type: types2[i2],
                value: values[i2]
              };
          }
          return tokens;
        };
        Tokenizer2.prototype.$arrayTokens = function(str) {
          if (!str)
            return [];
          var values = this.splitRegex.exec(str);
          if (!values)
            return "text";
          var tokens = [];
          var types2 = this.tokenArray;
          for (var i2 = 0, l = types2.length; i2 < l; i2++) {
            if (values[i2 + 1])
              tokens[tokens.length] = {
                type: types2[i2],
                value: values[i2 + 1]
              };
          }
          return tokens;
        };
        Tokenizer2.prototype.removeCapturingGroups = function(src) {
          var r = src.replace(/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!<]|(\()/g, function(x, y) {
            return y ? "(?:" : x;
          });
          return r;
        };
        Tokenizer2.prototype.createSplitterRegexp = function(src, flag) {
          if (src.indexOf("(?=") != -1) {
            var stack = 0;
            var inChClass = false;
            var lastCapture = {};
            src.replace(/(\\.)|(\((?:\?[=!])?)|(\))|([\[\]])/g, function(m, esc, parenOpen, parenClose, square, index2) {
              if (inChClass) {
                inChClass = square != "]";
              } else if (square) {
                inChClass = true;
              } else if (parenClose) {
                if (stack == lastCapture.stack) {
                  lastCapture.end = index2 + 1;
                  lastCapture.stack = -1;
                }
                stack--;
              } else if (parenOpen) {
                stack++;
                if (parenOpen.length != 1) {
                  lastCapture.stack = stack;
                  lastCapture.start = index2;
                }
              }
              return m;
            });
            if (lastCapture.end != null && /^\)*$/.test(src.substr(lastCapture.end)))
              src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end);
          }
          if (src.charAt(0) != "^")
            src = "^" + src;
          if (src.charAt(src.length - 1) != "$")
            src += "$";
          return new RegExp(src, (flag || "").replace("g", ""));
        };
        Tokenizer2.prototype.getLineTokens = function(line, startState) {
          if (startState && typeof startState != "string") {
            var stack = startState.slice(0);
            startState = stack[0];
            if (startState === "#tmp") {
              stack.shift();
              startState = stack.shift();
            }
          } else
            var stack = [];
          var currentState = startState || "start";
          var state = this.states[currentState];
          if (!state) {
            currentState = "start";
            state = this.states[currentState];
          }
          var mapping = this.matchMappings[currentState];
          var re = this.regExps[currentState];
          re.lastIndex = 0;
          var match, tokens = [];
          var lastIndex = 0;
          var matchAttempts = 0;
          var token = { type: null, value: "" };
          while (match = re.exec(line)) {
            var type = mapping.defaultToken;
            var rule = null;
            var value2 = match[0];
            var index2 = re.lastIndex;
            if (index2 - value2.length > lastIndex) {
              var skipped = line.substring(lastIndex, index2 - value2.length);
              if (token.type == type) {
                token.value += skipped;
              } else {
                if (token.type)
                  tokens.push(token);
                token = { type, value: skipped };
              }
            }
            for (var i2 = 0; i2 < match.length - 2; i2++) {
              if (match[i2 + 1] === void 0)
                continue;
              rule = state[mapping[i2]];
              if (rule.onMatch)
                type = rule.onMatch(value2, currentState, stack, line);
              else
                type = rule.token;
              if (rule.next) {
                if (typeof rule.next == "string") {
                  currentState = rule.next;
                } else {
                  currentState = rule.next(currentState, stack);
                }
                state = this.states[currentState];
                if (!state) {
                  this.reportError("state doesn't exist", currentState);
                  currentState = "start";
                  state = this.states[currentState];
                }
                mapping = this.matchMappings[currentState];
                lastIndex = index2;
                re = this.regExps[currentState];
                re.lastIndex = index2;
              }
              if (rule.consumeLineEnd)
                lastIndex = index2;
              break;
            }
            if (value2) {
              if (typeof type === "string") {
                if ((!rule || rule.merge !== false) && token.type === type) {
                  token.value += value2;
                } else {
                  if (token.type)
                    tokens.push(token);
                  token = { type, value: value2 };
                }
              } else if (type) {
                if (token.type)
                  tokens.push(token);
                token = { type: null, value: "" };
                for (var i2 = 0; i2 < type.length; i2++)
                  tokens.push(type[i2]);
              }
            }
            if (lastIndex == line.length)
              break;
            lastIndex = index2;
            if (matchAttempts++ > MAX_TOKEN_COUNT) {
              if (matchAttempts > 2 * line.length) {
                this.reportError("infinite loop with in ace tokenizer", {
                  startState,
                  line
                });
              }
              while (lastIndex < line.length) {
                if (token.type)
                  tokens.push(token);
                token = {
                  value: line.substring(lastIndex, lastIndex += 500),
                  type: "overflow"
                };
              }
              currentState = "start";
              stack = [];
              break;
            }
          }
          if (token.type)
            tokens.push(token);
          if (stack.length > 1) {
            if (stack[0] !== currentState)
              stack.unshift("#tmp", currentState);
          }
          return {
            tokens,
            state: stack.length ? stack : currentState
          };
        };
        return Tokenizer2;
      }();
      Tokenizer.prototype.reportError = reportError;
      exports3.Tokenizer = Tokenizer;
    });
    ace.define("ace/mode/text_highlight_rules", ["require", "exports", "module", "ace/lib/deep_copy"], function(require2, exports3, module3) {
      var deepCopy = require2("../lib/deep_copy").deepCopy;
      var TextHighlightRules = function() {
        this.$rules = {
          "start": [{
            token: "empty_line",
            regex: "^$"
          }, {
            defaultToken: "text"
          }]
        };
      };
      (function() {
        this.addRules = function(rules, prefix) {
          if (!prefix) {
            for (var key in rules)
              this.$rules[key] = rules[key];
            return;
          }
          for (var key in rules) {
            var state = rules[key];
            for (var i2 = 0; i2 < state.length; i2++) {
              var rule = state[i2];
              if (rule.next || rule.onMatch) {
                if (typeof rule.next == "string") {
                  if (rule.next.indexOf(prefix) !== 0)
                    rule.next = prefix + rule.next;
                }
                if (rule.nextState && rule.nextState.indexOf(prefix) !== 0)
                  rule.nextState = prefix + rule.nextState;
              }
            }
            this.$rules[prefix + key] = state;
          }
        };
        this.getRules = function() {
          return this.$rules;
        };
        this.embedRules = function(HighlightRules, prefix, escapeRules, states, append) {
          var embedRules = typeof HighlightRules == "function" ? new HighlightRules().getRules() : HighlightRules;
          if (states) {
            for (var i2 = 0; i2 < states.length; i2++)
              states[i2] = prefix + states[i2];
          } else {
            states = [];
            for (var key in embedRules)
              states.push(prefix + key);
          }
          this.addRules(embedRules, prefix);
          if (escapeRules) {
            var addRules = Array.prototype[append ? "push" : "unshift"];
            for (var i2 = 0; i2 < states.length; i2++)
              addRules.apply(this.$rules[states[i2]], deepCopy(escapeRules));
          }
          if (!this.$embeds)
            this.$embeds = [];
          this.$embeds.push(prefix);
        };
        this.getEmbeds = function() {
          return this.$embeds;
        };
        var pushState = function(currentState, stack) {
          if (currentState != "start" || stack.length)
            stack.unshift(this.nextState, currentState);
          return this.nextState;
        };
        var popState = function(currentState, stack) {
          stack.shift();
          return stack.shift() || "start";
        };
        this.normalizeRules = function() {
          var id2 = 0;
          var rules = this.$rules;
          function processState(key) {
            var state = rules[key];
            state.processed = true;
            for (var i2 = 0; i2 < state.length; i2++) {
              var rule = state[i2];
              var toInsert = null;
              if (Array.isArray(rule)) {
                toInsert = rule;
                rule = {};
              }
              if (!rule.regex && rule.start) {
                rule.regex = rule.start;
                if (!rule.next)
                  rule.next = [];
                rule.next.push({
                  defaultToken: rule.token
                }, {
                  token: rule.token + ".end",
                  regex: rule.end || rule.start,
                  next: "pop"
                });
                rule.token = rule.token + ".start";
                rule.push = true;
              }
              var next = rule.next || rule.push;
              if (next && Array.isArray(next)) {
                var stateName = rule.stateName;
                if (!stateName) {
                  stateName = rule.token;
                  if (typeof stateName != "string")
                    stateName = stateName[0] || "";
                  if (rules[stateName])
                    stateName += id2++;
                }
                rules[stateName] = next;
                rule.next = stateName;
                processState(stateName);
              } else if (next == "pop") {
                rule.next = popState;
              }
              if (rule.push) {
                rule.nextState = rule.next || rule.push;
                rule.next = pushState;
                delete rule.push;
              }
              if (rule.rules) {
                for (var r in rule.rules) {
                  if (rules[r]) {
                    if (rules[r].push)
                      rules[r].push.apply(rules[r], rule.rules[r]);
                  } else {
                    rules[r] = rule.rules[r];
                  }
                }
              }
              var includeName = typeof rule == "string" ? rule : rule.include;
              if (includeName) {
                if (includeName === "$self")
                  includeName = "start";
                if (Array.isArray(includeName))
                  toInsert = includeName.map(function(x) {
                    return rules[x];
                  });
                else
                  toInsert = rules[includeName];
              }
              if (toInsert) {
                var args = [i2, 1].concat(toInsert);
                if (rule.noEscape)
                  args = args.filter(function(x) {
                    return !x.next;
                  });
                state.splice.apply(state, args);
                i2--;
              }
              if (rule.keywordMap) {
                rule.token = this.createKeywordMapper(rule.keywordMap, rule.defaultToken || "text", rule.caseInsensitive);
                delete rule.defaultToken;
              }
            }
          }
          Object.keys(rules).forEach(processState, this);
        };
        this.createKeywordMapper = function(map, defaultToken, ignoreCase, splitChar) {
          var keywords2 = Object.create(null);
          this.$keywordList = [];
          Object.keys(map).forEach(function(className) {
            var a = map[className];
            var list = a.split(splitChar || "|");
            for (var i2 = list.length; i2--; ) {
              var word = list[i2];
              this.$keywordList.push(word);
              if (ignoreCase)
                word = word.toLowerCase();
              keywords2[word] = className;
            }
          }, this);
          map = null;
          return ignoreCase ? function(value2) {
            return keywords2[value2.toLowerCase()] || defaultToken;
          } : function(value2) {
            return keywords2[value2] || defaultToken;
          };
        };
        this.getKeywords = function() {
          return this.$keywords;
        };
      }).call(TextHighlightRules.prototype);
      exports3.TextHighlightRules = TextHighlightRules;
    });
    ace.define("ace/mode/behaviour", ["require", "exports", "module"], function(require2, exports3, module3) {
      var Behaviour = function() {
        this.$behaviours = {};
      };
      (function() {
        this.add = function(name2, action, callback) {
          switch (void 0) {
            case this.$behaviours:
              this.$behaviours = {};
            case this.$behaviours[name2]:
              this.$behaviours[name2] = {};
          }
          this.$behaviours[name2][action] = callback;
        };
        this.addBehaviours = function(behaviours) {
          for (var key in behaviours) {
            for (var action in behaviours[key]) {
              this.add(key, action, behaviours[key][action]);
            }
          }
        };
        this.remove = function(name2) {
          if (this.$behaviours && this.$behaviours[name2]) {
            delete this.$behaviours[name2];
          }
        };
        this.inherit = function(mode, filter) {
          if (typeof mode === "function") {
            var behaviours = new mode().getBehaviours(filter);
          } else {
            var behaviours = mode.getBehaviours(filter);
          }
          this.addBehaviours(behaviours);
        };
        this.getBehaviours = function(filter) {
          if (!filter) {
            return this.$behaviours;
          } else {
            var ret = {};
            for (var i2 = 0; i2 < filter.length; i2++) {
              if (this.$behaviours[filter[i2]]) {
                ret[filter[i2]] = this.$behaviours[filter[i2]];
              }
            }
            return ret;
          }
        };
      }).call(Behaviour.prototype);
      exports3.Behaviour = Behaviour;
    });
    ace.define("ace/token_iterator", ["require", "exports", "module", "ace/range"], function(require2, exports3, module3) {
      var Range2 = require2("./range").Range;
      var TokenIterator = function() {
        function TokenIterator2(session, initialRow, initialColumn) {
          this.$session = session;
          this.$row = initialRow;
          this.$rowTokens = session.getTokens(initialRow);
          var token = session.getTokenAt(initialRow, initialColumn);
          this.$tokenIndex = token ? token.index : -1;
        }
        TokenIterator2.prototype.stepBackward = function() {
          this.$tokenIndex -= 1;
          while (this.$tokenIndex < 0) {
            this.$row -= 1;
            if (this.$row < 0) {
              this.$row = 0;
              return null;
            }
            this.$rowTokens = this.$session.getTokens(this.$row);
            this.$tokenIndex = this.$rowTokens.length - 1;
          }
          return this.$rowTokens[this.$tokenIndex];
        };
        TokenIterator2.prototype.stepForward = function() {
          this.$tokenIndex += 1;
          var rowCount;
          while (this.$tokenIndex >= this.$rowTokens.length) {
            this.$row += 1;
            if (!rowCount)
              rowCount = this.$session.getLength();
            if (this.$row >= rowCount) {
              this.$row = rowCount - 1;
              return null;
            }
            this.$rowTokens = this.$session.getTokens(this.$row);
            this.$tokenIndex = 0;
          }
          return this.$rowTokens[this.$tokenIndex];
        };
        TokenIterator2.prototype.getCurrentToken = function() {
          return this.$rowTokens[this.$tokenIndex];
        };
        TokenIterator2.prototype.getCurrentTokenRow = function() {
          return this.$row;
        };
        TokenIterator2.prototype.getCurrentTokenColumn = function() {
          var rowTokens = this.$rowTokens;
          var tokenIndex = this.$tokenIndex;
          var column = rowTokens[tokenIndex].start;
          if (column !== void 0)
            return column;
          column = 0;
          while (tokenIndex > 0) {
            tokenIndex -= 1;
            column += rowTokens[tokenIndex].value.length;
          }
          return column;
        };
        TokenIterator2.prototype.getCurrentTokenPosition = function() {
          return { row: this.$row, column: this.getCurrentTokenColumn() };
        };
        TokenIterator2.prototype.getCurrentTokenRange = function() {
          var token = this.$rowTokens[this.$tokenIndex];
          var column = this.getCurrentTokenColumn();
          return new Range2(this.$row, column, this.$row, column + token.value.length);
        };
        return TokenIterator2;
      }();
      exports3.TokenIterator = TokenIterator;
    });
    ace.define("ace/mode/behaviour/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator", "ace/lib/lang"], function(require2, exports3, module3) {
      var oop = require2("../../lib/oop");
      var Behaviour = require2("../behaviour").Behaviour;
      var TokenIterator = require2("../../token_iterator").TokenIterator;
      var lang = require2("../../lib/lang");
      var SAFE_INSERT_IN_TOKENS = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator"];
      var SAFE_INSERT_BEFORE_TOKENS = ["text", "paren.rparen", "rparen", "paren", "punctuation.operator", "comment"];
      var context;
      var contextCache = {};
      var defaultQuotes = { '"': '"', "'": "'" };
      var initContext = function(editor) {
        var id2 = -1;
        if (editor.multiSelect) {
          id2 = editor.selection.index;
          if (contextCache.rangeCount != editor.multiSelect.rangeCount)
            contextCache = { rangeCount: editor.multiSelect.rangeCount };
        }
        if (contextCache[id2])
          return context = contextCache[id2];
        context = contextCache[id2] = {
          autoInsertedBrackets: 0,
          autoInsertedRow: -1,
          autoInsertedLineEnd: "",
          maybeInsertedBrackets: 0,
          maybeInsertedRow: -1,
          maybeInsertedLineStart: "",
          maybeInsertedLineEnd: ""
        };
      };
      var getWrapped = function(selection, selected, opening, closing2) {
        var rowDiff = selection.end.row - selection.start.row;
        return {
          text: opening + selected + closing2,
          selection: [
            0,
            selection.start.column + 1,
            rowDiff,
            selection.end.column + (rowDiff ? 0 : 1)
          ]
        };
      };
      var CstyleBehaviour = function(options) {
        options = options || {};
        this.add("braces", "insertion", function(state, action, editor, session, text) {
          var cursor = editor.getCursorPosition();
          var line = session.doc.getLine(cursor.row);
          if (text == "{") {
            initContext(editor);
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
              return getWrapped(selection, selected, "{", "}");
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
              if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode || options.braces) {
                CstyleBehaviour.recordAutoInsert(editor, session, "}");
                return {
                  text: "{}",
                  selection: [1, 1]
                };
              } else {
                CstyleBehaviour.recordMaybeInsert(editor, session, "{");
                return {
                  text: "{",
                  selection: [1, 1]
                };
              }
            }
          } else if (text == "}") {
            initContext(editor);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == "}") {
              var matching = session.$findOpeningBracket("}", { column: cursor.column + 1, row: cursor.row });
              if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                CstyleBehaviour.popAutoInsertedClosing();
                return {
                  text: "",
                  selection: [1, 1]
                };
              }
            }
          } else if (text == "\n" || text == "\r\n") {
            initContext(editor);
            var closing2 = "";
            if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
              closing2 = lang.stringRepeat("}", context.maybeInsertedBrackets);
              CstyleBehaviour.clearMaybeInsertedClosing();
            }
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar === "}") {
              var openBracePos = session.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 }, "}");
              if (!openBracePos)
                return null;
              var next_indent = this.$getIndent(session.getLine(openBracePos.row));
            } else if (closing2) {
              var next_indent = this.$getIndent(line);
            } else {
              CstyleBehaviour.clearMaybeInsertedClosing();
              return;
            }
            var indent = next_indent + session.getTabString();
            return {
              text: "\n" + indent + "\n" + next_indent + closing2,
              selection: [1, indent.length, 1, indent.length]
            };
          } else {
            CstyleBehaviour.clearMaybeInsertedClosing();
          }
        });
        this.add("braces", "deletion", function(state, action, editor, session, range) {
          var selected = session.doc.getTextRange(range);
          if (!range.isMultiLine() && selected == "{") {
            initContext(editor);
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.end.column, range.end.column + 1);
            if (rightChar == "}") {
              range.end.column++;
              return range;
            } else {
              context.maybeInsertedBrackets--;
            }
          }
        });
        this.add("parens", "insertion", function(state, action, editor, session, text) {
          if (text == "(") {
            initContext(editor);
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
              return getWrapped(selection, selected, "(", ")");
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
              CstyleBehaviour.recordAutoInsert(editor, session, ")");
              return {
                text: "()",
                selection: [1, 1]
              };
            }
          } else if (text == ")") {
            initContext(editor);
            var cursor = editor.getCursorPosition();
            var line = session.doc.getLine(cursor.row);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == ")") {
              var matching = session.$findOpeningBracket(")", { column: cursor.column + 1, row: cursor.row });
              if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                CstyleBehaviour.popAutoInsertedClosing();
                return {
                  text: "",
                  selection: [1, 1]
                };
              }
            }
          }
        });
        this.add("parens", "deletion", function(state, action, editor, session, range) {
          var selected = session.doc.getTextRange(range);
          if (!range.isMultiLine() && selected == "(") {
            initContext(editor);
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == ")") {
              range.end.column++;
              return range;
            }
          }
        });
        this.add("brackets", "insertion", function(state, action, editor, session, text) {
          if (text == "[") {
            initContext(editor);
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && editor.getWrapBehavioursEnabled()) {
              return getWrapped(selection, selected, "[", "]");
            } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
              CstyleBehaviour.recordAutoInsert(editor, session, "]");
              return {
                text: "[]",
                selection: [1, 1]
              };
            }
          } else if (text == "]") {
            initContext(editor);
            var cursor = editor.getCursorPosition();
            var line = session.doc.getLine(cursor.row);
            var rightChar = line.substring(cursor.column, cursor.column + 1);
            if (rightChar == "]") {
              var matching = session.$findOpeningBracket("]", { column: cursor.column + 1, row: cursor.row });
              if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
                CstyleBehaviour.popAutoInsertedClosing();
                return {
                  text: "",
                  selection: [1, 1]
                };
              }
            }
          }
        });
        this.add("brackets", "deletion", function(state, action, editor, session, range) {
          var selected = session.doc.getTextRange(range);
          if (!range.isMultiLine() && selected == "[") {
            initContext(editor);
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == "]") {
              range.end.column++;
              return range;
            }
          }
        });
        this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
          var quotes = session.$mode.$quotes || defaultQuotes;
          if (text.length == 1 && quotes[text]) {
            if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1)
              return;
            initContext(editor);
            var quote = text;
            var selection = editor.getSelectionRange();
            var selected = session.doc.getTextRange(selection);
            if (selected !== "" && (selected.length != 1 || !quotes[selected]) && editor.getWrapBehavioursEnabled()) {
              return getWrapped(selection, selected, quote, quote);
            } else if (!selected) {
              var cursor = editor.getCursorPosition();
              var line = session.doc.getLine(cursor.row);
              var leftChar = line.substring(cursor.column - 1, cursor.column);
              var rightChar = line.substring(cursor.column, cursor.column + 1);
              var token = session.getTokenAt(cursor.row, cursor.column);
              var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
              if (leftChar == "\\" && token && /escape/.test(token.type))
                return null;
              var stringBefore = token && /string|escape/.test(token.type);
              var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
              var pair2;
              if (rightChar == quote) {
                pair2 = stringBefore !== stringAfter;
                if (pair2 && /string\.end/.test(rightToken.type))
                  pair2 = false;
              } else {
                if (stringBefore && !stringAfter)
                  return null;
                if (stringBefore && stringAfter)
                  return null;
                var wordRe = session.$mode.tokenRe;
                wordRe.lastIndex = 0;
                var isWordBefore = wordRe.test(leftChar);
                wordRe.lastIndex = 0;
                var isWordAfter = wordRe.test(rightChar);
                var pairQuotesAfter = session.$mode.$pairQuotesAfter;
                var shouldPairQuotes = pairQuotesAfter && pairQuotesAfter[quote] && pairQuotesAfter[quote].test(leftChar);
                if (!shouldPairQuotes && isWordBefore || isWordAfter)
                  return null;
                if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
                  return null;
                var charBefore2 = line[cursor.column - 2];
                if (leftChar == quote && (charBefore2 == quote || wordRe.test(charBefore2)))
                  return null;
                pair2 = true;
              }
              return {
                text: pair2 ? quote + quote : "",
                selection: [1, 1]
              };
            }
          }
        });
        this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
          var quotes = session.$mode.$quotes || defaultQuotes;
          var selected = session.doc.getTextRange(range);
          if (!range.isMultiLine() && quotes.hasOwnProperty(selected)) {
            initContext(editor);
            var line = session.doc.getLine(range.start.row);
            var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
            if (rightChar == selected) {
              range.end.column++;
              return range;
            }
          }
        });
        if (options.closeDocComment !== false) {
          this.add("doc comment end", "insertion", function(state, action, editor, session, text) {
            if (state === "doc-start" && (text === "\n" || text === "\r\n") && editor.selection.isEmpty()) {
              var cursor = editor.getCursorPosition();
              var line = session.doc.getLine(cursor.row);
              var nextLine = session.doc.getLine(cursor.row + 1);
              var indent = this.$getIndent(line);
              if (/\s*\*/.test(nextLine)) {
                if (/^\s*\*/.test(line)) {
                  return {
                    text: text + indent + "* ",
                    selection: [1, 3 + indent.length, 1, 3 + indent.length]
                  };
                } else {
                  return {
                    text: text + indent + " * ",
                    selection: [1, 3 + indent.length, 1, 3 + indent.length]
                  };
                }
              }
              if (/\/\*\*/.test(line.substring(0, cursor.column))) {
                return {
                  text: text + indent + " * " + text + " " + indent + "*/",
                  selection: [1, 4 + indent.length, 1, 4 + indent.length]
                };
              }
            }
          });
        }
      };
      CstyleBehaviour.isSaneInsertion = function(editor, session) {
        var cursor = editor.getCursorPosition();
        var iterator = new TokenIterator(session, cursor.row, cursor.column);
        if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
          if (/[)}\]]/.test(editor.session.getLine(cursor.row)[cursor.column]))
            return true;
          var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
          if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
            return false;
        }
        iterator.stepForward();
        return iterator.getCurrentTokenRow() !== cursor.row || this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
      };
      CstyleBehaviour.$matchTokenType = function(token, types2) {
        return types2.indexOf(token.type || token) > -1;
      };
      CstyleBehaviour.recordAutoInsert = function(editor, session, bracket2) {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
          context.autoInsertedBrackets = 0;
        context.autoInsertedRow = cursor.row;
        context.autoInsertedLineEnd = bracket2 + line.substr(cursor.column);
        context.autoInsertedBrackets++;
      };
      CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket2) {
        var cursor = editor.getCursorPosition();
        var line = session.doc.getLine(cursor.row);
        if (!this.isMaybeInsertedClosing(cursor, line))
          context.maybeInsertedBrackets = 0;
        context.maybeInsertedRow = cursor.row;
        context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket2;
        context.maybeInsertedLineEnd = line.substr(cursor.column);
        context.maybeInsertedBrackets++;
      };
      CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket2) {
        return context.autoInsertedBrackets > 0 && cursor.row === context.autoInsertedRow && bracket2 === context.autoInsertedLineEnd[0] && line.substr(cursor.column) === context.autoInsertedLineEnd;
      };
      CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
        return context.maybeInsertedBrackets > 0 && cursor.row === context.maybeInsertedRow && line.substr(cursor.column) === context.maybeInsertedLineEnd && line.substr(0, cursor.column) == context.maybeInsertedLineStart;
      };
      CstyleBehaviour.popAutoInsertedClosing = function() {
        context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
        context.autoInsertedBrackets--;
      };
      CstyleBehaviour.clearMaybeInsertedClosing = function() {
        if (context) {
          context.maybeInsertedBrackets = 0;
          context.maybeInsertedRow = -1;
        }
      };
      oop.inherits(CstyleBehaviour, Behaviour);
      exports3.CstyleBehaviour = CstyleBehaviour;
    });
    ace.define("ace/unicode", ["require", "exports", "module"], function(require2, exports3, module3) {
      var wordChars = [48, 9, 8, 25, 5, 0, 2, 25, 48, 0, 11, 0, 5, 0, 6, 22, 2, 30, 2, 457, 5, 11, 15, 4, 8, 0, 2, 0, 18, 116, 2, 1, 3, 3, 9, 0, 2, 2, 2, 0, 2, 19, 2, 82, 2, 138, 2, 4, 3, 155, 12, 37, 3, 0, 8, 38, 10, 44, 2, 0, 2, 1, 2, 1, 2, 0, 9, 26, 6, 2, 30, 10, 7, 61, 2, 9, 5, 101, 2, 7, 3, 9, 2, 18, 3, 0, 17, 58, 3, 100, 15, 53, 5, 0, 6, 45, 211, 57, 3, 18, 2, 5, 3, 11, 3, 9, 2, 1, 7, 6, 2, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 0, 4, 3, 3, 8, 3, 1, 3, 3, 9, 0, 5, 1, 2, 4, 3, 11, 16, 2, 2, 5, 5, 1, 3, 21, 2, 6, 2, 1, 2, 1, 2, 1, 3, 0, 2, 4, 5, 1, 3, 2, 4, 0, 8, 3, 2, 0, 8, 15, 12, 2, 2, 8, 2, 2, 2, 21, 2, 6, 2, 1, 2, 4, 3, 9, 2, 2, 2, 2, 3, 0, 16, 3, 3, 9, 18, 2, 2, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 3, 8, 3, 1, 3, 2, 9, 1, 5, 1, 2, 4, 3, 9, 2, 0, 17, 1, 2, 5, 4, 2, 2, 3, 4, 1, 2, 0, 2, 1, 4, 1, 4, 2, 4, 11, 5, 4, 4, 2, 2, 3, 3, 0, 7, 0, 15, 9, 18, 2, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 4, 7, 2, 2, 2, 3, 8, 1, 2, 1, 7, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 9, 2, 4, 3, 8, 2, 2, 2, 3, 8, 1, 8, 0, 2, 3, 3, 9, 19, 1, 2, 7, 2, 2, 2, 22, 2, 15, 4, 7, 2, 2, 2, 3, 10, 0, 9, 3, 3, 9, 11, 5, 3, 1, 2, 17, 4, 23, 2, 8, 2, 0, 3, 6, 4, 0, 5, 5, 2, 0, 2, 7, 19, 1, 14, 57, 6, 14, 2, 9, 40, 1, 2, 0, 3, 1, 2, 0, 3, 0, 7, 3, 2, 6, 2, 2, 2, 0, 2, 0, 3, 1, 2, 12, 2, 2, 3, 4, 2, 0, 2, 5, 3, 9, 3, 1, 35, 0, 24, 1, 7, 9, 12, 0, 2, 0, 2, 0, 5, 9, 2, 35, 5, 19, 2, 5, 5, 7, 2, 35, 10, 0, 58, 73, 7, 77, 3, 37, 11, 42, 2, 0, 4, 328, 2, 3, 3, 6, 2, 0, 2, 3, 3, 40, 2, 3, 3, 32, 2, 3, 3, 6, 2, 0, 2, 3, 3, 14, 2, 56, 2, 3, 3, 66, 5, 0, 33, 15, 17, 84, 13, 619, 3, 16, 2, 25, 6, 74, 22, 12, 2, 6, 12, 20, 12, 19, 13, 12, 2, 2, 2, 1, 13, 51, 3, 29, 4, 0, 5, 1, 3, 9, 34, 2, 3, 9, 7, 87, 9, 42, 6, 69, 11, 28, 4, 11, 5, 11, 11, 39, 3, 4, 12, 43, 5, 25, 7, 10, 38, 27, 5, 62, 2, 28, 3, 10, 7, 9, 14, 0, 89, 75, 5, 9, 18, 8, 13, 42, 4, 11, 71, 55, 9, 9, 4, 48, 83, 2, 2, 30, 14, 230, 23, 280, 3, 5, 3, 37, 3, 5, 3, 7, 2, 0, 2, 0, 2, 0, 2, 30, 3, 52, 2, 6, 2, 0, 4, 2, 2, 6, 4, 3, 3, 5, 5, 12, 6, 2, 2, 6, 67, 1, 20, 0, 29, 0, 14, 0, 17, 4, 60, 12, 5, 0, 4, 11, 18, 0, 5, 0, 3, 9, 2, 0, 4, 4, 7, 0, 2, 0, 2, 0, 2, 3, 2, 10, 3, 3, 6, 4, 5, 0, 53, 1, 2684, 46, 2, 46, 2, 132, 7, 6, 15, 37, 11, 53, 10, 0, 17, 22, 10, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 6, 2, 31, 48, 0, 470, 1, 36, 5, 2, 4, 6, 1, 5, 85, 3, 1, 3, 2, 2, 89, 2, 3, 6, 40, 4, 93, 18, 23, 57, 15, 513, 6581, 75, 20939, 53, 1164, 68, 45, 3, 268, 4, 27, 21, 31, 3, 13, 13, 1, 2, 24, 9, 69, 11, 1, 38, 8, 3, 102, 3, 1, 111, 44, 25, 51, 13, 68, 12, 9, 7, 23, 4, 0, 5, 45, 3, 35, 13, 28, 4, 64, 15, 10, 39, 54, 10, 13, 3, 9, 7, 22, 4, 1, 5, 66, 25, 2, 227, 42, 2, 1, 3, 9, 7, 11171, 13, 22, 5, 48, 8453, 301, 3, 61, 3, 105, 39, 6, 13, 4, 6, 11, 2, 12, 2, 4, 2, 0, 2, 1, 2, 1, 2, 107, 34, 362, 19, 63, 3, 53, 41, 11, 5, 15, 17, 6, 13, 1, 25, 2, 33, 4, 2, 134, 20, 9, 8, 25, 5, 0, 2, 25, 12, 88, 4, 5, 3, 5, 3, 5, 3, 2];
      var code2 = 0;
      var str = [];
      for (var i2 = 0; i2 < wordChars.length; i2 += 2) {
        str.push(code2 += wordChars[i2]);
        if (wordChars[i2 + 1])
          str.push(45, code2 += wordChars[i2 + 1]);
      }
      exports3.wordChars = String.fromCharCode.apply(null, str);
    });
    ace.define("ace/mode/text", ["require", "exports", "module", "ace/config", "ace/tokenizer", "ace/mode/text_highlight_rules", "ace/mode/behaviour/cstyle", "ace/unicode", "ace/lib/lang", "ace/token_iterator", "ace/range"], function(require2, exports3, module3) {
      var config2 = require2("../config");
      var Tokenizer = require2("../tokenizer").Tokenizer;
      var TextHighlightRules = require2("./text_highlight_rules").TextHighlightRules;
      var CstyleBehaviour = require2("./behaviour/cstyle").CstyleBehaviour;
      var unicode = require2("../unicode");
      var lang = require2("../lib/lang");
      var TokenIterator = require2("../token_iterator").TokenIterator;
      var Range2 = require2("../range").Range;
      var Mode = function() {
        this.HighlightRules = TextHighlightRules;
      };
      (function() {
        this.$defaultBehaviour = new CstyleBehaviour();
        this.tokenRe = new RegExp("^[" + unicode.wordChars + "\\$_]+", "g");
        this.nonTokenRe = new RegExp("^(?:[^" + unicode.wordChars + "\\$_]|\\s])+", "g");
        this.getTokenizer = function() {
          if (!this.$tokenizer) {
            this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig);
            this.$tokenizer = new Tokenizer(this.$highlightRules.getRules());
          }
          return this.$tokenizer;
        };
        this.lineCommentStart = "";
        this.blockComment = "";
        this.toggleCommentLines = function(state, session, startRow, endRow) {
          var doc2 = session.doc;
          var ignoreBlankLines = true;
          var shouldRemove = true;
          var minIndent = Infinity;
          var tabSize = session.getTabSize();
          var insertAtTabStop = false;
          if (!this.lineCommentStart) {
            if (!this.blockComment)
              return false;
            var lineCommentStart = this.blockComment.start;
            var lineCommentEnd = this.blockComment.end;
            var regexpStart = new RegExp("^(\\s*)(?:" + lang.escapeRegExp(lineCommentStart) + ")");
            var regexpEnd = new RegExp("(?:" + lang.escapeRegExp(lineCommentEnd) + ")\\s*$");
            var comment2 = function(line, i2) {
              if (testRemove(line, i2))
                return;
              if (!ignoreBlankLines || /\S/.test(line)) {
                doc2.insertInLine({ row: i2, column: line.length }, lineCommentEnd);
                doc2.insertInLine({ row: i2, column: minIndent }, lineCommentStart);
              }
            };
            var uncomment = function(line, i2) {
              var m;
              if (m = line.match(regexpEnd))
                doc2.removeInLine(i2, line.length - m[0].length, line.length);
              if (m = line.match(regexpStart))
                doc2.removeInLine(i2, m[1].length, m[0].length);
            };
            var testRemove = function(line, row) {
              if (regexpStart.test(line))
                return true;
              var tokens = session.getTokens(row);
              for (var i2 = 0; i2 < tokens.length; i2++) {
                if (tokens[i2].type === "comment")
                  return true;
              }
            };
          } else {
            if (Array.isArray(this.lineCommentStart)) {
              var regexpStart = this.lineCommentStart.map(lang.escapeRegExp).join("|");
              var lineCommentStart = this.lineCommentStart[0];
            } else {
              var regexpStart = lang.escapeRegExp(this.lineCommentStart);
              var lineCommentStart = this.lineCommentStart;
            }
            regexpStart = new RegExp("^(\\s*)(?:" + regexpStart + ") ?");
            insertAtTabStop = session.getUseSoftTabs();
            var uncomment = function(line, i2) {
              var m = line.match(regexpStart);
              if (!m)
                return;
              var start = m[1].length, end = m[0].length;
              if (!shouldInsertSpace(line, start, end) && m[0][end - 1] == " ")
                end--;
              doc2.removeInLine(i2, start, end);
            };
            var commentWithSpace = lineCommentStart + " ";
            var comment2 = function(line, i2) {
              if (!ignoreBlankLines || /\S/.test(line)) {
                if (shouldInsertSpace(line, minIndent, minIndent))
                  doc2.insertInLine({ row: i2, column: minIndent }, commentWithSpace);
                else
                  doc2.insertInLine({ row: i2, column: minIndent }, lineCommentStart);
              }
            };
            var testRemove = function(line, i2) {
              return regexpStart.test(line);
            };
            var shouldInsertSpace = function(line, before, after) {
              var spaces2 = 0;
              while (before-- && line.charAt(before) == " ")
                spaces2++;
              if (spaces2 % tabSize != 0)
                return false;
              var spaces2 = 0;
              while (line.charAt(after++) == " ")
                spaces2++;
              if (tabSize > 2)
                return spaces2 % tabSize != tabSize - 1;
              else
                return spaces2 % tabSize == 0;
            };
          }
          function iter(fun) {
            for (var i2 = startRow; i2 <= endRow; i2++)
              fun(doc2.getLine(i2), i2);
          }
          var minEmptyLength = Infinity;
          iter(function(line, i2) {
            var indent = line.search(/\S/);
            if (indent !== -1) {
              if (indent < minIndent)
                minIndent = indent;
              if (shouldRemove && !testRemove(line, i2))
                shouldRemove = false;
            } else if (minEmptyLength > line.length) {
              minEmptyLength = line.length;
            }
          });
          if (minIndent == Infinity) {
            minIndent = minEmptyLength;
            ignoreBlankLines = false;
            shouldRemove = false;
          }
          if (insertAtTabStop && minIndent % tabSize != 0)
            minIndent = Math.floor(minIndent / tabSize) * tabSize;
          iter(shouldRemove ? uncomment : comment2);
        };
        this.toggleBlockComment = function(state, session, range, cursor) {
          var comment2 = this.blockComment;
          if (!comment2)
            return;
          if (!comment2.start && comment2[0])
            comment2 = comment2[0];
          var iterator = new TokenIterator(session, cursor.row, cursor.column);
          var token = iterator.getCurrentToken();
          session.selection;
          var initialRange = session.selection.toOrientedRange();
          var startRow, colDiff;
          if (token && /comment/.test(token.type)) {
            var startRange, endRange;
            while (token && /comment/.test(token.type)) {
              var i2 = token.value.indexOf(comment2.start);
              if (i2 != -1) {
                var row = iterator.getCurrentTokenRow();
                var column = iterator.getCurrentTokenColumn() + i2;
                startRange = new Range2(row, column, row, column + comment2.start.length);
                break;
              }
              token = iterator.stepBackward();
            }
            var iterator = new TokenIterator(session, cursor.row, cursor.column);
            var token = iterator.getCurrentToken();
            while (token && /comment/.test(token.type)) {
              var i2 = token.value.indexOf(comment2.end);
              if (i2 != -1) {
                var row = iterator.getCurrentTokenRow();
                var column = iterator.getCurrentTokenColumn() + i2;
                endRange = new Range2(row, column, row, column + comment2.end.length);
                break;
              }
              token = iterator.stepForward();
            }
            if (endRange)
              session.remove(endRange);
            if (startRange) {
              session.remove(startRange);
              startRow = startRange.start.row;
              colDiff = -comment2.start.length;
            }
          } else {
            colDiff = comment2.start.length;
            startRow = range.start.row;
            session.insert(range.end, comment2.end);
            session.insert(range.start, comment2.start);
          }
          if (initialRange.start.row == startRow)
            initialRange.start.column += colDiff;
          if (initialRange.end.row == startRow)
            initialRange.end.column += colDiff;
          session.selection.fromOrientedRange(initialRange);
        };
        this.getNextLineIndent = function(state, line, tab) {
          return this.$getIndent(line);
        };
        this.checkOutdent = function(state, line, input) {
          return false;
        };
        this.autoOutdent = function(state, doc2, row) {
        };
        this.$getIndent = function(line) {
          return line.match(/^\s*/)[0];
        };
        this.createWorker = function(session) {
          return null;
        };
        this.createModeDelegates = function(mapping) {
          this.$embeds = [];
          this.$modes = {};
          for (var i2 in mapping) {
            if (mapping[i2]) {
              var Mode2 = mapping[i2];
              var id2 = Mode2.prototype.$id;
              var mode = config2.$modes[id2];
              if (!mode)
                config2.$modes[id2] = mode = new Mode2();
              if (!config2.$modes[i2])
                config2.$modes[i2] = mode;
              this.$embeds.push(i2);
              this.$modes[i2] = mode;
            }
          }
          var delegations = [
            "toggleBlockComment",
            "toggleCommentLines",
            "getNextLineIndent",
            "checkOutdent",
            "autoOutdent",
            "transformAction",
            "getCompletions"
          ];
          for (var i2 = 0; i2 < delegations.length; i2++) {
            (function(scope) {
              var functionName = delegations[i2];
              var defaultHandler = scope[functionName];
              scope[delegations[i2]] = function() {
                return this.$delegator(functionName, arguments, defaultHandler);
              };
            })(this);
          }
        };
        this.$delegator = function(method, args, defaultHandler) {
          var state = args[0] || "start";
          if (typeof state != "string") {
            if (Array.isArray(state[2])) {
              var language2 = state[2][state[2].length - 1];
              var mode = this.$modes[language2];
              if (mode)
                return mode[method].apply(mode, [state[1]].concat([].slice.call(args, 1)));
            }
            state = state[0] || "start";
          }
          for (var i2 = 0; i2 < this.$embeds.length; i2++) {
            if (!this.$modes[this.$embeds[i2]])
              continue;
            var split = state.split(this.$embeds[i2]);
            if (!split[0] && split[1]) {
              args[0] = split[1];
              var mode = this.$modes[this.$embeds[i2]];
              return mode[method].apply(mode, args);
            }
          }
          var ret = defaultHandler.apply(this, args);
          return defaultHandler ? ret : void 0;
        };
        this.transformAction = function(state, action, editor, session, param) {
          if (this.$behaviour) {
            var behaviours = this.$behaviour.getBehaviours();
            for (var key in behaviours) {
              if (behaviours[key][action]) {
                var ret = behaviours[key][action].apply(this, arguments);
                if (ret) {
                  return ret;
                }
              }
            }
          }
        };
        this.getKeywords = function(append) {
          if (!this.completionKeywords) {
            var rules = this.$tokenizer.rules;
            var completionKeywords = [];
            for (var rule in rules) {
              var ruleItr = rules[rule];
              for (var r = 0, l = ruleItr.length; r < l; r++) {
                if (typeof ruleItr[r].token === "string") {
                  if (/keyword|support|storage/.test(ruleItr[r].token))
                    completionKeywords.push(ruleItr[r].regex);
                } else if (typeof ruleItr[r].token === "object") {
                  for (var a = 0, aLength = ruleItr[r].token.length; a < aLength; a++) {
                    if (/keyword|support|storage/.test(ruleItr[r].token[a])) {
                      var rule = ruleItr[r].regex.match(/\(.+?\)/g)[a];
                      completionKeywords.push(rule.substr(1, rule.length - 2));
                    }
                  }
                }
              }
            }
            this.completionKeywords = completionKeywords;
          }
          if (!append)
            return this.$keywordList;
          return completionKeywords.concat(this.$keywordList || []);
        };
        this.$createKeywordList = function() {
          if (!this.$highlightRules)
            this.getTokenizer();
          return this.$keywordList = this.$highlightRules.$keywordList || [];
        };
        this.getCompletions = function(state, session, pos, prefix) {
          var keywords2 = this.$keywordList || this.$createKeywordList();
          return keywords2.map(function(word) {
            return {
              name: word,
              value: word,
              score: 0,
              meta: "keyword"
            };
          });
        };
        this.$id = "ace/mode/text";
      }).call(Mode.prototype);
      exports3.Mode = Mode;
    });
    ace.define("ace/apply_delta", ["require", "exports", "module"], function(require2, exports3, module3) {
      exports3.applyDelta = function(docLines, delta, doNotValidate) {
        var row = delta.start.row;
        var startColumn = delta.start.column;
        var line = docLines[row] || "";
        switch (delta.action) {
          case "insert":
            var lines = delta.lines;
            if (lines.length === 1) {
              docLines[row] = line.substring(0, startColumn) + delta.lines[0] + line.substring(startColumn);
            } else {
              var args = [row, 1].concat(delta.lines);
              docLines.splice.apply(docLines, args);
              docLines[row] = line.substring(0, startColumn) + docLines[row];
              docLines[row + delta.lines.length - 1] += line.substring(startColumn);
            }
            break;
          case "remove":
            var endColumn = delta.end.column;
            var endRow = delta.end.row;
            if (row === endRow) {
              docLines[row] = line.substring(0, startColumn) + line.substring(endColumn);
            } else {
              docLines.splice(row, endRow - row + 1, line.substring(0, startColumn) + docLines[endRow].substring(endColumn));
            }
            break;
        }
      };
    });
    ace.define("ace/anchor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var Anchor = function() {
        function Anchor2(doc2, row, column) {
          this.$onChange = this.onChange.bind(this);
          this.attach(doc2);
          if (typeof column == "undefined")
            this.setPosition(row.row, row.column);
          else
            this.setPosition(row, column);
        }
        Anchor2.prototype.getPosition = function() {
          return this.$clipPositionToDocument(this.row, this.column);
        };
        Anchor2.prototype.getDocument = function() {
          return this.document;
        };
        Anchor2.prototype.onChange = function(delta) {
          if (delta.start.row == delta.end.row && delta.start.row != this.row)
            return;
          if (delta.start.row > this.row)
            return;
          var point = $getTransformedPoint(delta, { row: this.row, column: this.column }, this.$insertRight);
          this.setPosition(point.row, point.column, true);
        };
        Anchor2.prototype.setPosition = function(row, column, noClip) {
          var pos;
          if (noClip) {
            pos = {
              row,
              column
            };
          } else {
            pos = this.$clipPositionToDocument(row, column);
          }
          if (this.row == pos.row && this.column == pos.column)
            return;
          var old = {
            row: this.row,
            column: this.column
          };
          this.row = pos.row;
          this.column = pos.column;
          this._signal("change", {
            old,
            value: pos
          });
        };
        Anchor2.prototype.detach = function() {
          this.document.off("change", this.$onChange);
        };
        Anchor2.prototype.attach = function(doc2) {
          this.document = doc2 || this.document;
          this.document.on("change", this.$onChange);
        };
        Anchor2.prototype.$clipPositionToDocument = function(row, column) {
          var pos = {};
          if (row >= this.document.getLength()) {
            pos.row = Math.max(0, this.document.getLength() - 1);
            pos.column = this.document.getLine(pos.row).length;
          } else if (row < 0) {
            pos.row = 0;
            pos.column = 0;
          } else {
            pos.row = row;
            pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column));
          }
          if (column < 0)
            pos.column = 0;
          return pos;
        };
        return Anchor2;
      }();
      Anchor.prototype.$insertRight = false;
      oop.implement(Anchor.prototype, EventEmitter);
      function $pointsInOrder(point1, point2, equalPointsInOrder) {
        var bColIsAfter = equalPointsInOrder ? point1.column <= point2.column : point1.column < point2.column;
        return point1.row < point2.row || point1.row == point2.row && bColIsAfter;
      }
      function $getTransformedPoint(delta, point, moveIfEqual) {
        var deltaIsInsert = delta.action == "insert";
        var deltaRowShift = (deltaIsInsert ? 1 : -1) * (delta.end.row - delta.start.row);
        var deltaColShift = (deltaIsInsert ? 1 : -1) * (delta.end.column - delta.start.column);
        var deltaStart = delta.start;
        var deltaEnd = deltaIsInsert ? deltaStart : delta.end;
        if ($pointsInOrder(point, deltaStart, moveIfEqual)) {
          return {
            row: point.row,
            column: point.column
          };
        }
        if ($pointsInOrder(deltaEnd, point, !moveIfEqual)) {
          return {
            row: point.row + deltaRowShift,
            column: point.column + (point.row == deltaEnd.row ? deltaColShift : 0)
          };
        }
        return {
          row: deltaStart.row,
          column: deltaStart.column
        };
      }
      exports3.Anchor = Anchor;
    });
    ace.define("ace/document", ["require", "exports", "module", "ace/lib/oop", "ace/apply_delta", "ace/lib/event_emitter", "ace/range", "ace/anchor"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var applyDelta = require2("./apply_delta").applyDelta;
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var Range2 = require2("./range").Range;
      var Anchor = require2("./anchor").Anchor;
      var Document = function() {
        function Document2(textOrLines) {
          this.$lines = [""];
          if (textOrLines.length === 0) {
            this.$lines = [""];
          } else if (Array.isArray(textOrLines)) {
            this.insertMergedLines({ row: 0, column: 0 }, textOrLines);
          } else {
            this.insert({ row: 0, column: 0 }, textOrLines);
          }
        }
        Document2.prototype.setValue = function(text) {
          var len = this.getLength() - 1;
          this.remove(new Range2(0, 0, len, this.getLine(len).length));
          this.insert({ row: 0, column: 0 }, text || "");
        };
        Document2.prototype.getValue = function() {
          return this.getAllLines().join(this.getNewLineCharacter());
        };
        Document2.prototype.createAnchor = function(row, column) {
          return new Anchor(this, row, column);
        };
        Document2.prototype.$detectNewLine = function(text) {
          var match = text.match(/^.*?(\r\n|\r|\n)/m);
          this.$autoNewLine = match ? match[1] : "\n";
          this._signal("changeNewLineMode");
        };
        Document2.prototype.getNewLineCharacter = function() {
          switch (this.$newLineMode) {
            case "windows":
              return "\r\n";
            case "unix":
              return "\n";
            default:
              return this.$autoNewLine || "\n";
          }
        };
        Document2.prototype.setNewLineMode = function(newLineMode) {
          if (this.$newLineMode === newLineMode)
            return;
          this.$newLineMode = newLineMode;
          this._signal("changeNewLineMode");
        };
        Document2.prototype.getNewLineMode = function() {
          return this.$newLineMode;
        };
        Document2.prototype.isNewLine = function(text) {
          return text == "\r\n" || text == "\r" || text == "\n";
        };
        Document2.prototype.getLine = function(row) {
          return this.$lines[row] || "";
        };
        Document2.prototype.getLines = function(firstRow, lastRow) {
          return this.$lines.slice(firstRow, lastRow + 1);
        };
        Document2.prototype.getAllLines = function() {
          return this.getLines(0, this.getLength());
        };
        Document2.prototype.getLength = function() {
          return this.$lines.length;
        };
        Document2.prototype.getTextRange = function(range) {
          return this.getLinesForRange(range).join(this.getNewLineCharacter());
        };
        Document2.prototype.getLinesForRange = function(range) {
          var lines;
          if (range.start.row === range.end.row) {
            lines = [this.getLine(range.start.row).substring(range.start.column, range.end.column)];
          } else {
            lines = this.getLines(range.start.row, range.end.row);
            lines[0] = (lines[0] || "").substring(range.start.column);
            var l = lines.length - 1;
            if (range.end.row - range.start.row == l)
              lines[l] = lines[l].substring(0, range.end.column);
          }
          return lines;
        };
        Document2.prototype.insertLines = function(row, lines) {
          console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");
          return this.insertFullLines(row, lines);
        };
        Document2.prototype.removeLines = function(firstRow, lastRow) {
          console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");
          return this.removeFullLines(firstRow, lastRow);
        };
        Document2.prototype.insertNewLine = function(position) {
          console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");
          return this.insertMergedLines(position, ["", ""]);
        };
        Document2.prototype.insert = function(position, text) {
          if (this.getLength() <= 1)
            this.$detectNewLine(text);
          return this.insertMergedLines(position, this.$split(text));
        };
        Document2.prototype.insertInLine = function(position, text) {
          var start = this.clippedPos(position.row, position.column);
          var end = this.pos(position.row, position.column + text.length);
          this.applyDelta({
            start,
            end,
            action: "insert",
            lines: [text]
          }, true);
          return this.clonePos(end);
        };
        Document2.prototype.clippedPos = function(row, column) {
          var length = this.getLength();
          if (row === void 0) {
            row = length;
          } else if (row < 0) {
            row = 0;
          } else if (row >= length) {
            row = length - 1;
            column = void 0;
          }
          var line = this.getLine(row);
          if (column == void 0)
            column = line.length;
          column = Math.min(Math.max(column, 0), line.length);
          return { row, column };
        };
        Document2.prototype.clonePos = function(pos) {
          return { row: pos.row, column: pos.column };
        };
        Document2.prototype.pos = function(row, column) {
          return { row, column };
        };
        Document2.prototype.$clipPosition = function(position) {
          var length = this.getLength();
          if (position.row >= length) {
            position.row = Math.max(0, length - 1);
            position.column = this.getLine(length - 1).length;
          } else {
            position.row = Math.max(0, position.row);
            position.column = Math.min(Math.max(position.column, 0), this.getLine(position.row).length);
          }
          return position;
        };
        Document2.prototype.insertFullLines = function(row, lines) {
          row = Math.min(Math.max(row, 0), this.getLength());
          var column = 0;
          if (row < this.getLength()) {
            lines = lines.concat([""]);
            column = 0;
          } else {
            lines = [""].concat(lines);
            row--;
            column = this.$lines[row].length;
          }
          this.insertMergedLines({ row, column }, lines);
        };
        Document2.prototype.insertMergedLines = function(position, lines) {
          var start = this.clippedPos(position.row, position.column);
          var end = {
            row: start.row + lines.length - 1,
            column: (lines.length == 1 ? start.column : 0) + lines[lines.length - 1].length
          };
          this.applyDelta({
            start,
            end,
            action: "insert",
            lines
          });
          return this.clonePos(end);
        };
        Document2.prototype.remove = function(range) {
          var start = this.clippedPos(range.start.row, range.start.column);
          var end = this.clippedPos(range.end.row, range.end.column);
          this.applyDelta({
            start,
            end,
            action: "remove",
            lines: this.getLinesForRange({ start, end })
          });
          return this.clonePos(start);
        };
        Document2.prototype.removeInLine = function(row, startColumn, endColumn) {
          var start = this.clippedPos(row, startColumn);
          var end = this.clippedPos(row, endColumn);
          this.applyDelta({
            start,
            end,
            action: "remove",
            lines: this.getLinesForRange({ start, end })
          }, true);
          return this.clonePos(start);
        };
        Document2.prototype.removeFullLines = function(firstRow, lastRow) {
          firstRow = Math.min(Math.max(0, firstRow), this.getLength() - 1);
          lastRow = Math.min(Math.max(0, lastRow), this.getLength() - 1);
          var deleteFirstNewLine = lastRow == this.getLength() - 1 && firstRow > 0;
          var deleteLastNewLine = lastRow < this.getLength() - 1;
          var startRow = deleteFirstNewLine ? firstRow - 1 : firstRow;
          var startCol = deleteFirstNewLine ? this.getLine(startRow).length : 0;
          var endRow = deleteLastNewLine ? lastRow + 1 : lastRow;
          var endCol = deleteLastNewLine ? 0 : this.getLine(endRow).length;
          var range = new Range2(startRow, startCol, endRow, endCol);
          var deletedLines = this.$lines.slice(firstRow, lastRow + 1);
          this.applyDelta({
            start: range.start,
            end: range.end,
            action: "remove",
            lines: this.getLinesForRange(range)
          });
          return deletedLines;
        };
        Document2.prototype.removeNewLine = function(row) {
          if (row < this.getLength() - 1 && row >= 0) {
            this.applyDelta({
              start: this.pos(row, this.getLine(row).length),
              end: this.pos(row + 1, 0),
              action: "remove",
              lines: ["", ""]
            });
          }
        };
        Document2.prototype.replace = function(range, text) {
          if (!(range instanceof Range2))
            range = Range2.fromPoints(range.start, range.end);
          if (text.length === 0 && range.isEmpty())
            return range.start;
          if (text == this.getTextRange(range))
            return range.end;
          this.remove(range);
          var end;
          if (text) {
            end = this.insert(range.start, text);
          } else {
            end = range.start;
          }
          return end;
        };
        Document2.prototype.applyDeltas = function(deltas) {
          for (var i2 = 0; i2 < deltas.length; i2++) {
            this.applyDelta(deltas[i2]);
          }
        };
        Document2.prototype.revertDeltas = function(deltas) {
          for (var i2 = deltas.length - 1; i2 >= 0; i2--) {
            this.revertDelta(deltas[i2]);
          }
        };
        Document2.prototype.applyDelta = function(delta, doNotValidate) {
          var isInsert = delta.action == "insert";
          if (isInsert ? delta.lines.length <= 1 && !delta.lines[0] : !Range2.comparePoints(delta.start, delta.end)) {
            return;
          }
          if (isInsert && delta.lines.length > 2e4) {
            this.$splitAndapplyLargeDelta(delta, 2e4);
          } else {
            applyDelta(this.$lines, delta, doNotValidate);
            this._signal("change", delta);
          }
        };
        Document2.prototype.$safeApplyDelta = function(delta) {
          var docLength = this.$lines.length;
          if (delta.action == "remove" && delta.start.row < docLength && delta.end.row < docLength || delta.action == "insert" && delta.start.row <= docLength) {
            this.applyDelta(delta);
          }
        };
        Document2.prototype.$splitAndapplyLargeDelta = function(delta, MAX2) {
          var lines = delta.lines;
          var l = lines.length - MAX2 + 1;
          var row = delta.start.row;
          var column = delta.start.column;
          for (var from = 0, to = 0; from < l; from = to) {
            to += MAX2 - 1;
            var chunk = lines.slice(from, to);
            chunk.push("");
            this.applyDelta({
              start: this.pos(row + from, column),
              end: this.pos(row + to, column = 0),
              action: delta.action,
              lines: chunk
            }, true);
          }
          delta.lines = lines.slice(from);
          delta.start.row = row + from;
          delta.start.column = column;
          this.applyDelta(delta, true);
        };
        Document2.prototype.revertDelta = function(delta) {
          this.$safeApplyDelta({
            start: this.clonePos(delta.start),
            end: this.clonePos(delta.end),
            action: delta.action == "insert" ? "remove" : "insert",
            lines: delta.lines.slice()
          });
        };
        Document2.prototype.indexToPosition = function(index2, startRow) {
          var lines = this.$lines || this.getAllLines();
          var newlineLength = this.getNewLineCharacter().length;
          for (var i2 = startRow || 0, l = lines.length; i2 < l; i2++) {
            index2 -= lines[i2].length + newlineLength;
            if (index2 < 0)
              return { row: i2, column: index2 + lines[i2].length + newlineLength };
          }
          return { row: l - 1, column: index2 + lines[l - 1].length + newlineLength };
        };
        Document2.prototype.positionToIndex = function(pos, startRow) {
          var lines = this.$lines || this.getAllLines();
          var newlineLength = this.getNewLineCharacter().length;
          var index2 = 0;
          var row = Math.min(pos.row, lines.length);
          for (var i2 = startRow || 0; i2 < row; ++i2)
            index2 += lines[i2].length + newlineLength;
          return index2 + pos.column;
        };
        Document2.prototype.$split = function(text) {
          return text.split(/\r\n|\r|\n/);
        };
        return Document2;
      }();
      Document.prototype.$autoNewLine = "";
      Document.prototype.$newLineMode = "auto";
      oop.implement(Document.prototype, EventEmitter);
      exports3.Document = Document;
    });
    ace.define("ace/background_tokenizer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var BackgroundTokenizer = function() {
        function BackgroundTokenizer2(tokenizer, editor) {
          this.running = false;
          this.lines = [];
          this.states = [];
          this.currentLine = 0;
          this.tokenizer = tokenizer;
          var self2 = this;
          this.$worker = function() {
            if (!self2.running) {
              return;
            }
            var workerStart = new Date();
            var currentLine = self2.currentLine;
            var endLine = -1;
            var doc2 = self2.doc;
            var startLine = currentLine;
            while (self2.lines[currentLine])
              currentLine++;
            var len = doc2.getLength();
            var processedLines = 0;
            self2.running = false;
            while (currentLine < len) {
              self2.$tokenizeRow(currentLine);
              endLine = currentLine;
              do {
                currentLine++;
              } while (self2.lines[currentLine]);
              processedLines++;
              if (processedLines % 5 === 0 && new Date() - workerStart > 20) {
                self2.running = setTimeout(self2.$worker, 20);
                break;
              }
            }
            self2.currentLine = currentLine;
            if (endLine == -1)
              endLine = currentLine;
            if (startLine <= endLine)
              self2.fireUpdateEvent(startLine, endLine);
          };
        }
        BackgroundTokenizer2.prototype.setTokenizer = function(tokenizer) {
          this.tokenizer = tokenizer;
          this.lines = [];
          this.states = [];
          this.start(0);
        };
        BackgroundTokenizer2.prototype.setDocument = function(doc2) {
          this.doc = doc2;
          this.lines = [];
          this.states = [];
          this.stop();
        };
        BackgroundTokenizer2.prototype.fireUpdateEvent = function(firstRow, lastRow) {
          var data2 = {
            first: firstRow,
            last: lastRow
          };
          this._signal("update", { data: data2 });
        };
        BackgroundTokenizer2.prototype.start = function(startRow) {
          this.currentLine = Math.min(startRow || 0, this.currentLine, this.doc.getLength());
          this.lines.splice(this.currentLine, this.lines.length);
          this.states.splice(this.currentLine, this.states.length);
          this.stop();
          this.running = setTimeout(this.$worker, 700);
        };
        BackgroundTokenizer2.prototype.scheduleStart = function() {
          if (!this.running)
            this.running = setTimeout(this.$worker, 700);
        };
        BackgroundTokenizer2.prototype.$updateOnChange = function(delta) {
          var startRow = delta.start.row;
          var len = delta.end.row - startRow;
          if (len === 0) {
            this.lines[startRow] = null;
          } else if (delta.action == "remove") {
            this.lines.splice(startRow, len + 1, null);
            this.states.splice(startRow, len + 1, null);
          } else {
            var args = Array(len + 1);
            args.unshift(startRow, 1);
            this.lines.splice.apply(this.lines, args);
            this.states.splice.apply(this.states, args);
          }
          this.currentLine = Math.min(startRow, this.currentLine, this.doc.getLength());
          this.stop();
        };
        BackgroundTokenizer2.prototype.stop = function() {
          if (this.running)
            clearTimeout(this.running);
          this.running = false;
        };
        BackgroundTokenizer2.prototype.getTokens = function(row) {
          return this.lines[row] || this.$tokenizeRow(row);
        };
        BackgroundTokenizer2.prototype.getState = function(row) {
          if (this.currentLine == row)
            this.$tokenizeRow(row);
          return this.states[row] || "start";
        };
        BackgroundTokenizer2.prototype.$tokenizeRow = function(row) {
          var line = this.doc.getLine(row);
          var state = this.states[row - 1];
          var data2 = this.tokenizer.getLineTokens(line, state, row);
          if (this.states[row] + "" !== data2.state + "") {
            this.states[row] = data2.state;
            this.lines[row + 1] = null;
            if (this.currentLine > row + 1)
              this.currentLine = row + 1;
          } else if (this.currentLine == row) {
            this.currentLine = row + 1;
          }
          return this.lines[row] = data2.tokens;
        };
        BackgroundTokenizer2.prototype.cleanup = function() {
          this.running = false;
          this.lines = [];
          this.states = [];
          this.currentLine = 0;
          this.removeAllListeners();
        };
        return BackgroundTokenizer2;
      }();
      oop.implement(BackgroundTokenizer.prototype, EventEmitter);
      exports3.BackgroundTokenizer = BackgroundTokenizer;
    });
    ace.define("ace/search_highlight", ["require", "exports", "module", "ace/lib/lang", "ace/range"], function(require2, exports3, module3) {
      var lang = require2("./lib/lang");
      var Range2 = require2("./range").Range;
      var SearchHighlight = function() {
        function SearchHighlight2(regExp, clazz, type) {
          if (type === void 0) {
            type = "text";
          }
          this.setRegexp(regExp);
          this.clazz = clazz;
          this.type = type;
        }
        SearchHighlight2.prototype.setRegexp = function(regExp) {
          if (this.regExp + "" == regExp + "")
            return;
          this.regExp = regExp;
          this.cache = [];
        };
        SearchHighlight2.prototype.update = function(html, markerLayer, session, config2) {
          if (!this.regExp)
            return;
          var start = config2.firstRow, end = config2.lastRow;
          var renderedMarkerRanges = {};
          for (var i2 = start; i2 <= end; i2++) {
            var ranges = this.cache[i2];
            if (ranges == null) {
              ranges = lang.getMatchOffsets(session.getLine(i2), this.regExp);
              if (ranges.length > this.MAX_RANGES)
                ranges = ranges.slice(0, this.MAX_RANGES);
              ranges = ranges.map(function(match) {
                return new Range2(i2, match.offset, i2, match.offset + match.length);
              });
              this.cache[i2] = ranges.length ? ranges : "";
            }
            for (var j = ranges.length; j--; ) {
              var rangeToAddMarkerTo = ranges[j].toScreenRange(session);
              var rangeAsString = rangeToAddMarkerTo.toString();
              if (renderedMarkerRanges[rangeAsString])
                continue;
              renderedMarkerRanges[rangeAsString] = true;
              markerLayer.drawSingleLineMarker(html, rangeToAddMarkerTo, this.clazz, config2);
            }
          }
        };
        return SearchHighlight2;
      }();
      SearchHighlight.prototype.MAX_RANGES = 500;
      exports3.SearchHighlight = SearchHighlight;
    });
    ace.define("ace/undomanager", ["require", "exports", "module", "ace/range"], function(require2, exports3, module3) {
      var UndoManager = function() {
        function UndoManager2() {
          this.$maxRev = 0;
          this.$fromUndo = false;
          this.$undoDepth = Infinity;
          this.reset();
        }
        UndoManager2.prototype.addSession = function(session) {
          this.$session = session;
        };
        UndoManager2.prototype.add = function(delta, allowMerge, session) {
          if (this.$fromUndo)
            return;
          if (delta == this.$lastDelta)
            return;
          if (!this.$keepRedoStack)
            this.$redoStack.length = 0;
          if (allowMerge === false || !this.lastDeltas) {
            this.lastDeltas = [];
            var undoStackLength = this.$undoStack.length;
            if (undoStackLength > this.$undoDepth - 1) {
              this.$undoStack.splice(0, undoStackLength - this.$undoDepth + 1);
            }
            this.$undoStack.push(this.lastDeltas);
            delta.id = this.$rev = ++this.$maxRev;
          }
          if (delta.action == "remove" || delta.action == "insert")
            this.$lastDelta = delta;
          this.lastDeltas.push(delta);
        };
        UndoManager2.prototype.addSelection = function(selection, rev) {
          this.selections.push({
            value: selection,
            rev: rev || this.$rev
          });
        };
        UndoManager2.prototype.startNewGroup = function() {
          this.lastDeltas = null;
          return this.$rev;
        };
        UndoManager2.prototype.markIgnored = function(from, to) {
          if (to == null)
            to = this.$rev + 1;
          var stack = this.$undoStack;
          for (var i2 = stack.length; i2--; ) {
            var delta = stack[i2][0];
            if (delta.id <= from)
              break;
            if (delta.id < to)
              delta.ignore = true;
          }
          this.lastDeltas = null;
        };
        UndoManager2.prototype.getSelection = function(rev, after) {
          var stack = this.selections;
          for (var i2 = stack.length; i2--; ) {
            var selection = stack[i2];
            if (selection.rev < rev) {
              if (after)
                selection = stack[i2 + 1];
              return selection;
            }
          }
        };
        UndoManager2.prototype.getRevision = function() {
          return this.$rev;
        };
        UndoManager2.prototype.getDeltas = function(from, to) {
          if (to == null)
            to = this.$rev + 1;
          var stack = this.$undoStack;
          var end = null, start = 0;
          for (var i2 = stack.length; i2--; ) {
            var delta = stack[i2][0];
            if (delta.id < to && !end)
              end = i2 + 1;
            if (delta.id <= from) {
              start = i2 + 1;
              break;
            }
          }
          return stack.slice(start, end);
        };
        UndoManager2.prototype.getChangedRanges = function(from, to) {
          if (to == null)
            to = this.$rev + 1;
        };
        UndoManager2.prototype.getChangedLines = function(from, to) {
          if (to == null)
            to = this.$rev + 1;
        };
        UndoManager2.prototype.undo = function(session, dontSelect) {
          this.lastDeltas = null;
          var stack = this.$undoStack;
          if (!rearrangeUndoStack(stack, stack.length))
            return;
          if (!session)
            session = this.$session;
          if (this.$redoStackBaseRev !== this.$rev && this.$redoStack.length)
            this.$redoStack = [];
          this.$fromUndo = true;
          var deltaSet = stack.pop();
          var undoSelectionRange = null;
          if (deltaSet) {
            undoSelectionRange = session.undoChanges(deltaSet, dontSelect);
            this.$redoStack.push(deltaSet);
            this.$syncRev();
          }
          this.$fromUndo = false;
          return undoSelectionRange;
        };
        UndoManager2.prototype.redo = function(session, dontSelect) {
          this.lastDeltas = null;
          if (!session)
            session = this.$session;
          this.$fromUndo = true;
          if (this.$redoStackBaseRev != this.$rev) {
            var diff = this.getDeltas(this.$redoStackBaseRev, this.$rev + 1);
            rebaseRedoStack(this.$redoStack, diff);
            this.$redoStackBaseRev = this.$rev;
            this.$redoStack.forEach(function(x) {
              x[0].id = ++this.$maxRev;
            }, this);
          }
          var deltaSet = this.$redoStack.pop();
          var redoSelectionRange = null;
          if (deltaSet) {
            redoSelectionRange = session.redoChanges(deltaSet, dontSelect);
            this.$undoStack.push(deltaSet);
            this.$syncRev();
          }
          this.$fromUndo = false;
          return redoSelectionRange;
        };
        UndoManager2.prototype.$syncRev = function() {
          var stack = this.$undoStack;
          var nextDelta = stack[stack.length - 1];
          var id2 = nextDelta && nextDelta[0].id || 0;
          this.$redoStackBaseRev = id2;
          this.$rev = id2;
        };
        UndoManager2.prototype.reset = function() {
          this.lastDeltas = null;
          this.$lastDelta = null;
          this.$undoStack = [];
          this.$redoStack = [];
          this.$rev = 0;
          this.mark = 0;
          this.$redoStackBaseRev = this.$rev;
          this.selections = [];
        };
        UndoManager2.prototype.canUndo = function() {
          return this.$undoStack.length > 0;
        };
        UndoManager2.prototype.canRedo = function() {
          return this.$redoStack.length > 0;
        };
        UndoManager2.prototype.bookmark = function(rev) {
          if (rev == void 0)
            rev = this.$rev;
          this.mark = rev;
        };
        UndoManager2.prototype.isAtBookmark = function() {
          return this.$rev === this.mark;
        };
        UndoManager2.prototype.toJSON = function() {
          return {
            $redoStack: this.$redoStack,
            $undoStack: this.$undoStack
          };
        };
        UndoManager2.prototype.fromJSON = function(json) {
          this.reset();
          this.$undoStack = json.$undoStack;
          this.$redoStack = json.$redoStack;
        };
        UndoManager2.prototype.$prettyPrint = function(delta) {
          if (delta)
            return stringifyDelta(delta);
          return stringifyDelta(this.$undoStack) + "\n---\n" + stringifyDelta(this.$redoStack);
        };
        return UndoManager2;
      }();
      UndoManager.prototype.hasUndo = UndoManager.prototype.canUndo;
      UndoManager.prototype.hasRedo = UndoManager.prototype.canRedo;
      UndoManager.prototype.isClean = UndoManager.prototype.isAtBookmark;
      UndoManager.prototype.markClean = UndoManager.prototype.bookmark;
      function rearrangeUndoStack(stack, pos) {
        for (var i2 = pos; i2--; ) {
          var deltaSet = stack[i2];
          if (deltaSet && !deltaSet[0].ignore) {
            while (i2 < pos - 1) {
              var swapped = swapGroups(stack[i2], stack[i2 + 1]);
              stack[i2] = swapped[0];
              stack[i2 + 1] = swapped[1];
              i2++;
            }
            return true;
          }
        }
      }
      var Range2 = require2("./range").Range;
      var cmp = Range2.comparePoints;
      Range2.comparePoints;
      function clonePos(pos) {
        return { row: pos.row, column: pos.column };
      }
      function cloneDelta(d) {
        return {
          start: clonePos(d.start),
          end: clonePos(d.end),
          action: d.action,
          lines: d.lines.slice()
        };
      }
      function stringifyDelta(d) {
        d = d || this;
        if (Array.isArray(d)) {
          return d.map(stringifyDelta).join("\n");
        }
        var type = "";
        if (d.action) {
          type = d.action == "insert" ? "+" : "-";
          type += "[" + d.lines + "]";
        } else if (d.value) {
          if (Array.isArray(d.value)) {
            type = d.value.map(stringifyRange).join("\n");
          } else {
            type = stringifyRange(d.value);
          }
        }
        if (d.start) {
          type += stringifyRange(d);
        }
        if (d.id || d.rev) {
          type += "	(" + (d.id || d.rev) + ")";
        }
        return type;
      }
      function stringifyRange(r) {
        return r.start.row + ":" + r.start.column + "=>" + r.end.row + ":" + r.end.column;
      }
      function swap(d1, d2) {
        var i1 = d1.action == "insert";
        var i2 = d2.action == "insert";
        if (i1 && i2) {
          if (cmp(d2.start, d1.end) >= 0) {
            shift2(d2, d1, -1);
          } else if (cmp(d2.start, d1.start) <= 0) {
            shift2(d1, d2, 1);
          } else {
            return null;
          }
        } else if (i1 && !i2) {
          if (cmp(d2.start, d1.end) >= 0) {
            shift2(d2, d1, -1);
          } else if (cmp(d2.end, d1.start) <= 0) {
            shift2(d1, d2, -1);
          } else {
            return null;
          }
        } else if (!i1 && i2) {
          if (cmp(d2.start, d1.start) >= 0) {
            shift2(d2, d1, 1);
          } else if (cmp(d2.start, d1.start) <= 0) {
            shift2(d1, d2, 1);
          } else {
            return null;
          }
        } else if (!i1 && !i2) {
          if (cmp(d2.start, d1.start) >= 0) {
            shift2(d2, d1, 1);
          } else if (cmp(d2.end, d1.start) <= 0) {
            shift2(d1, d2, -1);
          } else {
            return null;
          }
        }
        return [d2, d1];
      }
      function swapGroups(ds1, ds2) {
        for (var i2 = ds1.length; i2--; ) {
          for (var j = 0; j < ds2.length; j++) {
            if (!swap(ds1[i2], ds2[j])) {
              while (i2 < ds1.length) {
                while (j--) {
                  swap(ds2[j], ds1[i2]);
                }
                j = ds2.length;
                i2++;
              }
              return [ds1, ds2];
            }
          }
        }
        ds1.selectionBefore = ds2.selectionBefore = ds1.selectionAfter = ds2.selectionAfter = null;
        return [ds2, ds1];
      }
      function xform(d1, c1) {
        var i1 = d1.action == "insert";
        var i2 = c1.action == "insert";
        if (i1 && i2) {
          if (cmp(d1.start, c1.start) < 0) {
            shift2(c1, d1, 1);
          } else {
            shift2(d1, c1, 1);
          }
        } else if (i1 && !i2) {
          if (cmp(d1.start, c1.end) >= 0) {
            shift2(d1, c1, -1);
          } else if (cmp(d1.start, c1.start) <= 0) {
            shift2(c1, d1, 1);
          } else {
            shift2(d1, Range2.fromPoints(c1.start, d1.start), -1);
            shift2(c1, d1, 1);
          }
        } else if (!i1 && i2) {
          if (cmp(c1.start, d1.end) >= 0) {
            shift2(c1, d1, -1);
          } else if (cmp(c1.start, d1.start) <= 0) {
            shift2(d1, c1, 1);
          } else {
            shift2(c1, Range2.fromPoints(d1.start, c1.start), -1);
            shift2(d1, c1, 1);
          }
        } else if (!i1 && !i2) {
          if (cmp(c1.start, d1.end) >= 0) {
            shift2(c1, d1, -1);
          } else if (cmp(c1.end, d1.start) <= 0) {
            shift2(d1, c1, -1);
          } else {
            var before, after;
            if (cmp(d1.start, c1.start) < 0) {
              before = d1;
              d1 = splitDelta(d1, c1.start);
            }
            if (cmp(d1.end, c1.end) > 0) {
              after = splitDelta(d1, c1.end);
            }
            shiftPos(c1.end, d1.start, d1.end, -1);
            if (after && !before) {
              d1.lines = after.lines;
              d1.start = after.start;
              d1.end = after.end;
              after = d1;
            }
            return [c1, before, after].filter(Boolean);
          }
        }
        return [c1, d1];
      }
      function shift2(d1, d2, dir) {
        shiftPos(d1.start, d2.start, d2.end, dir);
        shiftPos(d1.end, d2.start, d2.end, dir);
      }
      function shiftPos(pos, start, end, dir) {
        if (pos.row == (dir == 1 ? start : end).row) {
          pos.column += dir * (end.column - start.column);
        }
        pos.row += dir * (end.row - start.row);
      }
      function splitDelta(c, pos) {
        var lines = c.lines;
        var end = c.end;
        c.end = clonePos(pos);
        var rowsBefore = c.end.row - c.start.row;
        var otherLines = lines.splice(rowsBefore, lines.length);
        var col = rowsBefore ? pos.column : pos.column - c.start.column;
        lines.push(otherLines[0].substring(0, col));
        otherLines[0] = otherLines[0].substr(col);
        var rest2 = {
          start: clonePos(pos),
          end,
          lines: otherLines,
          action: c.action
        };
        return rest2;
      }
      function moveDeltasByOne(redoStack, d) {
        d = cloneDelta(d);
        for (var j = redoStack.length; j--; ) {
          var deltaSet = redoStack[j];
          for (var i2 = 0; i2 < deltaSet.length; i2++) {
            var x = deltaSet[i2];
            var xformed = xform(x, d);
            d = xformed[0];
            if (xformed.length != 2) {
              if (xformed[2]) {
                deltaSet.splice(i2 + 1, 1, xformed[1], xformed[2]);
                i2++;
              } else if (!xformed[1]) {
                deltaSet.splice(i2, 1);
                i2--;
              }
            }
          }
          if (!deltaSet.length) {
            redoStack.splice(j, 1);
          }
        }
        return redoStack;
      }
      function rebaseRedoStack(redoStack, deltaSets) {
        for (var i2 = 0; i2 < deltaSets.length; i2++) {
          var deltas = deltaSets[i2];
          for (var j = 0; j < deltas.length; j++) {
            moveDeltasByOne(redoStack, deltas[j]);
          }
        }
      }
      exports3.UndoManager = UndoManager;
    });
    ace.define("ace/edit_session/fold_line", ["require", "exports", "module", "ace/range"], function(require2, exports3, module3) {
      var Range2 = require2("../range").Range;
      var FoldLine = function() {
        function FoldLine2(foldData, folds) {
          this.foldData = foldData;
          if (Array.isArray(folds)) {
            this.folds = folds;
          } else {
            folds = this.folds = [folds];
          }
          var last = folds[folds.length - 1];
          this.range = new Range2(folds[0].start.row, folds[0].start.column, last.end.row, last.end.column);
          this.start = this.range.start;
          this.end = this.range.end;
          this.folds.forEach(function(fold) {
            fold.setFoldLine(this);
          }, this);
        }
        FoldLine2.prototype.shiftRow = function(shift2) {
          this.start.row += shift2;
          this.end.row += shift2;
          this.folds.forEach(function(fold) {
            fold.start.row += shift2;
            fold.end.row += shift2;
          });
        };
        FoldLine2.prototype.addFold = function(fold) {
          if (fold.sameRow) {
            if (fold.start.row < this.startRow || fold.endRow > this.endRow) {
              throw new Error("Can't add a fold to this FoldLine as it has no connection");
            }
            this.folds.push(fold);
            this.folds.sort(function(a, b) {
              return -a.range.compareEnd(b.start.row, b.start.column);
            });
            if (this.range.compareEnd(fold.start.row, fold.start.column) > 0) {
              this.end.row = fold.end.row;
              this.end.column = fold.end.column;
            } else if (this.range.compareStart(fold.end.row, fold.end.column) < 0) {
              this.start.row = fold.start.row;
              this.start.column = fold.start.column;
            }
          } else if (fold.start.row == this.end.row) {
            this.folds.push(fold);
            this.end.row = fold.end.row;
            this.end.column = fold.end.column;
          } else if (fold.end.row == this.start.row) {
            this.folds.unshift(fold);
            this.start.row = fold.start.row;
            this.start.column = fold.start.column;
          } else {
            throw new Error("Trying to add fold to FoldRow that doesn't have a matching row");
          }
          fold.foldLine = this;
        };
        FoldLine2.prototype.containsRow = function(row) {
          return row >= this.start.row && row <= this.end.row;
        };
        FoldLine2.prototype.walk = function(callback, endRow, endColumn) {
          var lastEnd = 0, folds = this.folds, fold, cmp, stop, isNewRow = true;
          if (endRow == null) {
            endRow = this.end.row;
            endColumn = this.end.column;
          }
          for (var i2 = 0; i2 < folds.length; i2++) {
            fold = folds[i2];
            cmp = fold.range.compareStart(endRow, endColumn);
            if (cmp == -1) {
              callback(null, endRow, endColumn, lastEnd, isNewRow);
              return;
            }
            stop = callback(null, fold.start.row, fold.start.column, lastEnd, isNewRow);
            stop = !stop && callback(fold.placeholder, fold.start.row, fold.start.column, lastEnd);
            if (stop || cmp === 0) {
              return;
            }
            isNewRow = !fold.sameRow;
            lastEnd = fold.end.column;
          }
          callback(null, endRow, endColumn, lastEnd, isNewRow);
        };
        FoldLine2.prototype.getNextFoldTo = function(row, column) {
          var fold, cmp;
          for (var i2 = 0; i2 < this.folds.length; i2++) {
            fold = this.folds[i2];
            cmp = fold.range.compareEnd(row, column);
            if (cmp == -1) {
              return {
                fold,
                kind: "after"
              };
            } else if (cmp === 0) {
              return {
                fold,
                kind: "inside"
              };
            }
          }
          return null;
        };
        FoldLine2.prototype.addRemoveChars = function(row, column, len) {
          var ret = this.getNextFoldTo(row, column), fold, folds;
          if (ret) {
            fold = ret.fold;
            if (ret.kind == "inside" && fold.start.column != column && fold.start.row != row) {
              window.console && window.console.log(row, column, fold);
            } else if (fold.start.row == row) {
              folds = this.folds;
              var i2 = folds.indexOf(fold);
              if (i2 === 0) {
                this.start.column += len;
              }
              for (i2; i2 < folds.length; i2++) {
                fold = folds[i2];
                fold.start.column += len;
                if (!fold.sameRow) {
                  return;
                }
                fold.end.column += len;
              }
              this.end.column += len;
            }
          }
        };
        FoldLine2.prototype.split = function(row, column) {
          var pos = this.getNextFoldTo(row, column);
          if (!pos || pos.kind == "inside")
            return null;
          var fold = pos.fold;
          var folds = this.folds;
          var foldData = this.foldData;
          var i2 = folds.indexOf(fold);
          var foldBefore = folds[i2 - 1];
          this.end.row = foldBefore.end.row;
          this.end.column = foldBefore.end.column;
          folds = folds.splice(i2, folds.length - i2);
          var newFoldLine = new FoldLine2(foldData, folds);
          foldData.splice(foldData.indexOf(this) + 1, 0, newFoldLine);
          return newFoldLine;
        };
        FoldLine2.prototype.merge = function(foldLineNext) {
          var folds = foldLineNext.folds;
          for (var i2 = 0; i2 < folds.length; i2++) {
            this.addFold(folds[i2]);
          }
          var foldData = this.foldData;
          foldData.splice(foldData.indexOf(foldLineNext), 1);
        };
        FoldLine2.prototype.toString = function() {
          var ret = [this.range.toString() + ": ["];
          this.folds.forEach(function(fold) {
            ret.push("  " + fold.toString());
          });
          ret.push("]");
          return ret.join("\n");
        };
        FoldLine2.prototype.idxToPosition = function(idx) {
          var lastFoldEndColumn = 0;
          for (var i2 = 0; i2 < this.folds.length; i2++) {
            var fold = this.folds[i2];
            idx -= fold.start.column - lastFoldEndColumn;
            if (idx < 0) {
              return {
                row: fold.start.row,
                column: fold.start.column + idx
              };
            }
            idx -= fold.placeholder.length;
            if (idx < 0) {
              return fold.start;
            }
            lastFoldEndColumn = fold.end.column;
          }
          return {
            row: this.end.row,
            column: this.end.column + idx
          };
        };
        return FoldLine2;
      }();
      exports3.FoldLine = FoldLine;
    });
    ace.define("ace/range_list", ["require", "exports", "module", "ace/range"], function(require2, exports3, module3) {
      var Range2 = require2("./range").Range;
      var comparePoints = Range2.comparePoints;
      var RangeList = function() {
        function RangeList2() {
          this.ranges = [];
          this.$bias = 1;
        }
        RangeList2.prototype.pointIndex = function(pos, excludeEdges, startIndex) {
          var list = this.ranges;
          for (var i2 = startIndex || 0; i2 < list.length; i2++) {
            var range = list[i2];
            var cmpEnd = comparePoints(pos, range.end);
            if (cmpEnd > 0)
              continue;
            var cmpStart = comparePoints(pos, range.start);
            if (cmpEnd === 0)
              return excludeEdges && cmpStart !== 0 ? -i2 - 2 : i2;
            if (cmpStart > 0 || cmpStart === 0 && !excludeEdges)
              return i2;
            return -i2 - 1;
          }
          return -i2 - 1;
        };
        RangeList2.prototype.add = function(range) {
          var excludeEdges = !range.isEmpty();
          var startIndex = this.pointIndex(range.start, excludeEdges);
          if (startIndex < 0)
            startIndex = -startIndex - 1;
          var endIndex = this.pointIndex(range.end, excludeEdges, startIndex);
          if (endIndex < 0)
            endIndex = -endIndex - 1;
          else
            endIndex++;
          return this.ranges.splice(startIndex, endIndex - startIndex, range);
        };
        RangeList2.prototype.addList = function(list) {
          var removed = [];
          for (var i2 = list.length; i2--; ) {
            removed.push.apply(removed, this.add(list[i2]));
          }
          return removed;
        };
        RangeList2.prototype.substractPoint = function(pos) {
          var i2 = this.pointIndex(pos);
          if (i2 >= 0)
            return this.ranges.splice(i2, 1);
        };
        RangeList2.prototype.merge = function() {
          var removed = [];
          var list = this.ranges;
          list = list.sort(function(a, b) {
            return comparePoints(a.start, b.start);
          });
          var next = list[0], range;
          for (var i2 = 1; i2 < list.length; i2++) {
            range = next;
            next = list[i2];
            var cmp = comparePoints(range.end, next.start);
            if (cmp < 0)
              continue;
            if (cmp == 0 && !range.isEmpty() && !next.isEmpty())
              continue;
            if (comparePoints(range.end, next.end) < 0) {
              range.end.row = next.end.row;
              range.end.column = next.end.column;
            }
            list.splice(i2, 1);
            removed.push(next);
            next = range;
            i2--;
          }
          this.ranges = list;
          return removed;
        };
        RangeList2.prototype.contains = function(row, column) {
          return this.pointIndex({ row, column }) >= 0;
        };
        RangeList2.prototype.containsPoint = function(pos) {
          return this.pointIndex(pos) >= 0;
        };
        RangeList2.prototype.rangeAtPoint = function(pos) {
          var i2 = this.pointIndex(pos);
          if (i2 >= 0)
            return this.ranges[i2];
        };
        RangeList2.prototype.clipRows = function(startRow, endRow) {
          var list = this.ranges;
          if (list[0].start.row > endRow || list[list.length - 1].start.row < startRow)
            return [];
          var startIndex = this.pointIndex({ row: startRow, column: 0 });
          if (startIndex < 0)
            startIndex = -startIndex - 1;
          var endIndex = this.pointIndex({ row: endRow, column: 0 }, startIndex);
          if (endIndex < 0)
            endIndex = -endIndex - 1;
          var clipped = [];
          for (var i2 = startIndex; i2 < endIndex; i2++) {
            clipped.push(list[i2]);
          }
          return clipped;
        };
        RangeList2.prototype.removeAll = function() {
          return this.ranges.splice(0, this.ranges.length);
        };
        RangeList2.prototype.attach = function(session) {
          if (this.session)
            this.detach();
          this.session = session;
          this.onChange = this.$onChange.bind(this);
          this.session.on("change", this.onChange);
        };
        RangeList2.prototype.detach = function() {
          if (!this.session)
            return;
          this.session.removeListener("change", this.onChange);
          this.session = null;
        };
        RangeList2.prototype.$onChange = function(delta) {
          var start = delta.start;
          var end = delta.end;
          var startRow = start.row;
          var endRow = end.row;
          var ranges = this.ranges;
          for (var i2 = 0, n = ranges.length; i2 < n; i2++) {
            var r = ranges[i2];
            if (r.end.row >= startRow)
              break;
          }
          if (delta.action == "insert") {
            var lineDif = endRow - startRow;
            var colDiff = -start.column + end.column;
            for (; i2 < n; i2++) {
              var r = ranges[i2];
              if (r.start.row > startRow)
                break;
              if (r.start.row == startRow && r.start.column >= start.column) {
                if (r.start.column == start.column && this.$bias <= 0)
                  ;
                else {
                  r.start.column += colDiff;
                  r.start.row += lineDif;
                }
              }
              if (r.end.row == startRow && r.end.column >= start.column) {
                if (r.end.column == start.column && this.$bias < 0) {
                  continue;
                }
                if (r.end.column == start.column && colDiff > 0 && i2 < n - 1) {
                  if (r.end.column > r.start.column && r.end.column == ranges[i2 + 1].start.column)
                    r.end.column -= colDiff;
                }
                r.end.column += colDiff;
                r.end.row += lineDif;
              }
            }
          } else {
            var lineDif = startRow - endRow;
            var colDiff = start.column - end.column;
            for (; i2 < n; i2++) {
              var r = ranges[i2];
              if (r.start.row > endRow)
                break;
              if (r.end.row < endRow && (startRow < r.end.row || startRow == r.end.row && start.column < r.end.column)) {
                r.end.row = startRow;
                r.end.column = start.column;
              } else if (r.end.row == endRow) {
                if (r.end.column <= end.column) {
                  if (lineDif || r.end.column > start.column) {
                    r.end.column = start.column;
                    r.end.row = start.row;
                  }
                } else {
                  r.end.column += colDiff;
                  r.end.row += lineDif;
                }
              } else if (r.end.row > endRow) {
                r.end.row += lineDif;
              }
              if (r.start.row < endRow && (startRow < r.start.row || startRow == r.start.row && start.column < r.start.column)) {
                r.start.row = startRow;
                r.start.column = start.column;
              } else if (r.start.row == endRow) {
                if (r.start.column <= end.column) {
                  if (lineDif || r.start.column > start.column) {
                    r.start.column = start.column;
                    r.start.row = start.row;
                  }
                } else {
                  r.start.column += colDiff;
                  r.start.row += lineDif;
                }
              } else if (r.start.row > endRow) {
                r.start.row += lineDif;
              }
            }
          }
          if (lineDif != 0 && i2 < n) {
            for (; i2 < n; i2++) {
              var r = ranges[i2];
              r.start.row += lineDif;
              r.end.row += lineDif;
            }
          }
        };
        return RangeList2;
      }();
      RangeList.prototype.comparePoints = comparePoints;
      exports3.RangeList = RangeList;
    });
    ace.define("ace/edit_session/fold", ["require", "exports", "module", "ace/range_list"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 RangeList = require2("../range_list").RangeList;
      var Fold = function(_super) {
        __extends(Fold2, _super);
        function Fold2(range, placeholder) {
          var _this = _super.call(this) || this;
          _this.foldLine = null;
          _this.placeholder = placeholder;
          _this.range = range;
          _this.start = range.start;
          _this.end = range.end;
          _this.sameRow = range.start.row == range.end.row;
          _this.subFolds = _this.ranges = [];
          return _this;
        }
        Fold2.prototype.toString = function() {
          return '"' + this.placeholder + '" ' + this.range.toString();
        };
        Fold2.prototype.setFoldLine = function(foldLine) {
          this.foldLine = foldLine;
          this.subFolds.forEach(function(fold) {
            fold.setFoldLine(foldLine);
          });
        };
        Fold2.prototype.clone = function() {
          var range = this.range.clone();
          var fold = new Fold2(range, this.placeholder);
          this.subFolds.forEach(function(subFold) {
            fold.subFolds.push(subFold.clone());
          });
          fold.collapseChildren = this.collapseChildren;
          return fold;
        };
        Fold2.prototype.addSubFold = function(fold) {
          if (this.range.isEqual(fold))
            return;
          consumeRange(fold, this.start);
          var row = fold.start.row, column = fold.start.column;
          for (var i2 = 0, cmp = -1; i2 < this.subFolds.length; i2++) {
            cmp = this.subFolds[i2].range.compare(row, column);
            if (cmp != 1)
              break;
          }
          var afterStart = this.subFolds[i2];
          var firstConsumed = 0;
          if (cmp == 0) {
            if (afterStart.range.containsRange(fold))
              return afterStart.addSubFold(fold);
            else
              firstConsumed = 1;
          }
          var row = fold.range.end.row, column = fold.range.end.column;
          for (var j = i2, cmp = -1; j < this.subFolds.length; j++) {
            cmp = this.subFolds[j].range.compare(row, column);
            if (cmp != 1)
              break;
          }
          if (cmp == 0)
            j++;
          var consumedFolds = this.subFolds.splice(i2, j - i2, fold);
          var last = cmp == 0 ? consumedFolds.length - 1 : consumedFolds.length;
          for (var k = firstConsumed; k < last; k++) {
            fold.addSubFold(consumedFolds[k]);
          }
          fold.setFoldLine(this.foldLine);
          return fold;
        };
        Fold2.prototype.restoreRange = function(range) {
          return restoreRange(range, this.start);
        };
        return Fold2;
      }(RangeList);
      function consumePoint(point, anchor) {
        point.row -= anchor.row;
        if (point.row == 0)
          point.column -= anchor.column;
      }
      function consumeRange(range, anchor) {
        consumePoint(range.start, anchor);
        consumePoint(range.end, anchor);
      }
      function restorePoint(point, anchor) {
        if (point.row == 0)
          point.column += anchor.column;
        point.row += anchor.row;
      }
      function restoreRange(range, anchor) {
        restorePoint(range.start, anchor);
        restorePoint(range.end, anchor);
      }
      exports3.Fold = Fold;
    });
    ace.define("ace/edit_session/folding", ["require", "exports", "module", "ace/range", "ace/edit_session/fold_line", "ace/edit_session/fold", "ace/token_iterator", "ace/mouse/mouse_event"], function(require2, exports3, module3) {
      var Range2 = require2("../range").Range;
      var FoldLine = require2("./fold_line").FoldLine;
      var Fold = require2("./fold").Fold;
      var TokenIterator = require2("../token_iterator").TokenIterator;
      var MouseEvent2 = require2("../mouse/mouse_event").MouseEvent;
      function Folding() {
        this.getFoldAt = function(row, column, side) {
          var foldLine = this.getFoldLine(row);
          if (!foldLine)
            return null;
          var folds = foldLine.folds;
          for (var i2 = 0; i2 < folds.length; i2++) {
            var range = folds[i2].range;
            if (range.contains(row, column)) {
              if (side == 1 && range.isEnd(row, column) && !range.isEmpty()) {
                continue;
              } else if (side == -1 && range.isStart(row, column) && !range.isEmpty()) {
                continue;
              }
              return folds[i2];
            }
          }
        };
        this.getFoldsInRange = function(range) {
          var start = range.start;
          var end = range.end;
          var foldLines = this.$foldData;
          var foundFolds = [];
          start.column += 1;
          end.column -= 1;
          for (var i2 = 0; i2 < foldLines.length; i2++) {
            var cmp = foldLines[i2].range.compareRange(range);
            if (cmp == 2) {
              continue;
            } else if (cmp == -2) {
              break;
            }
            var folds = foldLines[i2].folds;
            for (var j = 0; j < folds.length; j++) {
              var fold = folds[j];
              cmp = fold.range.compareRange(range);
              if (cmp == -2) {
                break;
              } else if (cmp == 2) {
                continue;
              } else if (cmp == 42) {
                break;
              }
              foundFolds.push(fold);
            }
          }
          start.column -= 1;
          end.column += 1;
          return foundFolds;
        };
        this.getFoldsInRangeList = function(ranges) {
          if (Array.isArray(ranges)) {
            var folds = [];
            ranges.forEach(function(range) {
              folds = folds.concat(this.getFoldsInRange(range));
            }, this);
          } else {
            var folds = this.getFoldsInRange(ranges);
          }
          return folds;
        };
        this.getAllFolds = function() {
          var folds = [];
          var foldLines = this.$foldData;
          for (var i2 = 0; i2 < foldLines.length; i2++)
            for (var j = 0; j < foldLines[i2].folds.length; j++)
              folds.push(foldLines[i2].folds[j]);
          return folds;
        };
        this.getFoldStringAt = function(row, column, trim2, foldLine) {
          foldLine = foldLine || this.getFoldLine(row);
          if (!foldLine)
            return null;
          var lastFold = {
            end: { column: 0 }
          };
          var str, fold;
          for (var i2 = 0; i2 < foldLine.folds.length; i2++) {
            fold = foldLine.folds[i2];
            var cmp = fold.range.compareEnd(row, column);
            if (cmp == -1) {
              str = this.getLine(fold.start.row).substring(lastFold.end.column, fold.start.column);
              break;
            } else if (cmp === 0) {
              return null;
            }
            lastFold = fold;
          }
          if (!str)
            str = this.getLine(fold.start.row).substring(lastFold.end.column);
          if (trim2 == -1)
            return str.substring(0, column - lastFold.end.column);
          else if (trim2 == 1)
            return str.substring(column - lastFold.end.column);
          else
            return str;
        };
        this.getFoldLine = function(docRow, startFoldLine) {
          var foldData = this.$foldData;
          var i2 = 0;
          if (startFoldLine)
            i2 = foldData.indexOf(startFoldLine);
          if (i2 == -1)
            i2 = 0;
          for (i2; i2 < foldData.length; i2++) {
            var foldLine = foldData[i2];
            if (foldLine.start.row <= docRow && foldLine.end.row >= docRow) {
              return foldLine;
            } else if (foldLine.end.row > docRow) {
              return null;
            }
          }
          return null;
        };
        this.getNextFoldLine = function(docRow, startFoldLine) {
          var foldData = this.$foldData;
          var i2 = 0;
          if (startFoldLine)
            i2 = foldData.indexOf(startFoldLine);
          if (i2 == -1)
            i2 = 0;
          for (i2; i2 < foldData.length; i2++) {
            var foldLine = foldData[i2];
            if (foldLine.end.row >= docRow) {
              return foldLine;
            }
          }
          return null;
        };
        this.getFoldedRowCount = function(first, last) {
          var foldData = this.$foldData, rowCount = last - first + 1;
          for (var i2 = 0; i2 < foldData.length; i2++) {
            var foldLine = foldData[i2], end = foldLine.end.row, start = foldLine.start.row;
            if (end >= last) {
              if (start < last) {
                if (start >= first)
                  rowCount -= last - start;
                else
                  rowCount = 0;
              }
              break;
            } else if (end >= first) {
              if (start >= first)
                rowCount -= end - start;
              else
                rowCount -= end - first + 1;
            }
          }
          return rowCount;
        };
        this.$addFoldLine = function(foldLine) {
          this.$foldData.push(foldLine);
          this.$foldData.sort(function(a, b) {
            return a.start.row - b.start.row;
          });
          return foldLine;
        };
        this.addFold = function(placeholder, range) {
          var foldData = this.$foldData;
          var added = false;
          var fold;
          if (placeholder instanceof Fold)
            fold = placeholder;
          else {
            fold = new Fold(range, placeholder);
            fold.collapseChildren = range.collapseChildren;
          }
          this.$clipRangeToDocument(fold.range);
          var startRow = fold.start.row;
          var startColumn = fold.start.column;
          var endRow = fold.end.row;
          var endColumn = fold.end.column;
          var startFold = this.getFoldAt(startRow, startColumn, 1);
          var endFold = this.getFoldAt(endRow, endColumn, -1);
          if (startFold && endFold == startFold)
            return startFold.addSubFold(fold);
          if (startFold && !startFold.range.isStart(startRow, startColumn))
            this.removeFold(startFold);
          if (endFold && !endFold.range.isEnd(endRow, endColumn))
            this.removeFold(endFold);
          var folds = this.getFoldsInRange(fold.range);
          if (folds.length > 0) {
            this.removeFolds(folds);
            if (!fold.collapseChildren) {
              folds.forEach(function(subFold) {
                fold.addSubFold(subFold);
              });
            }
          }
          for (var i2 = 0; i2 < foldData.length; i2++) {
            var foldLine = foldData[i2];
            if (endRow == foldLine.start.row) {
              foldLine.addFold(fold);
              added = true;
              break;
            } else if (startRow == foldLine.end.row) {
              foldLine.addFold(fold);
              added = true;
              if (!fold.sameRow) {
                var foldLineNext = foldData[i2 + 1];
                if (foldLineNext && foldLineNext.start.row == endRow) {
                  foldLine.merge(foldLineNext);
                  break;
                }
              }
              break;
            } else if (endRow <= foldLine.start.row) {
              break;
            }
          }
          if (!added)
            foldLine = this.$addFoldLine(new FoldLine(this.$foldData, fold));
          if (this.$useWrapMode)
            this.$updateWrapData(foldLine.start.row, foldLine.start.row);
          else
            this.$updateRowLengthCache(foldLine.start.row, foldLine.start.row);
          this.$modified = true;
          this._signal("changeFold", { data: fold, action: "add" });
          return fold;
        };
        this.addFolds = function(folds) {
          folds.forEach(function(fold) {
            this.addFold(fold);
          }, this);
        };
        this.removeFold = function(fold) {
          var foldLine = fold.foldLine;
          var startRow = foldLine.start.row;
          var endRow = foldLine.end.row;
          var foldLines = this.$foldData;
          var folds = foldLine.folds;
          if (folds.length == 1) {
            foldLines.splice(foldLines.indexOf(foldLine), 1);
          } else if (foldLine.range.isEnd(fold.end.row, fold.end.column)) {
            folds.pop();
            foldLine.end.row = folds[folds.length - 1].end.row;
            foldLine.end.column = folds[folds.length - 1].end.column;
          } else if (foldLine.range.isStart(fold.start.row, fold.start.column)) {
            folds.shift();
            foldLine.start.row = folds[0].start.row;
            foldLine.start.column = folds[0].start.column;
          } else if (fold.sameRow) {
            folds.splice(folds.indexOf(fold), 1);
          } else {
            var newFoldLine = foldLine.split(fold.start.row, fold.start.column);
            folds = newFoldLine.folds;
            folds.shift();
            newFoldLine.start.row = folds[0].start.row;
            newFoldLine.start.column = folds[0].start.column;
          }
          if (!this.$updating) {
            if (this.$useWrapMode)
              this.$updateWrapData(startRow, endRow);
            else
              this.$updateRowLengthCache(startRow, endRow);
          }
          this.$modified = true;
          this._signal("changeFold", { data: fold, action: "remove" });
        };
        this.removeFolds = function(folds) {
          var cloneFolds = [];
          for (var i2 = 0; i2 < folds.length; i2++) {
            cloneFolds.push(folds[i2]);
          }
          cloneFolds.forEach(function(fold) {
            this.removeFold(fold);
          }, this);
          this.$modified = true;
        };
        this.expandFold = function(fold) {
          this.removeFold(fold);
          fold.subFolds.forEach(function(subFold) {
            fold.restoreRange(subFold);
            this.addFold(subFold);
          }, this);
          if (fold.collapseChildren > 0) {
            this.foldAll(fold.start.row + 1, fold.end.row, fold.collapseChildren - 1);
          }
          fold.subFolds = [];
        };
        this.expandFolds = function(folds) {
          folds.forEach(function(fold) {
            this.expandFold(fold);
          }, this);
        };
        this.unfold = function(location2, expandInner) {
          var range, folds;
          if (location2 == null) {
            range = new Range2(0, 0, this.getLength(), 0);
            if (expandInner == null)
              expandInner = true;
          } else if (typeof location2 == "number") {
            range = new Range2(location2, 0, location2, this.getLine(location2).length);
          } else if ("row" in location2) {
            range = Range2.fromPoints(location2, location2);
          } else if (Array.isArray(location2)) {
            folds = [];
            location2.forEach(function(range2) {
              folds = folds.concat(this.unfold(range2));
            }, this);
            return folds;
          } else {
            range = location2;
          }
          folds = this.getFoldsInRangeList(range);
          var outermostFolds = folds;
          while (folds.length == 1 && Range2.comparePoints(folds[0].start, range.start) < 0 && Range2.comparePoints(folds[0].end, range.end) > 0) {
            this.expandFolds(folds);
            folds = this.getFoldsInRangeList(range);
          }
          if (expandInner != false) {
            this.removeFolds(folds);
          } else {
            this.expandFolds(folds);
          }
          if (outermostFolds.length)
            return outermostFolds;
        };
        this.isRowFolded = function(docRow, startFoldRow) {
          return !!this.getFoldLine(docRow, startFoldRow);
        };
        this.getRowFoldEnd = function(docRow, startFoldRow) {
          var foldLine = this.getFoldLine(docRow, startFoldRow);
          return foldLine ? foldLine.end.row : docRow;
        };
        this.getRowFoldStart = function(docRow, startFoldRow) {
          var foldLine = this.getFoldLine(docRow, startFoldRow);
          return foldLine ? foldLine.start.row : docRow;
        };
        this.getFoldDisplayLine = function(foldLine, endRow, endColumn, startRow, startColumn) {
          if (startRow == null)
            startRow = foldLine.start.row;
          if (startColumn == null)
            startColumn = 0;
          if (endRow == null)
            endRow = foldLine.end.row;
          if (endColumn == null)
            endColumn = this.getLine(endRow).length;
          var doc2 = this.doc;
          var textLine = "";
          foldLine.walk(function(placeholder, row, column, lastColumn) {
            if (row < startRow)
              return;
            if (row == startRow) {
              if (column < startColumn)
                return;
              lastColumn = Math.max(startColumn, lastColumn);
            }
            if (placeholder != null) {
              textLine += placeholder;
            } else {
              textLine += doc2.getLine(row).substring(lastColumn, column);
            }
          }, endRow, endColumn);
          return textLine;
        };
        this.getDisplayLine = function(row, endColumn, startRow, startColumn) {
          var foldLine = this.getFoldLine(row);
          if (!foldLine) {
            var line;
            line = this.doc.getLine(row);
            return line.substring(startColumn || 0, endColumn || line.length);
          } else {
            return this.getFoldDisplayLine(foldLine, row, endColumn, startRow, startColumn);
          }
        };
        this.$cloneFoldData = function() {
          var fd = [];
          fd = this.$foldData.map(function(foldLine) {
            var folds = foldLine.folds.map(function(fold) {
              return fold.clone();
            });
            return new FoldLine(fd, folds);
          });
          return fd;
        };
        this.toggleFold = function(tryToUnfold) {
          var selection = this.selection;
          var range = selection.getRange();
          var fold;
          var bracketPos;
          if (range.isEmpty()) {
            var cursor = range.start;
            fold = this.getFoldAt(cursor.row, cursor.column);
            if (fold) {
              this.expandFold(fold);
              return;
            } else if (bracketPos = this.findMatchingBracket(cursor)) {
              if (range.comparePoint(bracketPos) == 1) {
                range.end = bracketPos;
              } else {
                range.start = bracketPos;
                range.start.column++;
                range.end.column--;
              }
            } else if (bracketPos = this.findMatchingBracket({ row: cursor.row, column: cursor.column + 1 })) {
              if (range.comparePoint(bracketPos) == 1)
                range.end = bracketPos;
              else
                range.start = bracketPos;
              range.start.column++;
            } else {
              range = this.getCommentFoldRange(cursor.row, cursor.column) || range;
            }
          } else {
            var folds = this.getFoldsInRange(range);
            if (tryToUnfold && folds.length) {
              this.expandFolds(folds);
              return;
            } else if (folds.length == 1) {
              fold = folds[0];
            }
          }
          if (!fold)
            fold = this.getFoldAt(range.start.row, range.start.column);
          if (fold && fold.range.toString() == range.toString()) {
            this.expandFold(fold);
            return;
          }
          var placeholder = "...";
          if (!range.isMultiLine()) {
            placeholder = this.getTextRange(range);
            if (placeholder.length < 4)
              return;
            placeholder = placeholder.trim().substring(0, 2) + "..";
          }
          this.addFold(placeholder, range);
        };
        this.getCommentFoldRange = function(row, column, dir) {
          var iterator = new TokenIterator(this, row, column);
          var token = iterator.getCurrentToken();
          var type = token && token.type;
          if (token && /^comment|string/.test(type)) {
            type = type.match(/comment|string/)[0];
            if (type == "comment")
              type += "|doc-start|\\.doc";
            var re = new RegExp(type);
            var range = new Range2();
            if (dir != 1) {
              do {
                token = iterator.stepBackward();
              } while (token && re.test(token.type) && !/^comment.end/.test(token.type));
              token = iterator.stepForward();
            }
            range.start.row = iterator.getCurrentTokenRow();
            range.start.column = iterator.getCurrentTokenColumn() + (/^comment.start/.test(token.type) ? token.value.length : 2);
            iterator = new TokenIterator(this, row, column);
            if (dir != -1) {
              var lastRow = -1;
              do {
                token = iterator.stepForward();
                if (lastRow == -1) {
                  var state = this.getState(iterator.$row);
                  if (!re.test(state))
                    lastRow = iterator.$row;
                } else if (iterator.$row > lastRow) {
                  break;
                }
              } while (token && re.test(token.type) && !/^comment.start/.test(token.type));
              token = iterator.stepBackward();
            } else
              token = iterator.getCurrentToken();
            range.end.row = iterator.getCurrentTokenRow();
            range.end.column = iterator.getCurrentTokenColumn();
            if (!/^comment.end/.test(token.type)) {
              range.end.column += token.value.length - 2;
            }
            return range;
          }
        };
        this.foldAll = function(startRow, endRow, depth, test) {
          if (depth == void 0)
            depth = 1e5;
          var foldWidgets = this.foldWidgets;
          if (!foldWidgets)
            return;
          endRow = endRow || this.getLength();
          startRow = startRow || 0;
          for (var row = startRow; row < endRow; row++) {
            if (foldWidgets[row] == null)
              foldWidgets[row] = this.getFoldWidget(row);
            if (foldWidgets[row] != "start")
              continue;
            if (test && !test(row))
              continue;
            var range = this.getFoldWidgetRange(row);
            if (range && range.isMultiLine() && range.end.row <= endRow && range.start.row >= startRow) {
              row = range.end.row;
              range.collapseChildren = depth;
              this.addFold("...", range);
            }
          }
        };
        this.foldToLevel = function(level) {
          this.foldAll();
          while (level-- > 0)
            this.unfold(null, false);
        };
        this.foldAllComments = function() {
          var session = this;
          this.foldAll(null, null, null, function(row) {
            var tokens = session.getTokens(row);
            for (var i2 = 0; i2 < tokens.length; i2++) {
              var token = tokens[i2];
              if (token.type == "text" && /^\s+$/.test(token.value))
                continue;
              if (/comment/.test(token.type))
                return true;
              return false;
            }
          });
        };
        this.$foldStyles = {
          "manual": 1,
          "markbegin": 1,
          "markbeginend": 1
        };
        this.$foldStyle = "markbegin";
        this.setFoldStyle = function(style) {
          if (!this.$foldStyles[style])
            throw new Error("invalid fold style: " + style + "[" + Object.keys(this.$foldStyles).join(", ") + "]");
          if (this.$foldStyle == style)
            return;
          this.$foldStyle = style;
          if (style == "manual")
            this.unfold();
          var mode = this.$foldMode;
          this.$setFolding(null);
          this.$setFolding(mode);
        };
        this.$setFolding = function(foldMode) {
          if (this.$foldMode == foldMode)
            return;
          this.$foldMode = foldMode;
          this.off("change", this.$updateFoldWidgets);
          this.off("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets);
          this._signal("changeAnnotation");
          if (!foldMode || this.$foldStyle == "manual") {
            this.foldWidgets = null;
            return;
          }
          this.foldWidgets = [];
          this.getFoldWidget = foldMode.getFoldWidget.bind(foldMode, this, this.$foldStyle);
          this.getFoldWidgetRange = foldMode.getFoldWidgetRange.bind(foldMode, this, this.$foldStyle);
          this.$updateFoldWidgets = this.updateFoldWidgets.bind(this);
          this.$tokenizerUpdateFoldWidgets = this.tokenizerUpdateFoldWidgets.bind(this);
          this.on("change", this.$updateFoldWidgets);
          this.on("tokenizerUpdate", this.$tokenizerUpdateFoldWidgets);
        };
        this.getParentFoldRangeData = function(row, ignoreCurrent) {
          var fw = this.foldWidgets;
          if (!fw || ignoreCurrent && fw[row])
            return {};
          var i2 = row - 1, firstRange;
          while (i2 >= 0) {
            var c = fw[i2];
            if (c == null)
              c = fw[i2] = this.getFoldWidget(i2);
            if (c == "start") {
              var range = this.getFoldWidgetRange(i2);
              if (!firstRange)
                firstRange = range;
              if (range && range.end.row >= row)
                break;
            }
            i2--;
          }
          return {
            range: i2 !== -1 && range,
            firstRange
          };
        };
        this.onFoldWidgetClick = function(row, e) {
          if (e instanceof MouseEvent2)
            e = e.domEvent;
          var options = {
            children: e.shiftKey,
            all: e.ctrlKey || e.metaKey,
            siblings: e.altKey
          };
          var range = this.$toggleFoldWidget(row, options);
          if (!range) {
            var el = e.target || e.srcElement;
            if (el && /ace_fold-widget/.test(el.className))
              el.className += " ace_invalid";
          }
        };
        this.$toggleFoldWidget = function(row, options) {
          if (!this.getFoldWidget)
            return;
          var type = this.getFoldWidget(row);
          var line = this.getLine(row);
          var dir = type === "end" ? -1 : 1;
          var fold = this.getFoldAt(row, dir === -1 ? 0 : line.length, dir);
          if (fold) {
            if (options.children || options.all)
              this.removeFold(fold);
            else
              this.expandFold(fold);
            return fold;
          }
          var range = this.getFoldWidgetRange(row, true);
          if (range && !range.isMultiLine()) {
            fold = this.getFoldAt(range.start.row, range.start.column, 1);
            if (fold && range.isEqual(fold.range)) {
              this.removeFold(fold);
              return fold;
            }
          }
          if (options.siblings) {
            var data2 = this.getParentFoldRangeData(row);
            if (data2.range) {
              var startRow = data2.range.start.row + 1;
              var endRow = data2.range.end.row;
            }
            this.foldAll(startRow, endRow, options.all ? 1e4 : 0);
          } else if (options.children) {
            endRow = range ? range.end.row : this.getLength();
            this.foldAll(row + 1, endRow, options.all ? 1e4 : 0);
          } else if (range) {
            if (options.all)
              range.collapseChildren = 1e4;
            this.addFold("...", range);
          }
          return range;
        };
        this.toggleFoldWidget = function(toggleParent) {
          var row = this.selection.getCursor().row;
          row = this.getRowFoldStart(row);
          var range = this.$toggleFoldWidget(row, {});
          if (range)
            return;
          var data2 = this.getParentFoldRangeData(row, true);
          range = data2.range || data2.firstRange;
          if (range) {
            row = range.start.row;
            var fold = this.getFoldAt(row, this.getLine(row).length, 1);
            if (fold) {
              this.removeFold(fold);
            } else {
              this.addFold("...", range);
            }
          }
        };
        this.updateFoldWidgets = function(delta) {
          var firstRow = delta.start.row;
          var len = delta.end.row - firstRow;
          if (len === 0) {
            this.foldWidgets[firstRow] = null;
          } else if (delta.action == "remove") {
            this.foldWidgets.splice(firstRow, len + 1, null);
          } else {
            var args = Array(len + 1);
            args.unshift(firstRow, 1);
            this.foldWidgets.splice.apply(this.foldWidgets, args);
          }
        };
        this.tokenizerUpdateFoldWidgets = function(e) {
          var rows = e.data;
          if (rows.first != rows.last) {
            if (this.foldWidgets.length > rows.first)
              this.foldWidgets.splice(rows.first, this.foldWidgets.length);
          }
        };
      }
      exports3.Folding = Folding;
    });
    ace.define("ace/edit_session/bracket_match", ["require", "exports", "module", "ace/token_iterator", "ace/range"], function(require2, exports3, module3) {
      var TokenIterator = require2("../token_iterator").TokenIterator;
      var Range2 = require2("../range").Range;
      function BracketMatch() {
        this.findMatchingBracket = function(position, chr) {
          if (position.column == 0)
            return null;
          var charBeforeCursor = chr || this.getLine(position.row).charAt(position.column - 1);
          if (charBeforeCursor == "")
            return null;
          var match = charBeforeCursor.match(/([\(\[\{])|([\)\]\}])/);
          if (!match)
            return null;
          if (match[1])
            return this.$findClosingBracket(match[1], position);
          else
            return this.$findOpeningBracket(match[2], position);
        };
        this.getBracketRange = function(pos) {
          var line = this.getLine(pos.row);
          var before = true, range;
          var chr = line.charAt(pos.column - 1);
          var match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
          if (!match) {
            chr = line.charAt(pos.column);
            pos = { row: pos.row, column: pos.column + 1 };
            match = chr && chr.match(/([\(\[\{])|([\)\]\}])/);
            before = false;
          }
          if (!match)
            return null;
          if (match[1]) {
            var bracketPos = this.$findClosingBracket(match[1], pos);
            if (!bracketPos)
              return null;
            range = Range2.fromPoints(pos, bracketPos);
            if (!before) {
              range.end.column++;
              range.start.column--;
            }
            range.cursor = range.end;
          } else {
            var bracketPos = this.$findOpeningBracket(match[2], pos);
            if (!bracketPos)
              return null;
            range = Range2.fromPoints(bracketPos, pos);
            if (!before) {
              range.start.column++;
              range.end.column--;
            }
            range.cursor = range.start;
          }
          return range;
        };
        this.getMatchingBracketRanges = function(pos, isBackwards) {
          var line = this.getLine(pos.row);
          var bracketsRegExp = /([\(\[\{])|([\)\]\}])/;
          var chr = !isBackwards && line.charAt(pos.column - 1);
          var match = chr && chr.match(bracketsRegExp);
          if (!match) {
            chr = (isBackwards === void 0 || isBackwards) && line.charAt(pos.column);
            pos = {
              row: pos.row,
              column: pos.column + 1
            };
            match = chr && chr.match(bracketsRegExp);
          }
          if (!match)
            return null;
          var startRange = new Range2(pos.row, pos.column - 1, pos.row, pos.column);
          var bracketPos = match[1] ? this.$findClosingBracket(match[1], pos) : this.$findOpeningBracket(match[2], pos);
          if (!bracketPos)
            return [startRange];
          var endRange = new Range2(bracketPos.row, bracketPos.column, bracketPos.row, bracketPos.column + 1);
          return [startRange, endRange];
        };
        this.$brackets = {
          ")": "(",
          "(": ")",
          "]": "[",
          "[": "]",
          "{": "}",
          "}": "{",
          "<": ">",
          ">": "<"
        };
        this.$findOpeningBracket = function(bracket2, position, typeRe) {
          var openBracket = this.$brackets[bracket2];
          var depth = 1;
          var iterator = new TokenIterator(this, position.row, position.column);
          var token = iterator.getCurrentToken();
          if (!token)
            token = iterator.stepForward();
          if (!token)
            return;
          if (!typeRe) {
            typeRe = new RegExp("(\\.?" + token.type.replace(".", "\\.").replace("rparen", ".paren").replace(/\b(?:end)\b/, "(?:start|begin|end)").replace(/-close\b/, "-(close|open)") + ")+");
          }
          var valueIndex = position.column - iterator.getCurrentTokenColumn() - 2;
          var value2 = token.value;
          while (true) {
            while (valueIndex >= 0) {
              var chr = value2.charAt(valueIndex);
              if (chr == openBracket) {
                depth -= 1;
                if (depth == 0) {
                  return {
                    row: iterator.getCurrentTokenRow(),
                    column: valueIndex + iterator.getCurrentTokenColumn()
                  };
                }
              } else if (chr == bracket2) {
                depth += 1;
              }
              valueIndex -= 1;
            }
            do {
              token = iterator.stepBackward();
            } while (token && !typeRe.test(token.type));
            if (token == null)
              break;
            value2 = token.value;
            valueIndex = value2.length - 1;
          }
          return null;
        };
        this.$findClosingBracket = function(bracket2, position, typeRe) {
          var closingBracket = this.$brackets[bracket2];
          var depth = 1;
          var iterator = new TokenIterator(this, position.row, position.column);
          var token = iterator.getCurrentToken();
          if (!token)
            token = iterator.stepForward();
          if (!token)
            return;
          if (!typeRe) {
            typeRe = new RegExp("(\\.?" + token.type.replace(".", "\\.").replace("lparen", ".paren").replace(/\b(?:start|begin)\b/, "(?:start|begin|end)").replace(/-open\b/, "-(close|open)") + ")+");
          }
          var valueIndex = position.column - iterator.getCurrentTokenColumn();
          while (true) {
            var value2 = token.value;
            var valueLength = value2.length;
            while (valueIndex < valueLength) {
              var chr = value2.charAt(valueIndex);
              if (chr == closingBracket) {
                depth -= 1;
                if (depth == 0) {
                  return {
                    row: iterator.getCurrentTokenRow(),
                    column: valueIndex + iterator.getCurrentTokenColumn()
                  };
                }
              } else if (chr == bracket2) {
                depth += 1;
              }
              valueIndex += 1;
            }
            do {
              token = iterator.stepForward();
            } while (token && !typeRe.test(token.type));
            if (token == null)
              break;
            valueIndex = 0;
          }
          return null;
        };
        this.getMatchingTags = function(pos) {
          var iterator = new TokenIterator(this, pos.row, pos.column);
          var token = this.$findTagName(iterator);
          if (!token)
            return;
          var prevToken = iterator.stepBackward();
          if (prevToken.value === "<") {
            return this.$findClosingTag(iterator, token);
          } else {
            return this.$findOpeningTag(iterator, token);
          }
        };
        this.$findTagName = function(iterator) {
          var token = iterator.getCurrentToken();
          var found = false;
          var backward = false;
          if (token && token.type.indexOf("tag-name") === -1) {
            do {
              if (backward)
                token = iterator.stepBackward();
              else
                token = iterator.stepForward();
              if (token) {
                if (token.value === "/>") {
                  backward = true;
                } else if (token.type.indexOf("tag-name") !== -1) {
                  found = true;
                }
              }
            } while (token && !found);
          }
          return token;
        };
        this.$findClosingTag = function(iterator, token) {
          var prevToken;
          var currentTag = token.value;
          var tag = token.value;
          var depth = 0;
          var openTagStart = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
          token = iterator.stepForward();
          var openTagName = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
          var foundOpenTagEnd = false;
          do {
            prevToken = token;
            token = iterator.stepForward();
            if (token) {
              if (token.value === ">" && !foundOpenTagEnd) {
                var openTagEnd = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
                foundOpenTagEnd = true;
              }
              if (token.type.indexOf("tag-name") !== -1) {
                currentTag = token.value;
                if (tag === currentTag) {
                  if (prevToken.value === "<") {
                    depth++;
                  } else if (prevToken.value === "</") {
                    depth--;
                    if (depth < 0) {
                      iterator.stepBackward();
                      var closeTagStart = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);
                      token = iterator.stepForward();
                      var closeTagName = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
                      token = iterator.stepForward();
                      if (token && token.value === ">") {
                        var closeTagEnd = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
                      } else {
                        return;
                      }
                    }
                  }
                }
              } else if (tag === currentTag && token.value === "/>") {
                depth--;
                if (depth < 0) {
                  var closeTagStart = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 2);
                  var closeTagName = closeTagStart;
                  var closeTagEnd = closeTagName;
                  var openTagEnd = new Range2(openTagName.end.row, openTagName.end.column, openTagName.end.row, openTagName.end.column + 1);
                }
              }
            }
          } while (token && depth >= 0);
          if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
            return {
              openTag: new Range2(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
              closeTag: new Range2(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
              openTagName,
              closeTagName
            };
          }
        };
        this.$findOpeningTag = function(iterator, token) {
          var prevToken = iterator.getCurrentToken();
          var tag = token.value;
          var depth = 0;
          var startRow = iterator.getCurrentTokenRow();
          var startColumn = iterator.getCurrentTokenColumn();
          var endColumn = startColumn + 2;
          var closeTagStart = new Range2(startRow, startColumn, startRow, endColumn);
          iterator.stepForward();
          var closeTagName = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + token.value.length);
          token = iterator.stepForward();
          if (!token || token.value !== ">")
            return;
          var closeTagEnd = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
          iterator.stepBackward();
          iterator.stepBackward();
          do {
            token = prevToken;
            startRow = iterator.getCurrentTokenRow();
            startColumn = iterator.getCurrentTokenColumn();
            endColumn = startColumn + token.value.length;
            prevToken = iterator.stepBackward();
            if (token) {
              if (token.type.indexOf("tag-name") !== -1) {
                if (tag === token.value) {
                  if (prevToken.value === "<") {
                    depth++;
                    if (depth > 0) {
                      var openTagName = new Range2(startRow, startColumn, startRow, endColumn);
                      var openTagStart = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
                      do {
                        token = iterator.stepForward();
                      } while (token && token.value !== ">");
                      var openTagEnd = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn(), iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + 1);
                    }
                  } else if (prevToken.value === "</") {
                    depth--;
                  }
                }
              } else if (token.value === "/>") {
                var stepCount = 0;
                var tmpToken = prevToken;
                while (tmpToken) {
                  if (tmpToken.type.indexOf("tag-name") !== -1 && tmpToken.value === tag) {
                    depth--;
                    break;
                  } else if (tmpToken.value === "<") {
                    break;
                  }
                  tmpToken = iterator.stepBackward();
                  stepCount++;
                }
                for (var i2 = 0; i2 < stepCount; i2++) {
                  iterator.stepForward();
                }
              }
            }
          } while (prevToken && depth <= 0);
          if (openTagStart && openTagEnd && closeTagStart && closeTagEnd && openTagName && closeTagName) {
            return {
              openTag: new Range2(openTagStart.start.row, openTagStart.start.column, openTagEnd.end.row, openTagEnd.end.column),
              closeTag: new Range2(closeTagStart.start.row, closeTagStart.start.column, closeTagEnd.end.row, closeTagEnd.end.column),
              openTagName,
              closeTagName
            };
          }
        };
      }
      exports3.BracketMatch = BracketMatch;
    });
    ace.define("ace/edit_session", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/bidihandler", "ace/config", "ace/lib/event_emitter", "ace/selection", "ace/mode/text", "ace/range", "ace/document", "ace/background_tokenizer", "ace/search_highlight", "ace/undomanager", "ace/edit_session/folding", "ace/edit_session/bracket_match"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var lang = require2("./lib/lang");
      var BidiHandler = require2("./bidihandler").BidiHandler;
      var config2 = require2("./config");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var Selection = require2("./selection").Selection;
      var TextMode = require2("./mode/text").Mode;
      var Range2 = require2("./range").Range;
      var Document = require2("./document").Document;
      var BackgroundTokenizer = require2("./background_tokenizer").BackgroundTokenizer;
      var SearchHighlight = require2("./search_highlight").SearchHighlight;
      var UndoManager = require2("./undomanager").UndoManager;
      var EditSession = function() {
        function EditSession2(text, mode) {
          this.$breakpoints = [];
          this.$decorations = [];
          this.$frontMarkers = {};
          this.$backMarkers = {};
          this.$markerId = 1;
          this.$undoSelect = true;
          this.$foldData = [];
          this.id = "session" + ++EditSession2.$uid;
          this.$foldData.toString = function() {
            return this.join("\n");
          };
          this.bgTokenizer = new BackgroundTokenizer(new TextMode().getTokenizer(), this);
          var _self = this;
          this.bgTokenizer.on("update", function(e) {
            _self._signal("tokenizerUpdate", e);
          });
          this.on("changeFold", this.onChangeFold.bind(this));
          this.$onChange = this.onChange.bind(this);
          if (typeof text != "object" || !text.getLine)
            text = new Document(text);
          this.setDocument(text);
          this.selection = new Selection(this);
          this.$bidiHandler = new BidiHandler(this);
          config2.resetOptions(this);
          this.setMode(mode);
          config2._signal("session", this);
          this.destroyed = false;
        }
        EditSession2.prototype.setDocument = function(doc2) {
          if (this.doc)
            this.doc.off("change", this.$onChange);
          this.doc = doc2;
          doc2.on("change", this.$onChange, true);
          this.bgTokenizer.setDocument(this.getDocument());
          this.resetCaches();
        };
        EditSession2.prototype.getDocument = function() {
          return this.doc;
        };
        EditSession2.prototype.$resetRowCache = function(docRow) {
          if (!docRow) {
            this.$docRowCache = [];
            this.$screenRowCache = [];
            return;
          }
          var l = this.$docRowCache.length;
          var i2 = this.$getRowCacheIndex(this.$docRowCache, docRow) + 1;
          if (l > i2) {
            this.$docRowCache.splice(i2, l);
            this.$screenRowCache.splice(i2, l);
          }
        };
        EditSession2.prototype.$getRowCacheIndex = function(cacheArray, val) {
          var low = 0;
          var hi = cacheArray.length - 1;
          while (low <= hi) {
            var mid = low + hi >> 1;
            var c = cacheArray[mid];
            if (val > c)
              low = mid + 1;
            else if (val < c)
              hi = mid - 1;
            else
              return mid;
          }
          return low - 1;
        };
        EditSession2.prototype.resetCaches = function() {
          this.$modified = true;
          this.$wrapData = [];
          this.$rowLengthCache = [];
          this.$resetRowCache(0);
          if (!this.destroyed)
            this.bgTokenizer.start(0);
        };
        EditSession2.prototype.onChangeFold = function(e) {
          var fold = e.data;
          this.$resetRowCache(fold.start.row);
        };
        EditSession2.prototype.onChange = function(delta) {
          this.$modified = true;
          this.$bidiHandler.onChange(delta);
          this.$resetRowCache(delta.start.row);
          var removedFolds = this.$updateInternalDataOnChange(delta);
          if (!this.$fromUndo && this.$undoManager) {
            if (removedFolds && removedFolds.length) {
              this.$undoManager.add({
                action: "removeFolds",
                folds: removedFolds
              }, this.mergeUndoDeltas);
              this.mergeUndoDeltas = true;
            }
            this.$undoManager.add(delta, this.mergeUndoDeltas);
            this.mergeUndoDeltas = true;
            this.$informUndoManager.schedule();
          }
          this.bgTokenizer.$updateOnChange(delta);
          this._signal("change", delta);
        };
        EditSession2.prototype.setValue = function(text) {
          this.doc.setValue(text);
          this.selection.moveTo(0, 0);
          this.$resetRowCache(0);
          this.setUndoManager(this.$undoManager);
          this.getUndoManager().reset();
        };
        EditSession2.fromJSON = function(session) {
          session = JSON.parse(session);
          var undoManager = new UndoManager();
          undoManager.$undoStack = session.history.undo;
          undoManager.$redoStack = session.history.redo;
          undoManager.mark = session.history.mark;
          undoManager.$rev = session.history.rev;
          var editSession = new EditSession2(session.value);
          session.folds.forEach(function(fold) {
            editSession.addFold("...", Range2.fromPoints(fold.start, fold.end));
          });
          editSession.setAnnotations(session.annotations);
          editSession.setBreakpoints(session.breakpoints);
          editSession.setMode(session.mode);
          editSession.setScrollLeft(session.scrollLeft);
          editSession.setScrollTop(session.scrollTop);
          editSession.setUndoManager(undoManager);
          editSession.selection.fromJSON(session.selection);
          return editSession;
        };
        EditSession2.prototype.toJSON = function() {
          return {
            annotations: this.$annotations,
            breakpoints: this.$breakpoints,
            folds: this.getAllFolds().map(function(fold) {
              return fold.range;
            }),
            history: this.getUndoManager(),
            mode: this.$mode.$id,
            scrollLeft: this.$scrollLeft,
            scrollTop: this.$scrollTop,
            selection: this.selection.toJSON(),
            value: this.doc.getValue()
          };
        };
        EditSession2.prototype.toString = function() {
          return this.doc.getValue();
        };
        EditSession2.prototype.getSelection = function() {
          return this.selection;
        };
        EditSession2.prototype.getState = function(row) {
          return this.bgTokenizer.getState(row);
        };
        EditSession2.prototype.getTokens = function(row) {
          return this.bgTokenizer.getTokens(row);
        };
        EditSession2.prototype.getTokenAt = function(row, column) {
          var tokens = this.bgTokenizer.getTokens(row);
          var token, c = 0;
          if (column == null) {
            var i2 = tokens.length - 1;
            c = this.getLine(row).length;
          } else {
            for (var i2 = 0; i2 < tokens.length; i2++) {
              c += tokens[i2].value.length;
              if (c >= column)
                break;
            }
          }
          token = tokens[i2];
          if (!token)
            return null;
          token.index = i2;
          token.start = c - token.value.length;
          return token;
        };
        EditSession2.prototype.setUndoManager = function(undoManager) {
          this.$undoManager = undoManager;
          if (this.$informUndoManager)
            this.$informUndoManager.cancel();
          if (undoManager) {
            var self2 = this;
            undoManager.addSession(this);
            this.$syncInformUndoManager = function() {
              self2.$informUndoManager.cancel();
              self2.mergeUndoDeltas = false;
            };
            this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
          } else {
            this.$syncInformUndoManager = function() {
            };
          }
        };
        EditSession2.prototype.markUndoGroup = function() {
          if (this.$syncInformUndoManager)
            this.$syncInformUndoManager();
        };
        EditSession2.prototype.getUndoManager = function() {
          return this.$undoManager || this.$defaultUndoManager;
        };
        EditSession2.prototype.getTabString = function() {
          if (this.getUseSoftTabs()) {
            return lang.stringRepeat(" ", this.getTabSize());
          } else {
            return "	";
          }
        };
        EditSession2.prototype.setUseSoftTabs = function(val) {
          this.setOption("useSoftTabs", val);
        };
        EditSession2.prototype.getUseSoftTabs = function() {
          return this.$useSoftTabs && !this.$mode.$indentWithTabs;
        };
        EditSession2.prototype.setTabSize = function(tabSize) {
          this.setOption("tabSize", tabSize);
        };
        EditSession2.prototype.getTabSize = function() {
          return this.$tabSize;
        };
        EditSession2.prototype.isTabStop = function(position) {
          return this.$useSoftTabs && position.column % this.$tabSize === 0;
        };
        EditSession2.prototype.setNavigateWithinSoftTabs = function(navigateWithinSoftTabs) {
          this.setOption("navigateWithinSoftTabs", navigateWithinSoftTabs);
        };
        EditSession2.prototype.getNavigateWithinSoftTabs = function() {
          return this.$navigateWithinSoftTabs;
        };
        EditSession2.prototype.setOverwrite = function(overwrite) {
          this.setOption("overwrite", overwrite);
        };
        EditSession2.prototype.getOverwrite = function() {
          return this.$overwrite;
        };
        EditSession2.prototype.toggleOverwrite = function() {
          this.setOverwrite(!this.$overwrite);
        };
        EditSession2.prototype.addGutterDecoration = function(row, className) {
          if (!this.$decorations[row])
            this.$decorations[row] = "";
          this.$decorations[row] += " " + className;
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.removeGutterDecoration = function(row, className) {
          this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.getBreakpoints = function() {
          return this.$breakpoints;
        };
        EditSession2.prototype.setBreakpoints = function(rows) {
          this.$breakpoints = [];
          for (var i2 = 0; i2 < rows.length; i2++) {
            this.$breakpoints[rows[i2]] = "ace_breakpoint";
          }
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.clearBreakpoints = function() {
          this.$breakpoints = [];
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.setBreakpoint = function(row, className) {
          if (className === void 0)
            className = "ace_breakpoint";
          if (className)
            this.$breakpoints[row] = className;
          else
            delete this.$breakpoints[row];
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.clearBreakpoint = function(row) {
          delete this.$breakpoints[row];
          this._signal("changeBreakpoint", {});
        };
        EditSession2.prototype.addMarker = function(range, clazz, type, inFront) {
          var id2 = this.$markerId++;
          var marker = {
            range,
            type: type || "line",
            renderer: typeof type == "function" ? type : null,
            clazz,
            inFront: !!inFront,
            id: id2
          };
          if (inFront) {
            this.$frontMarkers[id2] = marker;
            this._signal("changeFrontMarker");
          } else {
            this.$backMarkers[id2] = marker;
            this._signal("changeBackMarker");
          }
          return id2;
        };
        EditSession2.prototype.addDynamicMarker = function(marker, inFront) {
          if (!marker.update)
            return;
          var id2 = this.$markerId++;
          marker.id = id2;
          marker.inFront = !!inFront;
          if (inFront) {
            this.$frontMarkers[id2] = marker;
            this._signal("changeFrontMarker");
          } else {
            this.$backMarkers[id2] = marker;
            this._signal("changeBackMarker");
          }
          return marker;
        };
        EditSession2.prototype.removeMarker = function(markerId) {
          var marker = this.$frontMarkers[markerId] || this.$backMarkers[markerId];
          if (!marker)
            return;
          var markers = marker.inFront ? this.$frontMarkers : this.$backMarkers;
          delete markers[markerId];
          this._signal(marker.inFront ? "changeFrontMarker" : "changeBackMarker");
        };
        EditSession2.prototype.getMarkers = function(inFront) {
          return inFront ? this.$frontMarkers : this.$backMarkers;
        };
        EditSession2.prototype.highlight = function(re) {
          if (!this.$searchHighlight) {
            var highlight = new SearchHighlight(null, "ace_selected-word", "text");
            this.$searchHighlight = this.addDynamicMarker(highlight);
          }
          this.$searchHighlight.setRegexp(re);
        };
        EditSession2.prototype.highlightLines = function(startRow, endRow, clazz, inFront) {
          if (typeof endRow != "number") {
            clazz = endRow;
            endRow = startRow;
          }
          if (!clazz)
            clazz = "ace_step";
          var range = new Range2(startRow, 0, endRow, Infinity);
          range.id = this.addMarker(range, clazz, "fullLine", inFront);
          return range;
        };
        EditSession2.prototype.setAnnotations = function(annotations) {
          this.$annotations = annotations;
          this._signal("changeAnnotation", {});
        };
        EditSession2.prototype.getAnnotations = function() {
          return this.$annotations || [];
        };
        EditSession2.prototype.clearAnnotations = function() {
          this.setAnnotations([]);
        };
        EditSession2.prototype.$detectNewLine = function(text) {
          var match = text.match(/^.*?(\r?\n)/m);
          if (match) {
            this.$autoNewLine = match[1];
          } else {
            this.$autoNewLine = "\n";
          }
        };
        EditSession2.prototype.getWordRange = function(row, column) {
          var line = this.getLine(row);
          var inToken = false;
          if (column > 0)
            inToken = !!line.charAt(column - 1).match(this.tokenRe);
          if (!inToken)
            inToken = !!line.charAt(column).match(this.tokenRe);
          if (inToken)
            var re = this.tokenRe;
          else if (/^\s+$/.test(line.slice(column - 1, column + 1)))
            var re = /\s/;
          else
            var re = this.nonTokenRe;
          var start = column;
          if (start > 0) {
            do {
              start--;
            } while (start >= 0 && line.charAt(start).match(re));
            start++;
          }
          var end = column;
          while (end < line.length && line.charAt(end).match(re)) {
            end++;
          }
          return new Range2(row, start, row, end);
        };
        EditSession2.prototype.getAWordRange = function(row, column) {
          var wordRange = this.getWordRange(row, column);
          var line = this.getLine(wordRange.end.row);
          while (line.charAt(wordRange.end.column).match(/[ \t]/)) {
            wordRange.end.column += 1;
          }
          return wordRange;
        };
        EditSession2.prototype.setNewLineMode = function(newLineMode) {
          this.doc.setNewLineMode(newLineMode);
        };
        EditSession2.prototype.getNewLineMode = function() {
          return this.doc.getNewLineMode();
        };
        EditSession2.prototype.setUseWorker = function(useWorker) {
          this.setOption("useWorker", useWorker);
        };
        EditSession2.prototype.getUseWorker = function() {
          return this.$useWorker;
        };
        EditSession2.prototype.onReloadTokenizer = function(e) {
          var rows = e.data;
          this.bgTokenizer.start(rows.first);
          this._signal("tokenizerUpdate", e);
        };
        EditSession2.prototype.setMode = function(mode, cb) {
          if (mode && typeof mode === "object") {
            if (mode.getTokenizer)
              return this.$onChangeMode(mode);
            var options = mode;
            var path = options.path;
          } else {
            path = mode || "ace/mode/text";
          }
          if (!this.$modes["ace/mode/text"])
            this.$modes["ace/mode/text"] = new TextMode();
          if (this.$modes[path] && !options) {
            this.$onChangeMode(this.$modes[path]);
            cb && cb();
            return;
          }
          this.$modeId = path;
          config2.loadModule(["mode", path], function(m) {
            if (this.$modeId !== path)
              return cb && cb();
            if (this.$modes[path] && !options) {
              this.$onChangeMode(this.$modes[path]);
            } else if (m && m.Mode) {
              m = new m.Mode(options);
              if (!options) {
                this.$modes[path] = m;
                m.$id = path;
              }
              this.$onChangeMode(m);
            }
            cb && cb();
          }.bind(this));
          if (!this.$mode)
            this.$onChangeMode(this.$modes["ace/mode/text"], true);
        };
        EditSession2.prototype.$onChangeMode = function(mode, $isPlaceholder) {
          if (!$isPlaceholder)
            this.$modeId = mode.$id;
          if (this.$mode === mode)
            return;
          var oldMode = this.$mode;
          this.$mode = mode;
          this.$stopWorker();
          if (this.$useWorker)
            this.$startWorker();
          var tokenizer = mode.getTokenizer();
          if (tokenizer.on !== void 0) {
            var onReloadTokenizer = this.onReloadTokenizer.bind(this);
            tokenizer.on("update", onReloadTokenizer);
          }
          this.bgTokenizer.setTokenizer(tokenizer);
          this.bgTokenizer.setDocument(this.getDocument());
          this.tokenRe = mode.tokenRe;
          this.nonTokenRe = mode.nonTokenRe;
          if (!$isPlaceholder) {
            if (mode.attachToSession)
              mode.attachToSession(this);
            this.$options.wrapMethod.set.call(this, this.$wrapMethod);
            this.$setFolding(mode.foldingRules);
            this.bgTokenizer.start(0);
            this._emit("changeMode", { oldMode, mode });
          }
        };
        EditSession2.prototype.$stopWorker = function() {
          if (this.$worker) {
            this.$worker.terminate();
            this.$worker = null;
          }
        };
        EditSession2.prototype.$startWorker = function() {
          try {
            this.$worker = this.$mode.createWorker(this);
          } catch (e) {
            config2.warn("Could not load worker", e);
            this.$worker = null;
          }
        };
        EditSession2.prototype.getMode = function() {
          return this.$mode;
        };
        EditSession2.prototype.setScrollTop = function(scrollTop) {
          if (this.$scrollTop === scrollTop || isNaN(scrollTop))
            return;
          this.$scrollTop = scrollTop;
          this._signal("changeScrollTop", scrollTop);
        };
        EditSession2.prototype.getScrollTop = function() {
          return this.$scrollTop;
        };
        EditSession2.prototype.setScrollLeft = function(scrollLeft) {
          if (this.$scrollLeft === scrollLeft || isNaN(scrollLeft))
            return;
          this.$scrollLeft = scrollLeft;
          this._signal("changeScrollLeft", scrollLeft);
        };
        EditSession2.prototype.getScrollLeft = function() {
          return this.$scrollLeft;
        };
        EditSession2.prototype.getScreenWidth = function() {
          this.$computeWidth();
          if (this.lineWidgets)
            return Math.max(this.getLineWidgetMaxWidth(), this.screenWidth);
          return this.screenWidth;
        };
        EditSession2.prototype.getLineWidgetMaxWidth = function() {
          if (this.lineWidgetsWidth != null)
            return this.lineWidgetsWidth;
          var width = 0;
          this.lineWidgets.forEach(function(w) {
            if (w && w.screenWidth > width)
              width = w.screenWidth;
          });
          return this.lineWidgetWidth = width;
        };
        EditSession2.prototype.$computeWidth = function(force) {
          if (this.$modified || force) {
            this.$modified = false;
            if (this.$useWrapMode)
              return this.screenWidth = this.$wrapLimit;
            var lines = this.doc.getAllLines();
            var cache2 = this.$rowLengthCache;
            var longestScreenLine = 0;
            var foldIndex = 0;
            var foldLine = this.$foldData[foldIndex];
            var foldStart = foldLine ? foldLine.start.row : Infinity;
            var len = lines.length;
            for (var i2 = 0; i2 < len; i2++) {
              if (i2 > foldStart) {
                i2 = foldLine.end.row + 1;
                if (i2 >= len)
                  break;
                foldLine = this.$foldData[foldIndex++];
                foldStart = foldLine ? foldLine.start.row : Infinity;
              }
              if (cache2[i2] == null)
                cache2[i2] = this.$getStringScreenWidth(lines[i2])[0];
              if (cache2[i2] > longestScreenLine)
                longestScreenLine = cache2[i2];
            }
            this.screenWidth = longestScreenLine;
          }
        };
        EditSession2.prototype.getLine = function(row) {
          return this.doc.getLine(row);
        };
        EditSession2.prototype.getLines = function(firstRow, lastRow) {
          return this.doc.getLines(firstRow, lastRow);
        };
        EditSession2.prototype.getLength = function() {
          return this.doc.getLength();
        };
        EditSession2.prototype.getTextRange = function(range) {
          return this.doc.getTextRange(range || this.selection.getRange());
        };
        EditSession2.prototype.insert = function(position, text) {
          return this.doc.insert(position, text);
        };
        EditSession2.prototype.remove = function(range) {
          return this.doc.remove(range);
        };
        EditSession2.prototype.removeFullLines = function(firstRow, lastRow) {
          return this.doc.removeFullLines(firstRow, lastRow);
        };
        EditSession2.prototype.undoChanges = function(deltas, dontSelect) {
          if (!deltas.length)
            return;
          this.$fromUndo = true;
          for (var i2 = deltas.length - 1; i2 != -1; i2--) {
            var delta = deltas[i2];
            if (delta.action == "insert" || delta.action == "remove") {
              this.doc.revertDelta(delta);
            } else if (delta.folds) {
              this.addFolds(delta.folds);
            }
          }
          if (!dontSelect && this.$undoSelect) {
            if (deltas.selectionBefore)
              this.selection.fromJSON(deltas.selectionBefore);
            else
              this.selection.setRange(this.$getUndoSelection(deltas, true));
          }
          this.$fromUndo = false;
        };
        EditSession2.prototype.redoChanges = function(deltas, dontSelect) {
          if (!deltas.length)
            return;
          this.$fromUndo = true;
          for (var i2 = 0; i2 < deltas.length; i2++) {
            var delta = deltas[i2];
            if (delta.action == "insert" || delta.action == "remove") {
              this.doc.$safeApplyDelta(delta);
            }
          }
          if (!dontSelect && this.$undoSelect) {
            if (deltas.selectionAfter)
              this.selection.fromJSON(deltas.selectionAfter);
            else
              this.selection.setRange(this.$getUndoSelection(deltas, false));
          }
          this.$fromUndo = false;
        };
        EditSession2.prototype.setUndoSelect = function(enable) {
          this.$undoSelect = enable;
        };
        EditSession2.prototype.$getUndoSelection = function(deltas, isUndo) {
          function isInsert(delta2) {
            return isUndo ? delta2.action !== "insert" : delta2.action === "insert";
          }
          var range, point;
          for (var i2 = 0; i2 < deltas.length; i2++) {
            var delta = deltas[i2];
            if (!delta.start)
              continue;
            if (!range) {
              if (isInsert(delta)) {
                range = Range2.fromPoints(delta.start, delta.end);
              } else {
                range = Range2.fromPoints(delta.start, delta.start);
              }
              continue;
            }
            if (isInsert(delta)) {
              point = delta.start;
              if (range.compare(point.row, point.column) == -1) {
                range.setStart(point);
              }
              point = delta.end;
              if (range.compare(point.row, point.column) == 1) {
                range.setEnd(point);
              }
            } else {
              point = delta.start;
              if (range.compare(point.row, point.column) == -1) {
                range = Range2.fromPoints(delta.start, delta.start);
              }
            }
          }
          return range;
        };
        EditSession2.prototype.replace = function(range, text) {
          return this.doc.replace(range, text);
        };
        EditSession2.prototype.moveText = function(fromRange, toPosition, copy) {
          var text = this.getTextRange(fromRange);
          var folds = this.getFoldsInRange(fromRange);
          var toRange = Range2.fromPoints(toPosition, toPosition);
          if (!copy) {
            this.remove(fromRange);
            var rowDiff = fromRange.start.row - fromRange.end.row;
            var collDiff = rowDiff ? -fromRange.end.column : fromRange.start.column - fromRange.end.column;
            if (collDiff) {
              if (toRange.start.row == fromRange.end.row && toRange.start.column > fromRange.end.column)
                toRange.start.column += collDiff;
              if (toRange.end.row == fromRange.end.row && toRange.end.column > fromRange.end.column)
                toRange.end.column += collDiff;
            }
            if (rowDiff && toRange.start.row >= fromRange.end.row) {
              toRange.start.row += rowDiff;
              toRange.end.row += rowDiff;
            }
          }
          toRange.end = this.insert(toRange.start, text);
          if (folds.length) {
            var oldStart = fromRange.start;
            var newStart = toRange.start;
            var rowDiff = newStart.row - oldStart.row;
            var collDiff = newStart.column - oldStart.column;
            this.addFolds(folds.map(function(x) {
              x = x.clone();
              if (x.start.row == oldStart.row)
                x.start.column += collDiff;
              if (x.end.row == oldStart.row)
                x.end.column += collDiff;
              x.start.row += rowDiff;
              x.end.row += rowDiff;
              return x;
            }));
          }
          return toRange;
        };
        EditSession2.prototype.indentRows = function(startRow, endRow, indentString2) {
          indentString2 = indentString2.replace(/\t/g, this.getTabString());
          for (var row = startRow; row <= endRow; row++)
            this.doc.insertInLine({ row, column: 0 }, indentString2);
        };
        EditSession2.prototype.outdentRows = function(range) {
          var rowRange = range.collapseRows();
          var deleteRange = new Range2(0, 0, 0, 0);
          var size = this.getTabSize();
          for (var i2 = rowRange.start.row; i2 <= rowRange.end.row; ++i2) {
            var line = this.getLine(i2);
            deleteRange.start.row = i2;
            deleteRange.end.row = i2;
            for (var j = 0; j < size; ++j)
              if (line.charAt(j) != " ")
                break;
            if (j < size && line.charAt(j) == "	") {
              deleteRange.start.column = j;
              deleteRange.end.column = j + 1;
            } else {
              deleteRange.start.column = 0;
              deleteRange.end.column = j;
            }
            this.remove(deleteRange);
          }
        };
        EditSession2.prototype.$moveLines = function(firstRow, lastRow, dir) {
          firstRow = this.getRowFoldStart(firstRow);
          lastRow = this.getRowFoldEnd(lastRow);
          if (dir < 0) {
            var row = this.getRowFoldStart(firstRow + dir);
            if (row < 0)
              return 0;
            var diff = row - firstRow;
          } else if (dir > 0) {
            var row = this.getRowFoldEnd(lastRow + dir);
            if (row > this.doc.getLength() - 1)
              return 0;
            var diff = row - lastRow;
          } else {
            firstRow = this.$clipRowToDocument(firstRow);
            lastRow = this.$clipRowToDocument(lastRow);
            var diff = lastRow - firstRow + 1;
          }
          var range = new Range2(firstRow, 0, lastRow, Number.MAX_VALUE);
          var folds = this.getFoldsInRange(range).map(function(x) {
            x = x.clone();
            x.start.row += diff;
            x.end.row += diff;
            return x;
          });
          var lines = dir == 0 ? this.doc.getLines(firstRow, lastRow) : this.doc.removeFullLines(firstRow, lastRow);
          this.doc.insertFullLines(firstRow + diff, lines);
          folds.length && this.addFolds(folds);
          return diff;
        };
        EditSession2.prototype.moveLinesUp = function(firstRow, lastRow) {
          return this.$moveLines(firstRow, lastRow, -1);
        };
        EditSession2.prototype.moveLinesDown = function(firstRow, lastRow) {
          return this.$moveLines(firstRow, lastRow, 1);
        };
        EditSession2.prototype.duplicateLines = function(firstRow, lastRow) {
          return this.$moveLines(firstRow, lastRow, 0);
        };
        EditSession2.prototype.$clipRowToDocument = function(row) {
          return Math.max(0, Math.min(row, this.doc.getLength() - 1));
        };
        EditSession2.prototype.$clipColumnToRow = function(row, column) {
          if (column < 0)
            return 0;
          return Math.min(this.doc.getLine(row).length, column);
        };
        EditSession2.prototype.$clipPositionToDocument = function(row, column) {
          column = Math.max(0, column);
          if (row < 0) {
            row = 0;
            column = 0;
          } else {
            var len = this.doc.getLength();
            if (row >= len) {
              row = len - 1;
              column = this.doc.getLine(len - 1).length;
            } else {
              column = Math.min(this.doc.getLine(row).length, column);
            }
          }
          return {
            row,
            column
          };
        };
        EditSession2.prototype.$clipRangeToDocument = function(range) {
          if (range.start.row < 0) {
            range.start.row = 0;
            range.start.column = 0;
          } else {
            range.start.column = this.$clipColumnToRow(range.start.row, range.start.column);
          }
          var len = this.doc.getLength() - 1;
          if (range.end.row > len) {
            range.end.row = len;
            range.end.column = this.doc.getLine(len).length;
          } else {
            range.end.column = this.$clipColumnToRow(range.end.row, range.end.column);
          }
          return range;
        };
        EditSession2.prototype.setUseWrapMode = function(useWrapMode) {
          if (useWrapMode != this.$useWrapMode) {
            this.$useWrapMode = useWrapMode;
            this.$modified = true;
            this.$resetRowCache(0);
            if (useWrapMode) {
              var len = this.getLength();
              this.$wrapData = Array(len);
              this.$updateWrapData(0, len - 1);
            }
            this._signal("changeWrapMode");
          }
        };
        EditSession2.prototype.getUseWrapMode = function() {
          return this.$useWrapMode;
        };
        EditSession2.prototype.setWrapLimitRange = function(min, max) {
          if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) {
            this.$wrapLimitRange = { min, max };
            this.$modified = true;
            this.$bidiHandler.markAsDirty();
            if (this.$useWrapMode)
              this._signal("changeWrapMode");
          }
        };
        EditSession2.prototype.adjustWrapLimit = function(desiredLimit, $printMargin) {
          var limits = this.$wrapLimitRange;
          if (limits.max < 0)
            limits = { min: $printMargin, max: $printMargin };
          var wrapLimit = this.$constrainWrapLimit(desiredLimit, limits.min, limits.max);
          if (wrapLimit != this.$wrapLimit && wrapLimit > 1) {
            this.$wrapLimit = wrapLimit;
            this.$modified = true;
            if (this.$useWrapMode) {
              this.$updateWrapData(0, this.getLength() - 1);
              this.$resetRowCache(0);
              this._signal("changeWrapLimit");
            }
            return true;
          }
          return false;
        };
        EditSession2.prototype.$constrainWrapLimit = function(wrapLimit, min, max) {
          if (min)
            wrapLimit = Math.max(min, wrapLimit);
          if (max)
            wrapLimit = Math.min(max, wrapLimit);
          return wrapLimit;
        };
        EditSession2.prototype.getWrapLimit = function() {
          return this.$wrapLimit;
        };
        EditSession2.prototype.setWrapLimit = function(limit) {
          this.setWrapLimitRange(limit, limit);
        };
        EditSession2.prototype.getWrapLimitRange = function() {
          return {
            min: this.$wrapLimitRange.min,
            max: this.$wrapLimitRange.max
          };
        };
        EditSession2.prototype.$updateInternalDataOnChange = function(delta) {
          var useWrapMode = this.$useWrapMode;
          var action = delta.action;
          var start = delta.start;
          var end = delta.end;
          var firstRow = start.row;
          var lastRow = end.row;
          var len = lastRow - firstRow;
          var removedFolds = null;
          this.$updating = true;
          if (len != 0) {
            if (action === "remove") {
              this[useWrapMode ? "$wrapData" : "$rowLengthCache"].splice(firstRow, len);
              var foldLines = this.$foldData;
              removedFolds = this.getFoldsInRange(delta);
              this.removeFolds(removedFolds);
              var foldLine = this.getFoldLine(end.row);
              var idx = 0;
              if (foldLine) {
                foldLine.addRemoveChars(end.row, end.column, start.column - end.column);
                foldLine.shiftRow(-len);
                var foldLineBefore = this.getFoldLine(firstRow);
                if (foldLineBefore && foldLineBefore !== foldLine) {
                  foldLineBefore.merge(foldLine);
                  foldLine = foldLineBefore;
                }
                idx = foldLines.indexOf(foldLine) + 1;
              }
              for (idx; idx < foldLines.length; idx++) {
                var foldLine = foldLines[idx];
                if (foldLine.start.row >= end.row) {
                  foldLine.shiftRow(-len);
                }
              }
              lastRow = firstRow;
            } else {
              var args = Array(len);
              args.unshift(firstRow, 0);
              var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache;
              arr.splice.apply(arr, args);
              var foldLines = this.$foldData;
              var foldLine = this.getFoldLine(firstRow);
              var idx = 0;
              if (foldLine) {
                var cmp = foldLine.range.compareInside(start.row, start.column);
                if (cmp == 0) {
                  foldLine = foldLine.split(start.row, start.column);
                  if (foldLine) {
                    foldLine.shiftRow(len);
                    foldLine.addRemoveChars(lastRow, 0, end.column - start.column);
                  }
                } else if (cmp == -1) {
                  foldLine.addRemoveChars(firstRow, 0, end.column - start.column);
                  foldLine.shiftRow(len);
                }
                idx = foldLines.indexOf(foldLine) + 1;
              }
              for (idx; idx < foldLines.length; idx++) {
                var foldLine = foldLines[idx];
                if (foldLine.start.row >= firstRow) {
                  foldLine.shiftRow(len);
                }
              }
            }
          } else {
            len = Math.abs(delta.start.column - delta.end.column);
            if (action === "remove") {
              removedFolds = this.getFoldsInRange(delta);
              this.removeFolds(removedFolds);
              len = -len;
            }
            var foldLine = this.getFoldLine(firstRow);
            if (foldLine) {
              foldLine.addRemoveChars(firstRow, start.column, len);
            }
          }
          if (useWrapMode && this.$wrapData.length != this.doc.getLength()) {
            console.error("doc.getLength() and $wrapData.length have to be the same!");
          }
          this.$updating = false;
          if (useWrapMode)
            this.$updateWrapData(firstRow, lastRow);
          else
            this.$updateRowLengthCache(firstRow, lastRow);
          return removedFolds;
        };
        EditSession2.prototype.$updateRowLengthCache = function(firstRow, lastRow, b) {
          this.$rowLengthCache[firstRow] = null;
          this.$rowLengthCache[lastRow] = null;
        };
        EditSession2.prototype.$updateWrapData = function(firstRow, lastRow) {
          var lines = this.doc.getAllLines();
          var tabSize = this.getTabSize();
          var wrapData = this.$wrapData;
          var wrapLimit = this.$wrapLimit;
          var tokens;
          var foldLine;
          var row = firstRow;
          lastRow = Math.min(lastRow, lines.length - 1);
          while (row <= lastRow) {
            foldLine = this.getFoldLine(row, foldLine);
            if (!foldLine) {
              tokens = this.$getDisplayTokens(lines[row]);
              wrapData[row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
              row++;
            } else {
              tokens = [];
              foldLine.walk(function(placeholder, row2, column, lastColumn) {
                var walkTokens;
                if (placeholder != null) {
                  walkTokens = this.$getDisplayTokens(placeholder, tokens.length);
                  walkTokens[0] = PLACEHOLDER_START;
                  for (var i2 = 1; i2 < walkTokens.length; i2++) {
                    walkTokens[i2] = PLACEHOLDER_BODY;
                  }
                } else {
                  walkTokens = this.$getDisplayTokens(lines[row2].substring(lastColumn, column), tokens.length);
                }
                tokens = tokens.concat(walkTokens);
              }.bind(this), foldLine.end.row, lines[foldLine.end.row].length + 1);
              wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
              row = foldLine.end.row + 1;
            }
          }
        };
        EditSession2.prototype.$computeWrapSplits = function(tokens, wrapLimit, tabSize) {
          if (tokens.length == 0) {
            return [];
          }
          var splits = [];
          var displayLength = tokens.length;
          var lastSplit = 0, lastDocSplit = 0;
          var isCode = this.$wrapAsCode;
          var indentedSoftWrap = this.$indentedSoftWrap;
          var maxIndent = wrapLimit <= Math.max(2 * tabSize, 8) || indentedSoftWrap === false ? 0 : Math.floor(wrapLimit / 2);
          function getWrapIndent() {
            var indentation = 0;
            if (maxIndent === 0)
              return indentation;
            if (indentedSoftWrap) {
              for (var i2 = 0; i2 < tokens.length; i2++) {
                var token = tokens[i2];
                if (token == SPACE)
                  indentation += 1;
                else if (token == TAB)
                  indentation += tabSize;
                else if (token == TAB_SPACE)
                  continue;
                else
                  break;
              }
            }
            if (isCode && indentedSoftWrap !== false)
              indentation += tabSize;
            return Math.min(indentation, maxIndent);
          }
          function addSplit(screenPos) {
            var len = screenPos - lastSplit;
            for (var i2 = lastSplit; i2 < screenPos; i2++) {
              var ch = tokens[i2];
              if (ch === 12 || ch === 2)
                len -= 1;
            }
            if (!splits.length) {
              indent = getWrapIndent();
              splits.indent = indent;
            }
            lastDocSplit += len;
            splits.push(lastDocSplit);
            lastSplit = screenPos;
          }
          var indent = 0;
          while (displayLength - lastSplit > wrapLimit - indent) {
            var split = lastSplit + wrapLimit - indent;
            if (tokens[split - 1] >= SPACE && tokens[split] >= SPACE) {
              addSplit(split);
              continue;
            }
            if (tokens[split] == PLACEHOLDER_START || tokens[split] == PLACEHOLDER_BODY) {
              for (split; split != lastSplit - 1; split--) {
                if (tokens[split] == PLACEHOLDER_START) {
                  break;
                }
              }
              if (split > lastSplit) {
                addSplit(split);
                continue;
              }
              split = lastSplit + wrapLimit;
              for (split; split < tokens.length; split++) {
                if (tokens[split] != PLACEHOLDER_BODY) {
                  break;
                }
              }
              if (split == tokens.length) {
                break;
              }
              addSplit(split);
              continue;
            }
            var minSplit = Math.max(split - (wrapLimit - (wrapLimit >> 2)), lastSplit - 1);
            while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
              split--;
            }
            if (isCode) {
              while (split > minSplit && tokens[split] < PLACEHOLDER_START) {
                split--;
              }
              while (split > minSplit && tokens[split] == PUNCTUATION) {
                split--;
              }
            } else {
              while (split > minSplit && tokens[split] < SPACE) {
                split--;
              }
            }
            if (split > minSplit) {
              addSplit(++split);
              continue;
            }
            split = lastSplit + wrapLimit;
            if (tokens[split] == CHAR_EXT)
              split--;
            addSplit(split - indent);
          }
          return splits;
        };
        EditSession2.prototype.$getDisplayTokens = function(str, offset) {
          var arr = [];
          var tabSize;
          offset = offset || 0;
          for (var i2 = 0; i2 < str.length; i2++) {
            var c = str.charCodeAt(i2);
            if (c == 9) {
              tabSize = this.getScreenTabSize(arr.length + offset);
              arr.push(TAB);
              for (var n = 1; n < tabSize; n++) {
                arr.push(TAB_SPACE);
              }
            } else if (c == 32) {
              arr.push(SPACE);
            } else if (c > 39 && c < 48 || c > 57 && c < 64) {
              arr.push(PUNCTUATION);
            } else if (c >= 4352 && isFullWidth(c)) {
              arr.push(CHAR2, CHAR_EXT);
            } else {
              arr.push(CHAR2);
            }
          }
          return arr;
        };
        EditSession2.prototype.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
          if (maxScreenColumn == 0)
            return [0, 0];
          if (maxScreenColumn == null)
            maxScreenColumn = Infinity;
          screenColumn = screenColumn || 0;
          var c, column;
          for (column = 0; column < str.length; column++) {
            c = str.charCodeAt(column);
            if (c == 9) {
              screenColumn += this.getScreenTabSize(screenColumn);
            } else if (c >= 4352 && isFullWidth(c)) {
              screenColumn += 2;
            } else {
              screenColumn += 1;
            }
            if (screenColumn > maxScreenColumn) {
              break;
            }
          }
          return [screenColumn, column];
        };
        EditSession2.prototype.getRowLength = function(row) {
          var h = 1;
          if (this.lineWidgets)
            h += this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
          if (!this.$useWrapMode || !this.$wrapData[row])
            return h;
          else
            return this.$wrapData[row].length + h;
        };
        EditSession2.prototype.getRowLineCount = function(row) {
          if (!this.$useWrapMode || !this.$wrapData[row]) {
            return 1;
          } else {
            return this.$wrapData[row].length + 1;
          }
        };
        EditSession2.prototype.getRowWrapIndent = function(screenRow) {
          if (this.$useWrapMode) {
            var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
            var splits = this.$wrapData[pos.row];
            return splits.length && splits[0] < pos.column ? splits.indent : 0;
          } else {
            return 0;
          }
        };
        EditSession2.prototype.getScreenLastRowColumn = function(screenRow) {
          var pos = this.screenToDocumentPosition(screenRow, Number.MAX_VALUE);
          return this.documentToScreenColumn(pos.row, pos.column);
        };
        EditSession2.prototype.getDocumentLastRowColumn = function(docRow, docColumn) {
          var screenRow = this.documentToScreenRow(docRow, docColumn);
          return this.getScreenLastRowColumn(screenRow);
        };
        EditSession2.prototype.getDocumentLastRowColumnPosition = function(docRow, docColumn) {
          var screenRow = this.documentToScreenRow(docRow, docColumn);
          return this.screenToDocumentPosition(screenRow, Number.MAX_VALUE / 10);
        };
        EditSession2.prototype.getRowSplitData = function(row) {
          if (!this.$useWrapMode) {
            return void 0;
          } else {
            return this.$wrapData[row];
          }
        };
        EditSession2.prototype.getScreenTabSize = function(screenColumn) {
          return this.$tabSize - (screenColumn % this.$tabSize | 0);
        };
        EditSession2.prototype.screenToDocumentRow = function(screenRow, screenColumn) {
          return this.screenToDocumentPosition(screenRow, screenColumn).row;
        };
        EditSession2.prototype.screenToDocumentColumn = function(screenRow, screenColumn) {
          return this.screenToDocumentPosition(screenRow, screenColumn).column;
        };
        EditSession2.prototype.screenToDocumentPosition = function(screenRow, screenColumn, offsetX) {
          if (screenRow < 0)
            return { row: 0, column: 0 };
          var line;
          var docRow = 0;
          var docColumn = 0;
          var column;
          var row = 0;
          var rowLength = 0;
          var rowCache = this.$screenRowCache;
          var i2 = this.$getRowCacheIndex(rowCache, screenRow);
          var l = rowCache.length;
          if (l && i2 >= 0) {
            var row = rowCache[i2];
            var docRow = this.$docRowCache[i2];
            var doCache = screenRow > rowCache[l - 1];
          } else {
            var doCache = !l;
          }
          var maxRow = this.getLength() - 1;
          var foldLine = this.getNextFoldLine(docRow);
          var foldStart = foldLine ? foldLine.start.row : Infinity;
          while (row <= screenRow) {
            rowLength = this.getRowLength(docRow);
            if (row + rowLength > screenRow || docRow >= maxRow) {
              break;
            } else {
              row += rowLength;
              docRow++;
              if (docRow > foldStart) {
                docRow = foldLine.end.row + 1;
                foldLine = this.getNextFoldLine(docRow, foldLine);
                foldStart = foldLine ? foldLine.start.row : Infinity;
              }
            }
            if (doCache) {
              this.$docRowCache.push(docRow);
              this.$screenRowCache.push(row);
            }
          }
          if (foldLine && foldLine.start.row <= docRow) {
            line = this.getFoldDisplayLine(foldLine);
            docRow = foldLine.start.row;
          } else if (row + rowLength <= screenRow || docRow > maxRow) {
            return {
              row: maxRow,
              column: this.getLine(maxRow).length
            };
          } else {
            line = this.getLine(docRow);
            foldLine = null;
          }
          var wrapIndent = 0, splitIndex = Math.floor(screenRow - row);
          if (this.$useWrapMode) {
            var splits = this.$wrapData[docRow];
            if (splits) {
              column = splits[splitIndex];
              if (splitIndex > 0 && splits.length) {
                wrapIndent = splits.indent;
                docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
                line = line.substring(docColumn);
              }
            }
          }
          if (offsetX !== void 0 && this.$bidiHandler.isBidiRow(row + splitIndex, docRow, splitIndex))
            screenColumn = this.$bidiHandler.offsetToCol(offsetX);
          docColumn += this.$getStringScreenWidth(line, screenColumn - wrapIndent)[1];
          if (this.$useWrapMode && docColumn >= column)
            docColumn = column - 1;
          if (foldLine)
            return foldLine.idxToPosition(docColumn);
          return { row: docRow, column: docColumn };
        };
        EditSession2.prototype.documentToScreenPosition = function(docRow, docColumn) {
          if (typeof docColumn === "undefined")
            var pos = this.$clipPositionToDocument(docRow.row, docRow.column);
          else
            pos = this.$clipPositionToDocument(docRow, docColumn);
          docRow = pos.row;
          docColumn = pos.column;
          var screenRow = 0;
          var foldStartRow = null;
          var fold = null;
          fold = this.getFoldAt(docRow, docColumn, 1);
          if (fold) {
            docRow = fold.start.row;
            docColumn = fold.start.column;
          }
          var rowEnd, row = 0;
          var rowCache = this.$docRowCache;
          var i2 = this.$getRowCacheIndex(rowCache, docRow);
          var l = rowCache.length;
          if (l && i2 >= 0) {
            var row = rowCache[i2];
            var screenRow = this.$screenRowCache[i2];
            var doCache = docRow > rowCache[l - 1];
          } else {
            var doCache = !l;
          }
          var foldLine = this.getNextFoldLine(row);
          var foldStart = foldLine ? foldLine.start.row : Infinity;
          while (row < docRow) {
            if (row >= foldStart) {
              rowEnd = foldLine.end.row + 1;
              if (rowEnd > docRow)
                break;
              foldLine = this.getNextFoldLine(rowEnd, foldLine);
              foldStart = foldLine ? foldLine.start.row : Infinity;
            } else {
              rowEnd = row + 1;
            }
            screenRow += this.getRowLength(row);
            row = rowEnd;
            if (doCache) {
              this.$docRowCache.push(row);
              this.$screenRowCache.push(screenRow);
            }
          }
          var textLine = "";
          if (foldLine && row >= foldStart) {
            textLine = this.getFoldDisplayLine(foldLine, docRow, docColumn);
            foldStartRow = foldLine.start.row;
          } else {
            textLine = this.getLine(docRow).substring(0, docColumn);
            foldStartRow = docRow;
          }
          var wrapIndent = 0;
          if (this.$useWrapMode) {
            var wrapRow = this.$wrapData[foldStartRow];
            if (wrapRow) {
              var screenRowOffset = 0;
              while (textLine.length >= wrapRow[screenRowOffset]) {
                screenRow++;
                screenRowOffset++;
              }
              textLine = textLine.substring(wrapRow[screenRowOffset - 1] || 0, textLine.length);
              wrapIndent = screenRowOffset > 0 ? wrapRow.indent : 0;
            }
          }
          if (this.lineWidgets && this.lineWidgets[row] && this.lineWidgets[row].rowsAbove)
            screenRow += this.lineWidgets[row].rowsAbove;
          return {
            row: screenRow,
            column: wrapIndent + this.$getStringScreenWidth(textLine)[0]
          };
        };
        EditSession2.prototype.documentToScreenColumn = function(row, docColumn) {
          return this.documentToScreenPosition(row, docColumn).column;
        };
        EditSession2.prototype.documentToScreenRow = function(docRow, docColumn) {
          return this.documentToScreenPosition(docRow, docColumn).row;
        };
        EditSession2.prototype.getScreenLength = function() {
          var screenRows = 0;
          var fold = null;
          if (!this.$useWrapMode) {
            screenRows = this.getLength();
            var foldData = this.$foldData;
            for (var i2 = 0; i2 < foldData.length; i2++) {
              fold = foldData[i2];
              screenRows -= fold.end.row - fold.start.row;
            }
          } else {
            var lastRow = this.$wrapData.length;
            var row = 0, i2 = 0;
            var fold = this.$foldData[i2++];
            var foldStart = fold ? fold.start.row : Infinity;
            while (row < lastRow) {
              var splits = this.$wrapData[row];
              screenRows += splits ? splits.length + 1 : 1;
              row++;
              if (row > foldStart) {
                row = fold.end.row + 1;
                fold = this.$foldData[i2++];
                foldStart = fold ? fold.start.row : Infinity;
              }
            }
          }
          if (this.lineWidgets)
            screenRows += this.$getWidgetScreenLength();
          return screenRows;
        };
        EditSession2.prototype.$setFontMetrics = function(fm) {
          if (!this.$enableVarChar)
            return;
          this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
            if (maxScreenColumn === 0)
              return [0, 0];
            if (!maxScreenColumn)
              maxScreenColumn = Infinity;
            screenColumn = screenColumn || 0;
            var c, column;
            for (column = 0; column < str.length; column++) {
              c = str.charAt(column);
              if (c === "	") {
                screenColumn += this.getScreenTabSize(screenColumn);
              } else {
                screenColumn += fm.getCharacterWidth(c);
              }
              if (screenColumn > maxScreenColumn) {
                break;
              }
            }
            return [screenColumn, column];
          };
        };
        EditSession2.prototype.destroy = function() {
          if (!this.destroyed) {
            this.bgTokenizer.setDocument(null);
            this.bgTokenizer.cleanup();
            this.destroyed = true;
          }
          this.$stopWorker();
          this.removeAllListeners();
          if (this.doc) {
            this.doc.off("change", this.$onChange);
          }
          this.selection.detach();
        };
        return EditSession2;
      }();
      EditSession.$uid = 0;
      EditSession.prototype.$modes = config2.$modes;
      EditSession.prototype.getValue = EditSession.prototype.toString;
      EditSession.prototype.$defaultUndoManager = {
        undo: function() {
        },
        redo: function() {
        },
        hasUndo: function() {
        },
        hasRedo: function() {
        },
        reset: function() {
        },
        add: function() {
        },
        addSelection: function() {
        },
        startNewGroup: function() {
        },
        addSession: function() {
        }
      };
      EditSession.prototype.$overwrite = false;
      EditSession.prototype.$mode = null;
      EditSession.prototype.$modeId = null;
      EditSession.prototype.$scrollTop = 0;
      EditSession.prototype.$scrollLeft = 0;
      EditSession.prototype.$wrapLimit = 80;
      EditSession.prototype.$useWrapMode = false;
      EditSession.prototype.$wrapLimitRange = {
        min: null,
        max: null
      };
      EditSession.prototype.lineWidgets = null;
      EditSession.prototype.isFullWidth = isFullWidth;
      oop.implement(EditSession.prototype, EventEmitter);
      var CHAR2 = 1, CHAR_EXT = 2, PLACEHOLDER_START = 3, PLACEHOLDER_BODY = 4, PUNCTUATION = 9, SPACE = 10, TAB = 11, TAB_SPACE = 12;
      function isFullWidth(c) {
        if (c < 4352)
          return false;
        return c >= 4352 && c <= 4447 || c >= 4515 && c <= 4519 || c >= 4602 && c <= 4607 || c >= 9001 && c <= 9002 || c >= 11904 && c <= 11929 || c >= 11931 && c <= 12019 || c >= 12032 && c <= 12245 || c >= 12272 && c <= 12283 || c >= 12288 && c <= 12350 || c >= 12353 && c <= 12438 || c >= 12441 && c <= 12543 || c >= 12549 && c <= 12589 || c >= 12593 && c <= 12686 || c >= 12688 && c <= 12730 || c >= 12736 && c <= 12771 || c >= 12784 && c <= 12830 || c >= 12832 && c <= 12871 || c >= 12880 && c <= 13054 || c >= 13056 && c <= 19903 || c >= 19968 && c <= 42124 || c >= 42128 && c <= 42182 || c >= 43360 && c <= 43388 || c >= 44032 && c <= 55203 || c >= 55216 && c <= 55238 || c >= 55243 && c <= 55291 || c >= 63744 && c <= 64255 || c >= 65040 && c <= 65049 || c >= 65072 && c <= 65106 || c >= 65108 && c <= 65126 || c >= 65128 && c <= 65131 || c >= 65281 && c <= 65376 || c >= 65504 && c <= 65510;
      }
      require2("./edit_session/folding").Folding.call(EditSession.prototype);
      require2("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
      config2.defineOptions(EditSession.prototype, "session", {
        wrap: {
          set: function(value2) {
            if (!value2 || value2 == "off")
              value2 = false;
            else if (value2 == "free")
              value2 = true;
            else if (value2 == "printMargin")
              value2 = -1;
            else if (typeof value2 == "string")
              value2 = parseInt(value2, 10) || false;
            if (this.$wrap == value2)
              return;
            this.$wrap = value2;
            if (!value2) {
              this.setUseWrapMode(false);
            } else {
              var col = typeof value2 == "number" ? value2 : null;
              this.setWrapLimitRange(col, col);
              this.setUseWrapMode(true);
            }
          },
          get: function() {
            if (this.getUseWrapMode()) {
              if (this.$wrap == -1)
                return "printMargin";
              if (!this.getWrapLimitRange().min)
                return "free";
              return this.$wrap;
            }
            return "off";
          },
          handlesSet: true
        },
        wrapMethod: {
          set: function(val) {
            val = val == "auto" ? this.$mode.type != "text" : val != "text";
            if (val != this.$wrapAsCode) {
              this.$wrapAsCode = val;
              if (this.$useWrapMode) {
                this.$useWrapMode = false;
                this.setUseWrapMode(true);
              }
            }
          },
          initialValue: "auto"
        },
        indentedSoftWrap: {
          set: function() {
            if (this.$useWrapMode) {
              this.$useWrapMode = false;
              this.setUseWrapMode(true);
            }
          },
          initialValue: true
        },
        firstLineNumber: {
          set: function() {
            this._signal("changeBreakpoint");
          },
          initialValue: 1
        },
        useWorker: {
          set: function(useWorker) {
            this.$useWorker = useWorker;
            this.$stopWorker();
            if (useWorker)
              this.$startWorker();
          },
          initialValue: true
        },
        useSoftTabs: { initialValue: true },
        tabSize: {
          set: function(tabSize) {
            tabSize = parseInt(tabSize);
            if (tabSize > 0 && this.$tabSize !== tabSize) {
              this.$modified = true;
              this.$rowLengthCache = [];
              this.$tabSize = tabSize;
              this._signal("changeTabSize");
            }
          },
          initialValue: 4,
          handlesSet: true
        },
        navigateWithinSoftTabs: { initialValue: false },
        foldStyle: {
          set: function(val) {
            this.setFoldStyle(val);
          },
          handlesSet: true
        },
        overwrite: {
          set: function(val) {
            this._signal("changeOverwrite");
          },
          initialValue: false
        },
        newLineMode: {
          set: function(val) {
            this.doc.setNewLineMode(val);
          },
          get: function() {
            return this.doc.getNewLineMode();
          },
          handlesSet: true
        },
        mode: {
          set: function(val) {
            this.setMode(val);
          },
          get: function() {
            return this.$modeId;
          },
          handlesSet: true
        }
      });
      exports3.EditSession = EditSession;
    });
    ace.define("ace/search", ["require", "exports", "module", "ace/lib/lang", "ace/lib/oop", "ace/range"], function(require2, exports3, module3) {
      var lang = require2("./lib/lang");
      var oop = require2("./lib/oop");
      var Range2 = require2("./range").Range;
      var Search = function() {
        function Search2() {
          this.$options = {};
        }
        Search2.prototype.set = function(options) {
          oop.mixin(this.$options, options);
          return this;
        };
        Search2.prototype.getOptions = function() {
          return lang.copyObject(this.$options);
        };
        Search2.prototype.setOptions = function(options) {
          this.$options = options;
        };
        Search2.prototype.find = function(session) {
          var options = this.$options;
          var iterator = this.$matchIterator(session, options);
          if (!iterator)
            return false;
          var firstRange = null;
          iterator.forEach(function(sr, sc, er, ec) {
            firstRange = new Range2(sr, sc, er, ec);
            if (sc == ec && options.start && options.start.start && options.skipCurrent != false && firstRange.isEqual(options.start)) {
              firstRange = null;
              return false;
            }
            return true;
          });
          return firstRange;
        };
        Search2.prototype.findAll = function(session) {
          var options = this.$options;
          if (!options.needle)
            return [];
          this.$assembleRegExp(options);
          var range = options.range;
          var lines = range ? session.getLines(range.start.row, range.end.row) : session.doc.getAllLines();
          var ranges = [];
          var re = options.re;
          if (options.$isMultiLine) {
            var len = re.length;
            var maxRow = lines.length - len;
            var prevRange;
            outer:
              for (var row = re.offset || 0; row <= maxRow; row++) {
                for (var j = 0; j < len; j++)
                  if (lines[row + j].search(re[j]) == -1)
                    continue outer;
                var startLine = lines[row];
                var line = lines[row + len - 1];
                var startIndex = startLine.length - startLine.match(re[0])[0].length;
                var endIndex = line.match(re[len - 1])[0].length;
                if (prevRange && prevRange.end.row === row && prevRange.end.column > startIndex) {
                  continue;
                }
                ranges.push(prevRange = new Range2(row, startIndex, row + len - 1, endIndex));
                if (len > 2)
                  row = row + len - 2;
              }
          } else {
            for (var i2 = 0; i2 < lines.length; i2++) {
              var matches2 = lang.getMatchOffsets(lines[i2], re);
              for (var j = 0; j < matches2.length; j++) {
                var match = matches2[j];
                ranges.push(new Range2(i2, match.offset, i2, match.offset + match.length));
              }
            }
          }
          if (range) {
            var startColumn = range.start.column;
            var endColumn = range.end.column;
            var i2 = 0, j = ranges.length - 1;
            while (i2 < j && ranges[i2].start.column < startColumn && ranges[i2].start.row == 0)
              i2++;
            var endRow = range.end.row - range.start.row;
            while (i2 < j && ranges[j].end.column > endColumn && ranges[j].end.row == endRow)
              j--;
            ranges = ranges.slice(i2, j + 1);
            for (i2 = 0, j = ranges.length; i2 < j; i2++) {
              ranges[i2].start.row += range.start.row;
              ranges[i2].end.row += range.start.row;
            }
          }
          return ranges;
        };
        Search2.prototype.replace = function(input, replacement) {
          var options = this.$options;
          var re = this.$assembleRegExp(options);
          if (options.$isMultiLine)
            return replacement;
          if (!re)
            return;
          var match = re.exec(input);
          if (!match || match[0].length != input.length)
            return null;
          replacement = input.replace(re, replacement);
          if (options.preserveCase) {
            replacement = replacement.split("");
            for (var i2 = Math.min(input.length, input.length); i2--; ) {
              var ch = input[i2];
              if (ch && ch.toLowerCase() != ch)
                replacement[i2] = replacement[i2].toUpperCase();
              else
                replacement[i2] = replacement[i2].toLowerCase();
            }
            replacement = replacement.join("");
          }
          return replacement;
        };
        Search2.prototype.$assembleRegExp = function(options, $disableFakeMultiline) {
          if (options.needle instanceof RegExp)
            return options.re = options.needle;
          var needle = options.needle;
          if (!options.needle)
            return options.re = false;
          if (options.$supportsUnicodeFlag === void 0) {
            options.$supportsUnicodeFlag = lang.supportsUnicodeFlag();
          }
          try {
            new RegExp(needle, "u");
          } catch (e) {
            options.$supportsUnicodeFlag = false;
          }
          if (!options.regExp)
            needle = lang.escapeRegExp(needle);
          if (options.wholeWord)
            needle = addWordBoundary(needle, options);
          var modifier = options.caseSensitive ? "gm" : "gmi";
          if (options.$supportsUnicodeFlag) {
            modifier += "u";
          }
          options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle);
          if (options.$isMultiLine)
            return options.re = this.$assembleMultilineRegExp(needle, modifier);
          try {
            var re = new RegExp(needle, modifier);
          } catch (e) {
            re = false;
          }
          return options.re = re;
        };
        Search2.prototype.$assembleMultilineRegExp = function(needle, modifier) {
          var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n");
          var re = [];
          for (var i2 = 0; i2 < parts.length; i2++)
            try {
              re.push(new RegExp(parts[i2], modifier));
            } catch (e) {
              return false;
            }
          return re;
        };
        Search2.prototype.$matchIterator = function(session, options) {
          var re = this.$assembleRegExp(options);
          if (!re)
            return false;
          var backwards = options.backwards == true;
          var skipCurrent = options.skipCurrent != false;
          var range = options.range;
          var start = options.start;
          if (!start)
            start = range ? range[backwards ? "end" : "start"] : session.selection.getRange();
          if (start.start)
            start = start[skipCurrent != backwards ? "end" : "start"];
          var firstRow = range ? range.start.row : 0;
          var lastRow = range ? range.end.row : session.getLength() - 1;
          if (backwards) {
            var forEach2 = function(callback) {
              var row = start.row;
              if (forEachInLine(row, start.column, callback))
                return;
              for (row--; row >= firstRow; row--)
                if (forEachInLine(row, Number.MAX_VALUE, callback))
                  return;
              if (options.wrap == false)
                return;
              for (row = lastRow, firstRow = start.row; row >= firstRow; row--)
                if (forEachInLine(row, Number.MAX_VALUE, callback))
                  return;
            };
          } else {
            var forEach2 = function(callback) {
              var row = start.row;
              if (forEachInLine(row, start.column, callback))
                return;
              for (row = row + 1; row <= lastRow; row++)
                if (forEachInLine(row, 0, callback))
                  return;
              if (options.wrap == false)
                return;
              for (row = firstRow, lastRow = start.row; row <= lastRow; row++)
                if (forEachInLine(row, 0, callback))
                  return;
            };
          }
          if (options.$isMultiLine) {
            var len = re.length;
            var forEachInLine = function(row, offset, callback) {
              var startRow = backwards ? row - len + 1 : row;
              if (startRow < 0 || startRow + len > session.getLength())
                return;
              var line = session.getLine(startRow);
              var startIndex = line.search(re[0]);
              if (!backwards && startIndex < offset || startIndex === -1)
                return;
              for (var i2 = 1; i2 < len; i2++) {
                line = session.getLine(startRow + i2);
                if (line.search(re[i2]) == -1)
                  return;
              }
              var endIndex = line.match(re[len - 1])[0].length;
              if (backwards && endIndex > offset)
                return;
              if (callback(startRow, startIndex, startRow + len - 1, endIndex))
                return true;
            };
          } else if (backwards) {
            var forEachInLine = function(row, endIndex, callback) {
              var line = session.getLine(row);
              var matches2 = [];
              var m, last = 0;
              re.lastIndex = 0;
              while (m = re.exec(line)) {
                var length = m[0].length;
                last = m.index;
                if (!length) {
                  if (last >= line.length)
                    break;
                  re.lastIndex = last += 1;
                }
                if (m.index + length > endIndex)
                  break;
                matches2.push(m.index, length);
              }
              for (var i2 = matches2.length - 1; i2 >= 0; i2 -= 2) {
                var column = matches2[i2 - 1];
                var length = matches2[i2];
                if (callback(row, column, row, column + length))
                  return true;
              }
            };
          } else {
            var forEachInLine = function(row, startIndex, callback) {
              var line = session.getLine(row);
              var last;
              var m;
              re.lastIndex = startIndex;
              while (m = re.exec(line)) {
                var length = m[0].length;
                last = m.index;
                if (callback(row, last, row, last + length))
                  return true;
                if (!length) {
                  re.lastIndex = last += 1;
                  if (last >= line.length)
                    return false;
                }
              }
            };
          }
          return { forEach: forEach2 };
        };
        return Search2;
      }();
      function addWordBoundary(needle, options) {
        var supportsLookbehind = lang.supportsLookbehind();
        function wordBoundary(c, firstChar2) {
          if (firstChar2 === void 0) {
            firstChar2 = true;
          }
          var wordRegExp = supportsLookbehind && options.$supportsUnicodeFlag ? new RegExp("[\\p{L}\\p{N}_]", "u") : new RegExp("\\w");
          if (wordRegExp.test(c) || options.regExp) {
            if (supportsLookbehind && options.$supportsUnicodeFlag) {
              if (firstChar2)
                return "(?<=^|[^\\p{L}\\p{N}_])";
              return "(?=[^\\p{L}\\p{N}_]|$)";
            }
            return "\\b";
          }
          return "";
        }
        var needleArray = Array.from(needle);
        var firstChar = needleArray[0];
        var lastChar = needleArray[needleArray.length - 1];
        return wordBoundary(firstChar) + needle + wordBoundary(lastChar, false);
      }
      exports3.Search = Search;
    });
    ace.define("ace/keyboard/hash_handler", ["require", "exports", "module", "ace/lib/keys", "ace/lib/useragent"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 keyUtil = require2("../lib/keys");
      var useragent = require2("../lib/useragent");
      var KEY_MODS = keyUtil.KEY_MODS;
      var MultiHashHandler = function() {
        function MultiHashHandler2(config2, platform) {
          this.$init(config2, platform, false);
        }
        MultiHashHandler2.prototype.$init = function(config2, platform, $singleCommand) {
          this.platform = platform || (useragent.isMac ? "mac" : "win");
          this.commands = {};
          this.commandKeyBinding = {};
          this.addCommands(config2);
          this.$singleCommand = $singleCommand;
        };
        MultiHashHandler2.prototype.addCommand = function(command2) {
          if (this.commands[command2.name])
            this.removeCommand(command2);
          this.commands[command2.name] = command2;
          if (command2.bindKey)
            this._buildKeyHash(command2);
        };
        MultiHashHandler2.prototype.removeCommand = function(command2, keepCommand) {
          var name2 = command2 && (typeof command2 === "string" ? command2 : command2.name);
          command2 = this.commands[name2];
          if (!keepCommand)
            delete this.commands[name2];
          var ckb = this.commandKeyBinding;
          for (var keyId in ckb) {
            var cmdGroup = ckb[keyId];
            if (cmdGroup == command2) {
              delete ckb[keyId];
            } else if (Array.isArray(cmdGroup)) {
              var i2 = cmdGroup.indexOf(command2);
              if (i2 != -1) {
                cmdGroup.splice(i2, 1);
                if (cmdGroup.length == 1)
                  ckb[keyId] = cmdGroup[0];
              }
            }
          }
        };
        MultiHashHandler2.prototype.bindKey = function(key, command2, position) {
          if (typeof key == "object" && key) {
            if (position == void 0)
              position = key.position;
            key = key[this.platform];
          }
          if (!key)
            return;
          if (typeof command2 == "function")
            return this.addCommand({ exec: command2, bindKey: key, name: command2.name || key });
          key.split("|").forEach(function(keyPart) {
            var chain = "";
            if (keyPart.indexOf(" ") != -1) {
              var parts = keyPart.split(/\s+/);
              keyPart = parts.pop();
              parts.forEach(function(keyPart2) {
                var binding2 = this.parseKeys(keyPart2);
                var id3 = KEY_MODS[binding2.hashId] + binding2.key;
                chain += (chain ? " " : "") + id3;
                this._addCommandToBinding(chain, "chainKeys");
              }, this);
              chain += " ";
            }
            var binding = this.parseKeys(keyPart);
            var id2 = KEY_MODS[binding.hashId] + binding.key;
            this._addCommandToBinding(chain + id2, command2, position);
          }, this);
        };
        MultiHashHandler2.prototype._addCommandToBinding = function(keyId, command2, position) {
          var ckb = this.commandKeyBinding, i2;
          if (!command2) {
            delete ckb[keyId];
          } else if (!ckb[keyId] || this.$singleCommand) {
            ckb[keyId] = command2;
          } else {
            if (!Array.isArray(ckb[keyId])) {
              ckb[keyId] = [ckb[keyId]];
            } else if ((i2 = ckb[keyId].indexOf(command2)) != -1) {
              ckb[keyId].splice(i2, 1);
            }
            if (typeof position != "number") {
              position = getPosition(command2);
            }
            var commands = ckb[keyId];
            for (i2 = 0; i2 < commands.length; i2++) {
              var other = commands[i2];
              var otherPos = getPosition(other);
              if (otherPos > position)
                break;
            }
            commands.splice(i2, 0, command2);
          }
        };
        MultiHashHandler2.prototype.addCommands = function(commands) {
          commands && Object.keys(commands).forEach(function(name2) {
            var command2 = commands[name2];
            if (!command2)
              return;
            if (typeof command2 === "string")
              return this.bindKey(command2, name2);
            if (typeof command2 === "function")
              command2 = { exec: command2 };
            if (typeof command2 !== "object")
              return;
            if (!command2.name)
              command2.name = name2;
            this.addCommand(command2);
          }, this);
        };
        MultiHashHandler2.prototype.removeCommands = function(commands) {
          Object.keys(commands).forEach(function(name2) {
            this.removeCommand(commands[name2]);
          }, this);
        };
        MultiHashHandler2.prototype.bindKeys = function(keyList) {
          Object.keys(keyList).forEach(function(key) {
            this.bindKey(key, keyList[key]);
          }, this);
        };
        MultiHashHandler2.prototype._buildKeyHash = function(command2) {
          this.bindKey(command2.bindKey, command2);
        };
        MultiHashHandler2.prototype.parseKeys = function(keys2) {
          var parts = keys2.toLowerCase().split(/[\-\+]([\-\+])?/).filter(function(x) {
            return x;
          });
          var key = parts.pop();
          var keyCode = keyUtil[key];
          if (keyUtil.FUNCTION_KEYS[keyCode])
            key = keyUtil.FUNCTION_KEYS[keyCode].toLowerCase();
          else if (!parts.length)
            return { key, hashId: -1 };
          else if (parts.length == 1 && parts[0] == "shift")
            return { key: key.toUpperCase(), hashId: -1 };
          var hashId = 0;
          for (var i2 = parts.length; i2--; ) {
            var modifier = keyUtil.KEY_MODS[parts[i2]];
            if (modifier == null) {
              if (typeof console != "undefined")
                console.error("invalid modifier " + parts[i2] + " in " + keys2);
              return false;
            }
            hashId |= modifier;
          }
          return { key, hashId };
        };
        MultiHashHandler2.prototype.findKeyCommand = function(hashId, keyString) {
          var key = KEY_MODS[hashId] + keyString;
          return this.commandKeyBinding[key];
        };
        MultiHashHandler2.prototype.handleKeyboard = function(data2, hashId, keyString, keyCode) {
          if (keyCode < 0)
            return;
          var key = KEY_MODS[hashId] + keyString;
          var command2 = this.commandKeyBinding[key];
          if (data2.$keyChain) {
            data2.$keyChain += " " + key;
            command2 = this.commandKeyBinding[data2.$keyChain] || command2;
          }
          if (command2) {
            if (command2 == "chainKeys" || command2[command2.length - 1] == "chainKeys") {
              data2.$keyChain = data2.$keyChain || key;
              return { command: "null" };
            }
          }
          if (data2.$keyChain) {
            if ((!hashId || hashId == 4) && keyString.length == 1)
              data2.$keyChain = data2.$keyChain.slice(0, -key.length - 1);
            else if (hashId == -1 || keyCode > 0)
              data2.$keyChain = "";
          }
          return { command: command2 };
        };
        MultiHashHandler2.prototype.getStatusText = function(editor, data2) {
          return data2.$keyChain || "";
        };
        return MultiHashHandler2;
      }();
      function getPosition(command2) {
        return typeof command2 == "object" && command2.bindKey && command2.bindKey.position || (command2.isDefault ? -100 : 0);
      }
      var HashHandler = function(_super) {
        __extends(HashHandler2, _super);
        function HashHandler2(config2, platform) {
          var _this = _super.call(this, config2, platform) || this;
          _this.$singleCommand = true;
          return _this;
        }
        return HashHandler2;
      }(MultiHashHandler);
      HashHandler.call = function(thisArg, config2, platform) {
        MultiHashHandler.prototype.$init.call(thisArg, config2, platform, true);
      };
      MultiHashHandler.call = function(thisArg, config2, platform) {
        MultiHashHandler.prototype.$init.call(thisArg, config2, platform, false);
      };
      exports3.HashHandler = HashHandler;
      exports3.MultiHashHandler = MultiHashHandler;
    });
    ace.define("ace/commands/command_manager", ["require", "exports", "module", "ace/lib/oop", "ace/keyboard/hash_handler", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 oop = require2("../lib/oop");
      var MultiHashHandler = require2("../keyboard/hash_handler").MultiHashHandler;
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var CommandManager = function(_super) {
        __extends(CommandManager2, _super);
        function CommandManager2(platform, commands) {
          var _this = _super.call(this, commands, platform) || this;
          _this.byName = _this.commands;
          _this.setDefaultHandler("exec", function(e) {
            if (!e.args) {
              return e.command.exec(e.editor, {}, e.event, true);
            }
            return e.command.exec(e.editor, e.args, e.event, false);
          });
          return _this;
        }
        CommandManager2.prototype.exec = function(command2, editor, args) {
          if (Array.isArray(command2)) {
            for (var i2 = command2.length; i2--; ) {
              if (this.exec(command2[i2], editor, args))
                return true;
            }
            return false;
          }
          if (typeof command2 === "string")
            command2 = this.commands[command2];
          if (!command2)
            return false;
          if (editor && editor.$readOnly && !command2.readOnly)
            return false;
          if (this.$checkCommandState != false && command2.isAvailable && !command2.isAvailable(editor))
            return false;
          var e = { editor, command: command2, args };
          e.returnValue = this._emit("exec", e);
          this._signal("afterExec", e);
          return e.returnValue === false ? false : true;
        };
        CommandManager2.prototype.toggleRecording = function(editor) {
          if (this.$inReplay)
            return;
          editor && editor._emit("changeStatus");
          if (this.recording) {
            this.macro.pop();
            this.off("exec", this.$addCommandToMacro);
            if (!this.macro.length)
              this.macro = this.oldMacro;
            return this.recording = false;
          }
          if (!this.$addCommandToMacro) {
            this.$addCommandToMacro = function(e) {
              this.macro.push([e.command, e.args]);
            }.bind(this);
          }
          this.oldMacro = this.macro;
          this.macro = [];
          this.on("exec", this.$addCommandToMacro);
          return this.recording = true;
        };
        CommandManager2.prototype.replay = function(editor) {
          if (this.$inReplay || !this.macro)
            return;
          if (this.recording)
            return this.toggleRecording(editor);
          try {
            this.$inReplay = true;
            this.macro.forEach(function(x) {
              if (typeof x == "string")
                this.exec(x, editor);
              else
                this.exec(x[0], editor, x[1]);
            }, this);
          } finally {
            this.$inReplay = false;
          }
        };
        CommandManager2.prototype.trimMacro = function(m) {
          return m.map(function(x) {
            if (typeof x[0] != "string")
              x[0] = x[0].name;
            if (!x[1])
              x = x[0];
            return x;
          });
        };
        return CommandManager2;
      }(MultiHashHandler);
      oop.implement(CommandManager.prototype, EventEmitter);
      exports3.CommandManager = CommandManager;
    });
    ace.define("ace/commands/default_commands", ["require", "exports", "module", "ace/lib/lang", "ace/config", "ace/range"], function(require2, exports3, module3) {
      var lang = require2("../lib/lang");
      var config2 = require2("../config");
      var Range2 = require2("../range").Range;
      function bindKey(win, mac2) {
        return { win, mac: mac2 };
      }
      exports3.commands = [
        {
          name: "showSettingsMenu",
          description: "Show settings menu",
          bindKey: bindKey("Ctrl-,", "Command-,"),
          exec: function(editor) {
            config2.loadModule("ace/ext/settings_menu", function(module4) {
              module4.init(editor);
              editor.showSettingsMenu();
            });
          },
          readOnly: true
        },
        {
          name: "goToNextError",
          description: "Go to next error",
          bindKey: bindKey("Alt-E", "F4"),
          exec: function(editor) {
            config2.loadModule("ace/ext/error_marker", function(module4) {
              module4.showErrorMarker(editor, 1);
            });
          },
          scrollIntoView: "animate",
          readOnly: true
        },
        {
          name: "goToPreviousError",
          description: "Go to previous error",
          bindKey: bindKey("Alt-Shift-E", "Shift-F4"),
          exec: function(editor) {
            config2.loadModule("ace/ext/error_marker", function(module4) {
              module4.showErrorMarker(editor, -1);
            });
          },
          scrollIntoView: "animate",
          readOnly: true
        },
        {
          name: "selectall",
          description: "Select all",
          bindKey: bindKey("Ctrl-A", "Command-A"),
          exec: function(editor) {
            editor.selectAll();
          },
          readOnly: true
        },
        {
          name: "centerselection",
          description: "Center selection",
          bindKey: bindKey(null, "Ctrl-L"),
          exec: function(editor) {
            editor.centerSelection();
          },
          readOnly: true
        },
        {
          name: "gotoline",
          description: "Go to line...",
          bindKey: bindKey("Ctrl-L", "Command-L"),
          exec: function(editor, line) {
            if (typeof line === "number" && !isNaN(line))
              editor.gotoLine(line);
            editor.prompt({ $type: "gotoLine" });
          },
          readOnly: true
        },
        {
          name: "fold",
          bindKey: bindKey("Alt-L|Ctrl-F1", "Command-Alt-L|Command-F1"),
          exec: function(editor) {
            editor.session.toggleFold(false);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "unfold",
          bindKey: bindKey("Alt-Shift-L|Ctrl-Shift-F1", "Command-Alt-Shift-L|Command-Shift-F1"),
          exec: function(editor) {
            editor.session.toggleFold(true);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "toggleFoldWidget",
          description: "Toggle fold widget",
          bindKey: bindKey("F2", "F2"),
          exec: function(editor) {
            editor.session.toggleFoldWidget();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "toggleParentFoldWidget",
          description: "Toggle parent fold widget",
          bindKey: bindKey("Alt-F2", "Alt-F2"),
          exec: function(editor) {
            editor.session.toggleFoldWidget(true);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "foldall",
          description: "Fold all",
          bindKey: bindKey(null, "Ctrl-Command-Option-0"),
          exec: function(editor) {
            editor.session.foldAll();
          },
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "foldAllComments",
          description: "Fold all comments",
          bindKey: bindKey(null, "Ctrl-Command-Option-0"),
          exec: function(editor) {
            editor.session.foldAllComments();
          },
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "foldOther",
          description: "Fold other",
          bindKey: bindKey("Alt-0", "Command-Option-0"),
          exec: function(editor) {
            editor.session.foldAll();
            editor.session.unfold(editor.selection.getAllRanges());
          },
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "unfoldall",
          description: "Unfold all",
          bindKey: bindKey("Alt-Shift-0", "Command-Option-Shift-0"),
          exec: function(editor) {
            editor.session.unfold();
          },
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "findnext",
          description: "Find next",
          bindKey: bindKey("Ctrl-K", "Command-G"),
          exec: function(editor) {
            editor.findNext();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "findprevious",
          description: "Find previous",
          bindKey: bindKey("Ctrl-Shift-K", "Command-Shift-G"),
          exec: function(editor) {
            editor.findPrevious();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "center",
          readOnly: true
        },
        {
          name: "selectOrFindNext",
          description: "Select or find next",
          bindKey: bindKey("Alt-K", "Ctrl-G"),
          exec: function(editor) {
            if (editor.selection.isEmpty())
              editor.selection.selectWord();
            else
              editor.findNext();
          },
          readOnly: true
        },
        {
          name: "selectOrFindPrevious",
          description: "Select or find previous",
          bindKey: bindKey("Alt-Shift-K", "Ctrl-Shift-G"),
          exec: function(editor) {
            if (editor.selection.isEmpty())
              editor.selection.selectWord();
            else
              editor.findPrevious();
          },
          readOnly: true
        },
        {
          name: "find",
          description: "Find",
          bindKey: bindKey("Ctrl-F", "Command-F"),
          exec: function(editor) {
            config2.loadModule("ace/ext/searchbox", function(e) {
              e.Search(editor);
            });
          },
          readOnly: true
        },
        {
          name: "overwrite",
          description: "Overwrite",
          bindKey: "Insert",
          exec: function(editor) {
            editor.toggleOverwrite();
          },
          readOnly: true
        },
        {
          name: "selecttostart",
          description: "Select to start",
          bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"),
          exec: function(editor) {
            editor.getSelection().selectFileStart();
          },
          multiSelectAction: "forEach",
          readOnly: true,
          scrollIntoView: "animate",
          aceCommandGroup: "fileJump"
        },
        {
          name: "gotostart",
          description: "Go to start",
          bindKey: bindKey("Ctrl-Home", "Command-Home|Command-Up"),
          exec: function(editor) {
            editor.navigateFileStart();
          },
          multiSelectAction: "forEach",
          readOnly: true,
          scrollIntoView: "animate",
          aceCommandGroup: "fileJump"
        },
        {
          name: "selectup",
          description: "Select up",
          bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"),
          exec: function(editor) {
            editor.getSelection().selectUp();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "golineup",
          description: "Go line up",
          bindKey: bindKey("Up", "Up|Ctrl-P"),
          exec: function(editor, args) {
            editor.navigateUp(args.times);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selecttoend",
          description: "Select to end",
          bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"),
          exec: function(editor) {
            editor.getSelection().selectFileEnd();
          },
          multiSelectAction: "forEach",
          readOnly: true,
          scrollIntoView: "animate",
          aceCommandGroup: "fileJump"
        },
        {
          name: "gotoend",
          description: "Go to end",
          bindKey: bindKey("Ctrl-End", "Command-End|Command-Down"),
          exec: function(editor) {
            editor.navigateFileEnd();
          },
          multiSelectAction: "forEach",
          readOnly: true,
          scrollIntoView: "animate",
          aceCommandGroup: "fileJump"
        },
        {
          name: "selectdown",
          description: "Select down",
          bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"),
          exec: function(editor) {
            editor.getSelection().selectDown();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "golinedown",
          description: "Go line down",
          bindKey: bindKey("Down", "Down|Ctrl-N"),
          exec: function(editor, args) {
            editor.navigateDown(args.times);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectwordleft",
          description: "Select word left",
          bindKey: bindKey("Ctrl-Shift-Left", "Option-Shift-Left"),
          exec: function(editor) {
            editor.getSelection().selectWordLeft();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotowordleft",
          description: "Go to word left",
          bindKey: bindKey("Ctrl-Left", "Option-Left"),
          exec: function(editor) {
            editor.navigateWordLeft();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selecttolinestart",
          description: "Select to line start",
          bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"),
          exec: function(editor) {
            editor.getSelection().selectLineStart();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotolinestart",
          description: "Go to line start",
          bindKey: bindKey("Alt-Left|Home", "Command-Left|Home|Ctrl-A"),
          exec: function(editor) {
            editor.navigateLineStart();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectleft",
          description: "Select left",
          bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"),
          exec: function(editor) {
            editor.getSelection().selectLeft();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotoleft",
          description: "Go to left",
          bindKey: bindKey("Left", "Left|Ctrl-B"),
          exec: function(editor, args) {
            editor.navigateLeft(args.times);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectwordright",
          description: "Select word right",
          bindKey: bindKey("Ctrl-Shift-Right", "Option-Shift-Right"),
          exec: function(editor) {
            editor.getSelection().selectWordRight();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotowordright",
          description: "Go to word right",
          bindKey: bindKey("Ctrl-Right", "Option-Right"),
          exec: function(editor) {
            editor.navigateWordRight();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selecttolineend",
          description: "Select to line end",
          bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"),
          exec: function(editor) {
            editor.getSelection().selectLineEnd();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotolineend",
          description: "Go to line end",
          bindKey: bindKey("Alt-Right|End", "Command-Right|End|Ctrl-E"),
          exec: function(editor) {
            editor.navigateLineEnd();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectright",
          description: "Select right",
          bindKey: bindKey("Shift-Right", "Shift-Right"),
          exec: function(editor) {
            editor.getSelection().selectRight();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "gotoright",
          description: "Go to right",
          bindKey: bindKey("Right", "Right|Ctrl-F"),
          exec: function(editor, args) {
            editor.navigateRight(args.times);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectpagedown",
          description: "Select page down",
          bindKey: "Shift-PageDown",
          exec: function(editor) {
            editor.selectPageDown();
          },
          readOnly: true
        },
        {
          name: "pagedown",
          description: "Page down",
          bindKey: bindKey(null, "Option-PageDown"),
          exec: function(editor) {
            editor.scrollPageDown();
          },
          readOnly: true
        },
        {
          name: "gotopagedown",
          description: "Go to page down",
          bindKey: bindKey("PageDown", "PageDown|Ctrl-V"),
          exec: function(editor) {
            editor.gotoPageDown();
          },
          readOnly: true
        },
        {
          name: "selectpageup",
          description: "Select page up",
          bindKey: "Shift-PageUp",
          exec: function(editor) {
            editor.selectPageUp();
          },
          readOnly: true
        },
        {
          name: "pageup",
          description: "Page up",
          bindKey: bindKey(null, "Option-PageUp"),
          exec: function(editor) {
            editor.scrollPageUp();
          },
          readOnly: true
        },
        {
          name: "gotopageup",
          description: "Go to page up",
          bindKey: "PageUp",
          exec: function(editor) {
            editor.gotoPageUp();
          },
          readOnly: true
        },
        {
          name: "scrollup",
          description: "Scroll up",
          bindKey: bindKey("Ctrl-Up", null),
          exec: function(e) {
            e.renderer.scrollBy(0, -2 * e.renderer.layerConfig.lineHeight);
          },
          readOnly: true
        },
        {
          name: "scrolldown",
          description: "Scroll down",
          bindKey: bindKey("Ctrl-Down", null),
          exec: function(e) {
            e.renderer.scrollBy(0, 2 * e.renderer.layerConfig.lineHeight);
          },
          readOnly: true
        },
        {
          name: "selectlinestart",
          description: "Select line start",
          bindKey: "Shift-Home",
          exec: function(editor) {
            editor.getSelection().selectLineStart();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "selectlineend",
          description: "Select line end",
          bindKey: "Shift-End",
          exec: function(editor) {
            editor.getSelection().selectLineEnd();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "togglerecording",
          description: "Toggle recording",
          bindKey: bindKey("Ctrl-Alt-E", "Command-Option-E"),
          exec: function(editor) {
            editor.commands.toggleRecording(editor);
          },
          readOnly: true
        },
        {
          name: "replaymacro",
          description: "Replay macro",
          bindKey: bindKey("Ctrl-Shift-E", "Command-Shift-E"),
          exec: function(editor) {
            editor.commands.replay(editor);
          },
          readOnly: true
        },
        {
          name: "jumptomatching",
          description: "Jump to matching",
          bindKey: bindKey("Ctrl-\\|Ctrl-P", "Command-\\"),
          exec: function(editor) {
            editor.jumpToMatching();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "animate",
          readOnly: true
        },
        {
          name: "selecttomatching",
          description: "Select to matching",
          bindKey: bindKey("Ctrl-Shift-\\|Ctrl-Shift-P", "Command-Shift-\\"),
          exec: function(editor) {
            editor.jumpToMatching(true);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "animate",
          readOnly: true
        },
        {
          name: "expandToMatching",
          description: "Expand to matching",
          bindKey: bindKey("Ctrl-Shift-M", "Ctrl-Shift-M"),
          exec: function(editor) {
            editor.jumpToMatching(true, true);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "animate",
          readOnly: true
        },
        {
          name: "passKeysToBrowser",
          description: "Pass keys to browser",
          bindKey: bindKey(null, null),
          exec: function() {
          },
          passEvent: true,
          readOnly: true
        },
        {
          name: "copy",
          description: "Copy",
          exec: function(editor) {
          },
          readOnly: true
        },
        {
          name: "cut",
          description: "Cut",
          exec: function(editor) {
            var cutLine = editor.$copyWithEmptySelection && editor.selection.isEmpty();
            var range = cutLine ? editor.selection.getLineRange() : editor.selection.getRange();
            editor._emit("cut", range);
            if (!range.isEmpty())
              editor.session.remove(range);
            editor.clearSelection();
          },
          scrollIntoView: "cursor",
          multiSelectAction: "forEach"
        },
        {
          name: "paste",
          description: "Paste",
          exec: function(editor, args) {
            editor.$handlePaste(args);
          },
          scrollIntoView: "cursor"
        },
        {
          name: "removeline",
          description: "Remove line",
          bindKey: bindKey("Ctrl-D", "Command-D"),
          exec: function(editor) {
            editor.removeLines();
          },
          scrollIntoView: "cursor",
          multiSelectAction: "forEachLine"
        },
        {
          name: "duplicateSelection",
          description: "Duplicate selection",
          bindKey: bindKey("Ctrl-Shift-D", "Command-Shift-D"),
          exec: function(editor) {
            editor.duplicateSelection();
          },
          scrollIntoView: "cursor",
          multiSelectAction: "forEach"
        },
        {
          name: "sortlines",
          description: "Sort lines",
          bindKey: bindKey("Ctrl-Alt-S", "Command-Alt-S"),
          exec: function(editor) {
            editor.sortLines();
          },
          scrollIntoView: "selection",
          multiSelectAction: "forEachLine"
        },
        {
          name: "togglecomment",
          description: "Toggle comment",
          bindKey: bindKey("Ctrl-/", "Command-/"),
          exec: function(editor) {
            editor.toggleCommentLines();
          },
          multiSelectAction: "forEachLine",
          scrollIntoView: "selectionPart"
        },
        {
          name: "toggleBlockComment",
          description: "Toggle block comment",
          bindKey: bindKey("Ctrl-Shift-/", "Command-Shift-/"),
          exec: function(editor) {
            editor.toggleBlockComment();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "selectionPart"
        },
        {
          name: "modifyNumberUp",
          description: "Modify number up",
          bindKey: bindKey("Ctrl-Shift-Up", "Alt-Shift-Up"),
          exec: function(editor) {
            editor.modifyNumber(1);
          },
          scrollIntoView: "cursor",
          multiSelectAction: "forEach"
        },
        {
          name: "modifyNumberDown",
          description: "Modify number down",
          bindKey: bindKey("Ctrl-Shift-Down", "Alt-Shift-Down"),
          exec: function(editor) {
            editor.modifyNumber(-1);
          },
          scrollIntoView: "cursor",
          multiSelectAction: "forEach"
        },
        {
          name: "replace",
          description: "Replace",
          bindKey: bindKey("Ctrl-H", "Command-Option-F"),
          exec: function(editor) {
            config2.loadModule("ace/ext/searchbox", function(e) {
              e.Search(editor, true);
            });
          }
        },
        {
          name: "undo",
          description: "Undo",
          bindKey: bindKey("Ctrl-Z", "Command-Z"),
          exec: function(editor) {
            editor.undo();
          }
        },
        {
          name: "redo",
          description: "Redo",
          bindKey: bindKey("Ctrl-Shift-Z|Ctrl-Y", "Command-Shift-Z|Command-Y"),
          exec: function(editor) {
            editor.redo();
          }
        },
        {
          name: "copylinesup",
          description: "Copy lines up",
          bindKey: bindKey("Alt-Shift-Up", "Command-Option-Up"),
          exec: function(editor) {
            editor.copyLinesUp();
          },
          scrollIntoView: "cursor"
        },
        {
          name: "movelinesup",
          description: "Move lines up",
          bindKey: bindKey("Alt-Up", "Option-Up"),
          exec: function(editor) {
            editor.moveLinesUp();
          },
          scrollIntoView: "cursor"
        },
        {
          name: "copylinesdown",
          description: "Copy lines down",
          bindKey: bindKey("Alt-Shift-Down", "Command-Option-Down"),
          exec: function(editor) {
            editor.copyLinesDown();
          },
          scrollIntoView: "cursor"
        },
        {
          name: "movelinesdown",
          description: "Move lines down",
          bindKey: bindKey("Alt-Down", "Option-Down"),
          exec: function(editor) {
            editor.moveLinesDown();
          },
          scrollIntoView: "cursor"
        },
        {
          name: "del",
          description: "Delete",
          bindKey: bindKey("Delete", "Delete|Ctrl-D|Shift-Delete"),
          exec: function(editor) {
            editor.remove("right");
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "backspace",
          description: "Backspace",
          bindKey: bindKey("Shift-Backspace|Backspace", "Ctrl-Backspace|Shift-Backspace|Backspace|Ctrl-H"),
          exec: function(editor) {
            editor.remove("left");
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "cut_or_delete",
          description: "Cut or delete",
          bindKey: bindKey("Shift-Delete", null),
          exec: function(editor) {
            if (editor.selection.isEmpty()) {
              editor.remove("left");
            } else {
              return false;
            }
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removetolinestart",
          description: "Remove to line start",
          bindKey: bindKey("Alt-Backspace", "Command-Backspace"),
          exec: function(editor) {
            editor.removeToLineStart();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removetolineend",
          description: "Remove to line end",
          bindKey: bindKey("Alt-Delete", "Ctrl-K|Command-Delete"),
          exec: function(editor) {
            editor.removeToLineEnd();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removetolinestarthard",
          description: "Remove to line start hard",
          bindKey: bindKey("Ctrl-Shift-Backspace", null),
          exec: function(editor) {
            var range = editor.selection.getRange();
            range.start.column = 0;
            editor.session.remove(range);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removetolineendhard",
          description: "Remove to line end hard",
          bindKey: bindKey("Ctrl-Shift-Delete", null),
          exec: function(editor) {
            var range = editor.selection.getRange();
            range.end.column = Number.MAX_VALUE;
            editor.session.remove(range);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removewordleft",
          description: "Remove word left",
          bindKey: bindKey("Ctrl-Backspace", "Alt-Backspace|Ctrl-Alt-Backspace"),
          exec: function(editor) {
            editor.removeWordLeft();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "removewordright",
          description: "Remove word right",
          bindKey: bindKey("Ctrl-Delete", "Alt-Delete"),
          exec: function(editor) {
            editor.removeWordRight();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "outdent",
          description: "Outdent",
          bindKey: bindKey("Shift-Tab", "Shift-Tab"),
          exec: function(editor) {
            editor.blockOutdent();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "selectionPart"
        },
        {
          name: "indent",
          description: "Indent",
          bindKey: bindKey("Tab", "Tab"),
          exec: function(editor) {
            editor.indent();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "selectionPart"
        },
        {
          name: "blockoutdent",
          description: "Block outdent",
          bindKey: bindKey("Ctrl-[", "Ctrl-["),
          exec: function(editor) {
            editor.blockOutdent();
          },
          multiSelectAction: "forEachLine",
          scrollIntoView: "selectionPart"
        },
        {
          name: "blockindent",
          description: "Block indent",
          bindKey: bindKey("Ctrl-]", "Ctrl-]"),
          exec: function(editor) {
            editor.blockIndent();
          },
          multiSelectAction: "forEachLine",
          scrollIntoView: "selectionPart"
        },
        {
          name: "insertstring",
          description: "Insert string",
          exec: function(editor, str) {
            editor.insert(str);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "inserttext",
          description: "Insert text",
          exec: function(editor, args) {
            editor.insert(lang.stringRepeat(args.text || "", args.times || 1));
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "splitline",
          description: "Split line",
          bindKey: bindKey(null, "Ctrl-O"),
          exec: function(editor) {
            editor.splitLine();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "transposeletters",
          description: "Transpose letters",
          bindKey: bindKey("Alt-Shift-X", "Ctrl-T"),
          exec: function(editor) {
            editor.transposeLetters();
          },
          multiSelectAction: function(editor) {
            editor.transposeSelections(1);
          },
          scrollIntoView: "cursor"
        },
        {
          name: "touppercase",
          description: "To uppercase",
          bindKey: bindKey("Ctrl-U", "Ctrl-U"),
          exec: function(editor) {
            editor.toUpperCase();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "tolowercase",
          description: "To lowercase",
          bindKey: bindKey("Ctrl-Shift-U", "Ctrl-Shift-U"),
          exec: function(editor) {
            editor.toLowerCase();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "autoindent",
          description: "Auto Indent",
          bindKey: bindKey(null, null),
          exec: function(editor) {
            editor.autoIndent();
          },
          multiSelectAction: "forEachLine",
          scrollIntoView: "animate"
        },
        {
          name: "expandtoline",
          description: "Expand to line",
          bindKey: bindKey("Ctrl-Shift-L", "Command-Shift-L"),
          exec: function(editor) {
            var range = editor.selection.getRange();
            range.start.column = range.end.column = 0;
            range.end.row++;
            editor.selection.setRange(range, false);
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor",
          readOnly: true
        },
        {
          name: "openlink",
          bindKey: bindKey("Ctrl+F3", "F3"),
          exec: function(editor) {
            editor.openLink();
          }
        },
        {
          name: "joinlines",
          description: "Join lines",
          bindKey: bindKey(null, null),
          exec: function(editor) {
            var isBackwards = editor.selection.isBackwards();
            var selectionStart = isBackwards ? editor.selection.getSelectionLead() : editor.selection.getSelectionAnchor();
            var selectionEnd = isBackwards ? editor.selection.getSelectionAnchor() : editor.selection.getSelectionLead();
            var firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length;
            var selectedText = editor.session.doc.getTextRange(editor.selection.getRange());
            var selectedCount = selectedText.replace(/\n\s*/, " ").length;
            var insertLine = editor.session.doc.getLine(selectionStart.row);
            for (var i3 = selectionStart.row + 1; i3 <= selectionEnd.row + 1; i3++) {
              var curLine = lang.stringTrimLeft(lang.stringTrimRight(editor.session.doc.getLine(i3)));
              if (curLine.length !== 0) {
                curLine = " " + curLine;
              }
              insertLine += curLine;
            }
            if (selectionEnd.row + 1 < editor.session.doc.getLength() - 1) {
              insertLine += editor.session.doc.getNewLineCharacter();
            }
            editor.clearSelection();
            editor.session.doc.replace(new Range2(selectionStart.row, 0, selectionEnd.row + 2, 0), insertLine);
            if (selectedCount > 0) {
              editor.selection.moveCursorTo(selectionStart.row, selectionStart.column);
              editor.selection.selectTo(selectionStart.row, selectionStart.column + selectedCount);
            } else {
              firstLineEndCol = editor.session.doc.getLine(selectionStart.row).length > firstLineEndCol ? firstLineEndCol + 1 : firstLineEndCol;
              editor.selection.moveCursorTo(selectionStart.row, firstLineEndCol);
            }
          },
          multiSelectAction: "forEach",
          readOnly: true
        },
        {
          name: "invertSelection",
          description: "Invert selection",
          bindKey: bindKey(null, null),
          exec: function(editor) {
            var endRow = editor.session.doc.getLength() - 1;
            var endCol = editor.session.doc.getLine(endRow).length;
            var ranges = editor.selection.rangeList.ranges;
            var newRanges = [];
            if (ranges.length < 1) {
              ranges = [editor.selection.getRange()];
            }
            for (var i3 = 0; i3 < ranges.length; i3++) {
              if (i3 == ranges.length - 1) {
                if (!(ranges[i3].end.row === endRow && ranges[i3].end.column === endCol)) {
                  newRanges.push(new Range2(ranges[i3].end.row, ranges[i3].end.column, endRow, endCol));
                }
              }
              if (i3 === 0) {
                if (!(ranges[i3].start.row === 0 && ranges[i3].start.column === 0)) {
                  newRanges.push(new Range2(0, 0, ranges[i3].start.row, ranges[i3].start.column));
                }
              } else {
                newRanges.push(new Range2(ranges[i3 - 1].end.row, ranges[i3 - 1].end.column, ranges[i3].start.row, ranges[i3].start.column));
              }
            }
            editor.exitMultiSelectMode();
            editor.clearSelection();
            for (var i3 = 0; i3 < newRanges.length; i3++) {
              editor.selection.addRange(newRanges[i3], false);
            }
          },
          readOnly: true,
          scrollIntoView: "none"
        },
        {
          name: "addLineAfter",
          description: "Add new line after the current line",
          exec: function(editor) {
            editor.selection.clearSelection();
            editor.navigateLineEnd();
            editor.insert("\n");
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "addLineBefore",
          description: "Add new line before the current line",
          exec: function(editor) {
            editor.selection.clearSelection();
            var cursor = editor.getCursorPosition();
            editor.selection.moveTo(cursor.row - 1, Number.MAX_VALUE);
            editor.insert("\n");
            if (cursor.row === 0)
              editor.navigateUp();
          },
          multiSelectAction: "forEach",
          scrollIntoView: "cursor"
        },
        {
          name: "openCommandPallete",
          exec: function(editor) {
            console.warn("This is an obsolete command. Please use `openCommandPalette` instead.");
            editor.prompt({ $type: "commands" });
          },
          readOnly: true
        },
        {
          name: "openCommandPalette",
          description: "Open command palette",
          bindKey: bindKey("F1", "F1"),
          exec: function(editor) {
            editor.prompt({ $type: "commands" });
          },
          readOnly: true
        },
        {
          name: "modeSelect",
          description: "Change language mode...",
          bindKey: bindKey(null, null),
          exec: function(editor) {
            editor.prompt({ $type: "modes" });
          },
          readOnly: true
        }
      ];
      for (var i2 = 1; i2 < 9; i2++) {
        exports3.commands.push({
          name: "foldToLevel" + i2,
          description: "Fold To Level " + i2,
          level: i2,
          exec: function(editor) {
            editor.session.foldToLevel(this.level);
          },
          scrollIntoView: "center",
          readOnly: true
        });
      }
    });
    ace.define("ace/line_widgets", ["require", "exports", "module", "ace/lib/dom"], function(require2, exports3, module3) {
      var dom = require2("./lib/dom");
      var LineWidgets = function() {
        function LineWidgets2(session) {
          this.session = session;
          this.session.widgetManager = this;
          this.session.getRowLength = this.getRowLength;
          this.session.$getWidgetScreenLength = this.$getWidgetScreenLength;
          this.updateOnChange = this.updateOnChange.bind(this);
          this.renderWidgets = this.renderWidgets.bind(this);
          this.measureWidgets = this.measureWidgets.bind(this);
          this.session._changedWidgets = [];
          this.$onChangeEditor = this.$onChangeEditor.bind(this);
          this.session.on("change", this.updateOnChange);
          this.session.on("changeFold", this.updateOnFold);
          this.session.on("changeEditor", this.$onChangeEditor);
        }
        LineWidgets2.prototype.getRowLength = function(row) {
          var h;
          if (this.lineWidgets)
            h = this.lineWidgets[row] && this.lineWidgets[row].rowCount || 0;
          else
            h = 0;
          if (!this.$useWrapMode || !this.$wrapData[row]) {
            return 1 + h;
          } else {
            return this.$wrapData[row].length + 1 + h;
          }
        };
        LineWidgets2.prototype.$getWidgetScreenLength = function() {
          var screenRows = 0;
          this.lineWidgets.forEach(function(w) {
            if (w && w.rowCount && !w.hidden)
              screenRows += w.rowCount;
          });
          return screenRows;
        };
        LineWidgets2.prototype.$onChangeEditor = function(e) {
          this.attach(e.editor);
        };
        LineWidgets2.prototype.attach = function(editor) {
          if (editor && editor.widgetManager && editor.widgetManager != this)
            editor.widgetManager.detach();
          if (this.editor == editor)
            return;
          this.detach();
          this.editor = editor;
          if (editor) {
            editor.widgetManager = this;
            editor.renderer.on("beforeRender", this.measureWidgets);
            editor.renderer.on("afterRender", this.renderWidgets);
          }
        };
        LineWidgets2.prototype.detach = function(e) {
          var editor = this.editor;
          if (!editor)
            return;
          this.editor = null;
          editor.widgetManager = null;
          editor.renderer.off("beforeRender", this.measureWidgets);
          editor.renderer.off("afterRender", this.renderWidgets);
          var lineWidgets = this.session.lineWidgets;
          lineWidgets && lineWidgets.forEach(function(w) {
            if (w && w.el && w.el.parentNode) {
              w._inDocument = false;
              w.el.parentNode.removeChild(w.el);
            }
          });
        };
        LineWidgets2.prototype.updateOnFold = function(e, session) {
          var lineWidgets = session.lineWidgets;
          if (!lineWidgets || !e.action)
            return;
          var fold = e.data;
          var start = fold.start.row;
          var end = fold.end.row;
          var hide = e.action == "add";
          for (var i2 = start + 1; i2 < end; i2++) {
            if (lineWidgets[i2])
              lineWidgets[i2].hidden = hide;
          }
          if (lineWidgets[end]) {
            if (hide) {
              if (!lineWidgets[start])
                lineWidgets[start] = lineWidgets[end];
              else
                lineWidgets[end].hidden = hide;
            } else {
              if (lineWidgets[start] == lineWidgets[end])
                lineWidgets[start] = void 0;
              lineWidgets[end].hidden = hide;
            }
          }
        };
        LineWidgets2.prototype.updateOnChange = function(delta) {
          var lineWidgets = this.session.lineWidgets;
          if (!lineWidgets)
            return;
          var startRow = delta.start.row;
          var len = delta.end.row - startRow;
          if (len === 0)
            ;
          else if (delta.action == "remove") {
            var removed = lineWidgets.splice(startRow + 1, len);
            if (!lineWidgets[startRow] && removed[removed.length - 1]) {
              lineWidgets[startRow] = removed.pop();
            }
            removed.forEach(function(w) {
              w && this.removeLineWidget(w);
            }, this);
            this.$updateRows();
          } else {
            var args = new Array(len);
            if (lineWidgets[startRow] && lineWidgets[startRow].column != null) {
              if (delta.start.column > lineWidgets[startRow].column)
                startRow++;
            }
            args.unshift(startRow, 0);
            lineWidgets.splice.apply(lineWidgets, args);
            this.$updateRows();
          }
        };
        LineWidgets2.prototype.$updateRows = function() {
          var lineWidgets = this.session.lineWidgets;
          if (!lineWidgets)
            return;
          var noWidgets = true;
          lineWidgets.forEach(function(w, i2) {
            if (w) {
              noWidgets = false;
              w.row = i2;
              while (w.$oldWidget) {
                w.$oldWidget.row = i2;
                w = w.$oldWidget;
              }
            }
          });
          if (noWidgets)
            this.session.lineWidgets = null;
        };
        LineWidgets2.prototype.$registerLineWidget = function(w) {
          if (!this.session.lineWidgets)
            this.session.lineWidgets = new Array(this.session.getLength());
          var old = this.session.lineWidgets[w.row];
          if (old) {
            w.$oldWidget = old;
            if (old.el && old.el.parentNode) {
              old.el.parentNode.removeChild(old.el);
              old._inDocument = false;
            }
          }
          this.session.lineWidgets[w.row] = w;
          return w;
        };
        LineWidgets2.prototype.addLineWidget = function(w) {
          this.$registerLineWidget(w);
          w.session = this.session;
          if (!this.editor)
            return w;
          var renderer = this.editor.renderer;
          if (w.html && !w.el) {
            w.el = dom.createElement("div");
            w.el.innerHTML = w.html;
          }
          if (w.text && !w.el) {
            w.el = dom.createElement("div");
            w.el.textContent = w.text;
          }
          if (w.el) {
            dom.addCssClass(w.el, "ace_lineWidgetContainer");
            if (w.className) {
              dom.addCssClass(w.el, w.className);
            }
            w.el.style.position = "absolute";
            w.el.style.zIndex = 5;
            renderer.container.appendChild(w.el);
            w._inDocument = true;
            if (!w.coverGutter) {
              w.el.style.zIndex = 3;
            }
            if (w.pixelHeight == null) {
              w.pixelHeight = w.el.offsetHeight;
            }
          }
          if (w.rowCount == null) {
            w.rowCount = w.pixelHeight / renderer.layerConfig.lineHeight;
          }
          var fold = this.session.getFoldAt(w.row, 0);
          w.$fold = fold;
          if (fold) {
            var lineWidgets = this.session.lineWidgets;
            if (w.row == fold.end.row && !lineWidgets[fold.start.row])
              lineWidgets[fold.start.row] = w;
            else
              w.hidden = true;
          }
          this.session._emit("changeFold", { data: { start: { row: w.row } } });
          this.$updateRows();
          this.renderWidgets(null, renderer);
          this.onWidgetChanged(w);
          return w;
        };
        LineWidgets2.prototype.removeLineWidget = function(w) {
          w._inDocument = false;
          w.session = null;
          if (w.el && w.el.parentNode)
            w.el.parentNode.removeChild(w.el);
          if (w.editor && w.editor.destroy)
            try {
              w.editor.destroy();
            } catch (e) {
            }
          if (this.session.lineWidgets) {
            var w1 = this.session.lineWidgets[w.row];
            if (w1 == w) {
              this.session.lineWidgets[w.row] = w.$oldWidget;
              if (w.$oldWidget)
                this.onWidgetChanged(w.$oldWidget);
            } else {
              while (w1) {
                if (w1.$oldWidget == w) {
                  w1.$oldWidget = w.$oldWidget;
                  break;
                }
                w1 = w1.$oldWidget;
              }
            }
          }
          this.session._emit("changeFold", { data: { start: { row: w.row } } });
          this.$updateRows();
        };
        LineWidgets2.prototype.getWidgetsAtRow = function(row) {
          var lineWidgets = this.session.lineWidgets;
          var w = lineWidgets && lineWidgets[row];
          var list = [];
          while (w) {
            list.push(w);
            w = w.$oldWidget;
          }
          return list;
        };
        LineWidgets2.prototype.onWidgetChanged = function(w) {
          this.session._changedWidgets.push(w);
          this.editor && this.editor.renderer.updateFull();
        };
        LineWidgets2.prototype.measureWidgets = function(e, renderer) {
          var changedWidgets = this.session._changedWidgets;
          var config2 = renderer.layerConfig;
          if (!changedWidgets || !changedWidgets.length)
            return;
          var min = Infinity;
          for (var i2 = 0; i2 < changedWidgets.length; i2++) {
            var w = changedWidgets[i2];
            if (!w || !w.el)
              continue;
            if (w.session != this.session)
              continue;
            if (!w._inDocument) {
              if (this.session.lineWidgets[w.row] != w)
                continue;
              w._inDocument = true;
              renderer.container.appendChild(w.el);
            }
            w.h = w.el.offsetHeight;
            if (!w.fixedWidth) {
              w.w = w.el.offsetWidth;
              w.screenWidth = Math.ceil(w.w / config2.characterWidth);
            }
            var rowCount = w.h / config2.lineHeight;
            if (w.coverLine) {
              rowCount -= this.session.getRowLineCount(w.row);
              if (rowCount < 0)
                rowCount = 0;
            }
            if (w.rowCount != rowCount) {
              w.rowCount = rowCount;
              if (w.row < min)
                min = w.row;
            }
          }
          if (min != Infinity) {
            this.session._emit("changeFold", { data: { start: { row: min } } });
            this.session.lineWidgetWidth = null;
          }
          this.session._changedWidgets = [];
        };
        LineWidgets2.prototype.renderWidgets = function(e, renderer) {
          var config2 = renderer.layerConfig;
          var lineWidgets = this.session.lineWidgets;
          if (!lineWidgets)
            return;
          var first = Math.min(this.firstRow, config2.firstRow);
          var last = Math.max(this.lastRow, config2.lastRow, lineWidgets.length);
          while (first > 0 && !lineWidgets[first])
            first--;
          this.firstRow = config2.firstRow;
          this.lastRow = config2.lastRow;
          renderer.$cursorLayer.config = config2;
          for (var i2 = first; i2 <= last; i2++) {
            var w = lineWidgets[i2];
            if (!w || !w.el)
              continue;
            if (w.hidden) {
              w.el.style.top = -100 - (w.pixelHeight || 0) + "px";
              continue;
            }
            if (!w._inDocument) {
              w._inDocument = true;
              renderer.container.appendChild(w.el);
            }
            var top2 = renderer.$cursorLayer.getPixelPosition({ row: i2, column: 0 }, true).top;
            if (!w.coverLine)
              top2 += config2.lineHeight * this.session.getRowLineCount(w.row);
            w.el.style.top = top2 - config2.offset + "px";
            var left = w.coverGutter ? 0 : renderer.gutterWidth;
            if (!w.fixedWidth)
              left -= renderer.scrollLeft;
            w.el.style.left = left + "px";
            if (w.fullWidth && w.screenWidth) {
              w.el.style.minWidth = config2.width + 2 * config2.padding + "px";
            }
            if (w.fixedWidth) {
              w.el.style.right = renderer.scrollBar.getWidth() + "px";
            } else {
              w.el.style.right = "";
            }
          }
        };
        return LineWidgets2;
      }();
      exports3.LineWidgets = LineWidgets;
    });
    ace.define("ace/keyboard/gutter_handler", ["require", "exports", "module", "ace/lib/keys", "ace/mouse/default_gutter_handler"], function(require2, exports3, module3) {
      var keys2 = require2("../lib/keys");
      var GutterTooltip = require2("../mouse/default_gutter_handler").GutterTooltip;
      var GutterKeyboardHandler = function() {
        function GutterKeyboardHandler2(editor) {
          this.editor = editor;
          this.gutterLayer = editor.renderer.$gutterLayer;
          this.element = editor.renderer.$gutter;
          this.lines = editor.renderer.$gutterLayer.$lines;
          this.activeRowIndex = null;
          this.activeLane = null;
          this.annotationTooltip = new GutterTooltip(this.editor);
        }
        GutterKeyboardHandler2.prototype.addListener = function() {
          this.element.addEventListener("keydown", this.$onGutterKeyDown.bind(this));
          this.element.addEventListener("focusout", this.$blurGutter.bind(this));
          this.editor.on("mousewheel", this.$blurGutter.bind(this));
        };
        GutterKeyboardHandler2.prototype.removeListener = function() {
          this.element.removeEventListener("keydown", this.$onGutterKeyDown.bind(this));
          this.element.removeEventListener("focusout", this.$blurGutter.bind(this));
          this.editor.off("mousewheel", this.$blurGutter.bind(this));
        };
        GutterKeyboardHandler2.prototype.$onGutterKeyDown = function(e) {
          if (this.annotationTooltip.isOpen) {
            e.preventDefault();
            if (e.keyCode === keys2["escape"])
              this.annotationTooltip.hideTooltip();
            return;
          }
          if (e.target === this.element) {
            if (e.keyCode != keys2["enter"]) {
              return;
            }
            e.preventDefault();
            var row = this.editor.getCursorPosition().row;
            if (!this.editor.isRowVisible(row))
              this.editor.scrollToLine(row, true, true);
            setTimeout(function() {
              var index2 = this.$rowToRowIndex(this.gutterLayer.$cursorCell.row);
              var nearestFoldIndex = this.$findNearestFoldWidget(index2);
              var nearestAnnotationIndex = this.$findNearestAnnotation(index2);
              if (nearestFoldIndex === null && nearestAnnotationIndex === null)
                return;
              if (nearestFoldIndex === null && nearestAnnotationIndex !== null) {
                this.activeRowIndex = nearestAnnotationIndex;
                this.activeLane = "annotation";
                this.$focusAnnotation(this.activeRowIndex);
                return;
              }
              if (nearestFoldIndex !== null && nearestAnnotationIndex === null) {
                this.activeRowIndex = nearestFoldIndex;
                this.activeLane = "fold";
                this.$focusFoldWidget(this.activeRowIndex);
                return;
              }
              if (Math.abs(nearestAnnotationIndex - index2) < Math.abs(nearestFoldIndex - index2)) {
                this.activeRowIndex = nearestAnnotationIndex;
                this.activeLane = "annotation";
                this.$focusAnnotation(this.activeRowIndex);
                return;
              } else {
                this.activeRowIndex = nearestFoldIndex;
                this.activeLane = "fold";
                this.$focusFoldWidget(this.activeRowIndex);
                return;
              }
            }.bind(this), 10);
            return;
          }
          this.$handleGutterKeyboardInteraction(e);
          setTimeout(function() {
            this.editor._signal("gutterkeydown", new GutterKeyboardEvent(e, this));
          }.bind(this), 10);
        };
        GutterKeyboardHandler2.prototype.$handleGutterKeyboardInteraction = function(e) {
          if (e.keyCode === keys2["tab"]) {
            e.preventDefault();
            return;
          }
          if (e.keyCode === keys2["escape"]) {
            e.preventDefault();
            this.$blurGutter();
            this.element.focus();
            this.lane = null;
            return;
          }
          if (e.keyCode === keys2["up"]) {
            e.preventDefault();
            switch (this.activeLane) {
              case "fold":
                this.$moveFoldWidgetUp();
                break;
              case "annotation":
                this.$moveAnnotationUp();
                break;
            }
            return;
          }
          if (e.keyCode === keys2["down"]) {
            e.preventDefault();
            switch (this.activeLane) {
              case "fold":
                this.$moveFoldWidgetDown();
                break;
              case "annotation":
                this.$moveAnnotationDown();
                break;
            }
            return;
          }
          if (e.keyCode === keys2["left"]) {
            e.preventDefault();
            this.$switchLane("annotation");
            return;
          }
          if (e.keyCode === keys2["right"]) {
            e.preventDefault();
            this.$switchLane("fold");
            return;
          }
          if (e.keyCode === keys2["enter"] || e.keyCode === keys2["space"]) {
            e.preventDefault();
            switch (this.activeLane) {
              case "fold":
                if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === "start") {
                  var rowFoldingWidget = this.$rowIndexToRow(this.activeRowIndex);
                  this.editor.session.onFoldWidgetClick(this.$rowIndexToRow(this.activeRowIndex), e);
                  setTimeout(function() {
                    if (this.$rowIndexToRow(this.activeRowIndex) !== rowFoldingWidget) {
                      this.$blurFoldWidget(this.activeRowIndex);
                      this.activeRowIndex = this.$rowToRowIndex(rowFoldingWidget);
                      this.$focusFoldWidget(this.activeRowIndex);
                    }
                  }.bind(this), 10);
                  break;
                } else if (this.gutterLayer.session.foldWidgets[this.$rowIndexToRow(this.activeRowIndex)] === "end") {
                  break;
                }
                return;
              case "annotation":
                var gutterElement = this.lines.cells[this.activeRowIndex].element.childNodes[2];
                var rect = gutterElement.getBoundingClientRect();
                var style = this.annotationTooltip.getElement().style;
                style.left = rect.right + "px";
                style.top = rect.bottom + "px";
                this.annotationTooltip.showTooltip(this.$rowIndexToRow(this.activeRowIndex));
                break;
            }
            return;
          }
        };
        GutterKeyboardHandler2.prototype.$blurGutter = function() {
          if (this.activeRowIndex !== null) {
            switch (this.activeLane) {
              case "fold":
                this.$blurFoldWidget(this.activeRowIndex);
                break;
              case "annotation":
                this.$blurAnnotation(this.activeRowIndex);
                break;
            }
          }
          if (this.annotationTooltip.isOpen)
            this.annotationTooltip.hideTooltip();
          return;
        };
        GutterKeyboardHandler2.prototype.$isFoldWidgetVisible = function(index2) {
          var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index2));
          var isIconVisible = this.$getFoldWidget(index2).style.display !== "none";
          return isRowFullyVisible && isIconVisible;
        };
        GutterKeyboardHandler2.prototype.$isAnnotationVisible = function(index2) {
          var isRowFullyVisible = this.editor.isRowFullyVisible(this.$rowIndexToRow(index2));
          var isIconVisible = this.$getAnnotation(index2).style.display !== "none";
          return isRowFullyVisible && isIconVisible;
        };
        GutterKeyboardHandler2.prototype.$getFoldWidget = function(index2) {
          var cell = this.lines.get(index2);
          var element = cell.element;
          return element.childNodes[1];
        };
        GutterKeyboardHandler2.prototype.$getAnnotation = function(index2) {
          var cell = this.lines.get(index2);
          var element = cell.element;
          return element.childNodes[2];
        };
        GutterKeyboardHandler2.prototype.$findNearestFoldWidget = function(index2) {
          if (this.$isFoldWidgetVisible(index2))
            return index2;
          var i2 = 0;
          while (index2 - i2 > 0 || index2 + i2 < this.lines.getLength() - 1) {
            i2++;
            if (index2 - i2 >= 0 && this.$isFoldWidgetVisible(index2 - i2))
              return index2 - i2;
            if (index2 + i2 <= this.lines.getLength() - 1 && this.$isFoldWidgetVisible(index2 + i2))
              return index2 + i2;
          }
          return null;
        };
        GutterKeyboardHandler2.prototype.$findNearestAnnotation = function(index2) {
          if (this.$isAnnotationVisible(index2))
            return index2;
          var i2 = 0;
          while (index2 - i2 > 0 || index2 + i2 < this.lines.getLength() - 1) {
            i2++;
            if (index2 - i2 >= 0 && this.$isAnnotationVisible(index2 - i2))
              return index2 - i2;
            if (index2 + i2 <= this.lines.getLength() - 1 && this.$isAnnotationVisible(index2 + i2))
              return index2 + i2;
          }
          return null;
        };
        GutterKeyboardHandler2.prototype.$focusFoldWidget = function(index2) {
          if (index2 == null)
            return;
          var foldWidget2 = this.$getFoldWidget(index2);
          foldWidget2.classList.add(this.editor.renderer.keyboardFocusClassName);
          foldWidget2.focus();
        };
        GutterKeyboardHandler2.prototype.$focusAnnotation = function(index2) {
          if (index2 == null)
            return;
          var annotation = this.$getAnnotation(index2);
          annotation.classList.add(this.editor.renderer.keyboardFocusClassName);
          annotation.focus();
        };
        GutterKeyboardHandler2.prototype.$blurFoldWidget = function(index2) {
          var foldWidget2 = this.$getFoldWidget(index2);
          foldWidget2.classList.remove(this.editor.renderer.keyboardFocusClassName);
          foldWidget2.blur();
        };
        GutterKeyboardHandler2.prototype.$blurAnnotation = function(index2) {
          var annotation = this.$getAnnotation(index2);
          annotation.classList.remove(this.editor.renderer.keyboardFocusClassName);
          annotation.blur();
        };
        GutterKeyboardHandler2.prototype.$moveFoldWidgetUp = function() {
          var index2 = this.activeRowIndex;
          while (index2 > 0) {
            index2--;
            if (this.$isFoldWidgetVisible(index2)) {
              this.$blurFoldWidget(this.activeRowIndex);
              this.activeRowIndex = index2;
              this.$focusFoldWidget(this.activeRowIndex);
              return;
            }
          }
          return;
        };
        GutterKeyboardHandler2.prototype.$moveFoldWidgetDown = function() {
          var index2 = this.activeRowIndex;
          while (index2 < this.lines.getLength() - 1) {
            index2++;
            if (this.$isFoldWidgetVisible(index2)) {
              this.$blurFoldWidget(this.activeRowIndex);
              this.activeRowIndex = index2;
              this.$focusFoldWidget(this.activeRowIndex);
              return;
            }
          }
          return;
        };
        GutterKeyboardHandler2.prototype.$moveAnnotationUp = function() {
          var index2 = this.activeRowIndex;
          while (index2 > 0) {
            index2--;
            if (this.$isAnnotationVisible(index2)) {
              this.$blurAnnotation(this.activeRowIndex);
              this.activeRowIndex = index2;
              this.$focusAnnotation(this.activeRowIndex);
              return;
            }
          }
          return;
        };
        GutterKeyboardHandler2.prototype.$moveAnnotationDown = function() {
          var index2 = this.activeRowIndex;
          while (index2 < this.lines.getLength() - 1) {
            index2++;
            if (this.$isAnnotationVisible(index2)) {
              this.$blurAnnotation(this.activeRowIndex);
              this.activeRowIndex = index2;
              this.$focusAnnotation(this.activeRowIndex);
              return;
            }
          }
          return;
        };
        GutterKeyboardHandler2.prototype.$switchLane = function(desinationLane) {
          switch (desinationLane) {
            case "annotation":
              if (this.activeLane === "annotation") {
                break;
              }
              var annotationIndex = this.$findNearestAnnotation(this.activeRowIndex);
              if (annotationIndex == null) {
                break;
              }
              this.activeLane = "annotation";
              this.$blurFoldWidget(this.activeRowIndex);
              this.activeRowIndex = annotationIndex;
              this.$focusAnnotation(this.activeRowIndex);
              break;
            case "fold":
              if (this.activeLane === "fold") {
                break;
              }
              var foldWidgetIndex = this.$findNearestFoldWidget(this.activeRowIndex);
              if (foldWidgetIndex == null) {
                break;
              }
              this.activeLane = "fold";
              this.$blurAnnotation(this.activeRowIndex);
              this.activeRowIndex = foldWidgetIndex;
              this.$focusFoldWidget(this.activeRowIndex);
              break;
          }
          return;
        };
        GutterKeyboardHandler2.prototype.$rowIndexToRow = function(index2) {
          var cell = this.lines.get(index2);
          if (cell)
            return cell.row;
          return null;
        };
        GutterKeyboardHandler2.prototype.$rowToRowIndex = function(row) {
          for (var i2 = 0; i2 < this.lines.getLength(); i2++) {
            var cell = this.lines.get(i2);
            if (cell.row == row)
              return i2;
          }
          return null;
        };
        return GutterKeyboardHandler2;
      }();
      exports3.GutterKeyboardHandler = GutterKeyboardHandler;
      var GutterKeyboardEvent = function() {
        function GutterKeyboardEvent2(domEvent, gutterKeyboardHandler) {
          this.gutterKeyboardHandler = gutterKeyboardHandler;
          this.domEvent = domEvent;
        }
        GutterKeyboardEvent2.prototype.getKey = function() {
          return keys2.keyCodeToString(this.domEvent.keyCode);
        };
        GutterKeyboardEvent2.prototype.getRow = function() {
          return this.gutterKeyboardHandler.$rowIndexToRow(this.gutterKeyboardHandler.activeRowIndex);
        };
        GutterKeyboardEvent2.prototype.isInAnnotationLane = function() {
          return this.gutterKeyboardHandler.activeLane === "annotation";
        };
        GutterKeyboardEvent2.prototype.isInFoldLane = function() {
          return this.gutterKeyboardHandler.activeLane === "fold";
        };
        return GutterKeyboardEvent2;
      }();
      exports3.GutterKeyboardEvent = GutterKeyboardEvent;
    });
    ace.define("ace/editor", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/useragent", "ace/keyboard/textinput", "ace/mouse/mouse_handler", "ace/mouse/fold_handler", "ace/keyboard/keybinding", "ace/edit_session", "ace/search", "ace/range", "ace/lib/event_emitter", "ace/commands/command_manager", "ace/commands/default_commands", "ace/config", "ace/token_iterator", "ace/line_widgets", "ace/keyboard/gutter_handler", "ace/config", "ace/clipboard", "ace/lib/keys"], function(require2, exports3, module3) {
      var __values = this && this.__values || function(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.");
      };
      var oop = require2("./lib/oop");
      var dom = require2("./lib/dom");
      var lang = require2("./lib/lang");
      var useragent = require2("./lib/useragent");
      var TextInput = require2("./keyboard/textinput").TextInput;
      var MouseHandler = require2("./mouse/mouse_handler").MouseHandler;
      var FoldHandler = require2("./mouse/fold_handler").FoldHandler;
      var KeyBinding = require2("./keyboard/keybinding").KeyBinding;
      var EditSession = require2("./edit_session").EditSession;
      var Search = require2("./search").Search;
      var Range2 = require2("./range").Range;
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var CommandManager = require2("./commands/command_manager").CommandManager;
      var defaultCommands = require2("./commands/default_commands").commands;
      var config2 = require2("./config");
      var TokenIterator = require2("./token_iterator").TokenIterator;
      var LineWidgets = require2("./line_widgets").LineWidgets;
      var GutterKeyboardHandler = require2("./keyboard/gutter_handler").GutterKeyboardHandler;
      var nls = require2("./config").nls;
      var clipboard2 = require2("./clipboard");
      var keys2 = require2("./lib/keys");
      var Editor = function() {
        function Editor2(renderer, session, options) {
          this.$toDestroy = [];
          var container = renderer.getContainerElement();
          this.container = container;
          this.renderer = renderer;
          this.id = "editor" + ++Editor2.$uid;
          this.commands = new CommandManager(useragent.isMac ? "mac" : "win", defaultCommands);
          if (typeof document == "object") {
            this.textInput = new TextInput(renderer.getTextAreaContainer(), this);
            this.renderer.textarea = this.textInput.getElement();
            this.$mouseHandler = new MouseHandler(this);
            new FoldHandler(this);
          }
          this.keyBinding = new KeyBinding(this);
          this.$search = new Search().set({
            wrap: true
          });
          this.$historyTracker = this.$historyTracker.bind(this);
          this.commands.on("exec", this.$historyTracker);
          this.$initOperationListeners();
          this._$emitInputEvent = lang.delayedCall(function() {
            this._signal("input", {});
            if (this.session && !this.session.destroyed)
              this.session.bgTokenizer.scheduleStart();
          }.bind(this));
          this.on("change", function(_, _self) {
            _self._$emitInputEvent.schedule(31);
          });
          this.setSession(session || options && options.session || new EditSession(""));
          config2.resetOptions(this);
          if (options)
            this.setOptions(options);
          config2._signal("editor", this);
        }
        Editor2.prototype.$initOperationListeners = function() {
          this.commands.on("exec", this.startOperation.bind(this), true);
          this.commands.on("afterExec", this.endOperation.bind(this), true);
          this.$opResetTimer = lang.delayedCall(this.endOperation.bind(this, true));
          this.on("change", function() {
            if (!this.curOp) {
              this.startOperation();
              this.curOp.selectionBefore = this.$lastSel;
            }
            this.curOp.docChanged = true;
          }.bind(this), true);
          this.on("changeSelection", function() {
            if (!this.curOp) {
              this.startOperation();
              this.curOp.selectionBefore = this.$lastSel;
            }
            this.curOp.selectionChanged = true;
          }.bind(this), true);
        };
        Editor2.prototype.startOperation = function(commandEvent) {
          if (this.curOp) {
            if (!commandEvent || this.curOp.command)
              return;
            this.prevOp = this.curOp;
          }
          if (!commandEvent) {
            this.previousCommand = null;
            commandEvent = {};
          }
          this.$opResetTimer.schedule();
          this.curOp = this.session.curOp = {
            command: commandEvent.command || {},
            args: commandEvent.args,
            scrollTop: this.renderer.scrollTop
          };
          this.curOp.selectionBefore = this.selection.toJSON();
        };
        Editor2.prototype.endOperation = function(e) {
          if (this.curOp && this.session) {
            if (e && e.returnValue === false || !this.session)
              return this.curOp = null;
            if (e == true && this.curOp.command && this.curOp.command.name == "mouse")
              return;
            this._signal("beforeEndOperation");
            if (!this.curOp)
              return;
            var command2 = this.curOp.command;
            var scrollIntoView2 = command2 && command2.scrollIntoView;
            if (scrollIntoView2) {
              switch (scrollIntoView2) {
                case "center-animate":
                  scrollIntoView2 = "animate";
                case "center":
                  this.renderer.scrollCursorIntoView(null, 0.5);
                  break;
                case "animate":
                case "cursor":
                  this.renderer.scrollCursorIntoView();
                  break;
                case "selectionPart":
                  var range = this.selection.getRange();
                  var config3 = this.renderer.layerConfig;
                  if (range.start.row >= config3.lastRow || range.end.row <= config3.firstRow) {
                    this.renderer.scrollSelectionIntoView(this.selection.anchor, this.selection.lead);
                  }
                  break;
              }
              if (scrollIntoView2 == "animate")
                this.renderer.animateScrolling(this.curOp.scrollTop);
            }
            var sel = this.selection.toJSON();
            this.curOp.selectionAfter = sel;
            this.$lastSel = this.selection.toJSON();
            this.session.getUndoManager().addSelection(sel);
            this.prevOp = this.curOp;
            this.curOp = null;
          }
        };
        Editor2.prototype.$historyTracker = function(e) {
          if (!this.$mergeUndoDeltas)
            return;
          var prev = this.prevOp;
          var mergeableCommands = this.$mergeableCommands;
          var shouldMerge = prev.command && e.command.name == prev.command.name;
          if (e.command.name == "insertstring") {
            var text = e.args;
            if (this.mergeNextCommand === void 0)
              this.mergeNextCommand = true;
            shouldMerge = shouldMerge && this.mergeNextCommand && (!/\s/.test(text) || /\s/.test(prev.args));
            this.mergeNextCommand = true;
          } else {
            shouldMerge = shouldMerge && mergeableCommands.indexOf(e.command.name) !== -1;
          }
          if (this.$mergeUndoDeltas != "always" && Date.now() - this.sequenceStartTime > 2e3) {
            shouldMerge = false;
          }
          if (shouldMerge)
            this.session.mergeUndoDeltas = true;
          else if (mergeableCommands.indexOf(e.command.name) !== -1)
            this.sequenceStartTime = Date.now();
        };
        Editor2.prototype.setKeyboardHandler = function(keyboardHandler, cb) {
          if (keyboardHandler && typeof keyboardHandler === "string" && keyboardHandler != "ace") {
            this.$keybindingId = keyboardHandler;
            var _self = this;
            config2.loadModule(["keybinding", keyboardHandler], function(module4) {
              if (_self.$keybindingId == keyboardHandler)
                _self.keyBinding.setKeyboardHandler(module4 && module4.handler);
              cb && cb();
            });
          } else {
            this.$keybindingId = null;
            this.keyBinding.setKeyboardHandler(keyboardHandler);
            cb && cb();
          }
        };
        Editor2.prototype.getKeyboardHandler = function() {
          return this.keyBinding.getKeyboardHandler();
        };
        Editor2.prototype.setSession = function(session) {
          if (this.session == session)
            return;
          if (this.curOp)
            this.endOperation();
          this.curOp = {};
          var oldSession = this.session;
          if (oldSession) {
            this.session.off("change", this.$onDocumentChange);
            this.session.off("changeMode", this.$onChangeMode);
            this.session.off("tokenizerUpdate", this.$onTokenizerUpdate);
            this.session.off("changeTabSize", this.$onChangeTabSize);
            this.session.off("changeWrapLimit", this.$onChangeWrapLimit);
            this.session.off("changeWrapMode", this.$onChangeWrapMode);
            this.session.off("changeFold", this.$onChangeFold);
            this.session.off("changeFrontMarker", this.$onChangeFrontMarker);
            this.session.off("changeBackMarker", this.$onChangeBackMarker);
            this.session.off("changeBreakpoint", this.$onChangeBreakpoint);
            this.session.off("changeAnnotation", this.$onChangeAnnotation);
            this.session.off("changeOverwrite", this.$onCursorChange);
            this.session.off("changeScrollTop", this.$onScrollTopChange);
            this.session.off("changeScrollLeft", this.$onScrollLeftChange);
            var selection = this.session.getSelection();
            selection.off("changeCursor", this.$onCursorChange);
            selection.off("changeSelection", this.$onSelectionChange);
          }
          this.session = session;
          if (session) {
            this.$onDocumentChange = this.onDocumentChange.bind(this);
            session.on("change", this.$onDocumentChange);
            this.renderer.setSession(session);
            this.$onChangeMode = this.onChangeMode.bind(this);
            session.on("changeMode", this.$onChangeMode);
            this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);
            session.on("tokenizerUpdate", this.$onTokenizerUpdate);
            this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);
            session.on("changeTabSize", this.$onChangeTabSize);
            this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);
            session.on("changeWrapLimit", this.$onChangeWrapLimit);
            this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);
            session.on("changeWrapMode", this.$onChangeWrapMode);
            this.$onChangeFold = this.onChangeFold.bind(this);
            session.on("changeFold", this.$onChangeFold);
            this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);
            this.session.on("changeFrontMarker", this.$onChangeFrontMarker);
            this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);
            this.session.on("changeBackMarker", this.$onChangeBackMarker);
            this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);
            this.session.on("changeBreakpoint", this.$onChangeBreakpoint);
            this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);
            this.session.on("changeAnnotation", this.$onChangeAnnotation);
            this.$onCursorChange = this.onCursorChange.bind(this);
            this.session.on("changeOverwrite", this.$onCursorChange);
            this.$onScrollTopChange = this.onScrollTopChange.bind(this);
            this.session.on("changeScrollTop", this.$onScrollTopChange);
            this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
            this.session.on("changeScrollLeft", this.$onScrollLeftChange);
            this.selection = session.getSelection();
            this.selection.on("changeCursor", this.$onCursorChange);
            this.$onSelectionChange = this.onSelectionChange.bind(this);
            this.selection.on("changeSelection", this.$onSelectionChange);
            this.onChangeMode();
            this.onCursorChange();
            this.onScrollTopChange();
            this.onScrollLeftChange();
            this.onSelectionChange();
            this.onChangeFrontMarker();
            this.onChangeBackMarker();
            this.onChangeBreakpoint();
            this.onChangeAnnotation();
            this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
            this.renderer.updateFull();
          } else {
            this.selection = null;
            this.renderer.setSession(session);
          }
          this._signal("changeSession", {
            session,
            oldSession
          });
          this.curOp = null;
          oldSession && oldSession._signal("changeEditor", { oldEditor: this });
          session && session._signal("changeEditor", { editor: this });
          if (session && !session.destroyed)
            session.bgTokenizer.scheduleStart();
        };
        Editor2.prototype.getSession = function() {
          return this.session;
        };
        Editor2.prototype.setValue = function(val, cursorPos) {
          this.session.doc.setValue(val);
          if (!cursorPos)
            this.selectAll();
          else if (cursorPos == 1)
            this.navigateFileEnd();
          else if (cursorPos == -1)
            this.navigateFileStart();
          return val;
        };
        Editor2.prototype.getValue = function() {
          return this.session.getValue();
        };
        Editor2.prototype.getSelection = function() {
          return this.selection;
        };
        Editor2.prototype.resize = function(force) {
          this.renderer.onResize(force);
        };
        Editor2.prototype.setTheme = function(theme2, cb) {
          this.renderer.setTheme(theme2, cb);
        };
        Editor2.prototype.getTheme = function() {
          return this.renderer.getTheme();
        };
        Editor2.prototype.setStyle = function(style) {
          this.renderer.setStyle(style);
        };
        Editor2.prototype.unsetStyle = function(style) {
          this.renderer.unsetStyle(style);
        };
        Editor2.prototype.getFontSize = function() {
          return this.getOption("fontSize") || dom.computedStyle(this.container).fontSize;
        };
        Editor2.prototype.setFontSize = function(size) {
          this.setOption("fontSize", size);
        };
        Editor2.prototype.$highlightBrackets = function() {
          if (this.$highlightPending) {
            return;
          }
          var self2 = this;
          this.$highlightPending = true;
          setTimeout(function() {
            self2.$highlightPending = false;
            var session = self2.session;
            if (!session || session.destroyed)
              return;
            if (session.$bracketHighlight) {
              session.$bracketHighlight.markerIds.forEach(function(id2) {
                session.removeMarker(id2);
              });
              session.$bracketHighlight = null;
            }
            var pos = self2.getCursorPosition();
            var handler = self2.getKeyboardHandler();
            var isBackwards = handler && handler.$getDirectionForHighlight && handler.$getDirectionForHighlight(self2);
            var ranges = session.getMatchingBracketRanges(pos, isBackwards);
            if (!ranges) {
              var iterator = new TokenIterator(session, pos.row, pos.column);
              var token = iterator.getCurrentToken();
              if (token && /\b(?:tag-open|tag-name)/.test(token.type)) {
                var tagNamesRanges = session.getMatchingTags(pos);
                if (tagNamesRanges)
                  ranges = [tagNamesRanges.openTagName, tagNamesRanges.closeTagName];
              }
            }
            if (!ranges && session.$mode.getMatching)
              ranges = session.$mode.getMatching(self2.session);
            if (!ranges) {
              if (self2.getHighlightIndentGuides())
                self2.renderer.$textLayer.$highlightIndentGuide();
              return;
            }
            var markerType = "ace_bracket";
            if (!Array.isArray(ranges)) {
              ranges = [ranges];
            } else if (ranges.length == 1) {
              markerType = "ace_error_bracket";
            }
            if (ranges.length == 2) {
              if (Range2.comparePoints(ranges[0].end, ranges[1].start) == 0)
                ranges = [Range2.fromPoints(ranges[0].start, ranges[1].end)];
              else if (Range2.comparePoints(ranges[0].start, ranges[1].end) == 0)
                ranges = [Range2.fromPoints(ranges[1].start, ranges[0].end)];
            }
            session.$bracketHighlight = {
              ranges,
              markerIds: ranges.map(function(range) {
                return session.addMarker(range, markerType, "text");
              })
            };
            if (self2.getHighlightIndentGuides())
              self2.renderer.$textLayer.$highlightIndentGuide();
          }, 50);
        };
        Editor2.prototype.focus = function() {
          this.textInput.focus();
        };
        Editor2.prototype.isFocused = function() {
          return this.textInput.isFocused();
        };
        Editor2.prototype.blur = function() {
          this.textInput.blur();
        };
        Editor2.prototype.onFocus = function(e) {
          if (this.$isFocused)
            return;
          this.$isFocused = true;
          this.renderer.showCursor();
          this.renderer.visualizeFocus();
          this._emit("focus", e);
        };
        Editor2.prototype.onBlur = function(e) {
          if (!this.$isFocused)
            return;
          this.$isFocused = false;
          this.renderer.hideCursor();
          this.renderer.visualizeBlur();
          this._emit("blur", e);
        };
        Editor2.prototype.$cursorChange = function() {
          this.renderer.updateCursor();
          this.$highlightBrackets();
          this.$updateHighlightActiveLine();
        };
        Editor2.prototype.onDocumentChange = function(delta) {
          var wrap = this.session.$useWrapMode;
          var lastRow = delta.start.row == delta.end.row ? delta.end.row : Infinity;
          this.renderer.updateLines(delta.start.row, lastRow, wrap);
          this._signal("change", delta);
          this.$cursorChange();
        };
        Editor2.prototype.onTokenizerUpdate = function(e) {
          var rows = e.data;
          this.renderer.updateLines(rows.first, rows.last);
        };
        Editor2.prototype.onScrollTopChange = function() {
          this.renderer.scrollToY(this.session.getScrollTop());
        };
        Editor2.prototype.onScrollLeftChange = function() {
          this.renderer.scrollToX(this.session.getScrollLeft());
        };
        Editor2.prototype.onCursorChange = function() {
          this.$cursorChange();
          this._signal("changeSelection");
        };
        Editor2.prototype.$updateHighlightActiveLine = function() {
          var session = this.getSession();
          var highlight;
          if (this.$highlightActiveLine) {
            if (this.$selectionStyle != "line" || !this.selection.isMultiLine())
              highlight = this.getCursorPosition();
            if (this.renderer.theme && this.renderer.theme.$selectionColorConflict && !this.selection.isEmpty())
              highlight = false;
            if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))
              highlight = false;
          }
          if (session.$highlightLineMarker && !highlight) {
            session.removeMarker(session.$highlightLineMarker.id);
            session.$highlightLineMarker = null;
          } else if (!session.$highlightLineMarker && highlight) {
            var range = new Range2(highlight.row, highlight.column, highlight.row, Infinity);
            range.id = session.addMarker(range, "ace_active-line", "screenLine");
            session.$highlightLineMarker = range;
          } else if (highlight) {
            session.$highlightLineMarker.start.row = highlight.row;
            session.$highlightLineMarker.end.row = highlight.row;
            session.$highlightLineMarker.start.column = highlight.column;
            session._signal("changeBackMarker");
          }
        };
        Editor2.prototype.onSelectionChange = function(e) {
          var session = this.session;
          if (session.$selectionMarker) {
            session.removeMarker(session.$selectionMarker);
          }
          session.$selectionMarker = null;
          if (!this.selection.isEmpty()) {
            var range = this.selection.getRange();
            var style = this.getSelectionStyle();
            session.$selectionMarker = session.addMarker(range, "ace_selection", style);
          } else {
            this.$updateHighlightActiveLine();
          }
          var re = this.$highlightSelectedWord && this.$getSelectionHighLightRegexp();
          this.session.highlight(re);
          this._signal("changeSelection");
        };
        Editor2.prototype.$getSelectionHighLightRegexp = function() {
          var session = this.session;
          var selection = this.getSelectionRange();
          if (selection.isEmpty() || selection.isMultiLine())
            return;
          var startColumn = selection.start.column;
          var endColumn = selection.end.column;
          var line = session.getLine(selection.start.row);
          var needle = line.substring(startColumn, endColumn);
          if (needle.length > 5e3 || !/[\w\d]/.test(needle))
            return;
          var re = this.$search.$assembleRegExp({
            wholeWord: true,
            caseSensitive: true,
            needle
          });
          var wordWithBoundary = line.substring(startColumn - 1, endColumn + 1);
          if (!re.test(wordWithBoundary))
            return;
          return re;
        };
        Editor2.prototype.onChangeFrontMarker = function() {
          this.renderer.updateFrontMarkers();
        };
        Editor2.prototype.onChangeBackMarker = function() {
          this.renderer.updateBackMarkers();
        };
        Editor2.prototype.onChangeBreakpoint = function() {
          this.renderer.updateBreakpoints();
        };
        Editor2.prototype.onChangeAnnotation = function() {
          this.renderer.setAnnotations(this.session.getAnnotations());
        };
        Editor2.prototype.onChangeMode = function(e) {
          this.renderer.updateText();
          this._emit("changeMode", e);
        };
        Editor2.prototype.onChangeWrapLimit = function() {
          this.renderer.updateFull();
        };
        Editor2.prototype.onChangeWrapMode = function() {
          this.renderer.onResize(true);
        };
        Editor2.prototype.onChangeFold = function() {
          this.$updateHighlightActiveLine();
          this.renderer.updateFull();
        };
        Editor2.prototype.getSelectedText = function() {
          return this.session.getTextRange(this.getSelectionRange());
        };
        Editor2.prototype.getCopyText = function() {
          var text = this.getSelectedText();
          var nl = this.session.doc.getNewLineCharacter();
          var copyLine2 = false;
          if (!text && this.$copyWithEmptySelection) {
            copyLine2 = true;
            var ranges = this.selection.getAllRanges();
            for (var i2 = 0; i2 < ranges.length; i2++) {
              var range = ranges[i2];
              if (i2 && ranges[i2 - 1].start.row == range.start.row)
                continue;
              text += this.session.getLine(range.start.row) + nl;
            }
          }
          var e = { text };
          this._signal("copy", e);
          clipboard2.lineMode = copyLine2 ? e.text : false;
          return e.text;
        };
        Editor2.prototype.onCopy = function() {
          this.commands.exec("copy", this);
        };
        Editor2.prototype.onCut = function() {
          this.commands.exec("cut", this);
        };
        Editor2.prototype.onPaste = function(text, event) {
          var e = { text, event };
          this.commands.exec("paste", this, e);
        };
        Editor2.prototype.$handlePaste = function(e) {
          if (typeof e == "string")
            e = { text: e };
          this._signal("paste", e);
          var text = e.text;
          var lineMode = text === clipboard2.lineMode;
          var session = this.session;
          if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {
            if (lineMode)
              session.insert({ row: this.selection.lead.row, column: 0 }, text);
            else
              this.insert(text);
          } else if (lineMode) {
            this.selection.rangeList.ranges.forEach(function(range2) {
              session.insert({ row: range2.start.row, column: 0 }, text);
            });
          } else {
            var lines = text.split(/\r\n|\r|\n/);
            var ranges = this.selection.rangeList.ranges;
            var isFullLine = lines.length == 2 && (!lines[0] || !lines[1]);
            if (lines.length != ranges.length || isFullLine)
              return this.commands.exec("insertstring", this, text);
            for (var i2 = ranges.length; i2--; ) {
              var range = ranges[i2];
              if (!range.isEmpty())
                session.remove(range);
              session.insert(range.start, lines[i2]);
            }
          }
        };
        Editor2.prototype.execCommand = function(command2, args) {
          return this.commands.exec(command2, this, args);
        };
        Editor2.prototype.insert = function(text, pasted) {
          var session = this.session;
          var mode = session.getMode();
          var cursor = this.getCursorPosition();
          if (this.getBehavioursEnabled() && !pasted) {
            var transform = mode.transformAction(session.getState(cursor.row), "insertion", this, session, text);
            if (transform) {
              if (text !== transform.text) {
                if (!this.inVirtualSelectionMode) {
                  this.session.mergeUndoDeltas = false;
                  this.mergeNextCommand = false;
                }
              }
              text = transform.text;
            }
          }
          if (text == "	")
            text = this.session.getTabString();
          if (!this.selection.isEmpty()) {
            var range = this.getSelectionRange();
            cursor = this.session.remove(range);
            this.clearSelection();
          } else if (this.session.getOverwrite() && text.indexOf("\n") == -1) {
            var range = new Range2.fromPoints(cursor, cursor);
            range.end.column += text.length;
            this.session.remove(range);
          }
          if (text == "\n" || text == "\r\n") {
            var line = session.getLine(cursor.row);
            if (cursor.column > line.search(/\S|$/)) {
              var d = line.substr(cursor.column).search(/\S|$/);
              session.doc.removeInLine(cursor.row, cursor.column, cursor.column + d);
            }
          }
          this.clearSelection();
          var start = cursor.column;
          var lineState = session.getState(cursor.row);
          var line = session.getLine(cursor.row);
          var shouldOutdent = mode.checkOutdent(lineState, line, text);
          session.insert(cursor, text);
          if (transform && transform.selection) {
            if (transform.selection.length == 2) {
              this.selection.setSelectionRange(new Range2(cursor.row, start + transform.selection[0], cursor.row, start + transform.selection[1]));
            } else {
              this.selection.setSelectionRange(new Range2(cursor.row + transform.selection[0], transform.selection[1], cursor.row + transform.selection[2], transform.selection[3]));
            }
          }
          if (this.$enableAutoIndent) {
            if (session.getDocument().isNewLine(text)) {
              var lineIndent = mode.getNextLineIndent(lineState, line.slice(0, cursor.column), session.getTabString());
              session.insert({ row: cursor.row + 1, column: 0 }, lineIndent);
            }
            if (shouldOutdent)
              mode.autoOutdent(lineState, session, cursor.row);
          }
        };
        Editor2.prototype.autoIndent = function() {
          var session = this.session;
          var mode = session.getMode();
          var startRow, endRow;
          if (this.selection.isEmpty()) {
            startRow = 0;
            endRow = session.doc.getLength() - 1;
          } else {
            var selectedRange = this.getSelectionRange();
            startRow = selectedRange.start.row;
            endRow = selectedRange.end.row;
          }
          var prevLineState = "";
          var prevLine = "";
          var lineIndent = "";
          var line, currIndent, range;
          var tab = session.getTabString();
          for (var row = startRow; row <= endRow; row++) {
            if (row > 0) {
              prevLineState = session.getState(row - 1);
              prevLine = session.getLine(row - 1);
              lineIndent = mode.getNextLineIndent(prevLineState, prevLine, tab);
            }
            line = session.getLine(row);
            currIndent = mode.$getIndent(line);
            if (lineIndent !== currIndent) {
              if (currIndent.length > 0) {
                range = new Range2(row, 0, row, currIndent.length);
                session.remove(range);
              }
              if (lineIndent.length > 0) {
                session.insert({ row, column: 0 }, lineIndent);
              }
            }
            mode.autoOutdent(prevLineState, session, row);
          }
        };
        Editor2.prototype.onTextInput = function(text, composition) {
          if (!composition)
            return this.keyBinding.onTextInput(text);
          this.startOperation({ command: { name: "insertstring" } });
          var applyComposition = this.applyComposition.bind(this, text, composition);
          if (this.selection.rangeCount)
            this.forEachSelection(applyComposition);
          else
            applyComposition();
          this.endOperation();
        };
        Editor2.prototype.applyComposition = function(text, composition) {
          if (composition.extendLeft || composition.extendRight) {
            var r = this.selection.getRange();
            r.start.column -= composition.extendLeft;
            r.end.column += composition.extendRight;
            if (r.start.column < 0) {
              r.start.row--;
              r.start.column += this.session.getLine(r.start.row).length + 1;
            }
            this.selection.setRange(r);
            if (!text && !r.isEmpty())
              this.remove();
          }
          if (text || !this.selection.isEmpty())
            this.insert(text, true);
          if (composition.restoreStart || composition.restoreEnd) {
            var r = this.selection.getRange();
            r.start.column -= composition.restoreStart;
            r.end.column -= composition.restoreEnd;
            this.selection.setRange(r);
          }
        };
        Editor2.prototype.onCommandKey = function(e, hashId, keyCode) {
          return this.keyBinding.onCommandKey(e, hashId, keyCode);
        };
        Editor2.prototype.setOverwrite = function(overwrite) {
          this.session.setOverwrite(overwrite);
        };
        Editor2.prototype.getOverwrite = function() {
          return this.session.getOverwrite();
        };
        Editor2.prototype.toggleOverwrite = function() {
          this.session.toggleOverwrite();
        };
        Editor2.prototype.setScrollSpeed = function(speed) {
          this.setOption("scrollSpeed", speed);
        };
        Editor2.prototype.getScrollSpeed = function() {
          return this.getOption("scrollSpeed");
        };
        Editor2.prototype.setDragDelay = function(dragDelay) {
          this.setOption("dragDelay", dragDelay);
        };
        Editor2.prototype.getDragDelay = function() {
          return this.getOption("dragDelay");
        };
        Editor2.prototype.setSelectionStyle = function(val) {
          this.setOption("selectionStyle", val);
        };
        Editor2.prototype.getSelectionStyle = function() {
          return this.getOption("selectionStyle");
        };
        Editor2.prototype.setHighlightActiveLine = function(shouldHighlight) {
          this.setOption("highlightActiveLine", shouldHighlight);
        };
        Editor2.prototype.getHighlightActiveLine = function() {
          return this.getOption("highlightActiveLine");
        };
        Editor2.prototype.setHighlightGutterLine = function(shouldHighlight) {
          this.setOption("highlightGutterLine", shouldHighlight);
        };
        Editor2.prototype.getHighlightGutterLine = function() {
          return this.getOption("highlightGutterLine");
        };
        Editor2.prototype.setHighlightSelectedWord = function(shouldHighlight) {
          this.setOption("highlightSelectedWord", shouldHighlight);
        };
        Editor2.prototype.getHighlightSelectedWord = function() {
          return this.$highlightSelectedWord;
        };
        Editor2.prototype.setAnimatedScroll = function(shouldAnimate) {
          this.renderer.setAnimatedScroll(shouldAnimate);
        };
        Editor2.prototype.getAnimatedScroll = function() {
          return this.renderer.getAnimatedScroll();
        };
        Editor2.prototype.setShowInvisibles = function(showInvisibles) {
          this.renderer.setShowInvisibles(showInvisibles);
        };
        Editor2.prototype.getShowInvisibles = function() {
          return this.renderer.getShowInvisibles();
        };
        Editor2.prototype.setDisplayIndentGuides = function(display) {
          this.renderer.setDisplayIndentGuides(display);
        };
        Editor2.prototype.getDisplayIndentGuides = function() {
          return this.renderer.getDisplayIndentGuides();
        };
        Editor2.prototype.setHighlightIndentGuides = function(highlight) {
          this.renderer.setHighlightIndentGuides(highlight);
        };
        Editor2.prototype.getHighlightIndentGuides = function() {
          return this.renderer.getHighlightIndentGuides();
        };
        Editor2.prototype.setShowPrintMargin = function(showPrintMargin) {
          this.renderer.setShowPrintMargin(showPrintMargin);
        };
        Editor2.prototype.getShowPrintMargin = function() {
          return this.renderer.getShowPrintMargin();
        };
        Editor2.prototype.setPrintMarginColumn = function(showPrintMargin) {
          this.renderer.setPrintMarginColumn(showPrintMargin);
        };
        Editor2.prototype.getPrintMarginColumn = function() {
          return this.renderer.getPrintMarginColumn();
        };
        Editor2.prototype.setReadOnly = function(readOnly2) {
          this.setOption("readOnly", readOnly2);
        };
        Editor2.prototype.getReadOnly = function() {
          return this.getOption("readOnly");
        };
        Editor2.prototype.setBehavioursEnabled = function(enabled) {
          this.setOption("behavioursEnabled", enabled);
        };
        Editor2.prototype.getBehavioursEnabled = function() {
          return this.getOption("behavioursEnabled");
        };
        Editor2.prototype.setWrapBehavioursEnabled = function(enabled) {
          this.setOption("wrapBehavioursEnabled", enabled);
        };
        Editor2.prototype.getWrapBehavioursEnabled = function() {
          return this.getOption("wrapBehavioursEnabled");
        };
        Editor2.prototype.setShowFoldWidgets = function(show) {
          this.setOption("showFoldWidgets", show);
        };
        Editor2.prototype.getShowFoldWidgets = function() {
          return this.getOption("showFoldWidgets");
        };
        Editor2.prototype.setFadeFoldWidgets = function(fade) {
          this.setOption("fadeFoldWidgets", fade);
        };
        Editor2.prototype.getFadeFoldWidgets = function() {
          return this.getOption("fadeFoldWidgets");
        };
        Editor2.prototype.remove = function(dir) {
          if (this.selection.isEmpty()) {
            if (dir == "left")
              this.selection.selectLeft();
            else
              this.selection.selectRight();
          }
          var range = this.getSelectionRange();
          if (this.getBehavioursEnabled()) {
            var session = this.session;
            var state = session.getState(range.start.row);
            var new_range = session.getMode().transformAction(state, "deletion", this, session, range);
            if (range.end.column === 0) {
              var text = session.getTextRange(range);
              if (text[text.length - 1] == "\n") {
                var line = session.getLine(range.end.row);
                if (/^\s+$/.test(line)) {
                  range.end.column = line.length;
                }
              }
            }
            if (new_range)
              range = new_range;
          }
          this.session.remove(range);
          this.clearSelection();
        };
        Editor2.prototype.removeWordRight = function() {
          if (this.selection.isEmpty())
            this.selection.selectWordRight();
          this.session.remove(this.getSelectionRange());
          this.clearSelection();
        };
        Editor2.prototype.removeWordLeft = function() {
          if (this.selection.isEmpty())
            this.selection.selectWordLeft();
          this.session.remove(this.getSelectionRange());
          this.clearSelection();
        };
        Editor2.prototype.removeToLineStart = function() {
          if (this.selection.isEmpty())
            this.selection.selectLineStart();
          if (this.selection.isEmpty())
            this.selection.selectLeft();
          this.session.remove(this.getSelectionRange());
          this.clearSelection();
        };
        Editor2.prototype.removeToLineEnd = function() {
          if (this.selection.isEmpty())
            this.selection.selectLineEnd();
          var range = this.getSelectionRange();
          if (range.start.column == range.end.column && range.start.row == range.end.row) {
            range.end.column = 0;
            range.end.row++;
          }
          this.session.remove(range);
          this.clearSelection();
        };
        Editor2.prototype.splitLine = function() {
          if (!this.selection.isEmpty()) {
            this.session.remove(this.getSelectionRange());
            this.clearSelection();
          }
          var cursor = this.getCursorPosition();
          this.insert("\n");
          this.moveCursorToPosition(cursor);
        };
        Editor2.prototype.setGhostText = function(text, position) {
          if (!this.session.widgetManager) {
            this.session.widgetManager = new LineWidgets(this.session);
            this.session.widgetManager.attach(this);
          }
          this.renderer.setGhostText(text, position);
        };
        Editor2.prototype.removeGhostText = function() {
          if (!this.session.widgetManager)
            return;
          this.renderer.removeGhostText();
        };
        Editor2.prototype.transposeLetters = function() {
          if (!this.selection.isEmpty()) {
            return;
          }
          var cursor = this.getCursorPosition();
          var column = cursor.column;
          if (column === 0)
            return;
          var line = this.session.getLine(cursor.row);
          var swap, range;
          if (column < line.length) {
            swap = line.charAt(column) + line.charAt(column - 1);
            range = new Range2(cursor.row, column - 1, cursor.row, column + 1);
          } else {
            swap = line.charAt(column - 1) + line.charAt(column - 2);
            range = new Range2(cursor.row, column - 2, cursor.row, column);
          }
          this.session.replace(range, swap);
          this.session.selection.moveToPosition(range.end);
        };
        Editor2.prototype.toLowerCase = function() {
          var originalRange = this.getSelectionRange();
          if (this.selection.isEmpty()) {
            this.selection.selectWord();
          }
          var range = this.getSelectionRange();
          var text = this.session.getTextRange(range);
          this.session.replace(range, text.toLowerCase());
          this.selection.setSelectionRange(originalRange);
        };
        Editor2.prototype.toUpperCase = function() {
          var originalRange = this.getSelectionRange();
          if (this.selection.isEmpty()) {
            this.selection.selectWord();
          }
          var range = this.getSelectionRange();
          var text = this.session.getTextRange(range);
          this.session.replace(range, text.toUpperCase());
          this.selection.setSelectionRange(originalRange);
        };
        Editor2.prototype.indent = function() {
          var session = this.session;
          var range = this.getSelectionRange();
          if (range.start.row < range.end.row) {
            var rows = this.$getSelectedRows();
            session.indentRows(rows.first, rows.last, "	");
            return;
          } else if (range.start.column < range.end.column) {
            var text = session.getTextRange(range);
            if (!/^\s+$/.test(text)) {
              var rows = this.$getSelectedRows();
              session.indentRows(rows.first, rows.last, "	");
              return;
            }
          }
          var line = session.getLine(range.start.row);
          var position = range.start;
          var size = session.getTabSize();
          var column = session.documentToScreenColumn(position.row, position.column);
          if (this.session.getUseSoftTabs()) {
            var count = size - column % size;
            var indentString2 = lang.stringRepeat(" ", count);
          } else {
            var count = column % size;
            while (line[range.start.column - 1] == " " && count) {
              range.start.column--;
              count--;
            }
            this.selection.setSelectionRange(range);
            indentString2 = "	";
          }
          return this.insert(indentString2);
        };
        Editor2.prototype.blockIndent = function() {
          var rows = this.$getSelectedRows();
          this.session.indentRows(rows.first, rows.last, "	");
        };
        Editor2.prototype.blockOutdent = function() {
          var selection = this.session.getSelection();
          this.session.outdentRows(selection.getRange());
        };
        Editor2.prototype.sortLines = function() {
          var rows = this.$getSelectedRows();
          var session = this.session;
          var lines = [];
          for (var i2 = rows.first; i2 <= rows.last; i2++)
            lines.push(session.getLine(i2));
          lines.sort(function(a, b) {
            if (a.toLowerCase() < b.toLowerCase())
              return -1;
            if (a.toLowerCase() > b.toLowerCase())
              return 1;
            return 0;
          });
          var deleteRange = new Range2(0, 0, 0, 0);
          for (var i2 = rows.first; i2 <= rows.last; i2++) {
            var line = session.getLine(i2);
            deleteRange.start.row = i2;
            deleteRange.end.row = i2;
            deleteRange.end.column = line.length;
            session.replace(deleteRange, lines[i2 - rows.first]);
          }
        };
        Editor2.prototype.toggleCommentLines = function() {
          var state = this.session.getState(this.getCursorPosition().row);
          var rows = this.$getSelectedRows();
          this.session.getMode().toggleCommentLines(state, this.session, rows.first, rows.last);
        };
        Editor2.prototype.toggleBlockComment = function() {
          var cursor = this.getCursorPosition();
          var state = this.session.getState(cursor.row);
          var range = this.getSelectionRange();
          this.session.getMode().toggleBlockComment(state, this.session, range, cursor);
        };
        Editor2.prototype.getNumberAt = function(row, column) {
          var _numberRx = /[\-]?[0-9]+(?:\.[0-9]+)?/g;
          _numberRx.lastIndex = 0;
          var s = this.session.getLine(row);
          while (_numberRx.lastIndex < column) {
            var m = _numberRx.exec(s);
            if (m.index <= column && m.index + m[0].length >= column) {
              var number2 = {
                value: m[0],
                start: m.index,
                end: m.index + m[0].length
              };
              return number2;
            }
          }
          return null;
        };
        Editor2.prototype.modifyNumber = function(amount) {
          var row = this.selection.getCursor().row;
          var column = this.selection.getCursor().column;
          var charRange = new Range2(row, column - 1, row, column);
          var c = this.session.getTextRange(charRange);
          if (!isNaN(parseFloat(c)) && isFinite(c)) {
            var nr = this.getNumberAt(row, column);
            if (nr) {
              var fp = nr.value.indexOf(".") >= 0 ? nr.start + nr.value.indexOf(".") + 1 : nr.end;
              var decimals = nr.start + nr.value.length - fp;
              var t2 = parseFloat(nr.value);
              t2 *= Math.pow(10, decimals);
              if (fp !== nr.end && column < fp) {
                amount *= Math.pow(10, nr.end - column - 1);
              } else {
                amount *= Math.pow(10, nr.end - column);
              }
              t2 += amount;
              t2 /= Math.pow(10, decimals);
              var nnr = t2.toFixed(decimals);
              var replaceRange2 = new Range2(row, nr.start, row, nr.end);
              this.session.replace(replaceRange2, nnr);
              this.moveCursorTo(row, Math.max(nr.start + 1, column + nnr.length - nr.value.length));
            }
          } else {
            this.toggleWord();
          }
        };
        Editor2.prototype.toggleWord = function() {
          var row = this.selection.getCursor().row;
          var column = this.selection.getCursor().column;
          this.selection.selectWord();
          var currentState = this.getSelectedText();
          var currWordStart = this.selection.getWordRange().start.column;
          var wordParts = currentState.replace(/([a-z]+|[A-Z]+)(?=[A-Z_]|$)/g, "$1 ").split(/\s/);
          var delta = column - currWordStart - 1;
          if (delta < 0)
            delta = 0;
          var curLength = 0, itLength = 0;
          var that = this;
          if (currentState.match(/[A-Za-z0-9_]+/)) {
            wordParts.forEach(function(item2, i3) {
              itLength = curLength + item2.length;
              if (delta >= curLength && delta <= itLength) {
                currentState = item2;
                that.selection.clearSelection();
                that.moveCursorTo(row, curLength + currWordStart);
                that.selection.selectTo(row, itLength + currWordStart);
              }
              curLength = itLength;
            });
          }
          var wordPairs = this.$toggleWordPairs;
          var reg;
          for (var i2 = 0; i2 < wordPairs.length; i2++) {
            var item = wordPairs[i2];
            for (var j = 0; j <= 1; j++) {
              var negate = +!j;
              var firstCondition = currentState.match(new RegExp("^\\s?_?(" + lang.escapeRegExp(item[j]) + ")\\s?$", "i"));
              if (firstCondition) {
                var secondCondition = currentState.match(new RegExp("([_]|^|\\s)(" + lang.escapeRegExp(firstCondition[1]) + ")($|\\s)", "g"));
                if (secondCondition) {
                  reg = currentState.replace(new RegExp(lang.escapeRegExp(item[j]), "i"), function(result) {
                    var res = item[negate];
                    if (result.toUpperCase() == result) {
                      res = res.toUpperCase();
                    } else if (result.charAt(0).toUpperCase() == result.charAt(0)) {
                      res = res.substr(0, 0) + item[negate].charAt(0).toUpperCase() + res.substr(1);
                    }
                    return res;
                  });
                  this.insert(reg);
                  reg = "";
                }
              }
            }
          }
        };
        Editor2.prototype.findLinkAt = function(row, column) {
          var e_1, _a2;
          var line = this.session.getLine(row);
          var wordParts = line.split(/((?:https?|ftp):\/\/[\S]+)/);
          var columnPosition = column;
          if (columnPosition < 0)
            columnPosition = 0;
          var previousPosition = 0, currentPosition = 0, match;
          try {
            for (var wordParts_1 = __values(wordParts), wordParts_1_1 = wordParts_1.next(); !wordParts_1_1.done; wordParts_1_1 = wordParts_1.next()) {
              var item = wordParts_1_1.value;
              currentPosition = previousPosition + item.length;
              if (columnPosition >= previousPosition && columnPosition <= currentPosition) {
                if (item.match(/((?:https?|ftp):\/\/[\S]+)/)) {
                  match = item.replace(/[\s:.,'";}\]]+$/, "");
                  break;
                }
              }
              previousPosition = currentPosition;
            }
          } catch (e_1_1) {
            e_1 = { error: e_1_1 };
          } finally {
            try {
              if (wordParts_1_1 && !wordParts_1_1.done && (_a2 = wordParts_1.return))
                _a2.call(wordParts_1);
            } finally {
              if (e_1)
                throw e_1.error;
            }
          }
          return match;
        };
        Editor2.prototype.openLink = function() {
          var cursor = this.selection.getCursor();
          var url = this.findLinkAt(cursor.row, cursor.column);
          if (url)
            window.open(url, "_blank");
          return url != null;
        };
        Editor2.prototype.removeLines = function() {
          var rows = this.$getSelectedRows();
          this.session.removeFullLines(rows.first, rows.last);
          this.clearSelection();
        };
        Editor2.prototype.duplicateSelection = function() {
          var sel = this.selection;
          var doc2 = this.session;
          var range = sel.getRange();
          var reverse = sel.isBackwards();
          if (range.isEmpty()) {
            var row = range.start.row;
            doc2.duplicateLines(row, row);
          } else {
            var point = reverse ? range.start : range.end;
            var endPoint = doc2.insert(point, doc2.getTextRange(range), false);
            range.start = point;
            range.end = endPoint;
            sel.setSelectionRange(range, reverse);
          }
        };
        Editor2.prototype.moveLinesDown = function() {
          this.$moveLines(1, false);
        };
        Editor2.prototype.moveLinesUp = function() {
          this.$moveLines(-1, false);
        };
        Editor2.prototype.moveText = function(range, toPosition, copy) {
          return this.session.moveText(range, toPosition, copy);
        };
        Editor2.prototype.copyLinesUp = function() {
          this.$moveLines(-1, true);
        };
        Editor2.prototype.copyLinesDown = function() {
          this.$moveLines(1, true);
        };
        Editor2.prototype.$moveLines = function(dir, copy) {
          var rows, moved2;
          var selection = this.selection;
          if (!selection.inMultiSelectMode || this.inVirtualSelectionMode) {
            var range = selection.toOrientedRange();
            rows = this.$getSelectedRows(range);
            moved2 = this.session.$moveLines(rows.first, rows.last, copy ? 0 : dir);
            if (copy && dir == -1)
              moved2 = 0;
            range.moveBy(moved2, 0);
            selection.fromOrientedRange(range);
          } else {
            var ranges = selection.rangeList.ranges;
            selection.rangeList.detach(this.session);
            this.inVirtualSelectionMode = true;
            var diff = 0;
            var totalDiff = 0;
            var l = ranges.length;
            for (var i2 = 0; i2 < l; i2++) {
              var rangeIndex = i2;
              ranges[i2].moveBy(diff, 0);
              rows = this.$getSelectedRows(ranges[i2]);
              var first = rows.first;
              var last = rows.last;
              while (++i2 < l) {
                if (totalDiff)
                  ranges[i2].moveBy(totalDiff, 0);
                var subRows = this.$getSelectedRows(ranges[i2]);
                if (copy && subRows.first != last)
                  break;
                else if (!copy && subRows.first > last + 1)
                  break;
                last = subRows.last;
              }
              i2--;
              diff = this.session.$moveLines(first, last, copy ? 0 : dir);
              if (copy && dir == -1)
                rangeIndex = i2 + 1;
              while (rangeIndex <= i2) {
                ranges[rangeIndex].moveBy(diff, 0);
                rangeIndex++;
              }
              if (!copy)
                diff = 0;
              totalDiff += diff;
            }
            selection.fromOrientedRange(selection.ranges[0]);
            selection.rangeList.attach(this.session);
            this.inVirtualSelectionMode = false;
          }
        };
        Editor2.prototype.$getSelectedRows = function(range) {
          range = (range || this.getSelectionRange()).collapseRows();
          return {
            first: this.session.getRowFoldStart(range.start.row),
            last: this.session.getRowFoldEnd(range.end.row)
          };
        };
        Editor2.prototype.onCompositionStart = function(compositionState) {
          this.renderer.showComposition(compositionState);
        };
        Editor2.prototype.onCompositionUpdate = function(text) {
          this.renderer.setCompositionText(text);
        };
        Editor2.prototype.onCompositionEnd = function() {
          this.renderer.hideComposition();
        };
        Editor2.prototype.getFirstVisibleRow = function() {
          return this.renderer.getFirstVisibleRow();
        };
        Editor2.prototype.getLastVisibleRow = function() {
          return this.renderer.getLastVisibleRow();
        };
        Editor2.prototype.isRowVisible = function(row) {
          return row >= this.getFirstVisibleRow() && row <= this.getLastVisibleRow();
        };
        Editor2.prototype.isRowFullyVisible = function(row) {
          return row >= this.renderer.getFirstFullyVisibleRow() && row <= this.renderer.getLastFullyVisibleRow();
        };
        Editor2.prototype.$getVisibleRowCount = function() {
          return this.renderer.getScrollBottomRow() - this.renderer.getScrollTopRow() + 1;
        };
        Editor2.prototype.$moveByPage = function(dir, select) {
          var renderer = this.renderer;
          var config3 = this.renderer.layerConfig;
          var rows = dir * Math.floor(config3.height / config3.lineHeight);
          if (select === true) {
            this.selection.$moveSelection(function() {
              this.moveCursorBy(rows, 0);
            });
          } else if (select === false) {
            this.selection.moveCursorBy(rows, 0);
            this.selection.clearSelection();
          }
          var scrollTop = renderer.scrollTop;
          renderer.scrollBy(0, rows * config3.lineHeight);
          if (select != null)
            renderer.scrollCursorIntoView(null, 0.5);
          renderer.animateScrolling(scrollTop);
        };
        Editor2.prototype.selectPageDown = function() {
          this.$moveByPage(1, true);
        };
        Editor2.prototype.selectPageUp = function() {
          this.$moveByPage(-1, true);
        };
        Editor2.prototype.gotoPageDown = function() {
          this.$moveByPage(1, false);
        };
        Editor2.prototype.gotoPageUp = function() {
          this.$moveByPage(-1, false);
        };
        Editor2.prototype.scrollPageDown = function() {
          this.$moveByPage(1);
        };
        Editor2.prototype.scrollPageUp = function() {
          this.$moveByPage(-1);
        };
        Editor2.prototype.scrollToRow = function(row) {
          this.renderer.scrollToRow(row);
        };
        Editor2.prototype.scrollToLine = function(line, center, animate, callback) {
          this.renderer.scrollToLine(line, center, animate, callback);
        };
        Editor2.prototype.centerSelection = function() {
          var range = this.getSelectionRange();
          var pos = {
            row: Math.floor(range.start.row + (range.end.row - range.start.row) / 2),
            column: Math.floor(range.start.column + (range.end.column - range.start.column) / 2)
          };
          this.renderer.alignCursor(pos, 0.5);
        };
        Editor2.prototype.getCursorPosition = function() {
          return this.selection.getCursor();
        };
        Editor2.prototype.getCursorPositionScreen = function() {
          return this.session.documentToScreenPosition(this.getCursorPosition());
        };
        Editor2.prototype.getSelectionRange = function() {
          return this.selection.getRange();
        };
        Editor2.prototype.selectAll = function() {
          this.selection.selectAll();
        };
        Editor2.prototype.clearSelection = function() {
          this.selection.clearSelection();
        };
        Editor2.prototype.moveCursorTo = function(row, column) {
          this.selection.moveCursorTo(row, column);
        };
        Editor2.prototype.moveCursorToPosition = function(pos) {
          this.selection.moveCursorToPosition(pos);
        };
        Editor2.prototype.jumpToMatching = function(select, expand) {
          var cursor = this.getCursorPosition();
          var iterator = new TokenIterator(this.session, cursor.row, cursor.column);
          var prevToken = iterator.getCurrentToken();
          var tokenCount = 0;
          if (prevToken && prevToken.type.indexOf("tag-name") !== -1) {
            prevToken = iterator.stepBackward();
          }
          var token = prevToken || iterator.stepForward();
          if (!token)
            return;
          var matchType;
          var found = false;
          var depth = {};
          var i2 = cursor.column - token.start;
          var bracketType;
          var brackets = {
            ")": "(",
            "(": "(",
            "]": "[",
            "[": "[",
            "{": "{",
            "}": "{"
          };
          do {
            if (token.value.match(/[{}()\[\]]/g)) {
              for (; i2 < token.value.length && !found; i2++) {
                if (!brackets[token.value[i2]]) {
                  continue;
                }
                bracketType = brackets[token.value[i2]] + "." + token.type.replace("rparen", "lparen");
                if (isNaN(depth[bracketType])) {
                  depth[bracketType] = 0;
                }
                switch (token.value[i2]) {
                  case "(":
                  case "[":
                  case "{":
                    depth[bracketType]++;
                    break;
                  case ")":
                  case "]":
                  case "}":
                    depth[bracketType]--;
                    if (depth[bracketType] === -1) {
                      matchType = "bracket";
                      found = true;
                    }
                    break;
                }
              }
            } else if (token.type.indexOf("tag-name") !== -1) {
              if (isNaN(depth[token.value])) {
                depth[token.value] = 0;
              }
              if (prevToken.value === "<" && tokenCount > 1) {
                depth[token.value]++;
              } else if (prevToken.value === "</") {
                depth[token.value]--;
              }
              if (depth[token.value] === -1) {
                matchType = "tag";
                found = true;
              }
            }
            if (!found) {
              prevToken = token;
              tokenCount++;
              token = iterator.stepForward();
              i2 = 0;
            }
          } while (token && !found);
          if (!matchType)
            return;
          var range, pos;
          if (matchType === "bracket") {
            range = this.session.getBracketRange(cursor);
            if (!range) {
              range = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + i2 - 1, iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() + i2 - 1);
              pos = range.start;
              if (expand || pos.row === cursor.row && Math.abs(pos.column - cursor.column) < 2)
                range = this.session.getBracketRange(pos);
            }
          } else if (matchType === "tag") {
            if (!token || token.type.indexOf("tag-name") === -1)
              return;
            range = new Range2(iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() - 2, iterator.getCurrentTokenRow(), iterator.getCurrentTokenColumn() - 2);
            if (range.compare(cursor.row, cursor.column) === 0) {
              var tagsRanges = this.session.getMatchingTags(cursor);
              if (tagsRanges) {
                if (tagsRanges.openTag.contains(cursor.row, cursor.column)) {
                  range = tagsRanges.closeTag;
                  pos = range.start;
                } else {
                  range = tagsRanges.openTag;
                  if (tagsRanges.closeTag.start.row === cursor.row && tagsRanges.closeTag.start.column === cursor.column)
                    pos = range.end;
                  else
                    pos = range.start;
                }
              }
            }
            pos = pos || range.start;
          }
          pos = range && range.cursor || pos;
          if (pos) {
            if (select) {
              if (range && expand) {
                this.selection.setRange(range);
              } else if (range && range.isEqual(this.getSelectionRange())) {
                this.clearSelection();
              } else {
                this.selection.selectTo(pos.row, pos.column);
              }
            } else {
              this.selection.moveTo(pos.row, pos.column);
            }
          }
        };
        Editor2.prototype.gotoLine = function(lineNumber, column, animate) {
          this.selection.clearSelection();
          this.session.unfold({ row: lineNumber - 1, column: column || 0 });
          this.exitMultiSelectMode && this.exitMultiSelectMode();
          this.moveCursorTo(lineNumber - 1, column || 0);
          if (!this.isRowFullyVisible(lineNumber - 1))
            this.scrollToLine(lineNumber - 1, true, animate);
        };
        Editor2.prototype.navigateTo = function(row, column) {
          this.selection.moveTo(row, column);
        };
        Editor2.prototype.navigateUp = function(times) {
          if (this.selection.isMultiLine() && !this.selection.isBackwards()) {
            var selectionStart = this.selection.anchor.getPosition();
            return this.moveCursorToPosition(selectionStart);
          }
          this.selection.clearSelection();
          this.selection.moveCursorBy(-times || -1, 0);
        };
        Editor2.prototype.navigateDown = function(times) {
          if (this.selection.isMultiLine() && this.selection.isBackwards()) {
            var selectionEnd = this.selection.anchor.getPosition();
            return this.moveCursorToPosition(selectionEnd);
          }
          this.selection.clearSelection();
          this.selection.moveCursorBy(times || 1, 0);
        };
        Editor2.prototype.navigateLeft = function(times) {
          if (!this.selection.isEmpty()) {
            var selectionStart = this.getSelectionRange().start;
            this.moveCursorToPosition(selectionStart);
          } else {
            times = times || 1;
            while (times--) {
              this.selection.moveCursorLeft();
            }
          }
          this.clearSelection();
        };
        Editor2.prototype.navigateRight = function(times) {
          if (!this.selection.isEmpty()) {
            var selectionEnd = this.getSelectionRange().end;
            this.moveCursorToPosition(selectionEnd);
          } else {
            times = times || 1;
            while (times--) {
              this.selection.moveCursorRight();
            }
          }
          this.clearSelection();
        };
        Editor2.prototype.navigateLineStart = function() {
          this.selection.moveCursorLineStart();
          this.clearSelection();
        };
        Editor2.prototype.navigateLineEnd = function() {
          this.selection.moveCursorLineEnd();
          this.clearSelection();
        };
        Editor2.prototype.navigateFileEnd = function() {
          this.selection.moveCursorFileEnd();
          this.clearSelection();
        };
        Editor2.prototype.navigateFileStart = function() {
          this.selection.moveCursorFileStart();
          this.clearSelection();
        };
        Editor2.prototype.navigateWordRight = function() {
          this.selection.moveCursorWordRight();
          this.clearSelection();
        };
        Editor2.prototype.navigateWordLeft = function() {
          this.selection.moveCursorWordLeft();
          this.clearSelection();
        };
        Editor2.prototype.replace = function(replacement, options) {
          if (options)
            this.$search.set(options);
          var range = this.$search.find(this.session);
          var replaced = 0;
          if (!range)
            return replaced;
          if (this.$tryReplace(range, replacement)) {
            replaced = 1;
          }
          this.selection.setSelectionRange(range);
          this.renderer.scrollSelectionIntoView(range.start, range.end);
          return replaced;
        };
        Editor2.prototype.replaceAll = function(replacement, options) {
          if (options) {
            this.$search.set(options);
          }
          var ranges = this.$search.findAll(this.session);
          var replaced = 0;
          if (!ranges.length)
            return replaced;
          var selection = this.getSelectionRange();
          this.selection.moveTo(0, 0);
          for (var i2 = ranges.length - 1; i2 >= 0; --i2) {
            if (this.$tryReplace(ranges[i2], replacement)) {
              replaced++;
            }
          }
          this.selection.setSelectionRange(selection);
          return replaced;
        };
        Editor2.prototype.$tryReplace = function(range, replacement) {
          var input = this.session.getTextRange(range);
          replacement = this.$search.replace(input, replacement);
          if (replacement !== null) {
            range.end = this.session.replace(range, replacement);
            return range;
          } else {
            return null;
          }
        };
        Editor2.prototype.getLastSearchOptions = function() {
          return this.$search.getOptions();
        };
        Editor2.prototype.find = function(needle, options, animate) {
          if (!options)
            options = {};
          if (typeof needle == "string" || needle instanceof RegExp)
            options.needle = needle;
          else if (typeof needle == "object")
            oop.mixin(options, needle);
          var range = this.selection.getRange();
          if (options.needle == null) {
            needle = this.session.getTextRange(range) || this.$search.$options.needle;
            if (!needle) {
              range = this.session.getWordRange(range.start.row, range.start.column);
              needle = this.session.getTextRange(range);
            }
            this.$search.set({ needle });
          }
          this.$search.set(options);
          if (!options.start)
            this.$search.set({ start: range });
          var newRange = this.$search.find(this.session);
          if (options.preventScroll)
            return newRange;
          if (newRange) {
            this.revealRange(newRange, animate);
            return newRange;
          }
          if (options.backwards)
            range.start = range.end;
          else
            range.end = range.start;
          this.selection.setRange(range);
        };
        Editor2.prototype.findNext = function(options, animate) {
          this.find({ skipCurrent: true, backwards: false }, options, animate);
        };
        Editor2.prototype.findPrevious = function(options, animate) {
          this.find(options, { skipCurrent: true, backwards: true }, animate);
        };
        Editor2.prototype.revealRange = function(range, animate) {
          this.session.unfold(range);
          this.selection.setSelectionRange(range);
          var scrollTop = this.renderer.scrollTop;
          this.renderer.scrollSelectionIntoView(range.start, range.end, 0.5);
          if (animate !== false)
            this.renderer.animateScrolling(scrollTop);
        };
        Editor2.prototype.undo = function() {
          this.session.getUndoManager().undo(this.session);
          this.renderer.scrollCursorIntoView(null, 0.5);
        };
        Editor2.prototype.redo = function() {
          this.session.getUndoManager().redo(this.session);
          this.renderer.scrollCursorIntoView(null, 0.5);
        };
        Editor2.prototype.destroy = function() {
          if (this.$toDestroy) {
            this.$toDestroy.forEach(function(el) {
              el.destroy();
            });
            this.$toDestroy = null;
          }
          if (this.$mouseHandler)
            this.$mouseHandler.destroy();
          this.renderer.destroy();
          this._signal("destroy", this);
          if (this.session)
            this.session.destroy();
          if (this._$emitInputEvent)
            this._$emitInputEvent.cancel();
          this.removeAllListeners();
        };
        Editor2.prototype.setAutoScrollEditorIntoView = function(enable) {
          if (!enable)
            return;
          var rect;
          var self2 = this;
          var shouldScroll = false;
          if (!this.$scrollAnchor)
            this.$scrollAnchor = document.createElement("div");
          var scrollAnchor = this.$scrollAnchor;
          scrollAnchor.style.cssText = "position:absolute";
          this.container.insertBefore(scrollAnchor, this.container.firstChild);
          var onChangeSelection = this.on("changeSelection", function() {
            shouldScroll = true;
          });
          var onBeforeRender = this.renderer.on("beforeRender", function() {
            if (shouldScroll)
              rect = self2.renderer.container.getBoundingClientRect();
          });
          var onAfterRender = this.renderer.on("afterRender", function() {
            if (shouldScroll && rect && (self2.isFocused() || self2.searchBox && self2.searchBox.isFocused())) {
              var renderer = self2.renderer;
              var pos = renderer.$cursorLayer.$pixelPos;
              var config3 = renderer.layerConfig;
              var top2 = pos.top - config3.offset;
              if (pos.top >= 0 && top2 + rect.top < 0) {
                shouldScroll = true;
              } else if (pos.top < config3.height && pos.top + rect.top + config3.lineHeight > window.innerHeight) {
                shouldScroll = false;
              } else {
                shouldScroll = null;
              }
              if (shouldScroll != null) {
                scrollAnchor.style.top = top2 + "px";
                scrollAnchor.style.left = pos.left + "px";
                scrollAnchor.style.height = config3.lineHeight + "px";
                scrollAnchor.scrollIntoView(shouldScroll);
              }
              shouldScroll = rect = null;
            }
          });
          this.setAutoScrollEditorIntoView = function(enable2) {
            if (enable2)
              return;
            delete this.setAutoScrollEditorIntoView;
            this.off("changeSelection", onChangeSelection);
            this.renderer.off("afterRender", onAfterRender);
            this.renderer.off("beforeRender", onBeforeRender);
          };
        };
        Editor2.prototype.$resetCursorStyle = function() {
          var style = this.$cursorStyle || "ace";
          var cursorLayer2 = this.renderer.$cursorLayer;
          if (!cursorLayer2)
            return;
          cursorLayer2.setSmoothBlinking(/smooth/.test(style));
          cursorLayer2.isBlinking = !this.$readOnly && style != "wide";
          dom.setCssClass(cursorLayer2.element, "ace_slim-cursors", /slim/.test(style));
        };
        Editor2.prototype.prompt = function(message, options, callback) {
          var editor = this;
          config2.loadModule("ace/ext/prompt", function(module4) {
            module4.prompt(editor, message, options, callback);
          });
        };
        return Editor2;
      }();
      Editor.$uid = 0;
      Editor.prototype.curOp = null;
      Editor.prototype.prevOp = {};
      Editor.prototype.$mergeableCommands = ["backspace", "del", "insertstring"];
      Editor.prototype.$toggleWordPairs = [
        ["first", "last"],
        ["true", "false"],
        ["yes", "no"],
        ["width", "height"],
        ["top", "bottom"],
        ["right", "left"],
        ["on", "off"],
        ["x", "y"],
        ["get", "set"],
        ["max", "min"],
        ["horizontal", "vertical"],
        ["show", "hide"],
        ["add", "remove"],
        ["up", "down"],
        ["before", "after"],
        ["even", "odd"],
        ["in", "out"],
        ["inside", "outside"],
        ["next", "previous"],
        ["increase", "decrease"],
        ["attach", "detach"],
        ["&&", "||"],
        ["==", "!="]
      ];
      oop.implement(Editor.prototype, EventEmitter);
      config2.defineOptions(Editor.prototype, "editor", {
        selectionStyle: {
          set: function(style) {
            this.onSelectionChange();
            this._signal("changeSelectionStyle", { data: style });
          },
          initialValue: "line"
        },
        highlightActiveLine: {
          set: function() {
            this.$updateHighlightActiveLine();
          },
          initialValue: true
        },
        highlightSelectedWord: {
          set: function(shouldHighlight) {
            this.$onSelectionChange();
          },
          initialValue: true
        },
        readOnly: {
          set: function(readOnly2) {
            this.textInput.setReadOnly(readOnly2);
            this.$resetCursorStyle();
          },
          initialValue: false
        },
        copyWithEmptySelection: {
          set: function(value2) {
            this.textInput.setCopyWithEmptySelection(value2);
          },
          initialValue: false
        },
        cursorStyle: {
          set: function(val) {
            this.$resetCursorStyle();
          },
          values: ["ace", "slim", "smooth", "wide"],
          initialValue: "ace"
        },
        mergeUndoDeltas: {
          values: [false, true, "always"],
          initialValue: true
        },
        behavioursEnabled: { initialValue: true },
        wrapBehavioursEnabled: { initialValue: true },
        enableAutoIndent: { initialValue: true },
        autoScrollEditorIntoView: {
          set: function(val) {
            this.setAutoScrollEditorIntoView(val);
          }
        },
        keyboardHandler: {
          set: function(val) {
            this.setKeyboardHandler(val);
          },
          get: function() {
            return this.$keybindingId;
          },
          handlesSet: true
        },
        value: {
          set: function(val) {
            this.session.setValue(val);
          },
          get: function() {
            return this.getValue();
          },
          handlesSet: true,
          hidden: true
        },
        session: {
          set: function(val) {
            this.setSession(val);
          },
          get: function() {
            return this.session;
          },
          handlesSet: true,
          hidden: true
        },
        showLineNumbers: {
          set: function(show) {
            this.renderer.$gutterLayer.setShowLineNumbers(show);
            this.renderer.$loop.schedule(this.renderer.CHANGE_GUTTER);
            if (show && this.$relativeLineNumbers)
              relativeNumberRenderer.attach(this);
            else
              relativeNumberRenderer.detach(this);
          },
          initialValue: true
        },
        relativeLineNumbers: {
          set: function(value2) {
            if (this.$showLineNumbers && value2)
              relativeNumberRenderer.attach(this);
            else
              relativeNumberRenderer.detach(this);
          }
        },
        placeholder: {
          set: function(message) {
            if (!this.$updatePlaceholder) {
              this.$updatePlaceholder = function() {
                var hasValue = this.session && (this.renderer.$composition || this.session.getLength() > 1 || this.session.getLine(0).length > 0);
                if (hasValue && this.renderer.placeholderNode) {
                  this.renderer.off("afterRender", this.$updatePlaceholder);
                  dom.removeCssClass(this.container, "ace_hasPlaceholder");
                  this.renderer.placeholderNode.remove();
                  this.renderer.placeholderNode = null;
                } else if (!hasValue && !this.renderer.placeholderNode) {
                  this.renderer.on("afterRender", this.$updatePlaceholder);
                  dom.addCssClass(this.container, "ace_hasPlaceholder");
                  var el = dom.createElement("div");
                  el.className = "ace_placeholder";
                  el.textContent = this.$placeholder || "";
                  this.renderer.placeholderNode = el;
                  this.renderer.content.appendChild(this.renderer.placeholderNode);
                } else if (!hasValue && this.renderer.placeholderNode) {
                  this.renderer.placeholderNode.textContent = this.$placeholder || "";
                }
              }.bind(this);
              this.on("input", this.$updatePlaceholder);
            }
            this.$updatePlaceholder();
          }
        },
        enableKeyboardAccessibility: {
          set: function(value2) {
            var blurCommand = {
              name: "blurTextInput",
              description: "Set focus to the editor content div to allow tabbing through the page",
              bindKey: "Esc",
              exec: function(editor) {
                editor.blur();
                editor.renderer.scroller.focus();
              },
              readOnly: true
            };
            var focusOnEnterKeyup = function(e) {
              if (e.target == this.renderer.scroller && e.keyCode === keys2["enter"]) {
                e.preventDefault();
                var row = this.getCursorPosition().row;
                if (!this.isRowVisible(row))
                  this.scrollToLine(row, true, true);
                this.focus();
              }
            };
            var gutterKeyboardHandler;
            if (value2) {
              this.renderer.enableKeyboardAccessibility = true;
              this.renderer.keyboardFocusClassName = "ace_keyboard-focus";
              this.textInput.getElement().setAttribute("tabindex", -1);
              this.textInput.setNumberOfExtraLines(useragent.isWin ? 3 : 0);
              this.renderer.scroller.setAttribute("tabindex", 0);
              this.renderer.scroller.setAttribute("role", "group");
              this.renderer.scroller.setAttribute("aria-roledescription", nls("editor"));
              this.renderer.scroller.classList.add(this.renderer.keyboardFocusClassName);
              this.renderer.scroller.setAttribute("aria-label", nls("Editor content, press Enter to start editing, press Escape to exit"));
              this.renderer.scroller.addEventListener("keyup", focusOnEnterKeyup.bind(this));
              this.commands.addCommand(blurCommand);
              this.renderer.$gutter.setAttribute("tabindex", 0);
              this.renderer.$gutter.setAttribute("aria-hidden", false);
              this.renderer.$gutter.setAttribute("role", "group");
              this.renderer.$gutter.setAttribute("aria-roledescription", nls("editor"));
              this.renderer.$gutter.setAttribute("aria-label", nls("Editor gutter, press Enter to interact with controls using arrow keys, press Escape to exit"));
              this.renderer.$gutter.classList.add(this.renderer.keyboardFocusClassName);
              this.renderer.content.setAttribute("aria-hidden", true);
              if (!gutterKeyboardHandler)
                gutterKeyboardHandler = new GutterKeyboardHandler(this);
              gutterKeyboardHandler.addListener();
            } else {
              this.renderer.enableKeyboardAccessibility = false;
              this.textInput.getElement().setAttribute("tabindex", 0);
              this.textInput.setNumberOfExtraLines(0);
              this.renderer.scroller.setAttribute("tabindex", -1);
              this.renderer.scroller.removeAttribute("role");
              this.renderer.scroller.removeAttribute("aria-roledescription");
              this.renderer.scroller.classList.remove(this.renderer.keyboardFocusClassName);
              this.renderer.scroller.removeAttribute("aria-label");
              this.renderer.scroller.removeEventListener("keyup", focusOnEnterKeyup.bind(this));
              this.commands.removeCommand(blurCommand);
              this.renderer.content.removeAttribute("aria-hidden");
              this.renderer.$gutter.setAttribute("tabindex", -1);
              this.renderer.$gutter.setAttribute("aria-hidden", true);
              this.renderer.$gutter.removeAttribute("role");
              this.renderer.$gutter.removeAttribute("aria-roledescription");
              this.renderer.$gutter.removeAttribute("aria-label");
              this.renderer.$gutter.classList.remove(this.renderer.keyboardFocusClassName);
              if (gutterKeyboardHandler)
                gutterKeyboardHandler.removeListener();
            }
          },
          initialValue: false
        },
        customScrollbar: "renderer",
        hScrollBarAlwaysVisible: "renderer",
        vScrollBarAlwaysVisible: "renderer",
        highlightGutterLine: "renderer",
        animatedScroll: "renderer",
        showInvisibles: "renderer",
        showPrintMargin: "renderer",
        printMarginColumn: "renderer",
        printMargin: "renderer",
        fadeFoldWidgets: "renderer",
        showFoldWidgets: "renderer",
        displayIndentGuides: "renderer",
        highlightIndentGuides: "renderer",
        showGutter: "renderer",
        fontSize: "renderer",
        fontFamily: "renderer",
        maxLines: "renderer",
        minLines: "renderer",
        scrollPastEnd: "renderer",
        fixedWidthGutter: "renderer",
        theme: "renderer",
        hasCssTransforms: "renderer",
        maxPixelHeight: "renderer",
        useTextareaForIME: "renderer",
        useResizeObserver: "renderer",
        useSvgGutterIcons: "renderer",
        showFoldedAnnotations: "renderer",
        scrollSpeed: "$mouseHandler",
        dragDelay: "$mouseHandler",
        dragEnabled: "$mouseHandler",
        focusTimeout: "$mouseHandler",
        tooltipFollowsMouse: "$mouseHandler",
        firstLineNumber: "session",
        overwrite: "session",
        newLineMode: "session",
        useWorker: "session",
        useSoftTabs: "session",
        navigateWithinSoftTabs: "session",
        tabSize: "session",
        wrap: "session",
        indentedSoftWrap: "session",
        foldStyle: "session",
        mode: "session"
      });
      var relativeNumberRenderer = {
        getText: function(session, row) {
          return (Math.abs(session.selection.lead.row - row) || row + 1 + (row < 9 ? "\xB7" : "")) + "";
        },
        getWidth: function(session, lastLineNumber, config3) {
          return Math.max(lastLineNumber.toString().length, (config3.lastRow + 1).toString().length, 2) * config3.characterWidth;
        },
        update: function(e, editor) {
          editor.renderer.$loop.schedule(editor.renderer.CHANGE_GUTTER);
        },
        attach: function(editor) {
          editor.renderer.$gutterLayer.$renderer = this;
          editor.on("changeSelection", this.update);
          this.update(null, editor);
        },
        detach: function(editor) {
          if (editor.renderer.$gutterLayer.$renderer == this)
            editor.renderer.$gutterLayer.$renderer = null;
          editor.off("changeSelection", this.update);
          this.update(null, editor);
        }
      };
      exports3.Editor = Editor;
    });
    ace.define("ace/layer/lines", ["require", "exports", "module", "ace/lib/dom"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var Lines = function() {
        function Lines2(element, canvasHeight) {
          this.element = element;
          this.canvasHeight = canvasHeight || 5e5;
          this.element.style.height = this.canvasHeight * 2 + "px";
          this.cells = [];
          this.cellCache = [];
          this.$offsetCoefficient = 0;
        }
        Lines2.prototype.moveContainer = function(config2) {
          dom.translate(this.element, 0, -(config2.firstRowScreen * config2.lineHeight % this.canvasHeight) - config2.offset * this.$offsetCoefficient);
        };
        Lines2.prototype.pageChanged = function(oldConfig, newConfig) {
          return Math.floor(oldConfig.firstRowScreen * oldConfig.lineHeight / this.canvasHeight) !== Math.floor(newConfig.firstRowScreen * newConfig.lineHeight / this.canvasHeight);
        };
        Lines2.prototype.computeLineTop = function(row, config2, session) {
          var screenTop = config2.firstRowScreen * config2.lineHeight;
          var screenPage = Math.floor(screenTop / this.canvasHeight);
          var lineTop = session.documentToScreenRow(row, 0) * config2.lineHeight;
          return lineTop - screenPage * this.canvasHeight;
        };
        Lines2.prototype.computeLineHeight = function(row, config2, session) {
          return config2.lineHeight * session.getRowLineCount(row);
        };
        Lines2.prototype.getLength = function() {
          return this.cells.length;
        };
        Lines2.prototype.get = function(index2) {
          return this.cells[index2];
        };
        Lines2.prototype.shift = function() {
          this.$cacheCell(this.cells.shift());
        };
        Lines2.prototype.pop = function() {
          this.$cacheCell(this.cells.pop());
        };
        Lines2.prototype.push = function(cell) {
          if (Array.isArray(cell)) {
            this.cells.push.apply(this.cells, cell);
            var fragment = dom.createFragment(this.element);
            for (var i2 = 0; i2 < cell.length; i2++) {
              fragment.appendChild(cell[i2].element);
            }
            this.element.appendChild(fragment);
          } else {
            this.cells.push(cell);
            this.element.appendChild(cell.element);
          }
        };
        Lines2.prototype.unshift = function(cell) {
          if (Array.isArray(cell)) {
            this.cells.unshift.apply(this.cells, cell);
            var fragment = dom.createFragment(this.element);
            for (var i2 = 0; i2 < cell.length; i2++) {
              fragment.appendChild(cell[i2].element);
            }
            if (this.element.firstChild)
              this.element.insertBefore(fragment, this.element.firstChild);
            else
              this.element.appendChild(fragment);
          } else {
            this.cells.unshift(cell);
            this.element.insertAdjacentElement("afterbegin", cell.element);
          }
        };
        Lines2.prototype.last = function() {
          if (this.cells.length)
            return this.cells[this.cells.length - 1];
          else
            return null;
        };
        Lines2.prototype.$cacheCell = function(cell) {
          if (!cell)
            return;
          cell.element.remove();
          this.cellCache.push(cell);
        };
        Lines2.prototype.createCell = function(row, config2, session, initElement) {
          var cell = this.cellCache.pop();
          if (!cell) {
            var element = dom.createElement("div");
            if (initElement)
              initElement(element);
            this.element.appendChild(element);
            cell = {
              element,
              text: "",
              row
            };
          }
          cell.row = row;
          return cell;
        };
        return Lines2;
      }();
      exports3.Lines = Lines;
    });
    ace.define("ace/layer/gutter", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/lang", "ace/lib/event_emitter", "ace/layer/lines", "ace/config"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var oop = require2("../lib/oop");
      var lang = require2("../lib/lang");
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var Lines = require2("./lines").Lines;
      var nls = require2("../config").nls;
      var Gutter = function() {
        function Gutter2(parentEl2) {
          this.element = dom.createElement("div");
          this.element.className = "ace_layer ace_gutter-layer";
          parentEl2.appendChild(this.element);
          this.setShowFoldWidgets(this.$showFoldWidgets);
          this.gutterWidth = 0;
          this.$annotations = [];
          this.$updateAnnotations = this.$updateAnnotations.bind(this);
          this.$lines = new Lines(this.element);
          this.$lines.$offsetCoefficient = 1;
        }
        Gutter2.prototype.setSession = function(session) {
          if (this.session)
            this.session.off("change", this.$updateAnnotations);
          this.session = session;
          if (session)
            session.on("change", this.$updateAnnotations);
        };
        Gutter2.prototype.addGutterDecoration = function(row, className) {
          if (window.console)
            console.warn && console.warn("deprecated use session.addGutterDecoration");
          this.session.addGutterDecoration(row, className);
        };
        Gutter2.prototype.removeGutterDecoration = function(row, className) {
          if (window.console)
            console.warn && console.warn("deprecated use session.removeGutterDecoration");
          this.session.removeGutterDecoration(row, className);
        };
        Gutter2.prototype.setAnnotations = function(annotations) {
          this.$annotations = [];
          for (var i2 = 0; i2 < annotations.length; i2++) {
            var annotation = annotations[i2];
            var row = annotation.row;
            var rowInfo = this.$annotations[row];
            if (!rowInfo)
              rowInfo = this.$annotations[row] = { text: [], type: [] };
            var annoText = annotation.text;
            var annoType = annotation.type;
            annoText = annoText ? lang.escapeHTML(annoText) : annotation.html || "";
            if (rowInfo.text.indexOf(annoText) === -1) {
              rowInfo.text.push(annoText);
              rowInfo.type.push(annoType);
            }
            var className = annotation.className;
            if (className)
              rowInfo.className = className;
            else if (annoType == "error")
              rowInfo.className = " ace_error";
            else if (annoType == "warning" && rowInfo.className != " ace_error")
              rowInfo.className = " ace_warning";
            else if (annoType == "info" && !rowInfo.className)
              rowInfo.className = " ace_info";
          }
        };
        Gutter2.prototype.$updateAnnotations = function(delta) {
          if (!this.$annotations.length)
            return;
          var firstRow = delta.start.row;
          var len = delta.end.row - firstRow;
          if (len === 0)
            ;
          else if (delta.action == "remove") {
            this.$annotations.splice(firstRow, len + 1, null);
          } else {
            var args = new Array(len + 1);
            args.unshift(firstRow, 1);
            this.$annotations.splice.apply(this.$annotations, args);
          }
        };
        Gutter2.prototype.update = function(config2) {
          this.config = config2;
          var session = this.session;
          var firstRow = config2.firstRow;
          var lastRow = Math.min(config2.lastRow + config2.gutterOffset, session.getLength() - 1);
          this.oldLastRow = lastRow;
          this.config = config2;
          this.$lines.moveContainer(config2);
          this.$updateCursorRow();
          var fold = session.getNextFoldLine(firstRow);
          var foldStart = fold ? fold.start.row : Infinity;
          var cell = null;
          var index2 = -1;
          var row = firstRow;
          while (true) {
            if (row > foldStart) {
              row = fold.end.row + 1;
              fold = session.getNextFoldLine(row, fold);
              foldStart = fold ? fold.start.row : Infinity;
            }
            if (row > lastRow) {
              while (this.$lines.getLength() > index2 + 1)
                this.$lines.pop();
              break;
            }
            cell = this.$lines.get(++index2);
            if (cell) {
              cell.row = row;
            } else {
              cell = this.$lines.createCell(row, config2, this.session, onCreateCell);
              this.$lines.push(cell);
            }
            this.$renderCell(cell, config2, fold, row);
            row++;
          }
          this._signal("afterRender");
          this.$updateGutterWidth(config2);
        };
        Gutter2.prototype.$updateGutterWidth = function(config2) {
          var session = this.session;
          var gutterRenderer = session.gutterRenderer || this.$renderer;
          var firstLineNumber = session.$firstLineNumber;
          var lastLineText = this.$lines.last() ? this.$lines.last().text : "";
          if (this.$fixedWidth || session.$useWrapMode)
            lastLineText = session.getLength() + firstLineNumber - 1;
          var gutterWidth = gutterRenderer ? gutterRenderer.getWidth(session, lastLineText, config2) : lastLineText.toString().length * config2.characterWidth;
          var padding = this.$padding || this.$computePadding();
          gutterWidth += padding.left + padding.right;
          if (gutterWidth !== this.gutterWidth && !isNaN(gutterWidth)) {
            this.gutterWidth = gutterWidth;
            this.element.parentNode.style.width = this.element.style.width = Math.ceil(this.gutterWidth) + "px";
            this._signal("changeGutterWidth", gutterWidth);
          }
        };
        Gutter2.prototype.$updateCursorRow = function() {
          if (!this.$highlightGutterLine)
            return;
          var position = this.session.selection.getCursor();
          if (this.$cursorRow === position.row)
            return;
          this.$cursorRow = position.row;
        };
        Gutter2.prototype.updateLineHighlight = function() {
          if (!this.$highlightGutterLine)
            return;
          var row = this.session.selection.cursor.row;
          this.$cursorRow = row;
          if (this.$cursorCell && this.$cursorCell.row == row)
            return;
          if (this.$cursorCell)
            this.$cursorCell.element.className = this.$cursorCell.element.className.replace("ace_gutter-active-line ", "");
          var cells = this.$lines.cells;
          this.$cursorCell = null;
          for (var i2 = 0; i2 < cells.length; i2++) {
            var cell = cells[i2];
            if (cell.row >= this.$cursorRow) {
              if (cell.row > this.$cursorRow) {
                var fold = this.session.getFoldLine(this.$cursorRow);
                if (i2 > 0 && fold && fold.start.row == cells[i2 - 1].row)
                  cell = cells[i2 - 1];
                else
                  break;
              }
              cell.element.className = "ace_gutter-active-line " + cell.element.className;
              this.$cursorCell = cell;
              break;
            }
          }
        };
        Gutter2.prototype.scrollLines = function(config2) {
          var oldConfig = this.config;
          this.config = config2;
          this.$updateCursorRow();
          if (this.$lines.pageChanged(oldConfig, config2))
            return this.update(config2);
          this.$lines.moveContainer(config2);
          var lastRow = Math.min(config2.lastRow + config2.gutterOffset, this.session.getLength() - 1);
          var oldLastRow = this.oldLastRow;
          this.oldLastRow = lastRow;
          if (!oldConfig || oldLastRow < config2.firstRow)
            return this.update(config2);
          if (lastRow < oldConfig.firstRow)
            return this.update(config2);
          if (oldConfig.firstRow < config2.firstRow)
            for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config2.firstRow - 1); row > 0; row--)
              this.$lines.shift();
          if (oldLastRow > lastRow)
            for (var row = this.session.getFoldedRowCount(lastRow + 1, oldLastRow); row > 0; row--)
              this.$lines.pop();
          if (config2.firstRow < oldConfig.firstRow) {
            this.$lines.unshift(this.$renderLines(config2, config2.firstRow, oldConfig.firstRow - 1));
          }
          if (lastRow > oldLastRow) {
            this.$lines.push(this.$renderLines(config2, oldLastRow + 1, lastRow));
          }
          this.updateLineHighlight();
          this._signal("afterRender");
          this.$updateGutterWidth(config2);
        };
        Gutter2.prototype.$renderLines = function(config2, firstRow, lastRow) {
          var fragment = [];
          var row = firstRow;
          var foldLine = this.session.getNextFoldLine(row);
          var foldStart = foldLine ? foldLine.start.row : Infinity;
          while (true) {
            if (row > foldStart) {
              row = foldLine.end.row + 1;
              foldLine = this.session.getNextFoldLine(row, foldLine);
              foldStart = foldLine ? foldLine.start.row : Infinity;
            }
            if (row > lastRow)
              break;
            var cell = this.$lines.createCell(row, config2, this.session, onCreateCell);
            this.$renderCell(cell, config2, foldLine, row);
            fragment.push(cell);
            row++;
          }
          return fragment;
        };
        Gutter2.prototype.$renderCell = function(cell, config2, fold, row) {
          var element = cell.element;
          var session = this.session;
          var textNode = element.childNodes[0];
          var foldWidget2 = element.childNodes[1];
          var annotationNode = element.childNodes[2];
          var annotationIconNode = annotationNode.firstChild;
          var firstLineNumber = session.$firstLineNumber;
          var breakpoints = session.$breakpoints;
          var decorations2 = session.$decorations;
          var gutterRenderer = session.gutterRenderer || this.$renderer;
          var foldWidgets = this.$showFoldWidgets && session.foldWidgets;
          var foldStart = fold ? fold.start.row : Number.MAX_VALUE;
          var lineHeight = config2.lineHeight + "px";
          var className = this.$useSvgGutterIcons ? "ace_gutter-cell_svg-icons " : "ace_gutter-cell ";
          var iconClassName = this.$useSvgGutterIcons ? "ace_icon_svg" : "ace_icon";
          var rowText = (gutterRenderer ? gutterRenderer.getText(session, row) : row + firstLineNumber).toString();
          if (this.$highlightGutterLine) {
            if (row == this.$cursorRow || fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row) {
              className += "ace_gutter-active-line ";
              if (this.$cursorCell != cell) {
                if (this.$cursorCell)
                  this.$cursorCell.element.className = this.$cursorCell.element.className.replace("ace_gutter-active-line ", "");
                this.$cursorCell = cell;
              }
            }
          }
          if (breakpoints[row])
            className += breakpoints[row];
          if (decorations2[row])
            className += decorations2[row];
          if (this.$annotations[row] && row !== foldStart)
            className += this.$annotations[row].className;
          if (foldWidgets) {
            var c = foldWidgets[row];
            if (c == null)
              c = foldWidgets[row] = session.getFoldWidget(row);
          }
          if (c) {
            var foldClass = "ace_fold-widget ace_" + c;
            var isClosedFold = c == "start" && row == foldStart && row < fold.end.row;
            if (isClosedFold) {
              foldClass += " ace_closed";
              var foldAnnotationClass = "";
              var annotationInFold = false;
              for (var i2 = row + 1; i2 <= fold.end.row; i2++) {
                if (!this.$annotations[i2])
                  continue;
                if (this.$annotations[i2].className === " ace_error") {
                  annotationInFold = true;
                  foldAnnotationClass = " ace_error_fold";
                  break;
                }
                if (this.$annotations[i2].className === " ace_warning") {
                  annotationInFold = true;
                  foldAnnotationClass = " ace_warning_fold";
                  continue;
                }
              }
              className += foldAnnotationClass;
            } else
              foldClass += " ace_open";
            if (foldWidget2.className != foldClass)
              foldWidget2.className = foldClass;
            dom.setStyle(foldWidget2.style, "height", lineHeight);
            dom.setStyle(foldWidget2.style, "display", "inline-block");
            foldWidget2.setAttribute("role", "button");
            foldWidget2.setAttribute("tabindex", "-1");
            var foldRange = session.getFoldWidgetRange(row);
            if (foldRange)
              foldWidget2.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [foldRange.start.row + 1, foldRange.end.row + 1]));
            else {
              if (fold)
                foldWidget2.setAttribute("aria-label", nls("Toggle code folding, rows $0 through $1", [fold.start.row + 1, fold.end.row + 1]));
              else
                foldWidget2.setAttribute("aria-label", nls("Toggle code folding, row $0", [row + 1]));
            }
            if (isClosedFold) {
              foldWidget2.setAttribute("aria-expanded", "false");
              foldWidget2.setAttribute("title", nls("Unfold code"));
            } else {
              foldWidget2.setAttribute("aria-expanded", "true");
              foldWidget2.setAttribute("title", nls("Fold code"));
            }
          } else {
            if (foldWidget2) {
              dom.setStyle(foldWidget2.style, "display", "none");
              foldWidget2.setAttribute("tabindex", "0");
              foldWidget2.removeAttribute("role");
              foldWidget2.removeAttribute("aria-label");
            }
          }
          if (annotationInFold && this.$showFoldedAnnotations) {
            annotationNode.className = "ace_gutter_annotation";
            annotationIconNode.className = iconClassName;
            annotationIconNode.className += foldAnnotationClass;
            dom.setStyle(annotationIconNode.style, "height", lineHeight);
            dom.setStyle(annotationNode.style, "display", "block");
            dom.setStyle(annotationNode.style, "height", lineHeight);
            annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText]));
            annotationNode.setAttribute("tabindex", "-1");
            annotationNode.setAttribute("role", "button");
          } else if (this.$annotations[row]) {
            annotationNode.className = "ace_gutter_annotation";
            annotationIconNode.className = iconClassName;
            if (this.$useSvgGutterIcons)
              annotationIconNode.className += this.$annotations[row].className;
            else
              element.classList.add(this.$annotations[row].className.replace(" ", ""));
            dom.setStyle(annotationIconNode.style, "height", lineHeight);
            dom.setStyle(annotationNode.style, "display", "block");
            dom.setStyle(annotationNode.style, "height", lineHeight);
            annotationNode.setAttribute("aria-label", nls("Read annotations row $0", [rowText]));
            annotationNode.setAttribute("tabindex", "-1");
            annotationNode.setAttribute("role", "button");
          } else {
            dom.setStyle(annotationNode.style, "display", "none");
            annotationNode.removeAttribute("aria-label");
            annotationNode.removeAttribute("role");
            annotationNode.setAttribute("tabindex", "0");
          }
          if (rowText !== textNode.data) {
            textNode.data = rowText;
          }
          if (element.className != className)
            element.className = className;
          dom.setStyle(cell.element.style, "height", this.$lines.computeLineHeight(row, config2, session) + "px");
          dom.setStyle(cell.element.style, "top", this.$lines.computeLineTop(row, config2, session) + "px");
          cell.text = rowText;
          if (annotationNode.style.display === "none" && foldWidget2.style.display === "none")
            cell.element.setAttribute("aria-hidden", true);
          else
            cell.element.setAttribute("aria-hidden", false);
          return cell;
        };
        Gutter2.prototype.setHighlightGutterLine = function(highlightGutterLine) {
          this.$highlightGutterLine = highlightGutterLine;
        };
        Gutter2.prototype.setShowLineNumbers = function(show) {
          this.$renderer = !show && {
            getWidth: function() {
              return 0;
            },
            getText: function() {
              return "";
            }
          };
        };
        Gutter2.prototype.getShowLineNumbers = function() {
          return this.$showLineNumbers;
        };
        Gutter2.prototype.setShowFoldWidgets = function(show) {
          if (show)
            dom.addCssClass(this.element, "ace_folding-enabled");
          else
            dom.removeCssClass(this.element, "ace_folding-enabled");
          this.$showFoldWidgets = show;
          this.$padding = null;
        };
        Gutter2.prototype.getShowFoldWidgets = function() {
          return this.$showFoldWidgets;
        };
        Gutter2.prototype.$computePadding = function() {
          if (!this.element.firstChild)
            return { left: 0, right: 0 };
          var style = dom.computedStyle(this.element.firstChild);
          this.$padding = {};
          this.$padding.left = (parseInt(style.borderLeftWidth) || 0) + (parseInt(style.paddingLeft) || 0) + 1;
          this.$padding.right = (parseInt(style.borderRightWidth) || 0) + (parseInt(style.paddingRight) || 0);
          return this.$padding;
        };
        Gutter2.prototype.getRegion = function(point) {
          var padding = this.$padding || this.$computePadding();
          var rect = this.element.getBoundingClientRect();
          if (point.x < padding.left + rect.left)
            return "markers";
          if (this.$showFoldWidgets && point.x > rect.right - padding.right)
            return "foldWidgets";
        };
        return Gutter2;
      }();
      Gutter.prototype.$fixedWidth = false;
      Gutter.prototype.$highlightGutterLine = true;
      Gutter.prototype.$renderer = "";
      Gutter.prototype.$showLineNumbers = true;
      Gutter.prototype.$showFoldWidgets = true;
      oop.implement(Gutter.prototype, EventEmitter);
      function onCreateCell(element) {
        var textNode = document.createTextNode("");
        element.appendChild(textNode);
        var foldWidget2 = dom.createElement("span");
        element.appendChild(foldWidget2);
        var annotationNode = dom.createElement("span");
        element.appendChild(annotationNode);
        var annotationIconNode = dom.createElement("span");
        annotationNode.appendChild(annotationIconNode);
        return element;
      }
      exports3.Gutter = Gutter;
    });
    ace.define("ace/layer/marker", ["require", "exports", "module", "ace/range", "ace/lib/dom"], function(require2, exports3, module3) {
      var Range2 = require2("../range").Range;
      var dom = require2("../lib/dom");
      var Marker = function() {
        function Marker2(parentEl2) {
          this.element = dom.createElement("div");
          this.element.className = "ace_layer ace_marker-layer";
          parentEl2.appendChild(this.element);
        }
        Marker2.prototype.setPadding = function(padding) {
          this.$padding = padding;
        };
        Marker2.prototype.setSession = function(session) {
          this.session = session;
        };
        Marker2.prototype.setMarkers = function(markers) {
          this.markers = markers;
        };
        Marker2.prototype.elt = function(className, css2) {
          var x = this.i != -1 && this.element.childNodes[this.i];
          if (!x) {
            x = document.createElement("div");
            this.element.appendChild(x);
            this.i = -1;
          } else {
            this.i++;
          }
          x.style.cssText = css2;
          x.className = className;
        };
        Marker2.prototype.update = function(config2) {
          if (!config2)
            return;
          this.config = config2;
          this.i = 0;
          var html;
          for (var key in this.markers) {
            var marker = this.markers[key];
            if (!marker.range) {
              marker.update(html, this, this.session, config2);
              continue;
            }
            var range = marker.range.clipRows(config2.firstRow, config2.lastRow);
            if (range.isEmpty())
              continue;
            range = range.toScreenRange(this.session);
            if (marker.renderer) {
              var top2 = this.$getTop(range.start.row, config2);
              var left = this.$padding + range.start.column * config2.characterWidth;
              marker.renderer(html, range, left, top2, config2);
            } else if (marker.type == "fullLine") {
              this.drawFullLineMarker(html, range, marker.clazz, config2);
            } else if (marker.type == "screenLine") {
              this.drawScreenLineMarker(html, range, marker.clazz, config2);
            } else if (range.isMultiLine()) {
              if (marker.type == "text")
                this.drawTextMarker(html, range, marker.clazz, config2);
              else
                this.drawMultiLineMarker(html, range, marker.clazz, config2);
            } else {
              this.drawSingleLineMarker(html, range, marker.clazz + " ace_start ace_br15", config2);
            }
          }
          if (this.i != -1) {
            while (this.i < this.element.childElementCount)
              this.element.removeChild(this.element.lastChild);
          }
        };
        Marker2.prototype.$getTop = function(row, layerConfig) {
          return (row - layerConfig.firstRowScreen) * layerConfig.lineHeight;
        };
        Marker2.prototype.drawTextMarker = function(stringBuilder, range, clazz, layerConfig, extraStyle) {
          var session = this.session;
          var start = range.start.row;
          var end = range.end.row;
          var row = start;
          var prev = 0;
          var curr = 0;
          var next = session.getScreenLastRowColumn(row);
          var lineRange = new Range2(row, range.start.column, row, curr);
          for (; row <= end; row++) {
            lineRange.start.row = lineRange.end.row = row;
            lineRange.start.column = row == start ? range.start.column : session.getRowWrapIndent(row);
            lineRange.end.column = next;
            prev = curr;
            curr = next;
            next = row + 1 < end ? session.getScreenLastRowColumn(row + 1) : row == end ? 0 : range.end.column;
            this.drawSingleLineMarker(stringBuilder, lineRange, clazz + (row == start ? " ace_start" : "") + " ace_br" + getBorderClass(row == start || row == start + 1 && range.start.column, prev < curr, curr > next, row == end), layerConfig, row == end ? 0 : 1, extraStyle);
          }
        };
        Marker2.prototype.drawMultiLineMarker = function(stringBuilder, range, clazz, config2, extraStyle) {
          var padding = this.$padding;
          var height = config2.lineHeight;
          var top2 = this.$getTop(range.start.row, config2);
          var left = padding + range.start.column * config2.characterWidth;
          extraStyle = extraStyle || "";
          if (this.session.$bidiHandler.isBidiRow(range.start.row)) {
            var range1 = range.clone();
            range1.end.row = range1.start.row;
            range1.end.column = this.session.getLine(range1.start.row).length;
            this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br1 ace_start", config2, null, extraStyle);
          } else {
            this.elt(clazz + " ace_br1 ace_start", "height:" + height + "px;right:0;top:" + top2 + "px;left:" + left + "px;" + (extraStyle || ""));
          }
          if (this.session.$bidiHandler.isBidiRow(range.end.row)) {
            var range1 = range.clone();
            range1.start.row = range1.end.row;
            range1.start.column = 0;
            this.drawBidiSingleLineMarker(stringBuilder, range1, clazz + " ace_br12", config2, null, extraStyle);
          } else {
            top2 = this.$getTop(range.end.row, config2);
            var width = range.end.column * config2.characterWidth;
            this.elt(clazz + " ace_br12", "height:" + height + "px;width:" + width + "px;top:" + top2 + "px;left:" + padding + "px;" + (extraStyle || ""));
          }
          height = (range.end.row - range.start.row - 1) * config2.lineHeight;
          if (height <= 0)
            return;
          top2 = this.$getTop(range.start.row + 1, config2);
          var radiusClass = (range.start.column ? 1 : 0) | (range.end.column ? 0 : 8);
          this.elt(clazz + (radiusClass ? " ace_br" + radiusClass : ""), "height:" + height + "px;right:0;top:" + top2 + "px;left:" + padding + "px;" + (extraStyle || ""));
        };
        Marker2.prototype.drawSingleLineMarker = function(stringBuilder, range, clazz, config2, extraLength, extraStyle) {
          if (this.session.$bidiHandler.isBidiRow(range.start.row))
            return this.drawBidiSingleLineMarker(stringBuilder, range, clazz, config2, extraLength, extraStyle);
          var height = config2.lineHeight;
          var width = (range.end.column + (extraLength || 0) - range.start.column) * config2.characterWidth;
          var top2 = this.$getTop(range.start.row, config2);
          var left = this.$padding + range.start.column * config2.characterWidth;
          this.elt(clazz, "height:" + height + "px;width:" + width + "px;top:" + top2 + "px;left:" + left + "px;" + (extraStyle || ""));
        };
        Marker2.prototype.drawBidiSingleLineMarker = function(stringBuilder, range, clazz, config2, extraLength, extraStyle) {
          var height = config2.lineHeight, top2 = this.$getTop(range.start.row, config2), padding = this.$padding;
          var selections = this.session.$bidiHandler.getSelections(range.start.column, range.end.column);
          selections.forEach(function(selection) {
            this.elt(clazz, "height:" + height + "px;width:" + (selection.width + (extraLength || 0)) + "px;top:" + top2 + "px;left:" + (padding + selection.left) + "px;" + (extraStyle || ""));
          }, this);
        };
        Marker2.prototype.drawFullLineMarker = function(stringBuilder, range, clazz, config2, extraStyle) {
          var top2 = this.$getTop(range.start.row, config2);
          var height = config2.lineHeight;
          if (range.start.row != range.end.row)
            height += this.$getTop(range.end.row, config2) - top2;
          this.elt(clazz, "height:" + height + "px;top:" + top2 + "px;left:0;right:0;" + (extraStyle || ""));
        };
        Marker2.prototype.drawScreenLineMarker = function(stringBuilder, range, clazz, config2, extraStyle) {
          var top2 = this.$getTop(range.start.row, config2);
          var height = config2.lineHeight;
          this.elt(clazz, "height:" + height + "px;top:" + top2 + "px;left:0;right:0;" + (extraStyle || ""));
        };
        return Marker2;
      }();
      Marker.prototype.$padding = 0;
      function getBorderClass(tl, tr, br, bl) {
        return (tl ? 1 : 0) | (tr ? 2 : 0) | (br ? 4 : 0) | (bl ? 8 : 0);
      }
      exports3.Marker = Marker;
    });
    ace.define("ace/layer/text_util", ["require", "exports", "module"], function(require2, exports3, module3) {
      var textTokens = new Set(["text", "rparen", "lparen"]);
      exports3.isTextToken = function(tokenType) {
        return textTokens.has(tokenType);
      };
    });
    ace.define("ace/layer/text", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/layer/lines", "ace/lib/event_emitter", "ace/config", "ace/layer/text_util"], function(require2, exports3, module3) {
      var oop = require2("../lib/oop");
      var dom = require2("../lib/dom");
      var lang = require2("../lib/lang");
      var Lines = require2("./lines").Lines;
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var nls = require2("../config").nls;
      var isTextToken = require2("./text_util").isTextToken;
      var Text2 = function() {
        function Text3(parentEl2) {
          this.dom = dom;
          this.element = this.dom.createElement("div");
          this.element.className = "ace_layer ace_text-layer";
          parentEl2.appendChild(this.element);
          this.$updateEolChar = this.$updateEolChar.bind(this);
          this.$lines = new Lines(this.element);
        }
        Text3.prototype.$updateEolChar = function() {
          var doc2 = this.session.doc;
          var unixMode = doc2.getNewLineCharacter() == "\n" && doc2.getNewLineMode() != "windows";
          var EOL_CHAR = unixMode ? this.EOL_CHAR_LF : this.EOL_CHAR_CRLF;
          if (this.EOL_CHAR != EOL_CHAR) {
            this.EOL_CHAR = EOL_CHAR;
            return true;
          }
        };
        Text3.prototype.setPadding = function(padding) {
          this.$padding = padding;
          this.element.style.margin = "0 " + padding + "px";
        };
        Text3.prototype.getLineHeight = function() {
          return this.$fontMetrics.$characterSize.height || 0;
        };
        Text3.prototype.getCharacterWidth = function() {
          return this.$fontMetrics.$characterSize.width || 0;
        };
        Text3.prototype.$setFontMetrics = function(measure) {
          this.$fontMetrics = measure;
          this.$fontMetrics.on("changeCharacterSize", function(e) {
            this._signal("changeCharacterSize", e);
          }.bind(this));
          this.$pollSizeChanges();
        };
        Text3.prototype.checkForSizeChanges = function() {
          this.$fontMetrics.checkForSizeChanges();
        };
        Text3.prototype.$pollSizeChanges = function() {
          return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();
        };
        Text3.prototype.setSession = function(session) {
          this.session = session;
          if (session)
            this.$computeTabString();
        };
        Text3.prototype.setShowInvisibles = function(showInvisibles) {
          if (this.showInvisibles == showInvisibles)
            return false;
          this.showInvisibles = showInvisibles;
          if (typeof showInvisibles == "string") {
            this.showSpaces = /tab/i.test(showInvisibles);
            this.showTabs = /space/i.test(showInvisibles);
            this.showEOL = /eol/i.test(showInvisibles);
          } else {
            this.showSpaces = this.showTabs = this.showEOL = showInvisibles;
          }
          this.$computeTabString();
          return true;
        };
        Text3.prototype.setDisplayIndentGuides = function(display) {
          if (this.displayIndentGuides == display)
            return false;
          this.displayIndentGuides = display;
          this.$computeTabString();
          return true;
        };
        Text3.prototype.setHighlightIndentGuides = function(highlight) {
          if (this.$highlightIndentGuides === highlight)
            return false;
          this.$highlightIndentGuides = highlight;
          return highlight;
        };
        Text3.prototype.$computeTabString = function() {
          var tabSize = this.session.getTabSize();
          this.tabSize = tabSize;
          var tabStr = this.$tabStrings = [0];
          for (var i2 = 1; i2 < tabSize + 1; i2++) {
            if (this.showTabs) {
              var span = this.dom.createElement("span");
              span.className = "ace_invisible ace_invisible_tab";
              span.textContent = lang.stringRepeat(this.TAB_CHAR, i2);
              tabStr.push(span);
            } else {
              tabStr.push(this.dom.createTextNode(lang.stringRepeat(" ", i2), this.element));
            }
          }
          if (this.displayIndentGuides) {
            this.$indentGuideRe = /\s\S| \t|\t |\s$/;
            var className = "ace_indent-guide";
            var spaceClass = this.showSpaces ? " ace_invisible ace_invisible_space" : "";
            var spaceContent = this.showSpaces ? lang.stringRepeat(this.SPACE_CHAR, this.tabSize) : lang.stringRepeat(" ", this.tabSize);
            var tabClass = this.showTabs ? " ace_invisible ace_invisible_tab" : "";
            var tabContent = this.showTabs ? lang.stringRepeat(this.TAB_CHAR, this.tabSize) : spaceContent;
            var span = this.dom.createElement("span");
            span.className = className + spaceClass;
            span.textContent = spaceContent;
            this.$tabStrings[" "] = span;
            var span = this.dom.createElement("span");
            span.className = className + tabClass;
            span.textContent = tabContent;
            this.$tabStrings["	"] = span;
          }
        };
        Text3.prototype.updateLines = function(config2, firstRow, lastRow) {
          if (this.config.lastRow != config2.lastRow || this.config.firstRow != config2.firstRow) {
            return this.update(config2);
          }
          this.config = config2;
          var first = Math.max(firstRow, config2.firstRow);
          var last = Math.min(lastRow, config2.lastRow);
          var lineElements = this.element.childNodes;
          var lineElementsIdx = 0;
          for (var row = config2.firstRow; row < first; row++) {
            var foldLine = this.session.getFoldLine(row);
            if (foldLine) {
              if (foldLine.containsRow(first)) {
                first = foldLine.start.row;
                break;
              } else {
                row = foldLine.end.row;
              }
            }
            lineElementsIdx++;
          }
          var heightChanged = false;
          var row = first;
          var foldLine = this.session.getNextFoldLine(row);
          var foldStart = foldLine ? foldLine.start.row : Infinity;
          while (true) {
            if (row > foldStart) {
              row = foldLine.end.row + 1;
              foldLine = this.session.getNextFoldLine(row, foldLine);
              foldStart = foldLine ? foldLine.start.row : Infinity;
            }
            if (row > last)
              break;
            var lineElement = lineElements[lineElementsIdx++];
            if (lineElement) {
              this.dom.removeChildren(lineElement);
              this.$renderLine(lineElement, row, row == foldStart ? foldLine : false);
              if (heightChanged)
                lineElement.style.top = this.$lines.computeLineTop(row, config2, this.session) + "px";
              var height = config2.lineHeight * this.session.getRowLength(row) + "px";
              if (lineElement.style.height != height) {
                heightChanged = true;
                lineElement.style.height = height;
              }
            }
            row++;
          }
          if (heightChanged) {
            while (lineElementsIdx < this.$lines.cells.length) {
              var cell = this.$lines.cells[lineElementsIdx++];
              cell.element.style.top = this.$lines.computeLineTop(cell.row, config2, this.session) + "px";
            }
          }
        };
        Text3.prototype.scrollLines = function(config2) {
          var oldConfig = this.config;
          this.config = config2;
          if (this.$lines.pageChanged(oldConfig, config2))
            return this.update(config2);
          this.$lines.moveContainer(config2);
          var lastRow = config2.lastRow;
          var oldLastRow = oldConfig ? oldConfig.lastRow : -1;
          if (!oldConfig || oldLastRow < config2.firstRow)
            return this.update(config2);
          if (lastRow < oldConfig.firstRow)
            return this.update(config2);
          if (!oldConfig || oldConfig.lastRow < config2.firstRow)
            return this.update(config2);
          if (config2.lastRow < oldConfig.firstRow)
            return this.update(config2);
          if (oldConfig.firstRow < config2.firstRow)
            for (var row = this.session.getFoldedRowCount(oldConfig.firstRow, config2.firstRow - 1); row > 0; row--)
              this.$lines.shift();
          if (oldConfig.lastRow > config2.lastRow)
            for (var row = this.session.getFoldedRowCount(config2.lastRow + 1, oldConfig.lastRow); row > 0; row--)
              this.$lines.pop();
          if (config2.firstRow < oldConfig.firstRow) {
            this.$lines.unshift(this.$renderLinesFragment(config2, config2.firstRow, oldConfig.firstRow - 1));
          }
          if (config2.lastRow > oldConfig.lastRow) {
            this.$lines.push(this.$renderLinesFragment(config2, oldConfig.lastRow + 1, config2.lastRow));
          }
          this.$highlightIndentGuide();
        };
        Text3.prototype.$renderLinesFragment = function(config2, firstRow, lastRow) {
          var fragment = [];
          var row = firstRow;
          var foldLine = this.session.getNextFoldLine(row);
          var foldStart = foldLine ? foldLine.start.row : Infinity;
          while (true) {
            if (row > foldStart) {
              row = foldLine.end.row + 1;
              foldLine = this.session.getNextFoldLine(row, foldLine);
              foldStart = foldLine ? foldLine.start.row : Infinity;
            }
            if (row > lastRow)
              break;
            var line = this.$lines.createCell(row, config2, this.session);
            var lineEl = line.element;
            this.dom.removeChildren(lineEl);
            dom.setStyle(lineEl.style, "height", this.$lines.computeLineHeight(row, config2, this.session) + "px");
            dom.setStyle(lineEl.style, "top", this.$lines.computeLineTop(row, config2, this.session) + "px");
            this.$renderLine(lineEl, row, row == foldStart ? foldLine : false);
            if (this.$useLineGroups()) {
              lineEl.className = "ace_line_group";
            } else {
              lineEl.className = "ace_line";
            }
            fragment.push(line);
            row++;
          }
          return fragment;
        };
        Text3.prototype.update = function(config2) {
          this.$lines.moveContainer(config2);
          this.config = config2;
          var firstRow = config2.firstRow;
          var lastRow = config2.lastRow;
          var lines = this.$lines;
          while (lines.getLength())
            lines.pop();
          lines.push(this.$renderLinesFragment(config2, firstRow, lastRow));
        };
        Text3.prototype.$renderToken = function(parent, screenColumn, token, value2) {
          var self2 = this;
          var re = /(\t)|( +)|([\x00-\x1f\x80-\xa0\xad\u1680\u180E\u2000-\u200f\u2028\u2029\u202F\u205F\uFEFF\uFFF9-\uFFFC\u2066\u2067\u2068\u202A\u202B\u202D\u202E\u202C\u2069]+)|(\u3000)|([\u1100-\u115F\u11A3-\u11A7\u11FA-\u11FF\u2329-\u232A\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3001-\u303E\u3041-\u3096\u3099-\u30FF\u3105-\u312D\u3131-\u318E\u3190-\u31BA\u31C0-\u31E3\u31F0-\u321E\u3220-\u3247\u3250-\u32FE\u3300-\u4DBF\u4E00-\uA48C\uA490-\uA4C6\uA960-\uA97C\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFF01-\uFF60\uFFE0-\uFFE6]|[\uD800-\uDBFF][\uDC00-\uDFFF])/g;
          var valueFragment = this.dom.createFragment(this.element);
          var m;
          var i2 = 0;
          while (m = re.exec(value2)) {
            var tab = m[1];
            var simpleSpace = m[2];
            var controlCharacter = m[3];
            var cjkSpace = m[4];
            var cjk = m[5];
            if (!self2.showSpaces && simpleSpace)
              continue;
            var before = i2 != m.index ? value2.slice(i2, m.index) : "";
            i2 = m.index + m[0].length;
            if (before) {
              valueFragment.appendChild(this.dom.createTextNode(before, this.element));
            }
            if (tab) {
              var tabSize = self2.session.getScreenTabSize(screenColumn + m.index);
              valueFragment.appendChild(self2.$tabStrings[tabSize].cloneNode(true));
              screenColumn += tabSize - 1;
            } else if (simpleSpace) {
              if (self2.showSpaces) {
                var span = this.dom.createElement("span");
                span.className = "ace_invisible ace_invisible_space";
                span.textContent = lang.stringRepeat(self2.SPACE_CHAR, simpleSpace.length);
                valueFragment.appendChild(span);
              } else {
                valueFragment.appendChild(this.dom.createTextNode(simpleSpace, this.element));
              }
            } else if (controlCharacter) {
              var span = this.dom.createElement("span");
              span.className = "ace_invisible ace_invisible_space ace_invalid";
              span.textContent = lang.stringRepeat(self2.SPACE_CHAR, controlCharacter.length);
              valueFragment.appendChild(span);
            } else if (cjkSpace) {
              screenColumn += 1;
              var span = this.dom.createElement("span");
              span.style.width = self2.config.characterWidth * 2 + "px";
              span.className = self2.showSpaces ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk";
              span.textContent = self2.showSpaces ? self2.SPACE_CHAR : cjkSpace;
              valueFragment.appendChild(span);
            } else if (cjk) {
              screenColumn += 1;
              var span = this.dom.createElement("span");
              span.style.width = self2.config.characterWidth * 2 + "px";
              span.className = "ace_cjk";
              span.textContent = cjk;
              valueFragment.appendChild(span);
            }
          }
          valueFragment.appendChild(this.dom.createTextNode(i2 ? value2.slice(i2) : value2, this.element));
          if (!isTextToken(token.type)) {
            var classes = "ace_" + token.type.replace(/\./g, " ace_");
            var span = this.dom.createElement("span");
            if (token.type == "fold") {
              span.style.width = token.value.length * this.config.characterWidth + "px";
              span.setAttribute("title", nls("Unfold code"));
            }
            span.className = classes;
            span.appendChild(valueFragment);
            parent.appendChild(span);
          } else {
            parent.appendChild(valueFragment);
          }
          return screenColumn + value2.length;
        };
        Text3.prototype.renderIndentGuide = function(parent, value2, max) {
          var cols = value2.search(this.$indentGuideRe);
          if (cols <= 0 || cols >= max)
            return value2;
          if (value2[0] == " ") {
            cols -= cols % this.tabSize;
            var count = cols / this.tabSize;
            for (var i2 = 0; i2 < count; i2++) {
              parent.appendChild(this.$tabStrings[" "].cloneNode(true));
            }
            this.$highlightIndentGuide();
            return value2.substr(cols);
          } else if (value2[0] == "	") {
            for (var i2 = 0; i2 < cols; i2++) {
              parent.appendChild(this.$tabStrings["	"].cloneNode(true));
            }
            this.$highlightIndentGuide();
            return value2.substr(cols);
          }
          this.$highlightIndentGuide();
          return value2;
        };
        Text3.prototype.$highlightIndentGuide = function() {
          if (!this.$highlightIndentGuides || !this.displayIndentGuides)
            return;
          this.$highlightIndentGuideMarker = {
            indentLevel: void 0,
            start: void 0,
            end: void 0,
            dir: void 0
          };
          var lines = this.session.doc.$lines;
          if (!lines)
            return;
          var cursor = this.session.selection.getCursor();
          var initialIndent = /^\s*/.exec(this.session.doc.getLine(cursor.row))[0].length;
          var elementIndentLevel = Math.floor(initialIndent / this.tabSize);
          this.$highlightIndentGuideMarker = {
            indentLevel: elementIndentLevel,
            start: cursor.row
          };
          var bracketHighlight = this.session.$bracketHighlight;
          if (bracketHighlight) {
            var ranges = this.session.$bracketHighlight.ranges;
            for (var i2 = 0; i2 < ranges.length; i2++) {
              if (cursor.row !== ranges[i2].start.row) {
                this.$highlightIndentGuideMarker.end = ranges[i2].start.row;
                if (cursor.row > ranges[i2].start.row) {
                  this.$highlightIndentGuideMarker.dir = -1;
                } else {
                  this.$highlightIndentGuideMarker.dir = 1;
                }
                break;
              }
            }
          }
          if (!this.$highlightIndentGuideMarker.end) {
            if (lines[cursor.row] !== "" && cursor.column === lines[cursor.row].length) {
              this.$highlightIndentGuideMarker.dir = 1;
              for (var i2 = cursor.row + 1; i2 < lines.length; i2++) {
                var line = lines[i2];
                var currentIndent = /^\s*/.exec(line)[0].length;
                if (line !== "") {
                  this.$highlightIndentGuideMarker.end = i2;
                  if (currentIndent <= initialIndent)
                    break;
                }
              }
            }
          }
          this.$renderHighlightIndentGuide();
        };
        Text3.prototype.$clearActiveIndentGuide = function() {
          var cells = this.$lines.cells;
          for (var i2 = 0; i2 < cells.length; i2++) {
            var cell = cells[i2];
            var childNodes = cell.element.childNodes;
            if (childNodes.length > 0) {
              for (var j = 0; j < childNodes.length; j++) {
                if (childNodes[j].classList && childNodes[j].classList.contains("ace_indent-guide-active")) {
                  childNodes[j].classList.remove("ace_indent-guide-active");
                  break;
                }
              }
            }
          }
        };
        Text3.prototype.$setIndentGuideActive = function(cell, indentLevel) {
          var line = this.session.doc.getLine(cell.row);
          if (line !== "") {
            var childNodes = cell.element.childNodes;
            if (childNodes) {
              var node = childNodes[indentLevel - 1];
              if (node && node.classList && node.classList.contains("ace_indent-guide"))
                node.classList.add("ace_indent-guide-active");
            }
          }
        };
        Text3.prototype.$renderHighlightIndentGuide = function() {
          if (!this.$lines)
            return;
          var cells = this.$lines.cells;
          this.$clearActiveIndentGuide();
          var indentLevel = this.$highlightIndentGuideMarker.indentLevel;
          if (indentLevel !== 0) {
            if (this.$highlightIndentGuideMarker.dir === 1) {
              for (var i2 = 0; i2 < cells.length; i2++) {
                var cell = cells[i2];
                if (this.$highlightIndentGuideMarker.end && cell.row >= this.$highlightIndentGuideMarker.start + 1) {
                  if (cell.row >= this.$highlightIndentGuideMarker.end)
                    break;
                  this.$setIndentGuideActive(cell, indentLevel);
                }
              }
            } else {
              for (var i2 = cells.length - 1; i2 >= 0; i2--) {
                var cell = cells[i2];
                if (this.$highlightIndentGuideMarker.end && cell.row < this.$highlightIndentGuideMarker.start) {
                  if (cell.row <= this.$highlightIndentGuideMarker.end)
                    break;
                  this.$setIndentGuideActive(cell, indentLevel);
                }
              }
            }
          }
        };
        Text3.prototype.$createLineElement = function(parent) {
          var lineEl = this.dom.createElement("div");
          lineEl.className = "ace_line";
          lineEl.style.height = this.config.lineHeight + "px";
          return lineEl;
        };
        Text3.prototype.$renderWrappedLine = function(parent, tokens, splits) {
          var chars = 0;
          var split = 0;
          var splitChars = splits[0];
          var screenColumn = 0;
          var lineEl = this.$createLineElement();
          parent.appendChild(lineEl);
          for (var i2 = 0; i2 < tokens.length; i2++) {
            var token = tokens[i2];
            var value2 = token.value;
            if (i2 == 0 && this.displayIndentGuides) {
              chars = value2.length;
              value2 = this.renderIndentGuide(lineEl, value2, splitChars);
              if (!value2)
                continue;
              chars -= value2.length;
            }
            if (chars + value2.length < splitChars) {
              screenColumn = this.$renderToken(lineEl, screenColumn, token, value2);
              chars += value2.length;
            } else {
              while (chars + value2.length >= splitChars) {
                screenColumn = this.$renderToken(lineEl, screenColumn, token, value2.substring(0, splitChars - chars));
                value2 = value2.substring(splitChars - chars);
                chars = splitChars;
                lineEl = this.$createLineElement();
                parent.appendChild(lineEl);
                lineEl.appendChild(this.dom.createTextNode(lang.stringRepeat("\xA0", splits.indent), this.element));
                split++;
                screenColumn = 0;
                splitChars = splits[split] || Number.MAX_VALUE;
              }
              if (value2.length != 0) {
                chars += value2.length;
                screenColumn = this.$renderToken(lineEl, screenColumn, token, value2);
              }
            }
          }
          if (splits[splits.length - 1] > this.MAX_LINE_LENGTH)
            this.$renderOverflowMessage(lineEl, screenColumn, null, "", true);
        };
        Text3.prototype.$renderSimpleLine = function(parent, tokens) {
          var screenColumn = 0;
          for (var i2 = 0; i2 < tokens.length; i2++) {
            var token = tokens[i2];
            var value2 = token.value;
            if (i2 == 0 && this.displayIndentGuides) {
              value2 = this.renderIndentGuide(parent, value2);
              if (!value2)
                continue;
            }
            if (screenColumn + value2.length > this.MAX_LINE_LENGTH)
              return this.$renderOverflowMessage(parent, screenColumn, token, value2);
            screenColumn = this.$renderToken(parent, screenColumn, token, value2);
          }
        };
        Text3.prototype.$renderOverflowMessage = function(parent, screenColumn, token, value2, hide) {
          token && this.$renderToken(parent, screenColumn, token, value2.slice(0, this.MAX_LINE_LENGTH - screenColumn));
          var overflowEl = this.dom.createElement("span");
          overflowEl.className = "ace_inline_button ace_keyword ace_toggle_wrap";
          overflowEl.textContent = hide ? "<hide>" : "<click to see more...>";
          parent.appendChild(overflowEl);
        };
        Text3.prototype.$renderLine = function(parent, row, foldLine) {
          if (!foldLine && foldLine != false)
            foldLine = this.session.getFoldLine(row);
          if (foldLine)
            var tokens = this.$getFoldLineTokens(row, foldLine);
          else
            var tokens = this.session.getTokens(row);
          var lastLineEl = parent;
          if (tokens.length) {
            var splits = this.session.getRowSplitData(row);
            if (splits && splits.length) {
              this.$renderWrappedLine(parent, tokens, splits);
              var lastLineEl = parent.lastChild;
            } else {
              var lastLineEl = parent;
              if (this.$useLineGroups()) {
                lastLineEl = this.$createLineElement();
                parent.appendChild(lastLineEl);
              }
              this.$renderSimpleLine(lastLineEl, tokens);
            }
          } else if (this.$useLineGroups()) {
            lastLineEl = this.$createLineElement();
            parent.appendChild(lastLineEl);
          }
          if (this.showEOL && lastLineEl) {
            if (foldLine)
              row = foldLine.end.row;
            var invisibleEl = this.dom.createElement("span");
            invisibleEl.className = "ace_invisible ace_invisible_eol";
            invisibleEl.textContent = row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR;
            lastLineEl.appendChild(invisibleEl);
          }
        };
        Text3.prototype.$getFoldLineTokens = function(row, foldLine) {
          var session = this.session;
          var renderTokens = [];
          function addTokens(tokens2, from, to) {
            var idx = 0, col = 0;
            while (col + tokens2[idx].value.length < from) {
              col += tokens2[idx].value.length;
              idx++;
              if (idx == tokens2.length)
                return;
            }
            if (col != from) {
              var value2 = tokens2[idx].value.substring(from - col);
              if (value2.length > to - from)
                value2 = value2.substring(0, to - from);
              renderTokens.push({
                type: tokens2[idx].type,
                value: value2
              });
              col = from + value2.length;
              idx += 1;
            }
            while (col < to && idx < tokens2.length) {
              var value2 = tokens2[idx].value;
              if (value2.length + col > to) {
                renderTokens.push({
                  type: tokens2[idx].type,
                  value: value2.substring(0, to - col)
                });
              } else
                renderTokens.push(tokens2[idx]);
              col += value2.length;
              idx += 1;
            }
          }
          var tokens = session.getTokens(row);
          foldLine.walk(function(placeholder, row2, column, lastColumn, isNewRow) {
            if (placeholder != null) {
              renderTokens.push({
                type: "fold",
                value: placeholder
              });
            } else {
              if (isNewRow)
                tokens = session.getTokens(row2);
              if (tokens.length)
                addTokens(tokens, lastColumn, column);
            }
          }, foldLine.end.row, this.session.getLine(foldLine.end.row).length);
          return renderTokens;
        };
        Text3.prototype.$useLineGroups = function() {
          return this.session.getUseWrapMode();
        };
        return Text3;
      }();
      Text2.prototype.EOF_CHAR = "\xB6";
      Text2.prototype.EOL_CHAR_LF = "\xAC";
      Text2.prototype.EOL_CHAR_CRLF = "\xA4";
      Text2.prototype.EOL_CHAR = Text2.prototype.EOL_CHAR_LF;
      Text2.prototype.TAB_CHAR = "\u2014";
      Text2.prototype.SPACE_CHAR = "\xB7";
      Text2.prototype.$padding = 0;
      Text2.prototype.MAX_LINE_LENGTH = 1e4;
      Text2.prototype.showInvisibles = false;
      Text2.prototype.showSpaces = false;
      Text2.prototype.showTabs = false;
      Text2.prototype.showEOL = false;
      Text2.prototype.displayIndentGuides = true;
      Text2.prototype.$highlightIndentGuides = true;
      Text2.prototype.$tabStrings = [];
      Text2.prototype.destroy = {};
      Text2.prototype.onChangeTabSize = Text2.prototype.$computeTabString;
      oop.implement(Text2.prototype, EventEmitter);
      exports3.Text = Text2;
    });
    ace.define("ace/layer/cursor", ["require", "exports", "module", "ace/lib/dom"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var Cursor = function() {
        function Cursor2(parentEl2) {
          this.element = dom.createElement("div");
          this.element.className = "ace_layer ace_cursor-layer";
          parentEl2.appendChild(this.element);
          this.isVisible = false;
          this.isBlinking = true;
          this.blinkInterval = 1e3;
          this.smoothBlinking = false;
          this.cursors = [];
          this.cursor = this.addCursor();
          dom.addCssClass(this.element, "ace_hidden-cursors");
          this.$updateCursors = this.$updateOpacity.bind(this);
        }
        Cursor2.prototype.$updateOpacity = function(val) {
          var cursors = this.cursors;
          for (var i2 = cursors.length; i2--; )
            dom.setStyle(cursors[i2].style, "opacity", val ? "" : "0");
        };
        Cursor2.prototype.$startCssAnimation = function() {
          var cursors = this.cursors;
          for (var i2 = cursors.length; i2--; )
            cursors[i2].style.animationDuration = this.blinkInterval + "ms";
          this.$isAnimating = true;
          setTimeout(function() {
            if (this.$isAnimating) {
              dom.addCssClass(this.element, "ace_animate-blinking");
            }
          }.bind(this));
        };
        Cursor2.prototype.$stopCssAnimation = function() {
          this.$isAnimating = false;
          dom.removeCssClass(this.element, "ace_animate-blinking");
        };
        Cursor2.prototype.setPadding = function(padding) {
          this.$padding = padding;
        };
        Cursor2.prototype.setSession = function(session) {
          this.session = session;
        };
        Cursor2.prototype.setBlinking = function(blinking) {
          if (blinking != this.isBlinking) {
            this.isBlinking = blinking;
            this.restartTimer();
          }
        };
        Cursor2.prototype.setBlinkInterval = function(blinkInterval) {
          if (blinkInterval != this.blinkInterval) {
            this.blinkInterval = blinkInterval;
            this.restartTimer();
          }
        };
        Cursor2.prototype.setSmoothBlinking = function(smoothBlinking) {
          if (smoothBlinking != this.smoothBlinking) {
            this.smoothBlinking = smoothBlinking;
            dom.setCssClass(this.element, "ace_smooth-blinking", smoothBlinking);
            this.$updateCursors(true);
            this.restartTimer();
          }
        };
        Cursor2.prototype.addCursor = function() {
          var el = dom.createElement("div");
          el.className = "ace_cursor";
          this.element.appendChild(el);
          this.cursors.push(el);
          return el;
        };
        Cursor2.prototype.removeCursor = function() {
          if (this.cursors.length > 1) {
            var el = this.cursors.pop();
            el.parentNode.removeChild(el);
            return el;
          }
        };
        Cursor2.prototype.hideCursor = function() {
          this.isVisible = false;
          dom.addCssClass(this.element, "ace_hidden-cursors");
          this.restartTimer();
        };
        Cursor2.prototype.showCursor = function() {
          this.isVisible = true;
          dom.removeCssClass(this.element, "ace_hidden-cursors");
          this.restartTimer();
        };
        Cursor2.prototype.restartTimer = function() {
          var update = this.$updateCursors;
          clearInterval(this.intervalId);
          clearTimeout(this.timeoutId);
          this.$stopCssAnimation();
          if (this.smoothBlinking) {
            this.$isSmoothBlinking = false;
            dom.removeCssClass(this.element, "ace_smooth-blinking");
          }
          update(true);
          if (!this.isBlinking || !this.blinkInterval || !this.isVisible) {
            this.$stopCssAnimation();
            return;
          }
          if (this.smoothBlinking) {
            this.$isSmoothBlinking = true;
            setTimeout(function() {
              if (this.$isSmoothBlinking) {
                dom.addCssClass(this.element, "ace_smooth-blinking");
              }
            }.bind(this));
          }
          if (dom.HAS_CSS_ANIMATION) {
            this.$startCssAnimation();
          } else {
            var blink = function() {
              this.timeoutId = setTimeout(function() {
                update(false);
              }, 0.6 * this.blinkInterval);
            }.bind(this);
            this.intervalId = setInterval(function() {
              update(true);
              blink();
            }, this.blinkInterval);
            blink();
          }
        };
        Cursor2.prototype.getPixelPosition = function(position, onScreen) {
          if (!this.config || !this.session)
            return { left: 0, top: 0 };
          if (!position)
            position = this.session.selection.getCursor();
          var pos = this.session.documentToScreenPosition(position);
          var cursorLeft = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, position.row) ? this.session.$bidiHandler.getPosLeft(pos.column) : pos.column * this.config.characterWidth);
          var cursorTop = (pos.row - (onScreen ? this.config.firstRowScreen : 0)) * this.config.lineHeight;
          return { left: cursorLeft, top: cursorTop };
        };
        Cursor2.prototype.isCursorInView = function(pixelPos, config2) {
          return pixelPos.top >= 0 && pixelPos.top < config2.maxHeight;
        };
        Cursor2.prototype.update = function(config2) {
          this.config = config2;
          var selections = this.session.$selectionMarkers;
          var i2 = 0, cursorIndex = 0;
          if (selections === void 0 || selections.length === 0) {
            selections = [{ cursor: null }];
          }
          for (var i2 = 0, n = selections.length; i2 < n; i2++) {
            var pixelPos = this.getPixelPosition(selections[i2].cursor, true);
            if ((pixelPos.top > config2.height + config2.offset || pixelPos.top < 0) && i2 > 1) {
              continue;
            }
            var element = this.cursors[cursorIndex++] || this.addCursor();
            var style = element.style;
            if (!this.drawCursor) {
              if (!this.isCursorInView(pixelPos, config2)) {
                dom.setStyle(style, "display", "none");
              } else {
                dom.setStyle(style, "display", "block");
                dom.translate(element, pixelPos.left, pixelPos.top);
                dom.setStyle(style, "width", Math.round(config2.characterWidth) + "px");
                dom.setStyle(style, "height", config2.lineHeight + "px");
              }
            } else {
              this.drawCursor(element, pixelPos, config2, selections[i2], this.session);
            }
          }
          while (this.cursors.length > cursorIndex)
            this.removeCursor();
          var overwrite = this.session.getOverwrite();
          this.$setOverwrite(overwrite);
          this.$pixelPos = pixelPos;
          this.restartTimer();
        };
        Cursor2.prototype.$setOverwrite = function(overwrite) {
          if (overwrite != this.overwrite) {
            this.overwrite = overwrite;
            if (overwrite)
              dom.addCssClass(this.element, "ace_overwrite-cursors");
            else
              dom.removeCssClass(this.element, "ace_overwrite-cursors");
          }
        };
        Cursor2.prototype.destroy = function() {
          clearInterval(this.intervalId);
          clearTimeout(this.timeoutId);
        };
        return Cursor2;
      }();
      Cursor.prototype.$padding = 0;
      Cursor.prototype.drawCursor = null;
      exports3.Cursor = Cursor;
    });
    ace.define("ace/scrollbar", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 oop = require2("./lib/oop");
      var dom = require2("./lib/dom");
      var event = require2("./lib/event");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var MAX_SCROLL_H = 32768;
      var Scrollbar = function() {
        function Scrollbar2(parent, classSuffix) {
          this.element = dom.createElement("div");
          this.element.className = "ace_scrollbar ace_scrollbar" + classSuffix;
          this.inner = dom.createElement("div");
          this.inner.className = "ace_scrollbar-inner";
          this.inner.textContent = "\xA0";
          this.element.appendChild(this.inner);
          parent.appendChild(this.element);
          this.setVisible(false);
          this.skipEvent = false;
          event.addListener(this.element, "scroll", this.onScroll.bind(this));
          event.addListener(this.element, "mousedown", event.preventDefault);
        }
        Scrollbar2.prototype.setVisible = function(isVisible) {
          this.element.style.display = isVisible ? "" : "none";
          this.isVisible = isVisible;
          this.coeff = 1;
        };
        return Scrollbar2;
      }();
      oop.implement(Scrollbar.prototype, EventEmitter);
      var VScrollBar = function(_super) {
        __extends(VScrollBar2, _super);
        function VScrollBar2(parent, renderer) {
          var _this = _super.call(this, parent, "-v") || this;
          _this.scrollTop = 0;
          _this.scrollHeight = 0;
          renderer.$scrollbarWidth = _this.width = dom.scrollbarWidth(parent.ownerDocument);
          _this.inner.style.width = _this.element.style.width = (_this.width || 15) + 5 + "px";
          _this.$minWidth = 0;
          return _this;
        }
        VScrollBar2.prototype.onScroll = function() {
          if (!this.skipEvent) {
            this.scrollTop = this.element.scrollTop;
            if (this.coeff != 1) {
              var h = this.element.clientHeight / this.scrollHeight;
              this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);
            }
            this._emit("scroll", { data: this.scrollTop });
          }
          this.skipEvent = false;
        };
        VScrollBar2.prototype.getWidth = function() {
          return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
        };
        VScrollBar2.prototype.setHeight = function(height) {
          this.element.style.height = height + "px";
        };
        VScrollBar2.prototype.setScrollHeight = function(height) {
          this.scrollHeight = height;
          if (height > MAX_SCROLL_H) {
            this.coeff = MAX_SCROLL_H / height;
            height = MAX_SCROLL_H;
          } else if (this.coeff != 1) {
            this.coeff = 1;
          }
          this.inner.style.height = height + "px";
        };
        VScrollBar2.prototype.setScrollTop = function(scrollTop) {
          if (this.scrollTop != scrollTop) {
            this.skipEvent = true;
            this.scrollTop = scrollTop;
            this.element.scrollTop = scrollTop * this.coeff;
          }
        };
        return VScrollBar2;
      }(Scrollbar);
      VScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;
      var HScrollBar = function(_super) {
        __extends(HScrollBar2, _super);
        function HScrollBar2(parent, renderer) {
          var _this = _super.call(this, parent, "-h") || this;
          _this.scrollLeft = 0;
          _this.height = renderer.$scrollbarWidth;
          _this.inner.style.height = _this.element.style.height = (_this.height || 15) + 5 + "px";
          return _this;
        }
        HScrollBar2.prototype.onScroll = function() {
          if (!this.skipEvent) {
            this.scrollLeft = this.element.scrollLeft;
            this._emit("scroll", { data: this.scrollLeft });
          }
          this.skipEvent = false;
        };
        HScrollBar2.prototype.getHeight = function() {
          return this.isVisible ? this.height : 0;
        };
        HScrollBar2.prototype.setWidth = function(width) {
          this.element.style.width = width + "px";
        };
        HScrollBar2.prototype.setInnerWidth = function(width) {
          this.inner.style.width = width + "px";
        };
        HScrollBar2.prototype.setScrollWidth = function(width) {
          this.inner.style.width = width + "px";
        };
        HScrollBar2.prototype.setScrollLeft = function(scrollLeft) {
          if (this.scrollLeft != scrollLeft) {
            this.skipEvent = true;
            this.scrollLeft = this.element.scrollLeft = scrollLeft;
          }
        };
        return HScrollBar2;
      }(Scrollbar);
      exports3.ScrollBar = VScrollBar;
      exports3.ScrollBarV = VScrollBar;
      exports3.ScrollBarH = HScrollBar;
      exports3.VScrollBar = VScrollBar;
      exports3.HScrollBar = HScrollBar;
    });
    ace.define("ace/scrollbar_custom", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/event", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var __extends = this && this.__extends || 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 oop = require2("./lib/oop");
      var dom = require2("./lib/dom");
      var event = require2("./lib/event");
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      dom.importCssString(".ace_editor>.ace_sb-v div, .ace_editor>.ace_sb-h div{\n  position: absolute;\n  background: rgba(128, 128, 128, 0.6);\n  -moz-box-sizing: border-box;\n  box-sizing: border-box;\n  border: 1px solid #bbb;\n  border-radius: 2px;\n  z-index: 8;\n}\n.ace_editor>.ace_sb-v, .ace_editor>.ace_sb-h {\n  position: absolute;\n  z-index: 6;\n  background: none;\n  overflow: hidden!important;\n}\n.ace_editor>.ace_sb-v {\n  z-index: 6;\n  right: 0;\n  top: 0;\n  width: 12px;\n}\n.ace_editor>.ace_sb-v div {\n  z-index: 8;\n  right: 0;\n  width: 100%;\n}\n.ace_editor>.ace_sb-h {\n  bottom: 0;\n  left: 0;\n  height: 12px;\n}\n.ace_editor>.ace_sb-h div {\n  bottom: 0;\n  height: 100%;\n}\n.ace_editor>.ace_sb_grabbed {\n  z-index: 8;\n  background: #000;\n}", "ace_scrollbar.css", false);
      var ScrollBar = function() {
        function ScrollBar2(parent, classSuffix) {
          this.element = dom.createElement("div");
          this.element.className = "ace_sb" + classSuffix;
          this.inner = dom.createElement("div");
          this.inner.className = "";
          this.element.appendChild(this.inner);
          this.VScrollWidth = 12;
          this.HScrollHeight = 12;
          parent.appendChild(this.element);
          this.setVisible(false);
          this.skipEvent = false;
          event.addMultiMouseDownListener(this.element, [500, 300, 300], this, "onMouseDown");
        }
        ScrollBar2.prototype.setVisible = function(isVisible) {
          this.element.style.display = isVisible ? "" : "none";
          this.isVisible = isVisible;
          this.coeff = 1;
        };
        return ScrollBar2;
      }();
      oop.implement(ScrollBar.prototype, EventEmitter);
      var VScrollBar = function(_super) {
        __extends(VScrollBar2, _super);
        function VScrollBar2(parent, renderer) {
          var _this = _super.call(this, parent, "-v") || this;
          _this.scrollTop = 0;
          _this.scrollHeight = 0;
          _this.parent = parent;
          _this.width = _this.VScrollWidth;
          _this.renderer = renderer;
          _this.inner.style.width = _this.element.style.width = (_this.width || 15) + "px";
          _this.$minWidth = 0;
          return _this;
        }
        VScrollBar2.prototype.onMouseDown = function(eType, e) {
          if (eType !== "mousedown")
            return;
          if (event.getButton(e) !== 0 || e.detail === 2) {
            return;
          }
          if (e.target === this.inner) {
            var self2 = this;
            var mousePageY = e.clientY;
            var onMouseMove = function(e2) {
              mousePageY = e2.clientY;
            };
            var onMouseUp = function() {
              clearInterval(timerId);
            };
            var startY = e.clientY;
            var startTop = this.thumbTop;
            var onScrollInterval = function() {
              if (mousePageY === void 0)
                return;
              var scrollTop = self2.scrollTopFromThumbTop(startTop + mousePageY - startY);
              if (scrollTop === self2.scrollTop)
                return;
              self2._emit("scroll", { data: scrollTop });
            };
            event.capture(this.inner, onMouseMove, onMouseUp);
            var timerId = setInterval(onScrollInterval, 20);
            return event.preventDefault(e);
          }
          var top2 = e.clientY - this.element.getBoundingClientRect().top - this.thumbHeight / 2;
          this._emit("scroll", { data: this.scrollTopFromThumbTop(top2) });
          return event.preventDefault(e);
        };
        VScrollBar2.prototype.getHeight = function() {
          return this.height;
        };
        VScrollBar2.prototype.scrollTopFromThumbTop = function(thumbTop) {
          var scrollTop = thumbTop * (this.pageHeight - this.viewHeight) / (this.slideHeight - this.thumbHeight);
          scrollTop = scrollTop >> 0;
          if (scrollTop < 0) {
            scrollTop = 0;
          } else if (scrollTop > this.pageHeight - this.viewHeight) {
            scrollTop = this.pageHeight - this.viewHeight;
          }
          return scrollTop;
        };
        VScrollBar2.prototype.getWidth = function() {
          return Math.max(this.isVisible ? this.width : 0, this.$minWidth || 0);
        };
        VScrollBar2.prototype.setHeight = function(height) {
          this.height = Math.max(0, height);
          this.slideHeight = this.height;
          this.viewHeight = this.height;
          this.setScrollHeight(this.pageHeight, true);
        };
        VScrollBar2.prototype.setScrollHeight = function(height, force) {
          if (this.pageHeight === height && !force)
            return;
          this.pageHeight = height;
          this.thumbHeight = this.slideHeight * this.viewHeight / this.pageHeight;
          if (this.thumbHeight > this.slideHeight)
            this.thumbHeight = this.slideHeight;
          if (this.thumbHeight < 15)
            this.thumbHeight = 15;
          this.inner.style.height = this.thumbHeight + "px";
          if (this.scrollTop > this.pageHeight - this.viewHeight) {
            this.scrollTop = this.pageHeight - this.viewHeight;
            if (this.scrollTop < 0)
              this.scrollTop = 0;
            this._emit("scroll", { data: this.scrollTop });
          }
        };
        VScrollBar2.prototype.setScrollTop = function(scrollTop) {
          this.scrollTop = scrollTop;
          if (scrollTop < 0)
            scrollTop = 0;
          this.thumbTop = scrollTop * (this.slideHeight - this.thumbHeight) / (this.pageHeight - this.viewHeight);
          this.inner.style.top = this.thumbTop + "px";
        };
        return VScrollBar2;
      }(ScrollBar);
      VScrollBar.prototype.setInnerHeight = VScrollBar.prototype.setScrollHeight;
      var HScrollBar = function(_super) {
        __extends(HScrollBar2, _super);
        function HScrollBar2(parent, renderer) {
          var _this = _super.call(this, parent, "-h") || this;
          _this.scrollLeft = 0;
          _this.scrollWidth = 0;
          _this.height = _this.HScrollHeight;
          _this.inner.style.height = _this.element.style.height = (_this.height || 12) + "px";
          _this.renderer = renderer;
          return _this;
        }
        HScrollBar2.prototype.onMouseDown = function(eType, e) {
          if (eType !== "mousedown")
            return;
          if (event.getButton(e) !== 0 || e.detail === 2) {
            return;
          }
          if (e.target === this.inner) {
            var self2 = this;
            var mousePageX = e.clientX;
            var onMouseMove = function(e2) {
              mousePageX = e2.clientX;
            };
            var onMouseUp = function() {
              clearInterval(timerId);
            };
            var startX = e.clientX;
            var startLeft = this.thumbLeft;
            var onScrollInterval = function() {
              if (mousePageX === void 0)
                return;
              var scrollLeft = self2.scrollLeftFromThumbLeft(startLeft + mousePageX - startX);
              if (scrollLeft === self2.scrollLeft)
                return;
              self2._emit("scroll", { data: scrollLeft });
            };
            event.capture(this.inner, onMouseMove, onMouseUp);
            var timerId = setInterval(onScrollInterval, 20);
            return event.preventDefault(e);
          }
          var left = e.clientX - this.element.getBoundingClientRect().left - this.thumbWidth / 2;
          this._emit("scroll", { data: this.scrollLeftFromThumbLeft(left) });
          return event.preventDefault(e);
        };
        HScrollBar2.prototype.getHeight = function() {
          return this.isVisible ? this.height : 0;
        };
        HScrollBar2.prototype.scrollLeftFromThumbLeft = function(thumbLeft) {
          var scrollLeft = thumbLeft * (this.pageWidth - this.viewWidth) / (this.slideWidth - this.thumbWidth);
          scrollLeft = scrollLeft >> 0;
          if (scrollLeft < 0) {
            scrollLeft = 0;
          } else if (scrollLeft > this.pageWidth - this.viewWidth) {
            scrollLeft = this.pageWidth - this.viewWidth;
          }
          return scrollLeft;
        };
        HScrollBar2.prototype.setWidth = function(width) {
          this.width = Math.max(0, width);
          this.element.style.width = this.width + "px";
          this.slideWidth = this.width;
          this.viewWidth = this.width;
          this.setScrollWidth(this.pageWidth, true);
        };
        HScrollBar2.prototype.setScrollWidth = function(width, force) {
          if (this.pageWidth === width && !force)
            return;
          this.pageWidth = width;
          this.thumbWidth = this.slideWidth * this.viewWidth / this.pageWidth;
          if (this.thumbWidth > this.slideWidth)
            this.thumbWidth = this.slideWidth;
          if (this.thumbWidth < 15)
            this.thumbWidth = 15;
          this.inner.style.width = this.thumbWidth + "px";
          if (this.scrollLeft > this.pageWidth - this.viewWidth) {
            this.scrollLeft = this.pageWidth - this.viewWidth;
            if (this.scrollLeft < 0)
              this.scrollLeft = 0;
            this._emit("scroll", { data: this.scrollLeft });
          }
        };
        HScrollBar2.prototype.setScrollLeft = function(scrollLeft) {
          this.scrollLeft = scrollLeft;
          if (scrollLeft < 0)
            scrollLeft = 0;
          this.thumbLeft = scrollLeft * (this.slideWidth - this.thumbWidth) / (this.pageWidth - this.viewWidth);
          this.inner.style.left = this.thumbLeft + "px";
        };
        return HScrollBar2;
      }(ScrollBar);
      HScrollBar.prototype.setInnerWidth = HScrollBar.prototype.setScrollWidth;
      exports3.ScrollBar = VScrollBar;
      exports3.ScrollBarV = VScrollBar;
      exports3.ScrollBarH = HScrollBar;
      exports3.VScrollBar = VScrollBar;
      exports3.HScrollBar = HScrollBar;
    });
    ace.define("ace/renderloop", ["require", "exports", "module", "ace/lib/event"], function(require2, exports3, module3) {
      var event = require2("./lib/event");
      var RenderLoop = function() {
        function RenderLoop2(onRender, win) {
          this.onRender = onRender;
          this.pending = false;
          this.changes = 0;
          this.$recursionLimit = 2;
          this.window = win || window;
          var _self = this;
          this._flush = function(ts) {
            _self.pending = false;
            var changes = _self.changes;
            if (changes) {
              event.blockIdle(100);
              _self.changes = 0;
              _self.onRender(changes);
            }
            if (_self.changes) {
              if (_self.$recursionLimit-- < 0)
                return;
              _self.schedule();
            } else {
              _self.$recursionLimit = 2;
            }
          };
        }
        RenderLoop2.prototype.schedule = function(change) {
          this.changes = this.changes | change;
          if (this.changes && !this.pending) {
            event.nextFrame(this._flush);
            this.pending = true;
          }
        };
        RenderLoop2.prototype.clear = function(change) {
          var changes = this.changes;
          this.changes = 0;
          return changes;
        };
        return RenderLoop2;
      }();
      exports3.RenderLoop = RenderLoop;
    });
    ace.define("ace/layer/font_metrics", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/lib/event", "ace/lib/useragent", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var oop = require2("../lib/oop");
      var dom = require2("../lib/dom");
      var lang = require2("../lib/lang");
      var event = require2("../lib/event");
      var useragent = require2("../lib/useragent");
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var CHAR_COUNT = 512;
      var USE_OBSERVER = typeof ResizeObserver == "function";
      var L = 200;
      var FontMetrics = function() {
        function FontMetrics2(parentEl2) {
          this.el = dom.createElement("div");
          this.$setMeasureNodeStyles(this.el.style, true);
          this.$main = dom.createElement("div");
          this.$setMeasureNodeStyles(this.$main.style);
          this.$measureNode = dom.createElement("div");
          this.$setMeasureNodeStyles(this.$measureNode.style);
          this.el.appendChild(this.$main);
          this.el.appendChild(this.$measureNode);
          parentEl2.appendChild(this.el);
          this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT);
          this.$characterSize = { width: 0, height: 0 };
          if (USE_OBSERVER)
            this.$addObserver();
          else
            this.checkForSizeChanges();
        }
        FontMetrics2.prototype.$setMeasureNodeStyles = function(style, isRoot) {
          style.width = style.height = "auto";
          style.left = style.top = "0px";
          style.visibility = "hidden";
          style.position = "absolute";
          style.whiteSpace = "pre";
          if (useragent.isIE < 8) {
            style["font-family"] = "inherit";
          } else {
            style.font = "inherit";
          }
          style.overflow = isRoot ? "hidden" : "visible";
        };
        FontMetrics2.prototype.checkForSizeChanges = function(size) {
          if (size === void 0)
            size = this.$measureSizes();
          if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {
            this.$measureNode.style.fontWeight = "bold";
            var boldSize = this.$measureSizes();
            this.$measureNode.style.fontWeight = "";
            this.$characterSize = size;
            this.charSizes = Object.create(null);
            this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;
            this._emit("changeCharacterSize", { data: size });
          }
        };
        FontMetrics2.prototype.$addObserver = function() {
          var self2 = this;
          this.$observer = new window.ResizeObserver(function(e) {
            self2.checkForSizeChanges();
          });
          this.$observer.observe(this.$measureNode);
        };
        FontMetrics2.prototype.$pollSizeChanges = function() {
          if (this.$pollSizeChangesTimer || this.$observer)
            return this.$pollSizeChangesTimer;
          var self2 = this;
          return this.$pollSizeChangesTimer = event.onIdle(function cb() {
            self2.checkForSizeChanges();
            event.onIdle(cb, 500);
          }, 500);
        };
        FontMetrics2.prototype.setPolling = function(val) {
          if (val) {
            this.$pollSizeChanges();
          } else if (this.$pollSizeChangesTimer) {
            clearInterval(this.$pollSizeChangesTimer);
            this.$pollSizeChangesTimer = 0;
          }
        };
        FontMetrics2.prototype.$measureSizes = function(node) {
          var size = {
            height: (node || this.$measureNode).clientHeight,
            width: (node || this.$measureNode).clientWidth / CHAR_COUNT
          };
          if (size.width === 0 || size.height === 0)
            return null;
          return size;
        };
        FontMetrics2.prototype.$measureCharWidth = function(ch) {
          this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT);
          var rect = this.$main.getBoundingClientRect();
          return rect.width / CHAR_COUNT;
        };
        FontMetrics2.prototype.getCharacterWidth = function(ch) {
          var w = this.charSizes[ch];
          if (w === void 0) {
            w = this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;
          }
          return w;
        };
        FontMetrics2.prototype.destroy = function() {
          clearInterval(this.$pollSizeChangesTimer);
          if (this.$observer)
            this.$observer.disconnect();
          if (this.el && this.el.parentNode)
            this.el.parentNode.removeChild(this.el);
        };
        FontMetrics2.prototype.$getZoom = function(element) {
          if (!element || !element.parentElement)
            return 1;
          return (window.getComputedStyle(element).zoom || 1) * this.$getZoom(element.parentElement);
        };
        FontMetrics2.prototype.$initTransformMeasureNodes = function() {
          var t2 = function(t3, l) {
            return ["div", {
              style: "position: absolute;top:" + t3 + "px;left:" + l + "px;"
            }];
          };
          this.els = dom.buildDom([t2(0, 0), t2(L, 0), t2(0, L), t2(L, L)], this.el);
        };
        FontMetrics2.prototype.transformCoordinates = function(clientPos, elPos) {
          if (clientPos) {
            var zoom = this.$getZoom(this.el);
            clientPos = mul(1 / zoom, clientPos);
          }
          function solve(l1, l2, r) {
            var det = l1[1] * l2[0] - l1[0] * l2[1];
            return [
              (-l2[1] * r[0] + l2[0] * r[1]) / det,
              (+l1[1] * r[0] - l1[0] * r[1]) / det
            ];
          }
          function sub(a2, b2) {
            return [a2[0] - b2[0], a2[1] - b2[1]];
          }
          function add2(a2, b2) {
            return [a2[0] + b2[0], a2[1] + b2[1]];
          }
          function mul(a2, b2) {
            return [a2 * b2[0], a2 * b2[1]];
          }
          if (!this.els)
            this.$initTransformMeasureNodes();
          function p(el) {
            var r = el.getBoundingClientRect();
            return [r.left, r.top];
          }
          var a = p(this.els[0]);
          var b = p(this.els[1]);
          var c = p(this.els[2]);
          var d = p(this.els[3]);
          var h = solve(sub(d, b), sub(d, c), sub(add2(b, c), add2(d, a)));
          var m1 = mul(1 + h[0], sub(b, a));
          var m2 = mul(1 + h[1], sub(c, a));
          if (elPos) {
            var x = elPos;
            var k = h[0] * x[0] / L + h[1] * x[1] / L + 1;
            var ut = add2(mul(x[0], m1), mul(x[1], m2));
            return add2(mul(1 / k / L, ut), a);
          }
          var u = sub(clientPos, a);
          var f = solve(sub(m1, mul(h[0], u)), sub(m2, mul(h[1], u)), u);
          return mul(L, f);
        };
        return FontMetrics2;
      }();
      FontMetrics.prototype.$characterSize = { width: 0, height: 0 };
      oop.implement(FontMetrics.prototype, EventEmitter);
      exports3.FontMetrics = FontMetrics;
    });
    ace.define("ace/css/editor-css", ["require", "exports", "module"], function(require2, exports3, module3) {
      module3.exports = `
.ace_br1 {border-top-left-radius    : 3px;}
.ace_br2 {border-top-right-radius   : 3px;}
.ace_br3 {border-top-left-radius    : 3px; border-top-right-radius:    3px;}
.ace_br4 {border-bottom-right-radius: 3px;}
.ace_br5 {border-top-left-radius    : 3px; border-bottom-right-radius: 3px;}
.ace_br6 {border-top-right-radius   : 3px; border-bottom-right-radius: 3px;}
.ace_br7 {border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px;}
.ace_br8 {border-bottom-left-radius : 3px;}
.ace_br9 {border-top-left-radius    : 3px; border-bottom-left-radius:  3px;}
.ace_br10{border-top-right-radius   : 3px; border-bottom-left-radius:  3px;}
.ace_br11{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-left-radius:  3px;}
.ace_br12{border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}
.ace_br13{border-top-left-radius    : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}
.ace_br14{border-top-right-radius   : 3px; border-bottom-right-radius: 3px; border-bottom-left-radius:  3px;}
.ace_br15{border-top-left-radius    : 3px; border-top-right-radius:    3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;}


.ace_editor {
    position: relative;
    overflow: hidden;
    padding: 0;
    font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'Source Code Pro', 'source-code-pro', monospace;
    direction: ltr;
    text-align: left;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.ace_scroller {
    position: absolute;
    overflow: hidden;
    top: 0;
    bottom: 0;
    background-color: inherit;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: text;
}

.ace_content {
    position: absolute;
    box-sizing: border-box;
    min-width: 100%;
    contain: style size layout;
    font-variant-ligatures: no-common-ligatures;
}

.ace_keyboard-focus:focus {
    box-shadow: inset 0 0 0 2px #5E9ED6;
    outline: none;
}

.ace_dragging .ace_scroller:before{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    content: '';
    background: rgba(250, 250, 250, 0.01);
    z-index: 1000;
}
.ace_dragging.ace_dark .ace_scroller:before{
    background: rgba(0, 0, 0, 0.01);
}

.ace_gutter {
    position: absolute;
    overflow : hidden;
    width: auto;
    top: 0;
    bottom: 0;
    left: 0;
    cursor: default;
    z-index: 4;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    contain: style size layout;
}

.ace_gutter-active-line {
    position: absolute;
    left: 0;
    right: 0;
}

.ace_scroller.ace_scroll-left:after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
    pointer-events: none;
}

.ace_gutter-cell, .ace_gutter-cell_svg-icons {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding-left: 19px;
    padding-right: 6px;
    background-repeat: no-repeat;
}

.ace_gutter-cell_svg-icons .ace_gutter_annotation {
    margin-left: -14px;
    float: left;
}

.ace_gutter-cell .ace_gutter_annotation {
    margin-left: -19px;
    float: left;
}

.ace_gutter-cell.ace_error, .ace_icon.ace_error, .ace_icon.ace_error_fold {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAABOFBMVEX/////////QRswFAb/Ui4wFAYwFAYwFAaWGAfDRymzOSH/PxswFAb/SiUwFAYwFAbUPRvjQiDllog5HhHdRybsTi3/Tyv9Tir+Syj/UC3////XurebMBIwFAb/RSHbPx/gUzfdwL3kzMivKBAwFAbbvbnhPx66NhowFAYwFAaZJg8wFAaxKBDZurf/RB6mMxb/SCMwFAYwFAbxQB3+RB4wFAb/Qhy4Oh+4QifbNRcwFAYwFAYwFAb/QRzdNhgwFAYwFAbav7v/Uy7oaE68MBK5LxLewr/r2NXewLswFAaxJw4wFAbkPRy2PyYwFAaxKhLm1tMwFAazPiQwFAaUGAb/QBrfOx3bvrv/VC/maE4wFAbRPBq6MRO8Qynew8Dp2tjfwb0wFAbx6eju5+by6uns4uH9/f36+vr/GkHjAAAAYnRSTlMAGt+64rnWu/bo8eAA4InH3+DwoN7j4eLi4xP99Nfg4+b+/u9B/eDs1MD1mO7+4PHg2MXa347g7vDizMLN4eG+Pv7i5evs/v79yu7S3/DV7/498Yv24eH+4ufQ3Ozu/v7+y13sRqwAAADLSURBVHjaZc/XDsFgGIBhtDrshlitmk2IrbHFqL2pvXf/+78DPokj7+Fz9qpU/9UXJIlhmPaTaQ6QPaz0mm+5gwkgovcV6GZzd5JtCQwgsxoHOvJO15kleRLAnMgHFIESUEPmawB9ngmelTtipwwfASilxOLyiV5UVUyVAfbG0cCPHig+GBkzAENHS0AstVF6bacZIOzgLmxsHbt2OecNgJC83JERmePUYq8ARGkJx6XtFsdddBQgZE2nPR6CICZhawjA4Fb/chv+399kfR+MMMDGOQAAAABJRU5ErkJggg==");
    background-repeat: no-repeat;
    background-position: 2px center;
}

.ace_gutter-cell.ace_warning, .ace_icon.ace_warning, .ace_icon.ace_warning_fold {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAmVBMVEX///8AAAD///8AAAAAAABPSzb/5sAAAAB/blH/73z/ulkAAAAAAAD85pkAAAAAAAACAgP/vGz/rkDerGbGrV7/pkQICAf////e0IsAAAD/oED/qTvhrnUAAAD/yHD/njcAAADuv2r/nz//oTj/p064oGf/zHAAAAA9Nir/tFIAAAD/tlTiuWf/tkIAAACynXEAAAAAAAAtIRW7zBpBAAAAM3RSTlMAABR1m7RXO8Ln31Z36zT+neXe5OzooRDfn+TZ4p3h2hTf4t3k3ucyrN1K5+Xaks52Sfs9CXgrAAAAjklEQVR42o3PbQ+CIBQFYEwboPhSYgoYunIqqLn6/z8uYdH8Vmdnu9vz4WwXgN/xTPRD2+sgOcZjsge/whXZgUaYYvT8QnuJaUrjrHUQreGczuEafQCO/SJTufTbroWsPgsllVhq3wJEk2jUSzX3CUEDJC84707djRc5MTAQxoLgupWRwW6UB5fS++NV8AbOZgnsC7BpEAAAAABJRU5ErkJggg==");
    background-repeat: no-repeat;
    background-position: 2px center;
}

.ace_gutter-cell.ace_info, .ace_icon.ace_info {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAAAAAA6mKC9AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAJ0Uk5TAAB2k804AAAAPklEQVQY02NgIB68QuO3tiLznjAwpKTgNyDbMegwisCHZUETUZV0ZqOquBpXj2rtnpSJT1AEnnRmL2OgGgAAIKkRQap2htgAAAAASUVORK5CYII=");
    background-repeat: no-repeat;
    background-position: 2px center;
}
.ace_dark .ace_gutter-cell.ace_info, .ace_dark .ace_icon.ace_info {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQBAMAAADt3eJSAAAAJFBMVEUAAAChoaGAgIAqKiq+vr6tra1ZWVmUlJSbm5s8PDxubm56enrdgzg3AAAAAXRSTlMAQObYZgAAAClJREFUeNpjYMAPdsMYHegyJZFQBlsUlMFVCWUYKkAZMxZAGdxlDMQBAG+TBP4B6RyJAAAAAElFTkSuQmCC");
}

.ace_icon_svg.ace_error {
    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJyZWQiIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIj4KPGNpcmNsZSBmaWxsPSJub25lIiBjeD0iOCIgY3k9IjgiIHI9IjciIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPGxpbmUgeDE9IjExIiB5MT0iNSIgeDI9IjUiIHkyPSIxMSIvPgo8bGluZSB4MT0iMTEiIHkxPSIxMSIgeDI9IjUiIHkyPSI1Ii8+CjwvZz4KPC9zdmc+");
    background-color: crimson;
}
.ace_icon_svg.ace_warning {
    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJkYXJrb3JhbmdlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+Cjxwb2x5Z29uIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGZpbGw9Im5vbmUiIHBvaW50cz0iOCAxIDE1IDE1IDEgMTUgOCAxIi8+CjxyZWN0IHg9IjgiIHk9IjEyIiB3aWR0aD0iMC4wMSIgaGVpZ2h0PSIwLjAxIi8+CjxsaW5lIHgxPSI4IiB5MT0iNiIgeDI9IjgiIHkyPSIxMCIvPgo8L2c+Cjwvc3ZnPg==");
    background-color: darkorange;
}
.ace_icon_svg.ace_info {
    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiI+CjxnIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlPSJibHVlIiBzaGFwZS1yZW5kZXJpbmc9Imdlb21ldHJpY1ByZWNpc2lvbiI+CjxjaXJjbGUgZmlsbD0ibm9uZSIgY3g9IjgiIGN5PSI4IiByPSI3IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjxwb2x5bGluZSBwb2ludHM9IjggMTEgOCA4Ii8+Cjxwb2x5bGluZSBwb2ludHM9IjkgOCA2IDgiLz4KPGxpbmUgeDE9IjEwIiB5MT0iMTEiIHgyPSI2IiB5Mj0iMTEiLz4KPHJlY3QgeD0iOCIgeT0iNSIgd2lkdGg9IjAuMDEiIGhlaWdodD0iMC4wMSIvPgo8L2c+Cjwvc3ZnPg==");
    background-color: royalblue;
}

.ace_icon_svg.ace_error_fold {
    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSI+CiAgPHBhdGggZD0ibSAxOC45Mjk4NTEsNy44Mjk4MDc2IGMgMC4xNDYzNTMsNi4zMzc0NjA0IC02LjMyMzE0Nyw3Ljc3Nzg0NDQgLTcuNDc3OTEyLDcuNzc3ODQ0NCAtMi4xMDcyNzI2LC0wLjEyODc1IDUuMTE3Njc4LDAuMzU2MjQ5IDUuMDUxNjk4LC03Ljg3MDA2MTggLTAuNjA0NjcyLC04LjAwMzk3MzQ5IC03LjA3NzI3MDYsLTcuNTYzMTE4OSAtNC44NTczLC03LjQzMDM5NTU2IDEuNjA2LC0wLjExNTE0MjI1IDYuODk3NDg1LDEuMjYyNTQ1OTYgNy4yODM1MTQsNy41MjI2MTI5NiB6IiBmaWxsPSJjcmltc29uIiBzdHJva2Utd2lkdGg9IjIiLz4KICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibSA4LjExNDc1NjIsMi4wNTI5ODI4IGMgMy4zNDkxNjk4LDAgNi4wNjQxMzI4LDIuNjc2ODYyNyA2LjA2NDEzMjgsNS45Nzg5NTMgMCwzLjMwMjExMjIgLTIuNzE0OTYzLDUuOTc4OTIwMiAtNi4wNjQxMzI4LDUuOTc4OTIwMiAtMy4zNDkxNDczLDAgLTYuMDY0MTc3MiwtMi42NzY4MDggLTYuMDY0MTc3MiwtNS45Nzg5MjAyIDAuMDA1MzksLTMuMjk5ODg2MSAyLjcxNzI2NTYsLTUuOTczNjQwOCA2LjA2NDE3NzIsLTUuOTc4OTUzIHogbSAwLC0xLjczNTgyNzE5IGMgLTQuMzIxNDgzNiwwIC03LjgyNDc0MDM4LDMuNDU0MDE4NDkgLTcuODI0NzQwMzgsNy43MTQ3ODAxOSAwLDQuMjYwNzI4MiAzLjUwMzI1Njc4LDcuNzE0NzQ1MiA3LjgyNDc0MDM4LDcuNzE0NzQ1MiA0LjMyMTQ0OTgsMCA3LjgyNDY5OTgsLTMuNDU0MDE3IDcuODI0Njk5OCwtNy43MTQ3NDUyIDAsLTIuMDQ2MDkxNCAtMC44MjQzOTIsLTQuMDA4MzY3MiAtMi4yOTE3NTYsLTUuNDU1MTc0NiBDIDEyLjE4MDIyNSwxLjEyOTk2NDggMTAuMTkwMDEzLDAuMzE3MTU1NjEgOC4xMTQ3NTYyLDAuMzE3MTU1NjEgWiBNIDYuOTM3NDU2Myw4LjI0MDU5ODUgNC42NzE4Njg1LDEwLjQ4NTg1MiA2LjAwODY4MTQsMTEuODc2NzI4IDguMzE3MDAzNSw5LjYwMDc5MTEgMTAuNjI1MzM3LDExLjg3NjcyOCAxMS45NjIxMzgsMTAuNDg1ODUyIDkuNjk2NTUwOCw4LjI0MDU5ODUgMTEuOTYyMTM4LDYuMDA2ODA2NiAxMC41NzMyNDYsNC42Mzc0MzM1IDguMzE3MDAzNSw2Ljg3MzQyOTcgNi4wNjA3NjA3LDQuNjM3NDMzNSA0LjY3MTg2ODUsNi4wMDY4MDY2IFoiIGZpbGw9ImNyaW1zb24iIHN0cm9rZS13aWR0aD0iMiIvPgo8L3N2Zz4=");
    background-color: crimson;
}
.ace_icon_svg.ace_warning_fold {
    -webkit-mask-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAyMCAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNC43NzY5IDE0LjczMzdMOC42NTE5MiAyLjQ4MzY5QzguMzI5NDYgMS44Mzg3NyA3LjQwOTEzIDEuODM4NzcgNy4wODY2NyAyLjQ4MzY5TDAuOTYxNjY5IDE0LjczMzdDMC42NzA3NzUgMTUuMzE1NSAxLjA5MzgzIDE2IDEuNzQ0MjkgMTZIMTMuOTk0M0MxNC42NDQ4IDE2IDE1LjA2NzggMTUuMzE1NSAxNC43NzY5IDE0LjczMzdaTTMuMTYwMDcgMTQuMjVMNy44NjkyOSA0LjgzMTU2TDEyLjU3ODUgMTQuMjVIMy4xNjAwN1pNOC43NDQyOSAxMS42MjVWMTMuMzc1SDYuOTk0MjlWMTEuNjI1SDguNzQ0MjlaTTYuOTk0MjkgMTAuNzVWNy4yNUg4Ljc0NDI5VjEwLjc1SDYuOTk0MjlaIiBmaWxsPSIjRUM3MjExIi8+CjxwYXRoIGQ9Ik0xMS4xOTkxIDIuOTUyMzhDMTAuODgwOSAyLjMxNDY3IDEwLjM1MzcgMS44MDUyNiA5LjcwNTUgMS41MDlMMTEuMDQxIDEuMDY5NzhDMTEuNjg4MyAwLjk0OTgxNCAxMi4zMzcgMS4yNzI2MyAxMi42MzE3IDEuODYxNDFMMTcuNjEzNiAxMS44MTYxQzE4LjM1MjcgMTMuMjkyOSAxNy41OTM4IDE1LjA4MDQgMTYuMDE4IDE1LjU3NDVDMTYuNDA0NCAxNC40NTA3IDE2LjMyMzEgMTMuMjE4OCAxNS43OTI0IDEyLjE1NTVMMTEuMTk5MSAyLjk1MjM4WiIgZmlsbD0iI0VDNzIxMSIvPgo8L3N2Zz4=");
    background-color: darkorange;
}

.ace_scrollbar {
    contain: strict;
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 6;
}

.ace_scrollbar-inner {
    position: absolute;
    cursor: text;
    left: 0;
    top: 0;
}

.ace_scrollbar-v{
    overflow-x: hidden;
    overflow-y: scroll;
    top: 0;
}

.ace_scrollbar-h {
    overflow-x: scroll;
    overflow-y: hidden;
    left: 0;
}

.ace_print-margin {
    position: absolute;
    height: 100%;
}

.ace_text-input {
    position: absolute;
    z-index: 0;
    width: 0.5em;
    height: 1em;
    opacity: 0;
    background: transparent;
    -moz-appearance: none;
    appearance: none;
    border: none;
    resize: none;
    outline: none;
    overflow: hidden;
    font: inherit;
    padding: 0 1px;
    margin: 0 -1px;
    contain: strict;
    -ms-user-select: text;
    -moz-user-select: text;
    -webkit-user-select: text;
    user-select: text;
    /*with \`pre-line\` chrome inserts &nbsp; instead of space*/
    white-space: pre!important;
}
.ace_text-input.ace_composition {
    background: transparent;
    color: inherit;
    z-index: 1000;
    opacity: 1;
}
.ace_composition_placeholder { color: transparent }
.ace_composition_marker { 
    border-bottom: 1px solid;
    position: absolute;
    border-radius: 0;
    margin-top: 1px;
}

[ace_nocontext=true] {
    transform: none!important;
    filter: none!important;
    clip-path: none!important;
    mask : none!important;
    contain: none!important;
    perspective: none!important;
    mix-blend-mode: initial!important;
    z-index: auto;
}

.ace_layer {
    z-index: 1;
    position: absolute;
    overflow: hidden;
    /* workaround for chrome bug https://github.com/ajaxorg/ace/issues/2312*/
    word-wrap: normal;
    white-space: pre;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    /* setting pointer-events: auto; on node under the mouse, which changes
        during scroll, will break mouse wheel scrolling in Safari */
    pointer-events: none;
}

.ace_gutter-layer {
    position: relative;
    width: auto;
    text-align: right;
    pointer-events: auto;
    height: 1000000px;
    contain: style size layout;
}

.ace_text-layer {
    font: inherit !important;
    position: absolute;
    height: 1000000px;
    width: 1000000px;
    contain: style size layout;
}

.ace_text-layer > .ace_line, .ace_text-layer > .ace_line_group {
    contain: style size layout;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.ace_hidpi .ace_text-layer,
.ace_hidpi .ace_gutter-layer,
.ace_hidpi .ace_content,
.ace_hidpi .ace_gutter {
    contain: strict;
}
.ace_hidpi .ace_text-layer > .ace_line, 
.ace_hidpi .ace_text-layer > .ace_line_group {
    contain: strict;
}

.ace_cjk {
    display: inline-block;
    text-align: center;
}

.ace_cursor-layer {
    z-index: 4;
}

.ace_cursor {
    z-index: 4;
    position: absolute;
    box-sizing: border-box;
    border-left: 2px solid;
    /* workaround for smooth cursor repaintng whole screen in chrome */
    transform: translatez(0);
}

.ace_multiselect .ace_cursor {
    border-left-width: 1px;
}

.ace_slim-cursors .ace_cursor {
    border-left-width: 1px;
}

.ace_overwrite-cursors .ace_cursor {
    border-left-width: 0;
    border-bottom: 1px solid;
}

.ace_hidden-cursors .ace_cursor {
    opacity: 0.2;
}

.ace_hasPlaceholder .ace_hidden-cursors .ace_cursor {
    opacity: 0;
}

.ace_smooth-blinking .ace_cursor {
    transition: opacity 0.18s;
}

.ace_animate-blinking .ace_cursor {
    animation-duration: 1000ms;
    animation-timing-function: step-end;
    animation-name: blink-ace-animate;
    animation-iteration-count: infinite;
}

.ace_animate-blinking.ace_smooth-blinking .ace_cursor {
    animation-duration: 1000ms;
    animation-timing-function: ease-in-out;
    animation-name: blink-ace-animate-smooth;
}
    
@keyframes blink-ace-animate {
    from, to { opacity: 1; }
    60% { opacity: 0; }
}

@keyframes blink-ace-animate-smooth {
    from, to { opacity: 1; }
    45% { opacity: 1; }
    60% { opacity: 0; }
    85% { opacity: 0; }
}

.ace_marker-layer .ace_step, .ace_marker-layer .ace_stack {
    position: absolute;
    z-index: 3;
}

.ace_marker-layer .ace_selection {
    position: absolute;
    z-index: 5;
}

.ace_marker-layer .ace_bracket {
    position: absolute;
    z-index: 6;
}

.ace_marker-layer .ace_error_bracket {
    position: absolute;
    border-bottom: 1px solid #DE5555;
    border-radius: 0;
}

.ace_marker-layer .ace_active-line {
    position: absolute;
    z-index: 2;
}

.ace_marker-layer .ace_selected-word {
    position: absolute;
    z-index: 4;
    box-sizing: border-box;
}

.ace_line .ace_fold {
    box-sizing: border-box;

    display: inline-block;
    height: 11px;
    margin-top: -2px;
    vertical-align: middle;

    background-image:
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACJJREFUeNpi+P//fxgTAwPDBxDxD078RSX+YeEyDFMCIMAAI3INmXiwf2YAAAAASUVORK5CYII=");
    background-repeat: no-repeat, repeat-x;
    background-position: center center, top left;
    color: transparent;

    border: 1px solid black;
    border-radius: 2px;

    cursor: pointer;
    pointer-events: auto;
}

.ace_dark .ace_fold {
}

.ace_fold:hover{
    background-image:
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAJCAYAAADU6McMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJpJREFUeNpi/P//PwOlgAXGYGRklAVSokD8GmjwY1wasKljQpYACtpCFeADcHVQfQyMQAwzwAZI3wJKvCLkfKBaMSClBlR7BOQikCFGQEErIH0VqkabiGCAqwUadAzZJRxQr/0gwiXIal8zQQPnNVTgJ1TdawL0T5gBIP1MUJNhBv2HKoQHHjqNrA4WO4zY0glyNKLT2KIfIMAAQsdgGiXvgnYAAAAASUVORK5CYII="),
        url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAA3CAYAAADNNiA5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAACBJREFUeNpi+P//fz4TAwPDZxDxD5X4i5fLMEwJgAADAEPVDbjNw87ZAAAAAElFTkSuQmCC");
}

.ace_tooltip {
    background-color: #f5f5f5;
    border: 1px solid gray;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    color: black;
    max-width: 100%;
    padding: 3px 4px;
    position: fixed;
    z-index: 999999;
    box-sizing: border-box;
    cursor: default;
    white-space: pre;
    word-wrap: break-word;
    line-height: normal;
    font-style: normal;
    font-weight: normal;
    letter-spacing: normal;
    pointer-events: none;
}

.ace_tooltip.ace_dark {
    background-color: #636363;
    color: #fff;
}

.ace_tooltip:focus {
    outline: 1px solid #5E9ED6;
}

.ace_icon {
    display: inline-block;
    width: 18px;
    vertical-align: top;
}

.ace_icon_svg {
    display: inline-block;
    width: 12px;
    vertical-align: top;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: 12px;
    -webkit-mask-position: center;
}

.ace_folding-enabled > .ace_gutter-cell, .ace_folding-enabled > .ace_gutter-cell_svg-icons {
    padding-right: 13px;
}

.ace_fold-widget {
    box-sizing: border-box;

    margin: 0 -12px 0 1px;
    display: none;
    width: 11px;
    vertical-align: top;

    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42mWKsQ0AMAzC8ixLlrzQjzmBiEjp0A6WwBCSPgKAXoLkqSot7nN3yMwR7pZ32NzpKkVoDBUxKAAAAABJRU5ErkJggg==");
    background-repeat: no-repeat;
    background-position: center;

    border-radius: 3px;
    
    border: 1px solid transparent;
    cursor: pointer;
}

.ace_folding-enabled .ace_fold-widget {
    display: inline-block;   
}

.ace_fold-widget.ace_end {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAANElEQVR42m3HwQkAMAhD0YzsRchFKI7sAikeWkrxwScEB0nh5e7KTPWimZki4tYfVbX+MNl4pyZXejUO1QAAAABJRU5ErkJggg==");
}

.ace_fold-widget.ace_closed {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAGCAYAAAAG5SQMAAAAOUlEQVR42jXKwQkAMAgDwKwqKD4EwQ26sSOkVWjgIIHAzPiCgaqiqnJHZnKICBERHN194O5b9vbLuAVRL+l0YWnZAAAAAElFTkSuQmCCXA==");
}

.ace_fold-widget:hover {
    border: 1px solid rgba(0, 0, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.7);
}

.ace_fold-widget:active {
    border: 1px solid rgba(0, 0, 0, 0.4);
    background-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.8);
}
/**
 * Dark version for fold widgets
 */
.ace_dark .ace_fold-widget {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHklEQVQIW2P4//8/AzoGEQ7oGCaLLAhWiSwB146BAQCSTPYocqT0AAAAAElFTkSuQmCC");
}
.ace_dark .ace_fold-widget.ace_end {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAH0lEQVQIW2P4//8/AxQ7wNjIAjDMgC4AxjCVKBirIAAF0kz2rlhxpAAAAABJRU5ErkJggg==");
}
.ace_dark .ace_fold-widget.ace_closed {
    background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAAFCAYAAACAcVaiAAAAHElEQVQIW2P4//+/AxAzgDADlOOAznHAKgPWAwARji8UIDTfQQAAAABJRU5ErkJggg==");
}
.ace_dark .ace_fold-widget:hover {
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
    background-color: rgba(255, 255, 255, 0.1);
}
.ace_dark .ace_fold-widget:active {
    box-shadow: 0 1px 1px rgba(255, 255, 255, 0.2);
}

.ace_inline_button {
    border: 1px solid lightgray;
    display: inline-block;
    margin: -1px 8px;
    padding: 0 5px;
    pointer-events: auto;
    cursor: pointer;
}
.ace_inline_button:hover {
    border-color: gray;
    background: rgba(200,200,200,0.2);
    display: inline-block;
    pointer-events: auto;
}

.ace_fold-widget.ace_invalid {
    background-color: #FFB4B4;
    border-color: #DE5555;
}

.ace_fade-fold-widgets .ace_fold-widget {
    transition: opacity 0.4s ease 0.05s;
    opacity: 0;
}

.ace_fade-fold-widgets:hover .ace_fold-widget {
    transition: opacity 0.05s ease 0.05s;
    opacity:1;
}

.ace_underline {
    text-decoration: underline;
}

.ace_bold {
    font-weight: bold;
}

.ace_nobold .ace_bold {
    font-weight: normal;
}

.ace_italic {
    font-style: italic;
}


.ace_error-marker {
    background-color: rgba(255, 0, 0,0.2);
    position: absolute;
    z-index: 9;
}

.ace_highlight-marker {
    background-color: rgba(255, 255, 0,0.2);
    position: absolute;
    z-index: 8;
}

.ace_mobile-menu {
    position: absolute;
    line-height: 1.5;
    border-radius: 4px;
    -ms-user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    background: white;
    box-shadow: 1px 3px 2px grey;
    border: 1px solid #dcdcdc;
    color: black;
}
.ace_dark > .ace_mobile-menu {
    background: #333;
    color: #ccc;
    box-shadow: 1px 3px 2px grey;
    border: 1px solid #444;

}
.ace_mobile-button {
    padding: 2px;
    cursor: pointer;
    overflow: hidden;
}
.ace_mobile-button:hover {
    background-color: #eee;
    opacity:1;
}
.ace_mobile-button:active {
    background-color: #ddd;
}

.ace_placeholder {
    font-family: arial;
    transform: scale(0.9);
    transform-origin: left;
    white-space: pre;
    opacity: 0.7;
    margin: 0 10px;
}

.ace_ghost_text {
    opacity: 0.5;
    font-style: italic;
    white-space: pre;
}

.ace_screenreader-only {
    position:absolute;
    left:-10000px;
    top:auto;
    width:1px;
    height:1px;
    overflow:hidden;
}`;
    });
    ace.define("ace/layer/decorators", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event_emitter"], function(require2, exports3, module3) {
      var dom = require2("../lib/dom");
      var oop = require2("../lib/oop");
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var Decorator = function() {
        function Decorator2(parent, renderer) {
          this.canvas = dom.createElement("canvas");
          this.renderer = renderer;
          this.pixelRatio = 1;
          this.maxHeight = renderer.layerConfig.maxHeight;
          this.lineHeight = renderer.layerConfig.lineHeight;
          this.canvasHeight = parent.parent.scrollHeight;
          this.heightRatio = this.canvasHeight / this.maxHeight;
          this.canvasWidth = parent.width;
          this.minDecorationHeight = 2 * this.pixelRatio | 0;
          this.halfMinDecorationHeight = this.minDecorationHeight / 2 | 0;
          this.canvas.width = this.canvasWidth;
          this.canvas.height = this.canvasHeight;
          this.canvas.style.top = 0 + "px";
          this.canvas.style.right = 0 + "px";
          this.canvas.style.zIndex = 7 + "px";
          this.canvas.style.position = "absolute";
          this.colors = {};
          this.colors.dark = {
            "error": "rgba(255, 18, 18, 1)",
            "warning": "rgba(18, 136, 18, 1)",
            "info": "rgba(18, 18, 136, 1)"
          };
          this.colors.light = {
            "error": "rgb(255,51,51)",
            "warning": "rgb(32,133,72)",
            "info": "rgb(35,68,138)"
          };
          parent.element.appendChild(this.canvas);
        }
        Decorator2.prototype.$updateDecorators = function(config2) {
          var colors = this.renderer.theme.isDark === true ? this.colors.dark : this.colors.light;
          if (config2) {
            this.maxHeight = config2.maxHeight;
            this.lineHeight = config2.lineHeight;
            this.canvasHeight = config2.height;
            var allLineHeight = (config2.lastRow + 1) * this.lineHeight;
            if (allLineHeight < this.canvasHeight) {
              this.heightRatio = 1;
            } else {
              this.heightRatio = this.canvasHeight / this.maxHeight;
            }
          }
          var ctx = this.canvas.getContext("2d");
          function compare2(a, b) {
            if (a.priority < b.priority)
              return -1;
            if (a.priority > b.priority)
              return 1;
            return 0;
          }
          var annotations = this.renderer.session.$annotations;
          ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
          if (annotations) {
            var priorities = {
              "info": 1,
              "warning": 2,
              "error": 3
            };
            annotations.forEach(function(item) {
              item.priority = priorities[item.type] || null;
            });
            annotations = annotations.sort(compare2);
            var foldData = this.renderer.session.$foldData;
            for (var i2 = 0; i2 < annotations.length; i2++) {
              var row = annotations[i2].row;
              var compensateFold = this.compensateFoldRows(row, foldData);
              var currentY = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio);
              var y1 = Math.round((row - compensateFold) * this.lineHeight * this.heightRatio);
              var y2 = Math.round(((row - compensateFold) * this.lineHeight + this.lineHeight) * this.heightRatio);
              var height = y2 - y1;
              if (height < this.minDecorationHeight) {
                var yCenter = (y1 + y2) / 2 | 0;
                if (yCenter < this.halfMinDecorationHeight) {
                  yCenter = this.halfMinDecorationHeight;
                } else if (yCenter + this.halfMinDecorationHeight > this.canvasHeight) {
                  yCenter = this.canvasHeight - this.halfMinDecorationHeight;
                }
                y1 = Math.round(yCenter - this.halfMinDecorationHeight);
                y2 = Math.round(yCenter + this.halfMinDecorationHeight);
              }
              ctx.fillStyle = colors[annotations[i2].type] || null;
              ctx.fillRect(0, currentY, this.canvasWidth, y2 - y1);
            }
          }
          var cursor = this.renderer.session.selection.getCursor();
          if (cursor) {
            var compensateFold = this.compensateFoldRows(cursor.row, foldData);
            var currentY = Math.round((cursor.row - compensateFold) * this.lineHeight * this.heightRatio);
            ctx.fillStyle = "rgba(0, 0, 0, 0.5)";
            ctx.fillRect(0, currentY, this.canvasWidth, 2);
          }
        };
        Decorator2.prototype.compensateFoldRows = function(row, foldData) {
          var compensateFold = 0;
          if (foldData && foldData.length > 0) {
            for (var j = 0; j < foldData.length; j++) {
              if (row > foldData[j].start.row && row < foldData[j].end.row) {
                compensateFold += row - foldData[j].start.row;
              } else if (row >= foldData[j].end.row) {
                compensateFold += foldData[j].end.row - foldData[j].start.row;
              }
            }
          }
          return compensateFold;
        };
        return Decorator2;
      }();
      oop.implement(Decorator.prototype, EventEmitter);
      exports3.Decorator = Decorator;
    });
    ace.define("ace/virtual_renderer", ["require", "exports", "module", "ace/lib/oop", "ace/lib/dom", "ace/lib/lang", "ace/config", "ace/layer/gutter", "ace/layer/marker", "ace/layer/text", "ace/layer/cursor", "ace/scrollbar", "ace/scrollbar", "ace/scrollbar_custom", "ace/scrollbar_custom", "ace/renderloop", "ace/layer/font_metrics", "ace/lib/event_emitter", "ace/css/editor-css", "ace/layer/decorators", "ace/lib/useragent"], function(require2, exports3, module3) {
      var oop = require2("./lib/oop");
      var dom = require2("./lib/dom");
      var lang = require2("./lib/lang");
      var config2 = require2("./config");
      var GutterLayer = require2("./layer/gutter").Gutter;
      var MarkerLayer = require2("./layer/marker").Marker;
      var TextLayer = require2("./layer/text").Text;
      var CursorLayer = require2("./layer/cursor").Cursor;
      var HScrollBar = require2("./scrollbar").HScrollBar;
      var VScrollBar = require2("./scrollbar").VScrollBar;
      var HScrollBarCustom = require2("./scrollbar_custom").HScrollBar;
      var VScrollBarCustom = require2("./scrollbar_custom").VScrollBar;
      var RenderLoop = require2("./renderloop").RenderLoop;
      var FontMetrics = require2("./layer/font_metrics").FontMetrics;
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var editorCss = require2("./css/editor-css");
      var Decorator = require2("./layer/decorators").Decorator;
      var useragent = require2("./lib/useragent");
      dom.importCssString(editorCss, "ace_editor.css", false);
      var VirtualRenderer = function() {
        function VirtualRenderer2(container, theme2) {
          var _self = this;
          this.container = container || dom.createElement("div");
          dom.addCssClass(this.container, "ace_editor");
          if (dom.HI_DPI)
            dom.addCssClass(this.container, "ace_hidpi");
          this.setTheme(theme2);
          if (config2.get("useStrictCSP") == null)
            config2.set("useStrictCSP", false);
          this.$gutter = dom.createElement("div");
          this.$gutter.className = "ace_gutter";
          this.container.appendChild(this.$gutter);
          this.$gutter.setAttribute("aria-hidden", true);
          this.scroller = dom.createElement("div");
          this.scroller.className = "ace_scroller";
          this.container.appendChild(this.scroller);
          this.content = dom.createElement("div");
          this.content.className = "ace_content";
          this.scroller.appendChild(this.content);
          this.$gutterLayer = new GutterLayer(this.$gutter);
          this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this));
          this.$markerBack = new MarkerLayer(this.content);
          var textLayer = this.$textLayer = new TextLayer(this.content);
          this.canvas = textLayer.element;
          this.$markerFront = new MarkerLayer(this.content);
          this.$cursorLayer = new CursorLayer(this.content);
          this.$horizScroll = false;
          this.$vScroll = false;
          this.scrollBar = this.scrollBarV = new VScrollBar(this.container, this);
          this.scrollBarH = new HScrollBar(this.container, this);
          this.scrollBarV.on("scroll", function(e) {
            if (!_self.$scrollAnimation)
              _self.session.setScrollTop(e.data - _self.scrollMargin.top);
          });
          this.scrollBarH.on("scroll", function(e) {
            if (!_self.$scrollAnimation)
              _self.session.setScrollLeft(e.data - _self.scrollMargin.left);
          });
          this.scrollTop = 0;
          this.scrollLeft = 0;
          this.cursorPos = {
            row: 0,
            column: 0
          };
          this.$fontMetrics = new FontMetrics(this.container);
          this.$textLayer.$setFontMetrics(this.$fontMetrics);
          this.$textLayer.on("changeCharacterSize", function(e) {
            _self.updateCharacterSize();
            _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);
            _self._signal("changeCharacterSize", e);
          });
          this.$size = {
            width: 0,
            height: 0,
            scrollerHeight: 0,
            scrollerWidth: 0,
            $dirty: true
          };
          this.layerConfig = {
            width: 1,
            padding: 0,
            firstRow: 0,
            firstRowScreen: 0,
            lastRow: 0,
            lineHeight: 0,
            characterWidth: 0,
            minHeight: 1,
            maxHeight: 1,
            offset: 0,
            height: 1,
            gutterOffset: 1
          };
          this.scrollMargin = {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
            v: 0,
            h: 0
          };
          this.margin = {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0,
            v: 0,
            h: 0
          };
          this.$keepTextAreaAtCursor = !useragent.isIOS;
          this.$loop = new RenderLoop(this.$renderChanges.bind(this), this.container.ownerDocument.defaultView);
          this.$loop.schedule(this.CHANGE_FULL);
          this.updateCharacterSize();
          this.setPadding(4);
          this.$addResizeObserver();
          config2.resetOptions(this);
          config2._signal("renderer", this);
        }
        VirtualRenderer2.prototype.updateCharacterSize = function() {
          if (this.$textLayer.allowBoldFonts != this.$allowBoldFonts) {
            this.$allowBoldFonts = this.$textLayer.allowBoldFonts;
            this.setStyle("ace_nobold", !this.$allowBoldFonts);
          }
          this.layerConfig.characterWidth = this.characterWidth = this.$textLayer.getCharacterWidth();
          this.layerConfig.lineHeight = this.lineHeight = this.$textLayer.getLineHeight();
          this.$updatePrintMargin();
          dom.setStyle(this.scroller.style, "line-height", this.lineHeight + "px");
        };
        VirtualRenderer2.prototype.setSession = function(session) {
          if (this.session)
            this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode);
          this.session = session;
          if (session && this.scrollMargin.top && session.getScrollTop() <= 0)
            session.setScrollTop(-this.scrollMargin.top);
          this.$cursorLayer.setSession(session);
          this.$markerBack.setSession(session);
          this.$markerFront.setSession(session);
          this.$gutterLayer.setSession(session);
          this.$textLayer.setSession(session);
          if (!session)
            return;
          this.$loop.schedule(this.CHANGE_FULL);
          this.session.$setFontMetrics(this.$fontMetrics);
          this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;
          this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);
          this.onChangeNewLineMode();
          this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode);
        };
        VirtualRenderer2.prototype.updateLines = function(firstRow, lastRow, force) {
          if (lastRow === void 0)
            lastRow = Infinity;
          if (!this.$changedLines) {
            this.$changedLines = {
              firstRow,
              lastRow
            };
          } else {
            if (this.$changedLines.firstRow > firstRow)
              this.$changedLines.firstRow = firstRow;
            if (this.$changedLines.lastRow < lastRow)
              this.$changedLines.lastRow = lastRow;
          }
          if (this.$changedLines.lastRow < this.layerConfig.firstRow) {
            if (force)
              this.$changedLines.lastRow = this.layerConfig.lastRow;
            else
              return;
          }
          if (this.$changedLines.firstRow > this.layerConfig.lastRow)
            return;
          this.$loop.schedule(this.CHANGE_LINES);
        };
        VirtualRenderer2.prototype.onChangeNewLineMode = function() {
          this.$loop.schedule(this.CHANGE_TEXT);
          this.$textLayer.$updateEolChar();
          this.session.$bidiHandler.setEolChar(this.$textLayer.EOL_CHAR);
        };
        VirtualRenderer2.prototype.onChangeTabSize = function() {
          this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);
          this.$textLayer.onChangeTabSize();
        };
        VirtualRenderer2.prototype.updateText = function() {
          this.$loop.schedule(this.CHANGE_TEXT);
        };
        VirtualRenderer2.prototype.updateFull = function(force) {
          if (force)
            this.$renderChanges(this.CHANGE_FULL, true);
          else
            this.$loop.schedule(this.CHANGE_FULL);
        };
        VirtualRenderer2.prototype.updateFontSize = function() {
          this.$textLayer.checkForSizeChanges();
        };
        VirtualRenderer2.prototype.$updateSizeAsync = function() {
          if (this.$loop.pending)
            this.$size.$dirty = true;
          else
            this.onResize();
        };
        VirtualRenderer2.prototype.onResize = function(force, gutterWidth, width, height) {
          if (this.resizing > 2)
            return;
          else if (this.resizing > 0)
            this.resizing++;
          else
            this.resizing = force ? 1 : 0;
          var el = this.container;
          if (!height)
            height = el.clientHeight || el.scrollHeight;
          if (!width)
            width = el.clientWidth || el.scrollWidth;
          var changes = this.$updateCachedSize(force, gutterWidth, width, height);
          if (this.$resizeTimer)
            this.$resizeTimer.cancel();
          if (!this.$size.scrollerHeight || !width && !height)
            return this.resizing = 0;
          if (force)
            this.$gutterLayer.$padding = null;
          if (force)
            this.$renderChanges(changes | this.$changes, true);
          else
            this.$loop.schedule(changes | this.$changes);
          if (this.resizing)
            this.resizing = 0;
          this.scrollBarH.scrollLeft = this.scrollBarV.scrollTop = null;
          if (this.$customScrollbar) {
            this.$updateCustomScrollbar(true);
          }
        };
        VirtualRenderer2.prototype.$updateCachedSize = function(force, gutterWidth, width, height) {
          height -= this.$extraHeight || 0;
          var changes = 0;
          var size = this.$size;
          var oldSize = {
            width: size.width,
            height: size.height,
            scrollerHeight: size.scrollerHeight,
            scrollerWidth: size.scrollerWidth
          };
          if (height && (force || size.height != height)) {
            size.height = height;
            changes |= this.CHANGE_SIZE;
            size.scrollerHeight = size.height;
            if (this.$horizScroll)
              size.scrollerHeight -= this.scrollBarH.getHeight();
            this.scrollBarV.setHeight(size.scrollerHeight);
            this.scrollBarV.element.style.bottom = this.scrollBarH.getHeight() + "px";
            changes = changes | this.CHANGE_SCROLL;
          }
          if (width && (force || size.width != width)) {
            changes |= this.CHANGE_SIZE;
            size.width = width;
            if (gutterWidth == null)
              gutterWidth = this.$showGutter ? this.$gutter.offsetWidth : 0;
            this.gutterWidth = gutterWidth;
            dom.setStyle(this.scrollBarH.element.style, "left", gutterWidth + "px");
            dom.setStyle(this.scroller.style, "left", gutterWidth + this.margin.left + "px");
            size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h);
            dom.setStyle(this.$gutter.style, "left", this.margin.left + "px");
            var right = this.scrollBarV.getWidth() + "px";
            dom.setStyle(this.scrollBarH.element.style, "right", right);
            dom.setStyle(this.scroller.style, "right", right);
            dom.setStyle(this.scroller.style, "bottom", this.scrollBarH.getHeight());
            this.scrollBarH.setWidth(size.scrollerWidth);
            if (this.session && this.session.getUseWrapMode() && this.adjustWrapLimit() || force) {
              changes |= this.CHANGE_FULL;
            }
          }
          size.$dirty = !width || !height;
          if (changes)
            this._signal("resize", oldSize);
          return changes;
        };
        VirtualRenderer2.prototype.onGutterResize = function(width) {
          var gutterWidth = this.$showGutter ? width : 0;
          if (gutterWidth != this.gutterWidth)
            this.$changes |= this.$updateCachedSize(true, gutterWidth, this.$size.width, this.$size.height);
          if (this.session.getUseWrapMode() && this.adjustWrapLimit()) {
            this.$loop.schedule(this.CHANGE_FULL);
          } else if (this.$size.$dirty) {
            this.$loop.schedule(this.CHANGE_FULL);
          } else {
            this.$computeLayerConfig();
          }
        };
        VirtualRenderer2.prototype.adjustWrapLimit = function() {
          var availableWidth = this.$size.scrollerWidth - this.$padding * 2;
          var limit = Math.floor(availableWidth / this.characterWidth);
          return this.session.adjustWrapLimit(limit, this.$showPrintMargin && this.$printMarginColumn);
        };
        VirtualRenderer2.prototype.setAnimatedScroll = function(shouldAnimate) {
          this.setOption("animatedScroll", shouldAnimate);
        };
        VirtualRenderer2.prototype.getAnimatedScroll = function() {
          return this.$animatedScroll;
        };
        VirtualRenderer2.prototype.setShowInvisibles = function(showInvisibles) {
          this.setOption("showInvisibles", showInvisibles);
          this.session.$bidiHandler.setShowInvisibles(showInvisibles);
        };
        VirtualRenderer2.prototype.getShowInvisibles = function() {
          return this.getOption("showInvisibles");
        };
        VirtualRenderer2.prototype.getDisplayIndentGuides = function() {
          return this.getOption("displayIndentGuides");
        };
        VirtualRenderer2.prototype.setDisplayIndentGuides = function(display) {
          this.setOption("displayIndentGuides", display);
        };
        VirtualRenderer2.prototype.getHighlightIndentGuides = function() {
          return this.getOption("highlightIndentGuides");
        };
        VirtualRenderer2.prototype.setHighlightIndentGuides = function(highlight) {
          this.setOption("highlightIndentGuides", highlight);
        };
        VirtualRenderer2.prototype.setShowPrintMargin = function(showPrintMargin) {
          this.setOption("showPrintMargin", showPrintMargin);
        };
        VirtualRenderer2.prototype.getShowPrintMargin = function() {
          return this.getOption("showPrintMargin");
        };
        VirtualRenderer2.prototype.setPrintMarginColumn = function(showPrintMargin) {
          this.setOption("printMarginColumn", showPrintMargin);
        };
        VirtualRenderer2.prototype.getPrintMarginColumn = function() {
          return this.getOption("printMarginColumn");
        };
        VirtualRenderer2.prototype.getShowGutter = function() {
          return this.getOption("showGutter");
        };
        VirtualRenderer2.prototype.setShowGutter = function(show) {
          return this.setOption("showGutter", show);
        };
        VirtualRenderer2.prototype.getFadeFoldWidgets = function() {
          return this.getOption("fadeFoldWidgets");
        };
        VirtualRenderer2.prototype.setFadeFoldWidgets = function(show) {
          this.setOption("fadeFoldWidgets", show);
        };
        VirtualRenderer2.prototype.setHighlightGutterLine = function(shouldHighlight) {
          this.setOption("highlightGutterLine", shouldHighlight);
        };
        VirtualRenderer2.prototype.getHighlightGutterLine = function() {
          return this.getOption("highlightGutterLine");
        };
        VirtualRenderer2.prototype.$updatePrintMargin = function() {
          if (!this.$showPrintMargin && !this.$printMarginEl)
            return;
          if (!this.$printMarginEl) {
            var containerEl = dom.createElement("div");
            containerEl.className = "ace_layer ace_print-margin-layer";
            this.$printMarginEl = dom.createElement("div");
            this.$printMarginEl.className = "ace_print-margin";
            containerEl.appendChild(this.$printMarginEl);
            this.content.insertBefore(containerEl, this.content.firstChild);
          }
          var style = this.$printMarginEl.style;
          style.left = Math.round(this.characterWidth * this.$printMarginColumn + this.$padding) + "px";
          style.visibility = this.$showPrintMargin ? "visible" : "hidden";
          if (this.session && this.session.$wrap == -1)
            this.adjustWrapLimit();
        };
        VirtualRenderer2.prototype.getContainerElement = function() {
          return this.container;
        };
        VirtualRenderer2.prototype.getMouseEventTarget = function() {
          return this.scroller;
        };
        VirtualRenderer2.prototype.getTextAreaContainer = function() {
          return this.container;
        };
        VirtualRenderer2.prototype.$moveTextAreaToCursor = function() {
          if (this.$isMousePressed)
            return;
          var style = this.textarea.style;
          var composition = this.$composition;
          if (!this.$keepTextAreaAtCursor && !composition) {
            dom.translate(this.textarea, -100, 0);
            return;
          }
          var pixelPos = this.$cursorLayer.$pixelPos;
          if (!pixelPos)
            return;
          if (composition && composition.markerRange)
            pixelPos = this.$cursorLayer.getPixelPosition(composition.markerRange.start, true);
          var config3 = this.layerConfig;
          var posTop = pixelPos.top;
          var posLeft = pixelPos.left;
          posTop -= config3.offset;
          var h = composition && composition.useTextareaForIME || useragent.isMobile ? this.lineHeight : 1;
          if (posTop < 0 || posTop > config3.height - h) {
            dom.translate(this.textarea, 0, 0);
            return;
          }
          var w = 1;
          var maxTop = this.$size.height - h;
          if (!composition) {
            posTop += this.lineHeight;
          } else {
            if (composition.useTextareaForIME) {
              var val = this.textarea.value;
              w = this.characterWidth * this.session.$getStringScreenWidth(val)[0];
            } else {
              posTop += this.lineHeight + 2;
            }
          }
          posLeft -= this.scrollLeft;
          if (posLeft > this.$size.scrollerWidth - w)
            posLeft = this.$size.scrollerWidth - w;
          posLeft += this.gutterWidth + this.margin.left;
          dom.setStyle(style, "height", h + "px");
          dom.setStyle(style, "width", w + "px");
          dom.translate(this.textarea, Math.min(posLeft, this.$size.scrollerWidth - w), Math.min(posTop, maxTop));
        };
        VirtualRenderer2.prototype.getFirstVisibleRow = function() {
          return this.layerConfig.firstRow;
        };
        VirtualRenderer2.prototype.getFirstFullyVisibleRow = function() {
          return this.layerConfig.firstRow + (this.layerConfig.offset === 0 ? 0 : 1);
        };
        VirtualRenderer2.prototype.getLastFullyVisibleRow = function() {
          var config3 = this.layerConfig;
          var lastRow = config3.lastRow;
          var top2 = this.session.documentToScreenRow(lastRow, 0) * config3.lineHeight;
          if (top2 - this.session.getScrollTop() > config3.height - config3.lineHeight)
            return lastRow - 1;
          return lastRow;
        };
        VirtualRenderer2.prototype.getLastVisibleRow = function() {
          return this.layerConfig.lastRow;
        };
        VirtualRenderer2.prototype.setPadding = function(padding) {
          this.$padding = padding;
          this.$textLayer.setPadding(padding);
          this.$cursorLayer.setPadding(padding);
          this.$markerFront.setPadding(padding);
          this.$markerBack.setPadding(padding);
          this.$loop.schedule(this.CHANGE_FULL);
          this.$updatePrintMargin();
        };
        VirtualRenderer2.prototype.setScrollMargin = function(top2, bottom, left, right) {
          var sm = this.scrollMargin;
          sm.top = top2 | 0;
          sm.bottom = bottom | 0;
          sm.right = right | 0;
          sm.left = left | 0;
          sm.v = sm.top + sm.bottom;
          sm.h = sm.left + sm.right;
          if (sm.top && this.scrollTop <= 0 && this.session)
            this.session.setScrollTop(-sm.top);
          this.updateFull();
        };
        VirtualRenderer2.prototype.setMargin = function(top2, bottom, left, right) {
          var sm = this.margin;
          sm.top = top2 | 0;
          sm.bottom = bottom | 0;
          sm.right = right | 0;
          sm.left = left | 0;
          sm.v = sm.top + sm.bottom;
          sm.h = sm.left + sm.right;
          this.$updateCachedSize(true, this.gutterWidth, this.$size.width, this.$size.height);
          this.updateFull();
        };
        VirtualRenderer2.prototype.getHScrollBarAlwaysVisible = function() {
          return this.$hScrollBarAlwaysVisible;
        };
        VirtualRenderer2.prototype.setHScrollBarAlwaysVisible = function(alwaysVisible) {
          this.setOption("hScrollBarAlwaysVisible", alwaysVisible);
        };
        VirtualRenderer2.prototype.getVScrollBarAlwaysVisible = function() {
          return this.$vScrollBarAlwaysVisible;
        };
        VirtualRenderer2.prototype.setVScrollBarAlwaysVisible = function(alwaysVisible) {
          this.setOption("vScrollBarAlwaysVisible", alwaysVisible);
        };
        VirtualRenderer2.prototype.$updateScrollBarV = function() {
          var scrollHeight = this.layerConfig.maxHeight;
          var scrollerHeight = this.$size.scrollerHeight;
          if (!this.$maxLines && this.$scrollPastEnd) {
            scrollHeight -= (scrollerHeight - this.lineHeight) * this.$scrollPastEnd;
            if (this.scrollTop > scrollHeight - scrollerHeight) {
              scrollHeight = this.scrollTop + scrollerHeight;
              this.scrollBarV.scrollTop = null;
            }
          }
          this.scrollBarV.setScrollHeight(scrollHeight + this.scrollMargin.v);
          this.scrollBarV.setScrollTop(this.scrollTop + this.scrollMargin.top);
        };
        VirtualRenderer2.prototype.$updateScrollBarH = function() {
          this.scrollBarH.setScrollWidth(this.layerConfig.width + 2 * this.$padding + this.scrollMargin.h);
          this.scrollBarH.setScrollLeft(this.scrollLeft + this.scrollMargin.left);
        };
        VirtualRenderer2.prototype.freeze = function() {
          this.$frozen = true;
        };
        VirtualRenderer2.prototype.unfreeze = function() {
          this.$frozen = false;
        };
        VirtualRenderer2.prototype.$renderChanges = function(changes, force) {
          if (this.$changes) {
            changes |= this.$changes;
            this.$changes = 0;
          }
          if (!this.session || !this.container.offsetWidth || this.$frozen || !changes && !force) {
            this.$changes |= changes;
            return;
          }
          if (this.$size.$dirty) {
            this.$changes |= changes;
            return this.onResize(true);
          }
          if (!this.lineHeight) {
            this.$textLayer.checkForSizeChanges();
          }
          this._signal("beforeRender", changes);
          if (this.session && this.session.$bidiHandler)
            this.session.$bidiHandler.updateCharacterWidths(this.$fontMetrics);
          var config3 = this.layerConfig;
          if (changes & this.CHANGE_FULL || changes & this.CHANGE_SIZE || changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES || changes & this.CHANGE_SCROLL || changes & this.CHANGE_H_SCROLL) {
            changes |= this.$computeLayerConfig() | this.$loop.clear();
            if (config3.firstRow != this.layerConfig.firstRow && config3.firstRowScreen == this.layerConfig.firstRowScreen) {
              var st = this.scrollTop + (config3.firstRow - Math.max(this.layerConfig.firstRow, 0)) * this.lineHeight;
              if (st > 0) {
                this.scrollTop = st;
                changes = changes | this.CHANGE_SCROLL;
                changes |= this.$computeLayerConfig() | this.$loop.clear();
              }
            }
            config3 = this.layerConfig;
            this.$updateScrollBarV();
            if (changes & this.CHANGE_H_SCROLL)
              this.$updateScrollBarH();
            dom.translate(this.content, -this.scrollLeft, -config3.offset);
            var width = config3.width + 2 * this.$padding + "px";
            var height = config3.minHeight + "px";
            dom.setStyle(this.content.style, "width", width);
            dom.setStyle(this.content.style, "height", height);
          }
          if (changes & this.CHANGE_H_SCROLL) {
            dom.translate(this.content, -this.scrollLeft, -config3.offset);
            this.scroller.className = this.scrollLeft <= 0 ? "ace_scroller " : "ace_scroller ace_scroll-left ";
            if (this.enableKeyboardAccessibility)
              this.scroller.className += this.keyboardFocusClassName;
          }
          if (changes & this.CHANGE_FULL) {
            this.$changedLines = null;
            this.$textLayer.update(config3);
            if (this.$showGutter)
              this.$gutterLayer.update(config3);
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
            this.$markerBack.update(config3);
            this.$markerFront.update(config3);
            this.$cursorLayer.update(config3);
            this.$moveTextAreaToCursor();
            this._signal("afterRender", changes);
            return;
          }
          if (changes & this.CHANGE_SCROLL) {
            this.$changedLines = null;
            if (changes & this.CHANGE_TEXT || changes & this.CHANGE_LINES)
              this.$textLayer.update(config3);
            else
              this.$textLayer.scrollLines(config3);
            if (this.$showGutter) {
              if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES)
                this.$gutterLayer.update(config3);
              else
                this.$gutterLayer.scrollLines(config3);
            }
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
            this.$markerBack.update(config3);
            this.$markerFront.update(config3);
            this.$cursorLayer.update(config3);
            this.$moveTextAreaToCursor();
            this._signal("afterRender", changes);
            return;
          }
          if (changes & this.CHANGE_TEXT) {
            this.$changedLines = null;
            this.$textLayer.update(config3);
            if (this.$showGutter)
              this.$gutterLayer.update(config3);
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
          } else if (changes & this.CHANGE_LINES) {
            if (this.$updateLines() || changes & this.CHANGE_GUTTER && this.$showGutter)
              this.$gutterLayer.update(config3);
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
          } else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) {
            if (this.$showGutter)
              this.$gutterLayer.update(config3);
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
          } else if (changes & this.CHANGE_CURSOR) {
            if (this.$highlightGutterLine)
              this.$gutterLayer.updateLineHighlight(config3);
            if (this.$customScrollbar) {
              this.$scrollDecorator.$updateDecorators(config3);
            }
          }
          if (changes & this.CHANGE_CURSOR) {
            this.$cursorLayer.update(config3);
            this.$moveTextAreaToCursor();
          }
          if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {
            this.$markerFront.update(config3);
          }
          if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_BACK)) {
            this.$markerBack.update(config3);
          }
          this._signal("afterRender", changes);
        };
        VirtualRenderer2.prototype.$autosize = function() {
          var height = this.session.getScreenLength() * this.lineHeight;
          var maxHeight = this.$maxLines * this.lineHeight;
          var desiredHeight = Math.min(maxHeight, Math.max((this.$minLines || 1) * this.lineHeight, height)) + this.scrollMargin.v + (this.$extraHeight || 0);
          if (this.$horizScroll)
            desiredHeight += this.scrollBarH.getHeight();
          if (this.$maxPixelHeight && desiredHeight > this.$maxPixelHeight)
            desiredHeight = this.$maxPixelHeight;
          var hideScrollbars = desiredHeight <= 2 * this.lineHeight;
          var vScroll = !hideScrollbars && height > maxHeight;
          if (desiredHeight != this.desiredHeight || this.$size.height != this.desiredHeight || vScroll != this.$vScroll) {
            if (vScroll != this.$vScroll) {
              this.$vScroll = vScroll;
              this.scrollBarV.setVisible(vScroll);
            }
            var w = this.container.clientWidth;
            this.container.style.height = desiredHeight + "px";
            this.$updateCachedSize(true, this.$gutterWidth, w, desiredHeight);
            this.desiredHeight = desiredHeight;
            this._signal("autosize");
          }
        };
        VirtualRenderer2.prototype.$computeLayerConfig = function() {
          var session = this.session;
          var size = this.$size;
          var hideScrollbars = size.height <= 2 * this.lineHeight;
          var screenLines = this.session.getScreenLength();
          var maxHeight = screenLines * this.lineHeight;
          var longestLine = this.$getLongestLine();
          var horizScroll = !hideScrollbars && (this.$hScrollBarAlwaysVisible || size.scrollerWidth - longestLine - 2 * this.$padding < 0);
          var hScrollChanged = this.$horizScroll !== horizScroll;
          if (hScrollChanged) {
            this.$horizScroll = horizScroll;
            this.scrollBarH.setVisible(horizScroll);
          }
          var vScrollBefore = this.$vScroll;
          if (this.$maxLines && this.lineHeight > 1)
            this.$autosize();
          var minHeight = size.scrollerHeight + this.lineHeight;
          var scrollPastEnd = !this.$maxLines && this.$scrollPastEnd ? (size.scrollerHeight - this.lineHeight) * this.$scrollPastEnd : 0;
          maxHeight += scrollPastEnd;
          var sm = this.scrollMargin;
          this.session.setScrollTop(Math.max(-sm.top, Math.min(this.scrollTop, maxHeight - size.scrollerHeight + sm.bottom)));
          this.session.setScrollLeft(Math.max(-sm.left, Math.min(this.scrollLeft, longestLine + 2 * this.$padding - size.scrollerWidth + sm.right)));
          var vScroll = !hideScrollbars && (this.$vScrollBarAlwaysVisible || size.scrollerHeight - maxHeight + scrollPastEnd < 0 || this.scrollTop > sm.top);
          var vScrollChanged = vScrollBefore !== vScroll;
          if (vScrollChanged) {
            this.$vScroll = vScroll;
            this.scrollBarV.setVisible(vScroll);
          }
          var offset = this.scrollTop % this.lineHeight;
          var lineCount = Math.ceil(minHeight / this.lineHeight) - 1;
          var firstRow = Math.max(0, Math.round((this.scrollTop - offset) / this.lineHeight));
          var lastRow = firstRow + lineCount;
          var firstRowScreen, firstRowHeight;
          var lineHeight = this.lineHeight;
          firstRow = session.screenToDocumentRow(firstRow, 0);
          var foldLine = session.getFoldLine(firstRow);
          if (foldLine) {
            firstRow = foldLine.start.row;
          }
          firstRowScreen = session.documentToScreenRow(firstRow, 0);
          firstRowHeight = session.getRowLength(firstRow) * lineHeight;
          lastRow = Math.min(session.screenToDocumentRow(lastRow, 0), session.getLength() - 1);
          minHeight = size.scrollerHeight + session.getRowLength(lastRow) * lineHeight + firstRowHeight;
          offset = this.scrollTop - firstRowScreen * lineHeight;
          var changes = 0;
          if (this.layerConfig.width != longestLine || hScrollChanged)
            changes = this.CHANGE_H_SCROLL;
          if (hScrollChanged || vScrollChanged) {
            changes |= this.$updateCachedSize(true, this.gutterWidth, size.width, size.height);
            this._signal("scrollbarVisibilityChanged");
            if (vScrollChanged)
              longestLine = this.$getLongestLine();
          }
          this.layerConfig = {
            width: longestLine,
            padding: this.$padding,
            firstRow,
            firstRowScreen,
            lastRow,
            lineHeight,
            characterWidth: this.characterWidth,
            minHeight,
            maxHeight,
            offset,
            gutterOffset: lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0,
            height: this.$size.scrollerHeight
          };
          if (this.session.$bidiHandler)
            this.session.$bidiHandler.setContentWidth(longestLine - this.$padding);
          return changes;
        };
        VirtualRenderer2.prototype.$updateLines = function() {
          if (!this.$changedLines)
            return;
          var firstRow = this.$changedLines.firstRow;
          var lastRow = this.$changedLines.lastRow;
          this.$changedLines = null;
          var layerConfig = this.layerConfig;
          if (firstRow > layerConfig.lastRow + 1) {
            return;
          }
          if (lastRow < layerConfig.firstRow) {
            return;
          }
          if (lastRow === Infinity) {
            if (this.$showGutter)
              this.$gutterLayer.update(layerConfig);
            this.$textLayer.update(layerConfig);
            return;
          }
          this.$textLayer.updateLines(layerConfig, firstRow, lastRow);
          return true;
        };
        VirtualRenderer2.prototype.$getLongestLine = function() {
          var charCount = this.session.getScreenWidth();
          if (this.showInvisibles && !this.session.$useWrapMode)
            charCount += 1;
          if (this.$textLayer && charCount > this.$textLayer.MAX_LINE_LENGTH)
            charCount = this.$textLayer.MAX_LINE_LENGTH + 30;
          return Math.max(this.$size.scrollerWidth - 2 * this.$padding, Math.round(charCount * this.characterWidth));
        };
        VirtualRenderer2.prototype.updateFrontMarkers = function() {
          this.$markerFront.setMarkers(this.session.getMarkers(true));
          this.$loop.schedule(this.CHANGE_MARKER_FRONT);
        };
        VirtualRenderer2.prototype.updateBackMarkers = function() {
          this.$markerBack.setMarkers(this.session.getMarkers());
          this.$loop.schedule(this.CHANGE_MARKER_BACK);
        };
        VirtualRenderer2.prototype.addGutterDecoration = function(row, className) {
          this.$gutterLayer.addGutterDecoration(row, className);
        };
        VirtualRenderer2.prototype.removeGutterDecoration = function(row, className) {
          this.$gutterLayer.removeGutterDecoration(row, className);
        };
        VirtualRenderer2.prototype.updateBreakpoints = function(rows) {
          this.$loop.schedule(this.CHANGE_GUTTER);
        };
        VirtualRenderer2.prototype.setAnnotations = function(annotations) {
          this.$gutterLayer.setAnnotations(annotations);
          this.$loop.schedule(this.CHANGE_GUTTER);
        };
        VirtualRenderer2.prototype.updateCursor = function() {
          this.$loop.schedule(this.CHANGE_CURSOR);
        };
        VirtualRenderer2.prototype.hideCursor = function() {
          this.$cursorLayer.hideCursor();
        };
        VirtualRenderer2.prototype.showCursor = function() {
          this.$cursorLayer.showCursor();
        };
        VirtualRenderer2.prototype.scrollSelectionIntoView = function(anchor, lead, offset) {
          this.scrollCursorIntoView(anchor, offset);
          this.scrollCursorIntoView(lead, offset);
        };
        VirtualRenderer2.prototype.scrollCursorIntoView = function(cursor, offset, $viewMargin) {
          if (this.$size.scrollerHeight === 0)
            return;
          var pos = this.$cursorLayer.getPixelPosition(cursor);
          var newLeft = pos.left;
          var newTop = pos.top;
          var topMargin = $viewMargin && $viewMargin.top || 0;
          var bottomMargin = $viewMargin && $viewMargin.bottom || 0;
          if (this.$scrollAnimation) {
            this.$stopAnimation = true;
          }
          var currentTop = this.$scrollAnimation ? this.session.getScrollTop() : this.scrollTop;
          if (currentTop + topMargin > newTop) {
            if (offset && currentTop + topMargin > newTop + this.lineHeight)
              newTop -= offset * this.$size.scrollerHeight;
            if (newTop === 0)
              newTop = -this.scrollMargin.top;
            this.session.setScrollTop(newTop);
          } else if (currentTop + this.$size.scrollerHeight - bottomMargin < newTop + this.lineHeight) {
            if (offset && currentTop + this.$size.scrollerHeight - bottomMargin < newTop - this.lineHeight)
              newTop += offset * this.$size.scrollerHeight;
            this.session.setScrollTop(newTop + this.lineHeight + bottomMargin - this.$size.scrollerHeight);
          }
          var currentLeft = this.scrollLeft;
          var twoCharsWidth = 2 * this.layerConfig.characterWidth;
          if (newLeft - twoCharsWidth < currentLeft) {
            newLeft -= twoCharsWidth;
            if (newLeft < this.$padding + twoCharsWidth) {
              newLeft = -this.scrollMargin.left;
            }
            this.session.setScrollLeft(newLeft);
          } else {
            newLeft += twoCharsWidth;
            if (currentLeft + this.$size.scrollerWidth < newLeft + this.characterWidth) {
              this.session.setScrollLeft(Math.round(newLeft + this.characterWidth - this.$size.scrollerWidth));
            } else if (currentLeft <= this.$padding && newLeft - currentLeft < this.characterWidth) {
              this.session.setScrollLeft(0);
            }
          }
        };
        VirtualRenderer2.prototype.getScrollTop = function() {
          return this.session.getScrollTop();
        };
        VirtualRenderer2.prototype.getScrollLeft = function() {
          return this.session.getScrollLeft();
        };
        VirtualRenderer2.prototype.getScrollTopRow = function() {
          return this.scrollTop / this.lineHeight;
        };
        VirtualRenderer2.prototype.getScrollBottomRow = function() {
          return Math.max(0, Math.floor((this.scrollTop + this.$size.scrollerHeight) / this.lineHeight) - 1);
        };
        VirtualRenderer2.prototype.scrollToRow = function(row) {
          this.session.setScrollTop(row * this.lineHeight);
        };
        VirtualRenderer2.prototype.alignCursor = function(cursor, alignment) {
          if (typeof cursor == "number")
            cursor = { row: cursor, column: 0 };
          var pos = this.$cursorLayer.getPixelPosition(cursor);
          var h = this.$size.scrollerHeight - this.lineHeight;
          var offset = pos.top - h * (alignment || 0);
          this.session.setScrollTop(offset);
          return offset;
        };
        VirtualRenderer2.prototype.$calcSteps = function(fromValue, toValue) {
          var i2 = 0;
          var l = this.STEPS;
          var steps = [];
          var func = function(t2, x_min, dx) {
            return dx * (Math.pow(t2 - 1, 3) + 1) + x_min;
          };
          for (i2 = 0; i2 < l; ++i2)
            steps.push(func(i2 / this.STEPS, fromValue, toValue - fromValue));
          return steps;
        };
        VirtualRenderer2.prototype.scrollToLine = function(line, center, animate, callback) {
          var pos = this.$cursorLayer.getPixelPosition({ row: line, column: 0 });
          var offset = pos.top;
          if (center)
            offset -= this.$size.scrollerHeight / 2;
          var initialScroll = this.scrollTop;
          this.session.setScrollTop(offset);
          if (animate !== false)
            this.animateScrolling(initialScroll, callback);
        };
        VirtualRenderer2.prototype.animateScrolling = function(fromValue, callback) {
          var toValue = this.scrollTop;
          if (!this.$animatedScroll)
            return;
          var _self = this;
          if (fromValue == toValue)
            return;
          if (this.$scrollAnimation) {
            var oldSteps = this.$scrollAnimation.steps;
            if (oldSteps.length) {
              fromValue = oldSteps[0];
              if (fromValue == toValue)
                return;
            }
          }
          var steps = _self.$calcSteps(fromValue, toValue);
          this.$scrollAnimation = { from: fromValue, to: toValue, steps };
          clearInterval(this.$timer);
          _self.session.setScrollTop(steps.shift());
          _self.session.$scrollTop = toValue;
          function endAnimation() {
            _self.$timer = clearInterval(_self.$timer);
            _self.$scrollAnimation = null;
            _self.$stopAnimation = false;
            callback && callback();
          }
          this.$timer = setInterval(function() {
            if (_self.$stopAnimation) {
              endAnimation();
              return;
            }
            if (!_self.session)
              return clearInterval(_self.$timer);
            if (steps.length) {
              _self.session.setScrollTop(steps.shift());
              _self.session.$scrollTop = toValue;
            } else if (toValue != null) {
              _self.session.$scrollTop = -1;
              _self.session.setScrollTop(toValue);
              toValue = null;
            } else {
              endAnimation();
            }
          }, 10);
        };
        VirtualRenderer2.prototype.scrollToY = function(scrollTop) {
          if (this.scrollTop !== scrollTop) {
            this.$loop.schedule(this.CHANGE_SCROLL);
            this.scrollTop = scrollTop;
          }
        };
        VirtualRenderer2.prototype.scrollToX = function(scrollLeft) {
          if (this.scrollLeft !== scrollLeft)
            this.scrollLeft = scrollLeft;
          this.$loop.schedule(this.CHANGE_H_SCROLL);
        };
        VirtualRenderer2.prototype.scrollTo = function(x, y) {
          this.session.setScrollTop(y);
          this.session.setScrollLeft(x);
        };
        VirtualRenderer2.prototype.scrollBy = function(deltaX, deltaY) {
          deltaY && this.session.setScrollTop(this.session.getScrollTop() + deltaY);
          deltaX && this.session.setScrollLeft(this.session.getScrollLeft() + deltaX);
        };
        VirtualRenderer2.prototype.isScrollableBy = function(deltaX, deltaY) {
          if (deltaY < 0 && this.session.getScrollTop() >= 1 - this.scrollMargin.top)
            return true;
          if (deltaY > 0 && this.session.getScrollTop() + this.$size.scrollerHeight - this.layerConfig.maxHeight < -1 + this.scrollMargin.bottom)
            return true;
          if (deltaX < 0 && this.session.getScrollLeft() >= 1 - this.scrollMargin.left)
            return true;
          if (deltaX > 0 && this.session.getScrollLeft() + this.$size.scrollerWidth - this.layerConfig.width < -1 + this.scrollMargin.right)
            return true;
        };
        VirtualRenderer2.prototype.pixelToScreenCoordinates = function(x, y) {
          var canvasPos;
          if (this.$hasCssTransforms) {
            canvasPos = { top: 0, left: 0 };
            var p = this.$fontMetrics.transformCoordinates([x, y]);
            x = p[1] - this.gutterWidth - this.margin.left;
            y = p[0];
          } else {
            canvasPos = this.scroller.getBoundingClientRect();
          }
          var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;
          var offset = offsetX / this.characterWidth;
          var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);
          var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);
          return { row, column: col, side: offset - col > 0 ? 1 : -1, offsetX };
        };
        VirtualRenderer2.prototype.screenToTextCoordinates = function(x, y) {
          var canvasPos;
          if (this.$hasCssTransforms) {
            canvasPos = { top: 0, left: 0 };
            var p = this.$fontMetrics.transformCoordinates([x, y]);
            x = p[1] - this.gutterWidth - this.margin.left;
            y = p[0];
          } else {
            canvasPos = this.scroller.getBoundingClientRect();
          }
          var offsetX = x + this.scrollLeft - canvasPos.left - this.$padding;
          var offset = offsetX / this.characterWidth;
          var col = this.$blockCursor ? Math.floor(offset) : Math.round(offset);
          var row = Math.floor((y + this.scrollTop - canvasPos.top) / this.lineHeight);
          return this.session.screenToDocumentPosition(row, Math.max(col, 0), offsetX);
        };
        VirtualRenderer2.prototype.textToScreenCoordinates = function(row, column) {
          var canvasPos = this.scroller.getBoundingClientRect();
          var pos = this.session.documentToScreenPosition(row, column);
          var x = this.$padding + (this.session.$bidiHandler.isBidiRow(pos.row, row) ? this.session.$bidiHandler.getPosLeft(pos.column) : Math.round(pos.column * this.characterWidth));
          var y = pos.row * this.lineHeight;
          return {
            pageX: canvasPos.left + x - this.scrollLeft,
            pageY: canvasPos.top + y - this.scrollTop
          };
        };
        VirtualRenderer2.prototype.visualizeFocus = function() {
          dom.addCssClass(this.container, "ace_focus");
        };
        VirtualRenderer2.prototype.visualizeBlur = function() {
          dom.removeCssClass(this.container, "ace_focus");
        };
        VirtualRenderer2.prototype.showComposition = function(composition) {
          this.$composition = composition;
          if (!composition.cssText) {
            composition.cssText = this.textarea.style.cssText;
          }
          if (composition.useTextareaForIME == void 0)
            composition.useTextareaForIME = this.$useTextareaForIME;
          if (this.$useTextareaForIME) {
            dom.addCssClass(this.textarea, "ace_composition");
            this.textarea.style.cssText = "";
            this.$moveTextAreaToCursor();
            this.$cursorLayer.element.style.display = "none";
          } else {
            composition.markerId = this.session.addMarker(composition.markerRange, "ace_composition_marker", "text");
          }
        };
        VirtualRenderer2.prototype.setCompositionText = function(text) {
          var cursor = this.session.selection.cursor;
          this.addToken(text, "composition_placeholder", cursor.row, cursor.column);
          this.$moveTextAreaToCursor();
        };
        VirtualRenderer2.prototype.hideComposition = function() {
          if (!this.$composition)
            return;
          if (this.$composition.markerId)
            this.session.removeMarker(this.$composition.markerId);
          dom.removeCssClass(this.textarea, "ace_composition");
          this.textarea.style.cssText = this.$composition.cssText;
          var cursor = this.session.selection.cursor;
          this.removeExtraToken(cursor.row, cursor.column);
          this.$composition = null;
          this.$cursorLayer.element.style.display = "";
        };
        VirtualRenderer2.prototype.setGhostText = function(text, position) {
          var cursor = this.session.selection.cursor;
          var insertPosition = position || { row: cursor.row, column: cursor.column };
          this.removeGhostText();
          var textLines = text.split("\n");
          this.addToken(textLines[0], "ghost_text", insertPosition.row, insertPosition.column);
          this.$ghostText = {
            text,
            position: {
              row: insertPosition.row,
              column: insertPosition.column
            }
          };
          if (textLines.length > 1) {
            this.$ghostTextWidget = {
              text: textLines.slice(1).join("\n"),
              row: insertPosition.row,
              column: insertPosition.column,
              className: "ace_ghost_text"
            };
            this.session.widgetManager.addLineWidget(this.$ghostTextWidget);
          }
        };
        VirtualRenderer2.prototype.removeGhostText = function() {
          if (!this.$ghostText)
            return;
          var position = this.$ghostText.position;
          this.removeExtraToken(position.row, position.column);
          if (this.$ghostTextWidget) {
            this.session.widgetManager.removeLineWidget(this.$ghostTextWidget);
            this.$ghostTextWidget = null;
          }
          this.$ghostText = null;
        };
        VirtualRenderer2.prototype.addToken = function(text, type, row, column) {
          var session = this.session;
          session.bgTokenizer.lines[row] = null;
          var newToken = { type, value: text };
          var tokens = session.getTokens(row);
          if (column == null || !tokens.length) {
            tokens.push(newToken);
          } else {
            var l = 0;
            for (var i2 = 0; i2 < tokens.length; i2++) {
              var token = tokens[i2];
              l += token.value.length;
              if (column <= l) {
                var diff = token.value.length - (l - column);
                var before = token.value.slice(0, diff);
                var after = token.value.slice(diff);
                tokens.splice(i2, 1, { type: token.type, value: before }, newToken, { type: token.type, value: after });
                break;
              }
            }
          }
          this.updateLines(row, row);
        };
        VirtualRenderer2.prototype.removeExtraToken = function(row, column) {
          this.session.bgTokenizer.lines[row] = null;
          this.updateLines(row, row);
        };
        VirtualRenderer2.prototype.setTheme = function(theme2, cb) {
          var _self = this;
          this.$themeId = theme2;
          _self._dispatchEvent("themeChange", { theme: theme2 });
          if (!theme2 || typeof theme2 == "string") {
            var moduleName = theme2 || this.$options.theme.initialValue;
            config2.loadModule(["theme", moduleName], afterLoad);
          } else {
            afterLoad(theme2);
          }
          function afterLoad(module4) {
            if (_self.$themeId != theme2)
              return cb && cb();
            if (!module4 || !module4.cssClass)
              throw new Error("couldn't load module " + theme2 + " or it didn't call define");
            if (module4.$id)
              _self.$themeId = module4.$id;
            dom.importCssString(module4.cssText, module4.cssClass, _self.container);
            if (_self.theme)
              dom.removeCssClass(_self.container, _self.theme.cssClass);
            var padding = "padding" in module4 ? module4.padding : "padding" in (_self.theme || {}) ? 4 : _self.$padding;
            if (_self.$padding && padding != _self.$padding)
              _self.setPadding(padding);
            _self.$theme = module4.cssClass;
            _self.theme = module4;
            dom.addCssClass(_self.container, module4.cssClass);
            dom.setCssClass(_self.container, "ace_dark", module4.isDark);
            if (_self.$size) {
              _self.$size.width = 0;
              _self.$updateSizeAsync();
            }
            _self._dispatchEvent("themeLoaded", { theme: module4 });
            cb && cb();
          }
        };
        VirtualRenderer2.prototype.getTheme = function() {
          return this.$themeId;
        };
        VirtualRenderer2.prototype.setStyle = function(style, include) {
          dom.setCssClass(this.container, style, include !== false);
        };
        VirtualRenderer2.prototype.unsetStyle = function(style) {
          dom.removeCssClass(this.container, style);
        };
        VirtualRenderer2.prototype.setCursorStyle = function(style) {
          dom.setStyle(this.scroller.style, "cursor", style);
        };
        VirtualRenderer2.prototype.setMouseCursor = function(cursorStyle) {
          dom.setStyle(this.scroller.style, "cursor", cursorStyle);
        };
        VirtualRenderer2.prototype.attachToShadowRoot = function() {
          dom.importCssString(editorCss, "ace_editor.css", this.container);
        };
        VirtualRenderer2.prototype.destroy = function() {
          this.freeze();
          this.$fontMetrics.destroy();
          this.$cursorLayer.destroy();
          this.removeAllListeners();
          this.container.textContent = "";
          this.setOption("useResizeObserver", false);
        };
        VirtualRenderer2.prototype.$updateCustomScrollbar = function(val) {
          var _self = this;
          this.$horizScroll = this.$vScroll = null;
          this.scrollBarV.element.remove();
          this.scrollBarH.element.remove();
          if (this.$scrollDecorator) {
            delete this.$scrollDecorator;
          }
          if (val === true) {
            this.scrollBarV = new VScrollBarCustom(this.container, this);
            this.scrollBarH = new HScrollBarCustom(this.container, this);
            this.scrollBarV.setHeight(this.$size.scrollerHeight);
            this.scrollBarH.setWidth(this.$size.scrollerWidth);
            this.scrollBarV.addEventListener("scroll", function(e) {
              if (!_self.$scrollAnimation)
                _self.session.setScrollTop(e.data - _self.scrollMargin.top);
            });
            this.scrollBarH.addEventListener("scroll", function(e) {
              if (!_self.$scrollAnimation)
                _self.session.setScrollLeft(e.data - _self.scrollMargin.left);
            });
            this.$scrollDecorator = new Decorator(this.scrollBarV, this);
            this.$scrollDecorator.$updateDecorators();
          } else {
            this.scrollBarV = new VScrollBar(this.container, this);
            this.scrollBarH = new HScrollBar(this.container, this);
            this.scrollBarV.addEventListener("scroll", function(e) {
              if (!_self.$scrollAnimation)
                _self.session.setScrollTop(e.data - _self.scrollMargin.top);
            });
            this.scrollBarH.addEventListener("scroll", function(e) {
              if (!_self.$scrollAnimation)
                _self.session.setScrollLeft(e.data - _self.scrollMargin.left);
            });
          }
        };
        VirtualRenderer2.prototype.$addResizeObserver = function() {
          if (!window.ResizeObserver || this.$resizeObserver)
            return;
          var self2 = this;
          this.$resizeTimer = lang.delayedCall(function() {
            if (!self2.destroyed)
              self2.onResize();
          }, 50);
          this.$resizeObserver = new window.ResizeObserver(function(e) {
            var w = e[0].contentRect.width;
            var h = e[0].contentRect.height;
            if (Math.abs(self2.$size.width - w) > 1 || Math.abs(self2.$size.height - h) > 1) {
              self2.$resizeTimer.delay();
            } else {
              self2.$resizeTimer.cancel();
            }
          });
          this.$resizeObserver.observe(this.container);
        };
        return VirtualRenderer2;
      }();
      VirtualRenderer.prototype.CHANGE_CURSOR = 1;
      VirtualRenderer.prototype.CHANGE_MARKER = 2;
      VirtualRenderer.prototype.CHANGE_GUTTER = 4;
      VirtualRenderer.prototype.CHANGE_SCROLL = 8;
      VirtualRenderer.prototype.CHANGE_LINES = 16;
      VirtualRenderer.prototype.CHANGE_TEXT = 32;
      VirtualRenderer.prototype.CHANGE_SIZE = 64;
      VirtualRenderer.prototype.CHANGE_MARKER_BACK = 128;
      VirtualRenderer.prototype.CHANGE_MARKER_FRONT = 256;
      VirtualRenderer.prototype.CHANGE_FULL = 512;
      VirtualRenderer.prototype.CHANGE_H_SCROLL = 1024;
      VirtualRenderer.prototype.$changes = 0;
      VirtualRenderer.prototype.$padding = null;
      VirtualRenderer.prototype.$frozen = false;
      VirtualRenderer.prototype.STEPS = 8;
      oop.implement(VirtualRenderer.prototype, EventEmitter);
      config2.defineOptions(VirtualRenderer.prototype, "renderer", {
        useResizeObserver: {
          set: function(value2) {
            if (!value2 && this.$resizeObserver) {
              this.$resizeObserver.disconnect();
              this.$resizeTimer.cancel();
              this.$resizeTimer = this.$resizeObserver = null;
            } else if (value2 && !this.$resizeObserver) {
              this.$addResizeObserver();
            }
          }
        },
        animatedScroll: { initialValue: false },
        showInvisibles: {
          set: function(value2) {
            if (this.$textLayer.setShowInvisibles(value2))
              this.$loop.schedule(this.CHANGE_TEXT);
          },
          initialValue: false
        },
        showPrintMargin: {
          set: function() {
            this.$updatePrintMargin();
          },
          initialValue: true
        },
        printMarginColumn: {
          set: function() {
            this.$updatePrintMargin();
          },
          initialValue: 80
        },
        printMargin: {
          set: function(val) {
            if (typeof val == "number")
              this.$printMarginColumn = val;
            this.$showPrintMargin = !!val;
            this.$updatePrintMargin();
          },
          get: function() {
            return this.$showPrintMargin && this.$printMarginColumn;
          }
        },
        showGutter: {
          set: function(show) {
            this.$gutter.style.display = show ? "block" : "none";
            this.$loop.schedule(this.CHANGE_FULL);
            this.onGutterResize();
          },
          initialValue: true
        },
        useSvgGutterIcons: {
          set: function(value2) {
            this.$gutterLayer.$useSvgGutterIcons = value2;
          },
          initialValue: false
        },
        showFoldedAnnotations: {
          set: function(value2) {
            this.$gutterLayer.$showFoldedAnnotations = value2;
          },
          initialValue: false
        },
        fadeFoldWidgets: {
          set: function(show) {
            dom.setCssClass(this.$gutter, "ace_fade-fold-widgets", show);
          },
          initialValue: false
        },
        showFoldWidgets: {
          set: function(show) {
            this.$gutterLayer.setShowFoldWidgets(show);
            this.$loop.schedule(this.CHANGE_GUTTER);
          },
          initialValue: true
        },
        displayIndentGuides: {
          set: function(show) {
            if (this.$textLayer.setDisplayIndentGuides(show))
              this.$loop.schedule(this.CHANGE_TEXT);
          },
          initialValue: true
        },
        highlightIndentGuides: {
          set: function(show) {
            if (this.$textLayer.setHighlightIndentGuides(show) == true) {
              this.$textLayer.$highlightIndentGuide();
            } else {
              this.$textLayer.$clearActiveIndentGuide(this.$textLayer.$lines.cells);
            }
          },
          initialValue: true
        },
        highlightGutterLine: {
          set: function(shouldHighlight) {
            this.$gutterLayer.setHighlightGutterLine(shouldHighlight);
            this.$loop.schedule(this.CHANGE_GUTTER);
          },
          initialValue: true
        },
        hScrollBarAlwaysVisible: {
          set: function(val) {
            if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)
              this.$loop.schedule(this.CHANGE_SCROLL);
          },
          initialValue: false
        },
        vScrollBarAlwaysVisible: {
          set: function(val) {
            if (!this.$vScrollBarAlwaysVisible || !this.$vScroll)
              this.$loop.schedule(this.CHANGE_SCROLL);
          },
          initialValue: false
        },
        fontSize: {
          set: function(size) {
            if (typeof size == "number")
              size = size + "px";
            this.container.style.fontSize = size;
            this.updateFontSize();
          },
          initialValue: 12
        },
        fontFamily: {
          set: function(name2) {
            this.container.style.fontFamily = name2;
            this.updateFontSize();
          }
        },
        maxLines: {
          set: function(val) {
            this.updateFull();
          }
        },
        minLines: {
          set: function(val) {
            if (!(this.$minLines < 562949953421311))
              this.$minLines = 0;
            this.updateFull();
          }
        },
        maxPixelHeight: {
          set: function(val) {
            this.updateFull();
          },
          initialValue: 0
        },
        scrollPastEnd: {
          set: function(val) {
            val = +val || 0;
            if (this.$scrollPastEnd == val)
              return;
            this.$scrollPastEnd = val;
            this.$loop.schedule(this.CHANGE_SCROLL);
          },
          initialValue: 0,
          handlesSet: true
        },
        fixedWidthGutter: {
          set: function(val) {
            this.$gutterLayer.$fixedWidth = !!val;
            this.$loop.schedule(this.CHANGE_GUTTER);
          }
        },
        customScrollbar: {
          set: function(val) {
            this.$updateCustomScrollbar(val);
          },
          initialValue: false
        },
        theme: {
          set: function(val) {
            this.setTheme(val);
          },
          get: function() {
            return this.$themeId || this.theme;
          },
          initialValue: "./theme/textmate",
          handlesSet: true
        },
        hasCssTransforms: {},
        useTextareaForIME: {
          initialValue: !useragent.isMobile && !useragent.isIE
        }
      });
      exports3.VirtualRenderer = VirtualRenderer;
    });
    ace.define("ace/worker/worker_client", ["require", "exports", "module", "ace/lib/oop", "ace/lib/net", "ace/lib/event_emitter", "ace/config"], function(require2, exports3, module3) {
      var oop = require2("../lib/oop");
      var net = require2("../lib/net");
      var EventEmitter = require2("../lib/event_emitter").EventEmitter;
      var config2 = require2("../config");
      function $workerBlob(workerUrl) {
        var script = "importScripts('" + net.qualifyURL(workerUrl) + "');";
        try {
          return new Blob([script], { "type": "application/javascript" });
        } catch (e) {
          var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
          var blobBuilder = new BlobBuilder();
          blobBuilder.append(script);
          return blobBuilder.getBlob("application/javascript");
        }
      }
      function createWorker(workerUrl) {
        if (typeof Worker == "undefined")
          return { postMessage: function() {
          }, terminate: function() {
          } };
        if (config2.get("loadWorkerFromBlob")) {
          var blob = $workerBlob(workerUrl);
          var URL = window.URL || window.webkitURL;
          var blobURL = URL.createObjectURL(blob);
          return new Worker(blobURL);
        }
        return new Worker(workerUrl);
      }
      var WorkerClient = function(worker) {
        if (!worker.postMessage)
          worker = this.$createWorkerFromOldConfig.apply(this, arguments);
        this.$worker = worker;
        this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
        this.changeListener = this.changeListener.bind(this);
        this.onMessage = this.onMessage.bind(this);
        this.callbackId = 1;
        this.callbacks = {};
        this.$worker.onmessage = this.onMessage;
      };
      (function() {
        oop.implement(this, EventEmitter);
        this.$createWorkerFromOldConfig = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {
          if (require2.nameToUrl && !require2.toUrl)
            require2.toUrl = require2.nameToUrl;
          if (config2.get("packaged") || !require2.toUrl) {
            workerUrl = workerUrl || config2.moduleUrl(mod, "worker");
          } else {
            var normalizePath = this.$normalizePath;
            workerUrl = workerUrl || normalizePath(require2.toUrl("ace/worker/worker.js", null, "_"));
            var tlns = {};
            topLevelNamespaces.forEach(function(ns) {
              tlns[ns] = normalizePath(require2.toUrl(ns, null, "_").replace(/(\.js)?(\?.*)?$/, ""));
            });
          }
          this.$worker = createWorker(workerUrl);
          if (importScripts) {
            this.send("importScripts", importScripts);
          }
          this.$worker.postMessage({
            init: true,
            tlns,
            module: mod,
            classname
          });
          return this.$worker;
        };
        this.onMessage = function(e) {
          var msg = e.data;
          switch (msg.type) {
            case "event":
              this._signal(msg.name, { data: msg.data });
              break;
            case "call":
              var callback = this.callbacks[msg.id];
              if (callback) {
                callback(msg.data);
                delete this.callbacks[msg.id];
              }
              break;
            case "error":
              this.reportError(msg.data);
              break;
            case "log":
              window.console && console.log && console.log.apply(console, msg.data);
              break;
          }
        };
        this.reportError = function(err) {
          window.console && console.error && console.error(err);
        };
        this.$normalizePath = function(path) {
          return net.qualifyURL(path);
        };
        this.terminate = function() {
          this._signal("terminate", {});
          this.deltaQueue = null;
          this.$worker.terminate();
          this.$worker.onerror = function(e) {
            e.preventDefault();
          };
          this.$worker = null;
          if (this.$doc)
            this.$doc.off("change", this.changeListener);
          this.$doc = null;
        };
        this.send = function(cmd2, args) {
          this.$worker.postMessage({ command: cmd2, args });
        };
        this.call = function(cmd2, args, callback) {
          if (callback) {
            var id2 = this.callbackId++;
            this.callbacks[id2] = callback;
            args.push(id2);
          }
          this.send(cmd2, args);
        };
        this.emit = function(event, data2) {
          try {
            if (data2.data && data2.data.err)
              data2.data.err = { message: data2.data.err.message, stack: data2.data.err.stack, code: data2.data.err.code };
            this.$worker && this.$worker.postMessage({ event, data: { data: data2.data } });
          } catch (ex) {
            console.error(ex.stack);
          }
        };
        this.attachToDocument = function(doc2) {
          if (this.$doc)
            this.terminate();
          this.$doc = doc2;
          this.call("setValue", [doc2.getValue()]);
          doc2.on("change", this.changeListener, true);
        };
        this.changeListener = function(delta) {
          if (!this.deltaQueue) {
            this.deltaQueue = [];
            setTimeout(this.$sendDeltaQueue, 0);
          }
          if (delta.action == "insert")
            this.deltaQueue.push(delta.start, delta.lines);
          else
            this.deltaQueue.push(delta.start, delta.end);
        };
        this.$sendDeltaQueue = function() {
          var q = this.deltaQueue;
          if (!q)
            return;
          this.deltaQueue = null;
          if (q.length > 50 && q.length > this.$doc.getLength() >> 1) {
            this.call("setValue", [this.$doc.getValue()]);
          } else
            this.emit("change", { data: q });
        };
      }).call(WorkerClient.prototype);
      var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
        var main = null;
        var emitSync = false;
        var sender = Object.create(EventEmitter);
        var messageBuffer = [];
        var workerClient = new WorkerClient({
          messageBuffer,
          terminate: function() {
          },
          postMessage: function(e) {
            messageBuffer.push(e);
            if (!main)
              return;
            if (emitSync)
              setTimeout(processNext);
            else
              processNext();
          }
        });
        workerClient.setEmitSync = function(val) {
          emitSync = val;
        };
        var processNext = function() {
          var msg = messageBuffer.shift();
          if (msg.command)
            main[msg.command].apply(main, msg.args);
          else if (msg.event)
            sender._signal(msg.event, msg.data);
        };
        sender.postMessage = function(msg) {
          workerClient.onMessage({ data: msg });
        };
        sender.callback = function(data2, callbackId) {
          this.postMessage({ type: "call", id: callbackId, data: data2 });
        };
        sender.emit = function(name2, data2) {
          this.postMessage({ type: "event", name: name2, data: data2 });
        };
        config2.loadModule(["worker", mod], function(Main) {
          main = new Main[classname](sender);
          while (messageBuffer.length)
            processNext();
        });
        return workerClient;
      };
      exports3.UIWorkerClient = UIWorkerClient;
      exports3.WorkerClient = WorkerClient;
      exports3.createWorker = createWorker;
    });
    ace.define("ace/placeholder", ["require", "exports", "module", "ace/range", "ace/lib/event_emitter", "ace/lib/oop"], function(require2, exports3, module3) {
      var Range2 = require2("./range").Range;
      var EventEmitter = require2("./lib/event_emitter").EventEmitter;
      var oop = require2("./lib/oop");
      var PlaceHolder = function() {
        function PlaceHolder2(session, length, pos, others, mainClass, othersClass) {
          var _self = this;
          this.length = length;
          this.session = session;
          this.doc = session.getDocument();
          this.mainClass = mainClass;
          this.othersClass = othersClass;
          this.$onUpdate = this.onUpdate.bind(this);
          this.doc.on("change", this.$onUpdate, true);
          this.$others = others;
          this.$onCursorChange = function() {
            setTimeout(function() {
              _self.onCursorChange();
            });
          };
          this.$pos = pos;
          var undoStack = session.getUndoManager().$undoStack || session.getUndoManager().$undostack || { length: -1 };
          this.$undoStackDepth = undoStack.length;
          this.setup();
          session.selection.on("changeCursor", this.$onCursorChange);
        }
        PlaceHolder2.prototype.setup = function() {
          var _self = this;
          var doc2 = this.doc;
          var session = this.session;
          this.selectionBefore = session.selection.toJSON();
          if (session.selection.inMultiSelectMode)
            session.selection.toSingleRange();
          this.pos = doc2.createAnchor(this.$pos.row, this.$pos.column);
          var pos = this.pos;
          pos.$insertRight = true;
          pos.detach();
          pos.markerId = session.addMarker(new Range2(pos.row, pos.column, pos.row, pos.column + this.length), this.mainClass, null, false);
          this.others = [];
          this.$others.forEach(function(other) {
            var anchor = doc2.createAnchor(other.row, other.column);
            anchor.$insertRight = true;
            anchor.detach();
            _self.others.push(anchor);
          });
          session.setUndoSelect(false);
        };
        PlaceHolder2.prototype.showOtherMarkers = function() {
          if (this.othersActive)
            return;
          var session = this.session;
          var _self = this;
          this.othersActive = true;
          this.others.forEach(function(anchor) {
            anchor.markerId = session.addMarker(new Range2(anchor.row, anchor.column, anchor.row, anchor.column + _self.length), _self.othersClass, null, false);
          });
        };
        PlaceHolder2.prototype.hideOtherMarkers = function() {
          if (!this.othersActive)
            return;
          this.othersActive = false;
          for (var i2 = 0; i2 < this.others.length; i2++) {
            this.session.removeMarker(this.others[i2].markerId);
          }
        };
        PlaceHolder2.prototype.onUpdate = function(delta) {
          if (this.$updating)
            return this.updateAnchors(delta);
          var range = delta;
          if (range.start.row !== range.end.row)
            return;
          if (range.start.row !== this.pos.row)
            return;
          this.$updating = true;
          var lengthDiff = delta.action === "insert" ? range.end.column - range.start.column : range.start.column - range.end.column;
          var inMainRange = range.start.column >= this.pos.column && range.start.column <= this.pos.column + this.length + 1;
          var distanceFromStart = range.start.column - this.pos.column;
          this.updateAnchors(delta);
          if (inMainRange)
            this.length += lengthDiff;
          if (inMainRange && !this.session.$fromUndo) {
            if (delta.action === "insert") {
              for (var i2 = this.others.length - 1; i2 >= 0; i2--) {
                var otherPos = this.others[i2];
                var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };
                this.doc.insertMergedLines(newPos, delta.lines);
              }
            } else if (delta.action === "remove") {
              for (var i2 = this.others.length - 1; i2 >= 0; i2--) {
                var otherPos = this.others[i2];
                var newPos = { row: otherPos.row, column: otherPos.column + distanceFromStart };
                this.doc.remove(new Range2(newPos.row, newPos.column, newPos.row, newPos.column - lengthDiff));
              }
            }
          }
          this.$updating = false;
          this.updateMarkers();
        };
        PlaceHolder2.prototype.updateAnchors = function(delta) {
          this.pos.onChange(delta);
          for (var i2 = this.others.length; i2--; )
            this.others[i2].onChange(delta);
          this.updateMarkers();
        };
        PlaceHolder2.prototype.updateMarkers = function() {
          if (this.$updating)
            return;
          var _self = this;
          var session = this.session;
          var updateMarker = function(pos, className) {
            session.removeMarker(pos.markerId);
            pos.markerId = session.addMarker(new Range2(pos.row, pos.column, pos.row, pos.column + _self.length), className, null, false);
          };
          updateMarker(this.pos, this.mainClass);
          for (var i2 = this.others.length; i2--; )
            updateMarker(this.others[i2], this.othersClass);
        };
        PlaceHolder2.prototype.onCursorChange = function(event) {
          if (this.$updating || !this.session)
            return;
          var pos = this.session.selection.getCursor();
          if (pos.row === this.pos.row && pos.column >= this.pos.column && pos.column <= this.pos.column + this.length) {
            this.showOtherMarkers();
            this._emit("cursorEnter", event);
          } else {
            this.hideOtherMarkers();
            this._emit("cursorLeave", event);
          }
        };
        PlaceHolder2.prototype.detach = function() {
          this.session.removeMarker(this.pos && this.pos.markerId);
          this.hideOtherMarkers();
          this.doc.off("change", this.$onUpdate);
          this.session.selection.off("changeCursor", this.$onCursorChange);
          this.session.setUndoSelect(true);
          this.session = null;
        };
        PlaceHolder2.prototype.cancel = function() {
          if (this.$undoStackDepth === -1)
            return;
          var undoManager = this.session.getUndoManager();
          var undosRequired = (undoManager.$undoStack || undoManager.$undostack).length - this.$undoStackDepth;
          for (var i2 = 0; i2 < undosRequired; i2++) {
            undoManager.undo(this.session, true);
          }
          if (this.selectionBefore)
            this.session.selection.fromJSON(this.selectionBefore);
        };
        return PlaceHolder2;
      }();
      oop.implement(PlaceHolder.prototype, EventEmitter);
      exports3.PlaceHolder = PlaceHolder;
    });
    ace.define("ace/mouse/multi_select_handler", ["require", "exports", "module", "ace/lib/event", "ace/lib/useragent"], function(require2, exports3, module3) {
      var event = require2("../lib/event");
      var useragent = require2("../lib/useragent");
      function isSamePoint(p1, p2) {
        return p1.row == p2.row && p1.column == p2.column;
      }
      function onMouseDown(e) {
        var ev = e.domEvent;
        var alt = ev.altKey;
        var shift2 = ev.shiftKey;
        var ctrl = ev.ctrlKey;
        var accel = e.getAccelKey();
        var button = e.getButton();
        if (ctrl && useragent.isMac)
          button = ev.button;
        if (e.editor.inMultiSelectMode && button == 2) {
          e.editor.textInput.onContextMenu(e.domEvent);
          return;
        }
        if (!ctrl && !alt && !accel) {
          if (button === 0 && e.editor.inMultiSelectMode)
            e.editor.exitMultiSelectMode();
          return;
        }
        if (button !== 0)
          return;
        var editor = e.editor;
        var selection = editor.selection;
        var isMultiSelect = editor.inMultiSelectMode;
        var pos = e.getDocumentPosition();
        var cursor = selection.getCursor();
        var inSelection = e.inSelection() || selection.isEmpty() && isSamePoint(pos, cursor);
        var mouseX = e.x, mouseY = e.y;
        var onMouseSelection = function(e2) {
          mouseX = e2.clientX;
          mouseY = e2.clientY;
        };
        var session = editor.session;
        var screenAnchor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);
        var screenCursor = screenAnchor;
        var selectionMode;
        if (editor.$mouseHandler.$enableJumpToDef) {
          if (ctrl && alt || accel && alt)
            selectionMode = shift2 ? "block" : "add";
          else if (alt && editor.$blockSelectEnabled)
            selectionMode = "block";
        } else {
          if (accel && !alt) {
            selectionMode = "add";
            if (!isMultiSelect && shift2)
              return;
          } else if (alt && editor.$blockSelectEnabled) {
            selectionMode = "block";
          }
        }
        if (selectionMode && useragent.isMac && ev.ctrlKey) {
          editor.$mouseHandler.cancelContextMenu();
        }
        if (selectionMode == "add") {
          if (!isMultiSelect && inSelection)
            return;
          if (!isMultiSelect) {
            var range = selection.toOrientedRange();
            editor.addSelectionMarker(range);
          }
          var oldRange = selection.rangeList.rangeAtPoint(pos);
          editor.inVirtualSelectionMode = true;
          if (shift2) {
            oldRange = null;
            range = selection.ranges[0] || range;
            editor.removeSelectionMarker(range);
          }
          editor.once("mouseup", function() {
            var tmpSel = selection.toOrientedRange();
            if (oldRange && tmpSel.isEmpty() && isSamePoint(oldRange.cursor, tmpSel.cursor))
              selection.substractPoint(tmpSel.cursor);
            else {
              if (shift2) {
                selection.substractPoint(range.cursor);
              } else if (range) {
                editor.removeSelectionMarker(range);
                selection.addRange(range);
              }
              selection.addRange(tmpSel);
            }
            editor.inVirtualSelectionMode = false;
          });
        } else if (selectionMode == "block") {
          e.stop();
          editor.inVirtualSelectionMode = true;
          var initialRange;
          var rectSel = [];
          var blockSelect = function() {
            var newCursor = editor.renderer.pixelToScreenCoordinates(mouseX, mouseY);
            var cursor2 = session.screenToDocumentPosition(newCursor.row, newCursor.column, newCursor.offsetX);
            if (isSamePoint(screenCursor, newCursor) && isSamePoint(cursor2, selection.lead))
              return;
            screenCursor = newCursor;
            editor.selection.moveToPosition(cursor2);
            editor.renderer.scrollCursorIntoView();
            editor.removeSelectionMarkers(rectSel);
            rectSel = selection.rectangularRangeBlock(screenCursor, screenAnchor);
            if (editor.$mouseHandler.$clickSelection && rectSel.length == 1 && rectSel[0].isEmpty())
              rectSel[0] = editor.$mouseHandler.$clickSelection.clone();
            rectSel.forEach(editor.addSelectionMarker, editor);
            editor.updateSelectionMarkers();
          };
          if (isMultiSelect && !accel) {
            selection.toSingleRange();
          } else if (!isMultiSelect && accel) {
            initialRange = selection.toOrientedRange();
            editor.addSelectionMarker(initialRange);
          }
          if (shift2)
            screenAnchor = session.documentToScreenPosition(selection.lead);
          else
            selection.moveToPosition(pos);
          screenCursor = { row: -1, column: -1 };
          var onMouseSelectionEnd = function(e2) {
            blockSelect();
            clearInterval(timerId);
            editor.removeSelectionMarkers(rectSel);
            if (!rectSel.length)
              rectSel = [selection.toOrientedRange()];
            if (initialRange) {
              editor.removeSelectionMarker(initialRange);
              selection.toSingleRange(initialRange);
            }
            for (var i2 = 0; i2 < rectSel.length; i2++)
              selection.addRange(rectSel[i2]);
            editor.inVirtualSelectionMode = false;
            editor.$mouseHandler.$clickSelection = null;
          };
          var onSelectionInterval = blockSelect;
          event.capture(editor.container, onMouseSelection, onMouseSelectionEnd);
          var timerId = setInterval(function() {
            onSelectionInterval();
          }, 20);
          return e.preventDefault();
        }
      }
      exports3.onMouseDown = onMouseDown;
    });
    ace.define("ace/commands/multi_select_commands", ["require", "exports", "module", "ace/keyboard/hash_handler"], function(require2, exports3, module3) {
      exports3.defaultCommands = [{
        name: "addCursorAbove",
        description: "Add cursor above",
        exec: function(editor) {
          editor.selectMoreLines(-1);
        },
        bindKey: { win: "Ctrl-Alt-Up", mac: "Ctrl-Alt-Up" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "addCursorBelow",
        description: "Add cursor below",
        exec: function(editor) {
          editor.selectMoreLines(1);
        },
        bindKey: { win: "Ctrl-Alt-Down", mac: "Ctrl-Alt-Down" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "addCursorAboveSkipCurrent",
        description: "Add cursor above (skip current)",
        exec: function(editor) {
          editor.selectMoreLines(-1, true);
        },
        bindKey: { win: "Ctrl-Alt-Shift-Up", mac: "Ctrl-Alt-Shift-Up" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "addCursorBelowSkipCurrent",
        description: "Add cursor below (skip current)",
        exec: function(editor) {
          editor.selectMoreLines(1, true);
        },
        bindKey: { win: "Ctrl-Alt-Shift-Down", mac: "Ctrl-Alt-Shift-Down" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "selectMoreBefore",
        description: "Select more before",
        exec: function(editor) {
          editor.selectMore(-1);
        },
        bindKey: { win: "Ctrl-Alt-Left", mac: "Ctrl-Alt-Left" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "selectMoreAfter",
        description: "Select more after",
        exec: function(editor) {
          editor.selectMore(1);
        },
        bindKey: { win: "Ctrl-Alt-Right", mac: "Ctrl-Alt-Right" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "selectNextBefore",
        description: "Select next before",
        exec: function(editor) {
          editor.selectMore(-1, true);
        },
        bindKey: { win: "Ctrl-Alt-Shift-Left", mac: "Ctrl-Alt-Shift-Left" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "selectNextAfter",
        description: "Select next after",
        exec: function(editor) {
          editor.selectMore(1, true);
        },
        bindKey: { win: "Ctrl-Alt-Shift-Right", mac: "Ctrl-Alt-Shift-Right" },
        scrollIntoView: "cursor",
        readOnly: true
      }, {
        name: "toggleSplitSelectionIntoLines",
        description: "Split selection into lines",
        exec: function(editor) {
          if (editor.multiSelect.rangeCount > 1)
            editor.multiSelect.joinSelections();
          else
            editor.multiSelect.splitIntoLines();
        },
        bindKey: { win: "Ctrl-Alt-L", mac: "Ctrl-Alt-L" },
        readOnly: true
      }, {
        name: "splitSelectionIntoLines",
        description: "Split into lines",
        exec: function(editor) {
          editor.multiSelect.splitIntoLines();
        },
        readOnly: true
      }, {
        name: "alignCursors",
        description: "Align cursors",
        exec: function(editor) {
          editor.alignCursors();
        },
        bindKey: { win: "Ctrl-Alt-A", mac: "Ctrl-Alt-A" },
        scrollIntoView: "cursor"
      }, {
        name: "findAll",
        description: "Find all",
        exec: function(editor) {
          editor.findAll();
        },
        bindKey: { win: "Ctrl-Alt-K", mac: "Ctrl-Alt-G" },
        scrollIntoView: "cursor",
        readOnly: true
      }];
      exports3.multiSelectCommands = [{
        name: "singleSelection",
        description: "Single selection",
        bindKey: "esc",
        exec: function(editor) {
          editor.exitMultiSelectMode();
        },
        scrollIntoView: "cursor",
        readOnly: true,
        isAvailable: function(editor) {
          return editor && editor.inMultiSelectMode;
        }
      }];
      var HashHandler = require2("../keyboard/hash_handler").HashHandler;
      exports3.keyboardHandler = new HashHandler(exports3.multiSelectCommands);
    });
    ace.define("ace/multi_select", ["require", "exports", "module", "ace/range_list", "ace/range", "ace/selection", "ace/mouse/multi_select_handler", "ace/lib/event", "ace/lib/lang", "ace/commands/multi_select_commands", "ace/search", "ace/edit_session", "ace/editor", "ace/config"], function(require2, exports3, module3) {
      var RangeList = require2("./range_list").RangeList;
      var Range2 = require2("./range").Range;
      var Selection = require2("./selection").Selection;
      var onMouseDown = require2("./mouse/multi_select_handler").onMouseDown;
      var event = require2("./lib/event");
      var lang = require2("./lib/lang");
      var commands = require2("./commands/multi_select_commands");
      exports3.commands = commands.defaultCommands.concat(commands.multiSelectCommands);
      var Search = require2("./search").Search;
      var search = new Search();
      function find2(session, needle, dir) {
        search.$options.wrap = true;
        search.$options.needle = needle;
        search.$options.backwards = dir == -1;
        return search.find(session);
      }
      var EditSession = require2("./edit_session").EditSession;
      (function() {
        this.getSelectionMarkers = function() {
          return this.$selectionMarkers;
        };
      }).call(EditSession.prototype);
      (function() {
        this.ranges = null;
        this.rangeList = null;
        this.addRange = function(range, $blockChangeEvents) {
          if (!range)
            return;
          if (!this.inMultiSelectMode && this.rangeCount === 0) {
            var oldRange = this.toOrientedRange();
            this.rangeList.add(oldRange);
            this.rangeList.add(range);
            if (this.rangeList.ranges.length != 2) {
              this.rangeList.removeAll();
              return $blockChangeEvents || this.fromOrientedRange(range);
            }
            this.rangeList.removeAll();
            this.rangeList.add(oldRange);
            this.$onAddRange(oldRange);
          }
          if (!range.cursor)
            range.cursor = range.end;
          var removed = this.rangeList.add(range);
          this.$onAddRange(range);
          if (removed.length)
            this.$onRemoveRange(removed);
          if (this.rangeCount > 1 && !this.inMultiSelectMode) {
            this._signal("multiSelect");
            this.inMultiSelectMode = true;
            this.session.$undoSelect = false;
            this.rangeList.attach(this.session);
          }
          return $blockChangeEvents || this.fromOrientedRange(range);
        };
        this.toSingleRange = function(range) {
          range = range || this.ranges[0];
          var removed = this.rangeList.removeAll();
          if (removed.length)
            this.$onRemoveRange(removed);
          range && this.fromOrientedRange(range);
        };
        this.substractPoint = function(pos) {
          var removed = this.rangeList.substractPoint(pos);
          if (removed) {
            this.$onRemoveRange(removed);
            return removed[0];
          }
        };
        this.mergeOverlappingRanges = function() {
          var removed = this.rangeList.merge();
          if (removed.length)
            this.$onRemoveRange(removed);
        };
        this.$onAddRange = function(range) {
          this.rangeCount = this.rangeList.ranges.length;
          this.ranges.unshift(range);
          this._signal("addRange", { range });
        };
        this.$onRemoveRange = function(removed) {
          this.rangeCount = this.rangeList.ranges.length;
          if (this.rangeCount == 1 && this.inMultiSelectMode) {
            var lastRange = this.rangeList.ranges.pop();
            removed.push(lastRange);
            this.rangeCount = 0;
          }
          for (var i2 = removed.length; i2--; ) {
            var index2 = this.ranges.indexOf(removed[i2]);
            this.ranges.splice(index2, 1);
          }
          this._signal("removeRange", { ranges: removed });
          if (this.rangeCount === 0 && this.inMultiSelectMode) {
            this.inMultiSelectMode = false;
            this._signal("singleSelect");
            this.session.$undoSelect = true;
            this.rangeList.detach(this.session);
          }
          lastRange = lastRange || this.ranges[0];
          if (lastRange && !lastRange.isEqual(this.getRange()))
            this.fromOrientedRange(lastRange);
        };
        this.$initRangeList = function() {
          if (this.rangeList)
            return;
          this.rangeList = new RangeList();
          this.ranges = [];
          this.rangeCount = 0;
        };
        this.getAllRanges = function() {
          return this.rangeCount ? this.rangeList.ranges.concat() : [this.getRange()];
        };
        this.splitIntoLines = function() {
          var ranges = this.ranges.length ? this.ranges : [this.getRange()];
          var newRanges = [];
          for (var i2 = 0; i2 < ranges.length; i2++) {
            var range = ranges[i2];
            var row = range.start.row;
            var endRow = range.end.row;
            if (row === endRow) {
              newRanges.push(range.clone());
            } else {
              newRanges.push(new Range2(row, range.start.column, row, this.session.getLine(row).length));
              while (++row < endRow)
                newRanges.push(this.getLineRange(row, true));
              newRanges.push(new Range2(endRow, 0, endRow, range.end.column));
            }
            if (i2 == 0 && !this.isBackwards())
              newRanges = newRanges.reverse();
          }
          this.toSingleRange();
          for (var i2 = newRanges.length; i2--; )
            this.addRange(newRanges[i2]);
        };
        this.joinSelections = function() {
          var ranges = this.rangeList.ranges;
          var lastRange = ranges[ranges.length - 1];
          var range = Range2.fromPoints(ranges[0].start, lastRange.end);
          this.toSingleRange();
          this.setSelectionRange(range, lastRange.cursor == lastRange.start);
        };
        this.toggleBlockSelection = function() {
          if (this.rangeCount > 1) {
            var ranges = this.rangeList.ranges;
            var lastRange = ranges[ranges.length - 1];
            var range = Range2.fromPoints(ranges[0].start, lastRange.end);
            this.toSingleRange();
            this.setSelectionRange(range, lastRange.cursor == lastRange.start);
          } else {
            var cursor = this.session.documentToScreenPosition(this.cursor);
            var anchor = this.session.documentToScreenPosition(this.anchor);
            var rectSel = this.rectangularRangeBlock(cursor, anchor);
            rectSel.forEach(this.addRange, this);
          }
        };
        this.rectangularRangeBlock = function(screenCursor, screenAnchor, includeEmptyLines) {
          var rectSel = [];
          var xBackwards = screenCursor.column < screenAnchor.column;
          if (xBackwards) {
            var startColumn = screenCursor.column;
            var endColumn = screenAnchor.column;
            var startOffsetX = screenCursor.offsetX;
            var endOffsetX = screenAnchor.offsetX;
          } else {
            var startColumn = screenAnchor.column;
            var endColumn = screenCursor.column;
            var startOffsetX = screenAnchor.offsetX;
            var endOffsetX = screenCursor.offsetX;
          }
          var yBackwards = screenCursor.row < screenAnchor.row;
          if (yBackwards) {
            var startRow = screenCursor.row;
            var endRow = screenAnchor.row;
          } else {
            var startRow = screenAnchor.row;
            var endRow = screenCursor.row;
          }
          if (startColumn < 0)
            startColumn = 0;
          if (startRow < 0)
            startRow = 0;
          if (startRow == endRow)
            includeEmptyLines = true;
          var docEnd;
          for (var row = startRow; row <= endRow; row++) {
            var range = Range2.fromPoints(this.session.screenToDocumentPosition(row, startColumn, startOffsetX), this.session.screenToDocumentPosition(row, endColumn, endOffsetX));
            if (range.isEmpty()) {
              if (docEnd && isSamePoint(range.end, docEnd))
                break;
              docEnd = range.end;
            }
            range.cursor = xBackwards ? range.start : range.end;
            rectSel.push(range);
          }
          if (yBackwards)
            rectSel.reverse();
          if (!includeEmptyLines) {
            var end = rectSel.length - 1;
            while (rectSel[end].isEmpty() && end > 0)
              end--;
            if (end > 0) {
              var start = 0;
              while (rectSel[start].isEmpty())
                start++;
            }
            for (var i2 = end; i2 >= start; i2--) {
              if (rectSel[i2].isEmpty())
                rectSel.splice(i2, 1);
            }
          }
          return rectSel;
        };
      }).call(Selection.prototype);
      var Editor = require2("./editor").Editor;
      (function() {
        this.updateSelectionMarkers = function() {
          this.renderer.updateCursor();
          this.renderer.updateBackMarkers();
        };
        this.addSelectionMarker = function(orientedRange) {
          if (!orientedRange.cursor)
            orientedRange.cursor = orientedRange.end;
          var style = this.getSelectionStyle();
          orientedRange.marker = this.session.addMarker(orientedRange, "ace_selection", style);
          this.session.$selectionMarkers.push(orientedRange);
          this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
          return orientedRange;
        };
        this.removeSelectionMarker = function(range) {
          if (!range.marker)
            return;
          this.session.removeMarker(range.marker);
          var index2 = this.session.$selectionMarkers.indexOf(range);
          if (index2 != -1)
            this.session.$selectionMarkers.splice(index2, 1);
          this.session.selectionMarkerCount = this.session.$selectionMarkers.length;
        };
        this.removeSelectionMarkers = function(ranges) {
          var markerList = this.session.$selectionMarkers;
          for (var i2 = ranges.length; i2--; ) {
            var range = ranges[i2];
            if (!range.marker)
              continue;
            this.session.removeMarker(range.marker);
            var index2 = markerList.indexOf(range);
            if (index2 != -1)
              markerList.splice(index2, 1);
          }
          this.session.selectionMarkerCount = markerList.length;
        };
        this.$onAddRange = function(e) {
          this.addSelectionMarker(e.range);
          this.renderer.updateCursor();
          this.renderer.updateBackMarkers();
        };
        this.$onRemoveRange = function(e) {
          this.removeSelectionMarkers(e.ranges);
          this.renderer.updateCursor();
          this.renderer.updateBackMarkers();
        };
        this.$onMultiSelect = function(e) {
          if (this.inMultiSelectMode)
            return;
          this.inMultiSelectMode = true;
          this.setStyle("ace_multiselect");
          this.keyBinding.addKeyboardHandler(commands.keyboardHandler);
          this.commands.setDefaultHandler("exec", this.$onMultiSelectExec);
          this.renderer.updateCursor();
          this.renderer.updateBackMarkers();
        };
        this.$onSingleSelect = function(e) {
          if (this.session.multiSelect.inVirtualMode)
            return;
          this.inMultiSelectMode = false;
          this.unsetStyle("ace_multiselect");
          this.keyBinding.removeKeyboardHandler(commands.keyboardHandler);
          this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec);
          this.renderer.updateCursor();
          this.renderer.updateBackMarkers();
          this._emit("changeSelection");
        };
        this.$onMultiSelectExec = function(e) {
          var command2 = e.command;
          var editor = e.editor;
          if (!editor.multiSelect)
            return;
          if (!command2.multiSelectAction) {
            var result = command2.exec(editor, e.args || {});
            editor.multiSelect.addRange(editor.multiSelect.toOrientedRange());
            editor.multiSelect.mergeOverlappingRanges();
          } else if (command2.multiSelectAction == "forEach") {
            result = editor.forEachSelection(command2, e.args);
          } else if (command2.multiSelectAction == "forEachLine") {
            result = editor.forEachSelection(command2, e.args, true);
          } else if (command2.multiSelectAction == "single") {
            editor.exitMultiSelectMode();
            result = command2.exec(editor, e.args || {});
          } else {
            result = command2.multiSelectAction(editor, e.args || {});
          }
          return result;
        };
        this.forEachSelection = function(cmd2, args, options) {
          if (this.inVirtualSelectionMode)
            return;
          var keepOrder = options && options.keepOrder;
          var $byLines = options == true || options && options.$byLines;
          var session = this.session;
          var selection = this.selection;
          var rangeList = selection.rangeList;
          var ranges = (keepOrder ? selection : rangeList).ranges;
          var result;
          if (!ranges.length)
            return cmd2.exec ? cmd2.exec(this, args || {}) : cmd2(this, args || {});
          var reg = selection._eventRegistry;
          selection._eventRegistry = {};
          var tmpSel = new Selection(session);
          this.inVirtualSelectionMode = true;
          for (var i2 = ranges.length; i2--; ) {
            if ($byLines) {
              while (i2 > 0 && ranges[i2].start.row == ranges[i2 - 1].end.row)
                i2--;
            }
            tmpSel.fromOrientedRange(ranges[i2]);
            tmpSel.index = i2;
            this.selection = session.selection = tmpSel;
            var cmdResult = cmd2.exec ? cmd2.exec(this, args || {}) : cmd2(this, args || {});
            if (!result && cmdResult !== void 0)
              result = cmdResult;
            tmpSel.toOrientedRange(ranges[i2]);
          }
          tmpSel.detach();
          this.selection = session.selection = selection;
          this.inVirtualSelectionMode = false;
          selection._eventRegistry = reg;
          selection.mergeOverlappingRanges();
          if (selection.ranges[0])
            selection.fromOrientedRange(selection.ranges[0]);
          var anim = this.renderer.$scrollAnimation;
          this.onCursorChange();
          this.onSelectionChange();
          if (anim && anim.from == anim.to)
            this.renderer.animateScrolling(anim.from);
          return result;
        };
        this.exitMultiSelectMode = function() {
          if (!this.inMultiSelectMode || this.inVirtualSelectionMode)
            return;
          this.multiSelect.toSingleRange();
        };
        this.getSelectedText = function() {
          var text = "";
          if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
            var ranges = this.multiSelect.rangeList.ranges;
            var buf = [];
            for (var i2 = 0; i2 < ranges.length; i2++) {
              buf.push(this.session.getTextRange(ranges[i2]));
            }
            var nl = this.session.getDocument().getNewLineCharacter();
            text = buf.join(nl);
            if (text.length == (buf.length - 1) * nl.length)
              text = "";
          } else if (!this.selection.isEmpty()) {
            text = this.session.getTextRange(this.getSelectionRange());
          }
          return text;
        };
        this.$checkMultiselectChange = function(e, anchor) {
          if (this.inMultiSelectMode && !this.inVirtualSelectionMode) {
            var range = this.multiSelect.ranges[0];
            if (this.multiSelect.isEmpty() && anchor == this.multiSelect.anchor)
              return;
            var pos = anchor == this.multiSelect.anchor ? range.cursor == range.start ? range.end : range.start : range.cursor;
            if (pos.row != anchor.row || this.session.$clipPositionToDocument(pos.row, pos.column).column != anchor.column)
              this.multiSelect.toSingleRange(this.multiSelect.toOrientedRange());
            else
              this.multiSelect.mergeOverlappingRanges();
          }
        };
        this.findAll = function(needle, options, additive) {
          options = options || {};
          options.needle = needle || options.needle;
          if (options.needle == void 0) {
            var range = this.selection.isEmpty() ? this.selection.getWordRange() : this.selection.getRange();
            options.needle = this.session.getTextRange(range);
          }
          this.$search.set(options);
          var ranges = this.$search.findAll(this.session);
          if (!ranges.length)
            return 0;
          var selection = this.multiSelect;
          if (!additive)
            selection.toSingleRange(ranges[0]);
          for (var i2 = ranges.length; i2--; )
            selection.addRange(ranges[i2], true);
          if (range && selection.rangeList.rangeAtPoint(range.start))
            selection.addRange(range, true);
          return ranges.length;
        };
        this.selectMoreLines = function(dir, skip) {
          var range = this.selection.toOrientedRange();
          var isBackwards = range.cursor == range.end;
          var screenLead = this.session.documentToScreenPosition(range.cursor);
          if (this.selection.$desiredColumn)
            screenLead.column = this.selection.$desiredColumn;
          var lead = this.session.screenToDocumentPosition(screenLead.row + dir, screenLead.column);
          if (!range.isEmpty()) {
            var screenAnchor = this.session.documentToScreenPosition(isBackwards ? range.end : range.start);
            var anchor = this.session.screenToDocumentPosition(screenAnchor.row + dir, screenAnchor.column);
          } else {
            var anchor = lead;
          }
          if (isBackwards) {
            var newRange = Range2.fromPoints(lead, anchor);
            newRange.cursor = newRange.start;
          } else {
            var newRange = Range2.fromPoints(anchor, lead);
            newRange.cursor = newRange.end;
          }
          newRange.desiredColumn = screenLead.column;
          if (!this.selection.inMultiSelectMode) {
            this.selection.addRange(range);
          } else {
            if (skip)
              var toRemove = range.cursor;
          }
          this.selection.addRange(newRange);
          if (toRemove)
            this.selection.substractPoint(toRemove);
        };
        this.transposeSelections = function(dir) {
          var session = this.session;
          var sel = session.multiSelect;
          var all = sel.ranges;
          for (var i2 = all.length; i2--; ) {
            var range = all[i2];
            if (range.isEmpty()) {
              var tmp = session.getWordRange(range.start.row, range.start.column);
              range.start.row = tmp.start.row;
              range.start.column = tmp.start.column;
              range.end.row = tmp.end.row;
              range.end.column = tmp.end.column;
            }
          }
          sel.mergeOverlappingRanges();
          var words = [];
          for (var i2 = all.length; i2--; ) {
            var range = all[i2];
            words.unshift(session.getTextRange(range));
          }
          if (dir < 0)
            words.unshift(words.pop());
          else
            words.push(words.shift());
          for (var i2 = all.length; i2--; ) {
            var range = all[i2];
            var tmp = range.clone();
            session.replace(range, words[i2]);
            range.start.row = tmp.start.row;
            range.start.column = tmp.start.column;
          }
          sel.fromOrientedRange(sel.ranges[0]);
        };
        this.selectMore = function(dir, skip, stopAtFirst) {
          var session = this.session;
          var sel = session.multiSelect;
          var range = sel.toOrientedRange();
          if (range.isEmpty()) {
            range = session.getWordRange(range.start.row, range.start.column);
            range.cursor = dir == -1 ? range.start : range.end;
            this.multiSelect.addRange(range);
            if (stopAtFirst)
              return;
          }
          var needle = session.getTextRange(range);
          var newRange = find2(session, needle, dir);
          if (newRange) {
            newRange.cursor = dir == -1 ? newRange.start : newRange.end;
            this.session.unfold(newRange);
            this.multiSelect.addRange(newRange);
            this.renderer.scrollCursorIntoView(null, 0.5);
          }
          if (skip)
            this.multiSelect.substractPoint(range.cursor);
        };
        this.alignCursors = function() {
          var session = this.session;
          var sel = session.multiSelect;
          var ranges = sel.ranges;
          var row = -1;
          var sameRowRanges = ranges.filter(function(r) {
            if (r.cursor.row == row)
              return true;
            row = r.cursor.row;
          });
          if (!ranges.length || sameRowRanges.length == ranges.length - 1) {
            var range = this.selection.getRange();
            var fr = range.start.row, lr = range.end.row;
            var guessRange = fr == lr;
            if (guessRange) {
              var max = this.session.getLength();
              var line;
              do {
                line = this.session.getLine(lr);
              } while (/[=:]/.test(line) && ++lr < max);
              do {
                line = this.session.getLine(fr);
              } while (/[=:]/.test(line) && --fr > 0);
              if (fr < 0)
                fr = 0;
              if (lr >= max)
                lr = max - 1;
            }
            var lines = this.session.removeFullLines(fr, lr);
            lines = this.$reAlignText(lines, guessRange);
            this.session.insert({ row: fr, column: 0 }, lines.join("\n") + "\n");
            if (!guessRange) {
              range.start.column = 0;
              range.end.column = lines[lines.length - 1].length;
            }
            this.selection.setRange(range);
          } else {
            sameRowRanges.forEach(function(r) {
              sel.substractPoint(r.cursor);
            });
            var maxCol = 0;
            var minSpace = Infinity;
            var spaceOffsets = ranges.map(function(r) {
              var p = r.cursor;
              var line2 = session.getLine(p.row);
              var spaceOffset = line2.substr(p.column).search(/\S/g);
              if (spaceOffset == -1)
                spaceOffset = 0;
              if (p.column > maxCol)
                maxCol = p.column;
              if (spaceOffset < minSpace)
                minSpace = spaceOffset;
              return spaceOffset;
            });
            ranges.forEach(function(r, i2) {
              var p = r.cursor;
              var l = maxCol - p.column;
              var d = spaceOffsets[i2] - minSpace;
              if (l > d)
                session.insert(p, lang.stringRepeat(" ", l - d));
              else
                session.remove(new Range2(p.row, p.column, p.row, p.column - l + d));
              r.start.column = r.end.column = maxCol;
              r.start.row = r.end.row = p.row;
              r.cursor = r.end;
            });
            sel.fromOrientedRange(ranges[0]);
            this.renderer.updateCursor();
            this.renderer.updateBackMarkers();
          }
        };
        this.$reAlignText = function(lines, forceLeft) {
          var isLeftAligned = true, isRightAligned = true;
          var startW, textW, endW;
          return lines.map(function(line) {
            var m = line.match(/(\s*)(.*?)(\s*)([=:].*)/);
            if (!m)
              return [line];
            if (startW == null) {
              startW = m[1].length;
              textW = m[2].length;
              endW = m[3].length;
              return m;
            }
            if (startW + textW + endW != m[1].length + m[2].length + m[3].length)
              isRightAligned = false;
            if (startW != m[1].length)
              isLeftAligned = false;
            if (startW > m[1].length)
              startW = m[1].length;
            if (textW < m[2].length)
              textW = m[2].length;
            if (endW > m[3].length)
              endW = m[3].length;
            return m;
          }).map(forceLeft ? alignLeft : isLeftAligned ? isRightAligned ? alignRight : alignLeft : unAlign);
          function spaces2(n) {
            return lang.stringRepeat(" ", n);
          }
          function alignLeft(m) {
            return !m[2] ? m[0] : spaces2(startW) + m[2] + spaces2(textW - m[2].length + endW) + m[4].replace(/^([=:])\s+/, "$1 ");
          }
          function alignRight(m) {
            return !m[2] ? m[0] : spaces2(startW + textW - m[2].length) + m[2] + spaces2(endW) + m[4].replace(/^([=:])\s+/, "$1 ");
          }
          function unAlign(m) {
            return !m[2] ? m[0] : spaces2(startW) + m[2] + spaces2(endW) + m[4].replace(/^([=:])\s+/, "$1 ");
          }
        };
      }).call(Editor.prototype);
      function isSamePoint(p1, p2) {
        return p1.row == p2.row && p1.column == p2.column;
      }
      exports3.onSessionChange = function(e) {
        var session = e.session;
        if (session && !session.multiSelect) {
          session.$selectionMarkers = [];
          session.selection.$initRangeList();
          session.multiSelect = session.selection;
        }
        this.multiSelect = session && session.multiSelect;
        var oldSession = e.oldSession;
        if (oldSession) {
          oldSession.multiSelect.off("addRange", this.$onAddRange);
          oldSession.multiSelect.off("removeRange", this.$onRemoveRange);
          oldSession.multiSelect.off("multiSelect", this.$onMultiSelect);
          oldSession.multiSelect.off("singleSelect", this.$onSingleSelect);
          oldSession.multiSelect.lead.off("change", this.$checkMultiselectChange);
          oldSession.multiSelect.anchor.off("change", this.$checkMultiselectChange);
        }
        if (session) {
          session.multiSelect.on("addRange", this.$onAddRange);
          session.multiSelect.on("removeRange", this.$onRemoveRange);
          session.multiSelect.on("multiSelect", this.$onMultiSelect);
          session.multiSelect.on("singleSelect", this.$onSingleSelect);
          session.multiSelect.lead.on("change", this.$checkMultiselectChange);
          session.multiSelect.anchor.on("change", this.$checkMultiselectChange);
        }
        if (session && this.inMultiSelectMode != session.selection.inMultiSelectMode) {
          if (session.selection.inMultiSelectMode)
            this.$onMultiSelect();
          else
            this.$onSingleSelect();
        }
      };
      function MultiSelect(editor) {
        if (editor.$multiselectOnSessionChange)
          return;
        editor.$onAddRange = editor.$onAddRange.bind(editor);
        editor.$onRemoveRange = editor.$onRemoveRange.bind(editor);
        editor.$onMultiSelect = editor.$onMultiSelect.bind(editor);
        editor.$onSingleSelect = editor.$onSingleSelect.bind(editor);
        editor.$multiselectOnSessionChange = exports3.onSessionChange.bind(editor);
        editor.$checkMultiselectChange = editor.$checkMultiselectChange.bind(editor);
        editor.$multiselectOnSessionChange(editor);
        editor.on("changeSession", editor.$multiselectOnSessionChange);
        editor.on("mousedown", onMouseDown);
        editor.commands.addCommands(commands.defaultCommands);
        addAltCursorListeners(editor);
      }
      function addAltCursorListeners(editor) {
        if (!editor.textInput)
          return;
        var el = editor.textInput.getElement();
        var altCursor = false;
        event.addListener(el, "keydown", function(e) {
          var altDown = e.keyCode == 18 && !(e.ctrlKey || e.shiftKey || e.metaKey);
          if (editor.$blockSelectEnabled && altDown) {
            if (!altCursor) {
              editor.renderer.setMouseCursor("crosshair");
              altCursor = true;
            }
          } else if (altCursor) {
            reset();
          }
        }, editor);
        event.addListener(el, "keyup", reset, editor);
        event.addListener(el, "blur", reset, editor);
        function reset(e) {
          if (altCursor) {
            editor.renderer.setMouseCursor("");
            altCursor = false;
          }
        }
      }
      exports3.MultiSelect = MultiSelect;
      require2("./config").defineOptions(Editor.prototype, "editor", {
        enableMultiselect: {
          set: function(val) {
            MultiSelect(this);
            if (val) {
              this.on("mousedown", onMouseDown);
            } else {
              this.off("mousedown", onMouseDown);
            }
          },
          value: true
        },
        enableBlockSelect: {
          set: function(val) {
            this.$blockSelectEnabled = val;
          },
          value: true
        }
      });
    });
    ace.define("ace/mode/folding/fold_mode", ["require", "exports", "module", "ace/range"], function(require2, exports3, module3) {
      var Range2 = require2("../../range").Range;
      var FoldMode = exports3.FoldMode = function() {
      };
      (function() {
        this.foldingStartMarker = null;
        this.foldingStopMarker = null;
        this.getFoldWidget = function(session, foldStyle, row) {
          var line = session.getLine(row);
          if (this.foldingStartMarker.test(line))
            return "start";
          if (foldStyle == "markbeginend" && this.foldingStopMarker && this.foldingStopMarker.test(line))
            return "end";
          return "";
        };
        this.getFoldWidgetRange = function(session, foldStyle, row) {
          return null;
        };
        this.indentationBlock = function(session, row, column) {
          var re = /\S/;
          var line = session.getLine(row);
          var startLevel = line.search(re);
          if (startLevel == -1)
            return;
          var startColumn = column || line.length;
          var maxRow = session.getLength();
          var startRow = row;
          var endRow = row;
          while (++row < maxRow) {
            var level = session.getLine(row).search(re);
            if (level == -1)
              continue;
            if (level <= startLevel) {
              var token = session.getTokenAt(row, 0);
              if (!token || token.type !== "string")
                break;
            }
            endRow = row;
          }
          if (endRow > startRow) {
            var endColumn = session.getLine(endRow).length;
            return new Range2(startRow, startColumn, endRow, endColumn);
          }
        };
        this.openingBracketBlock = function(session, bracket2, row, column, typeRe) {
          var start = { row, column: column + 1 };
          var end = session.$findClosingBracket(bracket2, start, typeRe);
          if (!end)
            return;
          var fw = session.foldWidgets[end.row];
          if (fw == null)
            fw = session.getFoldWidget(end.row);
          if (fw == "start" && end.row > start.row) {
            end.row--;
            end.column = session.getLine(end.row).length;
          }
          return Range2.fromPoints(start, end);
        };
        this.closingBracketBlock = function(session, bracket2, row, column, typeRe) {
          var end = { row, column };
          var start = session.$findOpeningBracket(bracket2, end);
          if (!start)
            return;
          start.column++;
          end.column--;
          return Range2.fromPoints(start, end);
        };
      }).call(FoldMode.prototype);
    });
    ace.define("ace/ext/error_marker", ["require", "exports", "module", "ace/line_widgets", "ace/lib/dom", "ace/range", "ace/config"], function(require2, exports3, module3) {
      var LineWidgets = require2("../line_widgets").LineWidgets;
      var dom = require2("../lib/dom");
      var Range2 = require2("../range").Range;
      var nls = require2("../config").nls;
      function binarySearch(array, needle, comparator) {
        var first = 0;
        var last = array.length - 1;
        while (first <= last) {
          var mid = first + last >> 1;
          var c = comparator(needle, array[mid]);
          if (c > 0)
            first = mid + 1;
          else if (c < 0)
            last = mid - 1;
          else
            return mid;
        }
        return -(first + 1);
      }
      function findAnnotations(session, row, dir) {
        var annotations = session.getAnnotations().sort(Range2.comparePoints);
        if (!annotations.length)
          return;
        var i2 = binarySearch(annotations, { row, column: -1 }, Range2.comparePoints);
        if (i2 < 0)
          i2 = -i2 - 1;
        if (i2 >= annotations.length)
          i2 = dir > 0 ? 0 : annotations.length - 1;
        else if (i2 === 0 && dir < 0)
          i2 = annotations.length - 1;
        var annotation = annotations[i2];
        if (!annotation || !dir)
          return;
        if (annotation.row === row) {
          do {
            annotation = annotations[i2 += dir];
          } while (annotation && annotation.row === row);
          if (!annotation)
            return annotations.slice();
        }
        var matched = [];
        row = annotation.row;
        do {
          matched[dir < 0 ? "unshift" : "push"](annotation);
          annotation = annotations[i2 += dir];
        } while (annotation && annotation.row == row);
        return matched.length && matched;
      }
      exports3.showErrorMarker = function(editor, dir) {
        var session = editor.session;
        if (!session.widgetManager) {
          session.widgetManager = new LineWidgets(session);
          session.widgetManager.attach(editor);
        }
        var pos = editor.getCursorPosition();
        var row = pos.row;
        var oldWidget = session.widgetManager.getWidgetsAtRow(row).filter(function(w2) {
          return w2.type == "errorMarker";
        })[0];
        if (oldWidget) {
          oldWidget.destroy();
        } else {
          row -= dir;
        }
        var annotations = findAnnotations(session, row, dir);
        var gutterAnno;
        if (annotations) {
          var annotation = annotations[0];
          pos.column = (annotation.pos && typeof annotation.column != "number" ? annotation.pos.sc : annotation.column) || 0;
          pos.row = annotation.row;
          gutterAnno = editor.renderer.$gutterLayer.$annotations[pos.row];
        } else if (oldWidget) {
          return;
        } else {
          gutterAnno = {
            text: [nls("Looks good!")],
            className: "ace_ok"
          };
        }
        editor.session.unfold(pos.row);
        editor.selection.moveToPosition(pos);
        var w = {
          row: pos.row,
          fixedWidth: true,
          coverGutter: true,
          el: dom.createElement("div"),
          type: "errorMarker"
        };
        var el = w.el.appendChild(dom.createElement("div"));
        var arrow = w.el.appendChild(dom.createElement("div"));
        arrow.className = "error_widget_arrow " + gutterAnno.className;
        var left = editor.renderer.$cursorLayer.getPixelPosition(pos).left;
        arrow.style.left = left + editor.renderer.gutterWidth - 5 + "px";
        w.el.className = "error_widget_wrapper";
        el.className = "error_widget " + gutterAnno.className;
        el.innerHTML = gutterAnno.text.join("<br>");
        el.appendChild(dom.createElement("div"));
        var kb = function(_, hashId, keyString) {
          if (hashId === 0 && (keyString === "esc" || keyString === "return")) {
            w.destroy();
            return { command: "null" };
          }
        };
        w.destroy = function() {
          if (editor.$mouseHandler.isMousePressed)
            return;
          editor.keyBinding.removeKeyboardHandler(kb);
          session.widgetManager.removeLineWidget(w);
          editor.off("changeSelection", w.destroy);
          editor.off("changeSession", w.destroy);
          editor.off("mouseup", w.destroy);
          editor.off("change", w.destroy);
        };
        editor.keyBinding.addKeyboardHandler(kb);
        editor.on("changeSelection", w.destroy);
        editor.on("changeSession", w.destroy);
        editor.on("mouseup", w.destroy);
        editor.on("change", w.destroy);
        editor.session.widgetManager.addLineWidget(w);
        w.el.onmousedown = editor.focus.bind(editor);
        editor.renderer.scrollCursorIntoView(null, 0.5, { bottom: w.el.offsetHeight });
      };
      dom.importCssString("\n    .error_widget_wrapper {\n        background: inherit;\n        color: inherit;\n        border:none\n    }\n    .error_widget {\n        border-top: solid 2px;\n        border-bottom: solid 2px;\n        margin: 5px 0;\n        padding: 10px 40px;\n        white-space: pre-wrap;\n    }\n    .error_widget.ace_error, .error_widget_arrow.ace_error{\n        border-color: #ff5a5a\n    }\n    .error_widget.ace_warning, .error_widget_arrow.ace_warning{\n        border-color: #F1D817\n    }\n    .error_widget.ace_info, .error_widget_arrow.ace_info{\n        border-color: #5a5a5a\n    }\n    .error_widget.ace_ok, .error_widget_arrow.ace_ok{\n        border-color: #5aaa5a\n    }\n    .error_widget_arrow {\n        position: absolute;\n        border: solid 5px;\n        border-top-color: transparent!important;\n        border-right-color: transparent!important;\n        border-left-color: transparent!important;\n        top: -5px;\n    }\n", "error_marker.css", false);
    });
    ace.define("ace/ace", ["require", "exports", "module", "ace/lib/dom", "ace/range", "ace/editor", "ace/edit_session", "ace/undomanager", "ace/virtual_renderer", "ace/worker/worker_client", "ace/keyboard/hash_handler", "ace/placeholder", "ace/multi_select", "ace/mode/folding/fold_mode", "ace/theme/textmate", "ace/ext/error_marker", "ace/config", "ace/loader_build"], function(require2, exports3, module3) {
      require2("./loader_build")(exports3);
      var dom = require2("./lib/dom");
      var Range2 = require2("./range").Range;
      var Editor = require2("./editor").Editor;
      var EditSession = require2("./edit_session").EditSession;
      var UndoManager = require2("./undomanager").UndoManager;
      var Renderer = require2("./virtual_renderer").VirtualRenderer;
      require2("./worker/worker_client");
      require2("./keyboard/hash_handler");
      require2("./placeholder");
      require2("./multi_select");
      require2("./mode/folding/fold_mode");
      require2("./theme/textmate");
      require2("./ext/error_marker");
      exports3.config = require2("./config");
      exports3.edit = function(el, options) {
        if (typeof el == "string") {
          var _id = el;
          el = document.getElementById(_id);
          if (!el)
            throw new Error("ace.edit can't find div #" + _id);
        }
        if (el && el.env && el.env.editor instanceof Editor)
          return el.env.editor;
        var value2 = "";
        if (el && /input|textarea/i.test(el.tagName)) {
          var oldNode = el;
          value2 = oldNode.value;
          el = dom.createElement("pre");
          oldNode.parentNode.replaceChild(el, oldNode);
        } else if (el) {
          value2 = el.textContent;
          el.innerHTML = "";
        }
        var doc2 = exports3.createEditSession(value2);
        var editor = new Editor(new Renderer(el), doc2, options);
        var env = {
          document: doc2,
          editor,
          onResize: editor.resize.bind(editor, null)
        };
        if (oldNode)
          env.textarea = oldNode;
        editor.on("destroy", function() {
          env.editor.container.env = null;
        });
        editor.container.env = editor.env = env;
        return editor;
      };
      exports3.createEditSession = function(text, mode) {
        var doc2 = new EditSession(text, mode);
        doc2.setUndoManager(new UndoManager());
        return doc2;
      };
      exports3.Range = Range2;
      exports3.Editor = Editor;
      exports3.EditSession = EditSession;
      exports3.UndoManager = UndoManager;
      exports3.VirtualRenderer = Renderer;
      exports3.version = exports3.config.version;
    });
    (function() {
      ace.require(["ace/ace"], function(a) {
        if (a) {
          a.config.init(true);
          a.define = ace.define;
        }
        var global2 = function() {
          return this;
        }();
        if (!global2 && typeof window != "undefined")
          global2 = window;
        if (!global2 && typeof self != "undefined")
          global2 = self;
        if (!global2.ace)
          global2.ace = a;
        for (var key in a)
          if (a.hasOwnProperty(key))
            global2.ace[key] = a[key];
        global2.ace["default"] = global2.ace;
        if (module2) {
          module2.exports = global2.ace;
        }
      });
    })();
  })(ace$2);
  var ace$1 = ace$2.exports;
  var themeSqlserver = { exports: {} };
  (function(module2, exports2) {
    ace.define("ace/theme/sqlserver-css", ["require", "exports", "module"], function(e, t2, n) {
      n.exports = '.ace-sqlserver .ace_gutter {\n    background: #ebebeb;\n    color: #333;\n    overflow: hidden;\n}\n\n.ace-sqlserver .ace_print-margin {\n    width: 1px;\n    background: #e8e8e8;\n}\n\n.ace-sqlserver {\n    background-color: #FFFFFF;\n    color: black;\n}\n\n.ace-sqlserver .ace_identifier {\n    color: black;\n}\n\n.ace-sqlserver .ace_keyword {\n    color: #0000FF;\n}\n\n.ace-sqlserver .ace_numeric {\n    color: black;\n}\n\n.ace-sqlserver .ace_storage {\n    color: #11B7BE;\n}\n\n.ace-sqlserver .ace_keyword.ace_operator,\n.ace-sqlserver .ace_lparen,\n.ace-sqlserver .ace_rparen,\n.ace-sqlserver .ace_punctuation {\n    color: #808080;\n}\n\n.ace-sqlserver .ace_set.ace_statement {\n    color: #0000FF;\n    text-decoration: underline;\n}\n\n.ace-sqlserver .ace_cursor {\n    color: black;\n}\n\n.ace-sqlserver .ace_invisible {\n    color: rgb(191, 191, 191);\n}\n\n.ace-sqlserver .ace_constant.ace_buildin {\n    color: rgb(88, 72, 246);\n}\n\n.ace-sqlserver .ace_constant.ace_language {\n    color: #979797;\n}\n\n.ace-sqlserver .ace_constant.ace_library {\n    color: rgb(6, 150, 14);\n}\n\n.ace-sqlserver .ace_invalid {\n    background-color: rgb(153, 0, 0);\n    color: white;\n}\n\n.ace-sqlserver .ace_support.ace_function {\n    color: #FF00FF;\n}\n\n.ace-sqlserver .ace_support.ace_constant {\n    color: rgb(6, 150, 14);\n}\n\n.ace-sqlserver .ace_class {\n    color: #008080;\n}\n\n.ace-sqlserver .ace_support.ace_other {\n    color: #6D79DE;\n}\n\n.ace-sqlserver .ace_variable.ace_parameter {\n    font-style: italic;\n    color: #FD971F;\n}\n\n.ace-sqlserver .ace_comment {\n    color: #008000;\n}\n\n.ace-sqlserver .ace_constant.ace_numeric {\n    color: black;\n}\n\n.ace-sqlserver .ace_variable {\n    color: rgb(49, 132, 149);\n}\n\n.ace-sqlserver .ace_xml-pe {\n    color: rgb(104, 104, 91);\n}\n\n.ace-sqlserver .ace_support.ace_storedprocedure {\n    color: #800000;\n}\n\n.ace-sqlserver .ace_heading {\n    color: rgb(12, 7, 255);\n}\n\n.ace-sqlserver .ace_list {\n    color: rgb(185, 6, 144);\n}\n\n.ace-sqlserver .ace_marker-layer .ace_selection {\n    background: rgb(181, 213, 255);\n}\n\n.ace-sqlserver .ace_marker-layer .ace_step {\n    background: rgb(252, 255, 0);\n}\n\n.ace-sqlserver .ace_marker-layer .ace_stack {\n    background: rgb(164, 229, 101);\n}\n\n.ace-sqlserver .ace_marker-layer .ace_bracket {\n    margin: -1px 0 0 -1px;\n    border: 1px solid rgb(192, 192, 192);\n}\n\n.ace-sqlserver .ace_marker-layer .ace_active-line {\n    background: rgba(0, 0, 0, 0.07);\n}\n\n.ace-sqlserver .ace_gutter-active-line {\n    background-color: #dcdcdc;\n}\n\n.ace-sqlserver .ace_marker-layer .ace_selected-word {\n    background: rgb(250, 250, 255);\n    border: 1px solid rgb(200, 200, 250);\n}\n\n.ace-sqlserver .ace_meta.ace_tag {\n    color: #0000FF;\n}\n\n.ace-sqlserver .ace_string.ace_regex {\n    color: #FF0000;\n}\n\n.ace-sqlserver .ace_string {\n    color: #FF0000;\n}\n\n.ace-sqlserver .ace_entity.ace_other.ace_attribute-name {\n    color: #994409;\n}\n\n.ace-sqlserver .ace_indent-guide {\n    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAE0lEQVQImWP4////f4bLly//BwAmVgd1/w11/gAAAABJRU5ErkJggg==") right repeat-y;\n}\n\n.ace-sqlserver .ace_indent-guide-active {\n  background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAZSURBVHjaYvj///9/hivKyv8BAAAA//8DACLqBhbvk+/eAAAAAElFTkSuQmCC") right repeat-y;\n} \n';
    }), ace.define("ace/theme/sqlserver", ["require", "exports", "module", "ace/theme/sqlserver-css", "ace/lib/dom"], function(e, t2, n) {
      t2.isDark = false, t2.cssClass = "ace-sqlserver", t2.cssText = e("./sqlserver-css");
      var r = e("../lib/dom");
      r.importCssString(t2.cssText, t2.cssClass, false);
    });
    (function() {
      ace.require(["ace/theme/sqlserver"], function(m) {
        if (module2) {
          module2.exports = m;
        }
      });
    })();
  })(themeSqlserver);
  var modeJavascript = { exports: {} };
  (function(module2, exports2) {
    ace.define("ace/mode/jsdoc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function(e, t2, n) {
      var r = e("../lib/oop"), i2 = e("./text_highlight_rules").TextHighlightRules, s = function() {
        this.$rules = { start: [{ token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"], regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)", push: [{ token: "lparen.doc", regex: "{", push: [{ include: "doc-syntax" }, { token: "rparen.doc", regex: "}|(?=$)", next: "pop" }] }, { token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"], regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/, next: "pop" }, { token: "rparen.doc", regex: "}|(?=$)", next: "pop" }, { include: "doc-syntax" }, { defaultToken: "text.doc" }] }, { token: ["comment.doc.tag", "text.doc", "lparen.doc"], regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)", push: [{ token: "lparen.doc", regex: "{", push: [{ include: "doc-syntax" }, { token: "rparen.doc", regex: "}|(?=$)", next: "pop" }] }, { token: "rparen.doc", regex: "}|(?=$)", next: "pop" }, { include: "doc-syntax" }, { defaultToken: "text.doc" }] }, { token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"], regex: '(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?' }, { token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"], regex: "(@method)(\\s+)(\\w[\\w.\\(\\)]*)" }, { token: "comment.doc.tag", regex: "@access\\s+(?:private|public|protected)" }, { token: "comment.doc.tag", regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)" }, { token: "comment.doc.tag", regex: "@\\w+(?=\\s|$)" }, s.getTagRule(), { defaultToken: "comment.doc", caseInsensitive: true }], "doc-syntax": [{ token: "operator.doc", regex: /[|:]/ }, { token: "paren.doc", regex: /[\[\]]/ }] }, this.normalizeRules();
      };
      r.inherits(s, i2), s.getTagRule = function(e2) {
        return { token: "comment.doc.tag.storage.type", regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b" };
      }, s.getStartRule = function(e2) {
        return { token: "comment.doc", regex: "\\/\\*(?=\\*)", next: e2 };
      }, s.getEndRule = function(e2) {
        return { token: "comment.doc", regex: "\\*\\/", next: e2 };
      }, t2.JsDocCommentHighlightRules = s;
    }), ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/jsdoc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function(e, t2, n) {
      function a() {
        var e2 = o.replace("\\d", "\\d\\-"), t3 = { onMatch: function(e3, t4, n3) {
          var r2 = e3.charAt(1) == "/" ? 2 : 1;
          if (r2 == 1)
            t4 != this.nextState ? n3.unshift(this.next, this.nextState, 0) : n3.unshift(this.next), n3[2]++;
          else if (r2 == 2 && t4 == this.nextState) {
            n3[1]--;
            if (!n3[1] || n3[1] < 0)
              n3.shift(), n3.shift();
          }
          return [{ type: "meta.tag.punctuation." + (r2 == 1 ? "" : "end-") + "tag-open.xml", value: e3.slice(0, r2) }, { type: "meta.tag.tag-name.xml", value: e3.substr(r2) }];
        }, regex: "</?" + e2 + "", next: "jsxAttributes", nextState: "jsx" };
        this.$rules.start.unshift(t3);
        var n2 = { regex: "{", token: "paren.quasi.start", push: "start" };
        this.$rules.jsx = [n2, t3, { include: "reference" }, { defaultToken: "string" }], this.$rules.jsxAttributes = [{ token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", onMatch: function(e3, t4, n3) {
          return t4 == n3[0] && n3.shift(), e3.length == 2 && (n3[0] == this.nextState && n3[1]--, (!n3[1] || n3[1] < 0) && n3.splice(0, 2)), this.next = n3[0] || "start", [{ type: this.token, value: e3 }];
        }, nextState: "jsx" }, n2, f("jsxAttributes"), { token: "entity.other.attribute-name.xml", regex: e2 }, { token: "keyword.operator.attribute-equals.xml", regex: "=" }, { token: "text.tag-whitespace.xml", regex: "\\s+" }, { token: "string.attribute-value.xml", regex: "'", stateName: "jsx_attr_q", push: [{ token: "string.attribute-value.xml", regex: "'", next: "pop" }, { include: "reference" }, { defaultToken: "string.attribute-value.xml" }] }, { token: "string.attribute-value.xml", regex: '"', stateName: "jsx_attr_qq", push: [{ token: "string.attribute-value.xml", regex: '"', next: "pop" }, { include: "reference" }, { defaultToken: "string.attribute-value.xml" }] }, t3], this.$rules.reference = [{ token: "constant.language.escape.reference.xml", regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" }];
      }
      function f(e2) {
        return [{ token: "comment", regex: /\/\*/, next: [i2.getTagRule(), { token: "comment", regex: "\\*\\/", next: e2 || "pop" }, { defaultToken: "comment", caseInsensitive: true }] }, { token: "comment", regex: "\\/\\/", next: [i2.getTagRule(), { token: "comment", regex: "$|^", next: e2 || "pop" }, { defaultToken: "comment", caseInsensitive: true }] }];
      }
      var r = e("../lib/oop"), i2 = e("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules, s = e("./text_highlight_rules").TextHighlightRules, o = "[a-zA-Z\\$_\xA1-\uFFFF][a-zA-Z\\d\\$_\xA1-\uFFFF]*", u = function(e2) {
        var t3 = this.createKeywordMapper({ "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document", keyword: "const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor", "storage.type": "const|let|var|function", "constant.language": "null|Infinity|NaN|undefined", "support.function": "alert", "constant.language.boolean": "true|false" }, "identifier"), n2 = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void", r2 = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";
        this.$rules = { no_regex: [i2.getStartRule("doc-start"), f("no_regex"), { token: "string", regex: "'(?=.)", next: "qstring" }, { token: "string", regex: '"(?=.)', next: "qqstring" }, { token: "constant.numeric", regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ }, { token: "constant.numeric", regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ }, { token: ["storage.type", "punctuation.operator", "support.function", "punctuation.operator", "entity.name.function", "text", "keyword.operator"], regex: "(" + o + ")(\\.)(prototype)(\\.)(" + o + ")(\\s*)(=)", next: "function_arguments" }, { token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()", next: "function_arguments" }, { token: ["entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + o + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()", next: "function_arguments" }, { token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()", next: "function_arguments" }, { token: ["storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(function\\*?)(\\s+)(" + o + ")(\\s*)(\\()", next: "function_arguments" }, { token: ["entity.name.function", "text", "punctuation.operator", "text", "storage.type", "text", "paren.lparen"], regex: "(" + o + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()", next: "function_arguments" }, { token: ["text", "text", "storage.type", "text", "paren.lparen"], regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()", next: "function_arguments" }, { token: "keyword", regex: `from(?=\\s*('|"))` }, { token: "keyword", regex: "(?:" + n2 + ")\\b", next: "start" }, { token: "support.constant", regex: /that\b/ }, { token: ["storage.type", "punctuation.operator", "support.function.firebug"], regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/ }, { token: t3, regex: o }, { token: "punctuation.operator", regex: /[.](?![.])/, next: "property" }, { token: "storage.type", regex: /=>/, next: "start" }, { token: "keyword.operator", regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, next: "start" }, { token: "punctuation.operator", regex: /[?:,;.]/, next: "start" }, { token: "paren.lparen", regex: /[\[({]/, next: "start" }, { token: "paren.rparen", regex: /[\])}]/ }, { token: "comment", regex: /^#!.*$/ }], property: [{ token: "text", regex: "\\s+" }, { token: ["storage.type", "punctuation.operator", "entity.name.function", "text", "keyword.operator", "text", "storage.type", "text", "entity.name.function", "text", "paren.lparen"], regex: "(" + o + ")(\\.)(" + o + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()", next: "function_arguments" }, { token: "punctuation.operator", regex: /[.](?![.])/ }, { token: "support.function", regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/ }, { token: "support.function.dom", regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/ }, { token: "support.constant", regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/ }, { token: "identifier", regex: o }, { regex: "", token: "empty", next: "no_regex" }], start: [i2.getStartRule("doc-start"), f("start"), { token: "string.regexp", regex: "\\/", next: "regex" }, { token: "text", regex: "\\s+|^$", next: "start" }, { token: "empty", regex: "", next: "no_regex" }], regex: [{ token: "regexp.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" }, { token: "string.regexp", regex: "/[sxngimy]*", next: "no_regex" }, { token: "invalid", regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/ }, { token: "constant.language.escape", regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/ }, { token: "constant.language.delimiter", regex: /\|/ }, { token: "constant.language.escape", regex: /\[\^?/, next: "regex_character_class" }, { token: "empty", regex: "$", next: "no_regex" }, { defaultToken: "string.regexp" }], regex_character_class: [{ token: "regexp.charclass.keyword.operator", regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)" }, { token: "constant.language.escape", regex: "]", next: "regex" }, { token: "constant.language.escape", regex: "-" }, { token: "empty", regex: "$", next: "no_regex" }, { defaultToken: "string.regexp.charachterclass" }], default_parameter: [{ token: "string", regex: "'(?=.)", push: [{ token: "string", regex: "'|$", next: "pop" }, { include: "qstring" }] }, { token: "string", regex: '"(?=.)', push: [{ token: "string", regex: '"|$', next: "pop" }, { include: "qqstring" }] }, { token: "constant.language", regex: "null|Infinity|NaN|undefined" }, { token: "constant.numeric", regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/ }, { token: "constant.numeric", regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/ }, { token: "punctuation.operator", regex: ",", next: "function_arguments" }, { token: "text", regex: "\\s+" }, { token: "punctuation.operator", regex: "$" }, { token: "empty", regex: "", next: "no_regex" }], function_arguments: [f("function_arguments"), { token: "variable.parameter", regex: o }, { token: "punctuation.operator", regex: "," }, { token: "text", regex: "\\s+" }, { token: "punctuation.operator", regex: "$" }, { token: "empty", regex: "", next: "no_regex" }], qqstring: [{ token: "constant.language.escape", regex: r2 }, { token: "string", regex: "\\\\$", consumeLineEnd: true }, { token: "string", regex: '"|$', next: "no_regex" }, { defaultToken: "string" }], qstring: [{ token: "constant.language.escape", regex: r2 }, { token: "string", regex: "\\\\$", consumeLineEnd: true }, { token: "string", regex: "'|$", next: "no_regex" }, { defaultToken: "string" }] };
        if (!e2 || !e2.noES6)
          this.$rules.no_regex.unshift({ regex: "[{}]", onMatch: function(e3, t4, n3) {
            this.next = e3 == "{" ? this.nextState : "";
            if (e3 == "{" && n3.length)
              n3.unshift("start", t4);
            else if (e3 == "}" && n3.length) {
              n3.shift(), this.next = n3.shift();
              if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
                return "paren.quasi.end";
            }
            return e3 == "{" ? "paren.lparen" : "paren.rparen";
          }, nextState: "start" }, { token: "string.quasi.start", regex: /`/, push: [{ token: "constant.language.escape", regex: r2 }, { token: "paren.quasi.start", regex: /\${/, push: "start" }, { token: "string.quasi.end", regex: /`/, next: "pop" }, { defaultToken: "string.quasi" }] }, { token: ["variable.parameter", "text"], regex: "(" + o + ")(\\s*)(?=\\=>)" }, { token: "paren.lparen", regex: "(\\()(?=.+\\s*=>)", next: "function_arguments" }, { token: "variable.language", regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b" }), this.$rules.function_arguments.unshift({ token: "keyword.operator", regex: "=", next: "default_parameter" }, { token: "keyword.operator", regex: "\\.{3}" }), this.$rules.property.unshift({ token: "support.function", regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()" }, { token: "constant.language", regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b" }), (!e2 || e2.jsx != 0) && a.call(this);
        this.embedRules(i2, "doc-", [i2.getEndRule("no_regex")]), this.normalizeRules();
      };
      r.inherits(u, s), t2.JavaScriptHighlightRules = u;
    }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(e, t2, n) {
      var r = e("../range").Range, i2 = function() {
      };
      (function() {
        this.checkOutdent = function(e2, t3) {
          return /^\s+$/.test(e2) ? /^\s*\}/.test(t3) : false;
        }, this.autoOutdent = function(e2, t3) {
          var n2 = e2.getLine(t3), i3 = n2.match(/^(\s*\})/);
          if (!i3)
            return 0;
          var s = i3[1].length, o = e2.findMatchingBracket({ row: t3, column: s });
          if (!o || o.row == t3)
            return 0;
          var u = this.$getIndent(e2.getLine(o.row));
          e2.replace(new r(t3, 0, t3, s - 1), u);
        }, this.$getIndent = function(e2) {
          return e2.match(/^\s*/)[0];
        };
      }).call(i2.prototype), t2.MatchingBraceOutdent = i2;
    }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(e, t2, n) {
      var r = e("../../lib/oop"), i2 = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t2.FoldMode = function(e2) {
        e2 && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e2.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e2.end)));
      };
      r.inherits(o, s), function() {
        this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function(e2, t3, n2) {
          var r2 = e2.getLine(n2);
          if (this.singleLineBlockCommentRe.test(r2) && !this.startRegionRe.test(r2) && !this.tripleStarBlockCommentRe.test(r2))
            return "";
          var i3 = this._getFoldWidgetBase(e2, t3, n2);
          return !i3 && this.startRegionRe.test(r2) ? "start" : i3;
        }, this.getFoldWidgetRange = function(e2, t3, n2, r2) {
          var i3 = e2.getLine(n2);
          if (this.startRegionRe.test(i3))
            return this.getCommentRegionBlock(e2, i3, n2);
          var s2 = i3.match(this.foldingStartMarker);
          if (s2) {
            var o2 = s2.index;
            if (s2[1])
              return this.openingBracketBlock(e2, s2[1], n2, o2);
            var u = e2.getCommentFoldRange(n2, o2 + s2[0].length, 1);
            return u && !u.isMultiLine() && (r2 ? u = this.getSectionRange(e2, n2) : t3 != "all" && (u = null)), u;
          }
          if (t3 === "markbegin")
            return;
          var s2 = i3.match(this.foldingStopMarker);
          if (s2) {
            var o2 = s2.index + s2[0].length;
            return s2[1] ? this.closingBracketBlock(e2, s2[1], n2, o2) : e2.getCommentFoldRange(n2, o2, -1);
          }
        }, this.getSectionRange = function(e2, t3) {
          var n2 = e2.getLine(t3), r2 = n2.search(/\S/), s2 = t3, o2 = n2.length;
          t3 += 1;
          var u = t3, a = e2.getLength();
          while (++t3 < a) {
            n2 = e2.getLine(t3);
            var f = n2.search(/\S/);
            if (f === -1)
              continue;
            if (r2 > f)
              break;
            var l = this.getFoldWidgetRange(e2, "all", t3);
            if (l) {
              if (l.start.row <= s2)
                break;
              if (l.isMultiLine())
                t3 = l.end.row;
              else if (r2 == f)
                break;
            }
            u = t3;
          }
          return new i2(s2, o2, u, e2.getLine(u).length);
        }, this.getCommentRegionBlock = function(e2, t3, n2) {
          var r2 = t3.search(/\s*$/), s2 = e2.getLength(), o2 = n2, u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/, a = 1;
          while (++n2 < s2) {
            t3 = e2.getLine(n2);
            var f = u.exec(t3);
            if (!f)
              continue;
            f[1] ? a-- : a++;
            if (!a)
              break;
          }
          var l = n2;
          if (l > o2)
            return new i2(o2, r2, l, t3.length);
        };
      }.call(o.prototype);
    }), ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/behaviour/cstyle", "ace/mode/folding/cstyle"], function(e, t2, n) {
      var r = e("../lib/oop"), i2 = e("./text").Mode, s = e("./javascript_highlight_rules").JavaScriptHighlightRules, o = e("./matching_brace_outdent").MatchingBraceOutdent, u = e("../worker/worker_client").WorkerClient, a = e("./behaviour/cstyle").CstyleBehaviour, f = e("./folding/cstyle").FoldMode, l = function() {
        this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new a(), this.foldingRules = new f();
      };
      r.inherits(l, i2), function() {
        this.lineCommentStart = "//", this.blockComment = { start: "/*", end: "*/" }, this.$quotes = { '"': '"', "'": "'", "`": "`" }, this.$pairQuotesAfter = { "`": /\w/ }, this.getNextLineIndent = function(e2, t3, n2) {
          var r2 = this.$getIndent(t3), i3 = this.getTokenizer().getLineTokens(t3, e2), s2 = i3.tokens, o2 = i3.state;
          if (s2.length && s2[s2.length - 1].type == "comment")
            return r2;
          if (e2 == "start" || e2 == "no_regex") {
            var u2 = t3.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
            u2 && (r2 += n2);
          } else if (e2 == "doc-start") {
            if (o2 == "start" || o2 == "no_regex")
              return "";
            var u2 = t3.match(/^\s*(\/?)\*/);
            u2 && (u2[1] && (r2 += " "), r2 += "* ");
          }
          return r2;
        }, this.checkOutdent = function(e2, t3, n2) {
          return this.$outdent.checkOutdent(t3, n2);
        }, this.autoOutdent = function(e2, t3, n2) {
          this.$outdent.autoOutdent(t3, n2);
        }, this.createWorker = function(e2) {
          var t3 = new u(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
          return t3.attachToDocument(e2.getDocument()), t3.on("annotate", function(t4) {
            e2.setAnnotations(t4.data);
          }), t3.on("terminate", function() {
            e2.clearAnnotations();
          }), t3;
        }, this.$id = "ace/mode/javascript", this.snippetFileId = "ace/snippets/javascript";
      }.call(l.prototype), t2.Mode = l;
    });
    (function() {
      ace.require(["ace/mode/javascript"], function(m) {
        if (module2) {
          module2.exports = m;
        }
      });
    })();
  })(modeJavascript);
  var modeJson = { exports: {} };
  (function(module2, exports2) {
    ace.define("ace/mode/json_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function(e, t2, n) {
      var r = e("../lib/oop"), i2 = e("./text_highlight_rules").TextHighlightRules, s = function() {
        this.$rules = { start: [{ token: "variable", regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]\\s*(?=:)' }, { token: "string", regex: '"', next: "string" }, { token: "constant.numeric", regex: "0[xX][0-9a-fA-F]+\\b" }, { token: "constant.numeric", regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { token: "constant.language.boolean", regex: "(?:true|false)\\b" }, { token: "text", regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { token: "comment", regex: "\\/\\/.*$" }, { token: "comment.start", regex: "\\/\\*", next: "comment" }, { token: "paren.lparen", regex: "[[({]" }, { token: "paren.rparen", regex: "[\\])}]" }, { token: "punctuation.operator", regex: /[,]/ }, { token: "text", regex: "\\s+" }], string: [{ token: "constant.language.escape", regex: /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|["\\\/bfnrt])/ }, { token: "string", regex: '"|$', next: "start" }, { defaultToken: "string" }], comment: [{ token: "comment.end", regex: "\\*\\/", next: "start" }, { defaultToken: "comment" }] };
      };
      r.inherits(s, i2), t2.JsonHighlightRules = s;
    }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(e, t2, n) {
      var r = e("../range").Range, i2 = function() {
      };
      (function() {
        this.checkOutdent = function(e2, t3) {
          return /^\s+$/.test(e2) ? /^\s*\}/.test(t3) : false;
        }, this.autoOutdent = function(e2, t3) {
          var n2 = e2.getLine(t3), i3 = n2.match(/^(\s*\})/);
          if (!i3)
            return 0;
          var s = i3[1].length, o = e2.findMatchingBracket({ row: t3, column: s });
          if (!o || o.row == t3)
            return 0;
          var u = this.$getIndent(e2.getLine(o.row));
          e2.replace(new r(t3, 0, t3, s - 1), u);
        }, this.$getIndent = function(e2) {
          return e2.match(/^\s*/)[0];
        };
      }).call(i2.prototype), t2.MatchingBraceOutdent = i2;
    }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(e, t2, n) {
      var r = e("../../lib/oop"), i2 = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t2.FoldMode = function(e2) {
        e2 && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e2.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e2.end)));
      };
      r.inherits(o, s), function() {
        this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function(e2, t3, n2) {
          var r2 = e2.getLine(n2);
          if (this.singleLineBlockCommentRe.test(r2) && !this.startRegionRe.test(r2) && !this.tripleStarBlockCommentRe.test(r2))
            return "";
          var i3 = this._getFoldWidgetBase(e2, t3, n2);
          return !i3 && this.startRegionRe.test(r2) ? "start" : i3;
        }, this.getFoldWidgetRange = function(e2, t3, n2, r2) {
          var i3 = e2.getLine(n2);
          if (this.startRegionRe.test(i3))
            return this.getCommentRegionBlock(e2, i3, n2);
          var s2 = i3.match(this.foldingStartMarker);
          if (s2) {
            var o2 = s2.index;
            if (s2[1])
              return this.openingBracketBlock(e2, s2[1], n2, o2);
            var u = e2.getCommentFoldRange(n2, o2 + s2[0].length, 1);
            return u && !u.isMultiLine() && (r2 ? u = this.getSectionRange(e2, n2) : t3 != "all" && (u = null)), u;
          }
          if (t3 === "markbegin")
            return;
          var s2 = i3.match(this.foldingStopMarker);
          if (s2) {
            var o2 = s2.index + s2[0].length;
            return s2[1] ? this.closingBracketBlock(e2, s2[1], n2, o2) : e2.getCommentFoldRange(n2, o2, -1);
          }
        }, this.getSectionRange = function(e2, t3) {
          var n2 = e2.getLine(t3), r2 = n2.search(/\S/), s2 = t3, o2 = n2.length;
          t3 += 1;
          var u = t3, a = e2.getLength();
          while (++t3 < a) {
            n2 = e2.getLine(t3);
            var f = n2.search(/\S/);
            if (f === -1)
              continue;
            if (r2 > f)
              break;
            var l = this.getFoldWidgetRange(e2, "all", t3);
            if (l) {
              if (l.start.row <= s2)
                break;
              if (l.isMultiLine())
                t3 = l.end.row;
              else if (r2 == f)
                break;
            }
            u = t3;
          }
          return new i2(s2, o2, u, e2.getLine(u).length);
        }, this.getCommentRegionBlock = function(e2, t3, n2) {
          var r2 = t3.search(/\s*$/), s2 = e2.getLength(), o2 = n2, u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/, a = 1;
          while (++n2 < s2) {
            t3 = e2.getLine(n2);
            var f = u.exec(t3);
            if (!f)
              continue;
            f[1] ? a-- : a++;
            if (!a)
              break;
          }
          var l = n2;
          if (l > o2)
            return new i2(o2, r2, l, t3.length);
        };
      }.call(o.prototype);
    }), ace.define("ace/mode/json", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/json_highlight_rules", "ace/mode/matching_brace_outdent", "ace/mode/folding/cstyle", "ace/worker/worker_client"], function(e, t2, n) {
      var r = e("../lib/oop"), i2 = e("./text").Mode, s = e("./json_highlight_rules").JsonHighlightRules, o = e("./matching_brace_outdent").MatchingBraceOutdent, u = e("./folding/cstyle").FoldMode, a = e("../worker/worker_client").WorkerClient, f = function() {
        this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = this.$defaultBehaviour, this.foldingRules = new u();
      };
      r.inherits(f, i2), function() {
        this.lineCommentStart = "//", this.blockComment = { start: "/*", end: "*/" }, this.getNextLineIndent = function(e2, t3, n2) {
          var r2 = this.$getIndent(t3);
          if (e2 == "start") {
            var i3 = t3.match(/^.*[\{\(\[]\s*$/);
            i3 && (r2 += n2);
          }
          return r2;
        }, this.checkOutdent = function(e2, t3, n2) {
          return this.$outdent.checkOutdent(t3, n2);
        }, this.autoOutdent = function(e2, t3, n2) {
          this.$outdent.autoOutdent(t3, n2);
        }, this.createWorker = function(e2) {
          var t3 = new a(["ace"], "ace/mode/json_worker", "JsonWorker");
          return t3.attachToDocument(e2.getDocument()), t3.on("annotate", function(t4) {
            e2.setAnnotations(t4.data);
          }), t3.on("terminate", function() {
            e2.clearAnnotations();
          }), t3;
        }, this.$id = "ace/mode/json";
      }.call(f.prototype), t2.Mode = f;
    });
    (function() {
      ace.require(["ace/mode/json"], function(m) {
        if (module2) {
          module2.exports = m;
        }
      });
    })();
  })(modeJson);
  var modeCss = { exports: {} };
  (function(module2, exports2) {
    ace.define("ace/mode/css_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/lib/lang", "ace/mode/text_highlight_rules"], function(e, t2, n) {
      var r = e("../lib/oop");
      e("../lib/lang");
      var s = e("./text_highlight_rules").TextHighlightRules, o = t2.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index", u = t2.supportFunction = "rgb|rgba|url|attr|counter|counters", a = t2.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom", f = t2.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen", l = t2.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace", c = t2.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))", h = t2.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b", p = t2.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b", d = function() {
        var e2 = this.createKeywordMapper({ "support.function": u, "support.constant": a, "support.type": o, "support.constant.color": f, "support.constant.fonts": l }, "text", true);
        this.$rules = { start: [{ include: ["strings", "url", "comments"] }, { token: "paren.lparen", regex: "\\{", next: "ruleset" }, { token: "paren.rparen", regex: "\\}" }, { token: "string", regex: "@(?!viewport)", next: "media" }, { token: "keyword", regex: "#[a-z0-9-_]+" }, { token: "keyword", regex: "%" }, { token: "variable", regex: "\\.[a-z0-9-_]+" }, { token: "string", regex: ":[a-z0-9-_]+" }, { token: "constant.numeric", regex: c }, { token: "constant", regex: "[a-z0-9-_]+" }, { caseInsensitive: true }], media: [{ include: ["strings", "url", "comments"] }, { token: "paren.lparen", regex: "\\{", next: "start" }, { token: "paren.rparen", regex: "\\}", next: "start" }, { token: "string", regex: ";", next: "start" }, { token: "keyword", regex: "(?:media|supports|document|charset|import|namespace|media|supports|document|page|font|keyframes|viewport|counter-style|font-feature-values|swash|ornaments|annotation|stylistic|styleset|character-variant)" }], comments: [{ token: "comment", regex: "\\/\\*", push: [{ token: "comment", regex: "\\*\\/", next: "pop" }, { defaultToken: "comment" }] }], ruleset: [{ regex: "-(webkit|ms|moz|o)-", token: "text" }, { token: "punctuation.operator", regex: "[:;]" }, { token: "paren.rparen", regex: "\\}", next: "start" }, { include: ["strings", "url", "comments"] }, { token: ["constant.numeric", "keyword"], regex: "(" + c + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)" }, { token: "constant.numeric", regex: c }, { token: "constant.numeric", regex: "#[a-f0-9]{6}" }, { token: "constant.numeric", regex: "#[a-f0-9]{3}" }, { token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"], regex: h }, { token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"], regex: p }, { include: "url" }, { token: e2, regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" }, { caseInsensitive: true }], url: [{ token: "support.function", regex: "(?:url(:?-prefix)?|domain|regexp)\\(", push: [{ token: "support.function", regex: "\\)", next: "pop" }, { defaultToken: "string" }] }], strings: [{ token: "string.start", regex: "'", push: [{ token: "string.end", regex: "'|$", next: "pop" }, { include: "escapes" }, { token: "constant.language.escape", regex: /\\$/, consumeLineEnd: true }, { defaultToken: "string" }] }, { token: "string.start", regex: '"', push: [{ token: "string.end", regex: '"|$', next: "pop" }, { include: "escapes" }, { token: "constant.language.escape", regex: /\\$/, consumeLineEnd: true }, { defaultToken: "string" }] }], escapes: [{ token: "constant.language.escape", regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ }] }, this.normalizeRules();
      };
      r.inherits(d, s), t2.CssHighlightRules = d;
    }), ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(e, t2, n) {
      var r = e("../range").Range, i2 = function() {
      };
      (function() {
        this.checkOutdent = function(e2, t3) {
          return /^\s+$/.test(e2) ? /^\s*\}/.test(t3) : false;
        }, this.autoOutdent = function(e2, t3) {
          var n2 = e2.getLine(t3), i3 = n2.match(/^(\s*\})/);
          if (!i3)
            return 0;
          var s = i3[1].length, o = e2.findMatchingBracket({ row: t3, column: s });
          if (!o || o.row == t3)
            return 0;
          var u = this.$getIndent(e2.getLine(o.row));
          e2.replace(new r(t3, 0, t3, s - 1), u);
        }, this.$getIndent = function(e2) {
          return e2.match(/^\s*/)[0];
        };
      }).call(i2.prototype), t2.MatchingBraceOutdent = i2;
    }), ace.define("ace/mode/css_completions", ["require", "exports", "module"], function(e, t2, n) {
      var r = { background: { "#$0": 1 }, "background-color": { "#$0": 1, transparent: 1, fixed: 1 }, "background-image": { "url('/$0')": 1 }, "background-repeat": { repeat: 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, inherit: 1 }, "background-position": { bottom: 2, center: 2, left: 2, right: 2, top: 2, inherit: 2 }, "background-attachment": { scroll: 1, fixed: 1 }, "background-size": { cover: 1, contain: 1 }, "background-clip": { "border-box": 1, "padding-box": 1, "content-box": 1 }, "background-origin": { "border-box": 1, "padding-box": 1, "content-box": 1 }, border: { "solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1 }, "border-color": { "#$0": 1 }, "border-style": { solid: 2, dashed: 2, dotted: 2, "double": 2, groove: 2, hidden: 2, inherit: 2, inset: 2, none: 2, outset: 2, ridged: 2 }, "border-collapse": { collapse: 1, separate: 1 }, bottom: { px: 1, em: 1, "%": 1 }, clear: { left: 1, right: 1, both: 1, none: 1 }, color: { "#$0": 1, "rgb(#$00,0,0)": 1 }, cursor: { "default": 1, pointer: 1, move: 1, text: 1, wait: 1, help: 1, progress: 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1 }, display: { none: 1, block: 1, inline: 1, "inline-block": 1, "table-cell": 1 }, "empty-cells": { show: 1, hide: 1 }, "float": { left: 1, right: 1, none: 1 }, "font-family": { Arial: 2, "Comic Sans MS": 2, Consolas: 2, "Courier New": 2, Courier: 2, Georgia: 2, Monospace: 2, "Sans-Serif": 2, "Segoe UI": 2, Tahoma: 2, "Times New Roman": 2, "Trebuchet MS": 2, Verdana: 1 }, "font-size": { px: 1, em: 1, "%": 1 }, "font-weight": { bold: 1, normal: 1 }, "font-style": { italic: 1, normal: 1 }, "font-variant": { normal: 1, "small-caps": 1 }, height: { px: 1, em: 1, "%": 1 }, left: { px: 1, em: 1, "%": 1 }, "letter-spacing": { normal: 1 }, "line-height": { normal: 1 }, "list-style-type": { none: 1, disc: 1, circle: 1, square: 1, decimal: 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, georgian: 1, "lower-alpha": 1, "upper-alpha": 1 }, margin: { px: 1, em: 1, "%": 1 }, "margin-right": { px: 1, em: 1, "%": 1 }, "margin-left": { px: 1, em: 1, "%": 1 }, "margin-top": { px: 1, em: 1, "%": 1 }, "margin-bottom": { px: 1, em: 1, "%": 1 }, "max-height": { px: 1, em: 1, "%": 1 }, "max-width": { px: 1, em: 1, "%": 1 }, "min-height": { px: 1, em: 1, "%": 1 }, "min-width": { px: 1, em: 1, "%": 1 }, overflow: { hidden: 1, visible: 1, auto: 1, scroll: 1 }, "overflow-x": { hidden: 1, visible: 1, auto: 1, scroll: 1 }, "overflow-y": { hidden: 1, visible: 1, auto: 1, scroll: 1 }, padding: { px: 1, em: 1, "%": 1 }, "padding-top": { px: 1, em: 1, "%": 1 }, "padding-right": { px: 1, em: 1, "%": 1 }, "padding-bottom": { px: 1, em: 1, "%": 1 }, "padding-left": { px: 1, em: 1, "%": 1 }, "page-break-after": { auto: 1, always: 1, avoid: 1, left: 1, right: 1 }, "page-break-before": { auto: 1, always: 1, avoid: 1, left: 1, right: 1 }, position: { absolute: 1, relative: 1, fixed: 1, "static": 1 }, right: { px: 1, em: 1, "%": 1 }, "table-layout": { fixed: 1, auto: 1 }, "text-decoration": { none: 1, underline: 1, "line-through": 1, blink: 1 }, "text-align": { left: 1, right: 1, center: 1, justify: 1 }, "text-transform": { capitalize: 1, uppercase: 1, lowercase: 1, none: 1 }, top: { px: 1, em: 1, "%": 1 }, "vertical-align": { top: 1, bottom: 1 }, visibility: { hidden: 1, visible: 1 }, "white-space": { nowrap: 1, normal: 1, pre: 1, "pre-line": 1, "pre-wrap": 1 }, width: { px: 1, em: 1, "%": 1 }, "word-spacing": { normal: 1 }, filter: { "alpha(opacity=$0100)": 1 }, "text-shadow": { "$02px 2px 2px #777": 1 }, "text-overflow": { "ellipsis-word": 1, clip: 1, ellipsis: 1 }, "-moz-border-radius": 1, "-moz-border-radius-topright": 1, "-moz-border-radius-bottomright": 1, "-moz-border-radius-topleft": 1, "-moz-border-radius-bottomleft": 1, "-webkit-border-radius": 1, "-webkit-border-top-right-radius": 1, "-webkit-border-top-left-radius": 1, "-webkit-border-bottom-right-radius": 1, "-webkit-border-bottom-left-radius": 1, "-moz-box-shadow": 1, "-webkit-box-shadow": 1, transform: { "rotate($00deg)": 1, "skew($00deg)": 1 }, "-moz-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 }, "-webkit-transform": { "rotate($00deg)": 1, "skew($00deg)": 1 } }, i2 = function() {
      };
      (function() {
        this.completionsDefined = false, this.defineCompletions = function() {
          if (document) {
            var e2 = document.createElement("c").style;
            for (var t3 in e2) {
              if (typeof e2[t3] != "string")
                continue;
              var n2 = t3.replace(/[A-Z]/g, function(e3) {
                return "-" + e3.toLowerCase();
              });
              r.hasOwnProperty(n2) || (r[n2] = 1);
            }
          }
          this.completionsDefined = true;
        }, this.getCompletions = function(e2, t3, n2, r2) {
          this.completionsDefined || this.defineCompletions();
          if (e2 === "ruleset" || t3.$mode.$id == "ace/mode/scss") {
            var i3 = t3.getLine(n2.row).substr(0, n2.column), s = /\([^)]*$/.test(i3);
            return s && (i3 = i3.substr(i3.lastIndexOf("(") + 1)), /:[^;]+$/.test(i3) ? (/([\w\-]+):[^:]*$/.test(i3), this.getPropertyValueCompletions(e2, t3, n2, r2)) : this.getPropertyCompletions(e2, t3, n2, r2, s);
          }
          return [];
        }, this.getPropertyCompletions = function(e2, t3, n2, i3, s) {
          s = s || false;
          var o = Object.keys(r);
          return o.map(function(e3) {
            return { caption: e3, snippet: e3 + ": $0" + (s ? "" : ";"), meta: "property", score: 1e6 };
          });
        }, this.getPropertyValueCompletions = function(e2, t3, n2, i3) {
          var s = t3.getLine(n2.row).substr(0, n2.column), o = (/([\w\-]+):[^:]*$/.exec(s) || {})[1];
          if (!o)
            return [];
          var u = [];
          return o in r && typeof r[o] == "object" && (u = Object.keys(r[o])), u.map(function(e3) {
            return { caption: e3, snippet: e3, meta: "property value", score: 1e6 };
          });
        };
      }).call(i2.prototype), t2.CssCompletions = i2;
    }), ace.define("ace/mode/behaviour/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/mode/behaviour/cstyle", "ace/token_iterator"], function(e, t2, n) {
      var r = e("../../lib/oop");
      e("../behaviour").Behaviour;
      var s = e("./cstyle").CstyleBehaviour, o = e("../../token_iterator").TokenIterator, u = function() {
        this.inherit(s), this.add("colon", "insertion", function(e2, t3, n2, r2, i2) {
          if (i2 === ":" && n2.selection.isEmpty()) {
            var s2 = n2.getCursorPosition(), u2 = new o(r2, s2.row, s2.column), a = u2.getCurrentToken();
            a && a.value.match(/\s+/) && (a = u2.stepBackward());
            if (a && a.type === "support.type") {
              var f = r2.doc.getLine(s2.row), l = f.substring(s2.column, s2.column + 1);
              if (l === ":")
                return { text: "", selection: [1, 1] };
              if (/^(\s+[^;]|\s*$)/.test(f.substring(s2.column)))
                return { text: ":;", selection: [1, 1] };
            }
          }
        }), this.add("colon", "deletion", function(e2, t3, n2, r2, i2) {
          var s2 = r2.doc.getTextRange(i2);
          if (!i2.isMultiLine() && s2 === ":") {
            var u2 = n2.getCursorPosition(), a = new o(r2, u2.row, u2.column), f = a.getCurrentToken();
            f && f.value.match(/\s+/) && (f = a.stepBackward());
            if (f && f.type === "support.type") {
              var l = r2.doc.getLine(i2.start.row), c = l.substring(i2.end.column, i2.end.column + 1);
              if (c === ";")
                return i2.end.column++, i2;
            }
          }
        }), this.add("semicolon", "insertion", function(e2, t3, n2, r2, i2) {
          if (i2 === ";" && n2.selection.isEmpty()) {
            var s2 = n2.getCursorPosition(), o2 = r2.doc.getLine(s2.row), u2 = o2.substring(s2.column, s2.column + 1);
            if (u2 === ";")
              return { text: "", selection: [1, 1] };
          }
        }), this.add("!important", "insertion", function(e2, t3, n2, r2, i2) {
          if (i2 === "!" && n2.selection.isEmpty()) {
            var s2 = n2.getCursorPosition(), o2 = r2.doc.getLine(s2.row);
            if (/^\s*(;|}|$)/.test(o2.substring(s2.column)))
              return { text: "!important", selection: [10, 10] };
          }
        });
      };
      r.inherits(u, s), t2.CssBehaviour = u;
    }), ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(e, t2, n) {
      var r = e("../../lib/oop"), i2 = e("../../range").Range, s = e("./fold_mode").FoldMode, o = t2.FoldMode = function(e2) {
        e2 && (this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + e2.start)), this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + e2.end)));
      };
      r.inherits(o, s), function() {
        this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/, this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/, this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/, this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/, this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/, this._getFoldWidgetBase = this.getFoldWidget, this.getFoldWidget = function(e2, t3, n2) {
          var r2 = e2.getLine(n2);
          if (this.singleLineBlockCommentRe.test(r2) && !this.startRegionRe.test(r2) && !this.tripleStarBlockCommentRe.test(r2))
            return "";
          var i3 = this._getFoldWidgetBase(e2, t3, n2);
          return !i3 && this.startRegionRe.test(r2) ? "start" : i3;
        }, this.getFoldWidgetRange = function(e2, t3, n2, r2) {
          var i3 = e2.getLine(n2);
          if (this.startRegionRe.test(i3))
            return this.getCommentRegionBlock(e2, i3, n2);
          var s2 = i3.match(this.foldingStartMarker);
          if (s2) {
            var o2 = s2.index;
            if (s2[1])
              return this.openingBracketBlock(e2, s2[1], n2, o2);
            var u = e2.getCommentFoldRange(n2, o2 + s2[0].length, 1);
            return u && !u.isMultiLine() && (r2 ? u = this.getSectionRange(e2, n2) : t3 != "all" && (u = null)), u;
          }
          if (t3 === "markbegin")
            return;
          var s2 = i3.match(this.foldingStopMarker);
          if (s2) {
            var o2 = s2.index + s2[0].length;
            return s2[1] ? this.closingBracketBlock(e2, s2[1], n2, o2) : e2.getCommentFoldRange(n2, o2, -1);
          }
        }, this.getSectionRange = function(e2, t3) {
          var n2 = e2.getLine(t3), r2 = n2.search(/\S/), s2 = t3, o2 = n2.length;
          t3 += 1;
          var u = t3, a = e2.getLength();
          while (++t3 < a) {
            n2 = e2.getLine(t3);
            var f = n2.search(/\S/);
            if (f === -1)
              continue;
            if (r2 > f)
              break;
            var l = this.getFoldWidgetRange(e2, "all", t3);
            if (l) {
              if (l.start.row <= s2)
                break;
              if (l.isMultiLine())
                t3 = l.end.row;
              else if (r2 == f)
                break;
            }
            u = t3;
          }
          return new i2(s2, o2, u, e2.getLine(u).length);
        }, this.getCommentRegionBlock = function(e2, t3, n2) {
          var r2 = t3.search(/\s*$/), s2 = e2.getLength(), o2 = n2, u = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/, a = 1;
          while (++n2 < s2) {
            t3 = e2.getLine(n2);
            var f = u.exec(t3);
            if (!f)
              continue;
            f[1] ? a-- : a++;
            if (!a)
              break;
          }
          var l = n2;
          if (l > o2)
            return new i2(o2, r2, l, t3.length);
        };
      }.call(o.prototype);
    }), ace.define("ace/mode/css", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/css_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/css_completions", "ace/mode/behaviour/css", "ace/mode/folding/cstyle"], function(e, t2, n) {
      var r = e("../lib/oop"), i2 = e("./text").Mode, s = e("./css_highlight_rules").CssHighlightRules, o = e("./matching_brace_outdent").MatchingBraceOutdent, u = e("../worker/worker_client").WorkerClient, a = e("./css_completions").CssCompletions, f = e("./behaviour/css").CssBehaviour, l = e("./folding/cstyle").FoldMode, c = function() {
        this.HighlightRules = s, this.$outdent = new o(), this.$behaviour = new f(), this.$completer = new a(), this.foldingRules = new l();
      };
      r.inherits(c, i2), function() {
        this.foldingRules = "cStyle", this.blockComment = { start: "/*", end: "*/" }, this.getNextLineIndent = function(e2, t3, n2) {
          var r2 = this.$getIndent(t3), i3 = this.getTokenizer().getLineTokens(t3, e2).tokens;
          if (i3.length && i3[i3.length - 1].type == "comment")
            return r2;
          var s2 = t3.match(/^.*\{\s*$/);
          return s2 && (r2 += n2), r2;
        }, this.checkOutdent = function(e2, t3, n2) {
          return this.$outdent.checkOutdent(t3, n2);
        }, this.autoOutdent = function(e2, t3, n2) {
          this.$outdent.autoOutdent(t3, n2);
        }, this.getCompletions = function(e2, t3, n2, r2) {
          return this.$completer.getCompletions(e2, t3, n2, r2);
        }, this.createWorker = function(e2) {
          var t3 = new u(["ace"], "ace/mode/css_worker", "Worker");
          return t3.attachToDocument(e2.getDocument()), t3.on("annotate", function(t4) {
            e2.setAnnotations(t4.data);
          }), t3.on("terminate", function() {
            e2.clearAnnotations();
          }), t3;
        }, this.$id = "ace/mode/css", this.snippetFileId = "ace/snippets/css";
      }.call(c.prototype), t2.Mode = c;
    });
    (function() {
      ace.require(["ace/mode/css"], function(m) {
        if (module2) {
          module2.exports = m;
        }
      });
    })();
  })(modeCss);
  var extLanguage_tools = { exports: {} };
  (function(module2, exports2) {
    ace.define("ace/snippets", ["require", "exports", "module", "ace/lib/dom", "ace/lib/oop", "ace/lib/event_emitter", "ace/lib/lang", "ace/range", "ace/range_list", "ace/keyboard/hash_handler", "ace/tokenizer", "ace/clipboard", "ace/editor"], function(e, t2, n) {
      function p(e2) {
        var t3 = new Date().toLocaleString("en-us", e2);
        return t3.length == 1 ? "0" + t3 : t3;
      }
      var r = e("./lib/dom"), i2 = e("./lib/oop"), s = e("./lib/event_emitter").EventEmitter, o = e("./lib/lang"), u = e("./range").Range, a = e("./range_list").RangeList, f = e("./keyboard/hash_handler").HashHandler, l = e("./tokenizer").Tokenizer, c = e("./clipboard"), h = { CURRENT_WORD: function(e2) {
        return e2.session.getTextRange(e2.session.getWordRange());
      }, SELECTION: function(e2, t3, n2) {
        var r2 = e2.session.getTextRange();
        return n2 ? r2.replace(/\n\r?([ \t]*\S)/g, "\n" + n2 + "$1") : r2;
      }, CURRENT_LINE: function(e2) {
        return e2.session.getLine(e2.getCursorPosition().row);
      }, PREV_LINE: function(e2) {
        return e2.session.getLine(e2.getCursorPosition().row - 1);
      }, LINE_INDEX: function(e2) {
        return e2.getCursorPosition().row;
      }, LINE_NUMBER: function(e2) {
        return e2.getCursorPosition().row + 1;
      }, SOFT_TABS: function(e2) {
        return e2.session.getUseSoftTabs() ? "YES" : "NO";
      }, TAB_SIZE: function(e2) {
        return e2.session.getTabSize();
      }, CLIPBOARD: function(e2) {
        return c.getText && c.getText();
      }, FILENAME: function(e2) {
        return /[^/\\]*$/.exec(this.FILEPATH(e2))[0];
      }, FILENAME_BASE: function(e2) {
        return /[^/\\]*$/.exec(this.FILEPATH(e2))[0].replace(/\.[^.]*$/, "");
      }, DIRECTORY: function(e2) {
        return this.FILEPATH(e2).replace(/[^/\\]*$/, "");
      }, FILEPATH: function(e2) {
        return "/not implemented.txt";
      }, WORKSPACE_NAME: function() {
        return "Unknown";
      }, FULLNAME: function() {
        return "Unknown";
      }, BLOCK_COMMENT_START: function(e2) {
        var t3 = e2.session.$mode || {};
        return t3.blockComment && t3.blockComment.start || "";
      }, BLOCK_COMMENT_END: function(e2) {
        var t3 = e2.session.$mode || {};
        return t3.blockComment && t3.blockComment.end || "";
      }, LINE_COMMENT: function(e2) {
        var t3 = e2.session.$mode || {};
        return t3.lineCommentStart || "";
      }, CURRENT_YEAR: p.bind(null, { year: "numeric" }), CURRENT_YEAR_SHORT: p.bind(null, { year: "2-digit" }), CURRENT_MONTH: p.bind(null, { month: "numeric" }), CURRENT_MONTH_NAME: p.bind(null, { month: "long" }), CURRENT_MONTH_NAME_SHORT: p.bind(null, { month: "short" }), CURRENT_DATE: p.bind(null, { day: "2-digit" }), CURRENT_DAY_NAME: p.bind(null, { weekday: "long" }), CURRENT_DAY_NAME_SHORT: p.bind(null, { weekday: "short" }), CURRENT_HOUR: p.bind(null, { hour: "2-digit", hour12: false }), CURRENT_MINUTE: p.bind(null, { minute: "2-digit" }), CURRENT_SECOND: p.bind(null, { second: "2-digit" }) };
      h.SELECTED_TEXT = h.SELECTION;
      var d = function() {
        function e2() {
          this.snippetMap = {}, this.snippetNameMap = {}, this.variables = h;
        }
        return e2.prototype.getTokenizer = function() {
          return e2.$tokenizer || this.createTokenizer();
        }, e2.prototype.createTokenizer = function() {
          function t3(e3) {
            return e3 = e3.substr(1), /^\d+$/.test(e3) ? [{ tabstopId: parseInt(e3, 10) }] : [{ text: e3 }];
          }
          function n2(e3) {
            return "(?:[^\\\\" + e3 + "]|\\\\.)";
          }
          var r2 = { regex: "/(" + n2("/") + "+)/", onMatch: function(e3, t4, n3) {
            var r3 = n3[0];
            return r3.fmtString = true, r3.guard = e3.slice(1, -1), r3.flag = "", "";
          }, next: "formatString" };
          return e2.$tokenizer = new l({ start: [{ regex: /\\./, onMatch: function(e3, t4, n3) {
            var r3 = e3[1];
            return r3 == "}" && n3.length ? e3 = r3 : "`$\\".indexOf(r3) != -1 && (e3 = r3), [e3];
          } }, { regex: /}/, onMatch: function(e3, t4, n3) {
            return [n3.length ? n3.shift() : e3];
          } }, { regex: /\$(?:\d+|\w+)/, onMatch: t3 }, { regex: /\$\{[\dA-Z_a-z]+/, onMatch: function(e3, n3, r3) {
            var i3 = t3(e3.substr(1));
            return r3.unshift(i3[0]), i3;
          }, next: "snippetVar" }, { regex: /\n/, token: "newline", merge: false }], snippetVar: [{ regex: "\\|" + n2("\\|") + "*\\|", onMatch: function(e3, t4, n3) {
            var r3 = e3.slice(1, -1).replace(/\\[,|\\]|,/g, function(e4) {
              return e4.length == 2 ? e4[1] : "\0";
            }).split("\0").map(function(e4) {
              return { value: e4 };
            });
            return n3[0].choices = r3, [r3[0]];
          }, next: "start" }, r2, { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "start" }], formatString: [{ regex: /:/, onMatch: function(e3, t4, n3) {
            return n3.length && n3[0].expectElse ? (n3[0].expectElse = false, n3[0].ifEnd = { elseEnd: n3[0] }, [n3[0].ifEnd]) : ":";
          } }, { regex: /\\./, onMatch: function(e3, t4, n3) {
            var r3 = e3[1];
            return r3 == "}" && n3.length ? e3 = r3 : "`$\\".indexOf(r3) != -1 ? e3 = r3 : r3 == "n" ? e3 = "\n" : r3 == "t" ? e3 = "	" : "ulULE".indexOf(r3) != -1 && (e3 = { changeCase: r3, local: r3 > "a" }), [e3];
          } }, { regex: "/\\w*}", onMatch: function(e3, t4, n3) {
            var r3 = n3.shift();
            return r3 && (r3.flag = e3.slice(1, -1)), this.next = r3 && r3.tabstopId ? "start" : "", [r3 || e3];
          }, next: "start" }, { regex: /\$(?:\d+|\w+)/, onMatch: function(e3, t4, n3) {
            return [{ text: e3.slice(1) }];
          } }, { regex: /\${\w+/, onMatch: function(e3, t4, n3) {
            var r3 = { text: e3.slice(2) };
            return n3.unshift(r3), [r3];
          }, next: "formatStringVar" }, { regex: /\n/, token: "newline", merge: false }, { regex: /}/, onMatch: function(e3, t4, n3) {
            var r3 = n3.shift();
            return this.next = r3 && r3.tabstopId ? "start" : "", [r3 || e3];
          }, next: "start" }], formatStringVar: [{ regex: /:\/\w+}/, onMatch: function(e3, t4, n3) {
            var r3 = n3[0];
            return r3.formatFunction = e3.slice(2, -1), [n3.shift()];
          }, next: "formatString" }, r2, { regex: /:[\?\-+]?/, onMatch: function(e3, t4, n3) {
            e3[1] == "+" && (n3[0].ifEnd = n3[0]), e3[1] == "?" && (n3[0].expectElse = true);
          }, next: "formatString" }, { regex: "([^:}\\\\]|\\\\.)*:?", token: "", next: "formatString" }] }), e2.$tokenizer;
        }, e2.prototype.tokenizeTmSnippet = function(e3, t3) {
          return this.getTokenizer().getLineTokens(e3, t3).tokens.map(function(e4) {
            return e4.value || e4;
          });
        }, e2.prototype.getVariableValue = function(e3, t3, n2) {
          if (/^\d+$/.test(t3))
            return (this.variables.__ || {})[t3] || "";
          if (/^[A-Z]\d+$/.test(t3))
            return (this.variables[t3[0] + "__"] || {})[t3.substr(1)] || "";
          t3 = t3.replace(/^TM_/, "");
          if (!this.variables.hasOwnProperty(t3))
            return "";
          var r2 = this.variables[t3];
          return typeof r2 == "function" && (r2 = this.variables[t3](e3, t3, n2)), r2 == null ? "" : r2;
        }, e2.prototype.tmStrFormat = function(e3, t3, n2) {
          if (!t3.fmt)
            return e3;
          var r2 = t3.flag || "", i3 = t3.guard;
          i3 = new RegExp(i3, r2.replace(/[^gim]/g, ""));
          var s2 = typeof t3.fmt == "string" ? this.tokenizeTmSnippet(t3.fmt, "formatString") : t3.fmt, o2 = this, u2 = e3.replace(i3, function() {
            var e4 = o2.variables.__;
            o2.variables.__ = [].slice.call(arguments);
            var t4 = o2.resolveVariables(s2, n2), r3 = "E";
            for (var i4 = 0; i4 < t4.length; i4++) {
              var u3 = t4[i4];
              if (typeof u3 == "object") {
                t4[i4] = "";
                if (u3.changeCase && u3.local) {
                  var a2 = t4[i4 + 1];
                  a2 && typeof a2 == "string" && (u3.changeCase == "u" ? t4[i4] = a2[0].toUpperCase() : t4[i4] = a2[0].toLowerCase(), t4[i4 + 1] = a2.substr(1));
                } else
                  u3.changeCase && (r3 = u3.changeCase);
              } else
                r3 == "U" ? t4[i4] = u3.toUpperCase() : r3 == "L" && (t4[i4] = u3.toLowerCase());
            }
            return o2.variables.__ = e4, t4.join("");
          });
          return u2;
        }, e2.prototype.tmFormatFunction = function(e3, t3, n2) {
          return t3.formatFunction == "upcase" ? e3.toUpperCase() : t3.formatFunction == "downcase" ? e3.toLowerCase() : e3;
        }, e2.prototype.resolveVariables = function(e3, t3) {
          function f2(t4) {
            var n3 = e3.indexOf(t4, s2 + 1);
            n3 != -1 && (s2 = n3);
          }
          var n2 = [], r2 = "", i3 = true;
          for (var s2 = 0; s2 < e3.length; s2++) {
            var o2 = e3[s2];
            if (typeof o2 == "string") {
              n2.push(o2), o2 == "\n" ? (i3 = true, r2 = "") : i3 && (r2 = /^\t*/.exec(o2)[0], i3 = /\S/.test(o2));
              continue;
            }
            if (!o2)
              continue;
            i3 = false;
            if (o2.fmtString) {
              var u2 = e3.indexOf(o2, s2 + 1);
              u2 == -1 && (u2 = e3.length), o2.fmt = e3.slice(s2 + 1, u2), s2 = u2;
            }
            if (o2.text) {
              var a2 = this.getVariableValue(t3, o2.text, r2) + "";
              o2.fmtString && (a2 = this.tmStrFormat(a2, o2, t3)), o2.formatFunction && (a2 = this.tmFormatFunction(a2, o2, t3)), a2 && !o2.ifEnd ? (n2.push(a2), f2(o2)) : !a2 && o2.ifEnd && f2(o2.ifEnd);
            } else
              o2.elseEnd ? f2(o2.elseEnd) : o2.tabstopId != null ? n2.push(o2) : o2.changeCase != null && n2.push(o2);
          }
          return n2;
        }, e2.prototype.getDisplayTextForSnippet = function(e3, t3) {
          var n2 = v.call(this, e3, t3);
          return n2.text;
        }, e2.prototype.insertSnippetForSelection = function(e3, t3, n2) {
          n2 === void 0 && (n2 = {});
          var r2 = v.call(this, e3, t3, n2), i3 = e3.getSelectionRange(), s2 = e3.session.replace(i3, r2.text), o2 = new m(e3), u2 = e3.inVirtualSelectionMode && e3.selection.index;
          o2.addTabstops(r2.tabstops, i3.start, s2, u2);
        }, e2.prototype.insertSnippet = function(e3, t3, n2) {
          n2 === void 0 && (n2 = {});
          var r2 = this;
          if (e3.inVirtualSelectionMode)
            return r2.insertSnippetForSelection(e3, t3, n2);
          e3.forEachSelection(function() {
            r2.insertSnippetForSelection(e3, t3, n2);
          }, null, { keepOrder: true }), e3.tabstopManager && e3.tabstopManager.tabNext();
        }, e2.prototype.$getScope = function(e3) {
          var t3 = e3.session.$mode.$id || "";
          t3 = t3.split("/").pop();
          if (t3 === "html" || t3 === "php") {
            t3 === "php" && !e3.session.$mode.inlinePhp && (t3 = "html");
            var n2 = e3.getCursorPosition(), r2 = e3.session.getState(n2.row);
            typeof r2 == "object" && (r2 = r2[0]), r2.substring && (r2.substring(0, 3) == "js-" ? t3 = "javascript" : r2.substring(0, 4) == "css-" ? t3 = "css" : r2.substring(0, 4) == "php-" && (t3 = "php"));
          }
          return t3;
        }, e2.prototype.getActiveScopes = function(e3) {
          var t3 = this.$getScope(e3), n2 = [t3], r2 = this.snippetMap;
          return r2[t3] && r2[t3].includeScopes && n2.push.apply(n2, r2[t3].includeScopes), n2.push("_"), n2;
        }, e2.prototype.expandWithTab = function(e3, t3) {
          var n2 = this, r2 = e3.forEachSelection(function() {
            return n2.expandSnippetForSelection(e3, t3);
          }, null, { keepOrder: true });
          return r2 && e3.tabstopManager && e3.tabstopManager.tabNext(), r2;
        }, e2.prototype.expandSnippetForSelection = function(e3, t3) {
          var n2 = e3.getCursorPosition(), r2 = e3.session.getLine(n2.row), i3 = r2.substring(0, n2.column), s2 = r2.substr(n2.column), o2 = this.snippetMap, u2;
          return this.getActiveScopes(e3).some(function(e4) {
            var t4 = o2[e4];
            return t4 && (u2 = this.findMatchingSnippet(t4, i3, s2)), !!u2;
          }, this), u2 ? t3 && t3.dryRun ? true : (e3.session.doc.removeInLine(n2.row, n2.column - u2.replaceBefore.length, n2.column + u2.replaceAfter.length), this.variables.M__ = u2.matchBefore, this.variables.T__ = u2.matchAfter, this.insertSnippetForSelection(e3, u2.content), this.variables.M__ = this.variables.T__ = null, true) : false;
        }, e2.prototype.findMatchingSnippet = function(e3, t3, n2) {
          for (var r2 = e3.length; r2--; ) {
            var i3 = e3[r2];
            if (i3.startRe && !i3.startRe.test(t3))
              continue;
            if (i3.endRe && !i3.endRe.test(n2))
              continue;
            if (!i3.startRe && !i3.endRe)
              continue;
            return i3.matchBefore = i3.startRe ? i3.startRe.exec(t3) : [""], i3.matchAfter = i3.endRe ? i3.endRe.exec(n2) : [""], i3.replaceBefore = i3.triggerRe ? i3.triggerRe.exec(t3)[0] : "", i3.replaceAfter = i3.endTriggerRe ? i3.endTriggerRe.exec(n2)[0] : "", i3;
          }
        }, e2.prototype.register = function(e3, t3) {
          function s2(e4) {
            return e4 && !/^\^?\(.*\)\$?$|^\\b$/.test(e4) && (e4 = "(?:" + e4 + ")"), e4 || "";
          }
          function u2(e4, t4, n3) {
            return e4 = s2(e4), t4 = s2(t4), n3 ? (e4 = t4 + e4, e4 && e4[e4.length - 1] != "$" && (e4 += "$")) : (e4 += t4, e4 && e4[0] != "^" && (e4 = "^" + e4)), new RegExp(e4);
          }
          function a2(e4) {
            e4.scope || (e4.scope = t3 || "_"), t3 = e4.scope, n2[t3] || (n2[t3] = [], r2[t3] = {});
            var s3 = r2[t3];
            if (e4.name) {
              var a3 = s3[e4.name];
              a3 && i3.unregister(a3), s3[e4.name] = e4;
            }
            n2[t3].push(e4), e4.prefix && (e4.tabTrigger = e4.prefix), !e4.content && e4.body && (e4.content = Array.isArray(e4.body) ? e4.body.join("\n") : e4.body), e4.tabTrigger && !e4.trigger && (!e4.guard && /^\w/.test(e4.tabTrigger) && (e4.guard = "\\b"), e4.trigger = o.escapeRegExp(e4.tabTrigger));
            if (!e4.trigger && !e4.guard && !e4.endTrigger && !e4.endGuard)
              return;
            e4.startRe = u2(e4.trigger, e4.guard, true), e4.triggerRe = new RegExp(e4.trigger), e4.endRe = u2(e4.endTrigger, e4.endGuard, true), e4.endTriggerRe = new RegExp(e4.endTrigger);
          }
          var n2 = this.snippetMap, r2 = this.snippetNameMap, i3 = this;
          e3 || (e3 = []), Array.isArray(e3) ? e3.forEach(a2) : Object.keys(e3).forEach(function(t4) {
            a2(e3[t4]);
          }), this._signal("registerSnippets", { scope: t3 });
        }, e2.prototype.unregister = function(e3, t3) {
          function i3(e4) {
            var i4 = r2[e4.scope || t3];
            if (i4 && i4[e4.name]) {
              delete i4[e4.name];
              var s2 = n2[e4.scope || t3], o2 = s2 && s2.indexOf(e4);
              o2 >= 0 && s2.splice(o2, 1);
            }
          }
          var n2 = this.snippetMap, r2 = this.snippetNameMap;
          e3.content ? i3(e3) : Array.isArray(e3) && e3.forEach(i3);
        }, e2.prototype.parseSnippetFile = function(e3) {
          e3 = e3.replace(/\r/g, "");
          var t3 = [], n2 = {}, r2 = /^#.*|^({[\s\S]*})\s*$|^(\S+) (.*)$|^((?:\n*\t.*)+)/gm, i3;
          while (i3 = r2.exec(e3)) {
            if (i3[1])
              try {
                n2 = JSON.parse(i3[1]), t3.push(n2);
              } catch (s2) {
              }
            if (i3[4])
              n2.content = i3[4].replace(/^\t/gm, ""), t3.push(n2), n2 = {};
            else {
              var o2 = i3[2], u2 = i3[3];
              if (o2 == "regex") {
                var a2 = /\/((?:[^\/\\]|\\.)*)|$/g;
                n2.guard = a2.exec(u2)[1], n2.trigger = a2.exec(u2)[1], n2.endTrigger = a2.exec(u2)[1], n2.endGuard = a2.exec(u2)[1];
              } else
                o2 == "snippet" ? (n2.tabTrigger = u2.match(/^\S*/)[0], n2.name || (n2.name = u2)) : o2 && (n2[o2] = u2);
            }
          }
          return t3;
        }, e2.prototype.getSnippetByName = function(e3, t3) {
          var n2 = this.snippetNameMap, r2;
          return this.getActiveScopes(t3).some(function(t4) {
            var i3 = n2[t4];
            return i3 && (r2 = i3[e3]), !!r2;
          }, this), r2;
        }, e2;
      }();
      i2.implement(d.prototype, s);
      var v = function(e2, t3, n2) {
        function l2(e3) {
          var t4 = [];
          for (var n3 = 0; n3 < e3.length; n3++) {
            var r3 = e3[n3];
            if (typeof r3 == "object") {
              if (f2[r3.tabstopId])
                continue;
              var i4 = e3.lastIndexOf(r3, n3 - 1);
              r3 = t4[i4] || { tabstopId: r3.tabstopId };
            }
            t4[n3] = r3;
          }
          return t4;
        }
        n2 === void 0 && (n2 = {});
        var r2 = e2.getCursorPosition(), i3 = e2.session.getLine(r2.row), s2 = e2.session.getTabString(), o2 = i3.match(/^\s*/)[0];
        r2.column < o2.length && (o2 = o2.slice(0, r2.column)), t3 = t3.replace(/\r/g, "");
        var u2 = this.tokenizeTmSnippet(t3);
        u2 = this.resolveVariables(u2, e2), u2 = u2.map(function(e3) {
          return e3 == "\n" && !n2.excludeExtraIndent ? e3 + o2 : typeof e3 == "string" ? e3.replace(/\t/g, s2) : e3;
        });
        var a2 = [];
        u2.forEach(function(e3, t4) {
          if (typeof e3 != "object")
            return;
          var n3 = e3.tabstopId, r3 = a2[n3];
          r3 || (r3 = a2[n3] = [], r3.index = n3, r3.value = "", r3.parents = {});
          if (r3.indexOf(e3) !== -1)
            return;
          e3.choices && !r3.choices && (r3.choices = e3.choices), r3.push(e3);
          var i4 = u2.indexOf(e3, t4 + 1);
          if (i4 === -1)
            return;
          var s3 = u2.slice(t4 + 1, i4), o3 = s3.some(function(e4) {
            return typeof e4 == "object";
          });
          o3 && !r3.value ? r3.value = s3 : s3.length && (!r3.value || typeof r3.value != "string") && (r3.value = s3.join(""));
        }), a2.forEach(function(e3) {
          e3.length = 0;
        });
        var f2 = {};
        for (var c2 = 0; c2 < u2.length; c2++) {
          var h2 = u2[c2];
          if (typeof h2 != "object")
            continue;
          var p2 = h2.tabstopId, d2 = a2[p2], v2 = u2.indexOf(h2, c2 + 1);
          if (f2[p2]) {
            f2[p2] === h2 && (delete f2[p2], Object.keys(f2).forEach(function(e3) {
              d2.parents[e3] = true;
            }));
            continue;
          }
          f2[p2] = h2;
          var m2 = d2.value;
          typeof m2 != "string" ? m2 = l2(m2) : h2.fmt && (m2 = this.tmStrFormat(m2, h2, e2)), u2.splice.apply(u2, [c2 + 1, Math.max(0, v2 - c2)].concat(m2, h2)), d2.indexOf(h2) === -1 && d2.push(h2);
        }
        var g2 = 0, y2 = 0, b2 = "";
        return u2.forEach(function(e3) {
          if (typeof e3 == "string") {
            var t4 = e3.split("\n");
            t4.length > 1 ? (y2 = t4[t4.length - 1].length, g2 += t4.length - 1) : y2 += e3.length, b2 += e3;
          } else
            e3 && (e3.start ? e3.end = { row: g2, column: y2 } : e3.start = { row: g2, column: y2 });
        }), { text: b2, tabstops: a2, tokens: u2 };
      }, m = function() {
        function e2(e3) {
          this.index = 0, this.ranges = [], this.tabstops = [];
          if (e3.tabstopManager)
            return e3.tabstopManager;
          e3.tabstopManager = this, this.$onChange = this.onChange.bind(this), this.$onChangeSelection = o.delayedCall(this.onChangeSelection.bind(this)).schedule, this.$onChangeSession = this.onChangeSession.bind(this), this.$onAfterExec = this.onAfterExec.bind(this), this.attach(e3);
        }
        return e2.prototype.attach = function(e3) {
          this.$openTabstops = null, this.selectedTabstop = null, this.editor = e3, this.session = e3.session, this.editor.on("change", this.$onChange), this.editor.on("changeSelection", this.$onChangeSelection), this.editor.on("changeSession", this.$onChangeSession), this.editor.commands.on("afterExec", this.$onAfterExec), this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler);
        }, e2.prototype.detach = function() {
          this.tabstops.forEach(this.removeTabstopMarkers, this), this.ranges.length = 0, this.tabstops.length = 0, this.selectedTabstop = null, this.editor.off("change", this.$onChange), this.editor.off("changeSelection", this.$onChangeSelection), this.editor.off("changeSession", this.$onChangeSession), this.editor.commands.off("afterExec", this.$onAfterExec), this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler), this.editor.tabstopManager = null, this.session = null, this.editor = null;
        }, e2.prototype.onChange = function(e3) {
          var t3 = e3.action[0] == "r", n2 = this.selectedTabstop || {}, r2 = n2.parents || {}, i3 = this.tabstops.slice();
          for (var s2 = 0; s2 < i3.length; s2++) {
            var o2 = i3[s2], u2 = o2 == n2 || r2[o2.index];
            o2.rangeList.$bias = u2 ? 0 : 1;
            if (e3.action == "remove" && o2 !== n2) {
              var a2 = o2.parents && o2.parents[n2.index], f2 = o2.rangeList.pointIndex(e3.start, a2);
              f2 = f2 < 0 ? -f2 - 1 : f2 + 1;
              var l2 = o2.rangeList.pointIndex(e3.end, a2);
              l2 = l2 < 0 ? -l2 - 1 : l2 - 1;
              var c2 = o2.rangeList.ranges.slice(f2, l2);
              for (var h2 = 0; h2 < c2.length; h2++)
                this.removeRange(c2[h2]);
            }
            o2.rangeList.$onChange(e3);
          }
          var p2 = this.session;
          !this.$inChange && t3 && p2.getLength() == 1 && !p2.getValue() && this.detach();
        }, e2.prototype.updateLinkedFields = function() {
          var e3 = this.selectedTabstop;
          if (!e3 || !e3.hasLinkedRanges || !e3.firstNonLinked)
            return;
          this.$inChange = true;
          var n2 = this.session, r2 = n2.getTextRange(e3.firstNonLinked);
          for (var i3 = 0; i3 < e3.length; i3++) {
            var s2 = e3[i3];
            if (!s2.linked)
              continue;
            var o2 = s2.original, u2 = t2.snippetManager.tmStrFormat(r2, o2, this.editor);
            n2.replace(s2, u2);
          }
          this.$inChange = false;
        }, e2.prototype.onAfterExec = function(e3) {
          e3.command && !e3.command.readOnly && this.updateLinkedFields();
        }, e2.prototype.onChangeSelection = function() {
          if (!this.editor)
            return;
          var e3 = this.editor.selection.lead, t3 = this.editor.selection.anchor, n2 = this.editor.selection.isEmpty();
          for (var r2 = 0; r2 < this.ranges.length; r2++) {
            if (this.ranges[r2].linked)
              continue;
            var i3 = this.ranges[r2].contains(e3.row, e3.column), s2 = n2 || this.ranges[r2].contains(t3.row, t3.column);
            if (i3 && s2)
              return;
          }
          this.detach();
        }, e2.prototype.onChangeSession = function() {
          this.detach();
        }, e2.prototype.tabNext = function(e3) {
          var t3 = this.tabstops.length, n2 = this.index + (e3 || 1);
          n2 = Math.min(Math.max(n2, 1), t3), n2 == t3 && (n2 = 0), this.selectTabstop(n2), n2 === 0 && this.detach();
        }, e2.prototype.selectTabstop = function(e3) {
          this.$openTabstops = null;
          var t3 = this.tabstops[this.index];
          t3 && this.addTabstopMarkers(t3), this.index = e3, t3 = this.tabstops[this.index];
          if (!t3 || !t3.length)
            return;
          this.selectedTabstop = t3;
          var n2 = t3.firstNonLinked || t3;
          t3.choices && (n2.cursor = n2.start);
          if (!this.editor.inVirtualSelectionMode) {
            var r2 = this.editor.multiSelect;
            r2.toSingleRange(n2);
            for (var i3 = 0; i3 < t3.length; i3++) {
              if (t3.hasLinkedRanges && t3[i3].linked)
                continue;
              r2.addRange(t3[i3].clone(), true);
            }
          } else
            this.editor.selection.fromOrientedRange(n2);
          this.editor.keyBinding.addKeyboardHandler(this.keyboardHandler), this.selectedTabstop && this.selectedTabstop.choices && this.editor.execCommand("startAutocomplete", { matches: this.selectedTabstop.choices });
        }, e2.prototype.addTabstops = function(e3, t3, n2) {
          var r2 = this.useLink || !this.editor.getOption("enableMultiselect");
          this.$openTabstops || (this.$openTabstops = []);
          if (!e3[0]) {
            var i3 = u.fromPoints(n2, n2);
            y(i3.start, t3), y(i3.end, t3), e3[0] = [i3], e3[0].index = 0;
          }
          var s2 = this.index, o2 = [s2 + 1, 0], f2 = this.ranges;
          e3.forEach(function(e4, n3) {
            var i4 = this.$openTabstops[n3] || e4;
            for (var s3 = 0; s3 < e4.length; s3++) {
              var l2 = e4[s3], c2 = u.fromPoints(l2.start, l2.end || l2.start);
              g(c2.start, t3), g(c2.end, t3), c2.original = l2, c2.tabstop = i4, f2.push(c2), i4 != e4 ? i4.unshift(c2) : i4[s3] = c2, l2.fmtString || i4.firstNonLinked && r2 ? (c2.linked = true, i4.hasLinkedRanges = true) : i4.firstNonLinked || (i4.firstNonLinked = c2);
            }
            i4.firstNonLinked || (i4.hasLinkedRanges = false), i4 === e4 && (o2.push(i4), this.$openTabstops[n3] = i4), this.addTabstopMarkers(i4), i4.rangeList = i4.rangeList || new a(), i4.rangeList.$bias = 0, i4.rangeList.addList(i4);
          }, this), o2.length > 2 && (this.tabstops.length && o2.push(o2.splice(2, 1)[0]), this.tabstops.splice.apply(this.tabstops, o2));
        }, e2.prototype.addTabstopMarkers = function(e3) {
          var t3 = this.session;
          e3.forEach(function(e4) {
            e4.markerId || (e4.markerId = t3.addMarker(e4, "ace_snippet-marker", "text"));
          });
        }, e2.prototype.removeTabstopMarkers = function(e3) {
          var t3 = this.session;
          e3.forEach(function(e4) {
            t3.removeMarker(e4.markerId), e4.markerId = null;
          });
        }, e2.prototype.removeRange = function(e3) {
          var t3 = e3.tabstop.indexOf(e3);
          t3 != -1 && e3.tabstop.splice(t3, 1), t3 = this.ranges.indexOf(e3), t3 != -1 && this.ranges.splice(t3, 1), t3 = e3.tabstop.rangeList.ranges.indexOf(e3), t3 != -1 && e3.tabstop.splice(t3, 1), this.session.removeMarker(e3.markerId), e3.tabstop.length || (t3 = this.tabstops.indexOf(e3.tabstop), t3 != -1 && this.tabstops.splice(t3, 1), this.tabstops.length || this.detach());
        }, e2;
      }();
      m.prototype.keyboardHandler = new f(), m.prototype.keyboardHandler.bindKeys({ Tab: function(e2) {
        if (t2.snippetManager && t2.snippetManager.expandWithTab(e2))
          return;
        e2.tabstopManager.tabNext(1), e2.renderer.scrollCursorIntoView();
      }, "Shift-Tab": function(e2) {
        e2.tabstopManager.tabNext(-1), e2.renderer.scrollCursorIntoView();
      }, Esc: function(e2) {
        e2.tabstopManager.detach();
      } });
      var g = function(e2, t3) {
        e2.row == 0 && (e2.column += t3.column), e2.row += t3.row;
      }, y = function(e2, t3) {
        e2.row == t3.row && (e2.column -= t3.column), e2.row -= t3.row;
      };
      r.importCssString("\n.ace_snippet-marker {\n    -moz-box-sizing: border-box;\n    box-sizing: border-box;\n    background: rgba(194, 193, 208, 0.09);\n    border: 1px dotted rgba(211, 208, 235, 0.62);\n    position: absolute;\n}", "snippets.css", false), t2.snippetManager = new d();
      var b = e("./editor").Editor;
      (function() {
        this.insertSnippet = function(e2, n2) {
          return t2.snippetManager.insertSnippet(this, e2, n2);
        }, this.expandSnippet = function(e2) {
          return t2.snippetManager.expandWithTab(this, e2);
        };
      }).call(b.prototype);
    }), ace.define("ace/autocomplete/popup", ["require", "exports", "module", "ace/virtual_renderer", "ace/editor", "ace/range", "ace/lib/event", "ace/lib/lang", "ace/lib/dom", "ace/config"], function(e, t2, n) {
      var r = e("../virtual_renderer").VirtualRenderer, i2 = e("../editor").Editor, s = e("../range").Range, o = e("../lib/event"), u = e("../lib/lang"), a = e("../lib/dom"), f = e("../config").nls, l = function(e2) {
        return "suggest-aria-id:".concat(e2);
      }, c = function(e2) {
        var t3 = new r(e2);
        t3.$maxLines = 4;
        var n2 = new i2(t3);
        return n2.setHighlightActiveLine(false), n2.setShowPrintMargin(false), n2.renderer.setShowGutter(false), n2.renderer.setHighlightGutterLine(false), n2.$mouseHandler.$focusTimeout = 0, n2.$highlightTagPending = true, n2;
      }, h = function() {
        function e2(e3) {
          var t3 = a.createElement("div"), n2 = new c(t3);
          e3 && e3.appendChild(t3), t3.style.display = "none", n2.renderer.content.style.cursor = "default", n2.renderer.setStyle("ace_autocomplete"), n2.renderer.$textLayer.element.setAttribute("role", "listbox"), n2.renderer.$textLayer.element.setAttribute("aria-label", f("Autocomplete suggestions")), n2.renderer.textarea.setAttribute("aria-hidden", "true"), n2.setOption("displayIndentGuides", false), n2.setOption("dragDelay", 150);
          var r2 = function() {
          };
          n2.focus = r2, n2.$isFocused = true, n2.renderer.$cursorLayer.restartTimer = r2, n2.renderer.$cursorLayer.element.style.opacity = 0, n2.renderer.$maxLines = 8, n2.renderer.$keepTextAreaAtCursor = false, n2.setHighlightActiveLine(false), n2.session.highlight(""), n2.session.$searchHighlight.clazz = "ace_highlight-marker", n2.on("mousedown", function(e4) {
            var t4 = e4.getDocumentPosition();
            n2.selection.moveToPosition(t4), p.start.row = p.end.row = t4.row, e4.stop();
          });
          var i3, h2 = new s(-1, 0, -1, Infinity), p = new s(-1, 0, -1, Infinity);
          p.id = n2.session.addMarker(p, "ace_active-line", "fullLine"), n2.setSelectOnHover = function(e4) {
            e4 ? h2.id && (n2.session.removeMarker(h2.id), h2.id = null) : h2.id = n2.session.addMarker(h2, "ace_line-hover", "fullLine");
          }, n2.setSelectOnHover(false), n2.on("mousemove", function(e4) {
            if (!i3) {
              i3 = e4;
              return;
            }
            if (i3.x == e4.x && i3.y == e4.y)
              return;
            i3 = e4, i3.scrollTop = n2.renderer.scrollTop, n2.isMouseOver = true;
            var t4 = i3.getDocumentPosition().row;
            h2.start.row != t4 && (h2.id || n2.setRow(t4), v(t4));
          }), n2.renderer.on("beforeRender", function() {
            if (i3 && h2.start.row != -1) {
              i3.$pos = null;
              var e4 = i3.getDocumentPosition().row;
              h2.id || n2.setRow(e4), v(e4, true);
            }
          }), n2.renderer.on("afterRender", function() {
            var e4 = n2.getRow(), t4 = n2.renderer.$textLayer, r3 = t4.element.childNodes[e4 - t4.config.firstRow], i4 = document.activeElement;
            r3 !== t4.selectedNode && t4.selectedNode && (a.removeCssClass(t4.selectedNode, "ace_selected"), i4.removeAttribute("aria-activedescendant"), t4.selectedNode.removeAttribute("id")), t4.selectedNode = r3;
            if (r3) {
              a.addCssClass(r3, "ace_selected");
              var s2 = l(e4);
              r3.id = s2, t4.element.setAttribute("aria-activedescendant", s2), i4.setAttribute("aria-activedescendant", s2), r3.setAttribute("role", "option"), r3.setAttribute("aria-label", n2.getData(e4).value), r3.setAttribute("aria-setsize", n2.data.length), r3.setAttribute("aria-posinset", e4 + 1), r3.setAttribute("aria-describedby", "doc-tooltip");
            }
          });
          var d = function() {
            v(-1);
          }, v = function(e4, t4) {
            e4 !== h2.start.row && (h2.start.row = h2.end.row = e4, t4 || n2.session._emit("changeBackMarker"), n2._emit("changeHoverMarker"));
          };
          n2.getHoveredRow = function() {
            return h2.start.row;
          }, o.addListener(n2.container, "mouseout", function() {
            n2.isMouseOver = false, d();
          }), n2.on("hide", d), n2.on("changeSelection", d), n2.session.doc.getLength = function() {
            return n2.data.length;
          }, n2.session.doc.getLine = function(e4) {
            var t4 = n2.data[e4];
            return typeof t4 == "string" ? t4 : t4 && t4.value || "";
          };
          var m = n2.session.bgTokenizer;
          return m.$tokenizeRow = function(e4) {
            function s2(e5, n3) {
              e5 && r3.push({ type: (t4.className || "") + (n3 || ""), value: e5 });
            }
            var t4 = n2.data[e4], r3 = [];
            if (!t4)
              return r3;
            typeof t4 == "string" && (t4 = { value: t4 });
            var i4 = t4.caption || t4.value || t4.name, o2 = i4.toLowerCase(), u2 = (n2.filterText || "").toLowerCase(), a2 = 0, f2 = 0;
            for (var l2 = 0; l2 <= u2.length; l2++)
              if (l2 != f2 && (t4.matchMask & 1 << l2 || l2 == u2.length)) {
                var c2 = u2.slice(f2, l2);
                f2 = l2;
                var h3 = o2.indexOf(c2, a2);
                if (h3 == -1)
                  continue;
                s2(i4.slice(a2, h3), ""), a2 = h3 + c2.length, s2(i4.slice(h3, a2), "completion-highlight");
              }
            return s2(i4.slice(a2, i4.length), ""), r3.push({ type: "completion-spacer", value: " " }), t4.meta && r3.push({ type: "completion-meta", value: t4.meta }), t4.message && r3.push({ type: "completion-message", value: t4.message }), r3;
          }, m.$updateOnChange = r2, m.start = r2, n2.session.$computeWidth = function() {
            return this.screenWidth = 0;
          }, n2.isOpen = false, n2.isTopdown = false, n2.autoSelect = true, n2.filterText = "", n2.isMouseOver = false, n2.data = [], n2.setData = function(e4, t4) {
            n2.filterText = t4 || "", n2.setValue(u.stringRepeat("\n", e4.length), -1), n2.data = e4 || [], n2.setRow(0);
          }, n2.getData = function(e4) {
            return n2.data[e4];
          }, n2.getRow = function() {
            return p.start.row;
          }, n2.setRow = function(e4) {
            e4 = Math.max(this.autoSelect ? 0 : -1, Math.min(this.data.length - 1, e4)), p.start.row != e4 && (n2.selection.clearSelection(), p.start.row = p.end.row = e4 || 0, n2.session._emit("changeBackMarker"), n2.moveCursorTo(e4 || 0, 0), n2.isOpen && n2._signal("select"));
          }, n2.on("changeSelection", function() {
            n2.isOpen && n2.setRow(n2.selection.lead.row), n2.renderer.scrollCursorIntoView();
          }), n2.hide = function() {
            this.container.style.display = "none", n2.anchorPos = null, n2.anchor = null, n2.isOpen && (n2.isOpen = false, this._signal("hide"));
          }, n2.tryShow = function(e4, t4, r3, s2) {
            if (!s2 && n2.isOpen && n2.anchorPos && n2.anchor && n2.anchorPos.top === e4.top && n2.anchorPos.left === e4.left && n2.anchor === r3)
              return true;
            var o2 = this.container, u2 = window.innerHeight, a2 = window.innerWidth, f2 = this.renderer, l2 = f2.$maxLines * t4 * 1.4, c2 = { top: 0, bottom: 0, left: 0 }, h3 = u2 - e4.top - 3 * this.$borderSize - t4, p2 = e4.top - 3 * this.$borderSize;
            r3 || (p2 <= h3 || h3 >= l2 ? r3 = "bottom" : r3 = "top"), r3 === "top" ? (c2.bottom = e4.top - this.$borderSize, c2.top = c2.bottom - l2) : r3 === "bottom" && (c2.top = e4.top + t4 + this.$borderSize, c2.bottom = c2.top + l2);
            var d2 = c2.top >= 0 && c2.bottom <= u2;
            if (!s2 && !d2)
              return false;
            d2 ? f2.$maxPixelHeight = null : r3 === "top" ? f2.$maxPixelHeight = p2 : f2.$maxPixelHeight = h3, r3 === "top" ? (o2.style.top = "", o2.style.bottom = u2 - c2.bottom + "px", n2.isTopdown = false) : (o2.style.top = c2.top + "px", o2.style.bottom = "", n2.isTopdown = true), o2.style.display = "";
            var v2 = e4.left;
            return v2 + o2.offsetWidth > a2 && (v2 = a2 - o2.offsetWidth), o2.style.left = v2 + "px", o2.style.right = "", n2.isOpen || (n2.isOpen = true, this._signal("show"), i3 = null), n2.anchorPos = e4, n2.anchor = r3, true;
          }, n2.show = function(e4, t4, n3) {
            this.tryShow(e4, t4, n3 ? "bottom" : void 0, true);
          }, n2.goTo = function(e4) {
            var t4 = this.getRow(), n3 = this.session.getLength() - 1;
            switch (e4) {
              case "up":
                t4 = t4 <= 0 ? n3 : t4 - 1;
                break;
              case "down":
                t4 = t4 >= n3 ? -1 : t4 + 1;
                break;
              case "start":
                t4 = 0;
                break;
              case "end":
                t4 = n3;
            }
            this.setRow(t4);
          }, n2.getTextLeftOffset = function() {
            return this.$borderSize + this.renderer.$padding + this.$imageSize;
          }, n2.$imageSize = 0, n2.$borderSize = 1, n2;
        }
        return e2;
      }();
      a.importCssString('\n.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n    background-color: #CAD6FA;\n    z-index: 1;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\n    background-color: #3a674e;\n}\n.ace_editor.ace_autocomplete .ace_line-hover {\n    border: 1px solid #abbffe;\n    margin-top: -1px;\n    background: rgba(233,233,253,0.4);\n    position: absolute;\n    z-index: 2;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_line-hover {\n    border: 1px solid rgba(109, 150, 13, 0.8);\n    background: rgba(58, 103, 78, 0.62);\n}\n.ace_completion-meta {\n    opacity: 0.5;\n    margin-left: 0.9em;\n}\n.ace_completion-message {\n    margin-left: 0.9em;\n    color: blue;\n}\n.ace_editor.ace_autocomplete .ace_completion-highlight{\n    color: #2d69c7;\n}\n.ace_dark.ace_editor.ace_autocomplete .ace_completion-highlight{\n    color: #93ca12;\n}\n.ace_editor.ace_autocomplete {\n    width: 300px;\n    z-index: 200000;\n    border: 1px lightgray solid;\n    position: fixed;\n    box-shadow: 2px 3px 5px rgba(0,0,0,.2);\n    line-height: 1.4;\n    background: #fefefe;\n    color: #111;\n}\n.ace_dark.ace_editor.ace_autocomplete {\n    border: 1px #484747 solid;\n    box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.51);\n    line-height: 1.4;\n    background: #25282c;\n    color: #c1c1c1;\n}\n.ace_autocomplete .ace_text-layer  {\n    width: calc(100% - 8px);\n}\n.ace_autocomplete .ace_line {\n    display: flex;\n    align-items: center;\n}\n.ace_autocomplete .ace_line > * {\n    min-width: 0;\n    flex: 0 0 auto;\n}\n.ace_autocomplete .ace_line .ace_ {\n    flex: 0 1 auto;\n    overflow: hidden;\n    white-space: nowrap;\n    text-overflow: ellipsis;\n}\n.ace_autocomplete .ace_completion-spacer {\n    flex: 1;\n}\n.ace_autocomplete.ace_loading:after  {\n    content: "";\n    position: absolute;\n    top: 0px;\n    height: 2px;\n    width: 8%;\n    background: blue;\n    z-index: 100;\n    animation: ace_progress 3s infinite linear;\n    animation-delay: 300ms;\n    transform: translateX(-100%) scaleX(1);\n}\n@keyframes ace_progress {\n    0% { transform: translateX(-100%) scaleX(1) }\n    50% { transform: translateX(625%) scaleX(2) } \n    100% { transform: translateX(1500%) scaleX(3) } \n}\n@media (prefers-reduced-motion) {\n    .ace_autocomplete.ace_loading:after {\n        transform: translateX(625%) scaleX(2);\n        animation: none;\n     }\n}\n', "autocompletion.css", false), t2.AcePopup = h, t2.$singleLineEditor = c, t2.getAriaId = l;
    }), ace.define("ace/autocomplete/inline_screenreader", ["require", "exports", "module"], function(e, t2, n) {
      var r = function() {
        function e2(e3) {
          this.editor = e3, this.screenReaderDiv = document.createElement("div"), this.screenReaderDiv.classList.add("ace_screenreader-only"), this.editor.container.appendChild(this.screenReaderDiv);
        }
        return e2.prototype.setScreenReaderContent = function(e3) {
          !this.popup && this.editor.completer && this.editor.completer.popup && (this.popup = this.editor.completer.popup, this.popup.renderer.on("afterRender", function() {
            var e4 = this.popup.getRow(), t4 = this.popup.renderer.$textLayer, n2 = t4.element.childNodes[e4 - t4.config.firstRow];
            if (n2) {
              var r2 = "doc-tooltip ";
              for (var i2 = 0; i2 < this._lines.length; i2++)
                r2 += "ace-inline-screenreader-line-".concat(i2, " ");
              n2.setAttribute("aria-describedby", r2);
            }
          }.bind(this)));
          while (this.screenReaderDiv.firstChild)
            this.screenReaderDiv.removeChild(this.screenReaderDiv.firstChild);
          this._lines = e3.split(/\r\n|\r|\n/);
          var t3 = this.createCodeBlock();
          this.screenReaderDiv.appendChild(t3);
        }, e2.prototype.destroy = function() {
          this.screenReaderDiv.remove();
        }, e2.prototype.createCodeBlock = function() {
          var e3 = document.createElement("pre");
          e3.setAttribute("id", "ace-inline-screenreader");
          for (var t3 = 0; t3 < this._lines.length; t3++) {
            var n2 = document.createElement("code");
            n2.setAttribute("id", "ace-inline-screenreader-line-".concat(t3));
            var r2 = document.createTextNode(this._lines[t3]);
            n2.appendChild(r2), e3.appendChild(n2);
          }
          return e3;
        }, e2;
      }();
      t2.AceInlineScreenReader = r;
    }), ace.define("ace/autocomplete/inline", ["require", "exports", "module", "ace/snippets", "ace/autocomplete/inline_screenreader"], function(e, t2, n) {
      var r = e("../snippets").snippetManager, i2 = e("./inline_screenreader").AceInlineScreenReader, s = function() {
        function e2() {
          this.editor = null;
        }
        return e2.prototype.show = function(e3, t3, n2) {
          n2 = n2 || "", e3 && this.editor && this.editor !== e3 && (this.hide(), this.editor = null, this.inlineScreenReader = null);
          if (!e3 || !t3)
            return false;
          this.inlineScreenReader || (this.inlineScreenReader = new i2(e3));
          var s2 = t3.snippet ? r.getDisplayTextForSnippet(e3, t3.snippet) : t3.value;
          return t3.hideInlinePreview || !s2 || !s2.startsWith(n2) ? false : (this.editor = e3, this.inlineScreenReader.setScreenReaderContent(s2), s2 = s2.slice(n2.length), s2 === "" ? e3.removeGhostText() : e3.setGhostText(s2), true);
        }, e2.prototype.isOpen = function() {
          return this.editor ? !!this.editor.renderer.$ghostText : false;
        }, e2.prototype.hide = function() {
          return this.editor ? (this.editor.removeGhostText(), true) : false;
        }, e2.prototype.destroy = function() {
          this.hide(), this.editor = null, this.inlineScreenReader && (this.inlineScreenReader.destroy(), this.inlineScreenReader = null);
        }, e2;
      }();
      t2.AceInline = s;
    }), ace.define("ace/autocomplete/util", ["require", "exports", "module"], function(e, t2, n) {
      t2.parForEach = function(e2, t3, n2) {
        var r2 = 0, i2 = e2.length;
        i2 === 0 && n2();
        for (var s = 0; s < i2; s++)
          t3(e2[s], function(e3, t4) {
            r2++, r2 === i2 && n2(e3, t4);
          });
      };
      var r = /[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;
      t2.retrievePrecedingIdentifier = function(e2, t3, n2) {
        n2 = n2 || r;
        var i2 = [];
        for (var s = t3 - 1; s >= 0; s--) {
          if (!n2.test(e2[s]))
            break;
          i2.push(e2[s]);
        }
        return i2.reverse().join("");
      }, t2.retrieveFollowingIdentifier = function(e2, t3, n2) {
        n2 = n2 || r;
        var i2 = [];
        for (var s = t3; s < e2.length; s++) {
          if (!n2.test(e2[s]))
            break;
          i2.push(e2[s]);
        }
        return i2;
      }, t2.getCompletionPrefix = function(e2) {
        var t3 = e2.getCursorPosition(), n2 = e2.session.getLine(t3.row), r2;
        return e2.completers.forEach(function(e3) {
          e3.identifierRegexps && e3.identifierRegexps.forEach(function(e4) {
            !r2 && e4 && (r2 = this.retrievePrecedingIdentifier(n2, t3.column, e4));
          }.bind(this));
        }.bind(this)), r2 || this.retrievePrecedingIdentifier(n2, t3.column);
      }, t2.triggerAutocomplete = function(e2) {
        var t3 = e2.getCursorPosition(), n2 = e2.session.getLine(t3.row), r2 = t3.column === 0 ? 0 : t3.column - 1, i2 = n2[r2];
        return e2.completers.some(function(e3) {
          if (e3.triggerCharacters && Array.isArray(e3.triggerCharacters))
            return e3.triggerCharacters.includes(i2);
        });
      };
    }), ace.define("ace/autocomplete", ["require", "exports", "module", "ace/keyboard/hash_handler", "ace/autocomplete/popup", "ace/autocomplete/inline", "ace/autocomplete/popup", "ace/autocomplete/util", "ace/lib/lang", "ace/lib/dom", "ace/snippets", "ace/config", "ace/lib/event"], function(e, t2, n) {
      var r = e("./keyboard/hash_handler").HashHandler, i2 = e("./autocomplete/popup").AcePopup, s = e("./autocomplete/inline").AceInline, o = e("./autocomplete/popup").getAriaId, u = e("./autocomplete/util"), a = e("./lib/lang"), f = e("./lib/dom"), l = e("./snippets").snippetManager, c = e("./config"), h = e("./lib/event"), p = function(e2, t3) {
        t3.completer && t3.completer.destroy();
      }, d = function() {
        function e2() {
          this.autoInsert = false, this.autoSelect = true, this.autoShown = false, this.exactMatch = false, this.inlineEnabled = false, this.keyboardHandler = new r(), this.keyboardHandler.bindKeys(this.commands), this.parentNode = null, this.setSelectOnHover = false, this.showLoadingState = false, this.stickySelectionDelay = 500, this.blurListener = this.blurListener.bind(this), this.changeListener = this.changeListener.bind(this), this.mousedownListener = this.mousedownListener.bind(this), this.mousewheelListener = this.mousewheelListener.bind(this), this.onLayoutChange = this.onLayoutChange.bind(this), this.changeTimer = a.delayedCall(function() {
            this.updateCompletions(true);
          }.bind(this)), this.tooltipTimer = a.delayedCall(this.updateDocTooltip.bind(this), 50), this.stickySelectionTimer = a.delayedCall(function() {
            this.stickySelection = true;
          }.bind(this), this.stickySelectionDelay), this.$firstOpenTimer = a.delayedCall(function() {
            var t3 = this.completionProvider && this.completionProvider.initialPosition;
            if (this.autoShown || this.popup && this.popup.isOpen || !t3)
              return;
            this.completions = new m(e2.completionsForLoading), this.openPopup(this.editor, t3.prefix, false), this.popup.renderer.setStyle("ace_loading", true);
          }.bind(this), this.stickySelectionDelay);
        }
        return Object.defineProperty(e2, "completionsForLoading", { get: function() {
          return [{ caption: c.nls("Loading..."), value: "" }];
        }, enumerable: false, configurable: true }), e2.prototype.$init = function() {
          return this.popup = new i2(this.parentNode || document.body || document.documentElement), this.popup.on("click", function(e3) {
            this.insertMatch(), e3.stop();
          }.bind(this)), this.popup.focus = this.editor.focus.bind(this.editor), this.popup.on("show", this.$onPopupShow.bind(this)), this.popup.on("hide", this.$onHidePopup.bind(this)), this.popup.on("select", this.$onPopupChange.bind(this)), h.addListener(this.popup.container, "mouseout", this.mouseOutListener.bind(this)), this.popup.on("changeHoverMarker", this.tooltipTimer.bind(null, null)), this.popup;
        }, e2.prototype.$initInline = function() {
          if (!this.inlineEnabled || this.inlineRenderer)
            return;
          return this.inlineRenderer = new s(), this.inlineRenderer;
        }, e2.prototype.getPopup = function() {
          return this.popup || this.$init();
        }, e2.prototype.$onHidePopup = function() {
          this.inlineRenderer && this.inlineRenderer.hide(), this.hideDocTooltip(), this.stickySelectionTimer.cancel(), this.stickySelection = false;
        }, e2.prototype.$onPopupChange = function(e3) {
          if (this.inlineRenderer && this.inlineEnabled) {
            var t3 = e3 ? null : this.popup.getData(this.popup.getRow()), n2 = u.getCompletionPrefix(this.editor);
            this.inlineRenderer.show(this.editor, t3, n2) || this.inlineRenderer.hide();
            if (this.popup.isMouseOver && this.setSelectOnHover) {
              this.tooltipTimer.call(null, null);
              return;
            }
          }
          this.$updatePopupPosition(), this.tooltipTimer.call(null, null);
        }, e2.prototype.$onPopupShow = function(e3) {
          this.$onPopupChange(e3), this.stickySelection = false, this.stickySelectionDelay >= 0 && this.stickySelectionTimer.schedule(this.stickySelectionDelay);
        }, e2.prototype.observeLayoutChanges = function() {
          if (this.$elements || !this.editor)
            return;
          window.addEventListener("resize", this.onLayoutChange, { passive: true }), window.addEventListener("wheel", this.mousewheelListener);
          var e3 = this.editor.container.parentNode, t3 = [];
          while (e3)
            t3.push(e3), e3.addEventListener("scroll", this.onLayoutChange, { passive: true }), e3 = e3.parentNode;
          this.$elements = t3;
        }, e2.prototype.unObserveLayoutChanges = function() {
          var e3 = this;
          window.removeEventListener("resize", this.onLayoutChange, { passive: true }), window.removeEventListener("wheel", this.mousewheelListener), this.$elements && this.$elements.forEach(function(t3) {
            t3.removeEventListener("scroll", e3.onLayoutChange, { passive: true });
          }), this.$elements = null;
        }, e2.prototype.onLayoutChange = function() {
          if (!this.popup.isOpen)
            return this.unObserveLayoutChanges();
          this.$updatePopupPosition(), this.updateDocTooltip();
        }, e2.prototype.$updatePopupPosition = function() {
          var e3 = this.editor, t3 = e3.renderer, n2 = t3.layerConfig.lineHeight, r2 = t3.$cursorLayer.getPixelPosition(this.base, true);
          r2.left -= this.popup.getTextLeftOffset();
          var i3 = e3.container.getBoundingClientRect();
          r2.top += i3.top - t3.layerConfig.offset, r2.left += i3.left - e3.renderer.scrollLeft, r2.left += t3.gutterWidth;
          var s2 = { top: r2.top, left: r2.left };
          t3.$ghostText && t3.$ghostTextWidget && this.base.row === t3.$ghostText.position.row && (s2.top += t3.$ghostTextWidget.el.offsetHeight);
          if (this.popup.tryShow(s2, n2, "bottom"))
            return;
          if (this.popup.tryShow(r2, n2, "top"))
            return;
          this.popup.show(r2, n2);
        }, e2.prototype.openPopup = function(e3, t3, n2) {
          this.$firstOpenTimer.cancel(), this.popup || this.$init(), this.inlineEnabled && !this.inlineRenderer && this.$initInline(), this.popup.autoSelect = this.autoSelect, this.popup.setSelectOnHover(this.setSelectOnHover);
          var r2 = this.popup.getRow(), i3 = this.popup.data[r2];
          this.popup.setData(this.completions.filtered, this.completions.filterText), this.editor.textInput.setAriaOptions && this.editor.textInput.setAriaOptions({ activeDescendant: o(this.popup.getRow()), inline: this.inlineEnabled }), e3.keyBinding.addKeyboardHandler(this.keyboardHandler);
          var s2;
          this.stickySelection && (s2 = this.popup.data.indexOf(i3));
          if (!s2 || s2 === -1)
            s2 = 0;
          this.popup.setRow(this.autoSelect ? s2 : -1), s2 === r2 && i3 !== this.completions.filtered[s2] && this.$onPopupChange(), n2 ? n2 && !t3 && this.detach() : (this.popup.setTheme(e3.getTheme()), this.popup.setFontSize(e3.getFontSize()), this.$updatePopupPosition(), this.tooltipNode && this.updateDocTooltip()), this.changeTimer.cancel(), this.observeLayoutChanges();
        }, e2.prototype.detach = function() {
          this.editor && (this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler), this.editor.off("changeSelection", this.changeListener), this.editor.off("blur", this.blurListener), this.editor.off("mousedown", this.mousedownListener), this.editor.off("mousewheel", this.mousewheelListener)), this.$firstOpenTimer.cancel(), this.changeTimer.cancel(), this.hideDocTooltip(), this.completionProvider && this.completionProvider.detach(), this.popup && this.popup.isOpen && this.popup.hide(), this.base && this.base.detach(), this.activated = false, this.completionProvider = this.completions = this.base = null, this.unObserveLayoutChanges();
        }, e2.prototype.changeListener = function(e3) {
          var t3 = this.editor.selection.lead;
          (t3.row != this.base.row || t3.column < this.base.column) && this.detach(), this.activated ? this.changeTimer.schedule() : this.detach();
        }, e2.prototype.blurListener = function(e3) {
          var t3 = document.activeElement, n2 = this.editor.textInput.getElement(), r2 = e3.relatedTarget && this.tooltipNode && this.tooltipNode.contains(e3.relatedTarget), i3 = this.popup && this.popup.container;
          t3 != n2 && t3.parentNode != i3 && !r2 && t3 != this.tooltipNode && e3.relatedTarget != n2 && this.detach();
        }, e2.prototype.mousedownListener = function(e3) {
          this.detach();
        }, e2.prototype.mousewheelListener = function(e3) {
          this.popup.isMouseOver || this.detach();
        }, e2.prototype.mouseOutListener = function(e3) {
          this.popup.isOpen && this.$updatePopupPosition();
        }, e2.prototype.goTo = function(e3) {
          this.popup.goTo(e3);
        }, e2.prototype.insertMatch = function(e3, t3) {
          e3 || (e3 = this.popup.getData(this.popup.getRow()));
          if (!e3)
            return false;
          if (e3.value === "")
            return this.detach();
          var n2 = this.completions, r2 = this.getCompletionProvider().insertMatch(this.editor, e3, n2.filterText, t3);
          return this.completions == n2 && this.detach(), r2;
        }, e2.prototype.showPopup = function(e3, t3) {
          this.editor && this.detach(), this.activated = true, this.editor = e3, e3.completer != this && (e3.completer && e3.completer.detach(), e3.completer = this), e3.on("changeSelection", this.changeListener), e3.on("blur", this.blurListener), e3.on("mousedown", this.mousedownListener), e3.on("mousewheel", this.mousewheelListener), this.updateCompletions(false, t3);
        }, e2.prototype.getCompletionProvider = function(e3) {
          return this.completionProvider || (this.completionProvider = new v(e3)), this.completionProvider;
        }, e2.prototype.gatherCompletions = function(e3, t3) {
          return this.getCompletionProvider().gatherCompletions(e3, t3);
        }, e2.prototype.updateCompletions = function(t3, n2) {
          if (t3 && this.base && this.completions) {
            var r2 = this.editor.getCursorPosition(), i3 = this.editor.session.getTextRange({ start: this.base, end: r2 });
            if (i3 == this.completions.filterText)
              return;
            this.completions.setFilter(i3);
            if (!this.completions.filtered.length)
              return this.detach();
            if (this.completions.filtered.length == 1 && this.completions.filtered[0].value == i3 && !this.completions.filtered[0].snippet)
              return this.detach();
            this.openPopup(this.editor, i3, t3);
            return;
          }
          if (n2 && n2.matches) {
            var r2 = this.editor.getSelectionRange().start;
            return this.base = this.editor.session.doc.createAnchor(r2.row, r2.column), this.base.$insertRight = true, this.completions = new m(n2.matches), this.openPopup(this.editor, "", t3);
          }
          var s2 = this.editor.getSession(), r2 = this.editor.getCursorPosition(), i3 = u.getCompletionPrefix(this.editor);
          this.base = s2.doc.createAnchor(r2.row, r2.column - i3.length), this.base.$insertRight = true;
          var o2 = { exactMatch: this.exactMatch, ignoreCaption: this.ignoreCaption };
          this.getCompletionProvider({ prefix: i3, pos: r2 }).provideCompletions(this.editor, o2, function(n3, r3, i4) {
            var s3 = r3.filtered, o3 = u.getCompletionPrefix(this.editor);
            this.$firstOpenTimer.cancel();
            if (i4) {
              if (!s3.length) {
                var a2 = !this.autoShown && this.emptyMessage;
                typeof a2 == "function" && (a2 = this.emptyMessage(o3));
                if (a2) {
                  var f2 = [{ caption: a2, value: "" }];
                  this.completions = new m(f2), this.openPopup(this.editor, o3, t3), this.popup.renderer.setStyle("ace_loading", false);
                  return;
                }
                return this.detach();
              }
              if (s3.length == 1 && s3[0].value == o3 && !s3[0].snippet)
                return this.detach();
              if (this.autoInsert && !this.autoShown && s3.length == 1)
                return this.insertMatch(s3[0]);
            }
            this.completions = !i4 && this.showLoadingState ? new m(e2.completionsForLoading.concat(s3), r3.filterText) : r3, this.openPopup(this.editor, o3, t3), this.popup.renderer.setStyle("ace_loading", !i4);
          }.bind(this)), this.showLoadingState && !this.autoShown && (!this.popup || !this.popup.isOpen) && this.$firstOpenTimer.delay(this.stickySelectionDelay / 2);
        }, e2.prototype.cancelContextMenu = function() {
          this.editor.$mouseHandler.cancelContextMenu();
        }, e2.prototype.updateDocTooltip = function() {
          var e3 = this.popup, t3 = this.completions.filtered, n2 = t3 && (t3[e3.getHoveredRow()] || t3[e3.getRow()]), r2 = null;
          if (!n2 || !this.editor || !this.popup.isOpen)
            return this.hideDocTooltip();
          var i3 = this.editor.completers.length;
          for (var s2 = 0; s2 < i3; s2++) {
            var o2 = this.editor.completers[s2];
            if (o2.getDocTooltip && n2.completerId === o2.id) {
              r2 = o2.getDocTooltip(n2);
              break;
            }
          }
          !r2 && typeof n2 != "string" && (r2 = n2), typeof r2 == "string" && (r2 = { docText: r2 });
          if (!r2 || !r2.docHTML && !r2.docText)
            return this.hideDocTooltip();
          this.showDocTooltip(r2);
        }, e2.prototype.showDocTooltip = function(e3) {
          this.tooltipNode || (this.tooltipNode = f.createElement("div"), this.tooltipNode.style.margin = 0, this.tooltipNode.style.pointerEvents = "auto", this.tooltipNode.tabIndex = -1, this.tooltipNode.onblur = this.blurListener.bind(this), this.tooltipNode.onclick = this.onTooltipClick.bind(this), this.tooltipNode.id = "doc-tooltip", this.tooltipNode.setAttribute("role", "tooltip"));
          var t3 = this.editor.renderer.theme;
          this.tooltipNode.className = "ace_tooltip ace_doc-tooltip " + (t3.isDark ? "ace_dark " : "") + (t3.cssClass || "");
          var n2 = this.tooltipNode;
          e3.docHTML ? n2.innerHTML = e3.docHTML : e3.docText && (n2.textContent = e3.docText), n2.parentNode || this.popup.container.appendChild(this.tooltipNode);
          var r2 = this.popup, i3 = r2.container.getBoundingClientRect();
          n2.style.top = r2.container.style.top, n2.style.bottom = r2.container.style.bottom, n2.style.display = "block", window.innerWidth - i3.right < 320 ? i3.left < 320 ? r2.isTopdown ? (n2.style.top = i3.bottom + "px", n2.style.left = i3.left + "px", n2.style.right = "", n2.style.bottom = "") : (n2.style.top = r2.container.offsetTop - n2.offsetHeight + "px", n2.style.left = i3.left + "px", n2.style.right = "", n2.style.bottom = "") : (n2.style.right = window.innerWidth - i3.left + "px", n2.style.left = "") : (n2.style.left = i3.right + 1 + "px", n2.style.right = "");
        }, e2.prototype.hideDocTooltip = function() {
          this.tooltipTimer.cancel();
          if (!this.tooltipNode)
            return;
          var e3 = this.tooltipNode;
          !this.editor.isFocused() && document.activeElement == e3 && this.editor.focus(), this.tooltipNode = null, e3.parentNode && e3.parentNode.removeChild(e3);
        }, e2.prototype.onTooltipClick = function(e3) {
          var t3 = e3.target;
          while (t3 && t3 != this.tooltipNode) {
            if (t3.nodeName == "A" && t3.href) {
              t3.rel = "noreferrer", t3.target = "_blank";
              break;
            }
            t3 = t3.parentNode;
          }
        }, e2.prototype.destroy = function() {
          this.detach();
          if (this.popup) {
            this.popup.destroy();
            var e3 = this.popup.container;
            e3 && e3.parentNode && e3.parentNode.removeChild(e3);
          }
          this.editor && this.editor.completer == this && (this.editor.off("destroy", p), this.editor.completer = null), this.inlineRenderer = this.popup = this.editor = null;
        }, e2;
      }();
      d.prototype.commands = { Up: function(e2) {
        e2.completer.goTo("up");
      }, Down: function(e2) {
        e2.completer.goTo("down");
      }, "Ctrl-Up|Ctrl-Home": function(e2) {
        e2.completer.goTo("start");
      }, "Ctrl-Down|Ctrl-End": function(e2) {
        e2.completer.goTo("end");
      }, Esc: function(e2) {
        e2.completer.detach();
      }, Return: function(e2) {
        return e2.completer.insertMatch();
      }, "Shift-Return": function(e2) {
        e2.completer.insertMatch(null, { deleteSuffix: true });
      }, Tab: function(e2) {
        var t3 = e2.completer.insertMatch();
        if (!!t3 || !!e2.tabstopManager)
          return t3;
        e2.completer.goTo("down");
      }, PageUp: function(e2) {
        e2.completer.popup.gotoPageUp();
      }, PageDown: function(e2) {
        e2.completer.popup.gotoPageDown();
      } }, d.for = function(e2) {
        return e2.completer instanceof d ? e2.completer : (e2.completer && (e2.completer.destroy(), e2.completer = null), c.get("sharedPopups") ? (d.$sharedInstance || (d.$sharedInstance = new d()), e2.completer = d.$sharedInstance) : (e2.completer = new d(), e2.once("destroy", p)), e2.completer);
      }, d.startCommand = { name: "startAutocomplete", exec: function(e2, t3) {
        var n2 = d.for(e2);
        n2.autoInsert = false, n2.autoSelect = true, n2.autoShown = false, n2.showPopup(e2, t3), n2.cancelContextMenu();
      }, bindKey: "Ctrl-Space|Ctrl-Shift-Space|Alt-Space" };
      var v = function() {
        function e2(e3) {
          this.initialPosition = e3, this.active = true;
        }
        return e2.prototype.insertByIndex = function(e3, t3, n2) {
          return !this.completions || !this.completions.filtered ? false : this.insertMatch(e3, this.completions.filtered[t3], n2);
        }, e2.prototype.insertMatch = function(e3, t3, n2) {
          if (!t3)
            return false;
          e3.startOperation({ command: { name: "insertMatch" } });
          if (t3.completer && t3.completer.insertMatch)
            t3.completer.insertMatch(e3, t3);
          else {
            if (!this.completions)
              return false;
            var r2 = this.completions.filterText.length, i3 = 0;
            t3.range && t3.range.start.row === t3.range.end.row && (r2 -= this.initialPosition.prefix.length, r2 += this.initialPosition.pos.column - t3.range.start.column, i3 += t3.range.end.column - this.initialPosition.pos.column);
            if (r2 || i3) {
              var s2;
              e3.selection.getAllRanges ? s2 = e3.selection.getAllRanges() : s2 = [e3.getSelectionRange()];
              for (var o2 = 0, u2; u2 = s2[o2]; o2++)
                u2.start.column -= r2, u2.end.column += i3, e3.session.remove(u2);
            }
            t3.snippet ? l.insertSnippet(e3, t3.snippet) : this.$insertString(e3, t3), t3.command && t3.command === "startAutocomplete" && e3.execCommand(t3.command);
          }
          return e3.endOperation(), true;
        }, e2.prototype.$insertString = function(e3, t3) {
          var n2 = t3.value || t3;
          e3.execCommand("insertstring", n2);
        }, e2.prototype.gatherCompletions = function(e3, t3) {
          var n2 = e3.getSession(), r2 = e3.getCursorPosition(), i3 = u.getCompletionPrefix(e3), s2 = [];
          this.completers = e3.completers;
          var o2 = e3.completers.length;
          return e3.completers.forEach(function(a2, f2) {
            a2.getCompletions(e3, n2, r2, i3, function(n3, r3) {
              a2.hideInlinePreview && (r3 = r3.map(function(e4) {
                return Object.assign(e4, { hideInlinePreview: a2.hideInlinePreview });
              })), !n3 && r3 && (s2 = s2.concat(r3)), t3(null, { prefix: u.getCompletionPrefix(e3), matches: s2, finished: --o2 === 0 });
            });
          }), true;
        }, e2.prototype.provideCompletions = function(e3, t3, n2) {
          var r2 = function(e4) {
            var r3 = e4.prefix, i4 = e4.matches;
            this.completions = new m(i4), t3.exactMatch && (this.completions.exactMatch = true), t3.ignoreCaption && (this.completions.ignoreCaption = true), this.completions.setFilter(r3), (e4.finished || this.completions.filtered.length) && n2(null, this.completions, e4.finished);
          }.bind(this), i3 = true, s2 = null;
          this.gatherCompletions(e3, function(e4, t4) {
            if (!this.active)
              return;
            e4 && (n2(e4, [], true), this.detach());
            var o3 = t4.prefix;
            if (o3.indexOf(t4.prefix) !== 0)
              return;
            if (i3) {
              s2 = t4;
              return;
            }
            r2(t4);
          }.bind(this)), i3 = false;
          if (s2) {
            var o2 = s2;
            s2 = null, r2(o2);
          }
        }, e2.prototype.detach = function() {
          this.active = false, this.completers && this.completers.forEach(function(e3) {
            typeof e3.cancel == "function" && e3.cancel();
          });
        }, e2;
      }(), m = function() {
        function e2(e3, t3) {
          this.all = e3, this.filtered = e3, this.filterText = t3 || "", this.exactMatch = false, this.ignoreCaption = false;
        }
        return e2.prototype.setFilter = function(e3) {
          if (e3.length > this.filterText && e3.lastIndexOf(this.filterText, 0) === 0)
            var t3 = this.filtered;
          else
            var t3 = this.all;
          this.filterText = e3, t3 = this.filterCompletions(t3, this.filterText), t3 = t3.sort(function(e4, t4) {
            return t4.exactMatch - e4.exactMatch || t4.$score - e4.$score || (e4.caption || e4.value).localeCompare(t4.caption || t4.value);
          });
          var n2 = null;
          t3 = t3.filter(function(e4) {
            var t4 = e4.snippet || e4.caption || e4.value;
            return t4 === n2 ? false : (n2 = t4, true);
          }), this.filtered = t3;
        }, e2.prototype.filterCompletions = function(e3, t3) {
          var n2 = [], r2 = t3.toUpperCase(), i3 = t3.toLowerCase();
          e:
            for (var s2 = 0, o2; o2 = e3[s2]; s2++) {
              var u2 = !this.ignoreCaption && o2.caption || o2.value || o2.snippet;
              if (!u2)
                continue;
              var a2 = -1, f2 = 0, l2 = 0, c2, h2;
              if (this.exactMatch) {
                if (t3 !== u2.substr(0, t3.length))
                  continue e;
              } else {
                var p2 = u2.toLowerCase().indexOf(i3);
                if (p2 > -1)
                  l2 = p2;
                else
                  for (var d2 = 0; d2 < t3.length; d2++) {
                    var v2 = u2.indexOf(i3[d2], a2 + 1), m2 = u2.indexOf(r2[d2], a2 + 1);
                    c2 = v2 >= 0 ? m2 < 0 || v2 < m2 ? v2 : m2 : m2;
                    if (c2 < 0)
                      continue e;
                    h2 = c2 - a2 - 1, h2 > 0 && (a2 === -1 && (l2 += 10), l2 += h2, f2 |= 1 << d2), a2 = c2;
                  }
              }
              o2.matchMask = f2, o2.exactMatch = l2 ? 0 : 1, o2.$score = (o2.score || 0) - l2, n2.push(o2);
            }
          return n2;
        }, e2;
      }();
      t2.Autocomplete = d, t2.CompletionProvider = v, t2.FilteredList = m;
    }), ace.define("ace/autocomplete/text_completer", ["require", "exports", "module", "ace/range"], function(e, t2, n) {
      function s(e2, t3) {
        var n2 = e2.getTextRange(r.fromPoints({ row: 0, column: 0 }, t3));
        return n2.split(i2).length - 1;
      }
      function o(e2, t3) {
        var n2 = s(e2, t3), r2 = e2.getValue().split(i2), o2 = Object.create(null), u = r2[n2];
        return r2.forEach(function(e3, t4) {
          if (!e3 || e3 === u)
            return;
          var i3 = Math.abs(n2 - t4), s2 = r2.length - i3;
          o2[e3] ? o2[e3] = Math.max(s2, o2[e3]) : o2[e3] = s2;
        }), o2;
      }
      var r = e("../range").Range, i2 = /[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;
      t2.getCompletions = function(e2, t3, n2, r2, i3) {
        var s2 = o(t3, n2), u = Object.keys(s2);
        i3(null, u.map(function(e3) {
          return { caption: e3, value: e3, score: s2[e3], meta: "local" };
        }));
      };
    }), ace.define("ace/ext/language_tools", ["require", "exports", "module", "ace/snippets", "ace/autocomplete", "ace/config", "ace/lib/lang", "ace/autocomplete/util", "ace/autocomplete/text_completer", "ace/editor", "ace/config"], function(e, t2, n) {
      var r = e("../snippets").snippetManager, i2 = e("../autocomplete").Autocomplete, s = e("../config"), o = e("../lib/lang"), u = e("../autocomplete/util"), a = e("../autocomplete/text_completer"), f = { getCompletions: function(e2, t3, n2, r2, i3) {
        if (t3.$mode.completer)
          return t3.$mode.completer.getCompletions(e2, t3, n2, r2, i3);
        var s2 = e2.session.getState(n2.row), o2 = t3.$mode.getCompletions(s2, t3, n2, r2);
        o2 = o2.map(function(e3) {
          return e3.completerId = f.id, e3;
        }), i3(null, o2);
      }, id: "keywordCompleter" }, l = function(e2) {
        var t3 = {};
        return e2.replace(/\${(\d+)(:(.*?))?}/g, function(e3, n2, r2, i3) {
          return t3[n2] = i3 || "";
        }).replace(/\$(\d+?)/g, function(e3, n2) {
          return t3[n2];
        });
      }, c = { getCompletions: function(e2, t3, n2, i3, s2) {
        var o2 = [], u2 = t3.getTokenAt(n2.row, n2.column);
        u2 && u2.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/) ? o2.push("html-tag") : o2 = r.getActiveScopes(e2);
        var a2 = r.snippetMap, f2 = [];
        o2.forEach(function(e3) {
          var t4 = a2[e3] || [];
          for (var n3 = t4.length; n3--; ) {
            var r2 = t4[n3], i4 = r2.name || r2.tabTrigger;
            if (!i4)
              continue;
            f2.push({ caption: i4, snippet: r2.content, meta: r2.tabTrigger && !r2.name ? r2.tabTrigger + "\u21E5 " : "snippet", completerId: c.id });
          }
        }, this), s2(null, f2);
      }, getDocTooltip: function(e2) {
        e2.snippet && !e2.docHTML && (e2.docHTML = ["<b>", o.escapeHTML(e2.caption), "</b>", "<hr></hr>", o.escapeHTML(l(e2.snippet))].join(""));
      }, id: "snippetCompleter" }, h = [c, a, f];
      t2.setCompleters = function(e2) {
        h.length = 0, e2 && h.push.apply(h, e2);
      }, t2.addCompleter = function(e2) {
        h.push(e2);
      }, t2.textCompleter = a, t2.keyWordCompleter = f, t2.snippetCompleter = c;
      var p = { name: "expandSnippet", exec: function(e2) {
        return r.expandWithTab(e2);
      }, bindKey: "Tab" }, d = function(e2, t3) {
        v(t3.session.$mode);
      }, v = function(e2) {
        typeof e2 == "string" && (e2 = s.$modes[e2]);
        if (!e2)
          return;
        r.files || (r.files = {}), m(e2.$id, e2.snippetFileId), e2.modes && e2.modes.forEach(v);
      }, m = function(e2, t3) {
        if (!t3 || !e2 || r.files[e2])
          return;
        r.files[e2] = {}, s.loadModule(t3, function(t4) {
          if (!t4)
            return;
          r.files[e2] = t4, !t4.snippets && t4.snippetText && (t4.snippets = r.parseSnippetFile(t4.snippetText)), r.register(t4.snippets || [], t4.scope), t4.includeScopes && (r.snippetMap[t4.scope].includeScopes = t4.includeScopes, t4.includeScopes.forEach(function(e3) {
            v("ace/mode/" + e3);
          }));
        });
      }, g = function(e2) {
        var t3 = e2.editor, n2 = t3.completer && t3.completer.activated;
        if (e2.command.name === "backspace")
          n2 && !u.getCompletionPrefix(t3) && t3.completer.detach();
        else if (e2.command.name === "insertstring" && !n2) {
          y = e2;
          var r2 = e2.editor.$liveAutocompletionDelay;
          r2 ? b.delay(r2) : w(e2);
        }
      }, y, b = o.delayedCall(function() {
        w(y);
      }, 0), w = function(e2) {
        var t3 = e2.editor, n2 = u.getCompletionPrefix(t3), r2 = u.triggerAutocomplete(t3);
        if (n2 && n2.length >= t3.$liveAutocompletionThreshold || r2) {
          var s2 = i2.for(t3);
          s2.autoShown = true, s2.showPopup(t3);
        }
      }, E = e("../editor").Editor;
      e("../config").defineOptions(E.prototype, "editor", { enableBasicAutocompletion: { set: function(e2) {
        e2 ? (this.completers || (this.completers = Array.isArray(e2) ? e2 : h), this.commands.addCommand(i2.startCommand)) : this.commands.removeCommand(i2.startCommand);
      }, value: false }, enableLiveAutocompletion: { set: function(e2) {
        e2 ? (this.completers || (this.completers = Array.isArray(e2) ? e2 : h), this.commands.on("afterExec", g)) : this.commands.off("afterExec", g);
      }, value: false }, liveAutocompletionDelay: { initialValue: 0 }, liveAutocompletionThreshold: { initialValue: 0 }, enableSnippets: { set: function(e2) {
        e2 ? (this.commands.addCommand(p), this.on("changeMode", d), d(null, this)) : (this.commands.removeCommand(p), this.off("changeMode", d));
      }, value: false } });
    });
    (function() {
      ace.require(["ace/ext/language_tools"], function(m) {
        if (module2) {
          module2.exports = m;
        }
      });
    })();
  })(extLanguage_tools);
  const VARIANT_FORM_VERSION = "3.3.0";
  const MOCK_CASE_URL = "https://ks3-cn-beijing.ksyuncs.com/vform-static/vcase/";
  const ACE_BASE_PATH = "https://ks3-cn-beijing.ksyun.com/vform2021/ace-mini";
  const BEAUTIFIER_PATH = "https://ks3-cn-beijing.ksyun.com/vform2021/js-beautify/1.14.0/beautifier.min.js";
  var index_vue_vue_type_style_index_0_scoped_true_lang$5 = "";
  const _sfc_main$3M = {
    name: "CodeEditor",
    props: {
      modelValue: {
        type: String
      },
      readonly: {
        type: Boolean,
        default: false
      },
      mode: {
        type: String,
        default: "javascript"
      },
      userWorker: {
        type: Boolean,
        default: true
      }
    },
    emits: ["update:modelValue"],
    mounted() {
      ace$1.config.set("basePath", ACE_BASE_PATH);
      this.addAutoCompletion(ace$1);
      this.aceEditor = ace$1.edit(this.$refs.ace, {
        maxLines: 20,
        minLines: 5,
        fontSize: 12,
        theme: this.themePath,
        mode: this.modePath,
        tabSize: 2,
        readOnly: this.readonly,
        highlightActiveLine: true,
        value: this.codeValue
      });
      this.aceEditor.setOptions({
        enableBasicAutocompletion: true,
        enableSnippets: true,
        enableLiveAutocompletion: true
      });
      if (this.mode === "json") {
        this.setJsonMode();
      } else if (this.mode === "css") {
        this.setCssMode();
      }
      if (!this.userWorker) {
        this.aceEditor.getSession().setUseWorker(false);
      }
      this.aceEditor.getSession().on("change", (ev) => {
        this.$emit("update:modelValue", this.aceEditor.getValue());
      });
    },
    data() {
      return {
        aceEditor: null,
        themePath: "ace/theme/sqlserver",
        modePath: "ace/mode/javascript",
        codeValue: this.modelValue
      };
    },
    watch: {},
    methods: {
      addAutoCompletion(ace2) {
        let acData = [
          { meta: "VForm API", caption: "getWidgetRef", value: "getWidgetRef()", score: 1 },
          { meta: "VForm API", caption: "getFormRef", value: "getFormRef()", score: 1 },
          { meta: "VForm API", caption: "getParentFormRef", value: "getParentFormRef()", score: 1 }
        ];
        let langTools = ace2.require("ace/ext/language_tools");
        langTools.addCompleter({
          getCompletions: function(editor, session, pos, prefix, callback) {
            if (prefix.length === 0) {
              return callback(null, []);
            } else {
              return callback(null, acData);
            }
          }
        });
      },
      setJsonMode() {
        this.aceEditor.getSession().setMode("ace/mode/json");
      },
      setCssMode() {
        this.aceEditor.getSession().setMode("ace/mode/css");
      },
      getEditorAnnotations() {
        return this.aceEditor.getSession().getAnnotations();
      },
      setValue(newValue) {
        this.aceEditor.getSession().setValue(newValue);
      }
    }
  };
  const _hoisted_1$v = { class: "ace-container" };
  const _hoisted_2$h = {
    class: "ace-editor",
    ref: "ace"
  };
  function _sfc_render$3M(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$v, [
      require$$0$1.createElementVNode("div", _hoisted_2$h, null, 512)
    ]);
  }
  var CodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3M, [["render", _sfc_render$3M], ["__scopeId", "data-v-d179e75c"]]);
  const generateCode = function(formJson, codeType = "vue") {
    let formJsonStr = JSON.stringify(formJson);
    if (codeType === "html") {
      return `<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
	<title>VForm Demo</title>
	<link rel="stylesheet" href="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-plus/2.0.4/index.min.css" />
	<link rel="stylesheet" href="https://ks3-cn-beijing.ksyun.com/vform3/render.style.css?t=20220129">
	<style type="text/css">
	</style>
</head>
<body>

  <div id="app">
	  <v-form-render :form-json="formJson" :form-data="formData" :option-data="optionData" ref="vFormRef">
    </v-form-render>
	  <el-button type="primary" @click="submitForm">Submit</el-button>
  </div>

<script src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/3.2.30/vue.global.min.js"><\/script>
<script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/element-plus/2.0.4/index.full.min.js"><\/script>
<script src="https://ks3-cn-beijing.ksyun.com/vform3/render.umd.js?t=20220129"><\/script>
<script>
  const { createApp } = Vue;
	const app = createApp({
      data() {
        return {
          formJson: ${formJsonStr},
          formData: {},
          optionData: {}
        }
      },
      methods: {
        submitForm() {
          this.$refs.vFormRef.getFormData().then( (formData) => {
            // Form Validation OK
            alert( JSON.stringify(formData) )
          }).catch( function(error) {
            // Form Validation Failed
            alert(error)
          })
        }
      }
	});
	app.use(ElementPlus)
	app.use(VFormRender)
	app.mount("#app");
<\/script>
</body>
</html>`;
    } else {
      return `<template>
  <div>
    <v-form-render :form-json="formJson" :form-data="formData" :option-data="optionData" ref="vFormRef">
    </v-form-render>
    <el-button type="primary" @click="submitForm">Submit</el-button>
  </div>
</template>

<script setup>
  import { ref, reactive } from 'vue'
  import { ElMessage } from 'element-plus'

  const formJson = reactive(${formJsonStr})
  const formData = reactive({})
  const optionData = reactive({})
  const vFormRef = ref(null)

  const submitForm = () => {
    vFormRef.value.getFormData().then(formData => {
      // Form Validation OK
      alert( JSON.stringify(formData) )
    }).catch(error => {
      // Form Validation failed
      ElMessage.error(error)
    })
  }
<\/script>`;
    }
  };
  function emptyAttr(attrName, attrValue) {
    if (attrValue)
      return `${attrName}="${attrValue}"`;
    else
      return "";
  }
  function sfcTraverseSubformWidgets(widgetList2, handler) {
    widgetList2.forEach((w) => {
      handler(w);
    });
  }
  function sfcTraverseFieldWidgets(widgetList2, handler, parent = null) {
    widgetList2.forEach((w) => {
      if (w.formItemFlag) {
        handler(w, parent);
      } else if (w.type === "grid") {
        w.cols.forEach((col) => {
          sfcTraverseFieldWidgets(col.widgetList, handler, w);
        });
      } else if (w.type === "table") {
        w.rows.forEach((row) => {
          row.cols.forEach((cell) => {
            sfcTraverseFieldWidgets(cell.widgetList, handler, w);
          });
        });
      } else if (w.type === "tab") {
        w.tabs.forEach((tab) => {
          sfcTraverseFieldWidgets(tab.widgetList, handler, w);
        });
      } else if (w.type === "sub-form" || w.type === "grid-sub-form") {
        handler(w, parent);
      } else if (w.type === "data-table") {
        handler(w, parent);
      } else if (w.category === "container") {
        sfcTraverseFieldWidgets(w.widgetList, handler, w);
      }
    });
  }
  function sfcTraverseContainerWidgets(widgetList2, handler) {
    widgetList2.forEach((w) => {
      if (w.category === "container") {
        handler(w);
      }
      if (w.type === "grid") {
        w.cols.forEach((col) => {
          sfcTraverseContainerWidgets(col.widgetList, handler);
        });
      } else if (w.type === "table") {
        w.rows.forEach((row) => {
          row.cols.forEach((cell) => {
            sfcTraverseContainerWidgets(cell.widgetList, handler);
          });
        });
      } else if (w.type === "tab") {
        w.tabs.forEach((tab) => {
          sfcTraverseContainerWidgets(tab.widgetList, handler);
        });
      } else if (w.type === "sub-form" || w.type === "grid-sub-form") {
        traverseAllWidgets(w.widgetList, handler);
      } else if (w.category === "container") {
        sfcTraverseContainerWidgets(w.widgetList, handler);
      }
    });
  }
  function buildDefaultValueListFn(formConfig2, widgetList2, resultList2) {
    return function(fieldWidget2) {
      const fop2 = fieldWidget2.options;
      const fd = fop2.defaultValue;
      if (fieldWidget2.type === "sub-form" || fieldWidget2.type === "grid-sub-form") {
        let resultSubList = {};
        sfcTraverseSubformWidgets(fieldWidget2.widgetList, (result) => {
          resultSubList[result.options.name] = result.options.defaultValue;
        });
        resultList2.push(`${fop2.name}: [${JSON.stringify(resultSubList)}],`);
      } else if (fieldWidget2.type === "data-table") {
        let tableData = {
          tableData: fop2.tableData,
          tableColumns: fop2.tableColumns
        };
        resultList2.push(`${fop2.name}: ${JSON.stringify(tableData)},`);
      } else {
        if (isNotNull(fd)) {
          resultList2.push(`${fop2.name}: ${JSON.stringify(fd)},`);
        } else {
          resultList2.push(`${fop2.name}: null,`);
        }
      }
    };
  }
  function buildRulesListFn(formConfig, widgetList, resultList) {
    return function(fieldWidget) {
      const fop = fieldWidget.options;
      let fieldRules = [];
      if (fieldWidget.type !== "sub-form" && fieldWidget.type !== "grid-sub-form") {
        if (!!fop.required) {
          fieldRules.push(`{
          required: true,
          message: '${translate("render.hint.fieldRequired")}',
        }`);
        }
        if (!!fop.validation) {
          let vldName = fop.validation;
          if (!!FormValidators[vldName]) {
            fieldRules.push(`{
            pattern: ${eval(getRegExp(vldName))},
            trigger: ['blur', 'change'],
            message: '${fop.validationHint}'
          }`);
          } else {
            fieldRules.push(`{
            pattern: '${eval(vldName)}',
            trigger: ['blur', 'change'],
            message: '${fop.validationHint}'
          }`);
          }
        }
        fieldRules.length > 0 && resultList.push(`${fop.name}: [${fieldRules.join(",")}],`);
      } else {
        let resultSubList = [];
        fieldWidget.widgetList.forEach((subWidget) => {
          buildRulesListFn(formConfig, fieldWidget.widgetList, resultSubList)(subWidget);
        });
        resultList.push(resultSubList);
      }
    };
  }
  function buildFieldOptionsFn(formConfig2, widgetList2, resultList2) {
    return function(fieldWidget2) {
      const fop2 = fieldWidget2.options;
      const ft = fieldWidget2.type;
      if (ft === "radio" || ft === "checkbox" || ft === "select" || ft === "cascader") {
        resultList2.push(`${fop2.name}Options: ${JSON.stringify(fop2.optionItems)},`);
      } else if (ft === "sub-form" || ft === "grid-sub-form") {
        let resultSubList = [];
        fieldWidget2.widgetList.forEach((subWidget) => {
          buildFieldOptionsFn(formConfig2, fop2.widgetList, resultSubList)(subWidget);
        });
        resultList2.push(...resultSubList);
      } else if (ft === "grid") {
        let resultSubList = [];
        fieldWidget2.cols.forEach((col) => {
          col.widgetList.forEach((subWidget) => {
            buildFieldOptionsFn(formConfig2, fop2.widgetList, resultSubList)(subWidget);
          });
        });
        resultList2.push(...resultSubList);
      }
    };
  }
  function buildUploadDataFn(formConfig2, widgetList2, resultList2) {
    return function(fieldWidget2) {
      const fop2 = fieldWidget2.options;
      const ft = fieldWidget2.type;
      if (ft === "picture-upload" || ft === "file-upload") {
        resultList2.push(`${fop2.name}FileList: [],`);
        resultList2.push(`${fop2.name}UploadHeaders: {},`);
        resultList2.push(`${fop2.name}UploadData: {},`);
      }
    };
  }
  function buildActiveTabs(formConfig2, widgetList2) {
    let resultList2 = [];
    const handlerFn = function(cw) {
      const cop = cw.options;
      const ct = cw.type;
      if (ct === "tab") {
        cw.tabs.length > 0 && resultList2.push(`'${cop.name}ActiveTab': '${cw.tabs[0].options.name}',`);
      }
    };
    sfcTraverseContainerWidgets(widgetList2, handlerFn);
    return resultList2;
  }
  function buildSubFormMethods$1(widgetList2) {
    let template = ``;
    let widget = widgetList2.find((x) => x.type === "sub-form" || x.type === "grid-sub-form");
    if (widget) {
      template = `
   addSubFormRow(widgetId){
    this.formData[widgetId].push({})
   },
   insertSubFormRow(widgetId,sfrIdx){
    this.formData[widgetId].splice(sfrIdx,0,{})
   },
   deleteSubFormRow(widgetId,sfrIdx){
    this.formData[widgetId].splice(sfrIdx,1)
   },
   `;
    }
    return template;
  }
  function buildDataTableMethods$1(widgetList2) {
    let template = ``;
    let widget = widgetList2.find((x) => x.type === "data-table");
    if (widget) {
      template = `
    formatterValue(row, column, cellValue) {
      if (!cellValue) {
        return ''
      }

      let date=cellValue;      
      let v=cellValue;
      let y,m,d,res,length

      if(!!column.formatS) {
        switch(column.formatS) {
          case 'd1':
              if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
                return date;
              }
              date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
              y = date.getFullYear();
              m = date.getMonth() + 1;
              m = m < 10 ? '0' + m : m;
              d = date.getDate();
              d = d < 10 ? ('0' + d) : d;
              return y + '-' + m + '-' + d;
          case 'd2':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            y = date.getFullYear();
            m = date.getMonth() + 1;
            m = m < 10 ? '0' + m : m;
            d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            return y + '/' + m + '/' + d;
          case 'd3':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            y = date.getFullYear();
            m = date.getMonth() + 1;
            m = m < 10 ? '0' + m : m;
            d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            return y + '\u5E74' + m + '\u6708' + d +'\u65E5';
          case 'd4':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date"){
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            return date.toLocaleString()
          case 'd5':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Data();
            return date.toLocaleString('chinese', { hour12: false })
          case 'n1':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            switch(length){
              case 0:
                  v = v.toFixed(0)
                  break;
              case 1:
                  v = v.toFixed(1)
                  break;
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              case 4:
                  v = v.toFixed(4)
                  break;
              case 5:
                  v = v.toFixed(5)
                  break;
              default:
                  v = v.toFixed(6)
            }
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n2':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            switch(length){
              case 0:
              case 1:
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              case 4:
                  v = v.toFixed(4)
                  break;
              case 5:
                  v = v.toFixed(5)
                  break;
              default:
                  v = v.toFixed(6)
            }
          
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n3':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(6)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n4':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(3)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n5':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(2)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n6':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(0)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n7':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            v = v*100
            switch(length){
              case 0:
              case 1:
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              default:
                  v = v.toFixed(4)
            }
          
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res+'%';
        }
      }
      return cellValue;
    },
   `;
    }
    return template;
  }
  const genVue2JS = function(formConfig2, widgetList2) {
    let defaultValueList = [];
    let rulesList = [];
    let fieldOptions = [];
    let uploadData = [];
    sfcTraverseFieldWidgets(widgetList2, (widget) => {
      buildDefaultValueListFn(formConfig2, widgetList2, defaultValueList)(widget);
      buildRulesListFn(formConfig2, widgetList2, rulesList)(widget);
      buildFieldOptionsFn(formConfig2, widgetList2, fieldOptions)(widget);
      buildUploadDataFn(formConfig2, widgetList2, uploadData)(widget);
    });
    const activeTabs = buildActiveTabs(formConfig2, widgetList2);
    const v2JSTemplate = `  export default {
    components: {},
    props: {},
    data() {
      return {
        ${formConfig2.modelName}: {
          ${defaultValueList.join("\n")}
        },
        
        ${formConfig2.rulesName}: {
          ${rulesList.join("\n")}
        },
        
        ${activeTabs.join("\n")}
        
        ${fieldOptions.join("\n")}
        
        ${uploadData.join("\n")}
      }
    },
    computed: {},
    watch: {},
    created() {
    },
    mounted() {
    },
    methods: {
      ${buildSubFormMethods$1(widgetList2)}
      ${buildDataTableMethods$1(widgetList2)}
      
      submitForm() {
        this.$refs['vForm'].validate(valid => {
          if (!valid) return
          
          //TODO: \u63D0\u4EA4\u8868\u5355
        })
      },
      
      resetForm() {
        this.$refs['vForm'].resetFields()
      }
    }
  }`;
    return v2JSTemplate;
  };
  let beautifierObj;
  const beautifierOpts = {
    html: {
      indent_size: "2",
      indent_char: " ",
      max_preserve_newlines: "-1",
      preserve_newlines: false,
      keep_array_indentation: false,
      break_chained_methods: false,
      indent_scripts: "separate",
      brace_style: "end-expand",
      space_before_conditional: true,
      unescape_strings: false,
      jslint_happy: false,
      end_with_newline: true,
      wrap_line_length: "110",
      indent_inner_html: true,
      comma_first: false,
      e4x: true,
      indent_empty_lines: true
    },
    js: {
      indent_size: "2",
      indent_char: " ",
      max_preserve_newlines: "-1",
      preserve_newlines: false,
      keep_array_indentation: false,
      break_chained_methods: false,
      indent_scripts: "normal",
      brace_style: "end-expand",
      space_before_conditional: true,
      unescape_strings: false,
      jslint_happy: true,
      end_with_newline: true,
      wrap_line_length: "110",
      indent_inner_html: true,
      comma_first: false,
      e4x: true,
      indent_empty_lines: true
    },
    css: {
      indent_size: "2",
      indent_char: " ",
      max_preserve_newlines: "-1",
      preserve_newlines: false,
      keep_array_indentation: false,
      break_chained_methods: false,
      indent_scripts: "normal",
      brace_style: "end-expand",
      space_before_conditional: true,
      unescape_strings: false,
      jslint_happy: true,
      end_with_newline: true,
      wrap_line_length: "110",
      indent_inner_html: true,
      comma_first: false,
      e4x: true,
      indent_empty_lines: true
    }
  };
  function loadBeautifier(callback) {
    if (beautifierObj) {
      callback(beautifierObj);
      return;
    }
    loadRemoteScript(BEAUTIFIER_PATH, () => {
      beautifierObj = beautifier;
      callback(beautifierObj);
    });
  }
  function buildSubFormMethods(widgetList2) {
    let template = ``;
    let widget = widgetList2.find((x) => x.type === "sub-form" || x.type === "grid-sub-form");
    if (widget) {
      template = `
    methods.addSubFormRow=(widgetId)=>{
    state.formData[widgetId].push({})
   };

   methods.insertSubFormRow=(widgetId,sfrIdx)=>{
    state.formData[widgetId].splice(sfrIdx,0,{})
   };

   methods.deleteSubFormRow=(widgetId,sfrIdx)=>{
    state.formData[widgetId].splice(sfrIdx,1)
   };
   `;
    }
    return template;
  }
  function buildDataTableMethods(widgetList2) {
    let template = ``;
    let widget = widgetList2.find((x) => x.type === "data-table");
    if (widget) {
      template = `
    methods.formatterValue=(row, column, cellValue)=> {
      if (!cellValue) {
        return ''
      }

      let date=cellValue;      
      let v=cellValue;
      let y,m,d,res,length

      if(!!column.formatS) {
        switch(column.formatS) {
          case 'd1':
              if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
                return date;
              }
              date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
              y = date.getFullYear();
              m = date.getMonth() + 1;
              m = m < 10 ? '0' + m : m;
              d = date.getDate();
              d = d < 10 ? ('0' + d) : d;
              return y + '-' + m + '-' + d;
          case 'd2':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            y = date.getFullYear();
            m = date.getMonth() + 1;
            m = m < 10 ? '0' + m : m;
            d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            return y + '/' + m + '/' + d;
          case 'd3':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            y = date.getFullYear();
            m = date.getMonth() + 1;
            m = m < 10 ? '0' + m : m;
            d = date.getDate();
            d = d < 10 ? ('0' + d) : d;
            return y + '\u5E74' + m + '\u6708' + d +'\u65E5';
          case 'd4':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date"){
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Date
            return date.toLocaleString()
          case 'd5':
            if (new Date(Date.parse(date.replace(/-/g, "/"))) === "Invalid Date") {
              return date;
            }
            date = new Date(Date.parse(date.replace(/-/g, "/"))); //\u8F6C\u6362\u6210Data();
            return date.toLocaleString('chinese', { hour12: false })
          case 'n1':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            switch(length){
              case 0:
                  v = v.toFixed(0)
                  break;
              case 1:
                  v = v.toFixed(1)
                  break;
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              case 4:
                  v = v.toFixed(4)
                  break;
              case 5:
                  v = v.toFixed(5)
                  break;
              default:
                  v = v.toFixed(6)
            }
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n2':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            switch(length){
              case 0:
              case 1:
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              case 4:
                  v = v.toFixed(4)
                  break;
              case 5:
                  v = v.toFixed(5)
                  break;
              default:
                  v = v.toFixed(6)
            }
          
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n3':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(6)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n4':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(3)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n5':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(2)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n6':
            if (typeof(v) != "number") {
              return v;
            }
          
            v = v.toFixed(0)
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res;
          case 'n7':
            if (typeof(v) != "number") {
              return v;
            }
          
            length = v.toString().split(".")[1].length;
            v = v*100
            switch(length){
              case 0:
              case 1:
              case 2:
                  v = v.toFixed(2)
                  break;
              case 3:
                  v = v.toFixed(3)
                  break;
              default:
                  v = v.toFixed(4)
            }
          
            res = v.toString().replace(/d+/, function(n){ // \u5148\u63D0\u53D6\u6574\u6570\u90E8\u5206
              return n.replace(/(d)(?=(d{3})+$)/g,function($1){
                return $1+",";
                });
              })
            return res+'%';
        }
      }
      return cellValue;
    }
   `;
    }
    return template;
  }
  const genVue3JS = function(formConfig2, widgetList2) {
    let defaultValueList = [];
    let rulesList = [];
    let fieldOptions = [];
    let uploadData = [];
    sfcTraverseFieldWidgets(widgetList2, (widget) => {
      buildDefaultValueListFn(formConfig2, widgetList2, defaultValueList)(widget);
      buildRulesListFn(formConfig2, widgetList2, rulesList)(widget);
      buildFieldOptionsFn(formConfig2, widgetList2, fieldOptions)(widget);
      buildUploadDataFn(formConfig2, widgetList2, uploadData)(widget);
    });
    const activeTabs = buildActiveTabs(formConfig2, widgetList2);
    const v3JSTemplate = `  import { defineComponent, toRefs, reactive, getCurrentInstance } from 'vue'
  
  export default defineComponent({
    components: {},
    props: {},
    setup() {
      const state = reactive({
        ${formConfig2.modelName}: {
          ${defaultValueList.join("\n")}
        },
        
        ${formConfig2.rulesName}: {
          ${rulesList.join("\n")}
        },
        
        ${activeTabs.join("\n")}
        
        ${fieldOptions.join("\n")}
        
        ${uploadData.join("\n")}
      })
    
      const methods = {}
      
      const instance = getCurrentInstance()
      
      const submitForm = () => {
        instance.proxy.$refs['vForm'].validate(valid => {
          if (!valid) return
          
          //TODO: \u63D0\u4EA4\u8868\u5355
        })
      }
      
      const resetForm = () => {
        instance.proxy.$refs['vForm'].resetFields()
      }
      
      ${buildSubFormMethods(widgetList2)}
      ${buildDataTableMethods(widgetList2)}
      
      return {
        ...toRefs(state),
        ...methods,
        submitForm,
        resetForm
      }
    }
  })`;
    return v3JSTemplate;
  };
  function buildClassAttr(ctn, defaultClass) {
    const cop = ctn.options;
    let gridClassArray = [];
    !!defaultClass && gridClassArray.push(defaultClass);
    !!cop.customClass && cop.customClass.length > 0 && gridClassArray.push(cop.customClass.join(" "));
    return gridClassArray.length > 0 ? `class="${gridClassArray.join(" ")}"` : "";
  }
  function getLabelAlign(widget, subWidget) {
    return subWidget.options.labelAlign || widget.options.labelAlign;
  }
  function getCustomLabel(subWidget) {
    let html = [];
    if (!!subWidget.options.labelIconClass) {
      html.push(`<span class="custom-label">`);
      if (subWidget.options.labelIconPosition === "front") {
        html.push(`<el-tooltip content="${subWidget.options.labelTooltip}" effect="light"><i class="${subWidget.options.labelIconClass}"></i></el-tooltip>${subWidget.options.label}`);
      } else {
        html.push(`<i class="${subWidget.options.labelIconClass}"></i>${subWidget.options.label}`);
      }
      html.push(`</span>`);
    } else {
      html.push(`<span title="${subWidget.options.labelTooltip || ""}">${subWidget.options.label}</span>`);
    }
    return html.join("");
  }
  const rowId = () => {
    return `id${generateId()}`;
  };
  const containerTemplates = {
    "grid": (ctn, formConfig2, vue3Flag = false) => {
      const gridClassAttr = buildClassAttr(ctn);
      const gridTemplate = `<el-row ${gridClassAttr}>
${ctn.cols.map((col) => {
        const colOpt = col.options;
        const spanAttr = !!colOpt.responsive ? "" : `:span="${colOpt.span}"`;
        const mdAttr = !colOpt.responsive ? "" : `:md="${colOpt.md}"`;
        const smAttr = !colOpt.responsive ? "" : `:sm="${colOpt.sm}"`;
        const xsAttr = !colOpt.responsive ? "" : `:xs="${colOpt.xs}"`;
        const offsetAttr = !!colOpt.offset ? `:offset="${colOpt.offset}"` : "";
        const pushAttr = !!colOpt.push ? `:push="${colOpt.push}"` : "";
        const pullAttr = !!colOpt.pull ? `:pull="${colOpt.pull}"` : "";
        const colClassAttr = buildClassAttr(col, "grid-cell");
        return `<el-col ${spanAttr} ${mdAttr} ${smAttr} ${xsAttr} ${offsetAttr} ${pushAttr} ${pullAttr} ${colClassAttr}>
    ${col.widgetList.map((cw) => {
          if (cw.category === "container") {
            return buildContainerWidget(cw, formConfig2, vue3Flag);
          } else {
            return buildFieldWidget(cw, formConfig2, vue3Flag);
          }
        }).join("")}
    </el-col>`;
      }).join("")}
</el-row>`;
      return gridTemplate;
    },
    "table": (ctn, formConfig2, vue3Flag = false) => {
      const tableClassAttr = buildClassAttr(ctn, "table-layout");
      const tableTemplate = `<div class="table-container">
  <table ${tableClassAttr}><tbody>
  ${ctn.rows.map((tr) => {
        return `<tr>${tr.cols.filter((td) => !td.merged).map((td) => {
          const tdOpt = td.options;
          const tdClassAttr = buildClassAttr(td, "table-cell");
          const colspanAttr = !isNaN(tdOpt.colspan) && tdOpt.colspan !== 1 ? `colspan="${tdOpt.colspan}"` : "";
          const rowspanAttr = !isNaN(tdOpt.rowspan) && tdOpt.rowspan !== 1 ? `rowspan="${tdOpt.rowspan}"` : "";
          let tdStyleArray = [];
          !!tdOpt.cellWidth && tdStyleArray.push("width: " + tdOpt.cellWidth + " !important");
          !!tdOpt.cellHeight && tdStyleArray.push("height: " + tdOpt.cellHeight + " !important");
          let tdStyleAttr = tdStyleArray.length > 0 ? `style="${tdStyleArray.join(";")}"` : "";
          return `<td ${tdClassAttr} ${colspanAttr} ${rowspanAttr} ${tdStyleAttr}>${td.widgetList.map((tw) => {
            if (tw.category === "container") {
              return buildContainerWidget(tw, formConfig2, vue3Flag);
            } else {
              return buildFieldWidget(tw, formConfig2, vue3Flag);
            }
          }).join("")}
                    </td>`;
        }).join("")}</tr>`;
      }).join("")}
  </tbody></table>
</div>`;
      return tableTemplate;
    },
    "tab": (ctn, formConfig2, vue3Flag = false) => {
      const tabClassAttr = buildClassAttr(ctn);
      const vModel = ctn.tabs && ctn.tabs.length > 0 ? `v-model="${ctn.options.name}ActiveTab"` : "";
      const tabTemplate = `<div class="tab-container">
  <el-tabs ${vModel} type="${ctn.displayType}" ${tabClassAttr}>
    ${ctn.tabs.map((tab) => {
        const tabOpt = tab.options;
        const disabledAttr = tabOpt.disabled === true ? `disabled` : "";
        return `<el-tab-pane name="${tabOpt.name}" label="${tabOpt.label}" ${disabledAttr}>
        ${tab.widgetList.map((tw) => {
          if (tw.category === "container") {
            return buildContainerWidget(tw, formConfig2, vue3Flag);
          } else {
            return buildFieldWidget(tw, formConfig2, vue3Flag);
          }
        }).join("")}</el-tab-pane>`;
      }).join("")}
  </el-tabs>
</div>`;
      return tabTemplate;
    },
    "sub-form": (ctn, formConfig2, vue3Flag = false) => {
      const tabClassAttr = buildClassAttr(ctn);
      const tableTemplate = `<div class="container-wrapper"  ${emptyAttr("class", tabClassAttr)}>
      <div key="${ctn.id}" class="sub-form-container">
        <el-row class="header-row">
        <div class="action-header-column">
          <span class="action-label">\u64CD\u4F5C</span>
          <el-button round type="primary" size="mini" class="action-button" @click="addSubFormRow('${ctn.id}')" title="\u65B0\u589E\u884C">\u65B0\u589E${vue3Flag ? ` <Plus style="width:1em; height:1em;" />` : `<i class="el-icon-plus el-icon-right"></i>`}
          </el-button>
        </div>

          ${ctn.widgetList.map((subWidget) => {
        let subWidgetContainer = `<div key="${subWidget.id + "thc"}" class="field-header-column"
           
            ${emptyAttr("class", (getLabelAlign(ctn, subWidget), !!subWidget.options.required ? "is-required" : ""))}
            style="width: ${subWidget.options.columnWidth}">
              ${getCustomLabel(subWidget)}                        
            </div>`;
        return subWidgetContainer;
      }).join("")}
        </el-row>   

        ${(() => {
        let rowHtml = [];
        rowHtml.push(`<el-row class="sub-form-row" v-for="(subWidget,sfrIdx) in formData.${ctn.id}" :key="sfrIdx">`);
        rowHtml.push(`<div class="sub-form-action-column hide-label">
            <div class="action-button-column">
              <el-button circle type="" ${vue3Flag ? `icon="Plus"` : `icon="el-icon-circle-plus-outline"`} @click="insertSubFormRow('${ctn.id}',sfrIdx)"
                         title="\u63D2\u5165\u884C"></el-button>
              <el-button circle type="" ${vue3Flag ? `icon="Delete"` : `icon="el-icon-delete"`} @click="deleteSubFormRow('${ctn.id}',sfrIdx)"
                         title="\u5220\u9664\u884C"></el-button>
              <span class="row-number-span">#{{sfrIdx+1}}</span>
            </div>
          </div>`);
        ctn.widgetList.map((subWidget, swIdx) => {
          rowHtml.push(`<div class="sub-form-table-column hide-label" key="${subWidget.id + "tc" + rowId()}"  style="width: ${subWidget.options.columnWidth}">`);
          rowHtml.push(buildSubFormFieldWidget(subWidget, formConfig2, ctn));
          rowHtml.push(`</div>`);
        });
        rowHtml.push(`</el-row>`);
        return rowHtml.join("");
      })()} 
      </div> 
    </div>`;
      return tableTemplate;
    },
    "grid-sub-form": (ctn, formConfig2, vue3Flag = false) => {
      const tabClassAttr = buildClassAttr(ctn);
      const tableTemplate = `<div class="container-wrapper"  ${emptyAttr("class", tabClassAttr)}>
      <div key="${ctn.id}" class="sub-form-container">
        <el-row class="header-row">
        <div class="grid-sub-form action-header-column">
          <span class="action-label">\u64CD\u4F5C</span>
          <el-button  round type="primary" size="mini" class="action-button" @click="addSubFormRow('${ctn.id}')" 
          title="\u65B0\u589E\u884C">\u65B0\u589E${vue3Flag ? ` <Plus style="width:1em; height:1em;" />` : `<i class="el-icon-plus el-icon-right"></i>`}
          </el-button>
        </div>
        </el-row>

        ${(() => {
        let rowHtml = [];
        rowHtml.push(`<div class="grid-sub-form sub-form-row" v-for="(subWidget,sfrIdx) in formData.${ctn.id}" :key="sfrIdx">`);
        rowHtml.push(`<div class="grid-sub-form sub-form-action-column hide-label">
            <div class="action-button-column">
              <el-button circle type="" ${vue3Flag ? `icon="Plus"` : `icon="el-icon-circle-plus-outline"`} @click="insertSubFormRow('${ctn.id}',sfrIdx)"
                         title="\u63D2\u5165\u884C"></el-button>
              <el-button circle type="" ${vue3Flag ? `icon="Delete"` : `icon="el-icon-delete"`} @click="deleteSubFormRow('${ctn.id}',sfrIdx)"
                         title="\u5220\u9664\u884C"></el-button>
              <span class="row-number-span">#{{sfrIdx+1}}</span>
            </div>
          </div>`);
        rowHtml.push(`<div class="grid-sub-form grid-sub-form-data-row">`);
        ctn.widgetList.map((subWidget) => {
          rowHtml.push(containerTemplates["grid"](subWidget, formConfig2, ctn, vue3Flag));
        }).join("");
        rowHtml.push(`  </div>`);
        rowHtml.push(`</div>`);
        return rowHtml.join("");
      })()} 
      </div> 
    </div>`;
      return tableTemplate;
    },
    "data-table": (ctn, formConfig2, vue3Flag = false) => {
      const tabClassAttr = buildClassAttr(ctn, "container-wrapper");
      const buttonsColumnFixed = () => {
        if (ctn.options.buttonsColumnFixed === void 0) {
          return "right";
        }
        return !ctn.options.buttonsColumnFixed ? false : ctn.options.buttonsColumnFixed;
      };
      const paginationLayout = () => {
        return !!ctn.options.smallPagination ? "prev, pager, next" : "total, prev, pager, next, jumper";
      };
      const tableTemplate = `<div ${tabClassAttr}>
    <el-table ref="dataTable" :data="formData.${ctn.id}.tableData" ${emptyAttr("class", ctn.options.customClass.toString().replace(/,/g, " "))}
								height="${ctn.options.tableHeight}" :style="{width: '${ctn.options.tableWidth}'}"
								:border="${ctn.options.border}" :show-summary="${ctn.options.showSummary}"
								size="${ctn.options.tableSize}" :stripe="${ctn.options.stripe}"
                :highlight-current-row="${!ctn.options.showCheckBox}"              
								:cell-style="{padding: '${ctn.options.rowSpacing + "px 0"} '}" >

      ${(() => {
        if (!!ctn.options.showIndex) {
          return ` <el-table-column  type="index" width="50" fixed="left"></el-table-column>`;
        } else {
          return ``;
        }
      })()}
     
      ${(() => {
        if (!!ctn.options.showCheckBox) {
          return `<el-table-column type="selection" :width="${!ctn.options.showSummary ? 50 : 55}"  fixed="left"></el-table-column>`;
        } else {
          return ``;
        }
      })()}


      ${(() => {
        let html = [];
        ctn.options.tableColumns.forEach((item, index2) => {
          html.push(`<el-table-column 
                      prop="${item.prop}"
                      label="${item.label}"
                      ${emptyAttr(":sortable", item.sortable)}
                      ${!item.fixed ? ":fixed" : "fixed"}="${!item.fixed ? "false" : item.fixed}"
                      align="${item.align ? item.align : "center"}"
                      :formatter="formatterValue"
                      ${emptyAttr("format", item.format)}
                      :show-overflow-tooltip="true"
                      :min-width="${item.width}"
                      >`);
          if (item.formatS === "render" && !!item.render) {
            html.push(`<template ${vue3Flag ? `#default="scope">` : `slot-scope="scope">`}`);
            html.push(`\u81EA\u5B9A\u4E49render`);
            html.push(`</template>`);
          } else if (!!item.formatS) {
            html.push(`<template ${vue3Flag ? `#default="scope">` : `slot-scope="scope">`}`);
            html.push(`<span>{{formatterValue(scope.row, formData.${ctn.id}.tableColumns[${index2}], scope.row['${item.prop}'])}}</span>`);
            html.push(`</template>`);
          } else {
            html.push(`<template ${vue3Flag ? `#default="scope">` : `slot-scope="scope">`}`);
            html.push(`<span>{{scope.row['${item.prop}']}}</span>`);
            html.push(`</template>`);
          }
          html.push(`</el-table-column>`);
        });
        return html.join("");
      })()}

      
      ${(() => {
        if (!!ctn.options.showButtonsColumn)
          return `
            <el-table-column fixed="${buttonsColumnFixed()}"
                            class-name="data-table-buttons-column" align="'center'"
                            label="${ctn.options.buttonsColumnTitle}"
                            :width="${ctn.options.buttonsColumnWidth}">
              <template #default="scope">
                  ${(() => {
            let buttons = [];
            for (let i2 = 0; i2 < ctn.options.operationButtons.length; i2++) {
              let ob = ctn.options.operationButtons[i2];
              if (!ob.hidden) {
                buttons.push(`<el-button type="${ob.type}" size="${ob.size}" :round="${ob.round}"
                          :disabled="${ob.disabled}"
                          :class="['${"data-table-" + ob.name + "-button"}']">${ob.label}</el-button>`);
              }
            }
            return buttons.join("");
          })()}
              </template>
            </el-table-column>
        `;
        else {
          return "";
        }
      })()}

			</el-table>

      ${(() => {
        if (!!ctn.options.showPagination)
          return `
              <el-pagination :small="${ctn.options.smallPagination}"
                            ${vue3Flag ? `current-page="1"` : `:current-page="1"`}
                            :page-sizes="[10,20,50,100]"
                            :page-size="10"
                            layout="${paginationLayout()}"
                            :total="${ctn.options.tableData.length}">
              </el-pagination>
         `;
      })()}

    </div>`;
      return tableTemplate;
    }
  };
  function buildContainerWidget(widget, formConfig2, vue3Flag = false) {
    return containerTemplates[widget.type] ? containerTemplates[widget.type](widget, formConfig2, vue3Flag) : null;
  }
  function getElAttrs(widget, formConfig2, parentWidget) {
    let wop = widget.options;
    let vModel = "";
    if (!parentWidget) {
      vModel = `v-model="${formConfig2.modelName}.${wop.name}"`;
    } else {
      vModel = `v-model="subWidget.${wop.name}"`;
    }
    return {
      vModel,
      readonly: wop.readonly ? `readonly="true"` : "",
      disabled: wop.disabled ? `:disabled="true"` : "",
      size: !!wop.size ? `size="${wop.size}"` : "",
      type: !!wop.type ? `type="${wop.type === "number" ? "text" : wop.type}"` : "",
      showPassword: !!wop.showPassword ? `:show-password="${wop.showPassword}"` : "",
      placeholder: !!wop.placeholder ? `placeholder="${wop.placeholder}"` : "",
      rows: isNotNull(wop.rows) && !isNaN(wop.rows) ? `rows="${wop.rows}"` : "",
      clearable: !!wop.clearable ? "clearable" : "",
      minlength: isNotNull(wop.minLength) && !isNaN(wop.minLength) ? `:minlength="${wop.minLength}"` : "",
      maxlength: isNotNull(wop.maxLength) && !isNaN(wop.maxLength) ? `:maxlength="${wop.maxLength}"` : "",
      showWordLimit: !!wop.showWordLimit ? `:show-word-limit="true"` : "",
      prefixIcon: !!wop.prefixIcon ? `prefix-icon="${wop.prefixIcon}"` : "",
      suffixIcon: !!wop.suffixIcon ? `suffix-icon="${wop.suffixIcon}"` : "",
      controlsPosition: wop.controlsPosition === "right" ? `controls-position="right"` : "",
      min: isNotNull(wop.min) && !isNaN(wop.min) ? `:min="${wop.min}"` : "",
      max: isNotNull(wop.max) && !isNaN(wop.max) ? `:max="${wop.max}"` : "",
      precision: isNotNull(wop.precision) && !isNaN(wop.precision) ? `:precision="${wop.precision}"` : "",
      step: isNotNull(wop.step) && !isNaN(wop.step) ? `:step="${wop.step}"` : "",
      filterable: !!wop.filterable ? `filterable` : "",
      allowCreate: !!wop.allowCreate ? `allow-create` : "",
      defaultFirstOption: !!wop.filterable && !!wop.allowCreate ? `default-first-option` : "",
      multiple: !!wop.multiple ? `multiple` : "",
      multipleLimit: !isNaN(wop.multipleLimit) && wop.multipleLimit > 0 ? `:multiple-limit="${wop.multipleLimit}"` : "",
      automaticDropdown: !!wop.automaticDropdown ? `automatic-dropdown` : "",
      remote: !!wop.remote ? `remote` : "",
      format: !!wop.format ? `format="${wop.format}"` : "",
      valueFormat: !!wop.valueFormat ? `value-format="${wop.valueFormat}"` : "",
      editable: !!wop.editable ? `:editable="${wop.editable}"` : "",
      startPlaceholder: !!wop.startPlaceholder ? `start-placeholder="${wop.startPlaceholder}"` : "",
      endPlaceholder: !!wop.endPlaceholder ? `end-placeholder="${wop.endPlaceholder}"` : "",
      activeText: !!wop.activeText ? `active-text="${wop.activeText}"` : "",
      inactiveText: !!wop.inactiveText ? `inactive-text="${wop.inactiveText}"` : "",
      activeColor: !!wop.activeColor ? `active-color="${wop.activeColor}"` : "",
      inactiveColor: !!wop.inactiveColor ? `inactive-color="${wop.inactiveColor}"` : "",
      switchWidth: !isNaN(wop.switchWidth) && wop.switchWidth !== 40 ? `:width="${wop.switchWidth}"` : "",
      rateMax: !isNaN(wop.max) && wop.max !== 5 ? `:max="${wop.max}"` : "",
      lowThreshold: !isNaN(wop.lowThreshold) && wop.lowThreshold !== 2 ? `:low-threshold="${wop.lowThreshold}"` : "",
      highThreshold: !isNaN(wop.highThreshold) && wop.highThreshold !== 4 ? `:high-threshold="${wop.highThreshold}"` : "",
      allowHalf: !!wop.allowHalf ? `allow-half` : "",
      showText: !!wop.showText ? `show-text` : "",
      showScore: !!wop.showScore ? `show-score` : "",
      sliderMin: !isNaN(wop.min) && wop.min !== 0 ? `:min="${wop.min}"` : "",
      sliderMax: !isNaN(wop.max) && wop.max !== 100 ? `:max="${wop.max}"` : "",
      sliderStep: !isNaN(wop.step) && wop.step !== 1 ? `:step="${wop.step}"` : "",
      sliderRange: !!wop.range ? `range` : "",
      sliderVertical: !!wop.vertical ? `vertical` : "",
      uploadAction: !!wop.uploadURL ? `action="${wop.uploadURL}"` : "",
      withCredentials: !!wop.withCredentials ? `with-credentials` : "",
      multipleSelect: !!wop.multipleSelect ? `multiple` : "",
      showFileList: !!wop.showFileList ? `show-file-list` : "",
      limit: !isNaN(wop.limit) ? `:limit="${wop.limit}"` : "",
      uploadTipSlotChild: !!wop.uploadTip ? `<template #tip><div class="el-upload__tip">${wop.uploadTip}</div></template>` : "",
      pictureUploadIconChild: `<template #default><i class="el-icon-plus"></i></template>`,
      fileUploadIconChild: `<template #default><i class="el-icon-plus"></i></template>`,
      buttonType: !!wop.type ? `type="${wop.type}"` : "",
      buttonPlain: !!wop.plain ? `plain` : "",
      buttonRound: !!wop.round ? `round` : "",
      buttonCircle: !!wop.circle ? `circle` : "",
      buttonIcon: !!wop.icon ? `icon="${wop.icon}"` : "",
      contentPosition: !!wop.contentPosition && wop.contentPosition !== "center" ? `content-position="${wop.contentPosition}"` : "",
      appendButtonChild: !!wop.appendButton ? `<template #append><el-button class="${wop.buttonIcon}" ${!!wop.appendButtonDisabled ? "disabled" : ""}></el-button></template>` : ""
    };
  }
  function buildRadioChildren(widget, formConfig2) {
    let wop = widget.options;
    const childTag = !!wop.buttonStyle ? "el-radio-button" : "el-radio";
    const borderAttr = !!wop.border ? `border` : "";
    const styleAttr = `style="{display: ${wop.displayStyle}}"`;
    return `<${childTag} v-for="(item, index) in ${wop.name}Options" :key="index" :label="item.value"
          :disabled="item.disabled" ${borderAttr} ${styleAttr}>{{item.label}}</${childTag}>`;
  }
  function buildCheckboxChildren(widget, formConfig2) {
    let wop = widget.options;
    const childTag = !!wop.buttonStyle ? "el-checkbox-button" : "el-checkbox";
    const borderAttr = !!wop.border ? `border` : "";
    const styleAttr = `style="{display: ${wop.displayStyle}}"`;
    return `<${childTag} v-for="(item, index) in ${wop.name}Options" :key="index" :label="item.value"
          :disabled="item.disabled" ${borderAttr} ${styleAttr}>{{item.label}}</${childTag}>`;
  }
  function buildSelectChildren(widget, formConfig2) {
    let wop = widget.options;
    const childTag = "el-option";
    return `<${childTag} v-for="(item, index) in ${wop.name}Options" :key="index" :label="item.label"
          :value="item.value" :disabled="item.disabled"></${childTag}>`;
  }
  const elTemplates = {
    "input": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        type,
        showPassword,
        placeholder,
        clearable,
        minlength,
        maxlength,
        showWordLimit,
        prefixIcon,
        suffixIcon,
        appendButtonChild
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-input ${vModel} ${readonly} ${disabled} ${size} ${type} ${showPassword} ${placeholder} ${clearable}
            ${minlength} ${maxlength} ${showWordLimit} ${prefixIcon} ${suffixIcon}>${appendButtonChild}</el-input>`;
    },
    "textarea": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        type,
        showPassword,
        placeholder,
        rows,
        clearable,
        minlength,
        maxlength,
        showWordLimit
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-input type="textarea" ${vModel} ${readonly} ${disabled} ${size} ${type} ${showPassword} ${placeholder}
            ${rows} ${clearable} ${minlength} ${maxlength} ${showWordLimit}></el-input>`;
    },
    "number": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        size,
        type,
        showPassword,
        placeholder,
        controlsPosition,
        min,
        max,
        precision,
        step
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-input-number ${vModel} class="full-width-input" ${disabled} ${size} ${type} ${showPassword}
            ${placeholder} ${controlsPosition} ${min} ${max} ${precision} ${step}></el-input-number>`;
    },
    "radio": (widget, formConfig2, parentWidget) => {
      const { vModel, disabled, size } = getElAttrs(widget, formConfig2, parentWidget);
      const radioOptions = buildRadioChildren(widget);
      return `<el-radio-group ${vModel} ${disabled} ${size}>${radioOptions}</el-radio-group>`;
    },
    "checkbox": (widget, formConfig2, parentWidget) => {
      const { vModel, disabled, size } = getElAttrs(widget, formConfig2, parentWidget);
      const checkboxOptions = buildCheckboxChildren(widget);
      return `<el-checkbox-group ${vModel} ${disabled} ${size}>${checkboxOptions}</el-checkbox-group>`;
    },
    "select": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        size,
        clearable,
        filterable,
        allowCreate,
        defaultFirstOption,
        automaticDropdown,
        multiple,
        multipleLimit,
        remote,
        placeholder
      } = getElAttrs(widget, formConfig2, parentWidget);
      const selectOptions = buildSelectChildren(widget);
      return `<el-select ${vModel} class="full-width-input" ${disabled} ${size} ${clearable} ${filterable}
            ${allowCreate} ${defaultFirstOption} ${automaticDropdown} ${multiple} ${multipleLimit} ${placeholder}
            ${remote}>${selectOptions}</el-select>`;
    },
    "time": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        placeholder,
        clearable,
        format,
        editable: editable2
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-time-picker ${vModel} class="full-width-input" ${readonly} ${disabled} ${size} ${format}
            value-format="HH:mm:ss" ${placeholder} ${clearable} ${editable2}></el-time-picker>`;
    },
    "time-range": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        startPlaceholder,
        endPlaceholder,
        clearable,
        format,
        editable: editable2
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-time-picker is-range ${vModel} class="full-width-input" ${readonly} ${disabled} ${size} ${format}
            value-format="HH:mm:ss" ${startPlaceholder} ${endPlaceholder} ${clearable} ${editable2}></el-time-picker>`;
    },
    "date": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        type,
        placeholder,
        clearable,
        format,
        valueFormat,
        editable: editable2
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-date-picker ${vModel} ${type} class="full-width-input" ${readonly} ${disabled} ${size} ${format}
              ${valueFormat} ${placeholder} ${clearable} ${editable2}></el-date-picker>`;
    },
    "date-range": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        readonly,
        disabled,
        size,
        type,
        startPlaceholder,
        endPlaceholder,
        clearable,
        format,
        valueFormat,
        editable: editable2
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-date-picker is-range ${vModel} ${type} class="full-width-input" ${readonly} ${disabled} ${size} ${format}
            ${valueFormat} ${startPlaceholder} ${endPlaceholder} ${clearable} ${editable2}></el-date-picker>`;
    },
    "switch": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        activeText,
        inactiveText,
        activeColor,
        inactiveColor,
        switchWidth
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-switch ${vModel} ${disabled} ${activeText} ${inactiveText} ${activeColor} ${inactiveColor}
            ${switchWidth}></el-switch>`;
    },
    "rate": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        rateMax,
        lowThreshold,
        highThreshold,
        allowHalf,
        showText,
        showScore
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-rate ${vModel} ${disabled} ${rateMax} ${lowThreshold} ${highThreshold} ${allowHalf}
            ${showText} ${showScore}></el-rate>`;
    },
    "color": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        size
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-color-picker ${vModel} ${disabled} ${size}></el-color-picker>`;
    },
    "slider": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        sliderMin,
        sliderMax,
        sliderStep,
        sliderRange,
        sliderVertical
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-slider ${vModel} ${disabled} ${sliderMin} ${sliderMax} ${sliderStep} ${sliderRange}
            ${sliderVertical}></el-slider>`;
    },
    "picture-upload": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        uploadAction,
        withCredentials,
        multipleSelect,
        showFileList,
        limit,
        uploadTipSlotChild,
        pictureUploadIconChild
      } = getElAttrs(widget, formConfig2, parentWidget);
      let wop = widget.options;
      return `<el-upload :file-list="${wop.name}FileList" :headers="${wop.name}UploadHeaders" :data="${wop.name}UploadData" 
            ${disabled} ${uploadAction} list-type="picture-card" ${withCredentials} ${multipleSelect} ${showFileList} 
            ${limit}>${uploadTipSlotChild} ${pictureUploadIconChild}</el-upload>`;
    },
    "file-upload": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        uploadAction,
        withCredentials,
        multipleSelect,
        showFileList,
        limit,
        uploadTipSlotChild,
        fileUploadIconChild
      } = getElAttrs(widget, formConfig2, parentWidget);
      let wop = widget.options;
      return `<el-upload :file-list="${wop.name}FileList" :headers="${wop.name}UploadHeaders" :data="${wop.name}UploadData" 
            ${disabled} ${uploadAction} list-type="picture-card" ${withCredentials} ${multipleSelect} ${showFileList} 
            ${limit}>${uploadTipSlotChild} ${fileUploadIconChild}</el-upload>`;
    },
    "rich-editor": (widget, formConfig2, parentWidget) => {
      const {
        vModel,
        disabled,
        placeholder
      } = getElAttrs(widget, formConfig2, parentWidget);
      return `<vue-editor ${vModel} ${disabled} ${placeholder}></vue-editor>`;
    },
    "cascader": (widget, formConfig2, parentWidget) => {
      const { vModel, disabled, size, clearable, filterable, placeholder } = getElAttrs(widget, formConfig2, parentWidget);
      let wop = widget.options;
      const optionsAttr = `:options="${wop.name}Options"`;
      return `<el-cascader ${vModel} class="full-width-input" ${optionsAttr} ${disabled} ${size} ${clearable}
            ${filterable} ${placeholder}></el-cascader>`;
    },
    "static-text": (widget, formConfig2) => {
      return `<div>${widget.options.textContent}</div>`;
    },
    "html-text": (widget, formConfig2) => {
      return `<div v-html="'${widget.options.htmlContent}'"></div>`;
    },
    "button": (widget, formConfig2, parentWidget) => {
      const { buttonType, buttonPlain, buttonRound, buttonCircle, buttonIcon, disabled } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-button ${buttonType} ${buttonPlain} ${buttonRound} ${buttonCircle} ${buttonIcon}
            ${disabled}>${widget.options.label}</el-button>`;
    },
    "divider": (widget, formConfig2, parentWidget) => {
      const { contentPosition } = getElAttrs(widget, formConfig2, parentWidget);
      return `<el-divider direction="horizontal" ${contentPosition}></el-divider>`;
    }
  };
  function buildFieldWidget(widget, formConfig2, parentWidget, vue3Flag = false) {
    let wop = widget.options;
    const label = wop.labelHidden ? "" : wop.label;
    const labelWidthAttr = wop.labelHidden ? `label-width="0"` : !!wop.labelWidth ? `label-width="${wop.labelWidth}px"` : "";
    const labelTooltipAttr = wop.labelTooltip ? `title="${wop.labelTooltip}"` : "";
    const propAttr = `prop="${wop.name}"`;
    let classArray = [];
    !!wop.required && classArray.push("required");
    !!wop.customClass && wop.customClass.length > 0 && classArray.push(wop.customClass.join(" "));
    if (!!wop.labelAlign) {
      wop.labelAlign !== "label-left-align" && classArray.push(wop.labelAlign);
    } else if (!!widget.formItemFlag) {
      formConfig2.labelAlign !== "label-left-align" && classArray.push(formConfig2.labelAlign);
    }
    if (!widget.formItemFlag) {
      classArray.push("static-content-item");
    }
    const classAttr = classArray.length > 0 ? `class="${classArray.join(" ")}"` : "";
    let customLabelDom = `<template #label><span class="custom-label">${wop.labelIconPosition === "front" ? !!wop.labelTooltip ? `<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>${wop.label}` : `<i class="${wop.labelIconClass}"></i>${wop.label}` : !!wop.labelTooltip ? `${wop.label}<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>` : `${wop.label}<i class="${wop.labelIconClass}"></i>`}
</span></template>`;
    !wop.labelIconClass && (customLabelDom = "");
    const fwDom = elTemplates[widget.type] ? elTemplates[widget.type](widget, formConfig2, parentWidget, vue3Flag) : null;
    const isFormItem = !!widget.formItemFlag;
    const vShowAttr = !!wop.hidden ? `v-show="false"` : "";
    return isFormItem ? `<el-form-item label="${label}" ${labelWidthAttr} ${labelTooltipAttr} ${propAttr} ${classAttr}>
  ${customLabelDom}
  ${fwDom}
</el-form-item>` : `<div ${classAttr} ${vShowAttr}>${fwDom}</div>`;
  }
  function buildSubFormFieldWidget(widget, formConfig2, subformWidget, vue3Flag = false) {
    let wop = widget.options;
    wop.labelHidden ? "" : wop.label;
    wop.labelHidden ? `label-width="0"` : !!wop.labelWidth ? `label-width="${wop.labelWidth}px"` : "";
    wop.labelTooltip ? `title="${wop.labelTooltip}"` : "";
    `prop="${wop.name}"`;
    let classArray = [];
    !!wop.required && classArray.push("required");
    !!wop.customClass && wop.customClass.length > 0 && classArray.push(wop.customClass.join(" "));
    if (!!wop.labelAlign) {
      wop.labelAlign !== "label-left-align" && classArray.push(wop.labelAlign);
    } else if (!!widget.formItemFlag) {
      formConfig2.labelAlign !== "label-left-align" && classArray.push(formConfig2.labelAlign);
    }
    if (!widget.formItemFlag) {
      classArray.push("static-content-item");
    }
    let customLabelDom = `<template #label><span class="custom-label">${wop.labelIconPosition === "front" ? !!wop.labelTooltip ? `<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>${wop.label}` : `<i class="${wop.labelIconClass}"></i>${wop.label}` : !!wop.labelTooltip ? `${wop.label}<el-tooltip content="${wop.labelTooltip}" effect="light"><i class="${wop.labelIconClass}"></i></el-tooltip>` : `${wop.label}<i class="${wop.labelIconClass}"></i>`}
</span></template>`;
    !wop.labelIconClass && (customLabelDom = "");
    const fwDom = elTemplates[widget.type] ? elTemplates[widget.type](widget, formConfig2, subformWidget) : null;
    !!widget.formItemFlag;
    !!wop.hidden ? `v-show="false"` : "";
    return `${customLabelDom} ${fwDom}`;
  }
  function genTemplate(formConfig2, widgetList2, vue3Flag = false) {
    const submitAttr = !!vue3Flag ? `@submit.prevent` : `@submit.native.prevent`;
    let childrenList = [];
    widgetList2.forEach((wgt) => {
      if (wgt.category === "container") {
        childrenList.push(buildContainerWidget(wgt, formConfig2, vue3Flag));
      } else {
        childrenList.push(buildFieldWidget(wgt, formConfig2, null, vue3Flag));
      }
    });
    const formTemplate = `  <el-form :model="${formConfig2.modelName}" ref="${formConfig2.refName}" :rules="${formConfig2.rulesName}"
    label-position="${formConfig2.labelPosition}" label-width="${formConfig2.labelWidth}px" size="${formConfig2.size || "default"}"
    ${submitAttr}>
  ${!!childrenList ? childrenList.join("\n") : ""}
</el-form>`;
    return formTemplate;
  }
  const genGlobalCSS = function(formConfig2) {
    const globalCssTemplate = `  .el-input-number.full-width-input, .el-cascader.full-width-input {
    width: 100% !important;
  }
  
  .el-form-item--medium {
    .el-radio {
      line-height: 36px !important;
    }
  
    .el-rate{
      margin-top: 8px;
    }
  }

  .el-form-item--small {
    .el-radio {
      line-height: 32px !important;
    }
  
    .el-rate{
      margin-top: 6px;
    }
  }

  .el-form-item--mini {
    .el-radio {
      line-height: 28px !important;
    }
  
    .el-rate{
      margin-top: 4px;
    }
  }
  
  .clear-fix:before, .clear-fix:after {
    display: table;
    content: "";
  }

  .clear-fix:after {
    clear: both;
  }

  .float-right {
    float: right;
  }

${formConfig2.cssCode}`;
    return globalCssTemplate;
  };
  const genScopedCSS = function(formConfig2, vue3Flag = false) {
    const cssTemplate = `  div.table-container {
    table.table-layout {
      width: 100%;
      table-layout: fixed;
      border-collapse: collapse;
      
      td.table-cell {
        display: table-cell;
        height: 36px;
        border: 1px solid #e1e2e3;
      }
    }
  }
  
  div.tab-container {
  }
  
  .label-left-align ${!!vue3Flag ? `:deep(.el-form-item__label)` : `::v-deep .el-form-item__label`} {
    text-align: left;
  }

  .label-center-align ${!!vue3Flag ? `:deep(.el-form-item__label)` : `::v-deep .el-form-item__label`} {
    text-align: center;
  }

  .label-right-align ${!!vue3Flag ? `:deep(.el-form-item__label)` : `::v-deep .el-form-item__label`} {
    text-align: right;
  }
  
  .custom-label {
  }
  
  .static-content-item {
    min-height: 20px;
    display: flex;
    align-items: center;

    ${!!vue3Flag ? `:deep(.el-divider--horizontal)` : `::v-deep .el-divider--horizontal`} {
      margin: 0;
    }
  }`;
    return cssTemplate;
  };
  const genSubformScopedCSS = function(formConfig2, vue3Flag = false) {
    const cssTemplate = ` 
  .sub-form-container {
    margin-bottom: 8px;
    text-align: left; //IE\u6D4F\u89C8\u5668\u5F3A\u5236\u5C45\u5DE6\u5BF9\u9F50

    ${vue3Flag ? `:deep(.el-row)` : `::v-deep .el-row`}.header-row {
      padding: 0;
      display: flex;
    }
    
    ${vue3Flag ? `:deep(.el-form-item)` : `::v-deep .el-form-item`} {
    margin-bottom: 0;
  }
  ${vue3Flag ? `:deep(.el-row)` : `::v-deep .el-row`}.sub-form-row {
      padding: 0;
      display: flex;

      .row-number-span {
        margin-left: 16px;
      }
    }
  }

  div.action-header-column {
    display: inline-block;
    width: 120px;
    border: 1px solid #e1e2e3;
    background: #f1f2f3;
    padding: 8px;

    .action-label {
      margin-right: 12px;
    }

    .action-button {
      padding-left: 8px;
      padding-right: 8px;
    }
  }

  div.field-header-column {
    display: inline-block;
    //overflow: hidden;
    //white-space: nowrap;  //\u6587\u5B57\u8D85\u51FA\u957F\u5EA6\u4E0D\u81EA\u52A8\u6362\u884C
    //text-overflow: ellipsis;  //\u6587\u5B57\u8D85\u51FA\u957F\u5EA6\u663E\u793A\u7701\u7565\u53F7
    border: 1px solid #e1e2e3;
    background: #f1f2f3;
    padding: 8px;

    span.custom-label i {
      margin: 0 3px;
    }
  }

  div.field-header-column.is-required:before {
    content: '*';
    color: #F56C6C;
    margin-right: 4px;
  }

  div.label-center-left {
    text-align: left;
  }

  div.label-center-align {
    text-align: center;
  }

  div.label-right-align {
    text-align: right;
  }

  div.sub-form-action-column {
    display: flex;
    align-items: center;
    width: 120px;
    border: 1px solid #e1e2e3;
    padding: 8px;

    ${vue3Flag ? `:deep(.el-form-item)` : `::v-deep .el-form-item`} {
      margin-bottom: 0;
    }

    ${vue3Flag ? `:deep(.el-button)` : `::v-deep .el-button`} {
      font-size: 18px;
      padding: 0;
      background: #DCDFE6;
      border: 4px solid #DCDFE6;
      height:30px;
      width:30px;
    }

  }

  div.sub-form-action-column.hide-label {
    ${vue3Flag ? `:deep(.el-form-item__label)` : `::v-deep .el-form-item__label`} {
      display: none;
    }
  }

  div.sub-form-table-column {
    display: inline-block;
    //width: 200px;
    border: 1px solid #e1e2e3;
    padding: 8px;

    ${vue3Flag ? `:deep(.el-form-item)` : `::v-deep .el-form-item`} {
      margin-left: 4px;
      margin-right: 4px;
      margin-bottom: 0;
    }

    ${vue3Flag ? `:deep(.el-form-item__content)` : `::v-deep .el-form-item__content`} {
      margin-left: 0 !important;
    }
  }

  div.sub-form-table-column.hide-label {
    ${vue3Flag ? `:deep(.el-form-item__label)` : `::v-deep .el-form-item__label`} {
      display: none;
    }
  }
  `;
    return cssTemplate;
  };
  const genGridSubformScopedCSS = function(formConfig2, vue3Flag = false) {
    const cssTemplate = ` 
  .sub-form-container {
    ${vue3Flag ? `:deep( div.grid-sub-form.sub-form-row)` : `::v-deep  div.grid-sub-form.sub-form-row`} {
      display:flex;
      align-items: center;
      border: 1px solid #e1e2e3;
    }
  }

  div.grid-sub-form.action-header-column {
    width: 100%;
  }


  div.grid-sub-form.sub-form-action-column {
    display: inline-block;
    align-items: center;
    justify-content: initial;
    text-align: center;
    border:initial;
    .action-button-column{
      display:flex;
      justify-content:space-between;

      .row-number-span{
        line-height:30px;
      }
    }
  }

  div.grid-sub-form.grid-sub-form-data-row {
    display: inline-block;
    width: 100%;
    border-left: 1px solid #e1e2e3;
    border-right: 1px solid #e1e2e3;
  }
  `;
    return cssTemplate;
  };
  const registerCWGenerator = function(containerType, ctGenerator) {
    containerTemplates[containerType] = ctGenerator;
  };
  const registerFWGenerator = function(fieldType, ftGenerator) {
    elTemplates[fieldType] = ftGenerator;
  };
  const genSFC = function(formConfig2, widgetList2, beautifier2, vue3Flag = false) {
    const html = beautifier2.html(genTemplate(formConfig2, widgetList2, vue3Flag), beautifierOpts.html);
    const js = beautifier2.js(!!vue3Flag ? genVue3JS(formConfig2, widgetList2) : genVue2JS(formConfig2, widgetList2), beautifierOpts.js);
    const globalCss = beautifier2.css(genGlobalCSS(formConfig2), beautifierOpts.css);
    const scopedCss = beautifier2.css(genScopedCSS(formConfig2, vue3Flag), beautifierOpts.css);
    let scopedSubformCss = "";
    let scopedGridSubformCss = "";
    let widget = widgetList2.find((x) => x.type === "sub-form");
    if (widget) {
      scopedSubformCss = beautifier2.css(genSubformScopedCSS(formConfig2, vue3Flag), beautifierOpts.css);
    }
    widget = widgetList2.find((x) => x.type === "grid-sub-form");
    if (widget) {
      scopedSubformCss = beautifier2.css(genSubformScopedCSS(formConfig2, vue3Flag), beautifierOpts.css);
      scopedGridSubformCss = beautifier2.css(genGridSubformScopedCSS(formConfig2, vue3Flag), beautifierOpts.css);
    }
    return `<!-- 
Codes Generated By VForm:
https://www.vform666.com
-->

<template>
${html}
</template>

<script>
${js}
<\/script>

<style lang="scss">
${globalCss}
</style>

<style lang="scss" scoped>
${scopedCss}
${scopedSubformCss}
${scopedGridSubformCss}
</style>`;
  };
  var FileSaver_min = { exports: {} };
  (function(module2, exports2) {
    (function(a, b) {
      b();
    })(commonjsGlobal, function() {
      function b(a2, b2) {
        return typeof b2 == "undefined" ? b2 = { autoBom: false } : typeof b2 != "object" && (console.warn("Deprecated: Expected third argument to be a object"), b2 = { autoBom: !b2 }), b2.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type) ? new Blob(["\uFEFF", a2], { type: a2.type }) : a2;
      }
      function c(a2, b2, c2) {
        var d2 = new XMLHttpRequest();
        d2.open("GET", a2), d2.responseType = "blob", d2.onload = function() {
          g(d2.response, b2, c2);
        }, d2.onerror = function() {
          console.error("could not download file");
        }, d2.send();
      }
      function d(a2) {
        var b2 = new XMLHttpRequest();
        b2.open("HEAD", a2, false);
        try {
          b2.send();
        } catch (a3) {
        }
        return 200 <= b2.status && 299 >= b2.status;
      }
      function e(a2) {
        try {
          a2.dispatchEvent(new MouseEvent("click"));
        } catch (c2) {
          var b2 = document.createEvent("MouseEvents");
          b2.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null), a2.dispatchEvent(b2);
        }
      }
      var f = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof commonjsGlobal == "object" && commonjsGlobal.global === commonjsGlobal ? commonjsGlobal : void 0, a = f.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), g = f.saveAs || (typeof window != "object" || window !== f ? function() {
      } : "download" in HTMLAnchorElement.prototype && !a ? function(b2, g2, h) {
        var i2 = f.URL || f.webkitURL, j = document.createElement("a");
        g2 = g2 || b2.name || "download", j.download = g2, j.rel = "noopener", typeof b2 == "string" ? (j.href = b2, j.origin === location.origin ? e(j) : d(j.href) ? c(b2, g2, h) : e(j, j.target = "_blank")) : (j.href = i2.createObjectURL(b2), setTimeout(function() {
          i2.revokeObjectURL(j.href);
        }, 4e4), setTimeout(function() {
          e(j);
        }, 0));
      } : "msSaveOrOpenBlob" in navigator ? function(f2, g2, h) {
        if (g2 = g2 || f2.name || "download", typeof f2 != "string")
          navigator.msSaveOrOpenBlob(b(f2, h), g2);
        else if (d(f2))
          c(f2, g2, h);
        else {
          var i2 = document.createElement("a");
          i2.href = f2, i2.target = "_blank", setTimeout(function() {
            e(i2);
          });
        }
      } : function(b2, d2, e2, g2) {
        if (g2 = g2 || open("", "_blank"), g2 && (g2.document.title = g2.document.body.innerText = "downloading..."), typeof b2 == "string")
          return c(b2, d2, e2);
        var h = b2.type === "application/octet-stream", i2 = /constructor/i.test(f.HTMLElement) || f.safari, j = /CriOS\/[\d]+/.test(navigator.userAgent);
        if ((j || h && i2 || a) && typeof FileReader != "undefined") {
          var k = new FileReader();
          k.onloadend = function() {
            var a2 = k.result;
            a2 = j ? a2 : a2.replace(/^data:[^;]*;/, "data:attachment/file;"), g2 ? g2.location.href = a2 : location = a2, g2 = null;
          }, k.readAsDataURL(b2);
        } else {
          var l = f.URL || f.webkitURL, m = l.createObjectURL(b2);
          g2 ? g2.location = m : location.href = m, g2 = null, setTimeout(function() {
            l.revokeObjectURL(m);
          }, 4e4);
        }
      });
      f.saveAs = g.saveAs = g, module2.exports = g;
    });
  })(FileSaver_min);
  var index_vue_vue_type_style_index_0_scoped_true_lang$4 = "";
  const _sfc_main$3L = {
    name: "ToolbarPanel",
    mixins: [i18n$1],
    components: {
      VFormRender,
      CodeEditor,
      SvgIcon,
      Clipboard
    },
    props: {
      designer: Object,
      globalDsv: {
        type: Object,
        default: () => ({})
      }
    },
    inject: ["getDesignerConfig", "getTestOptionData"],
    data() {
      return {
        formJson: {},
        designerConfig: this.getDesignerConfig(),
        toolbarWidth: 450,
        showPreviewDialogFlag: false,
        showImportJsonDialogFlag: false,
        showExportJsonDialogFlag: false,
        showExportCodeDialogFlag: false,
        showFormDataDialogFlag: false,
        showExportSFCDialogFlag: false,
        showNodeTreeDrawerFlag: false,
        nodeTreeData: [],
        formReadonlyFlag: false,
        importTemplate: "",
        jsonContent: "",
        jsonRawContent: "",
        formDataJson: "",
        formDataRawJson: "",
        vueCode: "",
        htmlCode: "",
        sfcCode: "",
        sfcCodeV3: "",
        activeCodeTab: "vue",
        activeSFCTab: "vue2",
        testFormData: {
          "select62173": 2
        }
      };
    },
    computed: {
      undoDisabled() {
        return !this.designer.undoEnabled();
      },
      redoDisabled() {
        return !this.designer.redoEnabled();
      },
      layoutType() {
        return this.designer.getLayoutType();
      },
      designerDsv() {
        return this.globalDsv;
      },
      testOptionData() {
        return this.getTestOptionData();
      },
      showLayoutTypeButton() {
        if (this.designerConfig["layoutTypeButton"] === void 0) {
          return true;
        }
        return !!this.designerConfig["layoutTypeButton"];
      }
    },
    watch: {
      "designer.widgetList": {
        deep: true,
        handler(val) {
        }
      }
    },
    mounted() {
    },
    methods: {
      showToolButton(configName) {
        if (this.designerConfig[configName] === void 0) {
          return true;
        }
        return !!this.designerConfig[configName];
      },
      buildTreeNodeOfWidget(widget, treeNode) {
        let curNode = {
          id: widget.id,
          label: widget.options.label || widget.type,
          type: widget.type
        };
        treeNode.push(curNode);
        if (widget.category === void 0) {
          return;
        }
        curNode.children = [];
        if (widget.type === "grid") {
          widget.cols.map((col) => {
            let colNode = {
              id: col.id,
              label: col.options.name || widget.type,
              type: widget.type,
              children: []
            };
            curNode.children.push(colNode);
            col.widgetList.map((wChild) => {
              this.buildTreeNodeOfWidget(wChild, colNode.children);
            });
          });
        } else if (widget.type === "table") {
          widget.rows.map((row) => {
            let rowNode = {
              id: row.id,
              label: "table-row",
              type: widget.type,
              selectable: false,
              children: []
            };
            curNode.children.push(rowNode);
            row.cols.map((cell) => {
              if (!!cell.merged) {
                return;
              }
              let rowChildren = rowNode.children;
              let cellNode = {
                id: cell.id,
                label: "table-cell",
                type: cell.type,
                children: []
              };
              rowChildren.push(cellNode);
              cell.widgetList.map((wChild) => {
                this.buildTreeNodeOfWidget(wChild, cellNode.children);
              });
            });
          });
        } else if (widget.type === "tab") {
          widget.tabs.map((tab) => {
            let tabNode = {
              id: tab.id,
              label: tab.options.name || widget.type,
              type: widget.type,
              selectable: false,
              children: []
            };
            curNode.children.push(tabNode);
            tab.widgetList.map((wChild) => {
              this.buildTreeNodeOfWidget(wChild, tabNode.children);
            });
          });
        } else if (widget.type === "sub-form") {
          widget.widgetList.map((wChild) => {
            this.buildTreeNodeOfWidget(wChild, curNode.children);
          });
        } else if (widget.category === "container") {
          widget.widgetList.map((wChild) => {
            this.buildTreeNodeOfWidget(wChild, curNode.children);
          });
        }
      },
      refreshNodeTree() {
        this.nodeTreeData.length = 0;
        this.designer.widgetList.forEach((wItem) => {
          this.buildTreeNodeOfWidget(wItem, this.nodeTreeData);
        });
      },
      showNodeTreeDrawer() {
        this.refreshNodeTree();
        this.showNodeTreeDrawerFlag = true;
        this.$nextTick(() => {
          if (!!this.designer.selectedId) {
            this.$refs.nodeTree.setCurrentKey(this.designer.selectedId);
          }
        });
      },
      undoHistory() {
        this.designer.undoHistoryStep();
        this.designer.emitEvent("canvas-undo", null);
      },
      redoHistory() {
        this.designer.redoHistoryStep();
        this.designer.emitEvent("canvas-redo", null);
      },
      changeLayoutType(newType) {
        this.designer.changeLayoutType(newType);
      },
      clearFormWidget() {
        this.designer.clearDesigner();
        this.designer.formWidget.clearWidgetRefList();
        this.designer.emitEvent("form-json-imported", []);
      },
      previewForm() {
        this.formJson.widgetList = deepClone(this.designer.widgetList);
        this.formJson.formConfig = deepClone(this.designer.formConfig);
        this.showPreviewDialogFlag = true;
      },
      saveAsFile(fileContent, defaultFileName) {
        this.$prompt(this.i18nt("designer.hint.fileNameForSave"), this.i18nt("designer.hint.saveFileTitle"), {
          inputValue: defaultFileName,
          closeOnClickModal: false,
          inputPlaceholder: this.i18nt("designer.hint.fileNameInputPlaceholder")
        }).then(({ value: value2 }) => {
          if (!value2) {
            value2 = defaultFileName;
          }
          if (getQueryParam("vscode") == 1) {
            this.vsSaveFile(value2, fileContent);
            return;
          }
          const fileBlob = new Blob([fileContent], { type: "text/plain;charset=utf-8" });
          FileSaver_min.exports.saveAs(fileBlob, value2);
        }).catch(() => {
        });
      },
      vsSaveFile(fileName, fileContent) {
        const msgObj = {
          cmd: "writeFile",
          data: {
            fileName,
            code: fileContent
          }
        };
        window.parent.postMessage(msgObj, "*");
      },
      importJson() {
        this.importTemplate = JSON.stringify(this.designer.getImportTemplate(), null, "  ");
        this.showImportJsonDialogFlag = true;
      },
      doJsonImport() {
        try {
          let importObj = JSON.parse(this.importTemplate);
          if (!importObj || !importObj.formConfig) {
            throw new Error(this.i18nt("designer.hint.invalidJsonFormat"));
          }
          let fJsonVer = importObj.formConfig.jsonVersion;
          if (!fJsonVer || fJsonVer !== 3) {
            throw new Error(this.i18nt("designer.hint.jsonVersionMismatch"));
          }
          this.designer.loadFormJson(importObj);
          this.showImportJsonDialogFlag = false;
          this.$message.success(this.i18nt("designer.hint.importJsonSuccess"));
          this.designer.emitHistoryChange();
        } catch (ex) {
          this.$message.error(ex + "");
        }
      },
      exportJson() {
        let widgetList2 = deepClone(this.designer.widgetList);
        let formConfig2 = deepClone(this.designer.formConfig);
        this.jsonContent = JSON.stringify({ widgetList: widgetList2, formConfig: formConfig2 }, null, "  ");
        this.jsonRawContent = JSON.stringify({ widgetList: widgetList2, formConfig: formConfig2 });
        this.showExportJsonDialogFlag = true;
      },
      copyFormJson(e) {
        copyToClipboard(this.jsonRawContent, e, this.$message, this.i18nt("designer.hint.copyJsonSuccess"), this.i18nt("designer.hint.copyJsonFail"));
      },
      saveFormJson() {
        this.saveAsFile(this.jsonContent, `vform${generateId()}.json`);
      },
      exportCode() {
        this.formJson.widgetList = deepClone(this.designer.widgetList);
        this.formJson.formConfig = deepClone(this.designer.formConfig);
        this.vueCode = generateCode(this.formJson);
        this.htmlCode = generateCode(this.formJson, "html");
        this.showExportCodeDialogFlag = true;
      },
      copyVueCode(e) {
        copyToClipboard(this.vueCode, e, this.$message, this.i18nt("designer.hint.copyVueCodeSuccess"), this.i18nt("designer.hint.copyVueCodeFail"));
      },
      copyHtmlCode(e) {
        copyToClipboard(this.htmlCode, e, this.$message, this.i18nt("designer.hint.copyHtmlCodeSuccess"), this.i18nt("designer.hint.copyHtmlCodeFail"));
      },
      saveVueCode() {
        this.saveAsFile(this.vueCode, `vform${generateId()}.vue`);
      },
      saveHtmlCode() {
        this.saveAsFile(this.htmlCode, `vform${generateId()}.html`);
      },
      generateSFC() {
        loadBeautifier((beautifier2) => {
          this.sfcCode = genSFC(this.designer.formConfig, this.designer.widgetList, beautifier2);
          this.sfcCodeV3 = genSFC(this.designer.formConfig, this.designer.widgetList, beautifier2, true);
          this.showExportSFCDialogFlag = true;
        });
      },
      copyV2SFC(e) {
        copyToClipboard(this.sfcCode, e, this.$message, this.i18nt("designer.hint.copySFCSuccess"), this.i18nt("designer.hint.copySFCFail"));
      },
      copyV3SFC(e) {
        copyToClipboard(this.sfcCodeV3, e, this.$message, this.i18nt("designer.hint.copySFCSuccess"), this.i18nt("designer.hint.copySFCFail"));
      },
      saveV2SFC() {
        this.saveAsFile(this.sfcCode, `vformV2-${generateId()}.vue`);
      },
      saveV3SFC() {
        this.saveAsFile(this.sfcCodeV3, `vformV3-${generateId()}.vue`);
      },
      getFormData() {
        this.$refs["preForm"].getFormData().then((formData) => {
          this.formDataJson = JSON.stringify(formData, null, "  ");
          this.formDataRawJson = JSON.stringify(formData);
          this.showFormDataDialogFlag = true;
        }).catch((error2) => {
          this.$message.error(error2);
        });
      },
      copyFormDataJson(e) {
        copyToClipboard(this.formDataRawJson, e, this.$message, this.i18nt("designer.hint.copyJsonSuccess"), this.i18nt("designer.hint.copyJsonFail"));
      },
      saveFormData() {
        this.saveAsFile(this.formDataJson, `formData${generateId()}.json`);
      },
      resetForm() {
        this.$refs["preForm"].resetForm();
      },
      setFormDisabled() {
        this.$refs["preForm"].disableForm();
      },
      setFormEnabled() {
        this.$refs["preForm"].enableForm();
      },
      switchReadMode() {
        this.formReadonlyFlag = !this.formReadonlyFlag;
        this.$refs["preForm"].setReadMode(this.formReadonlyFlag);
      },
      testSetFormJson() {
        let newJson = { "widgetList": [{ "key": 75094, "type": "input", "icon": "text-field", "formItemFlag": true, "options": { "name": "input30696", "label": "input", "labelAlign": "", "type": "text", "defaultValue": "", "placeholder": "", "columnWidth": "200px", "size": "", "labelWidth": null, "labelHidden": false, "readonly": false, "disabled": false, "hidden": false, "clearable": true, "showPassword": false, "required": false, "validation": "", "validationHint": "", "customClass": [], "labelIconClass": null, "labelIconPosition": "rear", "labelTooltip": null, "minLength": null, "maxLength": null, "showWordLimit": false, "prefixIcon": "", "suffixIcon": "", "appendButton": false, "appendButtonDisabled": false, "buttonIcon": "custom-search", "onCreated": "", "onMounted": "", "onInput": "", "onChange": "", "onFocus": "", "onBlur": "", "onValidate": "" }, "id": "input30696" }], "formConfig": { "modelName": "formData", "refName": "vForm", "rulesName": "rules", "labelWidth": 120, "labelPosition": "left", "size": "", "labelAlign": "label-left-align", "cssCode": "", "customClass": "", "functions": "", "layoutType": "PC", "jsonVersion": 3, "onFormCreated": "", "onFormMounted": "", "onFormDataChange": "" } };
        this.$refs["preForm"].setFormJson(newJson);
      },
      testSubFormHide() {
        this.$refs["preForm"].hideWidgets("input73220");
      },
      testSetFormData() {
        let testFormData = {
          "picTest01": [
            {
              "name": "QQ\u6D4F\u89C8\u5668\u622A\u56FE20200730103242.png",
              "url": "http://image-2021.test.upcdn.net/QQ\u6D4F\u89C8\u5668\u622A\u56FE20200730103242.png"
            },
            {
              "name": "QQ\u6D4F\u89C8\u5668\u622A\u56FE20201218155618.jpg",
              "url": "http://image-2021.test.upcdn.net/QQ\u6D4F\u89C8\u5668\u622A\u56FE20201218155618.jpg"
            }
          ],
          "fileTest01": [
            {
              "name": "\u5409\u6797\u5927\u5B662019-2020\u300A\u516C\u6587\u5199\u4F5C\u300B\u5927\u4F5C\u4E1A.doc",
              "url": "http://image-2021.test.upcdn.net/\u5409\u6797\u5927\u5B662019-2020\u300A\u516C\u6587\u5199\u4F5C\u300B\u5927\u4F5C\u4E1A.doc"
            },
            {
              "name": "\u8D44\u6E90\u5305\u62B5\u6263\u660E\u7EC6.xlsx",
              "url": "http://image-2021.test.upcdn.net/\u8D44\u6E90\u5305\u62B5\u6263\u660E\u7EC6.xlsx"
            }
          ]
        };
        this.$refs["preForm"].setFormData(testFormData);
      },
      handleFormChange(fieldName, newValue, oldValue, formModel) {
      },
      testOnAppendButtonClick(clickedWidget) {
        console.log("test", clickedWidget);
      },
      testOnButtonClick(button) {
        console.log("test", button);
      },
      testDTSC(dt, s1, s2) {
      },
      testOBC(aa) {
        console.log("test=====", aa);
      },
      onMyEmitTest(aaa) {
        console.log("test emit", aaa);
      },
      findWidgetById(wId) {
        let foundW = null;
        traverseAllWidgets(this.designer.widgetList, (w) => {
          if (w.id === wId) {
            foundW = w;
          }
        });
        return foundW;
      },
      onNodeTreeClick(nodeData, node, nodeEl) {
        if (nodeData.selectable !== void 0 && !nodeData.selectable) {
          this.$message.info(this.i18nt("designer.hint.currentNodeCannotBeSelected"));
        } else {
          const selectedId = nodeData.id;
          const foundW = this.findWidgetById(selectedId);
          if (!!foundW) {
            this.designer.setSelected(foundW);
          }
        }
      }
    }
  };
  const _withScopeId$5 = (n) => (require$$0$1.pushScopeId("data-v-080be1d0"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$u = { class: "toolbar-container" };
  const _hoisted_2$g = { class: "left-toolbar" };
  const _hoisted_3$c = { class: "right-toolbar" };
  const _hoisted_4$b = { class: "right-toolbar-con" };
  const _hoisted_5$9 = {
    key: 0,
    class: ""
  };
  const _hoisted_6$9 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", null, "test1", -1));
  const _hoisted_7$6 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", null, "test2", -1));
  const _hoisted_8$6 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", null, "test3", -1));
  const _hoisted_9$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", null, "test4", -1));
  const _hoisted_10$5 = /* @__PURE__ */ _withScopeId$5(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", null, "test5", -1));
  const _hoisted_11$4 = { class: "dialog-footer" };
  const _hoisted_12$3 = {
    key: 1,
    class: ""
  };
  const _hoisted_13$3 = { class: "dialog-footer" };
  const _hoisted_14$2 = {
    key: 2,
    class: ""
  };
  const _hoisted_15$1 = { class: "dialog-footer" };
  const _hoisted_16$1 = {
    key: 3,
    class: ""
  };
  const _hoisted_17$1 = { class: "dialog-footer" };
  const _hoisted_18$1 = {
    key: 4,
    class: ""
  };
  const _hoisted_19$1 = { style: { "border": "1px solid #DCDFE6" } };
  const _hoisted_20 = { class: "dialog-footer" };
  const _hoisted_21 = {
    key: 5,
    class: ""
  };
  const _hoisted_22 = { class: "dialog-footer" };
  function _sfc_render$3L(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_el_tree = require$$0$1.resolveComponent("el-tree");
    const _component_el_drawer = require$$0$1.resolveComponent("el-drawer");
    const _component_el_scrollbar = require$$0$1.resolveComponent("el-scrollbar");
    const _component_VFormRender = require$$0$1.resolveComponent("VFormRender");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$u, [
      require$$0$1.createElementVNode("div", _hoisted_2$g, [
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          disabled: $options.undoDisabled,
          title: _ctx.i18nt("designer.toolbar.undoHint"),
          onClick: $options.undoHistory
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "undo" })
          ]),
          _: 1
        }, 8, ["disabled", "title", "onClick"]),
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          disabled: $options.redoDisabled,
          title: _ctx.i18nt("designer.toolbar.redoHint"),
          onClick: $options.redoHistory
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "redo" })
          ]),
          _: 1
        }, 8, ["disabled", "title", "onClick"]),
        $options.showLayoutTypeButton ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button_group, {
          key: 0,
          style: { "margin-left": "20px" }
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_button, {
              type: $options.layoutType === "PC" ? "info" : "",
              onClick: _cache[0] || (_cache[0] = ($event) => $options.changeLayoutType("PC"))
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.pcLayout")), 1)
              ]),
              _: 1
            }, 8, ["type"]),
            require$$0$1.createVNode(_component_el_button, {
              type: $options.layoutType === "Pad" ? "info" : "",
              onClick: _cache[1] || (_cache[1] = ($event) => $options.changeLayoutType("Pad"))
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.padLayout")), 1)
              ]),
              _: 1
            }, 8, ["type"]),
            require$$0$1.createVNode(_component_el_button, {
              type: $options.layoutType === "H5" ? "info" : "",
              onClick: _cache[2] || (_cache[2] = ($event) => $options.changeLayoutType("H5"))
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.mobileLayout")), 1)
              ]),
              _: 1
            }, 8, ["type"])
          ]),
          _: 1
        })) : require$$0$1.createCommentVNode("", true),
        require$$0$1.createVNode(_component_el_button, {
          style: { "margin-left": "20px" },
          title: _ctx.i18nt("designer.toolbar.nodeTreeHint"),
          onClick: $options.showNodeTreeDrawer
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "node-tree" })
          ]),
          _: 1
        }, 8, ["title", "onClick"])
      ]),
      require$$0$1.createVNode(_component_el_drawer, {
        title: _ctx.i18nt("designer.toolbar.nodeTreeTitle"),
        direction: "ltr",
        modelValue: $data.showNodeTreeDrawerFlag,
        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.showNodeTreeDrawerFlag = $event),
        modal: true,
        size: 280,
        "append-to-body": "",
        "destroy-on-close": true,
        class: "node-tree-drawer"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_tree, {
            ref: "nodeTree",
            data: $data.nodeTreeData,
            "node-key": "id",
            "default-expand-all": "",
            "highlight-current": "",
            class: "node-tree",
            "icon-class": "el-icon-arrow-right",
            onNodeClick: $options.onNodeTreeClick
          }, null, 8, ["data", "onNodeClick"])
        ]),
        _: 1
      }, 8, ["title", "modelValue"]),
      require$$0$1.createElementVNode("div", _hoisted_3$c, [
        require$$0$1.createVNode(_component_el_scrollbar, null, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_4$b, [
              $options.showToolButton("clearDesignerButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 0,
                link: "",
                type: "primary",
                onClick: $options.clearFormWidget
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" }),
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.clear")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              $options.showToolButton("previewFormButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 1,
                link: "",
                type: "primary",
                onClick: $options.previewForm
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-view" }),
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.preview")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              $options.showToolButton("importJsonButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 2,
                link: "",
                type: "primary",
                onClick: $options.importJson
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.importJson")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              $options.showToolButton("exportJsonButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 3,
                link: "",
                type: "primary",
                onClick: $options.exportJson
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.exportJson")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              $options.showToolButton("exportCodeButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 4,
                link: "",
                type: "primary",
                onClick: $options.exportCode
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.exportCode")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              $options.showToolButton("generateSFCButton") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                key: 5,
                link: "",
                type: "primary",
                onClick: $options.generateSFC
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_svg_icon, { "icon-class": "vue-sfc" }),
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.generateSFC")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])) : require$$0$1.createCommentVNode("", true),
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(_ctx.$slots, (idx, slotName) => {
                return require$$0$1.renderSlot(_ctx.$slots, slotName, {}, void 0, true);
              }), 256))
            ])
          ]),
          _: 3
        })
      ]),
      $data.showPreviewDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_5$9, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.toolbar.preview"),
          modelValue: $data.showPreviewDialogFlag,
          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.showPreviewDialogFlag = $event),
          "show-close": true,
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          center: "",
          "destroy-on-close": true,
          "append-to-body": true,
          class: "drag-dialog small-padding-dialog vf-preview-dialog",
          width: "75%",
          fullscreen: $options.layoutType === "H5" || $options.layoutType === "Pad"
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_11$4, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.getFormData
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.getFormData")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.resetForm
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.resetForm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.setFormDisabled
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.disableForm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.setFormEnabled
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.enableForm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                plain: "",
                onClick: $options.switchReadMode
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.switchReadMode")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[4] || (_cache[4] = ($event) => $data.showPreviewDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createCommentVNode("", true),
              require$$0$1.createCommentVNode("", true),
              require$$0$1.createCommentVNode("", true)
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", null, [
              require$$0$1.createElementVNode("div", {
                class: require$$0$1.normalizeClass(["form-render-wrapper", [$options.layoutType === "H5" ? "h5-layout" : $options.layoutType === "Pad" ? "pad-layout" : ""]])
              }, [
                require$$0$1.createVNode(_component_VFormRender, {
                  ref: "preForm",
                  "form-json": $data.formJson,
                  "form-data": $data.testFormData,
                  "preview-state": true,
                  "option-data": $options.testOptionData,
                  "global-dsv": $options.designerDsv,
                  onAppendButtonClick: $options.testOnAppendButtonClick,
                  onButtonClick: $options.testOnButtonClick,
                  onDataTableSelectionChange: $options.testDTSC,
                  onOperationButtonClick: $options.testOBC,
                  onMyEmitTest: $options.onMyEmitTest,
                  onFormChange: $options.handleFormChange
                }, {
                  slot1: require$$0$1.withCtx(() => [
                    _hoisted_6$9
                  ]),
                  slot2: require$$0$1.withCtx(() => [
                    _hoisted_7$6
                  ]),
                  slot3: require$$0$1.withCtx(() => [
                    _hoisted_8$6
                  ]),
                  slot4: require$$0$1.withCtx(() => [
                    _hoisted_9$5
                  ]),
                  slot5: require$$0$1.withCtx(() => [
                    _hoisted_10$5
                  ]),
                  _: 1
                }, 8, ["form-json", "form-data", "option-data", "global-dsv", "onAppendButtonClick", "onButtonClick", "onDataTableSelectionChange", "onOperationButtonClick", "onMyEmitTest", "onFormChange"])
              ], 2)
            ])
          ]),
          _: 1
        }, 8, ["title", "modelValue", "fullscreen"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showImportJsonDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_12$3, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.toolbar.importJson"),
          modelValue: $data.showImportJsonDialogFlag,
          "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.showImportJsonDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": true,
          center: "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_13$3, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.doJsonImport
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.import")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[7] || (_cache[7] = ($event) => $data.showImportJsonDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              title: _ctx.i18nt("designer.hint.importJsonHint"),
              "show-icon": "",
              class: "alert-padding"
            }, null, 8, ["title"]),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: false,
              modelValue: $data.importTemplate,
              "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.importTemplate = $event)
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showExportJsonDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_14$2, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.toolbar.exportJson"),
          modelValue: $data.showExportJsonDialogFlag,
          "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.showExportJsonDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          center: "",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_15$1, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-json-btn",
                "data-clipboard-text": $data.jsonRawContent,
                onClick: $options.copyFormJson
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyJson")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveFormJson }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveFormJson")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[10] || (_cache[10] = ($event) => $data.showExportJsonDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: true,
              modelValue: $data.jsonContent,
              "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.jsonContent = $event)
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showExportCodeDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_16$1, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.toolbar.exportCode"),
          modelValue: $data.showExportCodeDialogFlag,
          "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.showExportCodeDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          center: "",
          "append-to-body": "",
          width: "65%",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_17$1, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-vue-btn",
                "data-clipboard-text": $data.vueCode,
                onClick: $options.copyVueCode
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyVueCode")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-html-btn",
                "data-clipboard-text": $data.htmlCode,
                onClick: $options.copyHtmlCode
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyHtmlCode")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveVueCode }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveVueCode")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveHtmlCode }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveHtmlCode")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[15] || (_cache[15] = ($event) => $data.showExportCodeDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_tabs, {
              type: "border-card",
              class: "no-box-shadow no-padding",
              modelValue: $data.activeCodeTab,
              "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.activeCodeTab = $event)
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: "Vue",
                  name: "vue"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_code_editor, {
                      mode: "html",
                      readonly: true,
                      modelValue: $data.vueCode,
                      "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.vueCode = $event),
                      "user-worker": false
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: "HTML",
                  name: "html"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_code_editor, {
                      mode: "html",
                      readonly: true,
                      modelValue: $data.htmlCode,
                      "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $data.htmlCode = $event),
                      "user-worker": false
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showFormDataDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_18$1, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.hint.exportFormData"),
          modelValue: $data.showFormDataDialogFlag,
          "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.showFormDataDialogFlag = $event),
          "show-close": true,
          class: "nested-drag-dialog dialog-title-light-bg",
          center: "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true,
          "append-to-body": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_20, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-form-data-json-btn",
                "data-clipboard-text": $data.formDataRawJson,
                onClick: $options.copyFormDataJson
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyFormData")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveFormData }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveFormData")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[18] || (_cache[18] = ($event) => $data.showFormDataDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_19$1, [
              require$$0$1.createVNode(_component_code_editor, {
                mode: "json",
                readonly: true,
                modelValue: $data.formDataJson,
                "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.formDataJson = $event)
              }, null, 8, ["modelValue"])
            ])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".nested-drag-dialog.el-dialog", ".nested-drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showExportSFCDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_21, [
        $data.showExportSFCDialogFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_dialog, {
          key: 0,
          title: _ctx.i18nt("designer.toolbar.generateSFC"),
          modelValue: $data.showExportSFCDialogFlag,
          "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $data.showExportSFCDialogFlag = $event),
          "append-to-body": "",
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          center: "",
          width: "65%",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_22, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-vue2-sfc-btn",
                "data-clipboard-text": $data.sfcCode,
                onClick: $options.copyV2SFC
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyVue2SFC")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-vue3-sfc-btn",
                "data-clipboard-text": $data.sfcCodeV3,
                onClick: $options.copyV3SFC
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyVue3SFC")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveV2SFC }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveVue2SFC")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, { onClick: $options.saveV3SFC }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.saveVue3SFC")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[23] || (_cache[23] = ($event) => $data.showExportSFCDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_tabs, {
              type: "border-card",
              class: "no-box-shadow no-padding",
              modelValue: $data.activeSFCTab,
              "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.activeSFCTab = $event)
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: "Vue2",
                  name: "vue2"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_code_editor, {
                      mode: "html",
                      readonly: true,
                      modelValue: $data.sfcCode,
                      "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.sfcCode = $event),
                      "user-worker": false
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: "Vue3",
                  name: "vue3"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_code_editor, {
                      mode: "html",
                      readonly: true,
                      modelValue: $data.sfcCodeV3,
                      "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.sfcCodeV3 = $event),
                      "user-worker": false
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])) : require$$0$1.createCommentVNode("", true)
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var ToolbarPanel = /* @__PURE__ */ _export_sfc(_sfc_main$3L, [["render", _sfc_render$3L], ["__scopeId", "data-v-080be1d0"]]);
  var actionColumnPositionEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3K = {
    name: "actionColumnPosition-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      noLabelSetting() {
        return this.selectedWidget.type === "static-text" || this.selectedWidget.type === "html-text";
      }
    }
  };
  function _sfc_render$3K(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.actionColumnPosition")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.actionColumnPosition,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.actionColumnPosition = $event),
          class: "radio-group-custom"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio_button, { label: "left" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "right" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var actionColumnPositionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3K, [["render", _sfc_render$3K], ["__scopeId", "data-v-656de765"]]);
  var __glob_0_0$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": actionColumnPositionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var propertyMixin = {
    methods: {
      hasConfig(configName) {
        if (!this.designer || !this.designer.selectedWidget) {
          return false;
        }
        return this.designer.hasConfig(this.selectedWidget, configName);
      },
      emitDefaultValueChange() {
        if (!!this.designer) {
          if (!!this.designer.formWidget) {
            let fieldWidget2 = this.designer.formWidget.getWidgetRef(this.designer.selectedWidget.options.name);
            if (!!fieldWidget2 && !!fieldWidget2.refreshDefaultValue) {
              fieldWidget2.refreshDefaultValue();
            }
          }
        }
      },
      inputNumberHandler(value2) {
        value2 = value2.replace(/[^0-9]/gi, "");
      },
      onRemoteChange(val) {
        if (!!val) {
          this.optionModel.filterable = true;
        }
      },
      onAllowCreateChange(val) {
        if (!!val) {
          this.optionModel.filterable = true;
        }
      },
      onMultipleSelected(val) {
        if (val) {
          let foundRef = this.designer.formWidget.getWidgetRef(this.optionModel.name);
          if (!!foundRef && !!foundRef.clearSelectedOptions) {
            foundRef.clearSelectedOptions();
          }
          this.optionModel.defaultValue = [];
        } else {
          if (!!this.optionModel.defaultValue && this.optionModel.defaultValue.length > 0) {
            this.optionModel.defaultValue = this.optionModel.defaultValue[0];
          } else {
            this.optionModel.defaultValue = "";
          }
        }
        const selectWidget2 = this.designer.formWidget.getSelectedWidgetRef();
        if (selectWidget2 && selectWidget2.refreshWidgetKey) {
          selectWidget2.refreshWidgetKey();
        }
      }
    }
  };
  const _sfc_main$3J = {
    name: "allowCreate-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3J(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.allowCreate")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.allowCreate,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.allowCreate = $event),
          onChange: _ctx.onAllowCreateChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var allowCreateEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3J, [["render", _sfc_render$3J]]);
  var __glob_0_1$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": allowCreateEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3I = {
    name: "appendButton-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3I(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_divider, { class: "custom-divider" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.inputButton")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.appendButton")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.appendButton,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.appendButton = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_form_item, { label: "\u5173\u8054\u5217\u8868/\u8868\u5355\u7F16\u7801" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.appendButtonClickFormCode,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.appendButtonClickFormCode = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 512), [
        [require$$0$1.vShow, $props.optionModel.appendButton]
      ]),
      require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_form_item, { label: "\u56DE\u8C03\u53D6\u503C" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.appendButtonClickBreakData,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.optionModel.appendButtonClickBreakData = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 512), [
        [require$$0$1.vShow, $props.optionModel.appendButton]
      ]),
      require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_form_item, { label: "\u56DE\u8C03\u8D4B\u503C" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.appendButtonClickBreakSetData,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.optionModel.appendButtonClickBreakSetData = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 512), [
        [require$$0$1.vShow, $props.optionModel.appendButton]
      ]),
      require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_form_item, { label: "\u662F\u5426\u591A\u9009" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.checkMany,
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $props.optionModel.checkMany = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 512), [
        [require$$0$1.vShow, $props.optionModel.appendButton]
      ])
    ]);
  }
  var appendButtonEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3I, [["render", _sfc_render$3I]]);
  var __glob_0_2$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": appendButtonEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3H = {
    name: "appendButtonDisabled-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3H(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.appendButtonDisabled")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.appendButtonDisabled,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.appendButtonDisabled = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var appendButtonDisabledEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3H, [["render", _sfc_render$3H]]);
  var __glob_0_3$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": appendButtonDisabledEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3G = {
    name: "autoFullWidth-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3G(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.autoFullWidth")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.autoFullWidth,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.autoFullWidth = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var autoFullWidthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3G, [["render", _sfc_render$3G]]);
  var __glob_0_4$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": autoFullWidthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3F = {
    name: "automaticDropdown-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3F(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.automaticDropdown")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.automaticDropdown,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.automaticDropdown = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var automaticDropdownEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3F, [["render", _sfc_render$3F]]);
  var __glob_0_5$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": automaticDropdownEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3E = {
    name: "border-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3E(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.border")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.border,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.border = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var borderEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3E, [["render", _sfc_render$3E]]);
  var __glob_0_6$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": borderEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const eleIcons = [];
  function registerIcon(app) {
    app.component("el-icon-edit", ElementPlusIconsVue.Edit);
    app.component("el-icon-minus", ElementPlusIconsVue.Minus);
    app.component("el-icon-plus", ElementPlusIconsVue.Plus);
    app.component("el-icon-info", ElementPlusIconsVue.InfoFilled);
    app.component("el-icon-search", ElementPlusIconsVue.Search);
    app.component("el-icon-circle-plus-outline", ElementPlusIconsVue.CirclePlus);
    app.component("el-icon-delete", ElementPlusIconsVue.Delete);
    app.component("el-icon-arrow-down", ElementPlusIconsVue.ArrowDown);
    app.component("el-icon-arrow-up", ElementPlusIconsVue.ArrowUp);
    app.component("el-icon-bottom", ElementPlusIconsVue.Bottom);
    app.component("el-icon-top", ElementPlusIconsVue.Top);
    app.component("el-icon-back", ElementPlusIconsVue.Back);
    app.component("el-icon-right", ElementPlusIconsVue.Right);
    app.component("el-icon-bottom-left", ElementPlusIconsVue.BottomLeft);
    app.component("el-icon-top-right", ElementPlusIconsVue.TopRight);
    for (const [key, component] of Object.entries(ElementPlusIconsVue__namespace)) {
      eleIcons.push(key);
      if (!app.component(key)) {
        app.component(key, component);
      }
    }
  }
  var index_vue_vue_type_style_index_0_scoped_true_lang$3 = "";
  const _sfc_main$3D = {
    name: "icon-picker",
    mixins: [i18n$1],
    props: ["modelValue"],
    emits: ["update:modelValue"],
    components: {
      SvgIcon
    },
    data() {
      return {
        icons: eleIcons
      };
    },
    computed: {
      currentIcon() {
        return this.modelValue || "";
      }
    },
    methods: {
      iconClick(className) {
        this.$emit("update:modelValue", className);
      },
      clearHandle() {
        this.$emit("update:modelValue", "");
      }
    }
  };
  const _withScopeId$4 = (n) => (require$$0$1.pushScopeId("data-v-5362e52e"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$t = {
    key: 0,
    class: "icon-picker-selected"
  };
  const _hoisted_2$f = { class: "clear-icon" };
  const _hoisted_3$b = ["onClick"];
  const _hoisted_4$a = /* @__PURE__ */ _withScopeId$4(() => /* @__PURE__ */ require$$0$1.createElementVNode("div", { class: "clearfix" }, null, -1));
  function _sfc_render$3D(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
      value: $props.modelValue,
      clearable: "",
      onClear: $options.clearHandle
    }, {
      prefix: require$$0$1.withCtx(() => [
        $props.modelValue !== "" && $props.modelValue != null ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_1$t, [
          require$$0$1.createVNode(_component_el_icon, { size: 16 }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($props.modelValue)))
            ]),
            _: 1
          })
        ])) : require$$0$1.createCommentVNode("", true)
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_option, {
          class: "icon-picker-option",
          value: $options.currentIcon
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", null, [
              require$$0$1.createElementVNode("ul", null, [
                require$$0$1.createElementVNode("li", _hoisted_2$f, [
                  require$$0$1.createElementVNode("span", {
                    onClick: _cache[0] || (_cache[0] = (...args) => $options.clearHandle && $options.clearHandle(...args))
                  }, require$$0$1.toDisplayString(_ctx.i18nt("designer.toolbar.clear")), 1)
                ]),
                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.icons, (iconClass) => {
                  return require$$0$1.openBlock(), require$$0$1.createElementBlock("li", {
                    key: iconClass,
                    onClick: ($event) => $options.iconClick(iconClass)
                  }, [
                    require$$0$1.createElementVNode("span", null, [
                      require$$0$1.createVNode(_component_el_icon, { size: 16 }, {
                        default: require$$0$1.withCtx(() => [
                          (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(iconClass)))
                        ]),
                        _: 2
                      }, 1024)
                    ])
                  ], 8, _hoisted_3$b);
                }), 128)),
                _hoisted_4$a
              ])
            ])
          ]),
          _: 1
        }, 8, ["value"])
      ]),
      _: 1
    }, 8, ["value", "onClear"]);
  }
  var IconPicker = /* @__PURE__ */ _export_sfc(_sfc_main$3D, [["render", _sfc_render$3D], ["__scopeId", "data-v-5362e52e"]]);
  const _sfc_main$3C = {
    name: "buttonIcon-editor",
    components: { IconPicker },
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3C(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.appendButtonIcon")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_icon_picker, {
          modelValue: $props.optionModel.buttonIcon,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.buttonIcon = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var buttonIconEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3C, [["render", _sfc_render$3C]]);
  var __glob_0_7$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonIconEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3B = {
    name: "buttonStyle-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3B(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.buttonStyle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.buttonStyle,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.buttonStyle = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var buttonStyleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3B, [["render", _sfc_render$3B]]);
  var __glob_0_8$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonStyleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3A = {
    name: "clearable-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3A(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.clearable")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.clearable,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.clearable = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var clearableEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3A, [["render", _sfc_render$3A]]);
  var __glob_0_9$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": clearableEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3z = {
    name: "columnWidth-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    inject: ["isSubFormChildWidget"]
  };
  function _sfc_render$3z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.widgetColumnWidth")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            type: "text",
            modelValue: $props.optionModel.columnWidth,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.columnWidth = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]), [
        [require$$0$1.vShow, !!$options.isSubFormChildWidget()]
      ])
    ]);
  }
  var columnWidthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3z, [["render", _sfc_render$3z]]);
  var __glob_0_10$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": columnWidthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3y = {
    name: "customClass-editor",
    componentName: "PropertyEditor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        cssClassList: []
      };
    },
    created() {
      this.cssClassList = deepClone(this.designer.getCssClassList());
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.cssClassList = cssClassList;
      });
    }
  };
  function _sfc_render$3y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.customClass")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.customClass,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.customClass = $event),
          multiple: "",
          filterable: "",
          "allow-create": "",
          "default-first-option": ""
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: idx,
                label: item,
                value: item
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var customClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3y, [["render", _sfc_render$3y]]);
  var __glob_0_11$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": customClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3x = {
    name: "defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3x(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return !_ctx.hasConfig("optionItems") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var defaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3x, [["render", _sfc_render$3x]]);
  var __glob_0_12$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": defaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3w = {
    name: "disabled-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3w(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.disabled")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.disabled,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.disabled = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var disabledEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3w, [["render", _sfc_render$3w]]);
  var __glob_0_13$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": disabledEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3v = {
    name: "displayStyle-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3v(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio = require$$0$1.resolveComponent("el-radio");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.displayStyle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.displayStyle,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.displayStyle = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio, { label: "inline" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.inlineLayout")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio, { label: "block" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.blockLayout")), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var displayStyleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3v, [["render", _sfc_render$3v]]);
  var __glob_0_14 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": displayStyleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3u = {
    name: "editable-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3u(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.editable")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.editable,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.editable = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var editableEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3u, [["render", _sfc_render$3u]]);
  var __glob_0_15 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": editableEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3t = {
    name: "endPlaceholder-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3t(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.endPlaceholder")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.endPlaceholder,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.endPlaceholder = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var endPlaceholderEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3t, [["render", _sfc_render$3t]]);
  var __glob_0_16 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": endPlaceholderEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3s = {
    name: "fileMaxSize-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3s(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.fileMaxSize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.fileMaxSize,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.fileMaxSize = $event),
          min: 1,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var fileMaxSizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3s, [["render", _sfc_render$3s]]);
  var __glob_0_17 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": fileMaxSizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3r = {
    name: "filterable-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3r(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.filterable")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.filterable,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.filterable = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var filterableEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3r, [["render", _sfc_render$3r]]);
  var __glob_0_18 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": filterableEditor
  }, Symbol.toStringTag, { value: "Module" }));
  class Stack {
    constructor(p, stack, state, reducePos, pos, score2, buffer, bufferBase, curContext, lookAhead = 0, parent) {
      this.p = p;
      this.stack = stack;
      this.state = state;
      this.reducePos = reducePos;
      this.pos = pos;
      this.score = score2;
      this.buffer = buffer;
      this.bufferBase = bufferBase;
      this.curContext = curContext;
      this.lookAhead = lookAhead;
      this.parent = parent;
    }
    toString() {
      return `[${this.stack.filter((_, i2) => i2 % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? "!" + this.score : ""}`;
    }
    static start(p, state, pos = 0) {
      let cx = p.parser.context;
      return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);
    }
    get context() {
      return this.curContext ? this.curContext.context : null;
    }
    pushState(state, start) {
      this.stack.push(this.state, start, this.bufferBase + this.buffer.length);
      this.state = state;
    }
    reduce(action) {
      var _a2;
      let depth = action >> 19, type = action & 65535;
      let { parser: parser2 } = this.p;
      let dPrec = parser2.dynamicPrecedence(type);
      if (dPrec)
        this.score += dPrec;
      if (depth == 0) {
        this.pushState(parser2.getGoto(this.state, type, true), this.reducePos);
        if (type < parser2.minRepeatTerm)
          this.storeNode(type, this.reducePos, this.reducePos, 4, true);
        this.reduceContext(type, this.reducePos);
        return;
      }
      let base2 = this.stack.length - (depth - 1) * 3 - (action & 262144 ? 6 : 0);
      let start = base2 ? this.stack[base2 - 2] : this.p.ranges[0].from, size = this.reducePos - start;
      if (size >= 2e3 && !((_a2 = this.p.parser.nodeSet.types[type]) === null || _a2 === void 0 ? void 0 : _a2.isAnonymous)) {
        if (start == this.p.lastBigReductionStart) {
          this.p.bigReductionCount++;
          this.p.lastBigReductionSize = size;
        } else if (this.p.lastBigReductionSize < size) {
          this.p.bigReductionCount = 1;
          this.p.lastBigReductionStart = start;
          this.p.lastBigReductionSize = size;
        }
      }
      let bufferBase = base2 ? this.stack[base2 - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;
      if (type < parser2.minRepeatTerm || action & 131072) {
        let pos = parser2.stateFlag(this.state, 1) ? this.pos : this.reducePos;
        this.storeNode(type, start, pos, count + 4, true);
      }
      if (action & 262144) {
        this.state = this.stack[base2];
      } else {
        let baseStateID = this.stack[base2 - 3];
        this.state = parser2.getGoto(baseStateID, type, true);
      }
      while (this.stack.length > base2)
        this.stack.pop();
      this.reduceContext(type, start);
    }
    storeNode(term, start, end, size = 4, isReduce = false) {
      if (term == 0 && (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {
        let cur2 = this, top2 = this.buffer.length;
        if (top2 == 0 && cur2.parent) {
          top2 = cur2.bufferBase - cur2.parent.bufferBase;
          cur2 = cur2.parent;
        }
        if (top2 > 0 && cur2.buffer[top2 - 4] == 0 && cur2.buffer[top2 - 1] > -1) {
          if (start == end)
            return;
          if (cur2.buffer[top2 - 2] >= start) {
            cur2.buffer[top2 - 2] = end;
            return;
          }
        }
      }
      if (!isReduce || this.pos == end) {
        this.buffer.push(term, start, end, size);
      } else {
        let index2 = this.buffer.length;
        if (index2 > 0 && this.buffer[index2 - 4] != 0)
          while (index2 > 0 && this.buffer[index2 - 2] > end) {
            this.buffer[index2] = this.buffer[index2 - 4];
            this.buffer[index2 + 1] = this.buffer[index2 - 3];
            this.buffer[index2 + 2] = this.buffer[index2 - 2];
            this.buffer[index2 + 3] = this.buffer[index2 - 1];
            index2 -= 4;
            if (size > 4)
              size -= 4;
          }
        this.buffer[index2] = term;
        this.buffer[index2 + 1] = start;
        this.buffer[index2 + 2] = end;
        this.buffer[index2 + 3] = size;
      }
    }
    shift(action, type, start, end) {
      if (action & 131072) {
        this.pushState(action & 65535, this.pos);
      } else if ((action & 262144) == 0) {
        let nextState = action, { parser: parser2 } = this.p;
        if (end > this.pos || type <= parser2.maxNode) {
          this.pos = end;
          if (!parser2.stateFlag(nextState, 1))
            this.reducePos = end;
        }
        this.pushState(nextState, start);
        this.shiftContext(type, start);
        if (type <= parser2.maxNode)
          this.buffer.push(type, start, end, 4);
      } else {
        this.pos = end;
        this.shiftContext(type, start);
        if (type <= this.p.parser.maxNode)
          this.buffer.push(type, start, end, 4);
      }
    }
    apply(action, next, nextStart, nextEnd) {
      if (action & 65536)
        this.reduce(action);
      else
        this.shift(action, next, nextStart, nextEnd);
    }
    useNode(value2, next) {
      let index2 = this.p.reused.length - 1;
      if (index2 < 0 || this.p.reused[index2] != value2) {
        this.p.reused.push(value2);
        index2++;
      }
      let start = this.pos;
      this.reducePos = this.pos = start + value2.length;
      this.pushState(next, start);
      this.buffer.push(index2, start, this.reducePos, -1);
      if (this.curContext)
        this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value2, this, this.p.stream.reset(this.pos - value2.length)));
    }
    split() {
      let parent = this;
      let off2 = parent.buffer.length;
      while (off2 > 0 && parent.buffer[off2 - 2] > parent.reducePos)
        off2 -= 4;
      let buffer = parent.buffer.slice(off2), base2 = parent.bufferBase + off2;
      while (parent && base2 == parent.bufferBase)
        parent = parent.parent;
      return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base2, this.curContext, this.lookAhead, parent);
    }
    recoverByDelete(next, nextEnd) {
      let isNode = next <= this.p.parser.maxNode;
      if (isNode)
        this.storeNode(next, this.pos, nextEnd, 4);
      this.storeNode(0, this.pos, nextEnd, isNode ? 8 : 4);
      this.pos = this.reducePos = nextEnd;
      this.score -= 190;
    }
    canShift(term) {
      for (let sim = new SimulatedStack(this); ; ) {
        let action = this.p.parser.stateSlot(sim.state, 4) || this.p.parser.hasAction(sim.state, term);
        if (action == 0)
          return false;
        if ((action & 65536) == 0)
          return true;
        sim.reduce(action);
      }
    }
    recoverByInsert(next) {
      if (this.stack.length >= 300)
        return [];
      let nextStates = this.p.parser.nextStates(this.state);
      if (nextStates.length > 4 << 1 || this.stack.length >= 120) {
        let best = [];
        for (let i2 = 0, s; i2 < nextStates.length; i2 += 2) {
          if ((s = nextStates[i2 + 1]) != this.state && this.p.parser.hasAction(s, next))
            best.push(nextStates[i2], s);
        }
        if (this.stack.length < 120)
          for (let i2 = 0; best.length < 4 << 1 && i2 < nextStates.length; i2 += 2) {
            let s = nextStates[i2 + 1];
            if (!best.some((v, i3) => i3 & 1 && v == s))
              best.push(nextStates[i2], s);
          }
        nextStates = best;
      }
      let result = [];
      for (let i2 = 0; i2 < nextStates.length && result.length < 4; i2 += 2) {
        let s = nextStates[i2 + 1];
        if (s == this.state)
          continue;
        let stack = this.split();
        stack.pushState(s, this.pos);
        stack.storeNode(0, stack.pos, stack.pos, 4, true);
        stack.shiftContext(nextStates[i2], this.pos);
        stack.reducePos = this.pos;
        stack.score -= 200;
        result.push(stack);
      }
      return result;
    }
    forceReduce() {
      let { parser: parser2 } = this.p;
      let reduce = parser2.stateSlot(this.state, 5);
      if ((reduce & 65536) == 0)
        return false;
      if (!parser2.validAction(this.state, reduce)) {
        let depth = reduce >> 19, term = reduce & 65535;
        let target = this.stack.length - depth * 3;
        if (target < 0 || parser2.getGoto(this.stack[target], term, false) < 0) {
          let backup = this.findForcedReduction();
          if (backup == null)
            return false;
          reduce = backup;
        }
        this.storeNode(0, this.pos, this.pos, 4, true);
        this.score -= 100;
      }
      this.reducePos = this.pos;
      this.reduce(reduce);
      return true;
    }
    findForcedReduction() {
      let { parser: parser2 } = this.p, seen = [];
      let explore = (state, depth) => {
        if (seen.includes(state))
          return;
        seen.push(state);
        return parser2.allActions(state, (action) => {
          if (action & (262144 | 131072))
            ;
          else if (action & 65536) {
            let rDepth = (action >> 19) - depth;
            if (rDepth > 1) {
              let term = action & 65535, target = this.stack.length - rDepth * 3;
              if (target >= 0 && parser2.getGoto(this.stack[target], term, false) >= 0)
                return rDepth << 19 | 65536 | term;
            }
          } else {
            let found = explore(action, depth + 1);
            if (found != null)
              return found;
          }
        });
      };
      return explore(this.state, 0);
    }
    forceAll() {
      while (!this.p.parser.stateFlag(this.state, 2)) {
        if (!this.forceReduce()) {
          this.storeNode(0, this.pos, this.pos, 4, true);
          break;
        }
      }
      return this;
    }
    get deadEnd() {
      if (this.stack.length != 3)
        return false;
      let { parser: parser2 } = this.p;
      return parser2.data[parser2.stateSlot(this.state, 1)] == 65535 && !parser2.stateSlot(this.state, 4);
    }
    restart() {
      this.storeNode(0, this.pos, this.pos, 4, true);
      this.state = this.stack[0];
      this.stack.length = 0;
    }
    sameState(other) {
      if (this.state != other.state || this.stack.length != other.stack.length)
        return false;
      for (let i2 = 0; i2 < this.stack.length; i2 += 3)
        if (this.stack[i2] != other.stack[i2])
          return false;
      return true;
    }
    get parser() {
      return this.p.parser;
    }
    dialectEnabled(dialectID) {
      return this.p.parser.dialect.flags[dialectID];
    }
    shiftContext(term, start) {
      if (this.curContext)
        this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));
    }
    reduceContext(term, start) {
      if (this.curContext)
        this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));
    }
    emitContext() {
      let last = this.buffer.length - 1;
      if (last < 0 || this.buffer[last] != -3)
        this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);
    }
    emitLookAhead() {
      let last = this.buffer.length - 1;
      if (last < 0 || this.buffer[last] != -4)
        this.buffer.push(this.lookAhead, this.pos, this.pos, -4);
    }
    updateContext(context) {
      if (context != this.curContext.context) {
        let newCx = new StackContext(this.curContext.tracker, context);
        if (newCx.hash != this.curContext.hash)
          this.emitContext();
        this.curContext = newCx;
      }
    }
    setLookAhead(lookAhead) {
      if (lookAhead > this.lookAhead) {
        this.emitLookAhead();
        this.lookAhead = lookAhead;
      }
    }
    close() {
      if (this.curContext && this.curContext.tracker.strict)
        this.emitContext();
      if (this.lookAhead > 0)
        this.emitLookAhead();
    }
  }
  class StackContext {
    constructor(tracker, context) {
      this.tracker = tracker;
      this.context = context;
      this.hash = tracker.strict ? tracker.hash(context) : 0;
    }
  }
  class SimulatedStack {
    constructor(start) {
      this.start = start;
      this.state = start.state;
      this.stack = start.stack;
      this.base = this.stack.length;
    }
    reduce(action) {
      let term = action & 65535, depth = action >> 19;
      if (depth == 0) {
        if (this.stack == this.start.stack)
          this.stack = this.stack.slice();
        this.stack.push(this.state, 0, 0);
        this.base += 3;
      } else {
        this.base -= (depth - 1) * 3;
      }
      let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);
      this.state = goto;
    }
  }
  class StackBufferCursor {
    constructor(stack, pos, index2) {
      this.stack = stack;
      this.pos = pos;
      this.index = index2;
      this.buffer = stack.buffer;
      if (this.index == 0)
        this.maybeNext();
    }
    static create(stack, pos = stack.bufferBase + stack.buffer.length) {
      return new StackBufferCursor(stack, pos, pos - stack.bufferBase);
    }
    maybeNext() {
      let next = this.stack.parent;
      if (next != null) {
        this.index = this.stack.bufferBase - next.bufferBase;
        this.stack = next;
        this.buffer = next.buffer;
      }
    }
    get id() {
      return this.buffer[this.index - 4];
    }
    get start() {
      return this.buffer[this.index - 3];
    }
    get end() {
      return this.buffer[this.index - 2];
    }
    get size() {
      return this.buffer[this.index - 1];
    }
    next() {
      this.index -= 4;
      this.pos -= 4;
      if (this.index == 0)
        this.maybeNext();
    }
    fork() {
      return new StackBufferCursor(this.stack, this.pos, this.index);
    }
  }
  function decodeArray(input, Type = Uint16Array) {
    if (typeof input != "string")
      return input;
    let array = null;
    for (let pos = 0, out = 0; pos < input.length; ) {
      let value2 = 0;
      for (; ; ) {
        let next = input.charCodeAt(pos++), stop = false;
        if (next == 126) {
          value2 = 65535;
          break;
        }
        if (next >= 92)
          next--;
        if (next >= 34)
          next--;
        let digit = next - 32;
        if (digit >= 46) {
          digit -= 46;
          stop = true;
        }
        value2 += digit;
        if (stop)
          break;
        value2 *= 46;
      }
      if (array)
        array[out++] = value2;
      else
        array = new Type(value2);
    }
    return array;
  }
  class CachedToken {
    constructor() {
      this.start = -1;
      this.value = -1;
      this.end = -1;
      this.extended = -1;
      this.lookAhead = 0;
      this.mask = 0;
      this.context = 0;
    }
  }
  const nullToken = new CachedToken();
  class InputStream {
    constructor(input, ranges) {
      this.input = input;
      this.ranges = ranges;
      this.chunk = "";
      this.chunkOff = 0;
      this.chunk2 = "";
      this.chunk2Pos = 0;
      this.next = -1;
      this.token = nullToken;
      this.rangeIndex = 0;
      this.pos = this.chunkPos = ranges[0].from;
      this.range = ranges[0];
      this.end = ranges[ranges.length - 1].to;
      this.readNext();
    }
    resolveOffset(offset, assoc) {
      let range = this.range, index2 = this.rangeIndex;
      let pos = this.pos + offset;
      while (pos < range.from) {
        if (!index2)
          return null;
        let next = this.ranges[--index2];
        pos -= range.from - next.to;
        range = next;
      }
      while (assoc < 0 ? pos > range.to : pos >= range.to) {
        if (index2 == this.ranges.length - 1)
          return null;
        let next = this.ranges[++index2];
        pos += next.from - range.to;
        range = next;
      }
      return pos;
    }
    clipPos(pos) {
      if (pos >= this.range.from && pos < this.range.to)
        return pos;
      for (let range of this.ranges)
        if (range.to > pos)
          return Math.max(pos, range.from);
      return this.end;
    }
    peek(offset) {
      let idx = this.chunkOff + offset, pos, result;
      if (idx >= 0 && idx < this.chunk.length) {
        pos = this.pos + offset;
        result = this.chunk.charCodeAt(idx);
      } else {
        let resolved = this.resolveOffset(offset, 1);
        if (resolved == null)
          return -1;
        pos = resolved;
        if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {
          result = this.chunk2.charCodeAt(pos - this.chunk2Pos);
        } else {
          let i2 = this.rangeIndex, range = this.range;
          while (range.to <= pos)
            range = this.ranges[++i2];
          this.chunk2 = this.input.chunk(this.chunk2Pos = pos);
          if (pos + this.chunk2.length > range.to)
            this.chunk2 = this.chunk2.slice(0, range.to - pos);
          result = this.chunk2.charCodeAt(0);
        }
      }
      if (pos >= this.token.lookAhead)
        this.token.lookAhead = pos + 1;
      return result;
    }
    acceptToken(token, endOffset = 0) {
      let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;
      if (end == null || end < this.token.start)
        throw new RangeError("Token end out of bounds");
      this.token.value = token;
      this.token.end = end;
    }
    getChunk() {
      if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {
        let { chunk, chunkPos } = this;
        this.chunk = this.chunk2;
        this.chunkPos = this.chunk2Pos;
        this.chunk2 = chunk;
        this.chunk2Pos = chunkPos;
        this.chunkOff = this.pos - this.chunkPos;
      } else {
        this.chunk2 = this.chunk;
        this.chunk2Pos = this.chunkPos;
        let nextChunk = this.input.chunk(this.pos);
        let end = this.pos + nextChunk.length;
        this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;
        this.chunkPos = this.pos;
        this.chunkOff = 0;
      }
    }
    readNext() {
      if (this.chunkOff >= this.chunk.length) {
        this.getChunk();
        if (this.chunkOff == this.chunk.length)
          return this.next = -1;
      }
      return this.next = this.chunk.charCodeAt(this.chunkOff);
    }
    advance(n = 1) {
      this.chunkOff += n;
      while (this.pos + n >= this.range.to) {
        if (this.rangeIndex == this.ranges.length - 1)
          return this.setDone();
        n -= this.range.to - this.pos;
        this.range = this.ranges[++this.rangeIndex];
        this.pos = this.range.from;
      }
      this.pos += n;
      if (this.pos >= this.token.lookAhead)
        this.token.lookAhead = this.pos + 1;
      return this.readNext();
    }
    setDone() {
      this.pos = this.chunkPos = this.end;
      this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];
      this.chunk = "";
      return this.next = -1;
    }
    reset(pos, token) {
      if (token) {
        this.token = token;
        token.start = pos;
        token.lookAhead = pos + 1;
        token.value = token.extended = -1;
      } else {
        this.token = nullToken;
      }
      if (this.pos != pos) {
        this.pos = pos;
        if (pos == this.end) {
          this.setDone();
          return this;
        }
        while (pos < this.range.from)
          this.range = this.ranges[--this.rangeIndex];
        while (pos >= this.range.to)
          this.range = this.ranges[++this.rangeIndex];
        if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {
          this.chunkOff = pos - this.chunkPos;
        } else {
          this.chunk = "";
          this.chunkOff = 0;
        }
        this.readNext();
      }
      return this;
    }
    read(from, to) {
      if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)
        return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);
      if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)
        return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);
      if (from >= this.range.from && to <= this.range.to)
        return this.input.read(from, to);
      let result = "";
      for (let r of this.ranges) {
        if (r.from >= to)
          break;
        if (r.to > from)
          result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));
      }
      return result;
    }
  }
  class TokenGroup {
    constructor(data2, id2) {
      this.data = data2;
      this.id = id2;
    }
    token(input, stack) {
      let { parser: parser2 } = stack.p;
      readToken(this.data, input, stack, this.id, parser2.data, parser2.tokenPrecTable);
    }
  }
  TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
  class LocalTokenGroup {
    constructor(data2, precTable, elseToken) {
      this.precTable = precTable;
      this.elseToken = elseToken;
      this.data = typeof data2 == "string" ? decodeArray(data2) : data2;
    }
    token(input, stack) {
      let start = input.pos, skipped = 0;
      for (; ; ) {
        let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);
        readToken(this.data, input, stack, 0, this.data, this.precTable);
        if (input.token.value > -1)
          break;
        if (this.elseToken == null)
          return;
        if (!atEof)
          skipped++;
        if (nextPos == null)
          break;
        input.reset(nextPos, input.token);
      }
      if (skipped) {
        input.reset(start, input.token);
        input.acceptToken(this.elseToken, skipped);
      }
    }
  }
  LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;
  class ExternalTokenizer {
    constructor(token, options = {}) {
      this.token = token;
      this.contextual = !!options.contextual;
      this.fallback = !!options.fallback;
      this.extend = !!options.extend;
    }
  }
  function readToken(data2, input, stack, group, precTable, precOffset) {
    let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;
    scan:
      for (; ; ) {
        if ((groupMask & data2[state]) == 0)
          break;
        let accEnd = data2[state + 1];
        for (let i2 = state + 3; i2 < accEnd; i2 += 2)
          if ((data2[i2 + 1] & groupMask) > 0) {
            let term = data2[i2];
            if (dialect.allows(term) && (input.token.value == -1 || input.token.value == term || overrides(term, input.token.value, precTable, precOffset))) {
              input.acceptToken(term);
              break;
            }
          }
        let next = input.next, low = 0, high = data2[state + 2];
        if (input.next < 0 && high > low && data2[accEnd + high * 3 - 3] == 65535) {
          state = data2[accEnd + high * 3 - 1];
          continue scan;
        }
        for (; low < high; ) {
          let mid = low + high >> 1;
          let index2 = accEnd + mid + (mid << 1);
          let from = data2[index2], to = data2[index2 + 1] || 65536;
          if (next < from)
            high = mid;
          else if (next >= to)
            low = mid + 1;
          else {
            state = data2[index2 + 2];
            input.advance();
            continue scan;
          }
        }
        break;
      }
  }
  function findOffset(data2, start, term) {
    for (let i2 = start, next; (next = data2[i2]) != 65535; i2++)
      if (next == term)
        return i2 - start;
    return -1;
  }
  function overrides(token, prev, tableData, tableOffset) {
    let iPrev = findOffset(tableData, tableOffset, prev);
    return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;
  }
  const verbose = typeof process != "undefined" && process.env && /\bparse\b/.test({}.LOG);
  let stackIDs = null;
  function cutAt(tree, pos, side) {
    let cursor = tree.cursor(IterMode.IncludeAnonymous);
    cursor.moveTo(pos);
    for (; ; ) {
      if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))
        for (; ; ) {
          if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)
            return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25)) : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25));
          if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())
            break;
          if (!cursor.parent())
            return side < 0 ? 0 : tree.length;
        }
    }
  }
  class FragmentCursor {
    constructor(fragments, nodeSet) {
      this.fragments = fragments;
      this.nodeSet = nodeSet;
      this.i = 0;
      this.fragment = null;
      this.safeFrom = -1;
      this.safeTo = -1;
      this.trees = [];
      this.start = [];
      this.index = [];
      this.nextFragment();
    }
    nextFragment() {
      let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];
      if (fr) {
        this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;
        this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;
        while (this.trees.length) {
          this.trees.pop();
          this.start.pop();
          this.index.pop();
        }
        this.trees.push(fr.tree);
        this.start.push(-fr.offset);
        this.index.push(0);
        this.nextStart = this.safeFrom;
      } else {
        this.nextStart = 1e9;
      }
    }
    nodeAt(pos) {
      if (pos < this.nextStart)
        return null;
      while (this.fragment && this.safeTo <= pos)
        this.nextFragment();
      if (!this.fragment)
        return null;
      for (; ; ) {
        let last = this.trees.length - 1;
        if (last < 0) {
          this.nextFragment();
          return null;
        }
        let top2 = this.trees[last], index2 = this.index[last];
        if (index2 == top2.children.length) {
          this.trees.pop();
          this.start.pop();
          this.index.pop();
          continue;
        }
        let next = top2.children[index2];
        let start = this.start[last] + top2.positions[index2];
        if (start > pos) {
          this.nextStart = start;
          return null;
        }
        if (next instanceof Tree) {
          if (start == pos) {
            if (start < this.safeFrom)
              return null;
            let end = start + next.length;
            if (end <= this.safeTo) {
              let lookAhead = next.prop(NodeProp.lookAhead);
              if (!lookAhead || end + lookAhead < this.fragment.to)
                return next;
            }
          }
          this.index[last]++;
          if (start + next.length >= Math.max(this.safeFrom, pos)) {
            this.trees.push(next);
            this.start.push(start);
            this.index.push(0);
          }
        } else {
          this.index[last]++;
          this.nextStart = start + next.length;
        }
      }
    }
  }
  class TokenCache {
    constructor(parser2, stream) {
      this.stream = stream;
      this.tokens = [];
      this.mainToken = null;
      this.actions = [];
      this.tokens = parser2.tokenizers.map((_) => new CachedToken());
    }
    getActions(stack) {
      let actionIndex = 0;
      let main = null;
      let { parser: parser2 } = stack.p, { tokenizers } = parser2;
      let mask = parser2.stateSlot(stack.state, 3);
      let context = stack.curContext ? stack.curContext.hash : 0;
      let lookAhead = 0;
      for (let i2 = 0; i2 < tokenizers.length; i2++) {
        if ((1 << i2 & mask) == 0)
          continue;
        let tokenizer = tokenizers[i2], token = this.tokens[i2];
        if (main && !tokenizer.fallback)
          continue;
        if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {
          this.updateCachedToken(token, tokenizer, stack);
          token.mask = mask;
          token.context = context;
        }
        if (token.lookAhead > token.end + 25)
          lookAhead = Math.max(token.lookAhead, lookAhead);
        if (token.value != 0) {
          let startIndex = actionIndex;
          if (token.extended > -1)
            actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);
          actionIndex = this.addActions(stack, token.value, token.end, actionIndex);
          if (!tokenizer.extend) {
            main = token;
            if (actionIndex > startIndex)
              break;
          }
        }
      }
      while (this.actions.length > actionIndex)
        this.actions.pop();
      if (lookAhead)
        stack.setLookAhead(lookAhead);
      if (!main && stack.pos == this.stream.end) {
        main = new CachedToken();
        main.value = stack.p.parser.eofTerm;
        main.start = main.end = stack.pos;
        actionIndex = this.addActions(stack, main.value, main.end, actionIndex);
      }
      this.mainToken = main;
      return this.actions;
    }
    getMainToken(stack) {
      if (this.mainToken)
        return this.mainToken;
      let main = new CachedToken(), { pos, p } = stack;
      main.start = pos;
      main.end = Math.min(pos + 1, p.stream.end);
      main.value = pos == p.stream.end ? p.parser.eofTerm : 0;
      return main;
    }
    updateCachedToken(token, tokenizer, stack) {
      let start = this.stream.clipPos(stack.pos);
      tokenizer.token(this.stream.reset(start, token), stack);
      if (token.value > -1) {
        let { parser: parser2 } = stack.p;
        for (let i2 = 0; i2 < parser2.specialized.length; i2++)
          if (parser2.specialized[i2] == token.value) {
            let result = parser2.specializers[i2](this.stream.read(token.start, token.end), stack);
            if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {
              if ((result & 1) == 0)
                token.value = result >> 1;
              else
                token.extended = result >> 1;
              break;
            }
          }
      } else {
        token.value = 0;
        token.end = this.stream.clipPos(start + 1);
      }
    }
    putAction(action, token, end, index2) {
      for (let i2 = 0; i2 < index2; i2 += 3)
        if (this.actions[i2] == action)
          return index2;
      this.actions[index2++] = action;
      this.actions[index2++] = token;
      this.actions[index2++] = end;
      return index2;
    }
    addActions(stack, token, end, index2) {
      let { state } = stack, { parser: parser2 } = stack.p, { data: data2 } = parser2;
      for (let set = 0; set < 2; set++) {
        for (let i2 = parser2.stateSlot(state, set ? 2 : 1); ; i2 += 3) {
          if (data2[i2] == 65535) {
            if (data2[i2 + 1] == 1) {
              i2 = pair(data2, i2 + 2);
            } else {
              if (index2 == 0 && data2[i2 + 1] == 2)
                index2 = this.putAction(pair(data2, i2 + 2), token, end, index2);
              break;
            }
          }
          if (data2[i2] == token)
            index2 = this.putAction(pair(data2, i2 + 1), token, end, index2);
        }
      }
      return index2;
    }
  }
  class Parse {
    constructor(parser2, input, fragments, ranges) {
      this.parser = parser2;
      this.input = input;
      this.ranges = ranges;
      this.recovering = 0;
      this.nextStackID = 9812;
      this.minStackPos = 0;
      this.reused = [];
      this.stoppedAt = null;
      this.lastBigReductionStart = -1;
      this.lastBigReductionSize = 0;
      this.bigReductionCount = 0;
      this.stream = new InputStream(input, ranges);
      this.tokens = new TokenCache(parser2, this.stream);
      this.topTerm = parser2.top[1];
      let { from } = ranges[0];
      this.stacks = [Stack.start(this, parser2.top[0], from)];
      this.fragments = fragments.length && this.stream.end - from > parser2.bufferLength * 4 ? new FragmentCursor(fragments, parser2.nodeSet) : null;
    }
    get parsedPos() {
      return this.minStackPos;
    }
    advance() {
      let stacks = this.stacks, pos = this.minStackPos;
      let newStacks = this.stacks = [];
      let stopped, stoppedTokens;
      if (this.bigReductionCount > 300 && stacks.length == 1) {
        let [s] = stacks;
        while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) {
        }
        this.bigReductionCount = this.lastBigReductionSize = 0;
      }
      for (let i2 = 0; i2 < stacks.length; i2++) {
        let stack = stacks[i2];
        for (; ; ) {
          this.tokens.mainToken = null;
          if (stack.pos > pos) {
            newStacks.push(stack);
          } else if (this.advanceStack(stack, newStacks, stacks)) {
            continue;
          } else {
            if (!stopped) {
              stopped = [];
              stoppedTokens = [];
            }
            stopped.push(stack);
            let tok = this.tokens.getMainToken(stack);
            stoppedTokens.push(tok.value, tok.end);
          }
          break;
        }
      }
      if (!newStacks.length) {
        let finished = stopped && findFinished(stopped);
        if (finished) {
          if (verbose)
            console.log("Finish with " + this.stackID(finished));
          return this.stackToTree(finished);
        }
        if (this.parser.strict) {
          if (verbose && stopped)
            console.log("Stuck with token " + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : "none"));
          throw new SyntaxError("No parse at " + pos);
        }
        if (!this.recovering)
          this.recovering = 5;
      }
      if (this.recovering && stopped) {
        let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0] : this.runRecovery(stopped, stoppedTokens, newStacks);
        if (finished) {
          if (verbose)
            console.log("Force-finish " + this.stackID(finished));
          return this.stackToTree(finished.forceAll());
        }
      }
      if (this.recovering) {
        let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3;
        if (newStacks.length > maxRemaining) {
          newStacks.sort((a, b) => b.score - a.score);
          while (newStacks.length > maxRemaining)
            newStacks.pop();
        }
        if (newStacks.some((s) => s.reducePos > pos))
          this.recovering--;
      } else if (newStacks.length > 1) {
        outer:
          for (let i2 = 0; i2 < newStacks.length - 1; i2++) {
            let stack = newStacks[i2];
            for (let j = i2 + 1; j < newStacks.length; j++) {
              let other = newStacks[j];
              if (stack.sameState(other) || stack.buffer.length > 500 && other.buffer.length > 500) {
                if ((stack.score - other.score || stack.buffer.length - other.buffer.length) > 0) {
                  newStacks.splice(j--, 1);
                } else {
                  newStacks.splice(i2--, 1);
                  continue outer;
                }
              }
            }
          }
        if (newStacks.length > 12)
          newStacks.splice(12, newStacks.length - 12);
      }
      this.minStackPos = newStacks[0].pos;
      for (let i2 = 1; i2 < newStacks.length; i2++)
        if (newStacks[i2].pos < this.minStackPos)
          this.minStackPos = newStacks[i2].pos;
      return null;
    }
    stopAt(pos) {
      if (this.stoppedAt != null && this.stoppedAt < pos)
        throw new RangeError("Can't move stoppedAt forward");
      this.stoppedAt = pos;
    }
    advanceStack(stack, stacks, split) {
      let start = stack.pos, { parser: parser2 } = this;
      let base2 = verbose ? this.stackID(stack) + " -> " : "";
      if (this.stoppedAt != null && start > this.stoppedAt)
        return stack.forceReduce() ? stack : null;
      if (this.fragments) {
        let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;
        for (let cached = this.fragments.nodeAt(start); cached; ) {
          let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser2.getGoto(stack.state, cached.type.id) : -1;
          if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {
            stack.useNode(cached, match);
            if (verbose)
              console.log(base2 + this.stackID(stack) + ` (via reuse of ${parser2.getName(cached.type.id)})`);
            return true;
          }
          if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)
            break;
          let inner = cached.children[0];
          if (inner instanceof Tree && cached.positions[0] == 0)
            cached = inner;
          else
            break;
        }
      }
      let defaultReduce = parser2.stateSlot(stack.state, 4);
      if (defaultReduce > 0) {
        stack.reduce(defaultReduce);
        if (verbose)
          console.log(base2 + this.stackID(stack) + ` (via always-reduce ${parser2.getName(defaultReduce & 65535)})`);
        return true;
      }
      if (stack.stack.length >= 8400) {
        while (stack.stack.length > 6e3 && stack.forceReduce()) {
        }
      }
      let actions = this.tokens.getActions(stack);
      for (let i2 = 0; i2 < actions.length; ) {
        let action = actions[i2++], term = actions[i2++], end = actions[i2++];
        let last = i2 == actions.length || !split;
        let localStack = last ? stack : stack.split();
        let main = this.tokens.mainToken;
        localStack.apply(action, term, main ? main.start : localStack.pos, end);
        if (verbose)
          console.log(base2 + this.stackID(localStack) + ` (via ${(action & 65536) == 0 ? "shift" : `reduce of ${parser2.getName(action & 65535)}`} for ${parser2.getName(term)} @ ${start}${localStack == stack ? "" : ", split"})`);
        if (last)
          return true;
        else if (localStack.pos > start)
          stacks.push(localStack);
        else
          split.push(localStack);
      }
      return false;
    }
    advanceFully(stack, newStacks) {
      let pos = stack.pos;
      for (; ; ) {
        if (!this.advanceStack(stack, null, null))
          return false;
        if (stack.pos > pos) {
          pushStackDedup(stack, newStacks);
          return true;
        }
      }
    }
    runRecovery(stacks, tokens, newStacks) {
      let finished = null, restarted = false;
      for (let i2 = 0; i2 < stacks.length; i2++) {
        let stack = stacks[i2], token = tokens[i2 << 1], tokenEnd = tokens[(i2 << 1) + 1];
        let base2 = verbose ? this.stackID(stack) + " -> " : "";
        if (stack.deadEnd) {
          if (restarted)
            continue;
          restarted = true;
          stack.restart();
          if (verbose)
            console.log(base2 + this.stackID(stack) + " (restarted)");
          let done = this.advanceFully(stack, newStacks);
          if (done)
            continue;
        }
        let force = stack.split(), forceBase = base2;
        for (let j = 0; force.forceReduce() && j < 10; j++) {
          if (verbose)
            console.log(forceBase + this.stackID(force) + " (via force-reduce)");
          let done = this.advanceFully(force, newStacks);
          if (done)
            break;
          if (verbose)
            forceBase = this.stackID(force) + " -> ";
        }
        for (let insert2 of stack.recoverByInsert(token)) {
          if (verbose)
            console.log(base2 + this.stackID(insert2) + " (via recover-insert)");
          this.advanceFully(insert2, newStacks);
        }
        if (this.stream.end > stack.pos) {
          if (tokenEnd == stack.pos) {
            tokenEnd++;
            token = 0;
          }
          stack.recoverByDelete(token, tokenEnd);
          if (verbose)
            console.log(base2 + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);
          pushStackDedup(stack, newStacks);
        } else if (!finished || finished.score < stack.score) {
          finished = stack;
        }
      }
      return finished;
    }
    stackToTree(stack) {
      stack.close();
      return Tree.build({
        buffer: StackBufferCursor.create(stack),
        nodeSet: this.parser.nodeSet,
        topID: this.topTerm,
        maxBufferLength: this.parser.bufferLength,
        reused: this.reused,
        start: this.ranges[0].from,
        length: stack.pos - this.ranges[0].from,
        minRepeatType: this.parser.minRepeatTerm
      });
    }
    stackID(stack) {
      let id2 = (stackIDs || (stackIDs = new WeakMap())).get(stack);
      if (!id2)
        stackIDs.set(stack, id2 = String.fromCodePoint(this.nextStackID++));
      return id2 + stack;
    }
  }
  function pushStackDedup(stack, newStacks) {
    for (let i2 = 0; i2 < newStacks.length; i2++) {
      let other = newStacks[i2];
      if (other.pos == stack.pos && other.sameState(stack)) {
        if (newStacks[i2].score < stack.score)
          newStacks[i2] = stack;
        return;
      }
    }
    newStacks.push(stack);
  }
  class Dialect {
    constructor(source, flags, disabled) {
      this.source = source;
      this.flags = flags;
      this.disabled = disabled;
    }
    allows(term) {
      return !this.disabled || this.disabled[term] == 0;
    }
  }
  const id$1 = (x) => x;
  class ContextTracker {
    constructor(spec) {
      this.start = spec.start;
      this.shift = spec.shift || id$1;
      this.reduce = spec.reduce || id$1;
      this.reuse = spec.reuse || id$1;
      this.hash = spec.hash || (() => 0);
      this.strict = spec.strict !== false;
    }
  }
  class LRParser extends Parser {
    constructor(spec) {
      super();
      this.wrappers = [];
      if (spec.version != 14)
        throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14})`);
      let nodeNames = spec.nodeNames.split(" ");
      this.minRepeatTerm = nodeNames.length;
      for (let i2 = 0; i2 < spec.repeatNodeCount; i2++)
        nodeNames.push("");
      let topTerms = Object.keys(spec.topRules).map((r) => spec.topRules[r][1]);
      let nodeProps = [];
      for (let i2 = 0; i2 < nodeNames.length; i2++)
        nodeProps.push([]);
      function setProp(nodeID, prop, value2) {
        nodeProps[nodeID].push([prop, prop.deserialize(String(value2))]);
      }
      if (spec.nodeProps)
        for (let propSpec of spec.nodeProps) {
          let prop = propSpec[0];
          if (typeof prop == "string")
            prop = NodeProp[prop];
          for (let i2 = 1; i2 < propSpec.length; ) {
            let next = propSpec[i2++];
            if (next >= 0) {
              setProp(next, prop, propSpec[i2++]);
            } else {
              let value2 = propSpec[i2 + -next];
              for (let j = -next; j > 0; j--)
                setProp(propSpec[i2++], prop, value2);
              i2++;
            }
          }
        }
      this.nodeSet = new NodeSet(nodeNames.map((name2, i2) => NodeType.define({
        name: i2 >= this.minRepeatTerm ? void 0 : name2,
        id: i2,
        props: nodeProps[i2],
        top: topTerms.indexOf(i2) > -1,
        error: i2 == 0,
        skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i2) > -1
      })));
      if (spec.propSources)
        this.nodeSet = this.nodeSet.extend(...spec.propSources);
      this.strict = false;
      this.bufferLength = DefaultBufferLength;
      let tokenArray = decodeArray(spec.tokenData);
      this.context = spec.context;
      this.specializerSpecs = spec.specialized || [];
      this.specialized = new Uint16Array(this.specializerSpecs.length);
      for (let i2 = 0; i2 < this.specializerSpecs.length; i2++)
        this.specialized[i2] = this.specializerSpecs[i2].term;
      this.specializers = this.specializerSpecs.map(getSpecializer);
      this.states = decodeArray(spec.states, Uint32Array);
      this.data = decodeArray(spec.stateData);
      this.goto = decodeArray(spec.goto);
      this.maxTerm = spec.maxTerm;
      this.tokenizers = spec.tokenizers.map((value2) => typeof value2 == "number" ? new TokenGroup(tokenArray, value2) : value2);
      this.topRules = spec.topRules;
      this.dialects = spec.dialects || {};
      this.dynamicPrecedences = spec.dynamicPrecedences || null;
      this.tokenPrecTable = spec.tokenPrec;
      this.termNames = spec.termNames || null;
      this.maxNode = this.nodeSet.types.length - 1;
      this.dialect = this.parseDialect();
      this.top = this.topRules[Object.keys(this.topRules)[0]];
    }
    createParse(input, fragments, ranges) {
      let parse2 = new Parse(this, input, fragments, ranges);
      for (let w of this.wrappers)
        parse2 = w(parse2, input, fragments, ranges);
      return parse2;
    }
    getGoto(state, term, loose = false) {
      let table = this.goto;
      if (term >= table[0])
        return -1;
      for (let pos = table[term + 1]; ; ) {
        let groupTag = table[pos++], last = groupTag & 1;
        let target = table[pos++];
        if (last && loose)
          return target;
        for (let end = pos + (groupTag >> 1); pos < end; pos++)
          if (table[pos] == state)
            return target;
        if (last)
          return -1;
      }
    }
    hasAction(state, terminal) {
      let data2 = this.data;
      for (let set = 0; set < 2; set++) {
        for (let i2 = this.stateSlot(state, set ? 2 : 1), next; ; i2 += 3) {
          if ((next = data2[i2]) == 65535) {
            if (data2[i2 + 1] == 1)
              next = data2[i2 = pair(data2, i2 + 2)];
            else if (data2[i2 + 1] == 2)
              return pair(data2, i2 + 2);
            else
              break;
          }
          if (next == terminal || next == 0)
            return pair(data2, i2 + 1);
        }
      }
      return 0;
    }
    stateSlot(state, slot) {
      return this.states[state * 6 + slot];
    }
    stateFlag(state, flag) {
      return (this.stateSlot(state, 0) & flag) > 0;
    }
    validAction(state, action) {
      return !!this.allActions(state, (a) => a == action ? true : null);
    }
    allActions(state, action) {
      let deflt = this.stateSlot(state, 4);
      let result = deflt ? action(deflt) : void 0;
      for (let i2 = this.stateSlot(state, 1); result == null; i2 += 3) {
        if (this.data[i2] == 65535) {
          if (this.data[i2 + 1] == 1)
            i2 = pair(this.data, i2 + 2);
          else
            break;
        }
        result = action(pair(this.data, i2 + 1));
      }
      return result;
    }
    nextStates(state) {
      let result = [];
      for (let i2 = this.stateSlot(state, 1); ; i2 += 3) {
        if (this.data[i2] == 65535) {
          if (this.data[i2 + 1] == 1)
            i2 = pair(this.data, i2 + 2);
          else
            break;
        }
        if ((this.data[i2 + 2] & 65536 >> 16) == 0) {
          let value2 = this.data[i2 + 1];
          if (!result.some((v, i3) => i3 & 1 && v == value2))
            result.push(this.data[i2], value2);
        }
      }
      return result;
    }
    configure(config2) {
      let copy = Object.assign(Object.create(LRParser.prototype), this);
      if (config2.props)
        copy.nodeSet = this.nodeSet.extend(...config2.props);
      if (config2.top) {
        let info = this.topRules[config2.top];
        if (!info)
          throw new RangeError(`Invalid top rule name ${config2.top}`);
        copy.top = info;
      }
      if (config2.tokenizers)
        copy.tokenizers = this.tokenizers.map((t2) => {
          let found = config2.tokenizers.find((r) => r.from == t2);
          return found ? found.to : t2;
        });
      if (config2.specializers) {
        copy.specializers = this.specializers.slice();
        copy.specializerSpecs = this.specializerSpecs.map((s, i2) => {
          let found = config2.specializers.find((r) => r.from == s.external);
          if (!found)
            return s;
          let spec = Object.assign(Object.assign({}, s), { external: found.to });
          copy.specializers[i2] = getSpecializer(spec);
          return spec;
        });
      }
      if (config2.contextTracker)
        copy.context = config2.contextTracker;
      if (config2.dialect)
        copy.dialect = this.parseDialect(config2.dialect);
      if (config2.strict != null)
        copy.strict = config2.strict;
      if (config2.wrap)
        copy.wrappers = copy.wrappers.concat(config2.wrap);
      if (config2.bufferLength != null)
        copy.bufferLength = config2.bufferLength;
      return copy;
    }
    hasWrappers() {
      return this.wrappers.length > 0;
    }
    getName(term) {
      return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);
    }
    get eofTerm() {
      return this.maxNode + 1;
    }
    get topNode() {
      return this.nodeSet.types[this.top[1]];
    }
    dynamicPrecedence(term) {
      let prec2 = this.dynamicPrecedences;
      return prec2 == null ? 0 : prec2[term] || 0;
    }
    parseDialect(dialect) {
      let values = Object.keys(this.dialects), flags = values.map(() => false);
      if (dialect)
        for (let part of dialect.split(" ")) {
          let id2 = values.indexOf(part);
          if (id2 >= 0)
            flags[id2] = true;
        }
      let disabled = null;
      for (let i2 = 0; i2 < values.length; i2++)
        if (!flags[i2]) {
          for (let j = this.dialects[values[i2]], id2; (id2 = this.data[j++]) != 65535; )
            (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id2] = 1;
        }
      return new Dialect(dialect, flags, disabled);
    }
    static deserialize(spec) {
      return new LRParser(spec);
    }
  }
  function pair(data2, off2) {
    return data2[off2] | data2[off2 + 1] << 16;
  }
  function findFinished(stacks) {
    let best = null;
    for (let stack of stacks) {
      let stopped = stack.p.stoppedAt;
      if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) && stack.p.parser.stateFlag(stack.state, 2) && (!best || best.score < stack.score))
        best = stack;
    }
    return best;
  }
  function getSpecializer(spec) {
    if (spec.external) {
      let mask = spec.extend ? 1 : 0;
      return (value2, stack) => spec.external(value2, stack) << 1 | mask;
    }
    return spec.get;
  }
  const noSemi = 304, incdec = 1, incdecPrefix = 2, insertSemi = 305, spaces = 307, newline = 308, LineComment = 3, BlockComment = 4;
  const space = [
    9,
    10,
    11,
    12,
    13,
    32,
    133,
    160,
    5760,
    8192,
    8193,
    8194,
    8195,
    8196,
    8197,
    8198,
    8199,
    8200,
    8201,
    8202,
    8232,
    8233,
    8239,
    8287,
    12288
  ];
  const braceR = 125, semicolon = 59, slash = 47, star = 42, plus = 43, minus = 45;
  const trackNewline = new ContextTracker({
    start: false,
    shift(context, term) {
      return term == LineComment || term == BlockComment || term == spaces ? context : term == newline;
    },
    strict: false
  });
  const insertSemicolon = new ExternalTokenizer((input, stack) => {
    let { next } = input;
    if (next == braceR || next == -1 || stack.context)
      input.acceptToken(insertSemi);
  }, { contextual: true, fallback: true });
  const noSemicolon = new ExternalTokenizer((input, stack) => {
    let { next } = input, after;
    if (space.indexOf(next) > -1)
      return;
    if (next == slash && ((after = input.peek(1)) == slash || after == star))
      return;
    if (next != braceR && next != semicolon && next != -1 && !stack.context)
      input.acceptToken(noSemi);
  }, { contextual: true });
  const incdecToken = new ExternalTokenizer((input, stack) => {
    let { next } = input;
    if (next == plus || next == minus) {
      input.advance();
      if (next == input.next) {
        input.advance();
        let mayPostfix = !stack.context && stack.canShift(incdec);
        input.acceptToken(mayPostfix ? incdec : incdecPrefix);
      }
    }
  }, { contextual: true });
  const jsHighlight = styleTags({
    "get set async static": tags.modifier,
    "for while do if else switch try catch finally return throw break continue default case": tags.controlKeyword,
    "in of await yield void typeof delete instanceof": tags.operatorKeyword,
    "let var const using function class extends": tags.definitionKeyword,
    "import export from": tags.moduleKeyword,
    "with debugger as new": tags.keyword,
    TemplateString: tags.special(tags.string),
    super: tags.atom,
    BooleanLiteral: tags.bool,
    this: tags.self,
    null: tags.null,
    Star: tags.modifier,
    VariableName: tags.variableName,
    "CallExpression/VariableName TaggedTemplateExpression/VariableName": tags.function(tags.variableName),
    VariableDefinition: tags.definition(tags.variableName),
    Label: tags.labelName,
    PropertyName: tags.propertyName,
    PrivatePropertyName: tags.special(tags.propertyName),
    "CallExpression/MemberExpression/PropertyName": tags.function(tags.propertyName),
    "FunctionDeclaration/VariableDefinition": tags.function(tags.definition(tags.variableName)),
    "ClassDeclaration/VariableDefinition": tags.definition(tags.className),
    PropertyDefinition: tags.definition(tags.propertyName),
    PrivatePropertyDefinition: tags.definition(tags.special(tags.propertyName)),
    UpdateOp: tags.updateOperator,
    "LineComment Hashbang": tags.lineComment,
    BlockComment: tags.blockComment,
    Number: tags.number,
    String: tags.string,
    Escape: tags.escape,
    ArithOp: tags.arithmeticOperator,
    LogicOp: tags.logicOperator,
    BitOp: tags.bitwiseOperator,
    CompareOp: tags.compareOperator,
    RegExp: tags.regexp,
    Equals: tags.definitionOperator,
    Arrow: tags.function(tags.punctuation),
    ": Spread": tags.punctuation,
    "( )": tags.paren,
    "[ ]": tags.squareBracket,
    "{ }": tags.brace,
    "InterpolationStart InterpolationEnd": tags.special(tags.brace),
    ".": tags.derefOperator,
    ", ;": tags.separator,
    "@": tags.meta,
    TypeName: tags.typeName,
    TypeDefinition: tags.definition(tags.typeName),
    "type enum interface implements namespace module declare": tags.definitionKeyword,
    "abstract global Privacy readonly override": tags.modifier,
    "is keyof unique infer": tags.operatorKeyword,
    JSXAttributeValue: tags.attributeValue,
    JSXText: tags.content,
    "JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag": tags.angleBracket,
    "JSXIdentifier JSXNameSpacedName": tags.tagName,
    "JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName": tags.attributeName,
    "JSXBuiltin/JSXIdentifier": tags.standard(tags.tagName)
  });
  const spec_identifier = { __proto__: null, export: 16, as: 21, from: 29, default: 32, async: 37, function: 38, extends: 48, this: 52, true: 60, false: 60, null: 72, void: 76, typeof: 80, super: 98, new: 132, delete: 148, yield: 157, await: 161, class: 166, public: 223, private: 223, protected: 223, readonly: 225, instanceof: 244, satisfies: 247, in: 248, const: 250, import: 282, keyof: 337, unique: 341, infer: 347, is: 383, abstract: 403, implements: 405, type: 407, let: 410, var: 412, using: 415, interface: 421, enum: 425, namespace: 431, module: 433, declare: 437, global: 441, for: 460, of: 469, while: 472, with: 476, do: 480, if: 484, else: 486, switch: 490, case: 496, try: 502, catch: 506, finally: 510, return: 514, throw: 518, break: 522, continue: 526, debugger: 530 };
  const spec_word = { __proto__: null, async: 119, get: 121, set: 123, declare: 183, public: 185, private: 185, protected: 185, static: 187, abstract: 189, override: 191, readonly: 197, accessor: 199, new: 387 };
  const spec_LessThan = { __proto__: null, "<": 139 };
  const parser = LRParser.deserialize({
    version: 14,
    states: "$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO<dQSO'#G}O={QSO'#CcO>]QSO'#HZO>eQSO'#HaO>eQSO'#HcO`QUO'#HeO>eQSO'#HgO>eQSO'#HjO>jQSO'#HpO>oQ(C]O'#HvO%[QUO'#HxO>zQ(C]O'#HzO?VQ(C]O'#H|O9eQ(C[O'#IOO?bQ(CjO'#CgO@dQWO'#DgQOQSOOO%[QUO'#D}O@zQSO'#EQO9{Q,UO'#EhOAVQSO'#EhOAbQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Ji'#JiO%[QUO'#JiOOQO'#Jm'#JmOOQO'#Ia'#IaOBbQWO'#EaOOQ(CW'#E`'#E`OC^Q(C`O'#EaOChQWO'#ETOOQO'#Jl'#JlOC|QWO'#JmOEZQWO'#ETOChQWO'#EaPEhO?MpO'#C`POOO)CDp)CDpOOOO'#IW'#IWOEsOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFRO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFaO07`O,59vOOQ(CY,59v,59vOFoQUO'#I[OGSQSO'#JgOIUQbO'#JgO+}QUO'#JgOI]QSO,59|OIsQSO'#EjOJQQSO'#JuOJ]QSO'#JtOJ]QSO'#JtOJeQSO,5;WOJjQSO'#JsOOQ(CY,5:X,5:XOJqQUO,5:XOLrQ(CjO,5:cOMcQSO,5:kOM|Q(C[O'#JrONTQSO'#JqO9TQSO'#JqONiQSO'#JqONqQSO,5;VONvQSO'#JqO!#OQbO'#JfOOQ(CY'#Cg'#CgO%[QUO'#EPO!#nQ`O,5:pOOQO'#Jn'#JnOOQO-E<b-E<bO9ZQSO,5=WO!$UQSO,5=WO!$ZQUO,5;TO!&^Q,UO'#EeO!'qQSO,5;TO!)ZQ,UO'#DqO!)bQUO'#DvO!)lQWO,5;^O!)tQWO,5;^O%[QUO,5;^OOQQ'#FP'#FPOOQQ'#FR'#FRO%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_O%[QUO,5;_OOQQ'#FV'#FVO!*SQUO,5;pOOQ(CY,5;u,5;uOOQ(CY,5;v,5;vO!,VQSO,5;vOOQ(CY,5;w,5;wO%[QUO'#IhO!,_Q(C[O,5<dO!&^Q,UO,5;_O!,|Q,UO,5;_O%[QUO,5;sO!-TQ#tO'#FfO!.QQ#tO'#JyO!-lQ#tO'#JyO!.XQ#tO'#JyOOQO'#Jy'#JyO!.mQ#tO,5<OOOOO,5<[,5<[O!/OQUO'#FrOOOO'#Ig'#IgO7YO&jO,5;{O!/VQ#tO'#FtOOQ(CY,5;{,5;{O!/vQ7[O'#CsOOQ(CY'#Cw'#CwO!0ZQSO'#CwO!0`O07`O'#C{O!0|Q,UO,5<aO!1TQSO,5<cO!2jQMhO'#GRO!2wQSO'#GSO!2|QSO'#GSO!3RQMhO'#GWO!4QQWO'#G[O!4sQ7[O'#J`OOQ(CY'#J`'#J`O!4}QSO'#J_O!5]QSO'#J^O!5eQSO'#CrOOQ(CY'#Cu'#CuOOQ(CY'#DP'#DPOOQ(CY'#DR'#DRO1SQSO'#DTO!'vQ,UO'#FyO!'vQ,UO'#F{O!5mQSO'#F}O!5rQSO'#GOO!2|QSO'#GUO!'vQ,UO'#GZO!5wQSO'#EkO!6fQSO,5<bOOQ(CW'#Cp'#CpO!6nQSO'#ElO!7hQWO'#EmOOQ(CW'#Js'#JsO!7oQ(C[O'#KSO9eQ(C[O,5=[O`QUO,5>lOOQQ'#JZ'#JZOOQQ,5>m,5>mOOQQ-E<T-E<TO!9qQ(CjO,5:ZO!<_Q(CjO,5:gO%[QUO,5:gO!>xQ(CjO,5:iOOQO,5@m,5@mO!?iQ,UO,5=WO!?wQ(C[O'#J[O9OQSO'#J[O!@YQ(C[O,59XO!@eQWO,59XO!@mQ,UO,59XO9{Q,UO,59XO!@xQSO,5;TO!AQQSO'#HYO!AfQSO'#KVO%[QUO,5;xO!7cQWO,5;zO!AnQSO,5=sO!AsQSO,5=sO!AxQSO,5=sO9eQ(C[O,5=sO;mQSO,5=cOOQO'#Cs'#CsO!BWQWO,5=`O!B`Q,UO,5=aO!BkQSO,5=cO!BpQ`O,5=fO!BxQSO'#KRO>jQSO'#HPO9ZQSO'#HRO!B}QSO'#HRO9{Q,UO'#HTO!CSQSO'#HTOOQQ,5=i,5=iO!CXQSO'#HUO!CjQSO'#CmO!CoQSO,58}O!CyQSO,58}O!FOQUO,58}OOQQ,58},58}O!F`Q(C[O,58}O%[QUO,58}O!HkQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IRQSO,5=uO`QUO,5={O`QUO,5=}O!IWQSO,5>PO`QUO,5>RO!I]QSO,5>UO!IbQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9eQ(C[O,5>dOOQQ,5>f,5>fO!MlQSO,5>fOOQQ,5>h,5>hO!MlQSO,5>hOOQQ,5>j,5>jO!MqQWO'#DYO%[QUO'#JiO!N`QWO'#JiO!N}QWO'#DhO# `QWO'#DhO##qQUO'#DhO##xQSO'#JhO#$QQSO,5:RO#$VQSO'#EnO#$eQSO'#JvO#$mQSO,5;XO#$rQWO'#DhO#%PQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%WQSO,5:lO>jQSO,5;SO!@eQWO,5;SO!@mQ,UO,5;SO9{Q,UO,5;SO#%`QSO,5@TO#%eQ!LQO,5:pOOQO-E<_-E<_O#&kQ(C`O,5:{OChQWO,5:oO#&uQWO,5:oOChQWO,5:{O!@YQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'SQ(C[O,5:{O#'_Q(C[O,5:{O!@eQWO,5:oOOQO,5;R,5;RO#'mQ(C[O,5:{POOO'#IU'#IUP#(RO?MpO,58zPOOO,58z,58zOOOO-E<U-E<UOOQ(CY1G.n1G.nOOOO-E<V-E<VO#(^Q`O,59xOOOO-E<X-E<XOOQ(CY1G/b1G/bO#(cQbO,5>vO+}QUO,5>vOOQO,5>|,5>|O#(mQUO'#I[OOQO-E<Y-E<YO#(zQSO,5@RO#)SQbO,5@RO#)ZQSO,5@`OOQ(CY1G/h1G/hO%[QUO,5@aO#)cQSO'#IbOOQO-E<`-E<`O#)ZQSO,5@`OOQ(CW1G0r1G0rOOQ(CY1G/s1G/sOOQ(CY1G0V1G0VO%[QUO,5@^O#)wQ(C[O,5@^O#*YQ(C[O,5@^O#*aQSO,5@]O9TQSO,5@]O#*iQSO,5@]O#*wQSO'#IeO#*aQSO,5@]OOQ(CW1G0q1G0qO!)lQWO,5:rO!)wQWO,5:rOOQO,5:t,5:tO#+iQSO,5:tO#+qQ,UO1G2rO9ZQSO1G2rOOQ(CY1G0o1G0oO#,PQ(CjO1G0oO#-UQ(ChO,5;POOQ(CY'#GQ'#GQO#-rQ(CjO'#J`O!$ZQUO1G0oO#/zQ,UO'#JjO#0UQSO,5:]O#0ZQbO'#JkO%[QUO'#JkO#0eQSO,5:bOOQ(CY'#DY'#DYOOQ(CY1G0x1G0xO%[QUO1G0xOOQ(CY1G1b1G1bO#0jQSO1G0xO#3RQ(CjO1G0yO#3YQ(CjO1G0yO#5sQ(CjO1G0yO#5zQ(CjO1G0yO#8UQ(CjO1G0yO#8lQ(CjO1G0yO#;fQ(CjO1G0yO#;mQ(CjO1G0yO#>WQ(CjO1G0yO#>_Q(CjO1G0yO#@VQ(CjO1G0yO#CVQ$IUO'#CgO#ETQ$IUO1G1[O#E[Q$IUO'#JfO!,YQSO1G1bO#ElQ(CjO,5?SOOQ(CW-E<f-E<fO#F`Q(CjO1G0yOOQ(CY1G0y1G0yO#HkQ(CjO1G1_O#I_Q#tO,5<SO#IgQ#tO,5<TO#IoQ#tO'#FkO#JWQSO'#FjOOQO'#Jz'#JzOOQO'#If'#IfO#J]Q#tO1G1jOOQ(CY1G1j1G1jOOOO1G1u1G1uO#JnQ$IUO'#JeO#JxQSO,5<^O!*SQUO,5<^OOOO-E<e-E<eOOQ(CY1G1g1G1gO#J}QWO'#JyOOQ(CY,5<`,5<`O#KVQWO,5<`OOQ(CY,59c,59cO!&^Q,UO'#C}OOOO'#IY'#IYO#K[O07`O,59gOOQ(CY,59g,59gO%[QUO1G1{O!5rQSO'#IjO#KgQ,UO,5<tOOQ(CY,5<q,5<qOOQO'#Gg'#GgO!'vQ,UO,5=QOOQO'#Gi'#GiO!'vQ,UO,5=SO!&^Q,UO,5=UOOQO1G1}1G1}O#KnQ`O'#CpO#LRQ`O,5<mO#LYQSO'#J}O9ZQSO'#J}O#LhQSO,5<oO!'vQ,UO,5<nO#LmQSO'#GTO#LxQSO,5<nO#L}Q`O'#GQO#M[Q`O'#KOO#MfQSO'#KOO!&^Q,UO'#KOO#MkQSO,5<rO#MpQWO'#G]O!3{QWO'#G]O#NRQSO'#G_O#NWQSO'#GaO!2|QSO'#GdO#N]Q(C[O'#IlO#NhQWO,5<vOOQ(CY,5<v,5<vO#NoQWO'#G]O#N}QWO'#G^O$ VQWO'#G^OOQ(CY,5=V,5=VO!'vQ,UO,5?yO!'vQ,UO,5?yO$ [QSO'#ImO$ gQSO,5?xO$ oQSO,59^O$!`Q,UO,59oOOQ(CY,59o,59oO$#RQ,UO,5<eO$#tQ,UO,5<gO@[QSO,5<iOOQ(CY,5<j,5<jO$$OQSO,5<pO$$TQ,UO,5<uO$$eQSO'#JqO!$ZQUO1G1|O$$jQSO1G1|O9TQSO'#JtO9TQSO'#EnO%[QUO'#EnO9TQSO'#IoO$$oQ(C[O,5@nOOQQ1G2v1G2vOOQQ1G4W1G4WOOQ(CY1G/u1G/uO!,VQSO1G/uO$&tQ(CjO1G0ROOQQ1G2r1G2rO!&^Q,UO1G2rO%[QUO1G2rO$'eQSO1G2rO$'pQ,UO'#EeOOQ(CW,5?v,5?vO$'zQ(C[O,5?vOOQQ1G.s1G.sO!@YQ(C[O1G.sO!@eQWO1G.sO!@mQ,UO1G.sO$(]QSO1G0oO$(bQSO'#CgO$(mQSO'#KWO$(uQSO,5=tO$(zQSO'#KWO$)PQSO'#KWO$)_QSO'#IuO$)mQSO,5@qO$)uQbO1G1dOOQ(CY1G1f1G1fO9ZQSO1G3_O@[QSO1G3_O$)|QSO1G3_O$*RQSO1G3_OOQQ1G3_1G3_O!BkQSO1G2}O!&^Q,UO1G2zO$*WQSO1G2zOOQQ1G2{1G2{O!&^Q,UO1G2{O$*]QSO1G2{O$*eQWO'#GyOOQQ1G2}1G2}O!3{QWO'#IqO!BpQ`O1G3QOOQQ1G3Q1G3QOOQQ,5=k,5=kO$*mQ,UO,5=mO9ZQSO,5=mO#NWQSO,5=oO9OQSO,5=oO!@eQWO,5=oO!@mQ,UO,5=oO9{Q,UO,5=oO$*{QSO'#KUO$+WQSO,5=pOOQQ1G.i1G.iO$+]Q(C[O1G.iO@[QSO1G.iO$+hQSO1G.iO9eQ(C[O1G.iO$-mQbO,5@sO$-}QSO,5@sO9TQSO,5@sO$.YQUO,5=wO$.aQSO,5=wOOQQ1G3a1G3aO`QUO1G3aOOQQ1G3g1G3gOOQQ1G3i1G3iO>eQSO1G3kO$.fQUO1G3mO$2jQUO'#HlOOQQ1G3p1G3pO$2wQSO'#HrO>jQSO'#HtOOQQ1G3v1G3vO$3PQUO1G3vO9eQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9eQ(C[O1G4QO9eQ(C[O1G4SO$7WQSO,5@TO!*SQUO,5;YO9TQSO,5;YO>jQSO,5:SO!*SQUO,5:SO!@eQWO,5:SO$7]Q$IUO,5:SOOQO,5;Y,5;YO$7gQWO'#I]O$7}QSO,5@SOOQ(CY1G/m1G/mO$8VQWO'#IcO$8aQSO,5@bOOQ(CW1G0s1G0sO# `QWO,5:SOOQO'#I`'#I`O$8iQWO,5:nOOQ(CY,5:n,5:nO#%ZQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>jQSO1G0nO!@eQWO1G0nO!@mQ,UO1G0nOOQ(CW1G5o1G5oO!@YQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$8pQ(C[O1G0gO$8{Q(C[O1G0gO!@eQWO1G0ZOChQWO1G0ZO$9ZQ(C[O1G0gOOQO1G0Z1G0ZO$9oQ(CjO1G0gPOOO-E<S-E<SPOOO1G.f1G.fOOOO1G/d1G/dO$9yQ`O,5<dO$:RQbO1G4bOOQO1G4h1G4hO%[QUO,5>vO$:]QSO1G5mO$:eQSO1G5zO$:mQbO1G5{O9TQSO,5>|O$:wQ(CjO1G5xO%[QUO1G5xO$;XQ(C[O1G5xO$;jQSO1G5wO$;jQSO1G5wO9TQSO1G5wO$;rQSO,5?PO9TQSO,5?POOQO,5?P,5?PO$<WQSO,5?PO$$eQSO,5?POOQO-E<c-E<cOOQO1G0^1G0^OOQO1G0`1G0`O!,YQSO1G0`OOQQ7+(^7+(^O!&^Q,UO7+(^O%[QUO7+(^O$<fQSO7+(^O$<qQ,UO7+(^O$=PQ(CjO,59oO$?XQ(CjO,5<eO$AdQ(CjO,5<gO$CoQ(CjO,5<uOOQ(CY7+&Z7+&ZO$FQQ(CjO7+&ZO$FtQ,UO'#I^O$GOQSO,5@UOOQ(CY1G/w1G/wO$GWQUO'#I_O$GeQSO,5@VO$GmQbO,5@VOOQ(CY1G/|1G/|O$GwQSO7+&dOOQ(CY7+&d7+&dO$G|Q$IUO,5:cO%[QUO7+&vO$HWQ$IUO,5:ZO$HeQ$IUO,5:gO$HoQ$IUO,5:iOOQ(CY7+&|7+&|OOQO1G1n1G1nOOQO1G1o1G1oO$HyQ#tO,5<VO!*SQUO,5<UOOQO-E<d-E<dOOQ(CY7+'U7+'UOOOO7+'a7+'aOOOO1G1x1G1xO$IUQSO1G1xOOQ(CY1G1z1G1zO$IZQ`O,59iOOOO-E<W-E<WOOQ(CY1G/R1G/RO$IbQ(CjO7+'gOOQ(CY,5?U,5?UO$JUQ`O,5?UOOQ(CY1G2`1G2`P!&^Q,UO'#IjPOQ(CY-E<h-E<hO$JtQ,UO1G2lO$KgQ,UO1G2nO$KqQ`O1G2pOOQ(CY1G2X1G2XO$KxQSO'#IiO$LWQSO,5@iO$LWQSO,5@iO$L`QSO,5@iO$LkQSO,5@iOOQO1G2Z1G2ZO$LyQ,UO1G2YO!'vQ,UO1G2YO$MZQMhO'#IkO$MkQSO,5@jO!&^Q,UO,5@jO$MsQ`O,5@jOOQ(CY1G2^1G2^OOQ(CW,5<w,5<wOOQ(CW,5<x,5<xO$$eQSO,5<xOCXQSO,5<xO!@eQWO,5<wOOQO'#G`'#G`O$M}QSO,5<yOOQ(CW,5<{,5<{O$$eQSO,5=OOOQO,5?W,5?WOOQO-E<j-E<jOOQ(CY1G2b1G2bO!3{QWO,5<wO$NVQSO,5<xO#NRQSO,5<yO!3{QWO,5<xO$NbQ,UO1G5eO$NlQ,UO1G5eOOQO,5?X,5?XOOQO-E<k-E<kOOQO1G.x1G.xO!7cQWO,59qO%[QUO,59qO$NyQSO1G2TO!'vQ,UO1G2[O% OQ(CjO7+'hOOQ(CY7+'h7+'hO!$ZQUO7+'hO% rQSO,5;YOOQ(CW,5?Z,5?ZOOQ(CW-E<m-E<mOOQ(CY7+%a7+%aO% wQ`O'#KPO#%ZQSO7+(^O%!RQbO7+(^O$<iQSO7+(^O%!YQ(ChO'#CgO%!mQ(ChO,5<|O%#_QSO,5<|OOQ(CW1G5b1G5bOOQQ7+$_7+$_O!@YQ(C[O7+$_O!@eQWO7+$_O!$ZQUO7+&ZO%#dQSO'#ItO%#{QSO,5@rOOQO1G3`1G3`O9ZQSO,5@rO%#{QSO,5@rO%$TQSO,5@rOOQO,5?a,5?aOOQO-E<s-E<sOOQ(CY7+'O7+'OO%$YQSO7+(yO9eQ(C[O7+(yO9ZQSO7+(yO@[QSO7+(yOOQQ7+(i7+(iO%$_Q(ChO7+(fO!&^Q,UO7+(fO%$iQ`O7+(gOOQQ7+(g7+(gO!&^Q,UO7+(gO%$pQSO'#KTO%${QSO,5=eOOQO,5?],5?]OOQO-E<o-E<oOOQQ7+(l7+(lO%&[QWO'#HSOOQQ1G3X1G3XO!&^Q,UO1G3XO%[QUO1G3XO%&cQSO1G3XO%&nQ,UO1G3XO9eQ(C[O1G3ZO#NWQSO1G3ZO9OQSO1G3ZO!@eQWO1G3ZO!@mQ,UO1G3ZO%&|QSO'#IsO%'bQSO,5@pO%'jQWO,5@pOOQ(CW1G3[1G3[OOQQ7+$T7+$TO@[QSO7+$TO9eQ(C[O7+$TO%'uQSO7+$TO%[QUO1G6_O%[QUO1G6`O%'zQ(C[O1G6_O%(UQUO1G3cO%(]QSO1G3cO%(bQUO1G3cOOQQ7+({7+({O9eQ(C[O7+)VO`QUO7+)XOOQQ'#KZ'#KZOOQQ'#Iv'#IvO%(iQUO,5>WOOQQ,5>W,5>WO%[QUO'#HmO%(vQSO'#HoOOQQ,5>^,5>^O9TQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%({QWO1G5oO%)aQ$IUO1G0tO%)kQSO1G0tOOQO1G/n1G/nO%)vQ$IUO1G/nO>jQSO1G/nO!*SQUO'#DhOOQO,5>w,5>wOOQO-E<Z-E<ZOOQO,5>},5>}OOQO-E<a-E<aO!@eQWO1G/nOOQO-E<^-E<^OOQ(CY1G0Y1G0YOOQ(CY7+%r7+%rO#%ZQSO7+%rOOQ(CY7+&Y7+&YO>jQSO7+&YO!@eQWO7+&YOOQO7+%u7+%uO$9oQ(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%*QQ(C[O7+&RO!@YQ(C[O7+%uO!@eQWO7+%uO%*]Q(C[O7+&RO%*kQ(CjO7++dO%[QUO7++dO%*{QSO7++cO%*{QSO7++cOOQO1G4k1G4kO9TQSO1G4kO%+TQSO1G4kOOQO7+%z7+%zO#%ZQSO<<KxO%!RQbO<<KxO%+cQSO<<KxOOQQ<<Kx<<KxO!&^Q,UO<<KxO%[QUO<<KxO%+kQSO<<KxO%+vQ(CjO1G2lO%.RQ(CjO1G2nO%0^Q(CjO1G2YO%2oQ,UO,5>xOOQO-E<[-E<[O%2yQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%3TQSO1G5qOOQ(CY<<JO<<JOO%3]Q$IUO1G0oO%5gQ$IUO1G0yO%5nQ$IUO1G0yO%7rQ$IUO1G0yO%7yQ$IUO1G0yO%9nQ$IUO1G0yO%:UQ$IUO1G0yO%<iQ$IUO1G0yO%<pQ$IUO1G0yO%>tQ$IUO1G0yO%>{Q$IUO1G0yO%@sQ$IUO1G0yO%AWQ(CjO<<JbO%B]Q$IUO1G0yO%DRQ$IUO'#J`O%FUQ$IUO1G1_O%FcQ$IUO1G0RO!*SQUO'#FmOOQO'#J{'#J{OOQO1G1q1G1qO%FmQSO1G1pO%FrQ$IUO,5?SOOOO7+'d7+'dOOOO1G/T1G/TOOQ(CY1G4p1G4pO!'vQ,UO7+([O%F|QSO,5?TO9ZQSO,5?TOOQO-E<g-E<gO%G[QSO1G6TO%G[QSO1G6TO%GdQSO1G6TO%GoQ,UO7+'tO%HPQ`O,5?VO%HZQSO,5?VO!&^Q,UO,5?VOOQO-E<i-E<iO%H`Q`O1G6UO%HjQSO1G6UOOQ(CW1G2d1G2dO$$eQSO1G2dOOQ(CW1G2c1G2cO%HrQSO1G2eO!&^Q,UO1G2eOOQ(CW1G2j1G2jO!@eQWO1G2cOCXQSO1G2dO%HwQSO1G2eO%IPQSO1G2dO!'vQ,UO7++POOQ(CY1G/]1G/]O%I[QSO1G/]OOQ(CY7+'o7+'oO%IaQ,UO7+'vO%IqQ(CjO<<KSOOQ(CY<<KS<<KSO%JeQSO1G0tO!&^Q,UO'#InO%JjQSO,5@kO!&^Q,UO1G2hOOQQ<<Gy<<GyO!@YQ(C[O<<GyO%JrQ(CjO<<IuOOQ(CY<<Iu<<IuOOQO,5?`,5?`O%KfQSO,5?`O%KkQSO,5?`OOQO-E<r-E<rO%KyQSO1G6^O%KyQSO1G6^O9ZQSO1G6^O@[QSO<<LeOOQQ<<Le<<LeO%LRQSO<<LeO9eQ(C[O<<LeOOQQ<<LQ<<LQO%$_Q(ChO<<LQOOQQ<<LR<<LRO%$iQ`O<<LRO%LWQWO'#IpO%LcQSO,5@oO!*SQUO,5@oOOQQ1G3P1G3PO%LkQUO'#JiOOQO'#Ir'#IrO9eQ(C[O'#IrO%LuQWO,5=nOOQQ,5=n,5=nO%L|QWO'#EaO%MbQSO7+(sO%MgQSO7+(sOOQQ7+(s7+(sO!&^Q,UO7+(sO%[QUO7+(sO%MoQSO7+(sOOQQ7+(u7+(uO9eQ(C[O7+(uO#NWQSO7+(uO9OQSO7+(uO!@eQWO7+(uO%MzQSO,5?_OOQO-E<q-E<qOOQO'#HV'#HVO%NVQSO1G6[O9eQ(C[O<<GoOOQQ<<Go<<GoO@[QSO<<GoO%N_QSO7++yO%NdQSO7++zO%[QUO7++yO%[QUO7++zOOQQ7+(}7+(}O%NiQSO7+(}O%NnQUO7+(}O%NuQSO7+(}OOQQ<<Lq<<LqOOQQ<<Ls<<LsOOQQ-E<t-E<tOOQQ1G3r1G3rO%NzQSO,5>XOOQQ,5>Z,5>ZO& PQSO1G3xO9TQSO7+&`O!*SQUO7+&`OOQO7+%Y7+%YO& UQ$IUO1G5{O>jQSO7+%YOOQ(CY<<I^<<I^OOQ(CY<<It<<ItO>jQSO<<ItOOQO<<Im<<ImO$9oQ(CjO<<ImO%[QUO<<ImOOQO<<Ia<<IaO!@YQ(C[O<<IaO& `Q(C[O<<ImO& kQ(CjO<= OO& {QSO<<N}OOQO7+*V7+*VO9TQSO7+*VOOQQANAdANAdO&!TQSOANAdO!&^Q,UOANAdO#%ZQSOANAdO%!RQbOANAdO%[QUOANAdO&!]Q(CjO7+'tO&$nQ(CjO7+'vO&'PQbO1G4eO&'ZQ$IUO7+&ZO&'hQ$IUO,59oO&)kQ$IUO,5<eO&+nQ$IUO,5<gO&-qQ$IUO,5<uO&/gQ$IUO7+'gO&/tQ$IUO7+'hO&0RQSO,5<XOOQO7+'[7+'[O&0WQ,UO<<KvOOQO1G4o1G4oO&0_QSO1G4oO&0jQSO1G4oO&0xQSO7++oO&0xQSO7++oO!&^Q,UO1G4qO&1QQ`O1G4qO&1[QSO7++pOOQ(CW7+(O7+(OO$$eQSO7+(PO&1dQ`O7+(POOQ(CW7+'}7+'}O$$eQSO7+(OO&1kQSO7+(PO!&^Q,UO7+(POCXQSO7+(OO&1pQ,UO<<NkOOQ(CY7+$w7+$wO&1zQ`O,5?YOOQO-E<l-E<lO&2UQ(ChO7+(SOOQQAN=eAN=eO9ZQSO1G4zOOQO1G4z1G4zO&2fQSO1G4zO&2kQSO7++xO&2kQSO7++xO9eQ(C[OANBPO@[QSOANBPOOQQANBPANBPOOQQANAlANAlOOQQANAmANAmO&2sQSO,5?[OOQO-E<n-E<nO&3OQ$IUO1G6ZO&5`QbO'#CgOOQO,5?^,5?^OOQO-E<p-E<pOOQQ1G3Y1G3YO%LkQUO,5<yOOQQ<<L_<<L_O!&^Q,UO<<L_O%MbQSO<<L_O&5jQSO<<L_O%[QUO<<L_OOQQ<<La<<LaO9eQ(C[O<<LaO#NWQSO<<LaO9OQSO<<LaO&5rQWO1G4yO&5}QSO7++vOOQQAN=ZAN=ZO9eQ(C[OAN=ZOOQQ<= e<= eOOQQ<= f<= fO&6VQSO<= eO&6[QSO<= fOOQQ<<Li<<LiO&6aQSO<<LiO&6fQUO<<LiOOQQ1G3s1G3sO>jQSO7+)dO&6mQSO<<IzO&6xQ$IUO<<IzOOQO<<Ht<<HtOOQ(CYAN?`AN?`OOQOAN?XAN?XO$9oQ(CjOAN?XOOQOAN>{AN>{O%[QUOAN?XOOQO<<Mq<<MqOOQQG27OG27OO!&^Q,UOG27OO#%ZQSOG27OO&7SQSOG27OO%!RQbOG27OO&7[Q$IUO<<JbO&7iQ$IUO1G2YO&9_Q$IUO1G2lO&;bQ$IUO1G2nO&=eQ$IUO<<KSO&=rQ$IUO<<IuOOQO1G1s1G1sO!'vQ,UOANAbOOQO7+*Z7+*ZO&>PQSO7+*ZO&>[QSO<= ZO&>dQ`O7+*]OOQ(CW<<Kk<<KkO$$eQSO<<KkOOQ(CW<<Kj<<KjO&>nQ`O<<KkO$$eQSO<<KjOOQO7+*f7+*fO9ZQSO7+*fO&>uQSO<= dOOQQG27kG27kO9eQ(C[OG27kO!*SQUO1G4vO&>}QSO7++uO%MbQSOANAyOOQQANAyANAyO!&^Q,UOANAyO&?VQSOANAyOOQQANA{ANA{O9eQ(C[OANA{O#NWQSOANA{OOQO'#HW'#HWOOQO7+*e7+*eOOQQG22uG22uOOQQANEPANEPOOQQANEQANEQOOQQANBTANBTO&?_QSOANBTOOQQ<<MO<<MOO!*SQUOAN?fOOQOG24sG24sO$9oQ(CjOG24sO#%ZQSOLD,jOOQQLD,jLD,jO!&^Q,UOLD,jO&?dQSOLD,jO&?lQ$IUO7+'tO&AbQ$IUO7+'vO&CWQ,UOG26|OOQO<<Mu<<MuOOQ(CWANAVANAVO$$eQSOANAVOOQ(CWANAUANAUOOQO<<NQ<<NQOOQQLD-VLD-VO&ChQ$IUO7+*bOOQQG27eG27eO%MbQSOG27eO!&^Q,UOG27eOOQQG27gG27gO9eQ(C[OG27gOOQQG27oG27oO&CrQ$IUOG25QOOQOLD*_LD*_OOQQ!$(!U!$(!UO#%ZQSO!$(!UO!&^Q,UO!$(!UO&C|Q(CjOG26|OOQ(CWG26qG26qOOQQLD-PLD-PO%MbQSOLD-POOQQLD-RLD-ROOQQ!)9Ep!)9EpO#%ZQSO!)9EpOOQQ!$(!k!$(!kOOQQ!.K;[!.K;[O&F_Q$IUOG26|O!*SQUO'#DwO1PQSO'#EUO&HTQbO'#JeO!*SQUO'#DoO&H[QUO'#D{O&HcQbO'#CgO&JyQbO'#CgO!*SQUO'#D}O&KZQUO,5;TO!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO,5;_O!*SQUO'#IhO&M^QSO,5<dO&MfQ,UO,5;_O&NyQ,UO,5;_O!*SQUO,5;sO1SQSO'#DTO1SQSO'#DTO!&^Q,UO'#FyO&MfQ,UO'#FyO!&^Q,UO'#F{O&MfQ,UO'#F{O!&^Q,UO'#GZO&MfQ,UO'#GZO!*SQUO,5:gO!*SQUO,5@aO&KZQUO1G0oO' QQ$IUO'#CgO!*SQUO1G1{O!&^Q,UO,5=QO&MfQ,UO,5=QO!&^Q,UO,5=SO&MfQ,UO,5=SO!&^Q,UO,5<nO&MfQ,UO,5<nO&KZQUO1G1|O!*SQUO7+&vO!&^Q,UO1G2YO&MfQ,UO1G2YO!&^Q,UO1G2[O&MfQ,UO1G2[O&KZQUO7+'hO&KZQUO7+&ZO!&^Q,UOANAbO&MfQ,UOANAbO' [QSO'#EiO' aQSO'#EiO' iQSO'#FXO' nQSO'#EsO' sQSO'#JuO'!OQSO'#JsO'!ZQSO,5;TO'!`Q,UO,5<aO'!gQSO'#GSO'!lQSO'#GSO'!qQSO,5<bO'!yQSO,5;TO'#RQ$IUO1G1[O'#YQSO,5<nO'#_QSO,5<nO'#dQSO,5<pO'#iQSO,5<pO'#nQSO1G1|O'#sQSO1G0oO'#xQ,UO<<KvO'$PQ,UO<<KvO7hQ,UO'#FwO9OQSO'#FvOAVQSO'#EhO!*SQUO,5;pO!2|QSO'#GSO!2|QSO'#GSO!2|QSO'#GUO!2|QSO'#GUO!'vQ,UO7+([O!'vQ,UO7+([O$KqQ`O1G2pO$KqQ`O1G2pO!&^Q,UO,5=UO!&^Q,UO,5=U",
    stateData: "'%Y~O'oOS'pOSROS'qRQ~OPYOQYOW!VO_qObzOcyOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!YXO!duO!iZO!lYO!mYO!nYO!pvO!rwO!uxO!y]O#q!PO$R|O$VfO%a}O%c!QO%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO%r!UO&O!WO&U!XO&W!YO&Y!ZO&[![O&_!]O&e!^O&k!_O&m!`O&o!aO&q!bO&s!cO'vSO'xTO'{UO(TVO(c[O(piO~OUtO~P`OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~O_!vOm!nO}!oO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!wO#Q!pO#R!pO#U!yO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O'q!zO~OPZXYZX_ZXlZXzZX{ZX}ZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX'mZX(TZX(dZX(kZX(lZX~O!b${X~P(qO]!|O'x#OO'y!|O'z#OO~O]#PO'z#OO'{#OO'|#PO~Or#RO!P#SO(U#SO(V#UO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v9vO'xTO'{UO(TVO(c[O(piO~O!V#YO!W#VO!T(ZP!T(hP~P+}O!X#bO~P`OPYOQYOb!jOc!iOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'xTO'{UO(TVO(c[O(piO~Oj#lO!V#hO!y]O#c#kO#d#hO'v9wO!h(eP~P.iO!i#nO'v#mO~O!u#rO!y]O%a#sO~O#e#tO~O!b#uO#e#tO~OP$]OY$dOl$QOz#yO{#zO}#{O!W$aO!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O_(XX'm(XX'k(XX!h(XX!T(XX!Y(XX%b(XX!b(XX~P1qO#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#p(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX!Y(YX%b(YX~O_(YX!g(YX'm(YX'k(YX!T(YX!h(YXp(YX!b(YX~P4XO#Y$eO~O$X$gO$Z$fO$b$lO~O!Y$mO$VfO$e$nO$g$pO~Oj%SOl$tOm$sOn$sOt%TOv%UOx%VO}${O!Y$|O!d%[O!i$xO#d%]O$R%YO$n%WO$p%XO$s%ZO'v$rO'xTO'{UO(P%RO(T$uOe(QP~O!i%^O~O}%aO!Y%bO'v%`O~O!b%fO~O_%gO'm%gO~O'w!lO~P%[O%g%nO~P%[O!i%^O'v%`O'w!lO(P%RO~Oc%uO!i%^O'v%`O~O#p$SO~Oz%zO!Y%wO!i%yO%c%}O'v%`O'w!lO'xTO'{UO^(yP~O!u#rO~O%l&PO}(uX!Y(uX'v(uX~O'v&QO~O!r&VO#q!PO%c!QO%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO~Ob&[Oc&ZO!u&XO%a&YO%t&WO~P;rOb&_OcyO!Y&^O!r&VO!uxO!y]O#q!PO%a}O%e!OO%f!OO%g!OO%j!RO%l!SO%o!TO%p!TO%r!UO~O`&bO#Y&eO%c&`O'w!lO~P<wO!i&fO!r&jO~O!i#nO~O!YXO~O_%gO'l&rO'm%gO~O_%gO'l&uO'm%gO~O_%gO'l&wO'm%gO~O'kZX!TZXpZX!hZX&SZX!YZX%bZX!bZX~P(qO!]'UO!^&}O!_&}O'w!lO'xTO'{UO~Om&{O}&zO!V'OO(W&yO!X([P!X(jP~P@OOh'XO!Y'VO'v%`O~Oc'^O!i%^O'v%`O~Oz%zO!i%yO~Om!nO}!oO!y9rO!}!pO#O!pO#Q!pO#R!pO'w!lO'xTO'{UO(W!mO(c!sO~O!]'dO!^'cO!_'cO#P!pO#U'eO#V'eO~PAjO_%gO!b#uO!i%^O'm%gO(P%RO(d'gO~O!m'kO#Y'iO~PBxOm!nO}!oO'xTO'{UO(W!mO(c!sO~O!YXOm(aX}(aX!](aX!^(aX!_(aX!y(aX!}(aX#O(aX#P(aX#Q(aX#R(aX#U(aX#V(aX'w(aX'x(aX'{(aX(W(aX(c(aX~O!^'cO!_'cO'w!lO~PChO'r'oO's'oO't'qO~O]!|O'x'sO'y!|O'z'sO~O]#PO'z'sO'{'sO'|#PO~Or#RO!P#SO(U#SO(V'wO~O!V'yO!T'OX!T'UX!W'OX!W'UX~P+}O!W'{O!T(ZX~OP$]OY$dOl$QOz#yO{#zO}#{O!W'{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O!T(ZX~PG[O!T(QO~O!T(gX!W(gX!b(gX!h(gX(d(gX~O#Y(gX#e#^X!X(gX~PIbO#Y(RO!T(iX!W(iX~O!W(SO!T(hX~O!T(VO~O#Y$eO~PIbO!X(WO~P`Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!kaY!kal!ka!W!ka!f!ka!m!ka#h!ka#i!ka#j!ka#k!ka#l!ka#m!ka#n!ka#o!ka#p!ka#r!ka#t!ka#v!ka#w!ka(d!ka(k!ka(l!ka~O_!ka'm!ka'k!ka!T!ka!h!kap!ka!Y!ka%b!ka!b!ka~PJxO!h(XO~O!b#uO#Y(YO(d'gO!W(fX_(fX'm(fX~O!h(fX~PMhO}%aO!Y%bO!y]O#c(_O#d(^O'v%`O~O!W(`O!h(eX~O!h(bO~O}%aO!Y%bO#d(^O'v%`O~OP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!g(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#p(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O!b#uO!h(YX~P! UOz(cO{(dO!g#wO!i#xO!y!xa}!xa~O!u!xa%a!xa!Y!xa#c!xa#d!xa'v!xa~P!#YO!u(hO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!YXO!duO!iZO!lYO!mYO!nYO!pvO!r!gO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~Oj%SOl$tOm$sOn$sOt%TOv%UOx:[O}${O!Y$|O!d;fO!i$xO#d:bO$R%YO$n:^O$p:`O$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#e(nO~Oj%SOl$tOm$sOn$sOt%TOv%UOx%VO}${O!Y$|O!d%[O!i$xO#d%]O$R%YO$n%WO$p%XO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~Oe(^P~P!'vO!V(rO!h(_P~P%[O(W(tO(c[O~O}(vO!i#xO(W(tO(c[O~OP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!Y!eO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O{)XO!i#xO~O!W$aO_$la'm$la'k$la!h$la!T$la!Y$la%b$la!b$la~O#q)]O~P!&^Oz)`O!b)_O!Y$YX$U$YX$X$YX$Z$YX$b$YX~O!b)_O!Y(mX$U(mX$X(mX$Z(mX$b(mX~Oz)`O~P!-lOz)`O!Y(mX$U(mX$X(mX$Z(mX$b(mX~O!Y)bO$U)fO$X)aO$Z)aO$b)gO~O!V)jO~P!*SO$X$gO$Z$fO$b)nO~Oh$tXz$tX}$tX!g$tX(k$tX(l$tX~OegXe$tXhgX!WgX#YgX~P!/bOm)pO~Or)qO(U)rO(V)tO~Oh)}Oz)vO})wO(k)yO(l){O~Oe)uO~P!0kOe*OO~Oj%SOl$tOm$sOn$sOt%TOv%UOx:[O}${O!Y$|O!d;fO!i$xO#d:bO$R%YO$n:^O$p:`O$s%ZO'xTO'{UO(P%RO(T$uO~O!V*SO'v*PO!h(qP~P!1YO#e*UO~O!i*VO~O!V*[O'v*XO!T(rP~P!1YOl*hO}*`O!]*fO!^*_O!_*_O!i*VO#U*gO%X*bO'w!lO(W!mO~O!X*eO~P!3`O!g#wOh(SXz(SX}(SX(k(SX(l(SX!W(SX#Y(SX~Oe(SX#z(SX~P!4XOh*kO#Y*jOe(RX!W(RX~O!W*lOe(QX~O'v&QOe(QP~O!i*sO~O'v(lO~Oj*wO}%aO!V#hO!Y%bO!y]O#c#kO#d#hO'v%`O!h(eP~O!b#uO#e*xO~O}%aO!V*zO!W(SO!Y%bO'v%`O!T(hP~Om'RO}*|O!V*{O'xTO'{UO(W(tO~O!X(jP~P!7SO!W*}O_(vX'm(vX~OP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO#w$YO(TVO(d$ZO(k#|O(l#}O~O_!ca!W!ca'm!ca'k!ca!T!ca!h!cap!ca!Y!ca%b!ca!b!ca~P!7zOz#yO{#zO}#{O!g#wO!i#xO(TVOP!oaY!oal!oa!W!oa!f!oa!m!oa#h!oa#i!oa#j!oa#k!oa#l!oa#m!oa#n!oa#o!oa#p!oa#r!oa#t!oa#v!oa#w!oa(d!oa(k!oa(l!oa~O_!oa'm!oa'k!oa!T!oa!h!oap!oa!Y!oa%b!oa!b!oa~P!:eOz#yO{#zO}#{O!g#wO!i#xO(TVOP!qaY!qal!qa!W!qa!f!qa!m!qa#h!qa#i!qa#j!qa#k!qa#l!qa#m!qa#n!qa#o!qa#p!qa#r!qa#t!qa#v!qa#w!qa(d!qa(k!qa(l!qa~O_!qa'm!qa'k!qa!T!qa!h!qap!qa!Y!qa%b!qa!b!qa~P!=OOh+WO!Y'VO%b+VO(P%RO~O!b+YO_(OX!Y(OX'm(OX!W(OX~O_%gO!YXO'm%gO~O!i%^O(P%RO~O!i%^O'v%`O(P%RO~O!b#uO#e(nO~O`+eO%c+fO'v+bO'xTO'{UO!X(zP~O!W+gO^(yX~OY+kO~O^+lO~O!Y%wO'v%`O'w!lO^(yP~O#Y+qO(P%RO~Oh+tO!Y$|O(P%RO~O!Y+vO~Oz+xO!YXO~O%g%nO~O!u+}O~Oc,SO~O`,TO'v#mO'xTO'{UO!X(xP~Oc%uO~O%c!QO'v&QO~P<wOY,YO^,XO~OPYOQYObzOcyOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!duO!iZO!lYO!mYO!nYO!pvO!uxO!y]O$VfO%a}O'xTO'{UO(TVO(c[O(piO~O!Y!eO!r!gO$R!kO'v!dO~P!DRO^,XO_%gO'm%gO~OPYOQYOb!jOc!iOjkOlYOmkOnkOtkOvYOxYO}WO!RkO!SkO!Y!eO!duO!iZO!lYO!mYO!nYO!pvO!u!hO$R!kO$VfO'v!dO'xTO'{UO(TVO(c[O(piO~O_,_O!rwO#q!OO%e!OO%f!OO%g!OO~P!FkO!i&fO~O&U,eO~O!Y,gO~O&g,iO&i,jOP&daQ&daW&da_&dab&dac&daj&dal&dam&dan&dat&dav&dax&da}&da!R&da!S&da!Y&da!d&da!i&da!l&da!m&da!n&da!p&da!r&da!u&da!y&da#q&da$R&da$V&da%a&da%c&da%e&da%f&da%g&da%j&da%l&da%o&da%p&da%r&da&O&da&U&da&W&da&Y&da&[&da&_&da&e&da&k&da&m&da&o&da&q&da&s&da'k&da'v&da'x&da'{&da(T&da(c&da(p&da!X&da&]&da`&da&b&da~O'v,oO~O!W|X!W!`X!X|X!X!`X!b|X!b!`X!i!`X#Y|X(P!`X~O!b,tO#Y,sO!W#bX!W(]X!X#bX!X(]X!b(]X!i(]X(P(]X~O!b,vO!i%^O(P%RO!W![X!X![X~Om!nO}!oO'xTO'{UO(W!mO~OP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!Y!eO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'xTO'{UO(TVO(c[O(p;`O~O'v:gO~P# qO!W,zO!X([X~O!X,|O~O!b,tO#Y,sO!W#bX!X#bX~O!W,}O!X(jX~O!X-PO~O!^-QO!_-QO'w!lO~P# `O!X-TO~P'_Oh-WO!Y'VO~O!T-]O~Om!xa!]!xa!^!xa!_!xa!}!xa#O!xa#P!xa#Q!xa#R!xa#U!xa#V!xa'w!xa'x!xa'{!xa(W!xa(c!xa~P!#YO!m-bO#Y-`O~PBxO!^-dO!_-dO'w!lO~PChO_%gO#Y-`O'm%gO~O_%gO!b#uO#Y-`O'm%gO~O_%gO!b#uO!m-bO#Y-`O'm%gO(d'gO~O'r'oO's'oO't-iO~Op-jO~O!T'Oa!W'Oa~P!7zO!V-nO!T'OX!W'OX~P%[O!W'{O!T(Za~O!T(Za~PG[O!W(SO!T(ha~O}%aO!V-rO!Y%bO'v%`O!T'UX!W'UX~O#Y-tO!W(fa!h(fa_(fa'm(fa~O!b#uO~P#)wO!W(`O!h(ea~O}%aO!Y%bO#d-xO'v%`O~Oj-}O}%aO!V-zO!Y%bO!y]O#c-|O#d-zO'v%`O!W'XX!h'XX~O{.RO!i#xO~Oh.UO!Y'VO%b.TO(P%RO~O_#]i!W#]i'm#]i'k#]i!T#]i!h#]ip#]i!Y#]i%b#]i!b#]i~P!7zOh;lOz)vO})wO(k)yO(l){O~O#e#Xa_#Xa#Y#Xa'm#Xa!W#Xa!h#Xa!Y#Xa!T#Xa~P#,sO#e(SXP(SXY(SX_(SXl(SX{(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX'm(SX(T(SX(d(SX!h(SX!T(SX'k(SXp(SX!Y(SX%b(SX!b(SX~P!4XO!W._Oe(^X~P!0kOe.aO~O!W.bO!h(_X~P!7zO!h.eO~O!T.gO~OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gi_#gil#gi!W#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O#h#gi~P#0oO#h$OO~P#0oOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO(TVOY#gi_#gi!W#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~Ol#gi~P#3aOl$QO~P#3aOP$]Ol$QOz#yO{#zO}#{O!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO(TVO_#gi!W#gi#r#gi#t#gi#v#gi#w#gi'm#gi(d#gi(k#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P#6ROY$dO!f$SO#m$SO#n$SO#o$cO#p$SO~P#6ROP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO(TVO_#gi!W#gi#t#gi#v#gi#w#gi'm#gi(d#gi(l#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O(k#gi~P#9SO(k#|O~P#9SOP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO(TVO(k#|O_#gi!W#gi#v#gi#w#gi'm#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~O(l#gi~P#;tO(l#}O~P#;tOP$]OY$dOl$QOz#yO{#zO}#{O!f$SO!g#wO!i#xO!m$]O#h$OO#i$PO#j$PO#k$PO#l$RO#m$SO#n$SO#o$cO#p$SO#r$TO#t$VO#v$XO(TVO(k#|O(l#}O~O_#gi!W#gi#w#gi'm#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#>fOPZXYZXlZXzZX{ZX}ZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX!WZX!XZX~O#zZX~P#APOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO#w:UO(TVO(d$ZO(k#|O(l#}O~O#z.iO~P#C^O#Y:ZO#|:ZO#z(YX!X(YX~P! UO_'[a!W'[a'm'[a'k'[a!h'[a!T'[ap'[a!Y'[a%b'[a!b'[a~P!7zOP#giY#gi_#gil#gi{#gi!W#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi'm#gi(T#gi(d#gi'k#gi!T#gi!h#gip#gi!Y#gi%b#gi!b#gi~P#,sO_#{i!W#{i'm#{i'k#{i!T#{i!h#{ip#{i!Y#{i%b#{i!b#{i~P!7zO$X.nO$Z.nO~O$X.oO$Z.oO~O!b)_O#Y.pO!Y$_X$U$_X$X$_X$Z$_X$b$_X~O!V.qO~O!Y)bO$U.sO$X)aO$Z)aO$b.tO~O!W:VO!X(XX~P#C^O!X.uO~O!b)_O$b(mX~O$b.wO~Or)qO(U)rO(V.zO~O!T/OO~P!&^O!WdX!bdX!hdX!h$tX(ddX~P!/bO!h/UO~P#,sO!W/VO!b#uO(d'gO!h(qX~O!h/[O~O!V*SO'v%`O!h(qP~O#e/^O~O!T$tX!W$tX!b${X~P!/bO!W/_O!T(rX~P#,sO!b/aO~O!T/cO~Ol/gO!b#uO!i%^O(P%RO(d'gO~O'v/iO~O!b+YO~O_%gO!W/mO'm%gO~O!X/oO~P!3`O!^/pO!_/pO'w!lO(W!mO~O}/rO(W!mO~O#U/sO~O'v&QOe'aX!W'aX~O!W*lOe(Qa~Oe/xO~Oz/yO{/yO}/zOhwa(kwa(lwa!Wwa#Ywa~Oewa#zwa~P$ tOz)vO})wOh$ma(k$ma(l$ma!W$ma#Y$ma~Oe$ma#z$ma~P$!jOz)vO})wOh$oa(k$oa(l$oa!W$oa#Y$oa~Oe$oa#z$oa~P$#]O#e/|O~Oe$}a!W$}a#Y$}a#z$}a~P!0kO!b#uO~O#e0PO~O!W*}O_(va'm(va~Oz#yO{#zO}#{O!g#wO!i#xO(TVOP!oiY!oil!oi!W!oi!f!oi!m!oi#h!oi#i!oi#j!oi#k!oi#l!oi#m!oi#n!oi#o!oi#p!oi#r!oi#t!oi#v!oi#w!oi(d!oi(k!oi(l!oi~O_!oi'm!oi'k!oi!T!oi!h!oip!oi!Y!oi%b!oi!b!oi~P$$zOh.UO!Y'VO%b.TO~Oj0ZO'v0YO~P!1]O!b+YO_(Oa!Y(Oa'm(Oa!W(Oa~O#e0aO~OYZX!WdX!XdX~O!W0bO!X(zX~O!X0dO~OY0eO~O`0gO'v+bO'xTO'{UO~O!Y%wO'v%`O^'iX!W'iX~O!W+gO^(ya~O!h0jO~P!7zOY0mO~O^0nO~O#Y0qO~Oh0tO!Y$|O~O(W(tO!X(wP~Oh0}O!Y0zO%b0|O(P%RO~OY1XO!W1VO!X(xX~O!X1YO~O^1[O_%gO'm%gO~O'v#mO'xTO'{UO~O#Y$eO#|$eOP(YXY(YXl(YXz(YX{(YX}(YX!W(YX!f(YX!i(YX!m(YX#h(YX#i(YX#j(YX#k(YX#l(YX#m(YX#n(YX#o(YX#r(YX#t(YX#v(YX#w(YX(T(YX(d(YX(k(YX(l(YX~O#p1_O&S1`O_(YX!g(YX~P$+sO#Y$eO#p1_O&S1`O~O_1bO~P%[O_1dO~O&]1gOP&ZiQ&ZiW&Zi_&Zib&Zic&Zij&Zil&Zim&Zin&Zit&Ziv&Zix&Zi}&Zi!R&Zi!S&Zi!Y&Zi!d&Zi!i&Zi!l&Zi!m&Zi!n&Zi!p&Zi!r&Zi!u&Zi!y&Zi#q&Zi$R&Zi$V&Zi%a&Zi%c&Zi%e&Zi%f&Zi%g&Zi%j&Zi%l&Zi%o&Zi%p&Zi%r&Zi&O&Zi&U&Zi&W&Zi&Y&Zi&[&Zi&_&Zi&e&Zi&k&Zi&m&Zi&o&Zi&q&Zi&s&Zi'k&Zi'v&Zi'x&Zi'{&Zi(T&Zi(c&Zi(p&Zi!X&Zi`&Zi&b&Zi~O`1mO!X1kO&b1lO~P`O!YXO!i1oO~O&i,jOP&diQ&diW&di_&dib&dic&dij&dil&dim&din&dit&div&dix&di}&di!R&di!S&di!Y&di!d&di!i&di!l&di!m&di!n&di!p&di!r&di!u&di!y&di#q&di$R&di$V&di%a&di%c&di%e&di%f&di%g&di%j&di%l&di%o&di%p&di%r&di&O&di&U&di&W&di&Y&di&[&di&_&di&e&di&k&di&m&di&o&di&q&di&s&di'k&di'v&di'x&di'{&di(T&di(c&di(p&di!X&di&]&di`&di&b&di~O!T1uO~O!W![a!X![a~P#C^Om!nO}!oO!V1{O(W!mO!W'PX!X'PX~P@OO!W,zO!X([a~O!W'VX!X'VX~P!7SO!W,}O!X(ja~O!X2SO~P'_O_%gO#Y2]O'm%gO~O_%gO!b#uO#Y2]O'm%gO~O_%gO!b#uO!m2aO#Y2]O'm%gO(d'gO~O_%gO'm%gO~P!7zO!W$aOp$la~O!T'Oi!W'Oi~P!7zO!W'{O!T(Zi~O!W(SO!T(hi~O!T(ii!W(ii~P!7zO!W(fi!h(fi_(fi'm(fi~P!7zO#Y2cO!W(fi!h(fi_(fi'm(fi~O!W(`O!h(ei~O}%aO!Y%bO!y]O#c2hO#d2gO'v%`O~O}%aO!Y%bO#d2gO'v%`O~Oh2oO!Y'VO%b2nO~Oh2oO!Y'VO%b2nO(P%RO~O#ewaPwaYwa_walwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa'mwa(Twa(dwa!hwa!Twa'kwapwa!Ywa%bwa!bwa~P$ tO#e$maP$maY$ma_$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma'm$ma(T$ma(d$ma!h$ma!T$ma'k$map$ma!Y$ma%b$ma!b$ma~P$!jO#e$oaP$oaY$oa_$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa'm$oa(T$oa(d$oa!h$oa!T$oa'k$oap$oa!Y$oa%b$oa!b$oa~P$#]O#e$}aP$}aY$}a_$}al$}a{$}a!W$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a'm$}a(T$}a(d$}a!h$}a!T$}a'k$}a#Y$}ap$}a!Y$}a%b$}a!b$}a~P#,sO_#]q!W#]q'm#]q'k#]q!T#]q!h#]qp#]q!Y#]q%b#]q!b#]q~P!7zOe'QX!W'QX~P!'vO!W._Oe(^a~O!V2wO!W'RX!h'RX~P%[O!W.bO!h(_a~O!W.bO!h(_a~P!7zO!T2zO~O#z!ka!X!ka~PJxO#z!ca!W!ca!X!ca~P#C^O#z!oa!X!oa~P!:eO#z!qa!X!qa~P!=OO!Y3^O$VfO$`3_O~O!X3cO~Op3dO~P#,sO_$iq!W$iq'm$iq'k$iq!T$iq!h$iqp$iq!Y$iq%b$iq!b$iq~P!7zO!T3eO~P#,sOz)vO})wO(l){Oh%Yi(k%Yi!W%Yi#Y%Yi~Oe%Yi#z%Yi~P$J]Oz)vO})wOh%[i(k%[i(l%[i!W%[i#Y%[i~Oe%[i#z%[i~P$KOO(d$ZO~P#,sO!V3hO'v%`O!W']X!h']X~O!W/VO!h(qa~O!W/VO!b#uO!h(qa~O!W/VO!b#uO(d'gO!h(qa~Oe$vi!W$vi#Y$vi#z$vi~P!0kO!V3pO'v*XO!T'_X!W'_X~P!1YO!W/_O!T(ra~O!W/_O!T(ra~P#,sO!b#uO#p3xO~Ol3{O!b#uO(d'gO~Oe(Ri!W(Ri~P!0kO#Y4OOe(Ri!W(Ri~P!0kO!h4RO~O_$jq!W$jq'm$jq'k$jq!T$jq!h$jqp$jq!Y$jq%b$jq!b$jq~P!7zO!T4VO~O!W4WO!Y(sX~P#,sO!g#wO~P4XO_$tX!Y$tX%VZX'm$tX!W$tX~P!/bO%V4YO_iXhiXziX}iX!YiX'miX(kiX(liX!WiX~O%V4YO~O`4`O%c4aO'v+bO'xTO'{UO!W'hX!X'hX~O!W0bO!X(za~OY4eO~O^4fO~O_%gO'm%gO~P#,sO!Y$|O~P#,sO!W4nO#Y4pO!X(wX~O!X4qO~Om!nO}4rO!]!xO!^!uO!_!uO!y9rO!}!pO#O!pO#P!pO#Q!pO#R!pO#U4wO#V!yO'w!lO'xTO'{UO(W!mO(c!sO~O!X4vO~P%%QOh4|O!Y0zO%b4{O~Oh4|O!Y0zO%b4{O(P%RO~O`5TO'v#mO'xTO'{UO!W'gX!X'gX~O!W1VO!X(xa~O'xTO'{UO(W5VO~O^5ZO~O#p5^O&S5_O~PMhO!h5`O~P%[O_5bO~O_5bO~P%[O`1mO!X5gO&b1lO~P`O!b5iO~O!b5kO!W(]i!X(]i!b(]i!i(]i(P(]i~O!W#bi!X#bi~P#C^O#Y5lO!W#bi!X#bi~O!W![i!X![i~P#C^O_%gO#Y5uO'm%gO~O_%gO!b#uO#Y5uO'm%gO~O!W(fq!h(fq_(fq'm(fq~P!7zO!W(`O!h(eq~O}%aO!Y%bO#d5|O'v%`O~O!Y'VO%b6PO~Oh6SO!Y'VO%b6PO~O#e%YiP%YiY%Yi_%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi'm%Yi(T%Yi(d%Yi!h%Yi!T%Yi'k%Yip%Yi!Y%Yi%b%Yi!b%Yi~P$J]O#e%[iP%[iY%[i_%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i'm%[i(T%[i(d%[i!h%[i!T%[i'k%[ip%[i!Y%[i%b%[i!b%[i~P$KOO#e$viP$viY$vi_$vil$vi{$vi!W$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi'm$vi(T$vi(d$vi!h$vi!T$vi'k$vi#Y$vip$vi!Y$vi%b$vi!b$vi~P#,sOe'Qa!W'Qa~P!0kO!W'Ra!h'Ra~P!7zO!W.bO!h(_i~O#z#]i!W#]i!X#]i~P#C^OP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O(TVOY#gil#gi!f#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~O#h#gi~P%3jO#h9zO~P%3jOP$]Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O(TVOY#gi!f#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~Ol#gi~P%5uOl9|O~P%5uOP$]Ol9|Oz#yO{#zO}#{O!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O(TVO#r#gi#t#gi#v#gi#w#gi#z#gi(d#gi(k#gi(l#gi!W#gi!X#gi~OY#gi!f#gi#m#gi#n#gi#o#gi#p#gi~P%8QOY:YO!f:OO#m:OO#n:OO#o:XO#p:OO~P%8QOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO(TVO#t#gi#v#gi#w#gi#z#gi(d#gi(l#gi!W#gi!X#gi~O(k#gi~P%:lO(k#|O~P%:lOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO(TVO(k#|O#v#gi#w#gi#z#gi(d#gi!W#gi!X#gi~O(l#gi~P%<wO(l#}O~P%<wOP$]OY:YOl9|Oz#yO{#zO}#{O!f:OO!g#wO!i#xO!m$]O#h9zO#i9{O#j9{O#k9{O#l9}O#m:OO#n:OO#o:XO#p:OO#r:PO#t:RO#v:TO(TVO(k#|O(l#}O~O#w#gi#z#gi(d#gi!W#gi!X#gi~P%?SO_#xy!W#xy'm#xy'k#xy!T#xy!h#xyp#xy!Y#xy%b#xy!b#xy~P!7zOh;mOz)vO})wO(k)yO(l){O~OP#giY#gil#gi{#gi!f#gi!g#gi!i#gi!m#gi#h#gi#i#gi#j#gi#k#gi#l#gi#m#gi#n#gi#o#gi#p#gi#r#gi#t#gi#v#gi#w#gi#z#gi(T#gi(d#gi!W#gi!X#gi~P%AzO!g#wOP(SXY(SXh(SXl(SXz(SX{(SX}(SX!f(SX!i(SX!m(SX#h(SX#i(SX#j(SX#k(SX#l(SX#m(SX#n(SX#o(SX#p(SX#r(SX#t(SX#v(SX#w(SX#z(SX(T(SX(d(SX(k(SX(l(SX!W(SX!X(SX~O#z#{i!W#{i!X#{i~P#C^O#z!oi!X!oi~P$$zO!X6`O~O!W'[a!X'[a~P#C^O!b#uO(d'gO!W']a!h']a~O!W/VO!h(qi~O!W/VO!b#uO!h(qi~Oe$vq!W$vq#Y$vq#z$vq~P!0kO!T'_a!W'_a~P#,sO!b6gO~O!W/_O!T(ri~P#,sO!W/_O!T(ri~O!T6kO~O!b#uO#p6pO~Ol6qO!b#uO(d'gO~O!T6sO~Oe$xq!W$xq#Y$xq#z$xq~P!0kO_$jy!W$jy'm$jy'k$jy!T$jy!h$jyp$jy!Y$jy%b$jy!b$jy~P!7zO!b5kO~O!W4WO!Y(sa~O_#]y!W#]y'm#]y'k#]y!T#]y!h#]yp#]y!Y#]y%b#]y!b#]y~P!7zOY6xO~O`6zO'v+bO'xTO'{UO~O!W0bO!X(zi~O^7OO~O(W(tO!W'dX!X'dX~O!W4nO!X(wa~OjkO'v7VO~P.iO!X7YO~P%%QOm!nO}7ZO'xTO'{UO(W!mO(c!sO~O!Y0zO~O!Y0zO%b7]O~Oh7`O!Y0zO%b7]O~OY7eO!W'ga!X'ga~O!W1VO!X(xi~O!h7iO~O!h7jO~O!h7mO~O!h7mO~P%[O_7oO~O!b7pO~O!h7qO~O!W(ii!X(ii~P#C^O_%gO#Y7yO'm%gO~O!W(fy!h(fy_(fy'm(fy~P!7zO!W(`O!h(ey~O!Y'VO%b7|O~O#e$vqP$vqY$vq_$vql$vq{$vq!W$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq'm$vq(T$vq(d$vq!h$vq!T$vq'k$vq#Y$vqp$vq!Y$vq%b$vq!b$vq~P#,sO#e$xqP$xqY$xq_$xql$xq{$xq!W$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq'm$xq(T$xq(d$xq!h$xq!T$xq'k$xq#Y$xqp$xq!Y$xq%b$xq!b$xq~P#,sO!W'Ri!h'Ri~P!7zO#z#]q!W#]q!X#]q~P#C^Oz/yO{/yO}/zOPwaYwahwalwa!fwa!gwa!iwa!mwa#hwa#iwa#jwa#kwa#lwa#mwa#nwa#owa#pwa#rwa#twa#vwa#wwa#zwa(Twa(dwa(kwa(lwa!Wwa!Xwa~Oz)vO})wOP$maY$mah$mal$ma{$ma!f$ma!g$ma!i$ma!m$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#o$ma#p$ma#r$ma#t$ma#v$ma#w$ma#z$ma(T$ma(d$ma(k$ma(l$ma!W$ma!X$ma~Oz)vO})wOP$oaY$oah$oal$oa{$oa!f$oa!g$oa!i$oa!m$oa#h$oa#i$oa#j$oa#k$oa#l$oa#m$oa#n$oa#o$oa#p$oa#r$oa#t$oa#v$oa#w$oa#z$oa(T$oa(d$oa(k$oa(l$oa!W$oa!X$oa~OP$}aY$}al$}a{$}a!f$}a!g$}a!i$}a!m$}a#h$}a#i$}a#j$}a#k$}a#l$}a#m$}a#n$}a#o$}a#p$}a#r$}a#t$}a#v$}a#w$}a#z$}a(T$}a(d$}a!W$}a!X$}a~P%AzO#z$iq!W$iq!X$iq~P#C^O#z$jq!W$jq!X$jq~P#C^O!X8WO~O#z8XO~P!0kO!b#uO!W']i!h']i~O!b#uO(d'gO!W']i!h']i~O!W/VO!h(qq~O!T'_i!W'_i~P#,sO!W/_O!T(rq~O!T8_O~P#,sO!T8_O~Oe(Ry!W(Ry~P!0kO!W'ba!Y'ba~P#,sO_%Uq!Y%Uq'm%Uq!W%Uq~P#,sOY8dO~O!W0bO!X(zq~O#Y8hO!W'da!X'da~O!W4nO!X(wi~P#C^OPZXYZXlZXzZX{ZX}ZX!TZX!WZX!fZX!gZX!iZX!mZX#YZX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!b%SX#p%SX~P&3YO!Y0zO%b8lO~O'xTO'{UO(W8qO~O!W1VO!X(xq~O!h8tO~O!h8uO~O!h8vO~O!h8vO~P%[O#Y8yO!W#by!X#by~O!W#by!X#by~P#C^O!Y'VO%b9OO~O#z#xy!W#xy!X#xy~P#C^OP$viY$vil$vi{$vi!f$vi!g$vi!i$vi!m$vi#h$vi#i$vi#j$vi#k$vi#l$vi#m$vi#n$vi#o$vi#p$vi#r$vi#t$vi#v$vi#w$vi#z$vi(T$vi(d$vi!W$vi!X$vi~P%AzOz)vO})wO(l){OP%YiY%Yih%Yil%Yi{%Yi!f%Yi!g%Yi!i%Yi!m%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#o%Yi#p%Yi#r%Yi#t%Yi#v%Yi#w%Yi#z%Yi(T%Yi(d%Yi(k%Yi!W%Yi!X%Yi~Oz)vO})wOP%[iY%[ih%[il%[i{%[i!f%[i!g%[i!i%[i!m%[i#h%[i#i%[i#j%[i#k%[i#l%[i#m%[i#n%[i#o%[i#p%[i#r%[i#t%[i#v%[i#w%[i#z%[i(T%[i(d%[i(k%[i(l%[i!W%[i!X%[i~O#z$jy!W$jy!X$jy~P#C^O#z#]y!W#]y!X#]y~P#C^O!b#uO!W']q!h']q~O!W/VO!h(qy~O!T'_q!W'_q~P#,sO!T9VO~P#,sO!W0bO!X(zy~O!W4nO!X(wq~O!Y0zO%b9^O~O!h9aO~O!Y'VO%b9fO~OP$vqY$vql$vq{$vq!f$vq!g$vq!i$vq!m$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#o$vq#p$vq#r$vq#t$vq#v$vq#w$vq#z$vq(T$vq(d$vq!W$vq!X$vq~P%AzOP$xqY$xql$xq{$xq!f$xq!g$xq!i$xq!m$xq#h$xq#i$xq#j$xq#k$xq#l$xq#m$xq#n$xq#o$xq#p$xq#r$xq#t$xq#v$xq#w$xq#z$xq(T$xq(d$xq!W$xq!X$xq~P%AzOe%^!Z!W%^!Z#Y%^!Z#z%^!Z~P!0kO!W'dq!X'dq~P#C^O!W#b!Z!X#b!Z~P#C^O#e%^!ZP%^!ZY%^!Z_%^!Zl%^!Z{%^!Z!W%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z'm%^!Z(T%^!Z(d%^!Z!h%^!Z!T%^!Z'k%^!Z#Y%^!Zp%^!Z!Y%^!Z%b%^!Z!b%^!Z~P#,sOP%^!ZY%^!Zl%^!Z{%^!Z!f%^!Z!g%^!Z!i%^!Z!m%^!Z#h%^!Z#i%^!Z#j%^!Z#k%^!Z#l%^!Z#m%^!Z#n%^!Z#o%^!Z#p%^!Z#r%^!Z#t%^!Z#v%^!Z#w%^!Z#z%^!Z(T%^!Z(d%^!Z!W%^!Z!X%^!Z~P%AzOp(XX~P1qO'w!lO~P!*SO!TdX!WdX#YdX~P&3YOPZXYZXlZXzZX{ZX}ZX!WZX!WdX!fZX!gZX!iZX!mZX#YZX#YdX#edX#hZX#iZX#jZX#kZX#lZX#mZX#nZX#oZX#pZX#rZX#tZX#vZX#wZX#|ZX(TZX(dZX(kZX(lZX~O!bdX!hZX!hdX(ddX~P&HpOP9qOQ9qOb;bOc!iOjkOl9qOmkOnkOtkOv9qOx9qO}WO!RkO!SkO!YXO!d9tO!iZO!l9qO!m9qO!n9qO!p9uO!r9xO!u!hO$R!kO$VfO'v)UO'xTO'{UO(TVO(c[O(p;`O~O!W:VO!X$la~Oj%SOl$tOm$sOn$sOt%TOv%UOx:]O}${O!Y$|O!d;gO!i$xO#d:cO$R%YO$n:_O$p:aO$s%ZO'v(lO'xTO'{UO(P%RO(T$uO~O#q)]O~P&MfO!XZX!XdX~P&HpO#e9yO~O!b#uO#e9yO~O#Y:ZO~O#p:OO~O#Y:eO!W(iX!X(iX~O#Y:ZO!W(gX!X(gX~O#e:fO~Oe:hO~P!0kO#e:mO~O#e:nO~O!b#uO#e:oO~O!b#uO#e:fO~O#z:pO~P#C^O#e:qO~O#e:rO~O#e:sO~O#e:tO~O#e:uO~O#e:vO~O#z:wO~P!0kO#z:xO~P!0kO$V~!g!}#O#Q#R#U#c#d#o(p$n$p$s%V%a%b%c%j%l%o%p%r%t~'qR$V(p#i!S'o'w#jm#h#klz'p(W'p'v$X$Z$X~",
    goto: "$'X)OPPPP)PPP)SP)eP*t.xPPPP5`PP5vP;r>yP?^P?^PPP?^PAOP?^P?^P?^PASPPAXPArPFjPPPFnPPPPFnIoPPPIuJpPFnPMOPPPP! ^FnPPPFnPFnP!#lFnP!'Q!(S!(]P!)P!)T!)PPPPPP!,`!(SPP!,|!-vP!0jFnFn!0o!3y!8`!8`!<UPPP!<]FnPPPPPPPPPPP!?jP!@{PPFn!BYPFnPFnFnFnFnPFn!ClPP!FtP!IxP!I|!JW!J[!J[P!FqP!J`!J`P!MdP!MhFnFn!Mn#!q?^P?^P?^?^P##|?^?^#%x?^#(X?^#)}?^?^#*l#,j#,j#,n#,v#,j#-OP#,jP?^#-h?^#.q?^?^5`PPP#/}PPP#0h#0hP#0hP#1O#0hPP#1UP#0{P#0{#1i#0{#2T#2Z5])S#2^)SP#2e#2e#2eP)SP)SP)SP)SPP)SP#2k#2nP#2n)SP#2rP#2uP)SP)SP)SP)SP)SP)S)SPP#2{#3R#3^#3d#3j#3p#3v#4U#4[#4b#4l#4r#4|#5]#5c#6T#6g#6m#6s#7R#7h#8y#9X#9_#9e#9k#9q#9{#:R#:X#:c#:u#:{PPPPPPPPPP#;RPPPPPPP#;v#>}P#@^#@e#@mPPPP#D{#Gr#NZ#N^#Na$ Y$ ]$ `$ g$ oPP$ u$ y$!q$#p$#t$$YPP$$^$$d$$hP$$k$$o$$r$%h$&P$&h$&l$&o$&r$&x$&{$'P$'TR!{RoqOXst!Z#c%f&i&k&l&n,b,g1g1jY!uQ'V-S0z4uQ%lvQ%tyQ%{|Q&a!VS&}!e,zQ']!iS'c!r!xS*_$|*dQ+`%uQ+m%}Q,R&ZQ-Q'UQ-['^Q-d'dQ/p*fQ1U,SR:d9u%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7yS#p]9r!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ*o%VQ+e%wQ,T&^Q,[&fQ.X:[Q0W+WQ0[+YQ0g+fQ1^,YQ2k.UQ4`0bQ5T1VQ6R2oQ6X:]Q6z4aR8P6S&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;ct!nQ!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4w$^$si#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ&O|Q&{!eS'R%b,}Q+e%wQ,T&^Q/{*sQ0g+fQ0l+lQ1],XQ1^,YQ4`0bQ4i0nQ5T1VQ5W1XQ5X1[Q6z4aQ6}4fQ7h5ZQ8g7OR8r7ernOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR,V&b&v^OPXYstuvwz!Z!`!g!j!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;b;c[#[WZ#V#Y'O'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q%oxQ%syS%x|%}Q&U!TQ'Y!hQ'[!iQ(g#rS*R$x*VS+_%t%uQ+c%wQ+|&XQ,Q&ZS-Z']'^Q.W(hQ/Z*SQ0`+`Q0f+fQ0h+gQ0k+kQ1P+}S1T,R,SQ2X-[Q3g/VQ4_0bQ4c0eQ4h0mQ5S1UQ6d3hQ6y4aQ6|4eQ8c6xR9X8dv$zi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i!S%qy!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zQ+X%oQ+r&RQ+u&SQ,P&ZQ.V(gQ1O+|U1S,Q,R,SQ2p.WQ4}1PS5R1T1UQ7d5S#O;d#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg;e:X:Y:_:a:c:j:l:n:r:t:xW%Pi%R*l;`S&R!Q&`Q&S!RQ&T!SR+p&P$_%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mT)r$u)sV*p%V:[:]U'R!e%b,}S(u#y#zQ+j%zS.P(c(dQ0u+vQ4P/yR7S4n&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c$i$`c#X#d%j%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.j.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VT#SV#T&}kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ'P!eR1|,zv!nQ!e!r!u!x!y&}'U'V'c'd'e,z-Q-S-d0z4u4wS*^$|*dS/h*_*fQ/q*gQ0w+xQ3z/pR3}/snqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&p!^Q'm!wS(i#t9yQ+]%rQ+z&UQ+{&WQ-X'ZQ-f'fS.](n:fS0O*x:oQ0^+^Q0y+yQ1n,iQ1p,jQ1x,uQ2V-YQ2Y-^S4U0P:uQ4Z0_S4^0a:vQ5m1zQ5q2WQ5v2_Q6w4[Q7t5oQ7u5rQ7x5wR8x7q$d$_c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(f#o'`U*i$}(m3ZS+S%j.jQ2l0WQ6O2kQ8O6RR9P8P$d$^c#X#d%k%m'x(O(j(q(y(z({(|(})O)P)Q)R)S)T)V)Y)^)h+T+i,x-g-l-q-s.^.d.h.k.l.{/}1v1y2Z2b2v2{2|2}3O3P3Q3R3S3T3U3V3W3X3[3]3b4T4]5n5t5y6V6W6]6^7U7s7w8Q8U8V8{9Z9b9s;VS(e#o'`S(w#z$_S+R%j.jS.Q(d(fQ.m)XQ0T+SR2i.R&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS#p]9rQ&k!XQ&l!YQ&n![Q&o!]R1f,eQ'W!hQ+U%oQ-V'YS.S(g+XQ2T-UW2m.V.W0V0XQ5p2UU5}2j2l2pS7{6O6QS8}7}8OS9d8|9PQ9l9eR9o9mU!vQ'V-ST4s0z4u!Q_OXZ`st!V!Z#c#g%^%f&`&b&i&k&l&n(`,b,g-y1g1j]!pQ!r'V-S0z4uT#p]9r%Y{OPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS(u#y#zS.P(c(d!s:|$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cY!tQ'V-S0z4uQ'b!rS'l!u!xS'n!y4wS-c'c'dQ-e'eR2`-dQ'k!tS([#f1aS-b'b'nQ/Y*RQ/f*^Q2a-eQ3l/ZS3u/g/qQ6c3gS6n3{3}Q8Z6dR8b6qQ#vbQ'j!tS(Z#f1aS(]#l*wQ*y%_Q+Z%pQ+a%vU-a'b'k'nQ-u([Q/X*RQ/e*^Q/k*aQ0]+[Q1Q,OS2^-b-eQ2f-}S3k/Y/ZS3t/f/qQ3w/jQ3y/lQ5P1RQ5x2aQ6b3gQ6f3lS6j3u3}Q6o3|Q7b5QS8Y6c6dQ8^6kQ8`6nQ8o7cQ9T8ZQ9U8_Q9W8bQ9`8pQ9h9VQ;P:zQ;[;TR;];UV!vQ'V-S%YaOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yS#vz!j!r:y$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;P;b%YbOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yQ%_j!S%py!i!t%s%t%u&|'[']'^'b'l*^+_+`,w-Z-[-c/h0`2Q2X2`3zS%vz!jQ+[%qQ,O&ZW1R,P,Q,R,SU5Q1S1T1US7c5R5SQ8p7d!r:z$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ;T;aR;U;b$|eOPXYstuvw!Z!`!g!o#R#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7yY#aWZ#V#Y'y!S%cm#g#h#k%^%a(S(^(_(`*z*{*},^,t-r-x-y-z-|1o2g2h5k5|Q,]&f!p:{$[$m)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cR;O'OS'S!e%bR2O,}%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|,_,b,g-W-`-n-t.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2w4r4|5^5_5b5u7Z7`7o7y!r)W$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cQ,[&fQ0W+WQ2k.UQ6R2oR8P6S!f$Uc#X%j'x(O(j(q)Q)R)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!T:Q)V)h,x.j1v1y2{3T3U3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!b$Wc#X%j'x(O(j(q)S)T)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9s!P:S)V)h,x.j1v1y2{3V3W3[3b5n6W6]6^7U7s8Q8U8V9Z9b;V!^$[c#X%j'x(O(j(q)Y)^+i-g-l-q-s.^.d.{/}2Z2b2v3X4T4]5t5y6V7w8{9sQ3f/Tz;c)V)h,x.j1v1y2{3[3b5n6W6]6^7U7s8Q8U8V9Z9b;VQ;h;jR;i;k&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cS$nh$oR3_.p'TgOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$jf$pQ$hfS)a$k)eR)m$pT$if$pT)c$k)e'ThOPWXYZhstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m$o%f%l%y&b&e&f&i&k&l&n&r&z'O'X'i'y'{(R(Y(n(r(v)j)u*x*|+W,_,b,g,s,v-W-`-n-t.U.b.i.p.q/z0P0a0}1_1`1b1d1g1j1l1{2]2c2o2w3^4p4r4|5^5_5b5l5u6S7Z7`7o7y8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;cT$nh$oQ$qhR)l$o%YjOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%f%l%y&b&e&f&i&k&l&n&r&z'X'i'y'{(R(Y(n(r(v)u*x*|+W,_,b,g-W-`-n-t.U.b.i/z0P0a0}1_1`1b1d1g1j1l2]2c2o2w4r4|5^5_5b5u6S7Z7`7o7y!s;a$[$m'O)j,s,v.q1{3^4p5l8h8y9q9t9u9x9y9z9{9|9}:O:P:Q:R:S:T:U:V:Z:d:e:f:h:o:p:u:v;c#clOPXZst!Z!`!o#R#c#n#{$m%f&b&e&f&i&k&l&n&r&z'X(v)j*|+W,_,b,g-W.U.q/z0}1_1`1b1d1g1j1l2o3^4r4|5^5_5b6S7Z7`7ov$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mQ*t%ZQ.|)vg3Z:X:Y:_:a:c:j:l:n:r:t:xv$yi#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;iQ*W$zS*a$|*dQ*u%[Q/l*b#O;R#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mf;S:X:Y:_:a:c:j:l:n:r:t:xQ;W;dQ;X;eQ;Y;fR;Z;gv$}i#w%W%X%])z)|*U*j*k._/^/|3f4O8X;`;h;i#O(m#u$c$d$x${)q)w)}*[+V+Y+q+t.T/P/_/a0q0t0|2n3p3x4W4Y4{6P6g6p7]7|8l9O9^9f:^:`:b:i:k:m:q:s:w;l;mg3Z:X:Y:_:a:c:j:l:n:r:t:xnoOXst!Z#c%f&i&k&l&n,b,g1g1jQ*Z${Q,p&uQ,q&wR3o/_$^%Oi#u#w$c$d$x${%W%X%])q)w)z)|)}*U*[*j*k+V+Y+q+t.T._/P/^/_/a/|0q0t0|2n3f3p3x4O4W4Y4{6P6g6p7]7|8X8l9O9^9f:X:Y:^:_:`:a:b:c:i:j:k:l:m:n:q:r:s:t:w:x;`;h;i;l;mQ+s&SQ0s+uQ4l0rR7R4mT*c$|*dS*c$|*dT4t0z4uS/j*`4rT3|/r7ZQ+Z%pQ/k*aQ0]+[Q1Q,OQ5P1RQ7b5QQ8o7cR9`8pn)z$v(o*v/]/t/u2t3m4S6a6r9S;Q;^;_!Y:i(k)[*Q*Y.[.x.}/T/b0U0p0r2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k]:j3Y6[8R9Q9R9pp)|$v(o*v/R/]/t/u2t3m4S6a6r9S;Q;^;_![:k(k)[*Q*Y.[.x.}/T/b0U0p0r2q2s3n3r4k4m6T6U6h6l6t6v8]8a9g;j;k_:l3Y6[8R8S9Q9R9prnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ&]!UR,_&frnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jR&]!UQ+w&TR0o+psnOXst!V!Z#c%f&`&i&k&l&n,b,g1g1jQ0{+|S4z1O1PU7[4x4y4}S8k7^7_S9[8j8mQ9i9]R9n9jQ&d!VR,W&`R5W1XS%x|%}R0h+gQ&i!WR,b&jR,h&oT1h,g1jR,l&pQ,k&pR1q,lQ'p!zR-h'pSsOtQ#cXT%is#cQ!}TR'r!}Q#QUR't#QQ)s$uR.y)sQ#TVR'v#TQ#WWU'|#W'}-oQ'}#XR-o(OQ,{'PR1},{Q.`(oR2u.`Q.c(qS2x.c2yR2y.dQ-S'VR2R-SY!rQ'V-S0z4uR'a!rS#^W%aU(T#^(U-pQ(U#_R-p(PQ-O'SR2P-Ot`OXst!V!Z#c%f&`&b&i&k&l&n,b,g1g1jS#gZ%^U#q`#g-yR-y(`Q(a#iQ-v(]W.O(a-v2d5zQ2d-wR5z2eQ)e$kR.r)eQ$ohR)k$oQ$bcU)Z$b-k:WQ-k9sR:W)hQ/W*RW3i/W3j6e8[U3j/X/Y/ZS6e3k3lR8[6f#o)x$v(k(o)[*Q*Y*q*r*v.Y.Z.[.x.}/R/S/T/]/b/t/u0U0p0r2q2r2s2t3Y3m3n3r4S4k4m6T6U6Y6Z6[6a6h6l6r6t6v8R8S8T8]8a9Q9R9S9g9p;Q;^;_;j;kQ/`*YU3q/`3s6iQ3s/bR6i3rQ*d$|R/n*dQ*m%QR/w*mQ4X0UR6u4XQ+O%dR0S+OQ4o0uS7T4o8iR8i7UQ+y&UR0x+yQ4u0zR7X4uQ1W,TS5U1W7fR7f5WQ0c+cW4b0c4d6{8eQ4d0fQ6{4cR8e6|Q+h%xR0i+hQ1j,gR5f1jYrOXst#cQ&m!ZQ+Q%fQ,a&iQ,c&kQ,d&lQ,f&nQ1e,bS1h,g1jR5e1gQ%hpQ&q!_Q&t!aQ&v!bQ&x!cQ'h!tQ+P%eQ+]%rQ+o&OQ,V&dQ,n&sW-_'b'j'k'nQ-f'fQ/m*cQ0^+^S1Z,W,ZQ1r,mQ1s,pQ1t,qQ2Y-^W2[-a-b-e-gQ4Z0_Q4g0lQ4j0pQ5O1QQ5Y1]Q5d1fU5s2Z2^2aQ5v2_Q6w4[Q7P4iQ7Q4kQ7W4tQ7a5PQ7g5XS7v5t5xQ7x5wQ8f6}Q8n7bQ8s7hQ8z7wQ9Y8gQ9_8oQ9c8{R9k9`Q%ryQ'Z!iQ'f!tU+^%s%t%uQ,u&|U-Y'[']'^S-^'b'lQ/d*^S0_+_+`Q1z,wS2W-Z-[Q2_-cQ3v/hQ4[0`Q5o2QQ5r2XQ5w2`R6m3zS$wi;`R*n%RU%Qi%R;`R/v*lQ$viS(k#u+YQ(o#wS)[$c$dQ*Q$xQ*Y${Q*q%WQ*r%XQ*v%]Q.Y:^Q.Z:`Q.[:bQ.x)qS.})w/PQ/R)zQ/S)|Q/T)}Q/]*UQ/b*[Q/t*jQ/u*kh0U+V.T0|2n4{6P7]7|8l9O9^9fQ0p+qQ0r+tQ2q:iQ2r:kQ2s:mQ2t._S3Y:X:YQ3m/^Q3n/_Q3r/aQ4S/|Q4k0qQ4m0tQ6T:qQ6U:sQ6Y:_Q6Z:aQ6[:cQ6a3fQ6h3pQ6l3xQ6r4OQ6t4WQ6v4YQ8R:nQ8S:jQ8T:lQ8]6gQ8a6pQ9Q:rQ9R:tQ9S8XQ9g:wQ9p:xQ;Q;`Q;^;hQ;_;iQ;j;lR;k;mnpOXst!Z#c%f&i&k&l&n,b,g1g1jQ!fPS#eZ#nQ&s!`U'_!o4r7ZQ'u#RQ(x#{Q)i$mS,Z&b&eQ,`&fQ,m&rQ,r&zQ-U'XQ.f(vQ.v)jQ0Q*|Q0X+WQ1c,_Q2U-WQ2l.UQ3a.qQ4Q/zQ4y0}Q5[1_Q5]1`Q5a1bQ5c1dQ5h1lQ6O2oQ6_3^Q7_4|Q7k5^Q7l5_Q7n5bQ8O6SQ8m7`R8w7o#WcOPXZst!Z!`!o#c#n#{%f&b&e&f&i&k&l&n&r&z'X(v*|+W,_,b,g-W.U/z0}1_1`1b1d1g1j1l2o4r4|5^5_5b6S7Z7`7oQ#XWQ#dYQ%juQ%kvS%mw!gS'x#V'{Q(O#YQ(j#tQ(q#xQ(y$OQ(z$PQ({$QQ(|$RQ(}$SQ)O$TQ)P$UQ)Q$VQ)R$WQ)S$XQ)T$YQ)V$[Q)Y$aQ)^$eW)h$m)j.q3^Q+T%lQ+i%yS,x'O1{Q-g'iS-l'y-nQ-q(RQ-s(YQ.^(nQ.d(rQ.h9qQ.j9tQ.k9uQ.l9xQ.{)uQ/}*xQ1v,sQ1y,vQ2Z-`Q2b-tQ2v.bQ2{9yQ2|9zQ2}9{Q3O9|Q3P9}Q3Q:OQ3R:PQ3S:QQ3T:RQ3U:SQ3V:TQ3W:UQ3X.iQ3[:ZQ3]:dQ3b:VQ4T0PQ4]0aQ5n:eQ5t2]Q5y2cQ6V2wQ6W:fQ6]:hQ6^:oQ7U4pQ7s5lQ7w5uQ8Q:pQ8U:uQ8V:vQ8{7yQ9Z8hQ9b8yQ9s#RR;V;cR#ZWR'Q!eY!tQ'V-S0z4uS&|!e,zQ'b!rS'l!u!xS'n!y4wS,w&}'US-c'c'dQ-e'eQ2Q-QR2`-dR(p#wR(s#xQ!fQT-R'V-S]!qQ!r'V-S0z4uQ#o]R'`9rT#jZ%^S#iZ%^S%dm,^U(]#g#h#kS-w(^(_Q-{(`Q0R*}Q2e-xU2f-y-z-|S5{2g2hR7z5|`#]W#V#Y%a'y(S*z-rr#fZm#g#h#k%^(^(_(`*}-x-y-z-|2g2h5|Q1a,^Q1w,tQ5j1oQ7r5kT:}'O*{T#`W%aS#_W%aS'z#V(SS(P#Y*zS,y'O*{T-m'y-rT'T!e%bQ$kfR)o$pT)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",
    nodeNames: "\u26A0 ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",
    maxTerm: 367,
    context: trackNewline,
    nodeProps: [
      ["group", -26, 7, 15, 17, 63, 200, 204, 208, 209, 211, 214, 217, 227, 229, 235, 237, 239, 241, 244, 250, 256, 258, 260, 262, 264, 266, 267, "Statement", -32, 11, 12, 26, 29, 30, 36, 46, 49, 50, 52, 57, 65, 73, 77, 79, 81, 82, 104, 105, 114, 115, 132, 135, 137, 138, 139, 140, 142, 143, 163, 164, 166, "Expression", -23, 25, 27, 31, 35, 37, 39, 167, 169, 171, 172, 174, 175, 176, 178, 179, 180, 182, 183, 184, 194, 196, 198, 199, "Type", -3, 85, 97, 103, "ClassItem"],
      ["openedBy", 32, "InterpolationStart", 51, "[", 55, "{", 70, "(", 144, "JSXStartTag", 156, "JSXStartTag JSXStartCloseTag"],
      ["closedBy", 34, "InterpolationEnd", 45, "]", 56, "}", 71, ")", 145, "JSXSelfCloseEndTag JSXEndTag", 161, "JSXEndTag"]
    ],
    propSources: [jsHighlight],
    skippedNodes: [0, 3, 4, 270],
    repeatNodeCount: 33,
    tokenData: "$Fl(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$<m#p#q$=c#q#r$>s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'yp'|!b'o(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'z#S$e&j'p(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'yp'|!b'p(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'x$(n$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j'|!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j'|!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'|!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t'|!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'yp'|!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__US$e&j'yp'|!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]US$e&j'|!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS'|!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'ypOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'ypOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'yp'|!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S#%|C}i$e&j(c!L^'yp'|!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr#%|EoP;=`<%lCr(CSFRk$e&j'yp'|!b(W!LY'v&;d$X#tOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$e&j'yp'|!b$X#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv(CSJPP;=`<%lEr%#SJ_`$e&j'yp'|!b#j$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SKl_$e&j#|$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfLva(l%<v$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SNW`$e&j#v$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b! c_'{$)`$e&j'ypOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b*Q!!i_$e&j'ypOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b)`!#mX$e&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h#t!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y#t!$oP;=`<%l!$Y)`!$uP;=`<%l!#h*Q!%R]$`#t$e&j'ypOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r$f!&PZ'ypOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z$f!&yU$`#t'ypOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r$f!'`P;=`<%l!%z*Q!'fP;=`<%l!!b(*Q!'t_!i(!b$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'l!)O_!hM|$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h!*[b$e&j'yp'|!b'w#)d#k$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S!+o`$e&j'yp'|!b#h$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&-O!,|`$e&j'yp'|!bl&%`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&C[!.Z_!W&;l$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!/ec$e&j'yp'|!bz'<nOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!0ya$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z!'d!2Z_!VMt$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!3eg$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!5Vg$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!6wc$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l!8_c$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS!9uf$e&j'yp'|!b#i$IdOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpxz!;Zz{#,f{!P!;Z!P!Q#-{!Q!^!;Z!^!_#'Z!_!`#5k!`!a#7Q!a!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(r!;fb$e&j'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(Q!<w`$e&j'|!b!SSOY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eb!Q!^!<n!^!_!GY!_!}!<n!}#O!Ja#O#P!Dj#P#o!<n#o#p!GY#p;'S!<n;'S;=`!Kj<%lO!<n&n!>Q^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j'|!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ'|!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb'|!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX'|!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j'|!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!<n#Q#o!Ja#o#p!Ic#p;'S!Ja;'S;=`!Kd<%lO!Ja(Q!KgP;=`<%l!Ja(Q!KmP;=`<%l!<n'`!Ky`$e&j'yp!SSOY!KpYZ&cZr!Kprs!=ys!P!Kp!P!Q!L{!Q!^!Kp!^!_!Ns!_!}!Kp!}#O##z#O#P!Dj#P#o!Kp#o#p!Ns#p;'S!Kp;'S;=`#%T<%lO!Kp'`!MUi$e&j'yp!SSOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#Z(r#Z#[!L{#[#](r#]#^!L{#^#a(r#a#b!L{#b#g(r#g#h!L{#h#i(r#i#j!L{#j#m(r#m#n!L{#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rt!NzZ'yp!SSOY!NsZr!Nsrs!@Ys!P!Ns!P!Q# m!Q!}!Ns!}#O#!|#O#P!Bb#P;'S!Ns;'S;=`##t<%lO!Nst# tb'yp!SSOY)rZr)rs#O)r#P#Z)r#Z#[# m#[#])r#]#^# m#^#a)r#a#b# m#b#g)r#g#h# m#h#i)r#i#j# m#j#m)r#m#n# m#n;'S)r;'S;=`*Z<%lO)rt##RX'ypOY#!|Zr#!|rs!Acs#O#!|#O#P!A{#P#Q!Ns#Q;'S#!|;'S;=`##n<%lO#!|t##qP;=`<%l#!|t##wP;=`<%l!Ns'`#$R^$e&j'ypOY##zYZ&cZr##zrs!Bws!^##z!^!_#!|!_#O##z#O#P!Cr#P#Q!Kp#Q#o##z#o#p#!|#p;'S##z;'S;=`#$}<%lO##z'`#%QP;=`<%l##z'`#%WP;=`<%l!Kp(r#%fk$e&j'yp'|!b!SSOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#Z%Z#Z#[#%Z#[#]%Z#]#^#%Z#^#a%Z#a#b#%Z#b#g%Z#g#h#%Z#h#i%Z#i#j#%Z#j#m%Z#m#n#%Z#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#W#'d]'yp'|!b!SSOY#'ZZr#'Zrs!GYsw#'Zwx!Nsx!P#'Z!P!Q#(]!Q!}#'Z!}#O#)w#O#P!Bb#P;'S#'Z;'S;=`#*w<%lO#'Z#W#(fe'yp'|!b!SSOY*gZr*grs'}sw*gwx)rx#O*g#P#Z*g#Z#[#(]#[#]*g#]#^#(]#^#a*g#a#b#(]#b#g*g#g#h#(]#h#i*g#i#j#(]#j#m*g#m#n#(]#n;'S*g;'S;=`+Z<%lO*g#W#*OZ'yp'|!bOY#)wZr#)wrs!Icsw#)wwx#!|x#O#)w#O#P!A{#P#Q#'Z#Q;'S#)w;'S;=`#*q<%lO#)w#W#*tP;=`<%l#)w#W#*zP;=`<%l#'Z(r#+W`$e&j'yp'|!bOY#*}YZ&cZr#*}rs!Jasw#*}wx##zx!^#*}!^!_#)w!_#O#*}#O#P!Cr#P#Q!;Z#Q#o#*}#o#p#)w#p;'S#*};'S;=`#,Y<%lO#*}(r#,]P;=`<%l#*}(r#,cP;=`<%l!;Z(CS#,sb$e&j'yp'|!b'q(;d!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z(CS#.W_$e&j'yp'|!bR(;dOY#-{YZ&cZr#-{rs#/Vsw#-{wx#2gx!^#-{!^!_#4f!_#O#-{#O#P#0X#P#o#-{#o#p#4f#p;'S#-{;'S;=`#5e<%lO#-{(Bb#/`]$e&j'|!bR(;dOY#/VYZ&cZw#/Vwx#0Xx!^#/V!^!_#1j!_#O#/V#O#P#0X#P#o#/V#o#p#1j#p;'S#/V;'S;=`#2a<%lO#/V(AO#0`X$e&jR(;dOY#0XYZ&cZ!^#0X!^!_#0{!_#o#0X#o#p#0{#p;'S#0X;'S;=`#1d<%lO#0X(;d#1QSR(;dOY#0{Z;'S#0{;'S;=`#1^<%lO#0{(;d#1aP;=`<%l#0{(AO#1gP;=`<%l#0X(<v#1qW'|!bR(;dOY#1jZw#1jwx#0{x#O#1j#O#P#0{#P;'S#1j;'S;=`#2Z<%lO#1j(<v#2^P;=`<%l#1j(Bb#2dP;=`<%l#/V(Ap#2p]$e&j'ypR(;dOY#2gYZ&cZr#2grs#0Xs!^#2g!^!_#3i!_#O#2g#O#P#0X#P#o#2g#o#p#3i#p;'S#2g;'S;=`#4`<%lO#2g(<U#3pW'ypR(;dOY#3iZr#3irs#0{s#O#3i#O#P#0{#P;'S#3i;'S;=`#4Y<%lO#3i(<U#4]P;=`<%l#3i(Ap#4cP;=`<%l#2g(=h#4oY'yp'|!bR(;dOY#4fZr#4frs#1jsw#4fwx#3ix#O#4f#O#P#0{#P;'S#4f;'S;=`#5_<%lO#4f(=h#5bP;=`<%l#4f(CS#5hP;=`<%l#-{%#W#5xb$e&j#|$Id'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z+h#7_b$U#t$e&j'yp'|!b!SSOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Kpx!P!;Z!P!Q#%Z!Q!^!;Z!^!_#'Z!_!}!;Z!}#O#*}#O#P!Dj#P#o!;Z#o#p#'Z#p;'S!;Z;'S;=`#,`<%lO!;Z$/l#8rp$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#:v![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#:v#S#U%Z#U#V#>Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#<v#c#d#AY#d#l%Z#l#m#D[#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#;Rk$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#:v![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#:v#S#X%Z#X#Y!4|#Y#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#=R_$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Acc$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#Bn!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#Bn#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Bye$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#Bn!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#Bn#S#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#Deg$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#E|![!^%Z!^!_*g!_!c%Z!c!i#E|!i#O%Z#O#P&c#P#R%Z#R#S#E|#S#T%Z#T#Z#E|#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#FXi$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#E|![!^%Z!^!_*g!_!c%Z!c!i#E|!i#O%Z#O#P&c#P#R%Z#R#S#E|#S#T%Z#T#Z#E|#Z#b%Z#b#c#<v#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#HT_!b$b$e&j#z%<f'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z)[#I___l$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS#Jm^(P!*v!f'.r'yp'|!b$V)d(pSOY*gZr*grs'}sw*gwx)rx!P*g!P!Q#Ki!Q!^*g!^!_#L_!_!`#NP!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#KrX$g&j'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#LhZ#l$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#MZ!`#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#MdX#|$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g$Kh#NYX#m$Id'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g%Gh$ Qa#Y%?x$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$!V!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#W$!b_#e$Ih$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh$#paeBf#m$Id$b#|$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$$u!`!a$&P!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$%Q_#m$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$&[a#l$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$'a!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$'l`#l$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+h$(yc(d$Ip$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P$*U!P!^%Z!^!_*g!_!a%Z!a!b$+`!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'+`$*a_{'#p$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$+k`$e&j#w$Id'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#&^$,x_!y!Ln$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(@^$.S_}(8n$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(n$/WZ$e&jO!^$/y!^!_$0a!_#i$/y#i#j$0f#j#l$/y#l#m$2X#m#o$/y#o#p$0a#p;'S$/y;'S;=`$4d<%lO$/y(n$0QT]#S$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0fO]#S(n$0k[$e&jO!Q&c!Q![$1a![!^&c!_!c&c!c!i$1a!i#T&c#T#Z$1a#Z#o&c#o#p$3w#p;'S&c;'S;=`&w<%lO&c(n$1fZ$e&jO!Q&c!Q![$2X![!^&c!_!c&c!c!i$2X!i#T&c#T#Z$2X#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2^Z$e&jO!Q&c!Q![$3P![!^&c!_!c&c!c!i$3P!i#T&c#T#Z$3P#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3UZ$e&jO!Q&c!Q![$/y![!^&c!_!c&c!c!i$/y!i#T&c#T#Z$/y#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$3zR!Q![$4T!c!i$4T#T#Z$4T#S$4WS!Q![$4T!c!i$4T#T#Z$4T#q#r$0a(n$4gP;=`<%l$/y!2r$4u_!T!+S$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S$6P`#t$Id$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&,v$7^_$e&j'yp'|!b(T&%WOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$8lk$e&j'yp'|!b(W!LY'v&;d$Z#tOY%ZYZ&cZr%Zrs&}st%Ztu$8]uw%Zwx(rx}%Z}!O$:a!O!Q%Z!Q![$8]![!^%Z!^!_*g!_!c%Z!c!}$8]!}#O%Z#O#P&c#P#R%Z#R#S$8]#S#T%Z#T#o$8]#o#p*g#p$g%Z$g;'S$8];'S;=`$<g<%lO$8]+d$:lk$e&j'yp'|!b$Z#tOY%ZYZ&cZr%Zrs&}st%Ztu$:auw%Zwx(rx}%Z}!O$:a!O!Q%Z!Q![$:a![!^%Z!^!_*g!_!c%Z!c!}$:a!}#O%Z#O#P&c#P#R%Z#R#S$:a#S#T%Z#T#o$:a#o#p*g#p$g%Z$g;'S$:a;'S;=`$<a<%lO$:a+d$<dP;=`<%l$:a(CS$<jP;=`<%l$8]!5p$<vX!Y!3l'yp'|!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g%Df$=na(k%<v$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+`#q;'S%Z;'S;=`+a<%lO%Z%#`$?Q_!X$I`p`$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(r$@[_!nS$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(CS$Al|$e&j'yp'|!b'o(;d(W!LY'v&;d$X#tOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$JTEr$JT$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(CS$Dwk$e&j'yp'|!b'p(;d(W!LY'v&;d$X#tOY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",
    tokenizers: [noSemicolon, incdecToken, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, insertSemicolon, new LocalTokenGroup("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOr~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!P~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(V~~", 141, 328), new LocalTokenGroup("j~RQYZXz{^~^O's~~aP!P!Qd~iO't~~", 25, 310)],
    topRules: { "Script": [0, 5], "SingleExpression": [1, 268], "SingleClassItem": [2, 269] },
    dialects: { jsx: 12842, ts: 12844 },
    dynamicPrecedences: { "67": 1, "77": 1, "79": 1, "164": 1, "192": 1 },
    specialized: [{ term: 314, get: (value2) => spec_identifier[value2] || -1 }, { term: 330, get: (value2) => spec_word[value2] || -1 }, { term: 68, get: (value2) => spec_LessThan[value2] || -1 }],
    tokenPrec: 12868
  });
  const snippets = [
    /* @__PURE__ */ snippetCompletion("function ${name}(${params}) {\n	${}\n}", {
      label: "function",
      detail: "definition",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n	${}\n}", {
      label: "for",
      detail: "loop",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("for (let ${name} of ${collection}) {\n	${}\n}", {
      label: "for",
      detail: "of loop",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("do {\n	${}\n} while (${})", {
      label: "do",
      detail: "loop",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("while (${}) {\n	${}\n}", {
      label: "while",
      detail: "loop",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("try {\n	${}\n} catch (${error}) {\n	${}\n}", {
      label: "try",
      detail: "/ catch block",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("if (${}) {\n	${}\n}", {
      label: "if",
      detail: "block",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("if (${}) {\n	${}\n} else {\n	${}\n}", {
      label: "if",
      detail: "/ else block",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("class ${name} {\n	constructor(${params}) {\n		${}\n	}\n}", {
      label: "class",
      detail: "definition",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion('import {${names}} from "${module}"\n${}', {
      label: "import",
      detail: "named",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion('import ${name} from "${module}"\n${}', {
      label: "import",
      detail: "default",
      type: "keyword"
    })
  ];
  const typescriptSnippets = /* @__PURE__ */ snippets.concat([
    /* @__PURE__ */ snippetCompletion("interface ${name} {\n	${}\n}", {
      label: "interface",
      detail: "definition",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("type ${name} = ${type}", {
      label: "type",
      detail: "definition",
      type: "keyword"
    }),
    /* @__PURE__ */ snippetCompletion("enum ${name} {\n	${}\n}", {
      label: "enum",
      detail: "definition",
      type: "keyword"
    })
  ]);
  const cache = /* @__PURE__ */ new NodeWeakMap();
  const ScopeNodes = /* @__PURE__ */ new Set([
    "Script",
    "Block",
    "FunctionExpression",
    "FunctionDeclaration",
    "ArrowFunction",
    "MethodDeclaration",
    "ForStatement"
  ]);
  function defID(type) {
    return (node, def) => {
      let id2 = node.node.getChild("VariableDefinition");
      if (id2)
        def(id2, type);
      return true;
    };
  }
  const functionContext = ["FunctionDeclaration"];
  const gatherCompletions = {
    FunctionDeclaration: /* @__PURE__ */ defID("function"),
    ClassDeclaration: /* @__PURE__ */ defID("class"),
    ClassExpression: () => true,
    EnumDeclaration: /* @__PURE__ */ defID("constant"),
    TypeAliasDeclaration: /* @__PURE__ */ defID("type"),
    NamespaceDeclaration: /* @__PURE__ */ defID("namespace"),
    VariableDefinition(node, def) {
      if (!node.matchContext(functionContext))
        def(node, "variable");
    },
    TypeDefinition(node, def) {
      def(node, "type");
    },
    __proto__: null
  };
  function getScope(doc2, node) {
    let cached = cache.get(node);
    if (cached)
      return cached;
    let completions = [], top2 = true;
    function def(node2, type) {
      let name2 = doc2.sliceString(node2.from, node2.to);
      completions.push({ label: name2, type });
    }
    node.cursor(IterMode.IncludeAnonymous).iterate((node2) => {
      if (top2) {
        top2 = false;
      } else if (node2.name) {
        let gather = gatherCompletions[node2.name];
        if (gather && gather(node2, def) || ScopeNodes.has(node2.name))
          return false;
      } else if (node2.to - node2.from > 8192) {
        for (let c of getScope(doc2, node2.node))
          completions.push(c);
        return false;
      }
    });
    cache.set(node, completions);
    return completions;
  }
  const Identifier = /^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/;
  const dontComplete = [
    "TemplateString",
    "String",
    "RegExp",
    "LineComment",
    "BlockComment",
    "VariableDefinition",
    "TypeDefinition",
    "Label",
    "PropertyDefinition",
    "PropertyName",
    "PrivatePropertyDefinition",
    "PrivatePropertyName",
    ".",
    "?."
  ];
  function localCompletionSource(context) {
    let inner = syntaxTree(context.state).resolveInner(context.pos, -1);
    if (dontComplete.indexOf(inner.name) > -1)
      return null;
    let isWord = inner.name == "VariableName" || inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));
    if (!isWord && !context.explicit)
      return null;
    let options = [];
    for (let pos = inner; pos; pos = pos.parent) {
      if (ScopeNodes.has(pos.name))
        options = options.concat(getScope(context.state.doc, pos));
    }
    return {
      options,
      from: isWord ? inner.from : context.pos,
      validFor: Identifier
    };
  }
  const javascriptLanguage = /* @__PURE__ */ LRLanguage.define({
    name: "javascript",
    parser: /* @__PURE__ */ parser.configure({
      props: [
        /* @__PURE__ */ indentNodeProp.add({
          IfStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|else\b)/ }),
          TryStatement: /* @__PURE__ */ continuedIndent({ except: /^\s*({|catch\b|finally\b)/ }),
          LabeledStatement: flatIndent,
          SwitchBody: (context) => {
            let after = context.textAfter, closed = /^\s*\}/.test(after), isCase = /^\s*(case|default)\b/.test(after);
            return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;
          },
          Block: /* @__PURE__ */ delimitedIndent({ closing: "}" }),
          ArrowFunction: (cx) => cx.baseIndent + cx.unit,
          "TemplateString BlockComment": () => null,
          "Statement Property": /* @__PURE__ */ continuedIndent({ except: /^{/ }),
          JSXElement(context) {
            let closed = /^\s*<\//.test(context.textAfter);
            return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);
          },
          JSXEscape(context) {
            let closed = /\s*\}/.test(context.textAfter);
            return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);
          },
          "JSXOpenTag JSXSelfClosingTag"(context) {
            return context.column(context.node.from) + context.unit;
          }
        }),
        /* @__PURE__ */ foldNodeProp.add({
          "Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType": foldInside,
          BlockComment(tree) {
            return { from: tree.from + 2, to: tree.to - 2 };
          }
        })
      ]
    }),
    languageData: {
      closeBrackets: { brackets: ["(", "[", "{", "'", '"', "`"] },
      commentTokens: { line: "//", block: { open: "/*", close: "*/" } },
      indentOnInput: /^\s*(?:case |default:|\{|\}|<\/)$/,
      wordChars: "$"
    }
  });
  const jsxSublanguage = {
    test: (node) => /^JSX/.test(node.name),
    facet: /* @__PURE__ */ defineLanguageFacet({ commentTokens: { block: { open: "{/*", close: "*/}" } } })
  };
  const typescriptLanguage = /* @__PURE__ */ javascriptLanguage.configure({ dialect: "ts" }, "typescript");
  const jsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({
    dialect: "jsx",
    props: [/* @__PURE__ */ sublanguageProp.add((n) => n.isTop ? [jsxSublanguage] : void 0)]
  });
  const tsxLanguage = /* @__PURE__ */ javascriptLanguage.configure({
    dialect: "jsx ts",
    props: [/* @__PURE__ */ sublanguageProp.add((n) => n.isTop ? [jsxSublanguage] : void 0)]
  }, "typescript");
  let kwCompletion = (name2) => ({ label: name2, type: "keyword" });
  const keywords = /* @__PURE__ */ "break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kwCompletion);
  const typescriptKeywords = /* @__PURE__ */ keywords.concat(/* @__PURE__ */ ["declare", "implements", "private", "protected", "public"].map(kwCompletion));
  function javascript(config2 = {}) {
    let lang = config2.jsx ? config2.typescript ? tsxLanguage : jsxLanguage : config2.typescript ? typescriptLanguage : javascriptLanguage;
    let completions = config2.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);
    return new LanguageSupport(lang, [
      javascriptLanguage.data.of({
        autocomplete: ifNotIn(dontComplete, completeFromList(completions))
      }),
      javascriptLanguage.data.of({
        autocomplete: localCompletionSource
      }),
      config2.jsx ? autoCloseTags : []
    ]);
  }
  function findOpenTag(node) {
    for (; ; ) {
      if (node.name == "JSXOpenTag" || node.name == "JSXSelfClosingTag" || node.name == "JSXFragmentTag")
        return node;
      if (node.name == "JSXEscape" || !node.parent)
        return null;
      node = node.parent;
    }
  }
  function elementName(doc2, tree, max = doc2.length) {
    for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {
      if (ch.name == "JSXIdentifier" || ch.name == "JSXBuiltin" || ch.name == "JSXNamespacedName" || ch.name == "JSXMemberExpression")
        return doc2.sliceString(ch.from, Math.min(ch.to, max));
    }
    return "";
  }
  const android = typeof navigator == "object" && /* @__PURE__ */ /Android\b/.test(navigator.userAgent);
  const autoCloseTags = /* @__PURE__ */ EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {
    if ((android ? view.composing : view.compositionStarted) || view.state.readOnly || from != to || text != ">" && text != "/" || !javascriptLanguage.isActiveAt(view.state, from, -1))
      return false;
    let base2 = defaultInsert(), { state } = base2;
    let closeTags = state.changeByRange((range) => {
      var _a2;
      let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name2;
      if (around.name == "JSXStartTag")
        around = around.parent;
      if (state.doc.sliceString(head - 1, head) != text || around.name == "JSXAttributeValue" && around.to > head)
        ;
      else if (text == ">" && around.name == "JSXFragmentTag") {
        return { range, changes: { from: head, insert: `</>` } };
      } else if (text == "/" && around.name == "JSXStartCloseTag") {
        let empty2 = around.parent, base3 = empty2.parent;
        if (base3 && empty2.from == head - 2 && ((name2 = elementName(state.doc, base3.firstChild, head)) || ((_a2 = base3.firstChild) === null || _a2 === void 0 ? void 0 : _a2.name) == "JSXFragmentTag")) {
          let insert2 = `${name2}>`;
          return { range: EditorSelection.cursor(head + insert2.length, -1), changes: { from: head, insert: insert2 } };
        }
      } else if (text == ">") {
        let openTag = findOpenTag(around);
        if (openTag && !/^\/?>|^<\//.test(state.doc.sliceString(head, head + 2)) && (name2 = elementName(state.doc, openTag, head)))
          return { range, changes: { from: head, insert: `</${name2}>` } };
      }
      return { range };
    });
    if (closeTags.changes.empty)
      return false;
    view.dispatch([
      base2,
      state.update(closeTags, { userEvent: "input.complete", scrollIntoView: true })
    ]);
    return true;
  });
  var formulaEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3q = {
    name: "formula-editor",
    mixins: [i18n$1],
    components: {},
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      formulaForView() {
        const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP);
        if (!matchResult) {
          return this.optionModel.formula;
        }
        let resultFormula = this.optionModel.formula;
        matchResult.forEach((mi) => {
          const secondPart = mi.split(".")[1];
          resultFormula = resultFormula.replaceAll(mi, secondPart);
        });
        return resultFormula;
      }
    },
    watch: {
      filterText(val) {
        this.$refs.fieldTree.filter(val);
      }
    },
    data() {
      return {
        codeMirror: null,
        formula: "",
        tags: [],
        fieldTreeData: [],
        filterText: "",
        formulaDialogVisible: false,
        operate: [
          "+",
          "-",
          "*",
          "/",
          "!=",
          "==",
          "<",
          ">",
          "<=",
          ">=",
          "(",
          ")",
          ","
        ],
        insertNum: 0,
        insertStr: "",
        activeNames: ["1"],
        widgetSizes: [
          {
            label: this.i18nt("designer.hint.formulaSizeLarge"),
            value: "large"
          },
          {
            label: this.i18nt("designer.hint.formulaSizeMedium"),
            value: "default"
          },
          {
            label: this.i18nt("designer.hint.formulaSizeSmall"),
            value: "small"
          },
          {
            label: this.i18nt("designer.hint.formulaSizeMini"),
            value: "small"
          }
        ],
        introTitle: this.i18nt("designer.hint.formulaFunctionExplain"),
        introduction: {
          title: this.i18nt("designer.hint.formulaPleaseSelect"),
          content: '<span class="cg">' + this.i18nt("designer.hint.formulaSample") + '\uFF1A</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">' + this.i18nt("designer.hint.formulaPara") + '1</span><span class="cg">,</span><span class="cs">' + this.i18nt("designer.hint.formulaPara") + '2</span><span class="cg">)</span>'
        },
        funcList: formulas,
        funcActiveCollapseNames: [0]
      };
    },
    mounted() {
    },
    methods: {
      clearFormula(event) {
        this.formula = "";
        this.tags = [];
        this.codeMirror.dispatch({ changes: { from: 0, to: this.codeMirror.state.doc.length, insert: "" } });
      },
      deleteChar(str, subStr, n) {
        let num2 = -1;
        return str.replace(/a/g, (item) => {
          num2++;
          return num2 === n ? "" : item;
        });
      },
      filterNode(value2, data2) {
        if (!value2)
          return true;
        return data2.label.indexOf(value2) !== -1;
      },
      loadFieldListToTree() {
        this.fieldTreeData.length = 0;
        const allFields = getAllFieldWidgets(this.designer.widgetList);
        const allContainers = getAllContainerWidgets(this.designer.widgetList);
        const subFormArray = [];
        let sfFieldArray = [];
        const subFormFieldMap = {};
        allContainers.forEach((con) => {
          if (con.type === "sub-form" || con.type === "grid-sub-form") {
            subFormArray.push(con.container);
            const tmpFieldArray = [];
            const fwHandler = (fw) => {
              if (!!fw.formItemFlag && fw.type === "number") {
                tmpFieldArray.push(fw);
              }
            };
            traverseFieldWidgetsOfContainer(con.container, fwHandler);
            subFormFieldMap[con.container.options.name] = tmpFieldArray;
            sfFieldArray = sfFieldArray.concat(tmpFieldArray);
          }
        });
        allFields.forEach((fld) => {
          if (!sfFieldArray.find((item) => item.id === fld.field.id)) {
            const fieldNode = {
              id: fld.field.id,
              name: fld.field.options.name,
              label: fld.field.options.label,
              type: fld.field.type,
              formItemFlag: true
            };
            if (fieldNode.name !== this.optionModel.name && fieldNode.type === "number") {
              this.fieldTreeData.push(fieldNode);
            }
          }
        });
        subFormArray.forEach((sf) => {
          const subFormNode = {
            id: sf.id,
            name: sf.options.name,
            label: sf.options.name || sf.type,
            type: sf.type,
            formItemFlag: false,
            children: []
          };
          subFormFieldMap[sf.options.name].forEach((fld) => {
            const fieldNode = {
              id: fld.id,
              name: fld.options.name,
              label: fld.options.label,
              type: fld.type,
              formItemFlag: true
            };
            if (fieldNode.name !== this.optionModel.name) {
              subFormNode.children.push(fieldNode);
            }
          });
          this.fieldTreeData.push(subFormNode);
        });
      },
      insertField(obj, node, self2) {
        if (!!obj.formItemFlag) {
          let fieldId = obj.id;
          let fieldLabel = "[" + obj.label + "]";
          this.updateCodeMirror(fieldId, fieldLabel, "field");
        }
      },
      insertSymbol(opt) {
        this.updateCodeMirror(opt, opt, null);
      },
      insertFunction(opt) {
        const val = opt.substring(0, opt.length - 1);
        this.updateCodeMirror(val, val, "func");
      },
      updateCodeMirror(field, text, type = null) {
        if (type) {
          let obj = {
            field,
            text,
            type
          };
          let selectionLet = obj.field.length + obj.text.length + obj.type.length;
          let code2 = `{{${obj.field}.${obj.text}.${obj.type}}}`;
          if (type === "func") {
            code2 += "()";
            selectionLet = selectionLet + 7;
          } else {
            selectionLet = selectionLet + 6;
          }
          if (code2) {
            this.codeMirror.dispatch({
              changes: {
                from: this.codeMirror.state.selection.main.head,
                to: this.codeMirror.state.selection.main.head,
                insert: code2
              },
              selection: { anchor: this.codeMirror.state.selection.main.head + selectionLet }
            });
          }
        } else {
          this.codeMirror.dispatch({
            changes: {
              from: this.codeMirror.state.selection.main.head,
              to: this.codeMirror.state.selection.main.head,
              insert: text
            },
            selection: { anchor: this.codeMirror.state.selection.main.head + text.length }
          });
        }
      },
      removeStr(str) {
        let a = str.indexOf("[");
        if (a === -1) {
          return str;
        }
        let b = str.indexOf("]", a) + 1;
        let c = str.substring(a, b);
        let strArr = str.split(c);
        let newStr = "";
        for (let i2 = 0; i2 < strArr.length; i2++) {
          newStr += strArr[i2];
        }
        return this.removeStr(newStr);
      },
      refreshFormula() {
        const matchResult = this.optionModel.formula.match(FORMULA_REG_EXP);
        if (!matchResult) {
          return this.optionModel.formula;
        }
        matchResult.forEach((mi) => {
          const firstPart = mi.split(".")[0];
          const thirdPart = mi.split(".")[2];
          const nodeType = thirdPart.substring(0, thirdPart.length - 2);
          if (nodeType === "func") {
            return;
          }
          const fieldId = firstPart.substring(2, firstPart.length);
          const fieldSchema = getFieldWidgetById(this.designer.widgetList, fieldId, false);
          const newLabel = fieldSchema.options.label || fieldSchema.options.name;
          this.optionModel.formula = this.optionModel.formula.replace(mi, firstPart + ".[" + newLabel + "]." + thirdPart);
        });
      },
      editFormula() {
        this.fieldTreeData.length = 0;
        this.designer.widgetList.forEach((wItem) => {
          if (this.optionModel.name !== wItem.id) {
            this.loadFieldListToTree();
          }
        });
        console.log("\u8BBE\u8BA1\u5668\u5B57\u6BB5===>", this.fieldTreeData);
        this.tags = deepClone(this.optionModel.formulaTags);
        this.refreshFormula();
        const code2 = this.optionModel.formula;
        this.formulaDialogVisible = true;
        this.$nextTick(() => {
          this.codeMirror = new EditorView({
            state: EditorState.create({
              doc: code2,
              extensions: [
                basicSetup,
                javascript(),
                [baseTheme, [], placeholders]
              ]
            }),
            parent: this.$refs.cmRef
          });
          console.log("\u7F16\u8F91\u5668\u5B9E\u4F8B==>", this.codeMirror);
        });
      },
      saveFormula() {
        this.optionModel.formula = this.codeMirror.state.doc.text.join("");
        this.formulaDialogVisible = false;
      },
      analysisFormula(formula) {
        let a = formula.indexOf("[");
        if (a === -1) {
          return formula;
        }
        let b = formula.indexOf("]", a) + 1;
        let cnField = formula.substring(a, b);
        let enFieldName = this.findTreeNodeByCnName(cnField);
        if (!!enFieldName) {
          formula = formula.replace(cnField, "{" + enFieldName + "}");
          return this.analysisFormula(formula);
        } else {
          this.$message.error(cnField + " \u5B57\u6BB5\u65E0\u6CD5\u8BC6\u522B");
          return false;
        }
      },
      findTreeNodeByCnName(nodeCnName) {
        let enTableName = "", enFieldName = "";
        let tableFieldName = nodeCnName.split("[")[1].split("]")[0];
        let tableName = tableFieldName.split("-")[0];
        let fieldName = tableFieldName.split("-")[1];
        let moduleList = this.fieldTreeData;
        for (let i2 = 0; i2 < moduleList.length; i2++) {
          let tableList = moduleList[i2].children;
          for (let j = 0; j < tableList.length; j++) {
            if (tableList[j].cnTitle === tableName) {
              enTableName = tableList[j].enTitle;
              let fieldList = tableList[j].children;
              for (let k = 0; k < fieldList.length; k++) {
                if (fieldList[k].cnTitle === fieldName) {
                  enFieldName = fieldList[k].enTitle;
                  return enTableName + "-" + enFieldName;
                }
              }
            }
          }
        }
        return null;
      },
      getClass(type) {
        if (type === this.i18nt("designer.hint.formulaNumber")) {
          return "warning";
        }
        if (type === this.i18nt("designer.hint.formulaChar")) {
          return "";
        }
        if (type === this.i18nt("designer.hint.formulaObject")) {
          return "danger";
        }
      },
      resetIntro() {
        this.introTitle = this.i18nt("designer.hint.formulaFunctionExplain");
        this.introduction = {
          title: this.i18nt("designer.hint.formulaPleaseSelect"),
          content: '<span class="cg">' + this.i18nt("designer.hint.formulaSample") + '\uFF1A</span><span class="fname">SUM</span><span class="cg">(</span><span class="cs">\u53C2\u65701</span><span class="cg">,</span><span class="cs">\u53C2\u65702</span><span class="cg">)</span>'
        };
      },
      showIntro(name2, title, content2) {
        content2 = '<span class="cg">' + content2 + "</span>";
        this.introduction = {
          title,
          content: content2
        };
        this.introTitle = name2;
      },
      isValid(s) {
        let a = [];
        let l = s.length;
        let k = 0;
        let flag = 1;
        let j;
        for (let i2 = 0; i2 < l && flag; i2++) {
          switch (s[i2]) {
            case "(":
              a[k] = i2;
              k++;
              break;
            case ")":
              j = a[k - 1];
              if (s[j] === "(") {
                a[k] = 0;
                k--;
              } else {
                flag = 0;
              }
              break;
            case "{":
              a[k] = i2;
              k++;
              break;
            case "}":
              j = a[k - 1];
              if (s[j] === "{") {
                a[k] = 0;
                k--;
              } else {
                flag = 0;
              }
              break;
            case "[":
              a[k] = i2;
              k++;
              break;
            case "]":
              j = a[k - 1];
              if (s[j] === "[") {
                a[k] = 0;
                k--;
              } else {
                flag = 0;
              }
              break;
          }
        }
        if (k !== 0) {
          flag = 0;
        }
        return flag !== 0;
      }
    }
  };
  const _hoisted_1$s = { class: "editor" };
  const _hoisted_2$e = { class: "editor-top" };
  const _hoisted_3$a = { style: { "font-weight": "bold" } };
  const _hoisted_4$9 = {
    ref: "cmRef",
    style: { "height": "110px", "width": "100%" }
  };
  const _hoisted_5$8 = { class: "editor-bottom" };
  const _hoisted_6$8 = { class: "group-item-left" };
  const _hoisted_7$5 = { class: "item-header" };
  const _hoisted_8$5 = { class: "item-body-left" };
  const _hoisted_9$4 = { class: "custom-tree-node" };
  const _hoisted_10$4 = { class: "group-item-right-top" };
  const _hoisted_11$3 = { class: "item-header" };
  const _hoisted_12$2 = { class: "function-list" };
  const _hoisted_13$2 = ["onClick", "onMouseenter"];
  const _hoisted_14$1 = { class: "group-item-right-bottom" };
  const _hoisted_15 = { class: "item-header" };
  const _hoisted_16 = { class: "item-body-right-bottom" };
  const _hoisted_17 = {
    key: 0,
    style: { "font-size": "16px", "color": "#0a5d7c" }
  };
  const _hoisted_18 = ["innerHTML"];
  const _hoisted_19 = { class: "dialog-footer" };
  function _sfc_render$3q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_el_tree = require$$0$1.resolveComponent("el-tree");
    const _component_el_tag = require$$0$1.resolveComponent("el-tag");
    const _component_el_collapse_item = require$$0$1.resolveComponent("el-collapse-item");
    const _component_el_collapse = require$$0$1.resolveComponent("el-collapse");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      $props.optionModel.formulaEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.formula")
      }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      $props.optionModel.formulaEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 1,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_tooltip, {
            content: $options.formulaForView,
            effect: "light",
            placement: "top"
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_input, {
                modelValue: $options.formulaForView,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.formulaForView = $event),
                readonly: ""
              }, {
                append: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_button, {
                    onClick: $options.editFormula,
                    icon: "el-icon-edit"
                  }, null, 8, ["onClick"])
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          }, 8, ["content"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_dialog, {
        modelValue: $data.formulaDialogVisible,
        "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.formulaDialogVisible = $event),
        title: _ctx.i18nt("designer.hint.formulaSetting"),
        class: "small-padding-dialog",
        draggable: "",
        "close-on-click-modal": false,
        "close-on-press-escape": false,
        "destroy-on-close": true,
        "append-to-body": false,
        width: "70%",
        ref: "colFormulaDialog"
      }, {
        footer: require$$0$1.withCtx(() => [
          require$$0$1.createElementVNode("div", _hoisted_19, [
            require$$0$1.createVNode(_component_el_button, {
              size: "default",
              type: "primary",
              onClick: $options.saveFormula
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
              ]),
              _: 1
            }, 8, ["onClick"]),
            require$$0$1.createVNode(_component_el_button, {
              size: "default",
              onClick: _cache[4] || (_cache[4] = ($event) => $data.formulaDialogVisible = false)
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
              ]),
              _: 1
            })
          ])
        ]),
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_row, null, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_col, { span: 24 }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("div", _hoisted_1$s, [
                    require$$0$1.createElementVNode("div", _hoisted_2$e, [
                      require$$0$1.createVNode(_component_el_row, null, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_col, { span: 22 }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createElementVNode("div", _hoisted_3$a, require$$0$1.toDisplayString(this.optionModel.label) + " = ", 1)
                            ]),
                            _: 1
                          }),
                          require$$0$1.createVNode(_component_el_col, { span: 2 }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createVNode(_component_el_button, {
                                size: "small",
                                onClick: $options.clearFormula,
                                type: "danger",
                                plain: ""
                              }, {
                                default: require$$0$1.withCtx(() => [
                                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.formulaClear")), 1)
                                ]),
                                _: 1
                              }, 8, ["onClick"])
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }),
                      require$$0$1.createElementVNode("div", _hoisted_4$9, null, 512)
                    ]),
                    require$$0$1.createElementVNode("div", _hoisted_5$8, [
                      (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.operate, (item, idx) => {
                        return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                          onClick: ($event) => $options.insertSymbol(item),
                          size: "default",
                          key: idx
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(item), 1)
                          ]),
                          _: 2
                        }, 1032, ["onClick"]);
                      }), 128))
                    ])
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          }),
          require$$0$1.createVNode(_component_el_row, { style: { "margin": "10px" } }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("div", _hoisted_6$8, [
                    require$$0$1.createElementVNode("div", _hoisted_7$5, require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.formulaWidgetList")), 1),
                    require$$0$1.createVNode(_component_el_input, {
                      placeholder: _ctx.i18nt("designer.hint.formulaSearch"),
                      modelValue: $data.filterText,
                      "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.filterText = $event),
                      clearable: ""
                    }, null, 8, ["placeholder", "modelValue"]),
                    require$$0$1.createElementVNode("div", _hoisted_8$5, [
                      require$$0$1.createVNode(_component_el_tree, {
                        ref: "fieldTree",
                        data: $data.fieldTreeData,
                        "filter-node-method": $options.filterNode,
                        onNodeClick: $options.insertField
                      }, {
                        default: require$$0$1.withCtx(({ node, data: data2 }) => [
                          require$$0$1.createElementVNode("span", _hoisted_9$4, [
                            require$$0$1.createVNode(_component_el_tooltip, {
                              effect: "dark",
                              content: node.label,
                              placement: "right"
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(node.label), 1)
                              ]),
                              _: 2
                            }, 1032, ["content"])
                          ])
                        ]),
                        _: 1
                      }, 8, ["data", "filter-node-method", "onNodeClick"])
                    ])
                  ])
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_row, null, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_col, { span: 24 }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createElementVNode("div", _hoisted_10$4, [
                            require$$0$1.createElementVNode("div", _hoisted_11$3, require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.formulaFunctionList")), 1),
                            require$$0$1.createElementVNode("div", _hoisted_12$2, [
                              require$$0$1.createVNode(_component_el_collapse, {
                                modelValue: $data.funcActiveCollapseNames,
                                "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.funcActiveCollapseNames = $event)
                              }, {
                                default: require$$0$1.withCtx(() => [
                                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.funcList, (item, index2) => {
                                    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                                      key: index2,
                                      title: _ctx.i18nt(item.fClass),
                                      name: index2
                                    }, {
                                      default: require$$0$1.withCtx(() => [
                                        (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(item.flist, (info, i2) => {
                                          return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
                                            key: i2,
                                            class: "field-item",
                                            onClick: ($event) => $options.insertFunction(info.fName + "("),
                                            onMouseenter: ($event) => $options.showIntro(_ctx.i18nt(info.fName), _ctx.i18nt(item.fClass), _ctx.i18nt(info.fIntro)),
                                            onMouseleave: _cache[2] || (_cache[2] = (...args) => $options.resetIntro && $options.resetIntro(...args))
                                          }, [
                                            require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(info.fName), 1),
                                            require$$0$1.createVNode(_component_el_tag, {
                                              type: $options.getClass(info.fType)
                                            }, {
                                              default: require$$0$1.withCtx(() => [
                                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt(info.fType)), 1)
                                              ]),
                                              _: 2
                                            }, 1032, ["type"])
                                          ], 40, _hoisted_13$2);
                                        }), 128))
                                      ]),
                                      _: 2
                                    }, 1032, ["title", "name"]);
                                  }), 128))
                                ]),
                                _: 1
                              }, 8, ["modelValue"])
                            ])
                          ])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_col, { span: 12 }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("div", _hoisted_14$1, [
                    require$$0$1.createElementVNode("div", _hoisted_15, require$$0$1.toDisplayString($data.introTitle), 1),
                    require$$0$1.createElementVNode("div", _hoisted_16, [
                      require$$0$1.createElementVNode("ul", null, [
                        $data.introduction.title !== "" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("li", _hoisted_17, require$$0$1.toDisplayString($data.introduction.title), 1)) : require$$0$1.createCommentVNode("", true),
                        require$$0$1.createElementVNode("li", null, [
                          require$$0$1.createElementVNode("div", {
                            class: "intro-content",
                            innerHTML: $data.introduction.content
                          }, null, 8, _hoisted_18)
                        ])
                      ])
                    ])
                  ])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["modelValue", "title"])
    ]);
  }
  var formulaEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3q, [["render", _sfc_render$3q], ["__scopeId", "data-v-bdc01096"]]);
  var __glob_0_19 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": formulaEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3p = {
    name: "formulaEnabled-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    methods: {
      handleChangeEvent() {
        if (this.optionModel.formula === void 0) {
          this.optionModel.formula = "";
        }
      }
    }
  };
  function _sfc_render$3p(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.formulaEnabled")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.formulaEnabled,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.formulaEnabled = $event),
          onChange: $options.handleChangeEvent
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var formulaEnabledEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3p, [["render", _sfc_render$3p]]);
  var __glob_0_20 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": formulaEnabledEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3o = {
    name: "hidden-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3o(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.hidden")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.hidden,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.hidden = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var hiddenEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3o, [["render", _sfc_render$3o]]);
  var __glob_0_21 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": hiddenEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3n = {
    name: "label-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      noLabelSetting() {
        return this.selectedWidget.type === "static-text" || this.selectedWidget.type === "html-text";
      }
    }
  };
  function _sfc_render$3n(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return !$options.noLabelSetting ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.label")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.label,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.label = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var labelEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3n, [["render", _sfc_render$3n]]);
  var __glob_0_22 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var labelAlignEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3m = {
    name: "labelAlign-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      noLabelSetting() {
        return this.selectedWidget.type === "static-text" || this.selectedWidget.type === "html-text";
      }
    }
  };
  function _sfc_render$3m(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return !$options.noLabelSetting && $props.selectedWidget.type !== "button" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.labelAlign")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.labelAlign,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelAlign = $event),
          class: "radio-group-custom"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-left-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-center-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.centerAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-right-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var labelAlignEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3m, [["render", _sfc_render$3m], ["__scopeId", "data-v-fcb445c6"]]);
  var __glob_0_23 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelAlignEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3l = {
    name: "labelHidden-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3l(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelHidden")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.labelHidden,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelHidden = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var labelHiddenEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3l, [["render", _sfc_render$3l]]);
  var __glob_0_24 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelHiddenEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3k = {
    name: "labelIconClass-editor",
    components: { IconPicker },
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3k(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_divider, { class: "custom-divider" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.customLabelIcon")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.labelIconClass")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_icon_picker, {
            modelValue: $props.optionModel.labelIconClass,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelIconClass = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])
    ]);
  }
  var labelIconClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3k, [["render", _sfc_render$3k]]);
  var __glob_0_25 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelIconClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3j = {
    name: "labelIconPosition-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        labelIconPosition: [
          { label: "front", value: "front" },
          { label: "rear", value: "rear" }
        ]
      };
    }
  };
  function _sfc_render$3j(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelIconPosition")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.labelIconPosition,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelIconPosition = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.labelIconPosition, (item) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: item.value,
                label: item.label,
                value: item.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var labelIconPositionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3j, [["render", _sfc_render$3j]]);
  var __glob_0_26 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelIconPositionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3i = {
    name: "labelTooltip-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3i(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelTooltip")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.labelTooltip,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelTooltip = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var labelTooltipEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3i, [["render", _sfc_render$3i]]);
  var __glob_0_27 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelTooltipEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3h = {
    name: "labelWidth-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3h(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelWidth")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "number",
          modelValue: $props.optionModel.labelWidth,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelWidth = $event),
          onInput: _ctx.inputNumberHandler,
          min: "0",
          class: "hide-spin-button"
        }, null, 8, ["modelValue", "onInput"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var labelWidthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3h, [["render", _sfc_render$3h]]);
  var __glob_0_28 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelWidthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3g = {
    name: "labelWrap-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3g(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelWrap")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.labelWrap,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelWrap = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var labelWrapEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3g, [["render", _sfc_render$3g]]);
  var __glob_0_29 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": labelWrapEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3f = {
    name: "limit-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3f(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.limit")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.limit,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.limit = $event),
          min: 1,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var limitEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3f, [["render", _sfc_render$3f]]);
  var __glob_0_30 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": limitEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3e = {
    name: "max-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      maxValue: {
        get() {
          return this.optionModel["max"];
        },
        set(newValue) {
          if (!newValue || isNaN(newValue)) {
            this.optionModel.max = null;
          } else {
            this.optionModel.max = Number(newValue);
          }
        }
      }
    }
  };
  function _sfc_render$3e(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.maxValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $options.maxValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.maxValue = $event),
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var maxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3e, [["render", _sfc_render$3e]]);
  var __glob_0_31 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": maxEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3d = {
    name: "maxLength-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      maxLength: {
        get() {
          return this.optionModel["maxLength"];
        },
        set(newValue) {
          if (!newValue || isNaN(newValue)) {
            this.optionModel.maxLength = null;
          } else {
            this.optionModel.maxLength = Number(newValue);
          }
        }
      }
    }
  };
  function _sfc_render$3d(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.maxLength")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "number",
          onInput: _ctx.inputNumberHandler,
          class: "hide-spin-button",
          min: "1",
          modelValue: $options.maxLength,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.maxLength = $event),
          style: { "width": "100%" }
        }, null, 8, ["onInput", "modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var maxLengthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3d, [["render", _sfc_render$3d]]);
  var __glob_0_32 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": maxLengthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3c = {
    name: "min-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      minValue: {
        get() {
          return this.optionModel["min"];
        },
        set(newValue) {
          if (newValue === void 0 || newValue === null || isNaN(newValue)) {
            this.optionModel.min = null;
          } else {
            this.optionModel.min = Number(newValue);
          }
        }
      }
    }
  };
  function _sfc_render$3c(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.minValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $options.minValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.minValue = $event),
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var minEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3c, [["render", _sfc_render$3c]]);
  var __glob_0_33 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": minEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3b = {
    name: "minLength-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {
      minLength: {
        get() {
          return this.optionModel["minLength"];
        },
        set(newValue) {
          if (!newValue || isNaN(newValue)) {
            this.optionModel.minLength = null;
          } else {
            this.optionModel.minLength = Number(newValue);
          }
        }
      }
    }
  };
  function _sfc_render$3b(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.minLength")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "number",
          onInput: _ctx.inputNumberHandler,
          class: "hide-spin-button",
          min: "0",
          modelValue: $options.minLength,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.minLength = $event),
          style: { "width": "100%" }
        }, null, 8, ["onInput", "modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var minLengthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3b, [["render", _sfc_render$3b]]);
  var __glob_0_34 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": minLengthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$3a = {
    name: "multiple-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$3a(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.multiple")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.multiple,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.multiple = $event),
          onChange: _ctx.onMultipleSelected
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var multipleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3a, [["render", _sfc_render$3a]]);
  var __glob_0_35 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": multipleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$39 = {
    name: "multipleLimit-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$39(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.optionModel.multiple ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.multipleLimit")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.multipleLimit,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.multipleLimit = $event),
          min: 0,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var multipleLimitEditor = /* @__PURE__ */ _export_sfc(_sfc_main$39, [["render", _sfc_render$39]]);
  var __glob_0_36 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": multipleLimitEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$38 = {
    name: "multipleSelect-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$38(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.multipleSelect")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.multipleSelect,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.multipleSelect = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var multipleSelectEditor = /* @__PURE__ */ _export_sfc(_sfc_main$38, [["render", _sfc_render$38]]);
  var __glob_0_37 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": multipleSelectEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$37 = {
    name: "name-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    inject: ["getServerFieldList", "getDesignerConfig"],
    data() {
      return {
        nameRequiredRule: [{ required: true, message: "name required" }]
      };
    },
    computed: {
      serverFieldList() {
        return this.getServerFieldList();
      },
      noFieldList() {
        return !this.serverFieldList || this.serverFieldList.length <= 0;
      },
      widgetNameReadonly() {
        return !!this.getDesignerConfig().widgetNameReadonly || !!this.selectedWidget.nameReadonly;
      }
    },
    methods: {
      updateWidgetNameAndRef(newName) {
        let oldName = this.designer.selectedWidgetName;
        if (isEmptyStr(newName)) {
          this.selectedWidget.options.name = oldName;
          this.$message.info(this.i18nt("designer.hint.nameRequired"));
          return;
        }
        if (!!this.designer.formWidget) {
          let foundRef = this.designer.formWidget.getWidgetRef(newName);
          if (!!foundRef) {
            this.selectedWidget.options.name = oldName;
            this.$message.info(this.i18nt("designer.hint.duplicateName") + newName);
            return;
          }
          let widgetInDesign = this.designer.formWidget.getWidgetRef(oldName);
          if (!!widgetInDesign && !!widgetInDesign.registerToRefList) {
            widgetInDesign.registerToRefList(oldName);
            let newLabel = this.getLabelByFieldName(newName);
            this.designer.updateSelectedWidgetNameAndLabel(this.selectedWidget, newName, newLabel);
          }
        }
      },
      getLabelByFieldName(fieldName) {
        for (let i2 = 0; i2 < this.serverFieldList.length; i2++) {
          if (this.serverFieldList[i2].name === fieldName) {
            return this.serverFieldList[i2].label;
          }
        }
        return null;
      }
    }
  };
  function _sfc_render$37(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      prop: "name",
      rules: $data.nameRequiredRule
    }, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.uniqueName")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.editNameHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        !!$props.selectedWidget.category || $options.noFieldList ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
          key: 0,
          type: "text",
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.name = $event),
          readonly: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef
        }, null, 8, ["modelValue", "readonly", "onChange"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
          key: 1,
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.name = $event),
          "allow-create": "",
          filterable: "",
          disabled: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef,
          title: _ctx.i18nt("designer.setting.editNameHelp")
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.serverFieldList, (sf, sfIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: sfIdx,
                label: sf.label,
                value: sf.name
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "onChange", "title"]))
      ]),
      _: 1
    }, 8, ["rules"]);
  }
  var nameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$37, [["render", _sfc_render$37]]);
  var __glob_0_38 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": nameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var optionItemsSetting_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$36 = {
    name: "OptionItemsSetting",
    mixins: [i18n$1],
    components: {
      CodeEditor
    },
    props: {
      designer: Object,
      selectedWidget: Object
    },
    data() {
      return {
        showImportDialogFlag: false,
        optionLines: "",
        cascaderOptions: "",
        showImportCascaderDialogFlag: false,
        separator: ","
      };
    },
    computed: {
      optionModel() {
        return this.selectedWidget.options;
      }
    },
    watch: {
      "selectedWidget.options": {
        deep: true,
        handler(val) {
        }
      }
    },
    methods: {
      handelValueTypeChange(valueType) {
        if (this.selectedWidget.type === "checkbox" || this.selectedWidget.type === "select" && this.selectedWidget.options.multiple) {
          this.optionModel.defaultValue = [];
        } else {
          this.optionModel.defaultValue = "";
        }
        this.selectedWidget.options.optionItems.forEach((opt, idx) => {
          let optValue = opt.value + "";
          if (valueType === "String") {
            opt.value = optValue;
          } else if (valueType === "Number") {
            if (!isNaN(optValue * 1)) {
              opt.value = Number(optValue);
            } else {
              opt.value = idx + 1;
            }
          } else if (valueType === "Boolean") {
            if (optValue.toLowerCase() === "true" || optValue === "1") {
              opt.value = true;
            } else {
              opt.value = false;
            }
          }
        });
      },
      emitDefaultValueChange() {
        if (!!this.designer && !!this.designer.formWidget) {
          let fieldWidget2 = this.designer.formWidget.getWidgetRef(this.selectedWidget.options.name);
          if (!!fieldWidget2 && !!fieldWidget2.refreshDefaultValue) {
            fieldWidget2.refreshDefaultValue();
          }
        }
      },
      deleteOption(option, index2) {
        this.optionModel.optionItems.splice(index2, 1);
      },
      addOption() {
        let newValue = this.optionModel.optionItems.length + 1;
        this.optionModel.optionItems.forEach((oi) => {
          if (Number.isFinite(oi.value) && oi.value >= newValue) {
            newValue += 1;
          }
        });
        this.optionModel.optionItems.push({
          value: newValue,
          label: "new option"
        });
      },
      importOptions() {
        this.optionLines = "";
        if (this.optionModel.optionItems.length > 0) {
          this.optionModel.optionItems.forEach((opt) => {
            if (opt.value === opt.label) {
              this.optionLines += opt.value + "\n";
            } else {
              this.optionLines += opt.value + this.separator + opt.label + "\n";
            }
          });
        }
        this.showImportDialogFlag = true;
      },
      saveOptions() {
        let lineArray = this.optionLines.split("\n");
        if (lineArray.length > 0) {
          this.optionModel.optionItems = [];
          lineArray.forEach((optLine) => {
            if (!!optLine && !!optLine.trim()) {
              if (optLine.indexOf(this.separator) !== -1) {
                this.optionModel.optionItems.push({
                  value: optLine.split(this.separator)[0],
                  label: optLine.split(this.separator)[1]
                });
              } else {
                this.optionModel.optionItems.push({
                  value: optLine,
                  label: optLine
                });
              }
            }
          });
        } else {
          this.optionModel.optionItems = [];
        }
        this.showImportDialogFlag = false;
      },
      resetDefault() {
        if (this.selectedWidget.type === "checkbox" || this.selectedWidget.type === "select" && this.selectedWidget.options.multiple) {
          this.optionModel.defaultValue = [];
        } else {
          this.optionModel.defaultValue = "";
        }
        this.emitDefaultValueChange();
      },
      importCascaderOptions() {
        this.cascaderOptions = JSON.stringify(this.optionModel.optionItems, null, "  ");
        this.showImportCascaderDialogFlag = true;
      },
      saveCascaderOptions() {
        try {
          let newOptions = JSON.parse(this.cascaderOptions);
          this.optionModel.optionItems = newOptions;
          this.showImportCascaderDialogFlag = false;
        } catch (ex) {
          this.$message.error(this.i18nt("designer.hint.invalidOptionsData") + ex.message);
        }
      }
    }
  };
  const _withScopeId$3 = (n) => (require$$0$1.pushScopeId("data-v-21e9cd1e"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$r = { class: "option-items-pane" };
  const _hoisted_2$d = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-option" }, null, -1));
  const _hoisted_3$9 = /* @__PURE__ */ _withScopeId$3(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-option" }, null, -1));
  const _hoisted_4$8 = {
    key: 3,
    class: "full-width-input"
  };
  const _hoisted_5$7 = { key: 4 };
  const _hoisted_6$7 = { key: 5 };
  const _hoisted_7$4 = {
    key: 6,
    class: ""
  };
  const _hoisted_8$4 = { class: "dialog-footer" };
  const _hoisted_9$3 = {
    key: 7,
    class: ""
  };
  const _hoisted_10$3 = { class: "dialog-footer" };
  function _sfc_render$36(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_radio = require$$0$1.resolveComponent("el-radio");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_checkbox = require$$0$1.resolveComponent("el-checkbox");
    const _component_el_checkbox_group = require$$0$1.resolveComponent("el-checkbox-group");
    const _component_el_cascader = require$$0$1.resolveComponent("el-cascader");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$r, [
      require$$0$1.createVNode(_component_el_form_item, { label: "\u5B57\u5178\u7F16\u7801" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $options.optionModel.eboDictCode,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $options.optionModel.eboDictCode = $event),
            size: "small"
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, { label: "\u7981\u7528\u9009\u9879(key\u503C)" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $options.optionModel.eboDisabledKey,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $options.optionModel.eboDisabledKey = $event),
            size: "small"
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }),
      $props.selectedWidget.type !== "cascader" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.optionValueType")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $options.optionModel.optionValueType,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $options.optionModel.optionValueType = $event),
            onChange: $options.handelValueTypeChange
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_option, {
                label: _ctx.i18nt("designer.setting.dsRequestValueStringType"),
                value: "String"
              }, null, 8, ["label"]),
              require$$0$1.createVNode(_component_el_option, {
                label: _ctx.i18nt("designer.setting.dsRequestValueNumberType"),
                value: "Number"
              }, null, 8, ["label"])
            ]),
            _: 1
          }, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      $props.selectedWidget.type === "radio" || $props.selectedWidget.type === "select" && !$props.selectedWidget.options.multiple ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_radio_group, {
        key: 1,
        modelValue: $options.optionModel.defaultValue,
        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $options.optionModel.defaultValue = $event),
        onChange: $options.emitDefaultValueChange
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
            tag: "ul",
            list: $options.optionModel.optionItems,
            "item-key": "id"
          }, { group: "optionsGroup", ghostClass: "ghost", handle: ".drag-option" }), {
            item: require$$0$1.withCtx(({ element: option, index: idx }) => [
              require$$0$1.createElementVNode("li", null, [
                require$$0$1.createVNode(_component_el_radio, {
                  label: option.value
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_input, {
                      modelValue: option.value,
                      "onUpdate:modelValue": ($event) => option.value = $event,
                      size: "small",
                      style: { "width": "100px" }
                    }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                    require$$0$1.createVNode(_component_el_input, {
                      modelValue: option.label,
                      "onUpdate:modelValue": ($event) => option.label = $event,
                      size: "small",
                      style: { "width": "100px" }
                    }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                    _hoisted_2$d,
                    require$$0$1.createVNode(_component_el_button, {
                      circle: "",
                      plain: "",
                      size: "small",
                      type: "danger",
                      onClick: ($event) => $options.deleteOption(option, idx),
                      icon: "el-icon-minus",
                      class: "col-delete-button"
                    }, null, 8, ["onClick"])
                  ]),
                  _: 2
                }, 1032, ["label"])
              ])
            ]),
            _: 1
          }, 16, ["list"])
        ]),
        _: 1
      }, 8, ["modelValue", "onChange"])) : $props.selectedWidget.type === "checkbox" || $props.selectedWidget.type === "select" && $props.selectedWidget.options.multiple ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_checkbox_group, {
        key: 2,
        modelValue: $options.optionModel.defaultValue,
        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $options.optionModel.defaultValue = $event),
        onChange: $options.emitDefaultValueChange
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
            tag: "ul",
            list: $options.optionModel.optionItems,
            "item-key": "id"
          }, { group: "optionsGroup", ghostClass: "ghost", handle: ".drag-option" }), {
            item: require$$0$1.withCtx(({ element: option, index: idx }) => [
              require$$0$1.createElementVNode("li", null, [
                require$$0$1.createVNode(_component_el_checkbox, {
                  label: option.value
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_input, {
                      modelValue: option.value,
                      "onUpdate:modelValue": ($event) => option.value = $event,
                      size: "small",
                      style: { "width": "100px" }
                    }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                    require$$0$1.createVNode(_component_el_input, {
                      modelValue: option.label,
                      "onUpdate:modelValue": ($event) => option.label = $event,
                      size: "small",
                      style: { "width": "100px" }
                    }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                    _hoisted_3$9,
                    require$$0$1.createVNode(_component_el_button, {
                      circle: "",
                      plain: "",
                      size: "small",
                      type: "danger",
                      onClick: ($event) => $options.deleteOption(option, idx),
                      icon: "el-icon-minus",
                      class: "col-delete-button"
                    }, null, 8, ["onClick"])
                  ]),
                  _: 2
                }, 1032, ["label"])
              ])
            ]),
            _: 1
          }, 16, ["list"])
        ]),
        _: 1
      }, 8, ["modelValue", "onChange"])) : $props.selectedWidget.type === "cascader" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_4$8, [
        require$$0$1.createVNode(_component_el_cascader, {
          modelValue: $options.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $options.optionModel.defaultValue = $event),
          options: $options.optionModel.optionItems,
          onChange: $options.emitDefaultValueChange,
          placeholder: _ctx.i18nt("render.hint.selectPlaceholder")
        }, null, 8, ["modelValue", "options", "onChange", "placeholder"])
      ])) : require$$0$1.createCommentVNode("", true),
      $props.selectedWidget.type === "cascader" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_5$7, [
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          onClick: $options.importCascaderOptions
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.importOptions")), 1)
          ]),
          _: 1
        }, 8, ["onClick"]),
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          onClick: $options.resetDefault
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.resetDefault")), 1)
          ]),
          _: 1
        }, 8, ["onClick"])
      ])) : require$$0$1.createCommentVNode("", true),
      $props.selectedWidget.type === "radio" || $props.selectedWidget.type === "checkbox" || $props.selectedWidget.type === "select" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_6$7, [
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          onClick: $options.addOption
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addOption")), 1)
          ]),
          _: 1
        }, 8, ["onClick"]),
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          onClick: $options.importOptions
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.importOptions")), 1)
          ]),
          _: 1
        }, 8, ["onClick"]),
        require$$0$1.createVNode(_component_el_button, {
          link: "",
          type: "primary",
          onClick: $options.resetDefault
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.resetDefault")), 1)
          ]),
          _: 1
        }, 8, ["onClick"])
      ])) : require$$0$1.createCommentVNode("", true),
      $data.showImportDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_7$4, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.importOptions"),
          modelValue: $data.showImportDialogFlag,
          "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.showImportDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_8$4, [
              require$$0$1.createVNode(_component_el_button, {
                size: "large",
                type: "primary",
                onClick: $options.saveOptions
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                size: "large",
                onClick: _cache[7] || (_cache[7] = ($event) => $data.showImportDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_form_item, null, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_input, {
                  type: "textarea",
                  rows: "10",
                  modelValue: $data.optionLines,
                  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.optionLines = $event)
                }, null, 8, ["modelValue"])
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showImportCascaderDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_9$3, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.importOptions"),
          modelValue: $data.showImportCascaderDialogFlag,
          "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.showImportCascaderDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_10$3, [
              require$$0$1.createVNode(_component_el_button, {
                size: "large",
                type: "primary",
                onClick: $options.saveCascaderOptions
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                size: "large",
                onClick: _cache[10] || (_cache[10] = ($event) => $data.showImportCascaderDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_code_editor, {
              modelValue: $data.cascaderOptions,
              "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.cascaderOptions = $event),
              mode: "json",
              readonly: false
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var OptionItemsSetting = /* @__PURE__ */ _export_sfc(_sfc_main$36, [["render", _sfc_render$36], ["__scopeId", "data-v-21e9cd1e"]]);
  const _sfc_main$35 = {
    name: "optionItems-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    components: {
      OptionItemsSetting
    },
    data() {
      return {
        dataSetList: []
      };
    },
    computed: {
      dataSourceList() {
        if (!this.designer.formConfig || !this.designer.formConfig.dataSources) {
          return [];
        } else {
          return this.designer.formConfig.dataSources;
        }
      }
    },
    watch: {
      selectedWidget: {
        handler(val, oldVal) {
          if (!val) {
            return;
          }
          this.loadDataSet(val.options.dsName);
        },
        immediate: true
      }
    },
    methods: {
      loadDataSet(dsName) {
        this.dataSetList.length = 0;
        if (!dsName) {
          return;
        }
        let dsModel = getDSByName(this.designer.formConfig, dsName);
        if (!!dsModel && !!dsModel.dataSets) {
          dsModel.dataSets.forEach((dSet) => {
            this.dataSetList.push({
              name: dSet.name,
              remark: dSet.remark
            });
          });
        }
      },
      getDataSetList() {
        this.optionModel.dataSetName = "";
        this.loadDataSet(this.optionModel.dsName);
      }
    }
  };
  const _hoisted_1$q = {
    key: 0,
    style: { "display": "none" }
  };
  function _sfc_render$35(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_option_items_setting = require$$0$1.resolveComponent("option-items-setting");
    return !!$props.selectedWidget.optionItemsReadonly ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$q)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 1 }, [
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_divider, { class: "custom-divider-margin-top" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.optionsSetting")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.labelKeyName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.labelKey,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelKey = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.valueKeyName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.valueKey,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.valueKey = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      _ctx.hasConfig("childrenKey") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.childrenKeyName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.childrenKey,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.optionModel.childrenKey = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.dsEnabled")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.dsEnabled,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.optionModel.dsEnabled = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 1,
        label: _ctx.i18nt("designer.setting.dsName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dsName,
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $props.optionModel.dsName = $event),
            filterable: "",
            clearable: "",
            onChange: $options.getDataSetList
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.dataSourceList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.description,
                  label: item.uniqueName,
                  value: item.uniqueName
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 2,
        label: _ctx.i18nt("designer.setting.dataSetName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dataSetName,
            "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $props.optionModel.dataSetName = $event),
            filterable: "",
            clearable: ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dataSetList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.remark,
                  label: item.name,
                  value: item.name
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 3,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_option_items_setting, {
            designer: $props.designer,
            "selected-widget": $props.selectedWidget
          }, null, 8, ["designer", "selected-widget"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true)
    ], 64));
  }
  var optionItemsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$35, [["render", _sfc_render$35]]);
  var __glob_0_39 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": optionItemsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$34 = {
    name: "placeholder-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$34(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.placeholder")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.placeholder,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.placeholder = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var placeholderEditor = /* @__PURE__ */ _export_sfc(_sfc_main$34, [["render", _sfc_render$34]]);
  var __glob_0_40 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": placeholderEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$33 = {
    name: "precision-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$33(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.precision")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.precision,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.precision = $event),
          min: 0,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var precisionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$33, [["render", _sfc_render$33]]);
  var __glob_0_41 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": precisionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$32 = {
    name: "prefixIcon-editor",
    components: { IconPicker },
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$32(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.prefixIcon")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_icon_picker, {
          modelValue: $props.optionModel.prefixIcon,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.prefixIcon = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var prefixIconEditor = /* @__PURE__ */ _export_sfc(_sfc_main$32, [["render", _sfc_render$32]]);
  var __glob_0_42 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": prefixIconEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$31 = {
    name: "readonly-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$31(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.readonly")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.readonly,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.readonly = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var readonlyEditor = /* @__PURE__ */ _export_sfc(_sfc_main$31, [["render", _sfc_render$31]]);
  var __glob_0_43 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": readonlyEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$30 = {
    name: "remote-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$30(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.remote")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.remote,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.remote = $event),
          onChange: _ctx.onRemoteChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var remoteEditor = /* @__PURE__ */ _export_sfc(_sfc_main$30, [["render", _sfc_render$30]]);
  var __glob_0_44 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": remoteEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2$ = {
    name: "required-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2$(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.required")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.required,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.required = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var requiredEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2$, [["render", _sfc_render$2$]]);
  var __glob_0_45 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": requiredEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2_ = {
    name: "requiredHint-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2_(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.requiredHint")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.requiredHint,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.requiredHint = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var requiredHintEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2_, [["render", _sfc_render$2_]]);
  var __glob_0_46 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": requiredHintEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2Z = {
    name: "rows-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2Z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return !$props.optionModel.autosize ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.rows")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.rows,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.rows = $event),
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var rowsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2Z, [["render", _sfc_render$2Z]]);
  var __glob_0_47 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": rowsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2Y = {
    name: "showFileList-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2Y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showFileList")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showFileList,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showFileList = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showFileListEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2Y, [["render", _sfc_render$2Y]]);
  var __glob_0_48 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showFileListEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2X = {
    name: "showPassword-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2X(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.optionModel.type === "password" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.showPassword")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showPassword,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showPassword = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var showPasswordEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2X, [["render", _sfc_render$2X]]);
  var __glob_0_49 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showPasswordEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2W = {
    name: "showWordLimit-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2W(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showWordLimit")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showWordLimit,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showWordLimit = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showWordLimitEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["render", _sfc_render$2W]]);
  var __glob_0_50 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showWordLimitEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2V = {
    name: "size-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        widgetSizes: [
          { label: "default", value: "" },
          { label: "large", value: "large" },
          { label: "small", value: "small" }
        ]
      };
    }
  };
  function _sfc_render$2V(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.widgetSize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.size,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.size = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.widgetSizes, (item) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: item.value,
                label: item.label,
                value: item.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var sizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2V, [["render", _sfc_render$2V]]);
  var __glob_0_51 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": sizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2U = {
    name: "startPlaceholder-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2U(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.startPlaceholder")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.startPlaceholder,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.startPlaceholder = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var startPlaceholderEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2U, [["render", _sfc_render$2U]]);
  var __glob_0_52 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": startPlaceholderEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2T = {
    name: "step-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2T(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.step")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.step,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.step = $event),
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var stepEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["render", _sfc_render$2T]]);
  var __glob_0_53 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": stepEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2S = {
    name: "suffixIcon-editor",
    components: { IconPicker },
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2S(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.suffixIcon")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_icon_picker, {
          modelValue: $props.optionModel.suffixIcon,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.suffixIcon = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var suffixIconEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2S, [["render", _sfc_render$2S]]);
  var __glob_0_54 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": suffixIconEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var textAlignEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2R = {
    name: "textAlign-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2R(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.selectedWidget.type === "static-text" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.textAlign")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.textAlign,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.textAlign = $event),
          class: "radio-group-custom"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio_button, { label: "left" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "center" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.centerAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "right" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var textAlignEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2R, [["render", _sfc_render$2R], ["__scopeId", "data-v-f9cc7378"]]);
  var __glob_0_55 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": textAlignEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2Q = {
    name: "type-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {}
  };
  function _sfc_render$2Q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.selectedWidget.type === "input" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.displayType")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.type,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.type = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "text",
              value: "text"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "password",
              value: "password"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var typeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2Q, [["render", _sfc_render$2Q]]);
  var __glob_0_56 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": typeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2P = {
    name: "uploadTip-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2P(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.uploadTip")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.uploadTip,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.uploadTip = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var uploadTipEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["render", _sfc_render$2P]]);
  var __glob_0_57 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": uploadTipEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2O = {
    name: "uploadURL-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2O(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_divider, { class: "custom-divider" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.uploadSetting")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.uploadURL")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            type: "text",
            modelValue: $props.optionModel.uploadURL,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.uploadURL = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])
    ]);
  }
  var uploadURLEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2O, [["render", _sfc_render$2O]]);
  var __glob_0_58 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": uploadURLEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2N = {
    name: "validation-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        fieldValidators: [
          { value: "number", label: this.i18nt("designer.hint.numberValidator") },
          { value: "letter", label: this.i18nt("designer.hint.letterValidator") },
          { value: "letterAndNumber", label: this.i18nt("designer.hint.letterAndNumberValidator") },
          { value: "mobilePhone", label: this.i18nt("designer.hint.mobilePhoneValidator") },
          { value: "email", label: this.i18nt("designer.hint.emailValidator") },
          { value: "url", label: this.i18nt("designer.hint.urlValidator") },
          { value: "noChinese", label: this.i18nt("designer.hint.noChineseValidator") },
          { value: "chinese", label: this.i18nt("designer.hint.chineseValidator") }
        ]
      };
    }
  };
  function _sfc_render$2N(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, null, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.validation")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.validationHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.validation,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.validation = $event),
          filterable: "",
          clearable: "",
          "allow-create": "",
          "default-first-option": ""
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.fieldValidators, (fv, fvIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: fvIdx,
                label: fv.label,
                value: fv.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    });
  }
  var validationEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2N, [["render", _sfc_render$2N]]);
  var __glob_0_59 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": validationEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2M = {
    name: "validationHint-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2M(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.validationHint")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.validationHint,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.validationHint = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var validationHintEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2M, [["render", _sfc_render$2M]]);
  var __glob_0_60 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": validationHintEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2L = {
    name: "withCredentials-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2L(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.withCredentials")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.withCredentials,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.withCredentials = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var withCredentialsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2L, [["render", _sfc_render$2L]]);
  var __glob_0_61 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": withCredentialsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2K = {
    name: "button-group-customClass-editor",
    componentName: "PropertyEditor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    components: {
      IconPicker
    },
    data() {
      return {
        showButtonsEditDialog: false,
        oldButtonName: "",
        cssClassList: [],
        nameRules: [
          { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
        ]
      };
    },
    created() {
      this.cssClassList = deepClone(this.designer.getCssClassList());
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.cssClassList = cssClassList;
      });
    },
    methods: {
      editButtonsColumn() {
        this.showButtonsEditDialog = true;
      },
      onButtonNameFocus(event) {
        this.oldButtonName = event.target.value;
      },
      onButtonNameChange(newName, btnIdx) {
        let sameNameFlag = false;
        this.optionModel.buttons.map((tb, tbIdx) => {
          if (tb.name === newName && tbIdx !== btnIdx) {
            sameNameFlag = true;
          }
        });
        if (sameNameFlag) {
          this.$message.error(this.i18nt("designer.setting.operationButtonDuplicatedNameError"));
          this.optionModel.buttons[btnIdx].name = this.oldButtonName;
        }
      },
      deleteGroupButton(idx) {
        this.$confirm(this.i18nt("designer.setting.deleteOperationButtonHint"), this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          this.optionModel.buttons.splice(idx, 1);
        }).catch((error2) => {
        });
      },
      addGroupButton() {
        this.optionModel.buttons = this.optionModel.buttons || [];
        this.optionModel.buttons.push({
          name: "btn" + generateId(),
          label: "new btn",
          type: "",
          size: "small",
          round: false,
          hidden: false,
          disabled: false
        });
      }
    }
  };
  const _hoisted_1$p = { key: 0 };
  const _hoisted_2$c = /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-handler" }, null, -1);
  const _hoisted_3$8 = { class: "dialog-footer" };
  function _sfc_render$2K(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.buttonsColumnEdit")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_button, {
            type: "primary",
            plain: "",
            round: "",
            onClick: $options.editButtonsColumn
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.editAction")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.customClass")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.customClass,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.customClass = $event),
            multiple: "",
            filterable: "",
            "allow-create": "",
            "default-first-option": ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  label: item,
                  value: item
                }, null, 8, ["label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      $data.showButtonsEditDialog ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$p, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.groupButtonsEdit"),
          modelValue: $data.showButtonsEditDialog,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.showButtonsEditDialog = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true,
          width: "1120px"
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_3$8, [
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                onClick: _cache[2] || (_cache[2] = ($event) => $data.showButtonsEditDialog = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_form, {
              "label-position": "top",
              model: $props.optionModel
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_row, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_col, { span: 24 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_divider, { "content-position": "left" }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.operationButtonsSetting")), 1)
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
                  modelValue: $props.optionModel.buttons,
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.buttons = $event),
                  "item-key": "id"
                }, { ghostClass: "ghost", handle: ".drag-handler" }), {
                  item: require$$0$1.withCtx(({ element: btn, index: bIdx }) => [
                    require$$0$1.createVNode(_component_el_row, {
                      gutter: 8,
                      class: "button-row"
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_col, {
                          span: 1,
                          class: "drag-sort-col"
                        }, {
                          default: require$$0$1.withCtx(() => [
                            _hoisted_2$c
                          ]),
                          _: 1
                        }),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".name",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonName"),
                              rules: $data.nameRules
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: btn.name,
                                  "onUpdate:modelValue": ($event) => btn.name = $event,
                                  onFocus: $options.onButtonNameFocus,
                                  onChange: (value2) => $options.onButtonNameChange(value2, bIdx),
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonName")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "onFocus", "onChange", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 2 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".label",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonLabel")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: btn.label,
                                  "onUpdate:modelValue": ($event) => btn.label = $event,
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonLabel")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".type",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonType")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: btn.type,
                                  "onUpdate:modelValue": ($event) => btn.type = $event,
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonType")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, { value: "" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("default")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "text" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("text")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "primary" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("primary")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "success" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("success")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "warning" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("warning")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "danger" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("danger")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "info" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("info")
                                      ]),
                                      _: 1
                                    })
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 5 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".icon",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.buttonIcon")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_icon_picker, {
                                  modelValue: btn.icon,
                                  "onUpdate:modelValue": ($event) => btn.icon = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".round",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonRound")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.round,
                                  "onUpdate:modelValue": ($event) => btn.round = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".hidden",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonHidden")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.hidden,
                                  "onUpdate:modelValue": ($event) => btn.hidden = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "buttons." + bIdx + ".disabled",
                              "label-width": "50px",
                              label: _ctx.i18nt("designer.setting.operationButtonDisabled")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.disabled,
                                  "onUpdate:modelValue": ($event) => btn.disabled = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 1 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_button, {
                              icon: "el-icon-delete",
                              plain: "",
                              circle: "",
                              onClick: ($event) => $options.deleteGroupButton(bIdx)
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      _: 2
                    }, 1024)
                  ]),
                  _: 1
                }, 16, ["modelValue"]),
                require$$0$1.createVNode(_component_el_row, { gutter: 0 }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_col, { span: 4 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_button, {
                          type: "primary",
                          size: "small",
                          icon: "el-icon-plus",
                          plain: "",
                          round: "",
                          onClick: $options.addGroupButton
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addOperationButton")), 1)
                          ]),
                          _: 1
                        }, 8, ["onClick"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["model"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var buttonGroupCustomClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2K, [["render", _sfc_render$2K]]);
  var __glob_0_62 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonGroupCustomClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2J = {
    name: "button-group-size-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        widgetSizes: [
          { label: "default", value: "" },
          { label: "large", value: "large" },
          { label: "small", value: "small" }
        ]
      };
    }
  };
  function _sfc_render$2J(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.widgetSize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.size,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.size = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.widgetSizes, (item) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: item.value,
                label: item.label,
                value: item.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var buttonGroupSizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2J, [["render", _sfc_render$2J]]);
  var __glob_0_63 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonGroupSizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  /**!
   * Sortable 1.14.0
   * @author	RubaXa   <trash@rubaxa.org>
   * @author	owenm    <owen23355@gmail.com>
   * @license MIT
   */
  function ownKeys(object, enumerableOnly) {
    var keys2 = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
      var symbols2 = Object.getOwnPropertySymbols(object);
      if (enumerableOnly) {
        symbols2 = symbols2.filter(function(sym) {
          return Object.getOwnPropertyDescriptor(object, sym).enumerable;
        });
      }
      keys2.push.apply(keys2, symbols2);
    }
    return keys2;
  }
  function _objectSpread2(target) {
    for (var i2 = 1; i2 < arguments.length; i2++) {
      var source = arguments[i2] != null ? arguments[i2] : {};
      if (i2 % 2) {
        ownKeys(Object(source), true).forEach(function(key) {
          _defineProperty(target, key, source[key]);
        });
      } else if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
      } else {
        ownKeys(Object(source)).forEach(function(key) {
          Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
      }
    }
    return target;
  }
  function _typeof(obj) {
    "@babel/helpers - typeof";
    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function(obj2) {
        return typeof obj2;
      };
    } else {
      _typeof = function(obj2) {
        return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
      };
    }
    return _typeof(obj);
  }
  function _defineProperty(obj, key, value2) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value2,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value2;
    }
    return obj;
  }
  function _extends() {
    _extends = Object.assign || function(target) {
      for (var i2 = 1; i2 < arguments.length; i2++) {
        var source = arguments[i2];
        for (var key in source) {
          if (Object.prototype.hasOwnProperty.call(source, key)) {
            target[key] = source[key];
          }
        }
      }
      return target;
    };
    return _extends.apply(this, arguments);
  }
  function _objectWithoutPropertiesLoose(source, excluded) {
    if (source == null)
      return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i2;
    for (i2 = 0; i2 < sourceKeys.length; i2++) {
      key = sourceKeys[i2];
      if (excluded.indexOf(key) >= 0)
        continue;
      target[key] = source[key];
    }
    return target;
  }
  function _objectWithoutProperties(source, excluded) {
    if (source == null)
      return {};
    var target = _objectWithoutPropertiesLoose(source, excluded);
    var key, i2;
    if (Object.getOwnPropertySymbols) {
      var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
      for (i2 = 0; i2 < sourceSymbolKeys.length; i2++) {
        key = sourceSymbolKeys[i2];
        if (excluded.indexOf(key) >= 0)
          continue;
        if (!Object.prototype.propertyIsEnumerable.call(source, key))
          continue;
        target[key] = source[key];
      }
    }
    return target;
  }
  var version = "1.14.0";
  function userAgent(pattern) {
    if (typeof window !== "undefined" && window.navigator) {
      return !!/* @__PURE__ */ navigator.userAgent.match(pattern);
    }
  }
  var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
  var Edge = userAgent(/Edge/i);
  var FireFox = userAgent(/firefox/i);
  var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
  var IOS = userAgent(/iP(ad|od|hone)/i);
  var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
  var captureMode = {
    capture: false,
    passive: false
  };
  function on(el, event, fn) {
    el.addEventListener(event, fn, !IE11OrLess && captureMode);
  }
  function off(el, event, fn) {
    el.removeEventListener(event, fn, !IE11OrLess && captureMode);
  }
  function matches(el, selector) {
    if (!selector)
      return;
    selector[0] === ">" && (selector = selector.substring(1));
    if (el) {
      try {
        if (el.matches) {
          return el.matches(selector);
        } else if (el.msMatchesSelector) {
          return el.msMatchesSelector(selector);
        } else if (el.webkitMatchesSelector) {
          return el.webkitMatchesSelector(selector);
        }
      } catch (_) {
        return false;
      }
    }
    return false;
  }
  function getParentOrHost(el) {
    return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
  }
  function closest(el, selector, ctx, includeCTX) {
    if (el) {
      ctx = ctx || document;
      do {
        if (selector != null && (selector[0] === ">" ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
          return el;
        }
        if (el === ctx)
          break;
      } while (el = getParentOrHost(el));
    }
    return null;
  }
  var R_SPACE = /\s+/g;
  function toggleClass(el, name2, state) {
    if (el && name2) {
      if (el.classList) {
        el.classList[state ? "add" : "remove"](name2);
      } else {
        var className = (" " + el.className + " ").replace(R_SPACE, " ").replace(" " + name2 + " ", " ");
        el.className = (className + (state ? " " + name2 : "")).replace(R_SPACE, " ");
      }
    }
  }
  function css(el, prop, val) {
    var style = el && el.style;
    if (style) {
      if (val === void 0) {
        if (document.defaultView && document.defaultView.getComputedStyle) {
          val = document.defaultView.getComputedStyle(el, "");
        } else if (el.currentStyle) {
          val = el.currentStyle;
        }
        return prop === void 0 ? val : val[prop];
      } else {
        if (!(prop in style) && prop.indexOf("webkit") === -1) {
          prop = "-webkit-" + prop;
        }
        style[prop] = val + (typeof val === "string" ? "" : "px");
      }
    }
  }
  function matrix(el, selfOnly) {
    var appliedTransforms = "";
    if (typeof el === "string") {
      appliedTransforms = el;
    } else {
      do {
        var transform = css(el, "transform");
        if (transform && transform !== "none") {
          appliedTransforms = transform + " " + appliedTransforms;
        }
      } while (!selfOnly && (el = el.parentNode));
    }
    var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
    return matrixFn && new matrixFn(appliedTransforms);
  }
  function find(ctx, tagName, iterator) {
    if (ctx) {
      var list = ctx.getElementsByTagName(tagName), i2 = 0, n = list.length;
      if (iterator) {
        for (; i2 < n; i2++) {
          iterator(list[i2], i2);
        }
      }
      return list;
    }
    return [];
  }
  function getWindowScrollingElement() {
    var scrollingElement = document.scrollingElement;
    if (scrollingElement) {
      return scrollingElement;
    } else {
      return document.documentElement;
    }
  }
  function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
    if (!el.getBoundingClientRect && el !== window)
      return;
    var elRect, top2, left, bottom, right, height, width;
    if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
      elRect = el.getBoundingClientRect();
      top2 = elRect.top;
      left = elRect.left;
      bottom = elRect.bottom;
      right = elRect.right;
      height = elRect.height;
      width = elRect.width;
    } else {
      top2 = 0;
      left = 0;
      bottom = window.innerHeight;
      right = window.innerWidth;
      height = window.innerHeight;
      width = window.innerWidth;
    }
    if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
      container = container || el.parentNode;
      if (!IE11OrLess) {
        do {
          if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) {
            var containerRect = container.getBoundingClientRect();
            top2 -= containerRect.top + parseInt(css(container, "border-top-width"));
            left -= containerRect.left + parseInt(css(container, "border-left-width"));
            bottom = top2 + elRect.height;
            right = left + elRect.width;
            break;
          }
        } while (container = container.parentNode);
      }
    }
    if (undoScale && el !== window) {
      var elMatrix = matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
      if (elMatrix) {
        top2 /= scaleY;
        left /= scaleX;
        width /= scaleX;
        height /= scaleY;
        bottom = top2 + height;
        right = left + width;
      }
    }
    return {
      top: top2,
      left,
      bottom,
      right,
      width,
      height
    };
  }
  function isScrolledPast(el, elSide, parentSide) {
    var parent = getParentAutoScrollElement(el, true), elSideVal = getRect(el)[elSide];
    while (parent) {
      var parentSideVal = getRect(parent)[parentSide], visible = void 0;
      if (parentSide === "top" || parentSide === "left") {
        visible = elSideVal >= parentSideVal;
      } else {
        visible = elSideVal <= parentSideVal;
      }
      if (!visible)
        return parent;
      if (parent === getWindowScrollingElement())
        break;
      parent = getParentAutoScrollElement(parent, false);
    }
    return false;
  }
  function getChild(el, childNum, options, includeDragEl) {
    var currentChild = 0, i2 = 0, children = el.children;
    while (i2 < children.length) {
      if (children[i2].style.display !== "none" && children[i2] !== Sortable.ghost && (includeDragEl || children[i2] !== Sortable.dragged) && closest(children[i2], options.draggable, el, false)) {
        if (currentChild === childNum) {
          return children[i2];
        }
        currentChild++;
      }
      i2++;
    }
    return null;
  }
  function lastChild(el, selector) {
    var last = el.lastElementChild;
    while (last && (last === Sortable.ghost || css(last, "display") === "none" || selector && !matches(last, selector))) {
      last = last.previousElementSibling;
    }
    return last || null;
  }
  function index(el, selector) {
    var index2 = 0;
    if (!el || !el.parentNode) {
      return -1;
    }
    while (el = el.previousElementSibling) {
      if (el.nodeName.toUpperCase() !== "TEMPLATE" && el !== Sortable.clone && (!selector || matches(el, selector))) {
        index2++;
      }
    }
    return index2;
  }
  function getRelativeScrollOffset(el) {
    var offsetLeft = 0, offsetTop = 0, winScroller = getWindowScrollingElement();
    if (el) {
      do {
        var elMatrix = matrix(el), scaleX = elMatrix.a, scaleY = elMatrix.d;
        offsetLeft += el.scrollLeft * scaleX;
        offsetTop += el.scrollTop * scaleY;
      } while (el !== winScroller && (el = el.parentNode));
    }
    return [offsetLeft, offsetTop];
  }
  function indexOfObject(arr, obj) {
    for (var i2 in arr) {
      if (!arr.hasOwnProperty(i2))
        continue;
      for (var key in obj) {
        if (obj.hasOwnProperty(key) && obj[key] === arr[i2][key])
          return Number(i2);
      }
    }
    return -1;
  }
  function getParentAutoScrollElement(el, includeSelf) {
    if (!el || !el.getBoundingClientRect)
      return getWindowScrollingElement();
    var elem = el;
    var gotSelf = false;
    do {
      if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
        var elemCSS = css(elem);
        if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == "auto" || elemCSS.overflowX == "scroll") || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == "auto" || elemCSS.overflowY == "scroll")) {
          if (!elem.getBoundingClientRect || elem === document.body)
            return getWindowScrollingElement();
          if (gotSelf || includeSelf)
            return elem;
          gotSelf = true;
        }
      }
    } while (elem = elem.parentNode);
    return getWindowScrollingElement();
  }
  function extend(dst, src) {
    if (dst && src) {
      for (var key in src) {
        if (src.hasOwnProperty(key)) {
          dst[key] = src[key];
        }
      }
    }
    return dst;
  }
  function isRectEqual(rect1, rect2) {
    return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
  }
  var _throttleTimeout;
  function throttle(callback, ms) {
    return function() {
      if (!_throttleTimeout) {
        var args = arguments, _this = this;
        if (args.length === 1) {
          callback.call(_this, args[0]);
        } else {
          callback.apply(_this, args);
        }
        _throttleTimeout = setTimeout(function() {
          _throttleTimeout = void 0;
        }, ms);
      }
    };
  }
  function cancelThrottle() {
    clearTimeout(_throttleTimeout);
    _throttleTimeout = void 0;
  }
  function scrollBy(el, x, y) {
    el.scrollLeft += x;
    el.scrollTop += y;
  }
  function clone(el) {
    var Polymer = window.Polymer;
    var $ = window.jQuery || window.Zepto;
    if (Polymer && Polymer.dom) {
      return Polymer.dom(el).cloneNode(true);
    } else if ($) {
      return $(el).clone(true)[0];
    } else {
      return el.cloneNode(true);
    }
  }
  var expando = "Sortable" + new Date().getTime();
  function AnimationStateManager() {
    var animationStates = [], animationCallbackId;
    return {
      captureAnimationState: function captureAnimationState() {
        animationStates = [];
        if (!this.options.animation)
          return;
        var children = [].slice.call(this.el.children);
        children.forEach(function(child) {
          if (css(child, "display") === "none" || child === Sortable.ghost)
            return;
          animationStates.push({
            target: child,
            rect: getRect(child)
          });
          var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
          if (child.thisAnimationDuration) {
            var childMatrix = matrix(child, true);
            if (childMatrix) {
              fromRect.top -= childMatrix.f;
              fromRect.left -= childMatrix.e;
            }
          }
          child.fromRect = fromRect;
        });
      },
      addAnimationState: function addAnimationState(state) {
        animationStates.push(state);
      },
      removeAnimationState: function removeAnimationState(target) {
        animationStates.splice(indexOfObject(animationStates, {
          target
        }), 1);
      },
      animateAll: function animateAll(callback) {
        var _this = this;
        if (!this.options.animation) {
          clearTimeout(animationCallbackId);
          if (typeof callback === "function")
            callback();
          return;
        }
        var animating = false, animationTime = 0;
        animationStates.forEach(function(state) {
          var time = 0, target = state.target, fromRect = target.fromRect, toRect = getRect(target), prevFromRect = target.prevFromRect, prevToRect = target.prevToRect, animatingRect = state.rect, targetMatrix = matrix(target, true);
          if (targetMatrix) {
            toRect.top -= targetMatrix.f;
            toRect.left -= targetMatrix.e;
          }
          target.toRect = toRect;
          if (target.thisAnimationDuration) {
            if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) && (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
              time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
            }
          }
          if (!isRectEqual(toRect, fromRect)) {
            target.prevFromRect = fromRect;
            target.prevToRect = toRect;
            if (!time) {
              time = _this.options.animation;
            }
            _this.animate(target, animatingRect, toRect, time);
          }
          if (time) {
            animating = true;
            animationTime = Math.max(animationTime, time);
            clearTimeout(target.animationResetTimer);
            target.animationResetTimer = setTimeout(function() {
              target.animationTime = 0;
              target.prevFromRect = null;
              target.fromRect = null;
              target.prevToRect = null;
              target.thisAnimationDuration = null;
            }, time);
            target.thisAnimationDuration = time;
          }
        });
        clearTimeout(animationCallbackId);
        if (!animating) {
          if (typeof callback === "function")
            callback();
        } else {
          animationCallbackId = setTimeout(function() {
            if (typeof callback === "function")
              callback();
          }, animationTime);
        }
        animationStates = [];
      },
      animate: function animate(target, currentRect, toRect, duration) {
        if (duration) {
          css(target, "transition", "");
          css(target, "transform", "");
          var elMatrix = matrix(this.el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d, translateX = (currentRect.left - toRect.left) / (scaleX || 1), translateY = (currentRect.top - toRect.top) / (scaleY || 1);
          target.animatingX = !!translateX;
          target.animatingY = !!translateY;
          css(target, "transform", "translate3d(" + translateX + "px," + translateY + "px,0)");
          this.forRepaintDummy = repaint(target);
          css(target, "transition", "transform " + duration + "ms" + (this.options.easing ? " " + this.options.easing : ""));
          css(target, "transform", "translate3d(0,0,0)");
          typeof target.animated === "number" && clearTimeout(target.animated);
          target.animated = setTimeout(function() {
            css(target, "transition", "");
            css(target, "transform", "");
            target.animated = false;
            target.animatingX = false;
            target.animatingY = false;
          }, duration);
        }
      }
    };
  }
  function repaint(target) {
    return target.offsetWidth;
  }
  function calculateRealTime(animatingRect, fromRect, toRect, options) {
    return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
  }
  var plugins = [];
  var defaults = {
    initializeByDefault: true
  };
  var PluginManager = {
    mount: function mount(plugin) {
      for (var option in defaults) {
        if (defaults.hasOwnProperty(option) && !(option in plugin)) {
          plugin[option] = defaults[option];
        }
      }
      plugins.forEach(function(p) {
        if (p.pluginName === plugin.pluginName) {
          throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
        }
      });
      plugins.push(plugin);
    },
    pluginEvent: function pluginEvent2(eventName, sortable, evt) {
      var _this = this;
      this.eventCanceled = false;
      evt.cancel = function() {
        _this.eventCanceled = true;
      };
      var eventNameGlobal = eventName + "Global";
      plugins.forEach(function(plugin) {
        if (!sortable[plugin.pluginName])
          return;
        if (sortable[plugin.pluginName][eventNameGlobal]) {
          sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
            sortable
          }, evt));
        }
        if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
          sortable[plugin.pluginName][eventName](_objectSpread2({
            sortable
          }, evt));
        }
      });
    },
    initializePlugins: function initializePlugins(sortable, el, defaults2, options) {
      plugins.forEach(function(plugin) {
        var pluginName = plugin.pluginName;
        if (!sortable.options[pluginName] && !plugin.initializeByDefault)
          return;
        var initialized = new plugin(sortable, el, sortable.options);
        initialized.sortable = sortable;
        initialized.options = sortable.options;
        sortable[pluginName] = initialized;
        _extends(defaults2, initialized.defaults);
      });
      for (var option in sortable.options) {
        if (!sortable.options.hasOwnProperty(option))
          continue;
        var modified = this.modifyOption(sortable, option, sortable.options[option]);
        if (typeof modified !== "undefined") {
          sortable.options[option] = modified;
        }
      }
    },
    getEventProperties: function getEventProperties(name2, sortable) {
      var eventProperties = {};
      plugins.forEach(function(plugin) {
        if (typeof plugin.eventProperties !== "function")
          return;
        _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name2));
      });
      return eventProperties;
    },
    modifyOption: function modifyOption(sortable, name2, value2) {
      var modifiedValue;
      plugins.forEach(function(plugin) {
        if (!sortable[plugin.pluginName])
          return;
        if (plugin.optionListeners && typeof plugin.optionListeners[name2] === "function") {
          modifiedValue = plugin.optionListeners[name2].call(sortable[plugin.pluginName], value2);
        }
      });
      return modifiedValue;
    }
  };
  function dispatchEvent(_ref) {
    var sortable = _ref.sortable, rootEl2 = _ref.rootEl, name2 = _ref.name, targetEl = _ref.targetEl, cloneEl2 = _ref.cloneEl, toEl = _ref.toEl, fromEl = _ref.fromEl, oldIndex2 = _ref.oldIndex, newIndex2 = _ref.newIndex, oldDraggableIndex2 = _ref.oldDraggableIndex, newDraggableIndex2 = _ref.newDraggableIndex, originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, extraEventProperties = _ref.extraEventProperties;
    sortable = sortable || rootEl2 && rootEl2[expando];
    if (!sortable)
      return;
    var evt, options = sortable.options, onName = "on" + name2.charAt(0).toUpperCase() + name2.substr(1);
    if (window.CustomEvent && !IE11OrLess && !Edge) {
      evt = new CustomEvent(name2, {
        bubbles: true,
        cancelable: true
      });
    } else {
      evt = document.createEvent("Event");
      evt.initEvent(name2, true, true);
    }
    evt.to = toEl || rootEl2;
    evt.from = fromEl || rootEl2;
    evt.item = targetEl || rootEl2;
    evt.clone = cloneEl2;
    evt.oldIndex = oldIndex2;
    evt.newIndex = newIndex2;
    evt.oldDraggableIndex = oldDraggableIndex2;
    evt.newDraggableIndex = newDraggableIndex2;
    evt.originalEvent = originalEvent;
    evt.pullMode = putSortable2 ? putSortable2.lastPutMode : void 0;
    var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name2, sortable));
    for (var option in allEventProperties) {
      evt[option] = allEventProperties[option];
    }
    if (rootEl2) {
      rootEl2.dispatchEvent(evt);
    }
    if (options[onName]) {
      options[onName].call(sortable, evt);
    }
  }
  var _excluded = ["evt"];
  var pluginEvent = function pluginEvent2(eventName, sortable) {
    var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, originalEvent = _ref.evt, data2 = _objectWithoutProperties(_ref, _excluded);
    PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
      dragEl,
      parentEl,
      ghostEl,
      rootEl,
      nextEl,
      lastDownEl,
      cloneEl,
      cloneHidden,
      dragStarted: moved,
      putSortable,
      activeSortable: Sortable.active,
      originalEvent,
      oldIndex,
      oldDraggableIndex,
      newIndex,
      newDraggableIndex,
      hideGhostForTarget: _hideGhostForTarget,
      unhideGhostForTarget: _unhideGhostForTarget,
      cloneNowHidden: function cloneNowHidden() {
        cloneHidden = true;
      },
      cloneNowShown: function cloneNowShown() {
        cloneHidden = false;
      },
      dispatchSortableEvent: function dispatchSortableEvent(name2) {
        _dispatchEvent({
          sortable,
          name: name2,
          originalEvent
        });
      }
    }, data2));
  };
  function _dispatchEvent(info) {
    dispatchEvent(_objectSpread2({
      putSortable,
      cloneEl,
      targetEl: dragEl,
      rootEl,
      oldIndex,
      oldDraggableIndex,
      newIndex,
      newDraggableIndex
    }, info));
  }
  var dragEl, parentEl, ghostEl, rootEl, nextEl, lastDownEl, cloneEl, cloneHidden, oldIndex, newIndex, oldDraggableIndex, newDraggableIndex, activeGroup, putSortable, awaitingDragStarted = false, ignoreNextClick = false, sortables = [], tapEvt, touchEvt, lastDx, lastDy, tapDistanceLeft, tapDistanceTop, moved, lastTarget, lastDirection, pastFirstInvertThresh = false, isCircumstantialInvert = false, targetMoveDistance, ghostRelativeParent, ghostRelativeParentInitialScroll = [], _silent = false, savedInputChecked = [];
  var documentExists = typeof document !== "undefined", PositionGhostAbsolutely = IOS, CSSFloatProperty = Edge || IE11OrLess ? "cssFloat" : "float", supportDraggable = documentExists && !ChromeForAndroid && !IOS && "draggable" in document.createElement("div"), supportCssPointerEvents = function() {
    if (!documentExists)
      return;
    if (IE11OrLess) {
      return false;
    }
    var el = document.createElement("x");
    el.style.cssText = "pointer-events:auto";
    return el.style.pointerEvents === "auto";
  }(), _detectDirection = function _detectDirection2(el, options) {
    var elCSS = css(el), elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth), child1 = getChild(el, 0, options), child2 = getChild(el, 1, options), firstChildCSS = child1 && css(child1), secondChildCSS = child2 && css(child2), firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width, secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
    if (elCSS.display === "flex") {
      return elCSS.flexDirection === "column" || elCSS.flexDirection === "column-reverse" ? "vertical" : "horizontal";
    }
    if (elCSS.display === "grid") {
      return elCSS.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
    }
    if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== "none") {
      var touchingSideChild2 = firstChildCSS["float"] === "left" ? "left" : "right";
      return child2 && (secondChildCSS.clear === "both" || secondChildCSS.clear === touchingSideChild2) ? "vertical" : "horizontal";
    }
    return child1 && (firstChildCSS.display === "block" || firstChildCSS.display === "flex" || firstChildCSS.display === "table" || firstChildCSS.display === "grid" || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === "none" || child2 && elCSS[CSSFloatProperty] === "none" && firstChildWidth + secondChildWidth > elWidth) ? "vertical" : "horizontal";
  }, _dragElInRowColumn = function _dragElInRowColumn2(dragRect, targetRect, vertical) {
    var dragElS1Opp = vertical ? dragRect.left : dragRect.top, dragElS2Opp = vertical ? dragRect.right : dragRect.bottom, dragElOppLength = vertical ? dragRect.width : dragRect.height, targetS1Opp = vertical ? targetRect.left : targetRect.top, targetS2Opp = vertical ? targetRect.right : targetRect.bottom, targetOppLength = vertical ? targetRect.width : targetRect.height;
    return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
  }, _detectNearestEmptySortable = function _detectNearestEmptySortable2(x, y) {
    var ret;
    sortables.some(function(sortable) {
      var threshold = sortable[expando].options.emptyInsertThreshold;
      if (!threshold || lastChild(sortable))
        return;
      var rect = getRect(sortable), insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold, insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
      if (insideHorizontally && insideVertically) {
        return ret = sortable;
      }
    });
    return ret;
  }, _prepareGroup = function _prepareGroup2(options) {
    function toFn(value2, pull) {
      return function(to, from, dragEl2, evt) {
        var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
        if (value2 == null && (pull || sameGroup)) {
          return true;
        } else if (value2 == null || value2 === false) {
          return false;
        } else if (pull && value2 === "clone") {
          return value2;
        } else if (typeof value2 === "function") {
          return toFn(value2(to, from, dragEl2, evt), pull)(to, from, dragEl2, evt);
        } else {
          var otherGroup = (pull ? to : from).options.group.name;
          return value2 === true || typeof value2 === "string" && value2 === otherGroup || value2.join && value2.indexOf(otherGroup) > -1;
        }
      };
    }
    var group = {};
    var originalGroup = options.group;
    if (!originalGroup || _typeof(originalGroup) != "object") {
      originalGroup = {
        name: originalGroup
      };
    }
    group.name = originalGroup.name;
    group.checkPull = toFn(originalGroup.pull, true);
    group.checkPut = toFn(originalGroup.put);
    group.revertClone = originalGroup.revertClone;
    options.group = group;
  }, _hideGhostForTarget = function _hideGhostForTarget2() {
    if (!supportCssPointerEvents && ghostEl) {
      css(ghostEl, "display", "none");
    }
  }, _unhideGhostForTarget = function _unhideGhostForTarget2() {
    if (!supportCssPointerEvents && ghostEl) {
      css(ghostEl, "display", "");
    }
  };
  if (documentExists) {
    document.addEventListener("click", function(evt) {
      if (ignoreNextClick) {
        evt.preventDefault();
        evt.stopPropagation && evt.stopPropagation();
        evt.stopImmediatePropagation && evt.stopImmediatePropagation();
        ignoreNextClick = false;
        return false;
      }
    }, true);
  }
  var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent2(evt) {
    if (dragEl) {
      evt = evt.touches ? evt.touches[0] : evt;
      var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
      if (nearest) {
        var event = {};
        for (var i2 in evt) {
          if (evt.hasOwnProperty(i2)) {
            event[i2] = evt[i2];
          }
        }
        event.target = event.rootEl = nearest;
        event.preventDefault = void 0;
        event.stopPropagation = void 0;
        nearest[expando]._onDragOver(event);
      }
    }
  };
  var _checkOutsideTargetEl = function _checkOutsideTargetEl2(evt) {
    if (dragEl) {
      dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
    }
  };
  function Sortable(el, options) {
    if (!(el && el.nodeType && el.nodeType === 1)) {
      throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
    }
    this.el = el;
    this.options = options = _extends({}, options);
    el[expando] = this;
    var defaults2 = {
      group: null,
      sort: true,
      disabled: false,
      store: null,
      handle: null,
      draggable: /^[uo]l$/i.test(el.nodeName) ? ">li" : ">*",
      swapThreshold: 1,
      invertSwap: false,
      invertedSwapThreshold: null,
      removeCloneOnHide: true,
      direction: function direction() {
        return _detectDirection(el, this.options);
      },
      ghostClass: "sortable-ghost",
      chosenClass: "sortable-chosen",
      dragClass: "sortable-drag",
      ignore: "a, img",
      filter: null,
      preventOnFilter: true,
      animation: 0,
      easing: null,
      setData: function setData(dataTransfer, dragEl2) {
        dataTransfer.setData("Text", dragEl2.textContent);
      },
      dropBubble: false,
      dragoverBubble: false,
      dataIdAttr: "data-id",
      delay: 0,
      delayOnTouchOnly: false,
      touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
      forceFallback: false,
      fallbackClass: "sortable-fallback",
      fallbackOnBody: false,
      fallbackTolerance: 0,
      fallbackOffset: {
        x: 0,
        y: 0
      },
      supportPointer: Sortable.supportPointer !== false && "PointerEvent" in window && !Safari,
      emptyInsertThreshold: 5
    };
    PluginManager.initializePlugins(this, el, defaults2);
    for (var name2 in defaults2) {
      !(name2 in options) && (options[name2] = defaults2[name2]);
    }
    _prepareGroup(options);
    for (var fn in this) {
      if (fn.charAt(0) === "_" && typeof this[fn] === "function") {
        this[fn] = this[fn].bind(this);
      }
    }
    this.nativeDraggable = options.forceFallback ? false : supportDraggable;
    if (this.nativeDraggable) {
      this.options.touchStartThreshold = 1;
    }
    if (options.supportPointer) {
      on(el, "pointerdown", this._onTapStart);
    } else {
      on(el, "mousedown", this._onTapStart);
      on(el, "touchstart", this._onTapStart);
    }
    if (this.nativeDraggable) {
      on(el, "dragover", this);
      on(el, "dragenter", this);
    }
    sortables.push(this.el);
    options.store && options.store.get && this.sort(options.store.get(this) || []);
    _extends(this, AnimationStateManager());
  }
  Sortable.prototype = {
    constructor: Sortable,
    _isOutsideThisEl: function _isOutsideThisEl(target) {
      if (!this.el.contains(target) && target !== this.el) {
        lastTarget = null;
      }
    },
    _getDirection: function _getDirection(evt, target) {
      return typeof this.options.direction === "function" ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
    },
    _onTapStart: function _onTapStart(evt) {
      if (!evt.cancelable)
        return;
      var _this = this, el = this.el, options = this.options, preventOnFilter = options.preventOnFilter, type = evt.type, touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === "touch" && evt, target = (touch || evt).target, originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target, filter = options.filter;
      _saveInputCheckedState(el);
      if (dragEl) {
        return;
      }
      if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
        return;
      }
      if (originalTarget.isContentEditable) {
        return;
      }
      if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === "SELECT") {
        return;
      }
      target = closest(target, options.draggable, el, false);
      if (target && target.animated) {
        return;
      }
      if (lastDownEl === target) {
        return;
      }
      oldIndex = index(target);
      oldDraggableIndex = index(target, options.draggable);
      if (typeof filter === "function") {
        if (filter.call(this, evt, target, this)) {
          _dispatchEvent({
            sortable: _this,
            rootEl: originalTarget,
            name: "filter",
            targetEl: target,
            toEl: el,
            fromEl: el
          });
          pluginEvent("filter", _this, {
            evt
          });
          preventOnFilter && evt.cancelable && evt.preventDefault();
          return;
        }
      } else if (filter) {
        filter = filter.split(",").some(function(criteria) {
          criteria = closest(originalTarget, criteria.trim(), el, false);
          if (criteria) {
            _dispatchEvent({
              sortable: _this,
              rootEl: criteria,
              name: "filter",
              targetEl: target,
              fromEl: el,
              toEl: el
            });
            pluginEvent("filter", _this, {
              evt
            });
            return true;
          }
        });
        if (filter) {
          preventOnFilter && evt.cancelable && evt.preventDefault();
          return;
        }
      }
      if (options.handle && !closest(originalTarget, options.handle, el, false)) {
        return;
      }
      this._prepareDragStart(evt, touch, target);
    },
    _prepareDragStart: function _prepareDragStart(evt, touch, target) {
      var _this = this, el = _this.el, options = _this.options, ownerDocument = el.ownerDocument, dragStartFn;
      if (target && !dragEl && target.parentNode === el) {
        var dragRect = getRect(target);
        rootEl = el;
        dragEl = target;
        parentEl = dragEl.parentNode;
        nextEl = dragEl.nextSibling;
        lastDownEl = target;
        activeGroup = options.group;
        Sortable.dragged = dragEl;
        tapEvt = {
          target: dragEl,
          clientX: (touch || evt).clientX,
          clientY: (touch || evt).clientY
        };
        tapDistanceLeft = tapEvt.clientX - dragRect.left;
        tapDistanceTop = tapEvt.clientY - dragRect.top;
        this._lastX = (touch || evt).clientX;
        this._lastY = (touch || evt).clientY;
        dragEl.style["will-change"] = "all";
        dragStartFn = function dragStartFn2() {
          pluginEvent("delayEnded", _this, {
            evt
          });
          if (Sortable.eventCanceled) {
            _this._onDrop();
            return;
          }
          _this._disableDelayedDragEvents();
          if (!FireFox && _this.nativeDraggable) {
            dragEl.draggable = true;
          }
          _this._triggerDragStart(evt, touch);
          _dispatchEvent({
            sortable: _this,
            name: "choose",
            originalEvent: evt
          });
          toggleClass(dragEl, options.chosenClass, true);
        };
        options.ignore.split(",").forEach(function(criteria) {
          find(dragEl, criteria.trim(), _disableDraggable);
        });
        on(ownerDocument, "dragover", nearestEmptyInsertDetectEvent);
        on(ownerDocument, "mousemove", nearestEmptyInsertDetectEvent);
        on(ownerDocument, "touchmove", nearestEmptyInsertDetectEvent);
        on(ownerDocument, "mouseup", _this._onDrop);
        on(ownerDocument, "touchend", _this._onDrop);
        on(ownerDocument, "touchcancel", _this._onDrop);
        if (FireFox && this.nativeDraggable) {
          this.options.touchStartThreshold = 4;
          dragEl.draggable = true;
        }
        pluginEvent("delayStart", this, {
          evt
        });
        if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
          if (Sortable.eventCanceled) {
            this._onDrop();
            return;
          }
          on(ownerDocument, "mouseup", _this._disableDelayedDrag);
          on(ownerDocument, "touchend", _this._disableDelayedDrag);
          on(ownerDocument, "touchcancel", _this._disableDelayedDrag);
          on(ownerDocument, "mousemove", _this._delayedDragTouchMoveHandler);
          on(ownerDocument, "touchmove", _this._delayedDragTouchMoveHandler);
          options.supportPointer && on(ownerDocument, "pointermove", _this._delayedDragTouchMoveHandler);
          _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
        } else {
          dragStartFn();
        }
      }
    },
    _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler(e) {
      var touch = e.touches ? e.touches[0] : e;
      if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
        this._disableDelayedDrag();
      }
    },
    _disableDelayedDrag: function _disableDelayedDrag() {
      dragEl && _disableDraggable(dragEl);
      clearTimeout(this._dragStartTimer);
      this._disableDelayedDragEvents();
    },
    _disableDelayedDragEvents: function _disableDelayedDragEvents() {
      var ownerDocument = this.el.ownerDocument;
      off(ownerDocument, "mouseup", this._disableDelayedDrag);
      off(ownerDocument, "touchend", this._disableDelayedDrag);
      off(ownerDocument, "touchcancel", this._disableDelayedDrag);
      off(ownerDocument, "mousemove", this._delayedDragTouchMoveHandler);
      off(ownerDocument, "touchmove", this._delayedDragTouchMoveHandler);
      off(ownerDocument, "pointermove", this._delayedDragTouchMoveHandler);
    },
    _triggerDragStart: function _triggerDragStart(evt, touch) {
      touch = touch || evt.pointerType == "touch" && evt;
      if (!this.nativeDraggable || touch) {
        if (this.options.supportPointer) {
          on(document, "pointermove", this._onTouchMove);
        } else if (touch) {
          on(document, "touchmove", this._onTouchMove);
        } else {
          on(document, "mousemove", this._onTouchMove);
        }
      } else {
        on(dragEl, "dragend", this);
        on(rootEl, "dragstart", this._onDragStart);
      }
      try {
        if (document.selection) {
          _nextTick(function() {
            document.selection.empty();
          });
        } else {
          window.getSelection().removeAllRanges();
        }
      } catch (err) {
      }
    },
    _dragStarted: function _dragStarted(fallback, evt) {
      awaitingDragStarted = false;
      if (rootEl && dragEl) {
        pluginEvent("dragStarted", this, {
          evt
        });
        if (this.nativeDraggable) {
          on(document, "dragover", _checkOutsideTargetEl);
        }
        var options = this.options;
        !fallback && toggleClass(dragEl, options.dragClass, false);
        toggleClass(dragEl, options.ghostClass, true);
        Sortable.active = this;
        fallback && this._appendGhost();
        _dispatchEvent({
          sortable: this,
          name: "start",
          originalEvent: evt
        });
      } else {
        this._nulling();
      }
    },
    _emulateDragOver: function _emulateDragOver() {
      if (touchEvt) {
        this._lastX = touchEvt.clientX;
        this._lastY = touchEvt.clientY;
        _hideGhostForTarget();
        var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
        var parent = target;
        while (target && target.shadowRoot) {
          target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
          if (target === parent)
            break;
          parent = target;
        }
        dragEl.parentNode[expando]._isOutsideThisEl(target);
        if (parent) {
          do {
            if (parent[expando]) {
              var inserted = void 0;
              inserted = parent[expando]._onDragOver({
                clientX: touchEvt.clientX,
                clientY: touchEvt.clientY,
                target,
                rootEl: parent
              });
              if (inserted && !this.options.dragoverBubble) {
                break;
              }
            }
            target = parent;
          } while (parent = parent.parentNode);
        }
        _unhideGhostForTarget();
      }
    },
    _onTouchMove: function _onTouchMove(evt) {
      if (tapEvt) {
        var options = this.options, fallbackTolerance = options.fallbackTolerance, fallbackOffset = options.fallbackOffset, touch = evt.touches ? evt.touches[0] : evt, ghostMatrix = ghostEl && matrix(ghostEl, true), scaleX = ghostEl && ghostMatrix && ghostMatrix.a, scaleY = ghostEl && ghostMatrix && ghostMatrix.d, relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent), dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1), dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
        if (!Sortable.active && !awaitingDragStarted) {
          if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
            return;
          }
          this._onDragStart(evt, true);
        }
        if (ghostEl) {
          if (ghostMatrix) {
            ghostMatrix.e += dx - (lastDx || 0);
            ghostMatrix.f += dy - (lastDy || 0);
          } else {
            ghostMatrix = {
              a: 1,
              b: 0,
              c: 0,
              d: 1,
              e: dx,
              f: dy
            };
          }
          var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
          css(ghostEl, "webkitTransform", cssMatrix);
          css(ghostEl, "mozTransform", cssMatrix);
          css(ghostEl, "msTransform", cssMatrix);
          css(ghostEl, "transform", cssMatrix);
          lastDx = dx;
          lastDy = dy;
          touchEvt = touch;
        }
        evt.cancelable && evt.preventDefault();
      }
    },
    _appendGhost: function _appendGhost() {
      if (!ghostEl) {
        var container = this.options.fallbackOnBody ? document.body : rootEl, rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container), options = this.options;
        if (PositionGhostAbsolutely) {
          ghostRelativeParent = container;
          while (css(ghostRelativeParent, "position") === "static" && css(ghostRelativeParent, "transform") === "none" && ghostRelativeParent !== document) {
            ghostRelativeParent = ghostRelativeParent.parentNode;
          }
          if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
            if (ghostRelativeParent === document)
              ghostRelativeParent = getWindowScrollingElement();
            rect.top += ghostRelativeParent.scrollTop;
            rect.left += ghostRelativeParent.scrollLeft;
          } else {
            ghostRelativeParent = getWindowScrollingElement();
          }
          ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
        }
        ghostEl = dragEl.cloneNode(true);
        toggleClass(ghostEl, options.ghostClass, false);
        toggleClass(ghostEl, options.fallbackClass, true);
        toggleClass(ghostEl, options.dragClass, true);
        css(ghostEl, "transition", "");
        css(ghostEl, "transform", "");
        css(ghostEl, "box-sizing", "border-box");
        css(ghostEl, "margin", 0);
        css(ghostEl, "top", rect.top);
        css(ghostEl, "left", rect.left);
        css(ghostEl, "width", rect.width);
        css(ghostEl, "height", rect.height);
        css(ghostEl, "opacity", "0.8");
        css(ghostEl, "position", PositionGhostAbsolutely ? "absolute" : "fixed");
        css(ghostEl, "zIndex", "100000");
        css(ghostEl, "pointerEvents", "none");
        Sortable.ghost = ghostEl;
        container.appendChild(ghostEl);
        css(ghostEl, "transform-origin", tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + "% " + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + "%");
      }
    },
    _onDragStart: function _onDragStart(evt, fallback) {
      var _this = this;
      var dataTransfer = evt.dataTransfer;
      var options = _this.options;
      pluginEvent("dragStart", this, {
        evt
      });
      if (Sortable.eventCanceled) {
        this._onDrop();
        return;
      }
      pluginEvent("setupClone", this);
      if (!Sortable.eventCanceled) {
        cloneEl = clone(dragEl);
        cloneEl.draggable = false;
        cloneEl.style["will-change"] = "";
        this._hideClone();
        toggleClass(cloneEl, this.options.chosenClass, false);
        Sortable.clone = cloneEl;
      }
      _this.cloneId = _nextTick(function() {
        pluginEvent("clone", _this);
        if (Sortable.eventCanceled)
          return;
        if (!_this.options.removeCloneOnHide) {
          rootEl.insertBefore(cloneEl, dragEl);
        }
        _this._hideClone();
        _dispatchEvent({
          sortable: _this,
          name: "clone"
        });
      });
      !fallback && toggleClass(dragEl, options.dragClass, true);
      if (fallback) {
        ignoreNextClick = true;
        _this._loopId = setInterval(_this._emulateDragOver, 50);
      } else {
        off(document, "mouseup", _this._onDrop);
        off(document, "touchend", _this._onDrop);
        off(document, "touchcancel", _this._onDrop);
        if (dataTransfer) {
          dataTransfer.effectAllowed = "move";
          options.setData && options.setData.call(_this, dataTransfer, dragEl);
        }
        on(document, "drop", _this);
        css(dragEl, "transform", "translateZ(0)");
      }
      awaitingDragStarted = true;
      _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
      on(document, "selectstart", _this);
      moved = true;
      if (Safari) {
        css(document.body, "user-select", "none");
      }
    },
    _onDragOver: function _onDragOver(evt) {
      var el = this.el, target = evt.target, dragRect, targetRect, revert, options = this.options, group = options.group, activeSortable = Sortable.active, isOwner = activeGroup === group, canSort = options.sort, fromSortable = putSortable || activeSortable, vertical, _this = this, completedFired = false;
      if (_silent)
        return;
      function dragOverEvent(name2, extra) {
        pluginEvent(name2, _this, _objectSpread2({
          evt,
          isOwner,
          axis: vertical ? "vertical" : "horizontal",
          revert,
          dragRect,
          targetRect,
          canSort,
          fromSortable,
          target,
          completed,
          onMove: function onMove(target2, after2) {
            return _onMove(rootEl, el, dragEl, dragRect, target2, getRect(target2), evt, after2);
          },
          changed
        }, extra));
      }
      function capture() {
        dragOverEvent("dragOverAnimationCapture");
        _this.captureAnimationState();
        if (_this !== fromSortable) {
          fromSortable.captureAnimationState();
        }
      }
      function completed(insertion) {
        dragOverEvent("dragOverCompleted", {
          insertion
        });
        if (insertion) {
          if (isOwner) {
            activeSortable._hideClone();
          } else {
            activeSortable._showClone(_this);
          }
          if (_this !== fromSortable) {
            toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
            toggleClass(dragEl, options.ghostClass, true);
          }
          if (putSortable !== _this && _this !== Sortable.active) {
            putSortable = _this;
          } else if (_this === Sortable.active && putSortable) {
            putSortable = null;
          }
          if (fromSortable === _this) {
            _this._ignoreWhileAnimating = target;
          }
          _this.animateAll(function() {
            dragOverEvent("dragOverAnimationComplete");
            _this._ignoreWhileAnimating = null;
          });
          if (_this !== fromSortable) {
            fromSortable.animateAll();
            fromSortable._ignoreWhileAnimating = null;
          }
        }
        if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
          lastTarget = null;
        }
        if (!options.dragoverBubble && !evt.rootEl && target !== document) {
          dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
          !insertion && nearestEmptyInsertDetectEvent(evt);
        }
        !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
        return completedFired = true;
      }
      function changed() {
        newIndex = index(dragEl);
        newDraggableIndex = index(dragEl, options.draggable);
        _dispatchEvent({
          sortable: _this,
          name: "change",
          toEl: el,
          newIndex,
          newDraggableIndex,
          originalEvent: evt
        });
      }
      if (evt.preventDefault !== void 0) {
        evt.cancelable && evt.preventDefault();
      }
      target = closest(target, options.draggable, el, true);
      dragOverEvent("dragOver");
      if (Sortable.eventCanceled)
        return completedFired;
      if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
        return completed(false);
      }
      ignoreNextClick = false;
      if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
        vertical = this._getDirection(evt, target) === "vertical";
        dragRect = getRect(dragEl);
        dragOverEvent("dragOverValid");
        if (Sortable.eventCanceled)
          return completedFired;
        if (revert) {
          parentEl = rootEl;
          capture();
          this._hideClone();
          dragOverEvent("revert");
          if (!Sortable.eventCanceled) {
            if (nextEl) {
              rootEl.insertBefore(dragEl, nextEl);
            } else {
              rootEl.appendChild(dragEl);
            }
          }
          return completed(true);
        }
        var elLastChild = lastChild(el, options.draggable);
        if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
          if (elLastChild === dragEl) {
            return completed(false);
          }
          if (elLastChild && el === evt.target) {
            target = elLastChild;
          }
          if (target) {
            targetRect = getRect(target);
          }
          if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
            capture();
            el.appendChild(dragEl);
            parentEl = el;
            changed();
            return completed(true);
          }
        } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
          var firstChild = getChild(el, 0, options, true);
          if (firstChild === dragEl) {
            return completed(false);
          }
          target = firstChild;
          targetRect = getRect(target);
          if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
            capture();
            el.insertBefore(dragEl, firstChild);
            parentEl = el;
            changed();
            return completed(true);
          }
        } else if (target.parentNode === el) {
          targetRect = getRect(target);
          var direction = 0, targetBeforeFirstSwap, differentLevel = dragEl.parentNode !== el, differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical), side1 = vertical ? "top" : "left", scrolledPastTop = isScrolledPast(target, "top", "top") || isScrolledPast(dragEl, "top", "top"), scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
          if (lastTarget !== target) {
            targetBeforeFirstSwap = targetRect[side1];
            pastFirstInvertThresh = false;
            isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
          }
          direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
          var sibling;
          if (direction !== 0) {
            var dragIndex = index(dragEl);
            do {
              dragIndex -= direction;
              sibling = parentEl.children[dragIndex];
            } while (sibling && (css(sibling, "display") === "none" || sibling === ghostEl));
          }
          if (direction === 0 || sibling === target) {
            return completed(false);
          }
          lastTarget = target;
          lastDirection = direction;
          var nextSibling = target.nextElementSibling, after = false;
          after = direction === 1;
          var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
          if (moveVector !== false) {
            if (moveVector === 1 || moveVector === -1) {
              after = moveVector === 1;
            }
            _silent = true;
            setTimeout(_unsilent, 30);
            capture();
            if (after && !nextSibling) {
              el.appendChild(dragEl);
            } else {
              target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
            }
            if (scrolledPastTop) {
              scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
            }
            parentEl = dragEl.parentNode;
            if (targetBeforeFirstSwap !== void 0 && !isCircumstantialInvert) {
              targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
            }
            changed();
            return completed(true);
          }
        }
        if (el.contains(dragEl)) {
          return completed(false);
        }
      }
      return false;
    },
    _ignoreWhileAnimating: null,
    _offMoveEvents: function _offMoveEvents() {
      off(document, "mousemove", this._onTouchMove);
      off(document, "touchmove", this._onTouchMove);
      off(document, "pointermove", this._onTouchMove);
      off(document, "dragover", nearestEmptyInsertDetectEvent);
      off(document, "mousemove", nearestEmptyInsertDetectEvent);
      off(document, "touchmove", nearestEmptyInsertDetectEvent);
    },
    _offUpEvents: function _offUpEvents() {
      var ownerDocument = this.el.ownerDocument;
      off(ownerDocument, "mouseup", this._onDrop);
      off(ownerDocument, "touchend", this._onDrop);
      off(ownerDocument, "pointerup", this._onDrop);
      off(ownerDocument, "touchcancel", this._onDrop);
      off(document, "selectstart", this);
    },
    _onDrop: function _onDrop(evt) {
      var el = this.el, options = this.options;
      newIndex = index(dragEl);
      newDraggableIndex = index(dragEl, options.draggable);
      pluginEvent("drop", this, {
        evt
      });
      parentEl = dragEl && dragEl.parentNode;
      newIndex = index(dragEl);
      newDraggableIndex = index(dragEl, options.draggable);
      if (Sortable.eventCanceled) {
        this._nulling();
        return;
      }
      awaitingDragStarted = false;
      isCircumstantialInvert = false;
      pastFirstInvertThresh = false;
      clearInterval(this._loopId);
      clearTimeout(this._dragStartTimer);
      _cancelNextTick(this.cloneId);
      _cancelNextTick(this._dragStartId);
      if (this.nativeDraggable) {
        off(document, "drop", this);
        off(el, "dragstart", this._onDragStart);
      }
      this._offMoveEvents();
      this._offUpEvents();
      if (Safari) {
        css(document.body, "user-select", "");
      }
      css(dragEl, "transform", "");
      if (evt) {
        if (moved) {
          evt.cancelable && evt.preventDefault();
          !options.dropBubble && evt.stopPropagation();
        }
        ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
        if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== "clone") {
          cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
        }
        if (dragEl) {
          if (this.nativeDraggable) {
            off(dragEl, "dragend", this);
          }
          _disableDraggable(dragEl);
          dragEl.style["will-change"] = "";
          if (moved && !awaitingDragStarted) {
            toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
          }
          toggleClass(dragEl, this.options.chosenClass, false);
          _dispatchEvent({
            sortable: this,
            name: "unchoose",
            toEl: parentEl,
            newIndex: null,
            newDraggableIndex: null,
            originalEvent: evt
          });
          if (rootEl !== parentEl) {
            if (newIndex >= 0) {
              _dispatchEvent({
                rootEl: parentEl,
                name: "add",
                toEl: parentEl,
                fromEl: rootEl,
                originalEvent: evt
              });
              _dispatchEvent({
                sortable: this,
                name: "remove",
                toEl: parentEl,
                originalEvent: evt
              });
              _dispatchEvent({
                rootEl: parentEl,
                name: "sort",
                toEl: parentEl,
                fromEl: rootEl,
                originalEvent: evt
              });
              _dispatchEvent({
                sortable: this,
                name: "sort",
                toEl: parentEl,
                originalEvent: evt
              });
            }
            putSortable && putSortable.save();
          } else {
            if (newIndex !== oldIndex) {
              if (newIndex >= 0) {
                _dispatchEvent({
                  sortable: this,
                  name: "update",
                  toEl: parentEl,
                  originalEvent: evt
                });
                _dispatchEvent({
                  sortable: this,
                  name: "sort",
                  toEl: parentEl,
                  originalEvent: evt
                });
              }
            }
          }
          if (Sortable.active) {
            if (newIndex == null || newIndex === -1) {
              newIndex = oldIndex;
              newDraggableIndex = oldDraggableIndex;
            }
            _dispatchEvent({
              sortable: this,
              name: "end",
              toEl: parentEl,
              originalEvent: evt
            });
            this.save();
          }
        }
      }
      this._nulling();
    },
    _nulling: function _nulling() {
      pluginEvent("nulling", this);
      rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
      savedInputChecked.forEach(function(el) {
        el.checked = true;
      });
      savedInputChecked.length = lastDx = lastDy = 0;
    },
    handleEvent: function handleEvent(evt) {
      switch (evt.type) {
        case "drop":
        case "dragend":
          this._onDrop(evt);
          break;
        case "dragenter":
        case "dragover":
          if (dragEl) {
            this._onDragOver(evt);
            _globalDragOver(evt);
          }
          break;
        case "selectstart":
          evt.preventDefault();
          break;
      }
    },
    toArray: function toArray() {
      var order = [], el, children = this.el.children, i2 = 0, n = children.length, options = this.options;
      for (; i2 < n; i2++) {
        el = children[i2];
        if (closest(el, options.draggable, this.el, false)) {
          order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
        }
      }
      return order;
    },
    sort: function sort(order, useAnimation) {
      var items = {}, rootEl2 = this.el;
      this.toArray().forEach(function(id2, i2) {
        var el = rootEl2.children[i2];
        if (closest(el, this.options.draggable, rootEl2, false)) {
          items[id2] = el;
        }
      }, this);
      useAnimation && this.captureAnimationState();
      order.forEach(function(id2) {
        if (items[id2]) {
          rootEl2.removeChild(items[id2]);
          rootEl2.appendChild(items[id2]);
        }
      });
      useAnimation && this.animateAll();
    },
    save: function save() {
      var store = this.options.store;
      store && store.set && store.set(this);
    },
    closest: function closest$1(el, selector) {
      return closest(el, selector || this.options.draggable, this.el, false);
    },
    option: function option(name2, value2) {
      var options = this.options;
      if (value2 === void 0) {
        return options[name2];
      } else {
        var modifiedValue = PluginManager.modifyOption(this, name2, value2);
        if (typeof modifiedValue !== "undefined") {
          options[name2] = modifiedValue;
        } else {
          options[name2] = value2;
        }
        if (name2 === "group") {
          _prepareGroup(options);
        }
      }
    },
    destroy: function destroy() {
      pluginEvent("destroy", this);
      var el = this.el;
      el[expando] = null;
      off(el, "mousedown", this._onTapStart);
      off(el, "touchstart", this._onTapStart);
      off(el, "pointerdown", this._onTapStart);
      if (this.nativeDraggable) {
        off(el, "dragover", this);
        off(el, "dragenter", this);
      }
      Array.prototype.forEach.call(el.querySelectorAll("[draggable]"), function(el2) {
        el2.removeAttribute("draggable");
      });
      this._onDrop();
      this._disableDelayedDragEvents();
      sortables.splice(sortables.indexOf(this.el), 1);
      this.el = el = null;
    },
    _hideClone: function _hideClone() {
      if (!cloneHidden) {
        pluginEvent("hideClone", this);
        if (Sortable.eventCanceled)
          return;
        css(cloneEl, "display", "none");
        if (this.options.removeCloneOnHide && cloneEl.parentNode) {
          cloneEl.parentNode.removeChild(cloneEl);
        }
        cloneHidden = true;
      }
    },
    _showClone: function _showClone(putSortable2) {
      if (putSortable2.lastPutMode !== "clone") {
        this._hideClone();
        return;
      }
      if (cloneHidden) {
        pluginEvent("showClone", this);
        if (Sortable.eventCanceled)
          return;
        if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
          rootEl.insertBefore(cloneEl, dragEl);
        } else if (nextEl) {
          rootEl.insertBefore(cloneEl, nextEl);
        } else {
          rootEl.appendChild(cloneEl);
        }
        if (this.options.group.revertClone) {
          this.animate(dragEl, cloneEl);
        }
        css(cloneEl, "display", "");
        cloneHidden = false;
      }
    }
  };
  function _globalDragOver(evt) {
    if (evt.dataTransfer) {
      evt.dataTransfer.dropEffect = "move";
    }
    evt.cancelable && evt.preventDefault();
  }
  function _onMove(fromEl, toEl, dragEl2, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
    var evt, sortable = fromEl[expando], onMoveFn = sortable.options.onMove, retVal;
    if (window.CustomEvent && !IE11OrLess && !Edge) {
      evt = new CustomEvent("move", {
        bubbles: true,
        cancelable: true
      });
    } else {
      evt = document.createEvent("Event");
      evt.initEvent("move", true, true);
    }
    evt.to = toEl;
    evt.from = fromEl;
    evt.dragged = dragEl2;
    evt.draggedRect = dragRect;
    evt.related = targetEl || toEl;
    evt.relatedRect = targetRect || getRect(toEl);
    evt.willInsertAfter = willInsertAfter;
    evt.originalEvent = originalEvent;
    fromEl.dispatchEvent(evt);
    if (onMoveFn) {
      retVal = onMoveFn.call(sortable, evt, originalEvent);
    }
    return retVal;
  }
  function _disableDraggable(el) {
    el.draggable = false;
  }
  function _unsilent() {
    _silent = false;
  }
  function _ghostIsFirst(evt, vertical, sortable) {
    var rect = getRect(getChild(sortable.el, 0, sortable.options, true));
    var spacer = 10;
    return vertical ? evt.clientX < rect.left - spacer || evt.clientY < rect.top && evt.clientX < rect.right : evt.clientY < rect.top - spacer || evt.clientY < rect.bottom && evt.clientX < rect.left;
  }
  function _ghostIsLast(evt, vertical, sortable) {
    var rect = getRect(lastChild(sortable.el, sortable.options.draggable));
    var spacer = 10;
    return vertical ? evt.clientX > rect.right + spacer || evt.clientX <= rect.right && evt.clientY > rect.bottom && evt.clientX >= rect.left : evt.clientX > rect.right && evt.clientY > rect.top || evt.clientX <= rect.right && evt.clientY > rect.bottom + spacer;
  }
  function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
    var mouseOnAxis = vertical ? evt.clientY : evt.clientX, targetLength = vertical ? targetRect.height : targetRect.width, targetS1 = vertical ? targetRect.top : targetRect.left, targetS2 = vertical ? targetRect.bottom : targetRect.right, invert = false;
    if (!invertSwap) {
      if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
        if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
          pastFirstInvertThresh = true;
        }
        if (!pastFirstInvertThresh) {
          if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance : mouseOnAxis > targetS2 - targetMoveDistance) {
            return -lastDirection;
          }
        } else {
          invert = true;
        }
      } else {
        if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
          return _getInsertDirection(target);
        }
      }
    }
    invert = invert || invertSwap;
    if (invert) {
      if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
        return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
      }
    }
    return 0;
  }
  function _getInsertDirection(target) {
    if (index(dragEl) < index(target)) {
      return 1;
    } else {
      return -1;
    }
  }
  function _generateId(el) {
    var str = el.tagName + el.className + el.src + el.href + el.textContent, i2 = str.length, sum = 0;
    while (i2--) {
      sum += str.charCodeAt(i2);
    }
    return sum.toString(36);
  }
  function _saveInputCheckedState(root) {
    savedInputChecked.length = 0;
    var inputs = root.getElementsByTagName("input");
    var idx = inputs.length;
    while (idx--) {
      var el = inputs[idx];
      el.checked && savedInputChecked.push(el);
    }
  }
  function _nextTick(fn) {
    return setTimeout(fn, 0);
  }
  function _cancelNextTick(id2) {
    return clearTimeout(id2);
  }
  if (documentExists) {
    on(document, "touchmove", function(evt) {
      if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
        evt.preventDefault();
      }
    });
  }
  Sortable.utils = {
    on,
    off,
    css,
    find,
    is: function is(el, selector) {
      return !!closest(el, selector, el, false);
    },
    extend,
    throttle,
    closest,
    toggleClass,
    clone,
    index,
    nextTick: _nextTick,
    cancelNextTick: _cancelNextTick,
    detectDirection: _detectDirection,
    getChild
  };
  Sortable.get = function(element) {
    return element[expando];
  };
  Sortable.mount = function() {
    for (var _len = arguments.length, plugins2 = new Array(_len), _key = 0; _key < _len; _key++) {
      plugins2[_key] = arguments[_key];
    }
    if (plugins2[0].constructor === Array)
      plugins2 = plugins2[0];
    plugins2.forEach(function(plugin) {
      if (!plugin.prototype || !plugin.prototype.constructor) {
        throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
      }
      if (plugin.utils)
        Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
      PluginManager.mount(plugin);
    });
  };
  Sortable.create = function(el, options) {
    return new Sortable(el, options);
  };
  Sortable.version = version;
  var autoScrolls = [], scrollEl, scrollRootEl, scrolling = false, lastAutoScrollX, lastAutoScrollY, touchEvt$1, pointerElemChangedInterval;
  function AutoScrollPlugin() {
    function AutoScroll() {
      this.defaults = {
        scroll: true,
        forceAutoScrollFallback: false,
        scrollSensitivity: 30,
        scrollSpeed: 10,
        bubbleScroll: true
      };
      for (var fn in this) {
        if (fn.charAt(0) === "_" && typeof this[fn] === "function") {
          this[fn] = this[fn].bind(this);
        }
      }
    }
    AutoScroll.prototype = {
      dragStarted: function dragStarted(_ref) {
        var originalEvent = _ref.originalEvent;
        if (this.sortable.nativeDraggable) {
          on(document, "dragover", this._handleAutoScroll);
        } else {
          if (this.options.supportPointer) {
            on(document, "pointermove", this._handleFallbackAutoScroll);
          } else if (originalEvent.touches) {
            on(document, "touchmove", this._handleFallbackAutoScroll);
          } else {
            on(document, "mousemove", this._handleFallbackAutoScroll);
          }
        }
      },
      dragOverCompleted: function dragOverCompleted(_ref2) {
        var originalEvent = _ref2.originalEvent;
        if (!this.options.dragOverBubble && !originalEvent.rootEl) {
          this._handleAutoScroll(originalEvent);
        }
      },
      drop: function drop2() {
        if (this.sortable.nativeDraggable) {
          off(document, "dragover", this._handleAutoScroll);
        } else {
          off(document, "pointermove", this._handleFallbackAutoScroll);
          off(document, "touchmove", this._handleFallbackAutoScroll);
          off(document, "mousemove", this._handleFallbackAutoScroll);
        }
        clearPointerElemChangedInterval();
        clearAutoScrolls();
        cancelThrottle();
      },
      nulling: function nulling() {
        touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
        autoScrolls.length = 0;
      },
      _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
        this._handleAutoScroll(evt, true);
      },
      _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
        var _this = this;
        var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, elem = document.elementFromPoint(x, y);
        touchEvt$1 = evt;
        if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
          autoScroll(evt, this.options, elem, fallback);
          var ogElemScroller = getParentAutoScrollElement(elem, true);
          if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
            pointerElemChangedInterval && clearPointerElemChangedInterval();
            pointerElemChangedInterval = setInterval(function() {
              var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
              if (newElem !== ogElemScroller) {
                ogElemScroller = newElem;
                clearAutoScrolls();
              }
              autoScroll(evt, _this.options, newElem, fallback);
            }, 10);
            lastAutoScrollX = x;
            lastAutoScrollY = y;
          }
        } else {
          if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
            clearAutoScrolls();
            return;
          }
          autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
        }
      }
    };
    return _extends(AutoScroll, {
      pluginName: "scroll",
      initializeByDefault: true
    });
  }
  function clearAutoScrolls() {
    autoScrolls.forEach(function(autoScroll2) {
      clearInterval(autoScroll2.pid);
    });
    autoScrolls = [];
  }
  function clearPointerElemChangedInterval() {
    clearInterval(pointerElemChangedInterval);
  }
  var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
    if (!options.scroll)
      return;
    var x = (evt.touches ? evt.touches[0] : evt).clientX, y = (evt.touches ? evt.touches[0] : evt).clientY, sens = options.scrollSensitivity, speed = options.scrollSpeed, winScroller = getWindowScrollingElement();
    var scrollThisInstance = false, scrollCustomFn;
    if (scrollRootEl !== rootEl2) {
      scrollRootEl = rootEl2;
      clearAutoScrolls();
      scrollEl = options.scroll;
      scrollCustomFn = options.scrollFn;
      if (scrollEl === true) {
        scrollEl = getParentAutoScrollElement(rootEl2, true);
      }
    }
    var layersOut = 0;
    var currentParent = scrollEl;
    do {
      var el = currentParent, rect = getRect(el), top2 = rect.top, bottom = rect.bottom, left = rect.left, right = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
      if (el === winScroller) {
        canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible");
        canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible");
      } else {
        canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll");
        canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll");
      }
      var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
      var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top2 - y) <= sens && !!scrollPosY);
      if (!autoScrolls[layersOut]) {
        for (var i2 = 0; i2 <= layersOut; i2++) {
          if (!autoScrolls[i2]) {
            autoScrolls[i2] = {};
          }
        }
      }
      if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
        autoScrolls[layersOut].el = el;
        autoScrolls[layersOut].vx = vx;
        autoScrolls[layersOut].vy = vy;
        clearInterval(autoScrolls[layersOut].pid);
        if (vx != 0 || vy != 0) {
          scrollThisInstance = true;
          autoScrolls[layersOut].pid = setInterval(function() {
            if (isFallback && this.layer === 0) {
              Sortable.active._onTouchMove(touchEvt$1);
            }
            var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
            var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
            if (typeof scrollCustomFn === "function") {
              if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== "continue") {
                return;
              }
            }
            scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
          }.bind({
            layer: layersOut
          }), 24);
        }
      }
      layersOut++;
    } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
    scrolling = scrollThisInstance;
  }, 30);
  var drop = function drop2(_ref) {
    var originalEvent = _ref.originalEvent, putSortable2 = _ref.putSortable, dragEl2 = _ref.dragEl, activeSortable = _ref.activeSortable, dispatchSortableEvent = _ref.dispatchSortableEvent, hideGhostForTarget = _ref.hideGhostForTarget, unhideGhostForTarget = _ref.unhideGhostForTarget;
    if (!originalEvent)
      return;
    var toSortable = putSortable2 || activeSortable;
    hideGhostForTarget();
    var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
    var target = document.elementFromPoint(touch.clientX, touch.clientY);
    unhideGhostForTarget();
    if (toSortable && !toSortable.el.contains(target)) {
      dispatchSortableEvent("spill");
      this.onSpill({
        dragEl: dragEl2,
        putSortable: putSortable2
      });
    }
  };
  function Revert() {
  }
  Revert.prototype = {
    startIndex: null,
    dragStart: function dragStart(_ref2) {
      var oldDraggableIndex2 = _ref2.oldDraggableIndex;
      this.startIndex = oldDraggableIndex2;
    },
    onSpill: function onSpill(_ref3) {
      var dragEl2 = _ref3.dragEl, putSortable2 = _ref3.putSortable;
      this.sortable.captureAnimationState();
      if (putSortable2) {
        putSortable2.captureAnimationState();
      }
      var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
      if (nextSibling) {
        this.sortable.el.insertBefore(dragEl2, nextSibling);
      } else {
        this.sortable.el.appendChild(dragEl2);
      }
      this.sortable.animateAll();
      if (putSortable2) {
        putSortable2.animateAll();
      }
    },
    drop
  };
  _extends(Revert, {
    pluginName: "revertOnSpill"
  });
  function Remove() {
  }
  Remove.prototype = {
    onSpill: function onSpill(_ref4) {
      var dragEl2 = _ref4.dragEl, putSortable2 = _ref4.putSortable;
      var parentSortable = putSortable2 || this.sortable;
      parentSortable.captureAnimationState();
      dragEl2.parentNode && dragEl2.parentNode.removeChild(dragEl2);
      parentSortable.animateAll();
    },
    drop
  };
  _extends(Remove, {
    pluginName: "removeOnSpill"
  });
  Sortable.mount(new AutoScrollPlugin());
  Sortable.mount(Remove, Revert);
  var dataTableCustomClassEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  var dataTableCustomClassEditor_vue_vue_type_style_index_1_lang = "";
  const _sfc_main$2I = {
    name: "data-table-customClass-editor",
    componentName: "PropertyEditor",
    mixins: [i18n$1],
    components: {
      CodeEditor
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        dialogVisible: false,
        dataDialogVisible: false,
        showButtonsEditDialog: false,
        oldButtonName: "",
        cssClassList: [],
        tableDataOptions: [],
        dataSetList: [],
        widgetSizes: [
          { label: "default", value: "" },
          { label: "large", value: "large" },
          { label: "small", value: "small" }
        ],
        alignOptions: [
          {
            value: "left",
            label: "left"
          },
          {
            value: "center",
            label: "center"
          },
          {
            value: "right",
            label: "right"
          }
        ],
        fieldTypeOptions: [
          {
            value: "text",
            label: "Text"
          },
          {
            value: "number",
            label: "Number"
          },
          {
            value: "date",
            label: "Date"
          }
        ],
        op: [{
          label: "Date Format",
          options: [
            { value: "d1", label: "yyyy-MM-dd" },
            { value: "d2", label: "yyyy/MM/dd" },
            { value: "d3", label: "yyyy\u5E74MM\u6708dd\u65E5" },
            { value: "d4", label: "yyyy-MM-dd HH:mm:ss" },
            { value: "d5", label: "yyyy-MM-dd hh:mm:ss" }
          ]
        }, {
          label: "Number Format",
          options: [
            { value: "n1", label: "###,###,###,##0.######" },
            { value: "n2", label: "###,###,###,##0.00####" },
            { value: "n3", label: "###,###,###,##0.000000" },
            { value: "n4", label: "###,###,###,##0.000" },
            { value: "n5", label: "###,###,###,##0.00" },
            { value: "n6", label: "###,###,###,##0" },
            { value: "n7", label: "###,##0.00##%" }
          ]
        }],
        showRenderDialogFlag: false,
        renderJson: "",
        currentTableColumn: null,
        tableColumnRows: null,
        nameRules: [
          { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
        ]
      };
    },
    computed: {
      dataSourceList() {
        if (!this.designer.formConfig || !this.designer.formConfig.dataSources) {
          return [];
        } else {
          return this.designer.formConfig.dataSources;
        }
      }
    },
    watch: {
      selectedWidget: {
        handler(val, oldVal) {
          if (!val) {
            return;
          }
          this.loadDataSet(val.options.dsName);
        },
        immediate: true
      }
    },
    created() {
      this.cssClassList = deepClone(this.designer.getCssClassList());
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.cssClassList = cssClassList;
      });
    },
    mounted() {
    },
    methods: {
      treeColumnsToArray() {
        const resultArray = [];
        const expandFn = (treeData, level) => {
          treeData.map((col) => {
            let newCol = deepClone(col);
            newCol.nodeLevel = level;
            resultArray.push(newCol);
            if (col.children) {
              expandFn(col.children, level + 1);
            }
          });
        };
        expandFn(this.optionModel.tableColumns, 1);
        return resultArray;
      },
      getParentArrayOfTableColumn(columns, columnId) {
        let foundFlag = false;
        columns.forEach((tc) => {
          if (tc.columnId === columnId) {
            foundFlag = true;
          }
        });
        if (foundFlag) {
          return columns;
        }
        let resultArray = [];
        columns.forEach((tc) => {
          if (tc.children) {
            let tmpArray = this.getParentArrayOfTableColumn(tc.children, columnId);
            if (tmpArray.length > 0) {
              resultArray = tmpArray;
            }
          }
        });
        return resultArray;
      },
      dragSort() {
        const el = this.$refs.singleTable.$el.querySelectorAll(".el-table__body-wrapper .el-table__body > tbody")[0];
        this.sortable = Sortable.create(el, {
          handle: ".column-drag-handler",
          ghostClass: "sortable-ghost",
          setData: function(dataTransfer) {
            dataTransfer.setData("Text", "");
          },
          onStart: (e) => {
            this.tableColumnRows = this.treeColumnsToArray();
          },
          onMove: ({ dragged, related }) => {
            const oldCol = this.tableColumnRows[dragged.rowIndex];
            const newCol = this.tableColumnRows[related.rowIndex];
            if (oldCol.nodeLevel !== newCol.nodeLevel) {
              this.$message.warning(this.i18nt("designer.setting.onlyDragBetweenSiblingNodes"));
              return false;
            }
          },
          onEnd: (e) => {
            const oldCol = this.tableColumnRows[e.oldIndex];
            const newCol = this.tableColumnRows[e.newIndex];
            if (oldCol.nodeLevel !== newCol.nodeLevel || e.oldIndex === e.newIndex) {
              return;
            }
            const oldColumnId = oldCol.columnId;
            const newColumnId = newCol.columnId;
            let tcArray = this.getParentArrayOfTableColumn(this.optionModel.tableColumns, oldColumnId);
            let oldIndexOfTcArray = tcArray.findIndex((tc) => tc.columnId === oldColumnId);
            let newIndexOfTcArray = tcArray.findIndex((tc) => tc.columnId === newColumnId);
            if (oldIndexOfTcArray > newIndexOfTcArray) {
              tcArray.splice(newIndexOfTcArray, 0, deepClone(tcArray[oldIndexOfTcArray]));
              tcArray.splice(oldIndexOfTcArray + 1, 1);
            } else {
              tcArray.splice(newIndexOfTcArray + 1, 0, deepClone(tcArray[oldIndexOfTcArray]));
              tcArray.splice(oldIndexOfTcArray, 1);
            }
          }
        });
      },
      openTableDataEdit() {
        this.dataDialogVisible = true;
        this.tableDataOptions = JSON.stringify(this.optionModel.tableData, null, "  ");
      },
      saveTableData() {
        try {
          this.optionModel.tableData = JSON.parse(this.tableDataOptions);
          this.dataDialogVisible = false;
        } catch (ex) {
          this.$message.error(this.i18nt("designer.hint.invalidOptionsData") + ex.message);
        }
      },
      openSetting() {
        this.dialogVisible = true;
        this.$nextTick(() => {
          this.dragSort();
          this.expandAllTableColumns(this.optionModel.tableColumns);
        });
      },
      getHeaderSpace(row) {
        let headerLevel = this.getHeaderLevel(this.optionModel.tableColumns, row.columnId, 1);
        return "|" + "-".repeat(headerLevel > 6 ? 0 : 6 - headerLevel);
      },
      getHeaderTitle(row) {
        let headerLevel = this.getHeaderLevel(this.optionModel.tableColumns, row.columnId, 1);
        return this.i18ntp("designer.setting.getHeaderLevelTitle", headerLevel);
      },
      getHeaderLevel(columns, columnId, currentLevel) {
        let foundFlag = false;
        columns.forEach((tc) => {
          if (tc.columnId === columnId) {
            foundFlag = true;
          }
        });
        if (foundFlag) {
          return currentLevel;
        }
        let resultLevel = -1;
        columns.forEach((tc) => {
          if (tc.children) {
            let childLevel = this.getHeaderLevel(tc.children, columnId, currentLevel + 1);
            if (childLevel > -1) {
              resultLevel = childLevel;
            }
          }
        });
        return resultLevel;
      },
      expandAllTableColumns(columns) {
        columns.forEach((tc) => {
          this.$refs.singleTable.toggleRowExpansion(tc, true);
          if (tc.children) {
            this.expandAllTableColumns(tc.children);
          }
        });
      },
      colSubmit() {
        this.dialogVisible = false;
      },
      addCol(index2) {
        let newRow = { columnId: new Date().getTime(), show: false };
        this.optionModel.tableColumns.splice(index2, 0, newRow);
        this.designer.emitHistoryChange();
      },
      handleAddColCommand(command2, index2, row) {
        if (command2 === "column") {
          let newColumn = { columnId: new Date().getTime(), show: false };
          this.insertTableColumnById(this.optionModel.tableColumns, row.columnId, newColumn, false);
          this.designer.emitHistoryChange();
        } else if (command2 === "sub-column") {
          let newColumn = { columnId: new Date().getTime(), show: false };
          this.insertTableColumnById(this.optionModel.tableColumns, row.columnId, newColumn, true);
          this.designer.emitHistoryChange();
        } else if (command2 === "header") {
          let newHeader = { columnId: new Date().getTime(), prop: "~", headerFlag: true, label: "header", align: "center", children: [] };
          this.insertTableColumnById(this.optionModel.tableColumns, row.columnId, newHeader, false);
          this.designer.emitHistoryChange();
        } else if (command2 === "sub-header") {
          let newHeader = { columnId: new Date().getTime(), prop: "~", headerFlag: true, label: "header", align: "center", children: [] };
          this.insertTableColumnById(this.optionModel.tableColumns, row.columnId, newHeader, true);
          this.designer.emitHistoryChange();
        }
        this.$nextTick(() => {
          this.$refs.singleTable.toggleRowExpansion(row, true);
        });
      },
      insertTableColumnById(columns, columnId, newColumn, childrenFlag) {
        let foundIdx = -1;
        columns.forEach((tc, idx) => {
          if (tc.columnId === columnId) {
            foundIdx = idx;
          }
          if (tc.children) {
            this.insertTableColumnById(tc.children, columnId, newColumn, childrenFlag);
          }
        });
        if (foundIdx > -1) {
          if (childrenFlag) {
            columns[foundIdx].children.push(newColumn);
          } else {
            columns.splice(foundIdx + 1, 0, newColumn);
          }
        }
      },
      disableDropdownItem(row, columnType) {
        if (row.children) {
          return false;
        } else {
          return true;
        }
      },
      handleDelete(index2, row) {
        if (this.optionModel.tableColumns.length === 1) {
          this.$message.warning(this.i18nt("designer.setting.onlyOneColumnCannotBeDeleted"));
          return false;
        }
        this.deleteTableColumnById(this.optionModel.tableColumns, row.columnId);
        this.designer.emitHistoryChange();
      },
      deleteTableColumnById(columns, columnId) {
        let foundIdx = -1;
        columns.forEach((tc, idx) => {
          if (tc.columnId === columnId) {
            foundIdx = idx;
          }
          if (tc.children) {
            this.deleteTableColumnById(tc.children, columnId);
          }
        });
        if (foundIdx > -1) {
          columns.splice(foundIdx, 1);
        }
      },
      showRenderDialog(tableColumn) {
        this.currentTableColumn = tableColumn;
        this.renderJson = tableColumn.render || "";
        this.showRenderDialogFlag = true;
      },
      saveColumnRender() {
        this.currentTableColumn.render = this.renderJson;
        this.showRenderDialogFlag = false;
      },
      handleShowButtonsColumnChange(value2) {
        if (!!value2) {
          this.refreshTableLayout();
        }
      },
      onButtonNameFocus(event) {
        this.oldButtonName = event.target.value;
      },
      onButtonNameChange(newName, btnIdx) {
        let sameNameFlag = false;
        this.optionModel.operationButtons.map((tb, tbIdx) => {
          if (tb.name === newName && tbIdx !== btnIdx) {
            sameNameFlag = true;
          }
        });
        if (sameNameFlag) {
          this.$message.error(this.i18nt("designer.setting.operationButtonDuplicatedNameError"));
          this.optionModel.operationButtons[btnIdx].name = this.oldButtonName;
        }
      },
      editButtonsColumn() {
        this.showButtonsEditDialog = true;
      },
      deleteOperationButton(idx) {
        this.$confirm(this.i18nt("designer.setting.deleteOperationButtonHint"), this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          this.optionModel.operationButtons.splice(idx, 1);
        }).catch((error2) => {
        });
      },
      addOperationButton() {
        this.optionModel.operationButtons = this.optionModel.operationButtons || [];
        this.optionModel.operationButtons.push({
          name: "btn" + generateId(),
          label: "new btn",
          type: "text",
          size: "small",
          round: false,
          hidden: false,
          disabled: false
        });
      },
      refreshTableLayout() {
        const dataTableInDesign = this.designer.formWidget.getSelectedWidgetRef();
        if (!!dataTableInDesign && !!dataTableInDesign.refreshLayout) {
          this.$nextTick(() => {
            dataTableInDesign.refreshLayout();
          });
        }
      },
      loadDataSet(dsName) {
        this.dataSetList.length = 0;
        if (!dsName) {
          return;
        }
        let dsModel = getDSByName(this.designer.formConfig, dsName);
        if (!!dsModel && !!dsModel.dataSets) {
          dsModel.dataSets.forEach((dSet) => {
            this.dataSetList.push({
              name: dSet.name,
              remark: dSet.remark
            });
          });
        }
      },
      getDataSetList() {
        this.optionModel.dataSetName = "";
        this.loadDataSet(this.optionModel.dsName);
      },
      handleTDEChange(val) {
        if (!!val) {
          this.optionModel.rowKey = "id";
          this.optionModel.childrenKey = "children";
        } else {
          this.optionModel.rowKey = "";
          this.optionModel.childrenKey = "";
        }
      }
    }
  };
  const _withScopeId$2 = (n) => (require$$0$1.pushScopeId("data-v-00800654"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$o = { key: 7 };
  const _hoisted_2$b = { class: "dialog-footer" };
  const _hoisted_3$7 = { key: 8 };
  const _hoisted_4$7 = { key: 0 };
  const _hoisted_5$6 = { key: 1 };
  const _hoisted_6$6 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-option column-drag-handler" }, null, -1));
  const _hoisted_7$3 = { key: 1 };
  const _hoisted_8$3 = { class: "dialog-footer" };
  const _hoisted_9$2 = { key: 9 };
  const _hoisted_10$2 = /* @__PURE__ */ _withScopeId$2(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-handler" }, null, -1));
  const _hoisted_11$2 = { class: "dialog-footer" };
  const _hoisted_12$1 = { key: 10 };
  const _hoisted_13$1 = {
    slot: "footer",
    class: "dialog-footer"
  };
  function _sfc_render$2I(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_el_table_column = require$$0$1.resolveComponent("el-table-column");
    const _component_el_option_group = require$$0$1.resolveComponent("el-option-group");
    const _component_el_dropdown_item = require$$0$1.resolveComponent("el-dropdown-item");
    const _component_el_dropdown_menu = require$$0$1.resolveComponent("el-dropdown-menu");
    const _component_el_dropdown = require$$0$1.resolveComponent("el-dropdown");
    const _component_el_table = require$$0$1.resolveComponent("el-table");
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.tableWidth")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.tableWidth,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.tableWidth = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.tableHeight")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.tableHeight,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.tableHeight = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.customClass")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.customClass,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.optionModel.customClass = $event),
            multiple: "",
            filterable: "",
            "allow-create": "",
            "default-first-option": ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  label: item,
                  value: item
                }, null, 8, ["label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.showIndex")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.showIndex,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.optionModel.showIndex = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.showCheckBox")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.showCheckBox,
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $props.optionModel.showCheckBox = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.showPagination")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.showPagination,
            "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $props.optionModel.showPagination = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.showPagination ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.paginationAlign")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_radio_group, {
            modelValue: $props.optionModel.paginationAlign,
            "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $props.optionModel.paginationAlign = $event),
            class: "radio-group-custom"
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_radio_button, { label: "left" }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_radio_button, { label: "center" }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.centerAlign")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_radio_button, { label: "right" }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
                ]),
                _: 1
              })
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.showPagination ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 1,
        label: _ctx.i18nt("designer.setting.smallPagination")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.smallPagination,
            "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $props.optionModel.smallPagination = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.showSummary")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.showSummary,
            "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $props.optionModel.showSummary = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.stripe")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.stripe,
            "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $props.optionModel.stripe = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.rowSpacing")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input_number, {
            modelValue: $props.optionModel.rowSpacing,
            "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => $props.optionModel.rowSpacing = $event),
            "controls-position": "right",
            min: 0,
            max: 20,
            style: { "width": "100%" }
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.widgetSize")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.tableSize,
            "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $props.optionModel.tableSize = $event)
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.widgetSizes, (item) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: item.value,
                  label: item.label,
                  value: item.value
                }, null, 8, ["label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.autoColumnWidthDisabled"),
        title: _ctx.i18nt("designer.setting.autoColumnWidthDisabled")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.autoColumnWidthDisabled,
            "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $props.optionModel.autoColumnWidthDisabled = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label", "title"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.tableColEdit")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_button, {
            type: "primary",
            plain: "",
            round: "",
            onClick: $options.openSetting
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.editAction")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["label"]),
      !$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 2,
        label: _ctx.i18nt("designer.setting.tableDataEdit")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_button, {
            type: "primary",
            plain: "",
            round: "",
            onClick: $options.openTableDataEdit
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.editAction")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.dsEnabled")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.dsEnabled,
            "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => $props.optionModel.dsEnabled = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 3,
        label: _ctx.i18nt("designer.setting.dsName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dsName,
            "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $props.optionModel.dsName = $event),
            filterable: "",
            clearable: "",
            onChange: $options.getDataSetList
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.dataSourceList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.description,
                  label: item.uniqueName,
                  value: item.uniqueName
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 4,
        label: _ctx.i18nt("designer.setting.dataSetName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dataSetName,
            "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $props.optionModel.dataSetName = $event),
            filterable: "",
            clearable: ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dataSetList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.remark,
                  label: item.name,
                  value: item.name
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.treeDataEnabled")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.treeDataEnabled,
            "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $props.optionModel.treeDataEnabled = $event),
            onChange: $options.handleTDEChange
          }, null, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.rowKeyOfTreeData")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.rowKey,
            "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $props.optionModel.rowKey = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.treeDataEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 5,
        label: _ctx.i18nt("designer.setting.childrenKeyOfTreeData")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            modelValue: $props.optionModel.childrenKey,
            "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => $props.optionModel.childrenKey = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.showButtonsColumn")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.showButtonsColumn,
            "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $props.optionModel.showButtonsColumn = $event),
            onChange: $options.handleShowButtonsColumnChange
          }, null, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.showButtonsColumn ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 6,
        label: _ctx.i18nt("designer.setting.buttonsColumnEdit")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_button, {
            type: "primary",
            plain: "",
            round: "",
            onClick: $options.editButtonsColumn
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.editAction")), 1)
            ]),
            _: 1
          }, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      $data.dataDialogVisible ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$o, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.tableDataEdit"),
          modelValue: $data.dataDialogVisible,
          "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.dataDialogVisible = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true,
          width: "75%"
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_2$b, [
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                type: "primary",
                onClick: $options.saveTableData
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                onClick: _cache[21] || (_cache[21] = ($event) => $data.dataDialogVisible = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: false,
              modelValue: $data.tableDataOptions,
              "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.tableDataOptions = $event)
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.dialogVisible ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_3$7, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.tableColEdit"),
          modelValue: $data.dialogVisible,
          "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.dialogVisible = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true,
          width: "1500px"
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_8$3, [
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                onClick: $options.colSubmit
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_table, {
              data: $props.optionModel.tableColumns,
              style: { "width": "100%" },
              "cell-style": { padding: "3px 0" },
              height: "500",
              border: "",
              "row-key": "columnId",
              ref: "singleTable",
              stripe: ""
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_table_column, {
                  type: "index",
                  width: "42",
                  fixed: "left"
                }),
                require$$0$1.createVNode(_component_el_table_column, {
                  width: "160",
                  prop: "columnId"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_4$7, require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.tableDataColumn")), 1)) : (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_5$6, require$$0$1.toDisplayString($options.getHeaderSpace(scope.row)), 1))
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: "",
                  width: "30"
                }, {
                  default: require$$0$1.withCtx(() => [
                    _hoisted_6$6
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.columnName"),
                  width: "150",
                  prop: "prop",
                  "class-name": "placeholder-hide"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
                      key: 0,
                      modelValue: scope.row.prop,
                      "onUpdate:modelValue": ($event) => scope.row.prop = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])) : (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_7$3, require$$0$1.toDisplayString($options.getHeaderTitle(scope.row)), 1))
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.columnLabel"),
                  width: "150",
                  prop: "label"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    require$$0$1.createVNode(_component_el_input, {
                      modelValue: scope.row.label,
                      "onUpdate:modelValue": ($event) => scope.row.label = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.columnWidth"),
                  width: "100",
                  prop: "width"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
                      key: 0,
                      modelValue: scope.row.width,
                      "onUpdate:modelValue": ($event) => scope.row.width = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.visibleColumn"),
                  width: "70",
                  prop: "show"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_switch, {
                      key: 0,
                      modelValue: scope.row.show,
                      "onUpdate:modelValue": ($event) => scope.row.show = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.sortableColumn"),
                  width: "70",
                  prop: "sortable"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_switch, {
                      key: 0,
                      modelValue: scope.row.sortable,
                      "onUpdate:modelValue": ($event) => scope.row.sortable = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.customSortColumn"),
                  width: "90",
                  prop: "customSort"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_switch, {
                      key: 0,
                      modelValue: scope.row.customSort,
                      "onUpdate:modelValue": ($event) => scope.row.customSort = $event
                    }, null, 8, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.fixedColumn"),
                  width: "100",
                  prop: "fixed"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
                      key: 0,
                      modelValue: scope.row.fixed,
                      "onUpdate:modelValue": ($event) => scope.row.fixed = $event
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_option, {
                          key: "false",
                          value: "",
                          label: "false"
                        }),
                        require$$0$1.createVNode(_component_el_option, {
                          key: "left",
                          value: "left",
                          label: "left"
                        }),
                        require$$0$1.createVNode(_component_el_option, {
                          key: "right",
                          value: "right",
                          label: "right"
                        })
                      ]),
                      _: 2
                    }, 1032, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.alignTypeOfColumn"),
                  width: "100",
                  prop: "align"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    require$$0$1.createVNode(_component_el_select, {
                      modelValue: scope.row.align,
                      "onUpdate:modelValue": ($event) => scope.row.align = $event
                    }, {
                      default: require$$0$1.withCtx(() => [
                        (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.alignOptions, (item) => {
                          return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                            key: item.value,
                            label: item.label,
                            value: item.value
                          }, null, 8, ["label", "value"]);
                        }), 128))
                      ]),
                      _: 2
                    }, 1032, ["modelValue", "onUpdate:modelValue"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.formatOfColumn"),
                  width: "200",
                  prop: "formatS"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    !scope.row.headerFlag ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
                      key: 0,
                      modelValue: scope.row.formatS,
                      "onUpdate:modelValue": ($event) => scope.row.formatS = $event,
                      clearable: ""
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_option_group, {
                          label: _ctx.i18nt("designer.setting.customRenderGroup"),
                          key: "custom-render-group"
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_option, {
                              value: "render",
                              label: "render"
                            })
                          ]),
                          _: 1
                        }, 8, ["label"]),
                        (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.op, (group) => {
                          return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option_group, {
                            key: group.label,
                            label: group.label
                          }, {
                            default: require$$0$1.withCtx(() => [
                              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(group.options, (item) => {
                                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                                  key: item.value,
                                  label: item.label,
                                  value: item.value
                                }, null, 8, ["label", "value"]);
                              }), 128))
                            ]),
                            _: 2
                          }, 1032, ["label"]);
                        }), 128))
                      ]),
                      _: 2
                    }, 1032, ["modelValue", "onUpdate:modelValue"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.renderFunction"),
                  width: "80",
                  fixed: "right",
                  align: "center"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    require$$0$1.createVNode(_component_el_button, {
                      disabled: scope.row.formatS !== "render",
                      onClick: ($event) => $options.showRenderDialog(scope.row),
                      size: "small",
                      plain: "",
                      round: "",
                      icon: "el-icon-edit"
                    }, null, 8, ["disabled", "onClick"])
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_table_column, {
                  label: _ctx.i18nt("designer.setting.actionColumn"),
                  width: "100",
                  fixed: "right",
                  align: "center"
                }, {
                  default: require$$0$1.withCtx((scope) => [
                    require$$0$1.createVNode(_component_el_dropdown, {
                      onCommand: (command2) => $options.handleAddColCommand(command2, scope.$index, scope.row)
                    }, {
                      dropdown: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_dropdown_menu, null, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_dropdown_item, { command: "column" }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertTableDataColumn")), 1)
                              ]),
                              _: 1
                            }),
                            require$$0$1.createVNode(_component_el_dropdown_item, {
                              disabled: $options.disableDropdownItem(scope.row, "header"),
                              command: "sub-column"
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertTableSubDataColumn")), 1)
                              ]),
                              _: 2
                            }, 1032, ["disabled"]),
                            require$$0$1.createVNode(_component_el_dropdown_item, { command: "header" }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertTableHeader")), 1)
                              ]),
                              _: 1
                            }),
                            require$$0$1.createVNode(_component_el_dropdown_item, {
                              disabled: $options.disableDropdownItem(scope.row, "sub-header"),
                              command: "sub-header"
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertTableSubHeader")), 1)
                              ]),
                              _: 2
                            }, 1032, ["disabled"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_button, {
                          title: _ctx.i18nt("designer.setting.addTableColumn"),
                          size: "small",
                          circle: "",
                          icon: "el-icon-plus"
                        }, null, 8, ["title"])
                      ]),
                      _: 2
                    }, 1032, ["onCommand"]),
                    require$$0$1.createVNode(_component_el_button, {
                      title: _ctx.i18nt("designer.setting.deleteTableColumn"),
                      size: "small",
                      circle: "",
                      onClick: ($event) => $options.handleDelete(scope.$index, scope.row),
                      icon: "el-icon-minus"
                    }, null, 8, ["title", "onClick"])
                  ]),
                  _: 1
                }, 8, ["label"])
              ]),
              _: 1
            }, 8, ["data"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showButtonsEditDialog ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_9$2, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.buttonsColumnEdit"),
          modelValue: $data.showButtonsEditDialog,
          "onUpdate:modelValue": _cache[29] || (_cache[29] = ($event) => $data.showButtonsEditDialog = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true,
          width: "1120px"
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_11$2, [
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                onClick: _cache[28] || (_cache[28] = ($event) => $data.showButtonsEditDialog = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_form, {
              "label-position": "left",
              model: $props.optionModel
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_row, { gutter: 8 }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_col, { span: 11 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_form_item, {
                          prop: "buttonsColumnTitle",
                          label: _ctx.i18nt("designer.setting.buttonsColumnTitle")
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_input, {
                              modelValue: $props.optionModel.buttonsColumnTitle,
                              "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => $props.optionModel.buttonsColumnTitle = $event)
                            }, null, 8, ["modelValue"])
                          ]),
                          _: 1
                        }, 8, ["label"])
                      ]),
                      _: 1
                    }),
                    require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_form_item, {
                          prop: "buttonsColumnWidth",
                          label: _ctx.i18nt("designer.setting.buttonsColumnWidth")
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_input_number, {
                              modelValue: $props.optionModel.buttonsColumnWidth,
                              "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => $props.optionModel.buttonsColumnWidth = $event)
                            }, null, 8, ["modelValue"])
                          ]),
                          _: 1
                        }, 8, ["label"])
                      ]),
                      _: 1
                    }),
                    require$$0$1.createVNode(_component_el_col, { span: 5 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_form_item, {
                          prop: "buttonsColumnFixed",
                          label: _ctx.i18nt("designer.setting.fixedColumn")
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_select, {
                              modelValue: $props.optionModel.buttonsColumnFixed,
                              "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => $props.optionModel.buttonsColumnFixed = $event)
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_option, { value: "" }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createTextVNode("false")
                                  ]),
                                  _: 1
                                }),
                                require$$0$1.createVNode(_component_el_option, { value: "left" }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createTextVNode("left")
                                  ]),
                                  _: 1
                                }),
                                require$$0$1.createVNode(_component_el_option, { value: "right" }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createTextVNode("right")
                                  ]),
                                  _: 1
                                })
                              ]),
                              _: 1
                            }, 8, ["modelValue"])
                          ]),
                          _: 1
                        }, 8, ["label"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_row, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_col, { span: 24 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_divider, { "content-position": "left" }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.operationButtonsSetting")), 1)
                          ]),
                          _: 1
                        })
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
                  modelValue: $props.optionModel.operationButtons,
                  "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => $props.optionModel.operationButtons = $event),
                  "item-key": "id"
                }, { ghostClass: "ghost", handle: ".drag-handler" }), {
                  item: require$$0$1.withCtx(({ element: btn, index: bIdx }) => [
                    require$$0$1.createVNode(_component_el_row, {
                      gutter: 8,
                      class: "button-row"
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_col, {
                          span: 1,
                          class: "drag-sort-col"
                        }, {
                          default: require$$0$1.withCtx(() => [
                            _hoisted_10$2
                          ]),
                          _: 1
                        }),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".name",
                              label: _ctx.i18nt("designer.setting.operationButtonName"),
                              rules: $data.nameRules
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: btn.name,
                                  "onUpdate:modelValue": ($event) => btn.name = $event,
                                  onFocus: $options.onButtonNameFocus,
                                  onChange: (value2) => $options.onButtonNameChange(value2, bIdx),
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonName")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "onFocus", "onChange", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".label",
                              label: _ctx.i18nt("designer.setting.operationButtonLabel")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: btn.label,
                                  "onUpdate:modelValue": ($event) => btn.label = $event,
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonLabel")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 4 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".type",
                              label: _ctx.i18nt("designer.setting.operationButtonType")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: btn.type,
                                  "onUpdate:modelValue": ($event) => btn.type = $event,
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonType")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, { value: "" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("default")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "text" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("text")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "primary" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("primary")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "success" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("success")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "warning" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("warning")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "danger" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("danger")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "info" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("info")
                                      ]),
                                      _: 1
                                    })
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".size",
                              label: _ctx.i18nt("designer.setting.operationButtonSize")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: btn.size,
                                  "onUpdate:modelValue": ($event) => btn.size = $event,
                                  placeholder: _ctx.i18nt("designer.setting.operationButtonSize")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, { value: "large" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("large")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "default" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("default")
                                      ]),
                                      _: 1
                                    }),
                                    require$$0$1.createVNode(_component_el_option, { value: "small" }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createTextVNode("small")
                                      ]),
                                      _: 1
                                    })
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".round",
                              label: _ctx.i18nt("designer.setting.operationButtonRound")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.round,
                                  "onUpdate:modelValue": ($event) => btn.round = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".hidden",
                              label: _ctx.i18nt("designer.setting.operationButtonHidden")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.hidden,
                                  "onUpdate:modelValue": ($event) => btn.hidden = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "operationButtons." + bIdx + ".disabled",
                              label: _ctx.i18nt("designer.setting.operationButtonDisabled")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_switch, {
                                  modelValue: btn.disabled,
                                  "onUpdate:modelValue": ($event) => btn.disabled = $event
                                }, null, 8, ["modelValue", "onUpdate:modelValue"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "label"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 1 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_button, {
                              icon: "el-icon-delete",
                              plain: "",
                              circle: "",
                              onClick: ($event) => $options.deleteOperationButton(bIdx)
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      _: 2
                    }, 1024)
                  ]),
                  _: 1
                }, 16, ["modelValue"]),
                require$$0$1.createVNode(_component_el_row, { gutter: 0 }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_col, { span: 4 }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_button, {
                          type: "primary",
                          size: "default",
                          icon: "el-icon-plus",
                          plain: "",
                          round: "",
                          onClick: $options.addOperationButton
                        }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addOperationButton")), 1)
                          ]),
                          _: 1
                        }, 8, ["onClick"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["model"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showRenderDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_12$1, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.renderFunction"),
          modelValue: $data.showRenderDialogFlag,
          "onUpdate:modelValue": _cache[32] || (_cache[32] = ($event) => $data.showRenderDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: "function customRender(h, params, components) {"
            }),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "javascript",
              readonly: false,
              modelValue: $data.renderJson,
              "onUpdate:modelValue": _cache[30] || (_cache[30] = ($event) => $data.renderJson = $event),
              ref: "dsResultEditor"
            }, null, 8, ["modelValue"]),
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: "}"
            }),
            require$$0$1.createElementVNode("div", _hoisted_13$1, [
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                type: "primary",
                onClick: $options.saveColumnRender
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                size: "default",
                onClick: _cache[31] || (_cache[31] = ($event) => $data.showRenderDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var dataTableCustomClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2I, [["render", _sfc_render$2I], ["__scopeId", "data-v-00800654"]]);
  var __glob_0_64 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dataTableCustomClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2H = {
    name: "colHeight-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2H(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.gridColHeight")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            type: "number",
            modelValue: $props.optionModel.colHeight,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.colHeight = $event),
            onInput: _ctx.inputNumberHandler,
            min: "0",
            class: "hide-spin-button"
          }, null, 8, ["modelValue", "onInput"])
        ]),
        _: 1
      }, 8, ["label"])
    ]);
  }
  var colHeightEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2H, [["render", _sfc_render$2H]]);
  var __glob_0_65 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": colHeightEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var gutterEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2G = {
    name: "gutter-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    methods: {
      spanChanged(curGrid) {
        let spanSum = 0;
        curGrid.cols.forEach((colItem) => {
          spanSum += colItem.options.span;
        });
        if (spanSum > 24) {
          console.log("\u5217\u6805\u683C\u4E4B\u548C\u8D85\u51FA24");
        }
        this.designer.saveCurrentHistoryStep();
      },
      deleteCol(curGrid, colIdx) {
        this.designer.deleteColOfGrid(curGrid, colIdx);
        this.designer.emitHistoryChange();
      },
      insertCol(curGrid, colIdx) {
        this.designer.insertNewColOfGrid(curGrid, colIdx);
        this.designer.emitHistoryChange();
      },
      addNewCol(curGrid) {
        this.designer.addNewColOfGrid(curGrid);
        this.designer.emitHistoryChange();
      }
    }
  };
  const _hoisted_1$n = { class: "col-span-title" };
  function _sfc_render$2G(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_divider, { class: "custom-divider" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.columnSetting")), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      }),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.gutter")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input_number, {
            modelValue: $props.optionModel.gutter,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.gutter = $event),
            style: { "width": "100%" }
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.colsOfGrid")
      }, null, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.selectedWidget.cols, (colItem, colIdx) => {
            return require$$0$1.openBlock(), require$$0$1.createElementBlock("li", {
              key: colIdx,
              class: "col-item"
            }, [
              require$$0$1.createElementVNode("span", _hoisted_1$n, require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.colSpanTitle")) + require$$0$1.toDisplayString(colIdx + 1), 1),
              require$$0$1.createVNode(_component_el_input_number, {
                modelValue: colItem.options.span,
                "onUpdate:modelValue": ($event) => colItem.options.span = $event,
                modelModifiers: { number: true },
                min: 1,
                max: 24,
                onChange: (newValue, oldValue) => $options.spanChanged($props.selectedWidget, colItem, colIdx, newValue, oldValue),
                class: "cell-span-input"
              }, null, 8, ["modelValue", "onUpdate:modelValue", "onChange"]),
              require$$0$1.createVNode(_component_el_button, {
                circle: "",
                plain: "",
                size: "small",
                type: "danger",
                onClick: ($event) => $options.deleteCol($props.selectedWidget, colIdx),
                icon: "el-icon-minus",
                class: "col-delete-button"
              }, null, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                circle: "",
                plain: "",
                size: "small",
                type: "warning",
                onClick: ($event) => $options.insertCol($props.selectedWidget, colIdx),
                icon: "el-icon-plus"
              }, null, 8, ["onClick"])
            ]);
          }), 128)),
          require$$0$1.createElementVNode("div", null, [
            require$$0$1.createVNode(_component_el_button, {
              link: "",
              type: "primary",
              onClick: _cache[1] || (_cache[1] = ($event) => $options.addNewCol($props.selectedWidget))
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addColumn")), 1)
              ]),
              _: 1
            })
          ])
        ]),
        _: 1
      })
    ]);
  }
  var gutterEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2G, [["render", _sfc_render$2G], ["__scopeId", "data-v-86b3f21a"]]);
  var __glob_0_66 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gutterEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2F = {
    name: "grid-col-offset-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2F(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.colOffsetTitle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.offset,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.offset = $event),
          modelModifiers: { number: true },
          min: 0,
          max: 24,
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var gridColOffsetEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["render", _sfc_render$2F]]);
  var __glob_0_67 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridColOffsetEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2E = {
    name: "grid-col-pull-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2E(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.colPullTitle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.pull,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.pull = $event),
          modelModifiers: { number: true },
          min: 0,
          max: 24,
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var gridColPullEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2E, [["render", _sfc_render$2E]]);
  var __glob_0_68 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridColPullEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2D = {
    name: "grid-col-push-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2D(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.colPushTitle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.push,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.push = $event),
          modelModifiers: { number: true },
          min: 0,
          max: 24,
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var gridColPushEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2D, [["render", _sfc_render$2D]]);
  var __glob_0_69 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridColPushEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2C = {
    name: "grid-col-responsive-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2C(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.responsive")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.responsive,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.responsive = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var gridColResponsiveEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2C, [["render", _sfc_render$2C]]);
  var __glob_0_70 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridColResponsiveEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var gridColSpanEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2B = {
    name: "grid-col-span-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        marks: {
          4: "1/6",
          6: "1/4",
          8: "1/3",
          12: "1/2",
          16: "2/3",
          18: "3/4"
        }
      };
    },
    computed: {
      formConfig() {
        return this.designer.formConfig;
      }
    }
  };
  function _sfc_render$2B(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_slider = require$$0$1.resolveComponent("el-slider");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      !$props.optionModel.responsive ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.colSpanTitle")
      }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !$props.optionModel.responsive ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 1,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_slider, {
            modelValue: $props.optionModel.span,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.span = $event),
            max: 24,
            step: 2,
            "show-stops": "",
            "show-input": ""
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "PC" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 2,
        label: _ctx.i18nt("designer.setting.colSpanTitle") + "(PC)"
      }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "PC" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 3,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_slider, {
            modelValue: $props.optionModel.md,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.md = $event),
            max: 24,
            step: 2,
            "show-stops": "",
            "show-input": ""
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "Pad" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 4,
        label: _ctx.i18nt("designer.setting.colSpanTitle") + "(Pad)"
      }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "Pad" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 5,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_slider, {
            modelValue: $props.optionModel.sm,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.optionModel.sm = $event),
            max: 24,
            step: 2,
            "show-stops": "",
            "show-input": ""
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "H5" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 6,
        label: _ctx.i18nt("designer.setting.colSpanTitle") + "(H5)"
      }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.responsive && $options.formConfig.layoutType === "H5" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 7,
        "label-width": "0"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_slider, {
            modelValue: $props.optionModel.xs,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.optionModel.xs = $event),
            max: 24,
            step: 2,
            "show-stops": "",
            "show-input": ""
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      })) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var gridColSpanEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["render", _sfc_render$2B], ["__scopeId", "data-v-f2224758"]]);
  var __glob_0_71 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridColSpanEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2A = {
    name: "grid-sub-form-name-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    inject: ["getServerSubFormList", "getDesignerConfig"],
    data() {
      return {
        nameRequiredRule: [{ required: true, message: "name required" }]
      };
    },
    computed: {
      serverSubFormList() {
        return this.getServerSubFormList();
      },
      noSubFormList() {
        return !this.serverSubFormList || this.serverSubFormList.length <= 0;
      },
      widgetNameReadonly() {
        return !!this.getDesignerConfig().widgetNameReadonly;
      }
    },
    methods: {
      updateWidgetNameAndRef(newName) {
        let oldName = this.designer.selectedWidgetName;
        if (isEmptyStr(newName)) {
          this.selectedWidget.options.name = oldName;
          this.$message.info(this.i18nt("designer.hint.nameRequired"));
          return;
        }
        if (!!this.designer.formWidget) {
          let foundRef = this.designer.formWidget.getWidgetRef(newName);
          if (!!foundRef) {
            this.selectedWidget.options.name = oldName;
            this.$message.info(this.i18nt("designer.hint.duplicateName") + newName);
            return;
          }
          let widgetInDesign = this.designer.formWidget.getWidgetRef(oldName);
          if (!!widgetInDesign && !!widgetInDesign.registerToRefList) {
            widgetInDesign.registerToRefList(oldName);
            let newLabel = this.getLabelByFieldName(newName);
            this.designer.updateSelectedWidgetNameAndLabel(this.selectedWidget, newName, newLabel);
          }
        }
      },
      getLabelByFieldName(fieldName) {
        for (let i2 = 0; i2 < this.serverSubFormList.length; i2++) {
          if (this.serverSubFormList[i2].name === fieldName) {
            return this.serverSubFormList[i2].label;
          }
        }
        return null;
      }
    }
  };
  function _sfc_render$2A(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      prop: "name",
      rules: $data.nameRequiredRule
    }, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.uniqueName")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.editNameHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        $options.noSubFormList ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
          key: 0,
          type: "text",
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.name = $event),
          readonly: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef
        }, null, 8, ["modelValue", "readonly", "onChange"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
          key: 1,
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.name = $event),
          "allow-create": "",
          filterable: "",
          disabled: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef,
          title: _ctx.i18nt("designer.setting.editNameHelp")
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.serverSubFormList, (sf, sfIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: sfIdx,
                label: sf.label,
                value: sf.name
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "onChange", "title"]))
      ]),
      _: 1
    }, 8, ["rules"]);
  }
  var gridSubFormNameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2A, [["render", _sfc_render$2A]]);
  var __glob_0_72 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridSubFormNameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2z = {
    name: "objectName-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        oldObjName: "",
        objectNameRequiredRule: [{ required: true, objectName: "name required" }]
      };
    },
    methods: {
      handleObjectNameFocus(event) {
        this.oldObjName = this.selectedWidget.options.objectName;
      },
      checkObjectName(objectName) {
        if (isEmptyStr(objectName)) {
          this.selectedWidget.options.objectName = this.oldObjName;
          this.$message.info(this.i18nt("designer.hint.objectNameRequired"));
          return;
        }
        let newObjName = objectName.trim();
        newObjName = trimEx(newObjName, ".");
        this.selectedWidget.options.objectName = newObjName;
      }
    }
  };
  function _sfc_render$2z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      prop: "objectName",
      rules: $data.objectNameRequiredRule
    }, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.objectName")) + " ", 1),
        require$$0$1.createVNode(_component_el_tooltip, {
          effect: "light",
          content: _ctx.i18nt("designer.setting.objectNameHelp")
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
          ]),
          _: 1
        }, 8, ["content"])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.objectName,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.objectName = $event),
          onFocus: $options.handleObjectNameFocus,
          onChange: $options.checkObjectName
        }, null, 8, ["modelValue", "onFocus", "onChange"])
      ]),
      _: 1
    }, 8, ["rules"]);
  }
  var objectNameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2z, [["render", _sfc_render$2z]]);
  var __glob_0_73 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": objectNameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2y = {
    name: "showBlankRow-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showBlankRow")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showBlankRow,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showBlankRow = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showBlankRowEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2y, [["render", _sfc_render$2y]]);
  var __glob_0_74 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showBlankRowEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2x = {
    name: "showRowNumber-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2x(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showRowNumber")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showRowNumber,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showRowNumber = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showRowNumberEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["render", _sfc_render$2x]]);
  var __glob_0_75 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showRowNumberEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var subFormLabelAlignEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2w = {
    name: "sub-form-labelAlign-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2w(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.labelAlign")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.labelAlign,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.labelAlign = $event),
          class: "radio-group-custom"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-left-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-center-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.centerAlign")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "label-right-align" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var subFormLabelAlignEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2w, [["render", _sfc_render$2w], ["__scopeId", "data-v-7c6da3d6"]]);
  var __glob_0_76 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": subFormLabelAlignEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2v = {
    name: "sub-form-name-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    inject: ["getServerSubFormList", "getDesignerConfig"],
    data() {
      return {
        nameRequiredRule: [{ required: true, message: "name required" }]
      };
    },
    computed: {
      serverSubFormList() {
        return this.getServerSubFormList();
      },
      noSubFormList() {
        return !this.serverSubFormList || this.serverSubFormList.length <= 0;
      },
      widgetNameReadonly() {
        return !!this.getDesignerConfig().widgetNameReadonly;
      }
    },
    methods: {
      updateWidgetNameAndRef(newName) {
        let oldName = this.designer.selectedWidgetName;
        if (isEmptyStr(newName)) {
          this.selectedWidget.options.name = oldName;
          this.$message.info(this.i18nt("designer.hint.nameRequired"));
          return;
        }
        if (!!this.designer.formWidget) {
          let foundRef = this.designer.formWidget.getWidgetRef(newName);
          if (!!foundRef) {
            this.selectedWidget.options.name = oldName;
            this.$message.info(this.i18nt("designer.hint.duplicateName") + newName);
            return;
          }
          let widgetInDesign = this.designer.formWidget.getWidgetRef(oldName);
          if (!!widgetInDesign && !!widgetInDesign.registerToRefList) {
            widgetInDesign.registerToRefList(oldName);
            let newLabel = this.getLabelByFieldName(newName);
            this.designer.updateSelectedWidgetNameAndLabel(this.selectedWidget, newName, newLabel);
          }
        }
      },
      getLabelByFieldName(fieldName) {
        for (let i2 = 0; i2 < this.serverSubFormList.length; i2++) {
          if (this.serverSubFormList[i2].name === fieldName) {
            return this.serverSubFormList[i2].label;
          }
        }
        return null;
      }
    }
  };
  function _sfc_render$2v(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      prop: "name",
      rules: $data.nameRequiredRule
    }, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.uniqueName")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.editNameHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        $options.noSubFormList ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
          key: 0,
          type: "text",
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.name = $event),
          readonly: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef
        }, null, 8, ["modelValue", "readonly", "onChange"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_select, {
          key: 1,
          modelValue: $props.optionModel.name,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.name = $event),
          "allow-create": "",
          filterable: "",
          disabled: $options.widgetNameReadonly,
          onChange: $options.updateWidgetNameAndRef,
          title: _ctx.i18nt("designer.setting.editNameHelp")
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.serverSubFormList, (sf, sfIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: sfIdx,
                label: sf.label,
                value: sf.name
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue", "disabled", "onChange", "title"]))
      ]),
      _: 1
    }, 8, ["rules"]);
  }
  var subFormNameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2v, [["render", _sfc_render$2v]]);
  var __glob_0_77 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": subFormNameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var tabCustomClassEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2u = {
    name: "tab-customClass-editor",
    componentName: "PropertyEditor",
    mixins: [i18n$1],
    components: {},
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        cssClassList: []
      };
    },
    created() {
      this.cssClassList = deepClone(this.designer.getCssClassList());
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.cssClassList = cssClassList;
      });
    },
    methods: {
      onTabPaneActiveChange(evt, tpItem) {
      },
      addTabPane(curTabs) {
        this.designer.addTabPaneOfTabs(curTabs);
        this.designer.emitHistoryChange();
      },
      deleteTabPane(curTabs, tpIdx) {
        if (curTabs.tabs.length === 1) {
          this.$message.info(this.i18nt("designer.hint.lastPaneCannotBeDeleted"));
          return;
        }
        this.designer.deleteTabPaneOfTabs(curTabs, tpIdx);
        this.designer.emitHistoryChange();
      }
    }
  };
  const _withScopeId$1 = (n) => (require$$0$1.pushScopeId("data-v-2041c9fc"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$m = { class: "col-item" };
  const _hoisted_2$a = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ require$$0$1.createElementVNode("i", { class: "iconfont icon-drag drag-option" }, null, -1));
  function _sfc_render$2u(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_checkbox = require$$0$1.resolveComponent("el-checkbox");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.customClass")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.customClass,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.customClass = $event),
            multiple: "",
            filterable: "",
            "allow-create": "",
            "default-first-option": ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  label: item,
                  value: item
                }, null, 8, ["label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.tabPaneSetting")
      }, null, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        "label-width": "0",
        class: "panes-setting"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
            tag: "ul",
            list: $props.selectedWidget.tabs,
            "item-key": "id"
          }, { group: "panesGroup", ghostClass: "ghost", handle: ".drag-option" }), {
            item: require$$0$1.withCtx(({ element: tpItem, index: tpIdx }) => [
              require$$0$1.createElementVNode("li", _hoisted_1$m, [
                require$$0$1.createVNode(_component_el_checkbox, {
                  modelValue: tpItem.options.active,
                  "onUpdate:modelValue": ($event) => tpItem.options.active = $event,
                  disabled: "",
                  onChange: (evt) => $options.onTabPaneActiveChange(evt, tpItem),
                  style: { "margin-right": "8px" }
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.paneActive")), 1)
                  ]),
                  _: 2
                }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"]),
                require$$0$1.createVNode(_component_el_input, {
                  type: "text",
                  modelValue: tpItem.options.label,
                  "onUpdate:modelValue": ($event) => tpItem.options.label = $event,
                  style: { "width": "155px" }
                }, null, 8, ["modelValue", "onUpdate:modelValue"]),
                _hoisted_2$a,
                require$$0$1.createVNode(_component_el_button, {
                  circle: "",
                  plain: "",
                  size: "small",
                  type: "danger",
                  onClick: ($event) => $options.deleteTabPane($props.selectedWidget, tpIdx),
                  icon: "el-icon-minus",
                  class: "col-delete-button"
                }, null, 8, ["onClick"])
              ])
            ]),
            _: 1
          }, 16, ["list"]),
          require$$0$1.createElementVNode("div", null, [
            require$$0$1.createVNode(_component_el_button, {
              link: "",
              type: "primary",
              onClick: _cache[1] || (_cache[1] = ($event) => $options.addTabPane($props.selectedWidget))
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addTabPane")), 1)
              ]),
              _: 1
            })
          ])
        ]),
        _: 1
      })
    ]);
  }
  var tabCustomClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2u, [["render", _sfc_render$2u], ["__scopeId", "data-v-2041c9fc"]]);
  var __glob_0_78 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tabCustomClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2t = {
    name: "tabPosition-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2t(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.tabPosition")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.tabPosition,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.tabPosition = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "top",
              value: "top"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "right",
              value: "right"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "bottom",
              value: "bottom"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "left",
              value: "left"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var tabPositionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2t, [["render", _sfc_render$2t]]);
  var __glob_0_79 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tabPositionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2s = {
    name: "tabType-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2s(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.tabType")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.tabType,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.tabType = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "default",
              value: ""
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "card",
              value: "card"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "border-card",
              value: "border-card"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var tabTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2s, [["render", _sfc_render$2s]]);
  var __glob_0_80 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tabTypeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2r = {
    name: "cellHeight-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2r(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.cellHeight")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.cellHeight,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.cellHeight = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var cellHeightEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2r, [["render", _sfc_render$2r]]);
  var __glob_0_81 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cellHeightEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2q = {
    name: "cellWidth-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.cellWidth")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.cellWidth,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.cellWidth = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var cellWidthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2q, [["render", _sfc_render$2q]]);
  var __glob_0_82 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cellWidthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2p = {
    name: "table-cell-wordBreak-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2p(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.wordBreak")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.wordBreak,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.wordBreak = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var wordBreakEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2p, [["render", _sfc_render$2p]]);
  var __glob_0_83 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": wordBreakEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2o = {
    name: "tree-checkStrictly-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2o(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.treeNodeCheckStrictly"),
      title: _ctx.i18nt("designer.setting.treeNodeCheckStrictly")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.checkStrictly,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.checkStrictly = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label", "title"]);
  }
  var checkStrictlyEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2o, [["render", _sfc_render$2o]]);
  var __glob_0_84 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": checkStrictlyEditor$1
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2n = {
    name: "show-checkbox-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2n(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showTreeCheckBox")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showCheckBox,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showCheckBox = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showCheckboxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["render", _sfc_render$2n]]);
  var __glob_0_85 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showCheckboxEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2m = {
    name: "show-filter-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2m(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.filter")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.filter,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.filter = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showFilterEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["render", _sfc_render$2m]]);
  var __glob_0_86 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showFilterEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2l = {
    name: "tree-customClass-editor",
    componentName: "PropertyEditor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        cssClassList: [],
        dataSetList: []
      };
    },
    computed: {
      dataSourceList() {
        if (!this.designer.formConfig || !this.designer.formConfig.dataSources) {
          return [];
        } else {
          return this.designer.formConfig.dataSources;
        }
      }
    },
    watch: {
      selectedWidget: {
        handler(val, oldVal) {
          if (!val) {
            return;
          }
          this.loadDataSet(val.options.dsName);
        },
        immediate: true
      }
    },
    created() {
      this.cssClassList = deepClone(this.designer.getCssClassList());
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.cssClassList = cssClassList;
      });
    },
    methods: {
      loadDataSet(dsName) {
        this.dataSetList.length = 0;
        if (!dsName) {
          return;
        }
        let dsModel = getDSByName(this.designer.formConfig, dsName);
        if (!!dsModel && !!dsModel.dataSets) {
          dsModel.dataSets.forEach((dSet) => {
            this.dataSetList.push({
              name: dSet.name,
              remark: dSet.remark
            });
          });
        }
      },
      getDataSetList() {
        this.optionModel.dataSetName = "";
        this.loadDataSet(this.optionModel.dsName);
      }
    }
  };
  function _sfc_render$2l(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.customClass")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.customClass,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.customClass = $event),
            multiple: "",
            filterable: "",
            "allow-create": "",
            "default-first-option": ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  label: item,
                  value: item
                }, null, 8, ["label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.dsEnabled")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_switch, {
            modelValue: $props.optionModel.dsEnabled,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.optionModel.dsEnabled = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"]),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 0,
        label: _ctx.i18nt("designer.setting.dsName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dsName,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.optionModel.dsName = $event),
            filterable: "",
            clearable: "",
            onChange: $options.getDataSetList
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($options.dataSourceList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.description,
                  label: item.uniqueName,
                  value: item.uniqueName
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue", "onChange"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
      !!$props.optionModel.dsEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
        key: 1,
        label: _ctx.i18nt("designer.setting.dataSetName")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_select, {
            modelValue: $props.optionModel.dataSetName,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.optionModel.dataSetName = $event),
            filterable: "",
            clearable: ""
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dataSetList, (item, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                  key: idx,
                  title: item.remark,
                  label: item.name,
                  value: item.name
                }, null, 8, ["title", "label", "value"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var treeCustomClassEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["render", _sfc_render$2l]]);
  var __glob_0_87 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeCustomClassEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2k = {
    name: "tree-defaultExpandAllNode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2k(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultExpandAllNode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.defaultExpandAllNode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultExpandAllNode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeDefaultExpandAllNodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["render", _sfc_render$2k]]);
  var __glob_0_88 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeDefaultExpandAllNodeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2j = {
    name: "tree-draggable-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2j(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.draggable")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.draggable,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.draggable = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeDraggableEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2j, [["render", _sfc_render$2j]]);
  var __glob_0_89 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeDraggableEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2i = {
    name: "tree-expandOnClickNode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2i(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.expandOnClickNode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.expandOnClickNode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.expandOnClickNode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeExpandOnClickNodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2i, [["render", _sfc_render$2i]]);
  var __glob_0_90 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeExpandOnClickNodeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2h = {
    name: "tree-expandRetractAllNode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2h(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.expandRetractAllNode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.expandRetractAllNode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.expandRetractAllNode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeExpandRetractAllNodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["render", _sfc_render$2h]]);
  var __glob_0_91 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeExpandRetractAllNodeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2g = {
    name: "tree-lazy-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2g(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.lazy")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.lazy,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.lazy = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeLazyEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["render", _sfc_render$2g]]);
  var __glob_0_92 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeLazyEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2f = {
    name: "tree-nodeEdit-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2f(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.nodeEdit")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.nodeEdit,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.nodeEdit = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeNodeEditEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["render", _sfc_render$2f]]);
  var __glob_0_93 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeNodeEditEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2e = {
    name: "tree-selectClearAllNode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2e(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.selectClearAllNode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.selectClearAllNode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.selectClearAllNode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeSelectClearAllNodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["render", _sfc_render$2e]]);
  var __glob_0_94 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeSelectClearAllNodeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var treeDataEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2d = {
    name: "treeData-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    components: {
      CodeEditor
    },
    data() {
      return {
        dataDialogVisible: false,
        treeDataOptions: []
      };
    },
    methods: {
      openTreeDataEdit() {
        this.dataDialogVisible = true;
        this.treeDataOptions = JSON.stringify(this.optionModel.treeData, null, "  ");
      },
      saveTreeData() {
        try {
          this.optionModel.treeData = JSON.parse(this.treeDataOptions);
          this.dataDialogVisible = false;
        } catch (ex) {
          this.$message.error(this.i18nt("designer.hint.invalidOptionsData") + ex.message);
        }
      }
    }
  };
  const _hoisted_1$l = { key: 0 };
  const _hoisted_2$9 = { class: "dialog-footer" };
  function _sfc_render$2d(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.treeDataEdit")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "primary",
          plain: "",
          round: "",
          onClick: $options.openTreeDataEdit
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.editAction")), 1)
          ]),
          _: 1
        }, 8, ["onClick"]),
        $data.dataDialogVisible ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$l, [
          require$$0$1.createVNode(_component_el_dialog, {
            title: _ctx.i18nt("designer.setting.treeDataEdit"),
            modelValue: $data.dataDialogVisible,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.dataDialogVisible = $event),
            "show-close": true,
            class: "drag-dialog small-padding-dialog",
            "append-to-body": "",
            "close-on-click-modal": false,
            "close-on-press-escape": false,
            "destroy-on-close": true,
            width: "75%"
          }, {
            footer: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", _hoisted_2$9, [
                require$$0$1.createVNode(_component_el_button, {
                  size: "default",
                  type: "primary",
                  onClick: $options.saveTreeData
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                  ]),
                  _: 1
                }, 8, ["onClick"]),
                require$$0$1.createVNode(_component_el_button, {
                  size: "default",
                  onClick: _cache[1] || (_cache[1] = ($event) => $data.dataDialogVisible = false)
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                  ]),
                  _: 1
                })
              ])
            ]),
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_code_editor, {
                mode: "json",
                readonly: false,
                modelValue: $data.treeDataOptions,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.treeDataOptions = $event)
              }, null, 8, ["modelValue"])
            ]),
            _: 1
          }, 8, ["title", "modelValue"])
        ])), [
          [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
        ]) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var treeDataEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2d, [["render", _sfc_render$2d], ["__scopeId", "data-v-6f3413a6"]]);
  var __glob_0_95 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeDataEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2c = {
    name: "cancelButtonHidden-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2c(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.cancelButtonHidden")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.cancelButtonHidden,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.cancelButtonHidden = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var cancelButtonHiddenEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["render", _sfc_render$2c]]);
  var __glob_0_96 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cancelButtonHiddenEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2b = {
    name: "cancelButtonLabel-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2b(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.cancelButtonLabel")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.cancelButtonLabel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.cancelButtonLabel = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var cancelButtonLabelEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["render", _sfc_render$2b]]);
  var __glob_0_97 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cancelButtonLabelEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$2a = {
    name: "center-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$2a(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.center"),
      title: _ctx.i18nt("designer.setting.center")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.center,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.center = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label", "title"]);
  }
  var centerEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2a, [["render", _sfc_render$2a]]);
  var __glob_0_98 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": centerEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$29 = {
    name: "closeOnClickModal-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$29(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.closeOnClickModal")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.closeOnClickModal,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.closeOnClickModal = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var closeOnClickModalEditor = /* @__PURE__ */ _export_sfc(_sfc_main$29, [["render", _sfc_render$29]]);
  var __glob_0_99 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": closeOnClickModalEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$28 = {
    name: "closeOnPressEscape-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$28(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.closeOnPressEscape")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.closeOnPressEscape,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.closeOnPressEscape = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var closeOnPressEscapeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$28, [["render", _sfc_render$28]]);
  var __glob_0_100 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": closeOnPressEscapeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$27 = {
    name: "disabledMode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$27(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.disabledMode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.disabledMode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.disabledMode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var disabledModeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$27, [["render", _sfc_render$27]]);
  var __glob_0_101 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": disabledModeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$26 = {
    name: "fullscreen-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$26(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.fullscreen")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.fullscreen,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.fullscreen = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var fullscreenEditor = /* @__PURE__ */ _export_sfc(_sfc_main$26, [["render", _sfc_render$26]]);
  var __glob_0_102 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": fullscreenEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$25 = {
    name: "okButtonHidden-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$25(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.okButtonHidden")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.okButtonHidden,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.okButtonHidden = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var okButtonHiddenEditor = /* @__PURE__ */ _export_sfc(_sfc_main$25, [["render", _sfc_render$25]]);
  var __glob_0_103 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": okButtonHiddenEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$24 = {
    name: "okButtonLabel-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$24(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.okButtonLabel")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.okButtonLabel,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.okButtonLabel = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var okButtonLabelEditor = /* @__PURE__ */ _export_sfc(_sfc_main$24, [["render", _sfc_render$24]]);
  var __glob_0_104 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": okButtonLabelEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$23 = {
    name: "readMode-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$23(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.readMode")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.readMode,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.readMode = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var readModeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$23, [["render", _sfc_render$23]]);
  var __glob_0_105 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": readModeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$22 = {
    name: "showClose-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$22(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showClose")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showClose,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showClose = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showCloseEditor = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["render", _sfc_render$22]]);
  var __glob_0_106 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showCloseEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$21 = {
    name: "showModal-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$21(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showModal")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showModal,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showModal = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showModalEditor = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["render", _sfc_render$21]]);
  var __glob_0_107 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showModalEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$20 = {
    name: "title-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$20(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.title")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.title,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.title = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var titleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["render", _sfc_render$20]]);
  var __glob_0_108 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": titleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1$ = {
    name: "width-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1$(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.dialogWidth")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.width,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.width = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var widthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["render", _sfc_render$1$]]);
  var __glob_0_109 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": widthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var vfDrawerDirectionEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$1_ = {
    name: "vf-drawer-direction-editor",
    mixins: [i18n$1],
    components: {
      Back: ElementPlusIconsVue.Back,
      Right: ElementPlusIconsVue.Right,
      Bottom: ElementPlusIconsVue.Bottom,
      Top: ElementPlusIconsVue.Top
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    computed: {}
  };
  function _sfc_render$1_(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_Back = require$$0$1.resolveComponent("Back");
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_Right = require$$0$1.resolveComponent("Right");
    const _component_Bottom = require$$0$1.resolveComponent("Bottom");
    const _component_Top = require$$0$1.resolveComponent("Top");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.drawDirection")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_radio_group, {
          modelValue: $props.optionModel.direction,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.direction = $event),
          class: "radio-group-custom"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_radio_button, { label: "rtl" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_Back)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "ltr" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_Right)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "ttb" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_Bottom)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_radio_button, { label: "btt" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_icon, null, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_Top)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var vfDrawerDirectionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1_, [["render", _sfc_render$1_], ["__scopeId", "data-v-47be7df0"]]);
  var __glob_0_110 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDrawerDirectionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1Z = {
    name: "vf-drawer-size-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1Z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.drawSize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.size,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.size = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var vfDrawerSizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1Z, [["render", _sfc_render$1Z]]);
  var __glob_0_111 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDrawerSizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var eventMixin = {
    mixins: [emitter],
    created() {
    },
    methods: {
      editEventHandler(eventName, eventParams) {
        this.dispatch("SettingPanel", "editEventHandler", [eventName, [...eventParams]]);
      }
    }
  };
  const _sfc_main$1Y = {
    name: "onAppendButtonClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1Y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onAppendButtonClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onAppendButtonClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onAppendButtonClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1Y, [["render", _sfc_render$1Y]]);
  var __glob_0_112 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onAppendButtonClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1X = {
    name: "onBeforeUpload-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["file"]
      };
    }
  };
  function _sfc_render$1X(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onBeforeUpload",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onBeforeUpload", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onBeforeUploadEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1X, [["render", _sfc_render$1X]]);
  var __glob_0_113 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onBeforeUploadEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1W = {
    name: "onBlur-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["event"]
      };
    }
  };
  function _sfc_render$1W(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onBlur",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onBlur", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onBlurEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1W, [["render", _sfc_render$1W]]);
  var __glob_0_114 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onBlurEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1V = {
    name: "onButtonGroupClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["buttonConfig"]
      };
    }
  };
  function _sfc_render$1V(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onButtonGroupClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onButtonGroupClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onButtonGroupClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1V, [["render", _sfc_render$1V]]);
  var __glob_0_115 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onButtonGroupClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1U = {
    name: "onCancelButtonClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1U(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCancelButtonClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCancelButtonClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onCancelButtonClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1U, [["render", _sfc_render$1U]]);
  var __glob_0_116 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCancelButtonClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1T = {
    name: "onCellClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["row", "column", "cell", "event"]
      };
    }
  };
  function _sfc_render$1T(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCellClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCellClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onCellClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1T, [["render", _sfc_render$1T]]);
  var __glob_0_117 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCellClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1S = {
    name: "onCellDoubleClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["row", "column", "cell", "event"]
      };
    }
  };
  function _sfc_render$1S(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCellDoubleClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCellDoubleClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onCellDoubleClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1S, [["render", _sfc_render$1S]]);
  var __glob_0_118 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCellDoubleClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1R = {
    name: "onChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["value", "oldValue", "subFormData", "rowId"]
      };
    }
  };
  function _sfc_render$1R(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["render", _sfc_render$1R]]);
  var __glob_0_119 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1Q = {
    name: "onCheckChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        eventParams: ["data", "checked", "indeterminate"]
      };
    }
  };
  function _sfc_render$1Q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCheckChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCheckChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        })
      ]),
      _: 1
    });
  }
  var onCheckChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["render", _sfc_render$1Q]]);
  var __glob_0_120 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCheckChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1P = {
    name: "onClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1P(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["render", _sfc_render$1P]]);
  var __glob_0_121 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1O = {
    name: "onCreated-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1O(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCreated",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCreated", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onCreatedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["render", _sfc_render$1O]]);
  var __glob_0_122 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCreatedEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1N = {
    name: "onCurrentPageChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["pageSize", "currentPage"]
      };
    }
  };
  function _sfc_render$1N(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onCurrentPageChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onCurrentPageChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onCurrentPageChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["render", _sfc_render$1N]]);
  var __glob_0_123 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onCurrentPageChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1M = {
    name: "onDialogBeforeClose-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1M(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onDialogBeforeClose",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onDialogBeforeClose", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onDialogBeforeCloseEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["render", _sfc_render$1M]]);
  var __glob_0_124 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onDialogBeforeCloseEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1L = {
    name: "onDialogOpened-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1L(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onDialogOpened",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onDialogOpened", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onDialogOpenedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["render", _sfc_render$1L]]);
  var __glob_0_125 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onDialogOpenedEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1K = {
    name: "onDisableOperationButton-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["buttonConfig", "rowIndex", "row"]
      };
    }
  };
  function _sfc_render$1K(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onDisableOperationButton",
      title: "onDisableOperationButton",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onDisableOperationButton", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onDisableOperationButtonEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["render", _sfc_render$1K]]);
  var __glob_0_126 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onDisableOperationButtonEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1J = {
    name: "onDrawerBeforeClose-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1J(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onDrawerBeforeClose",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onDrawerBeforeClose", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onDrawerBeforeCloseEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["render", _sfc_render$1J]]);
  var __glob_0_127 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onDrawerBeforeCloseEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1I = {
    name: "onDrawerOpened-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1I(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onDrawerOpened",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onDrawerOpened", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onDrawerOpenedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["render", _sfc_render$1I]]);
  var __glob_0_128 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onDrawerOpenedEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1H = {
    name: "onFileRemove-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["file", "fileList"]
      };
    }
  };
  function _sfc_render$1H(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onFileRemove",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onFileRemove", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onFileRemove = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["render", _sfc_render$1H]]);
  var __glob_0_129 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onFileRemove
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1G = {
    name: "onFocus-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["event"]
      };
    }
  };
  function _sfc_render$1G(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onFocus",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onFocus", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onFocusEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$1G]]);
  var __glob_0_130 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onFocusEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1F = {
    name: "onGetOperationButtonLabel-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["buttonConfig", "rowIndex", "row"]
      };
    }
  };
  function _sfc_render$1F(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onGetOperationButtonLabel",
      title: "onGetOperationButtonLabel",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onGetOperationButtonLabel", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onGetOperationButtonLabelEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$1F]]);
  var __glob_0_131 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onGetOperationButtonLabelEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1E = {
    name: "onGetRowClassName-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["rowIndex", "row"]
      };
    }
  };
  function _sfc_render$1E(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onGetRowClassName",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onGetRowClassName", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onGetRowClassNameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["render", _sfc_render$1E]]);
  var __glob_0_132 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onGetRowClassNameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1D = {
    name: "onGetSpanMethod-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["row", "column", "rowIndex", "columnIndex"]
      };
    }
  };
  function _sfc_render$1D(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onGetSpanMethod",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onGetSpanMethod", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onGetSpanMethodEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$1D]]);
  var __glob_0_133 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onGetSpanMethodEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1C = {
    name: "onHeaderClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["column", "event"]
      };
    }
  };
  function _sfc_render$1C(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onHeaderClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onHeaderClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onHeaderClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["render", _sfc_render$1C]]);
  var __glob_0_134 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onHeaderClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1B = {
    name: "onHideOperationButton-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["buttonConfig", "rowIndex", "row"]
      };
    }
  };
  function _sfc_render$1B(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onHideOperationButton",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onHideOperationButton", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onHideOperationButtonEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["render", _sfc_render$1B]]);
  var __glob_0_135 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onHideOperationButtonEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1A = {
    name: "onInput-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["value"]
      };
    }
  };
  function _sfc_render$1A(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onInput",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onInput", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onInputEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["render", _sfc_render$1A]]);
  var __glob_0_136 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onInputEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1z = {
    name: "onMounted-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onMounted",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onMounted", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onMountedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["render", _sfc_render$1z]]);
  var __glob_0_137 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onMountedEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1y = {
    name: "onNodeCheck-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        eventParams: ["data", "treeState"]
      };
    }
  };
  function _sfc_render$1y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onNodeCheck",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onNodeCheck", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        })
      ]),
      _: 1
    });
  }
  var onNodeCheckEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["render", _sfc_render$1y]]);
  var __glob_0_138 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onNodeCheckEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1x = {
    name: "onNodeClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        eventParams: ["data", "node", "el"]
      };
    }
  };
  function _sfc_render$1x(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onNodeClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onNodeClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        })
      ]),
      _: 1
    });
  }
  var onNodeClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$1x]]);
  var __glob_0_139 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onNodeClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1w = {
    name: "onNodeContextmenu-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        eventParams: ["event", "data", "node", "el"]
      };
    }
  };
  function _sfc_render$1w(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onNodeContextmenu",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onNodeContextmenu", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        })
      ]),
      _: 1
    });
  }
  var onNodeContextmenuEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$1w]]);
  var __glob_0_140 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onNodeContextmenuEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1v = {
    name: "onOkButtonClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: []
      };
    }
  };
  function _sfc_render$1v(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onOkButtonClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onOkButtonClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onOkButtonClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$1v]]);
  var __glob_0_141 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onOkButtonClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1u = {
    name: "onOperationButtonClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["buttonName", "rowIndex", "row"]
      };
    }
  };
  function _sfc_render$1u(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onOperationButtonClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onOperationButtonClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onOperationButtonClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$1u]]);
  var __glob_0_142 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onOperationButtonClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1t = {
    name: "onPageSizeChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["pageSize", "currentPage"]
      };
    }
  };
  function _sfc_render$1t(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onPageSizeChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onPageSizeChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onPageSizeChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["render", _sfc_render$1t]]);
  var __glob_0_143 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onPageSizeChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1s = {
    name: "onRemoteQuery-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["keyword"]
      };
    }
  };
  function _sfc_render$1s(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onRemoteQuery",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onRemoteQuery", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onRemoteQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["render", _sfc_render$1s]]);
  var __glob_0_144 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onRemoteQueryEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1r = {
    name: "onRowClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["row", "column", "event"]
      };
    }
  };
  function _sfc_render$1r(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onRowClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onRowClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onRowClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["render", _sfc_render$1r]]);
  var __glob_0_145 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onRowClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1q = {
    name: "onRowDoubleClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["row", "column", "event"]
      };
    }
  };
  function _sfc_render$1q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onRowDoubleClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onRowDoubleClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onRowDoubleClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["render", _sfc_render$1q]]);
  var __glob_0_146 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onRowDoubleClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1p = {
    name: "onSelectionChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["selection", "selectedIndices"]
      };
    }
  };
  function _sfc_render$1p(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSelectionChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSelectionChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSelectionChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["render", _sfc_render$1p]]);
  var __glob_0_147 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSelectionChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1o = {
    name: "onSortChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["column", "prop", "order", "pageSize", "currentPage"]
      };
    }
  };
  function _sfc_render$1o(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSortChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSortChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSortChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["render", _sfc_render$1o]]);
  var __glob_0_148 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSortChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1n = {
    name: "onSubFormRowAdd-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["subFormData", "newRowId"]
      };
    }
  };
  function _sfc_render$1n(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSubFormRowAdd",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSubFormRowAdd", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSubFormRowAddEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["render", _sfc_render$1n]]);
  var __glob_0_149 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSubFormRowAddEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1m = {
    name: "onSubFormRowChange-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["subFormData"]
      };
    }
  };
  function _sfc_render$1m(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSubFormRowChange",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSubFormRowChange", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSubFormRowChangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["render", _sfc_render$1m]]);
  var __glob_0_150 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSubFormRowChangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1l = {
    name: "onSubFormRowDelete-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["subFormData", "deletedDataRow"]
      };
    }
  };
  function _sfc_render$1l(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSubFormRowDelete",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSubFormRowDelete", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSubFormRowDeleteEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["render", _sfc_render$1l]]);
  var __glob_0_151 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSubFormRowDeleteEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1k = {
    name: "onSubFormRowInsert-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["subFormData", "newRowId"]
      };
    }
  };
  function _sfc_render$1k(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onSubFormRowInsert",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onSubFormRowInsert", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onSubFormRowInsertEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["render", _sfc_render$1k]]);
  var __glob_0_152 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onSubFormRowInsertEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1j = {
    name: "onTabClick-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["tab"]
      };
    }
  };
  function _sfc_render$1j(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onTabClick",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onTabClick", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onTabClickEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["render", _sfc_render$1j]]);
  var __glob_0_153 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onTabClickEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1i = {
    name: "onUploadError-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["error", "file", "fileList"]
      };
    }
  };
  function _sfc_render$1i(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onUploadError",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onUploadError", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onUploadErrorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["render", _sfc_render$1i]]);
  var __glob_0_154 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onUploadErrorEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1h = {
    name: "onUploadSuccess-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["result", "file", "fileList"]
      };
    }
  };
  function _sfc_render$1h(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onUploadSuccess",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onUploadSuccess", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onUploadSuccessEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["render", _sfc_render$1h]]);
  var __glob_0_155 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onUploadSuccessEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1g = {
    name: "onValidate-editor",
    mixins: [i18n$1, eventMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object,
      eventHandled: {
        type: Boolean,
        default: false
      }
    },
    data() {
      return {
        eventParams: ["rule", "value", "callback"]
      };
    }
  };
  function _sfc_render$1g(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: "onValidate",
      "label-width": "150px"
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_button, {
          type: "info",
          icon: "el-icon-edit",
          plain: "",
          round: "",
          class: require$$0$1.normalizeClass([$props.eventHandled ? "button-text-highlight" : ""]),
          onClick: _cache[0] || (_cache[0] = ($event) => _ctx.editEventHandler("onValidate", $data.eventParams))
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
          ]),
          _: 1
        }, 8, ["class"])
      ]),
      _: 1
    });
  }
  var onValidateEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["render", _sfc_render$1g]]);
  var __glob_0_156 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": onValidateEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1f = {
    name: "button-type-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1f(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.displayType")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.type,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.type = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "default",
              value: ""
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "primary",
              value: "primary"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "success",
              value: "success"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "warning",
              value: "warning"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "danger",
              value: "danger"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "info",
              value: "info"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "text",
              value: "text"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var buttonTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["render", _sfc_render$1f]]);
  var __glob_0_157 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonTypeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1e = {
    name: "circle-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1e(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.circle")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.circle,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.circle = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var circleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["render", _sfc_render$1e]]);
  var __glob_0_158 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": circleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1d = {
    name: "icon-editor",
    components: { IconPicker },
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1d(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_icon_picker = require$$0$1.resolveComponent("icon-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.buttonIcon")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_icon_picker, {
          modelValue: $props.optionModel.icon,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.icon = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var iconEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["render", _sfc_render$1d]]);
  var __glob_0_159 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": iconEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1c = {
    name: "plain-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1c(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.plain")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.plain,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.plain = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var plainEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$1c]]);
  var __glob_0_160 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": plainEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1b = {
    name: "round-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$1b(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.round")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.round,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.round = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var roundEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$1b]]);
  var __glob_0_161 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": roundEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$1a = {
    name: "cascader-defaultValue-editor",
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  const _hoisted_1$k = { style: { "display": "none" } };
  function _sfc_render$1a(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$k);
  }
  var cascaderDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$1a]]);
  var __glob_0_162 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cascaderDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$19 = {
    name: "cascader-multiple-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.multiple")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.multiple,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.multiple = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var cascaderMultipleEditor = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$19]]);
  var __glob_0_163 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": cascaderMultipleEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$18 = {
    name: "checkStrictly-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.checkStrictly")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.checkStrictly,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.checkStrictly = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var checkStrictlyEditor = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$18]]);
  var __glob_0_164 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": checkStrictlyEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$17 = {
    name: "showAllLevels-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showAllLevels")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showAllLevels,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showAllLevels = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showAllLevelsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$17]]);
  var __glob_0_165 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showAllLevelsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$16 = {
    name: "checkbox-defaultValue-editor",
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  const _hoisted_1$j = { style: { "display": "none" } };
  function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$j);
  }
  var checkboxDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$16]]);
  var __glob_0_166 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": checkboxDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$15 = {
    name: "color-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_color_picker = require$$0$1.resolveComponent("el-color-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_color_picker, {
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var colorDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$15]]);
  var __glob_0_167 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": colorDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$14 = {
    name: "keyName-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    watch: {}
  };
  function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.optionModel.keyNameEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, { key: 0 }, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.keyName")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.keyNameHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          type: "text",
          modelValue: $props.optionModel.keyName,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.keyName = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    })) : require$$0$1.createCommentVNode("", true);
  }
  var keyNameEditor = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$14]]);
  var __glob_0_168 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": keyNameEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$13 = {
    name: "keyNameEnabled-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    methods: {
      handleChange(value2) {
        if (value2 && !this.optionModel.keyName) {
          this.optionModel.keyName = this.optionModel.name;
        }
      }
    }
  };
  function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.keyNameEnabled")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.keyNameEnabled,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.keyNameEnabled = $event),
          onChange: $options.handleChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var keyNameEnabledEditor = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$13]]);
  var __glob_0_169 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": keyNameEnabledEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$12 = {
    name: "date-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_date_picker = require$$0$1.resolveComponent("el-date-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_date_picker, {
          type: $props.optionModel.type,
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange,
          format: $props.optionModel.format,
          "value-format": $props.optionModel.valueFormat,
          style: { "width": "100%" }
        }, null, 8, ["type", "modelValue", "onChange", "format", "value-format"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$12]]);
  var __glob_0_170 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$11 = {
    name: "date-format-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.format")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.format,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.format = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD",
              value: "YYYY-MM-DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY/MM/DD",
              value: "YYYY/MM/DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY\u5E74MM\u6708DD\u65E5",
              value: "YYYY\u5E74MM\u6708DD\u65E5"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD HH:mm:ss",
              value: "YYYY-MM-DD HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD hh:mm:ss",
              value: "YYYY-MM-DD hh:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM",
              value: "YYYY-MM"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY",
              value: "YYYY"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["render", _sfc_render$11]]);
  var __glob_0_171 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$10 = {
    name: "date-type-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.displayType")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.type,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.type = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "datetime",
              value: "datetime"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "date",
              value: "date"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "dates",
              value: "dates"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "year",
              value: "year"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "month",
              value: "month"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "week",
              value: "week"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["render", _sfc_render$10]]);
  var __glob_0_172 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateTypeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$$ = {
    name: "date-valueFormat-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$$(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.valueFormat")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.valueFormat,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.valueFormat = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD",
              value: "YYYY-MM-DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD HH:mm:ss",
              value: "YYYY-MM-DD HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM",
              value: "YYYY-MM"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY",
              value: "YYYY"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateValueFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["render", _sfc_render$$]]);
  var __glob_0_173 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateValueFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$_ = {
    name: "date-range-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$_(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_date_picker = require$$0$1.resolveComponent("el-date-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_date_picker, {
          type: $props.optionModel.type,
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange,
          format: $props.optionModel.format,
          "value-format": $props.optionModel.valueFormat,
          style: { "width": "100%" }
        }, null, 8, ["type", "modelValue", "onChange", "format", "value-format"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateRangeDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["render", _sfc_render$_]]);
  var __glob_0_174 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateRangeDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$Z = {
    name: "date-range-format-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$Z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.format")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.format,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.format = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD",
              value: "YYYY-MM-DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY/MM/DD",
              value: "YYYY/MM/DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY\u5E74MM\u6708DD\u65E5",
              value: "YYYY\u5E74MM\u6708DD\u65E5"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD HH:mm:ss",
              value: "YYYY-MM-DD HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD hh:mm:ss",
              value: "YYYY-MM-DD hh:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM",
              value: "YYYY-MM"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY",
              value: "YYYY"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateRangeFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$Z]]);
  var __glob_0_175 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateRangeFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$Y = {
    name: "date-range-type-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    methods: {
      refreshDateRange() {
        const drWidget = this.designer.formWidget.getSelectedWidgetRef();
        if (drWidget && drWidget.refreshWidgetKey) {
          drWidget.refreshWidgetKey();
        }
      }
    }
  };
  function _sfc_render$Y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.displayType")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.type,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.type = $event),
          onChange: $options.refreshDateRange
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "daterange",
              value: "daterange"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "datetimerange",
              value: "datetimerange"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "monthrange",
              value: "monthrange"
            })
          ]),
          _: 1
        }, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateRangeTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$Y]]);
  var __glob_0_176 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateRangeTypeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$X = {
    name: "date-range-valueFormat-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$X(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.valueFormat")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.valueFormat,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.valueFormat = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD",
              value: "YYYY-MM-DD"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM-DD HH:mm:ss",
              value: "YYYY-MM-DD HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY-MM",
              value: "YYYY-MM"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "YYYY",
              value: "YYYY"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dateRangeValueFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["render", _sfc_render$X]]);
  var __glob_0_177 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dateRangeValueFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$W = {
    name: "contentPosition-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$W(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.contentPosition")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.contentPosition,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.contentPosition = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "center",
              value: "center"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "left",
              value: "left"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "right",
              value: "right"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var contentPositionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$W]]);
  var __glob_0_178 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": contentPositionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$V = {
    name: "divider-direction-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$V(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.dividerDirection")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.direction,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.direction = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "horizontal",
              value: "horizontal"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "vertical",
              value: "vertical"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var dividerDirectionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$V]]);
  var __glob_0_179 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dividerDirectionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$U = {
    name: "file-upload-fileTypes-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        uploadFileTypes: [
          { value: "doc", label: "doc" },
          { value: "xls", label: "xls" },
          { value: "docx", label: "docx" },
          { value: "xlsx", label: "xlsx" }
        ]
      };
    }
  };
  function _sfc_render$U(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, null, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.fileTypes")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.fileTypesHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          multiple: "",
          "allow-create": "",
          filterable: "",
          "default-first-option": "",
          modelValue: $props.optionModel.fileTypes,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.fileTypes = $event),
          style: { "width": "100%" }
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.uploadFileTypes, (ft, ftIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: ftIdx,
                label: ft.label,
                value: ft.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    });
  }
  var fileUploadFileTypesEditor = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$U]]);
  var __glob_0_180 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": fileUploadFileTypesEditor
  }, Symbol.toStringTag, { value: "Module" }));
  var htmlContentEditor_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$T = {
    name: "htmlContent-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$T(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.htmlContent")
      }, null, 8, ["label"]),
      require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            type: "textarea",
            modelValue: $props.optionModel.htmlContent,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.htmlContent = $event),
            rows: 5,
            class: "html-content-editor"
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      })
    ]);
  }
  var htmlContentEditor = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$T], ["__scopeId", "data-v-e311c596"]]);
  var __glob_0_181 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": htmlContentEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$S = {
    name: "controls-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$S(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showControls")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.controls,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.controls = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var controlsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["render", _sfc_render$S]]);
  var __glob_0_182 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": controlsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$R = {
    name: "controlsPosition-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$R(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.controlsPosition")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.controlsPosition,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.controlsPosition = $event)
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "default",
              value: ""
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "right",
              value: "right"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var controlsPositionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["render", _sfc_render$R]]);
  var __glob_0_183 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": controlsPositionEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$Q = {
    name: "number-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$Q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return !_ctx.hasConfig("optionItems") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          type: "text",
          style: { "width": "100%" },
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var numberDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$Q]]);
  var __glob_0_184 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": numberDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$P = {
    name: "picture-upload-fileTypes-editor",
    mixins: [i18n$1],
    components: {
      SvgIcon
    },
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    data() {
      return {
        uploadPictureTypes: [
          { value: "jpg", label: "jpg" },
          { value: "jpeg", label: "jpeg" },
          { value: "png", label: "png" },
          { value: "gif", label: "gif" }
        ]
      };
    }
  };
  function _sfc_render$P(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_tooltip = require$$0$1.resolveComponent("el-tooltip");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, null, {
      label: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("span", null, [
          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.fileTypes")) + " ", 1),
          require$$0$1.createVNode(_component_el_tooltip, {
            effect: "light",
            content: _ctx.i18nt("designer.setting.fileTypesHelp")
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-info" })
            ]),
            _: 1
          }, 8, ["content"])
        ])
      ]),
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          multiple: "",
          "allow-create": "",
          filterable: "",
          "default-first-option": "",
          modelValue: $props.optionModel.fileTypes,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.fileTypes = $event),
          style: { "width": "100%" }
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.uploadPictureTypes, (ft, ftIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                key: ftIdx,
                label: ft.label,
                value: ft.value
              }, null, 8, ["label", "value"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    });
  }
  var pictureUploadFileTypesEditor = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$P]]);
  var __glob_0_185 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": pictureUploadFileTypesEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$O = {
    name: "radio-defaultValue-editor",
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  const _hoisted_1$i = { style: { "display": "none" } };
  function _sfc_render$O(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$i);
  }
  var radioDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$O]]);
  var __glob_0_186 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": radioDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$N = {
    name: "allowHalf-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$N(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.allowHalf")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.allowHalf,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.allowHalf = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var allowHalfEditor = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$N]]);
  var __glob_0_187 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": allowHalfEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$M = {
    name: "highThreshold-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$M(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.highThreshold")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.highThreshold,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.highThreshold = $event),
          min: $props.optionModel.lowThreshold,
          max: $props.optionModel.max,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue", "min", "max"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var highThresholdEditor = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["render", _sfc_render$M]]);
  var __glob_0_188 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": highThresholdEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$L = {
    name: "lowThreshold-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$L(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.lowThreshold")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.lowThreshold,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.lowThreshold = $event),
          min: 1,
          max: $props.optionModel.highThreshold,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue", "max"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var lowThresholdEditor = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["render", _sfc_render$L]]);
  var __glob_0_189 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": lowThresholdEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$K = {
    name: "rate-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$K(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          min: 0,
          max: $props.optionModel.max,
          style: { "width": "100%" },
          onChange: _ctx.emitDefaultValueChange
        }, null, 8, ["modelValue", "max", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var rateDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["render", _sfc_render$K]]);
  var __glob_0_190 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": rateDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$J = {
    name: "rate-max-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$J(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.maxStars")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.max,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.max = $event),
          min: 1,
          max: 10,
          class: "hide-spin-button",
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var rateMaxEditor = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$J]]);
  var __glob_0_191 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": rateMaxEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$I = {
    name: "showScore-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$I(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showScore")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showScore,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showScore = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showScoreEditor = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$I]]);
  var __glob_0_192 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showScoreEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$H = {
    name: "showText-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$H(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showText")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showText,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showText = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showTextEditor = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["render", _sfc_render$H]]);
  var __glob_0_193 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showTextEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$G = {
    name: "rich-editor-contentHeight-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$G(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form_item, {
        label: _ctx.i18nt("designer.setting.contentHeight")
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_input, {
            type: "text",
            modelValue: $props.optionModel.contentHeight,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.contentHeight = $event)
          }, null, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["label"])
    ]);
  }
  var richEditorContentHeightEditor = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["render", _sfc_render$G]]);
  var __glob_0_194 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": richEditorContentHeightEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$F = {
    name: "collapseTags-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$F(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return $props.optionModel.multiple ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      key: 0,
      label: _ctx.i18nt("designer.setting.collapseTags")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.collapseTags,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.collapseTags = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"])) : require$$0$1.createCommentVNode("", true);
  }
  var collapseTagsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["render", _sfc_render$F]]);
  var __glob_0_195 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": collapseTagsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$E = {
    name: "select-defaultValue-editor",
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  const _hoisted_1$h = { style: { "display": "none" } };
  function _sfc_render$E(_ctx, _cache, $props, $setup, $data, $options) {
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$h);
  }
  var selectDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["render", _sfc_render$E]]);
  var __glob_0_196 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": selectDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$D = {
    name: "range-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$D(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.range")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.range,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.range = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var rangeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$D]]);
  var __glob_0_197 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": rangeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$C = {
    name: "showStops-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$C(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.showStops")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.showStops,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.showStops = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var showStopsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$C]]);
  var __glob_0_198 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": showStopsEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$B = {
    name: "vertical-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$B(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.vertical")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.vertical,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.vertical = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var verticalEditor = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$B]]);
  var __glob_0_199 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": verticalEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$A = {
    name: "fontSize-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$A(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.fontSize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          modelValue: $props.optionModel.fontSize,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.fontSize = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var fontSizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$A]]);
  var __glob_0_200 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": fontSizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$z = {
    name: "static-text-preWrap-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$z(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.preWrap")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.preWrap,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.preWrap = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var preWrapEditor = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["render", _sfc_render$z]]);
  var __glob_0_201 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": preWrapEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$y = {
    name: "textContent-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.textContent")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          modelValue: $props.optionModel.textContent,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.textContent = $event),
          type: "textarea",
          rows: 3
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var textContentEditor = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["render", _sfc_render$y]]);
  var __glob_0_202 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": textContentEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$x = {
    name: "activeColor-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_color_picker = require$$0$1.resolveComponent("el-color-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.activeColor")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_color_picker, {
          modelValue: $props.optionModel.activeColor,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.activeColor = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var activeColorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["render", _sfc_render$x]]);
  var __glob_0_203 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": activeColorEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$w = {
    name: "activeText-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.activeText")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          modelValue: $props.optionModel.activeText,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.activeText = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var activeTextEditor = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render$w]]);
  var __glob_0_204 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": activeTextEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$v = {
    name: "inactiveColor-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_color_picker = require$$0$1.resolveComponent("el-color-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.inactiveColor")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_color_picker, {
          modelValue: $props.optionModel.inactiveColor,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.inactiveColor = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var inactiveColorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render$v]]);
  var __glob_0_205 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": inactiveColorEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$u = {
    name: "inactiveText-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.inactiveText")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input, {
          modelValue: $props.optionModel.inactiveText,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.inactiveText = $event)
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var inactiveTextEditor = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render$u]]);
  var __glob_0_206 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": inactiveTextEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$t = {
    name: "switch-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange,
          "active-text": "true",
          "inactive-text": "false"
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var switchDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["render", _sfc_render$t]]);
  var __glob_0_207 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": switchDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$s = {
    name: "switchWidth-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.switchWidth")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_input_number, {
          modelValue: $props.optionModel.switchWidth,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.switchWidth = $event),
          style: { "width": "100%" }
        }, null, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var switchWidthEditor = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["render", _sfc_render$s]]);
  var __glob_0_208 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": switchWidthEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$r = {
    name: "autosize-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    },
    methods: {
      refreshTextArea() {
        const taWidget = this.designer.formWidget.getSelectedWidgetRef();
        if (taWidget && taWidget.refreshWidgetKey) {
          taWidget.refreshWidgetKey();
        }
      }
    }
  };
  function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.autosize")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_switch, {
          modelValue: $props.optionModel.autosize,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.autosize = $event),
          onChange: $options.refreshTextArea
        }, null, 8, ["modelValue", "onChange"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var autosizeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["render", _sfc_render$r]]);
  var __glob_0_209 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": autosizeEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$q = {
    name: "time-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_time_picker = require$$0$1.resolveComponent("el-time-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_time_picker, {
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          onChange: _ctx.emitDefaultValueChange,
          format: $props.optionModel.format,
          "value-format": "HH:mm:ss",
          style: { "width": "100%" }
        }, null, 8, ["modelValue", "onChange", "format"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var timeDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$q]]);
  var __glob_0_210 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$p = {
    name: "time-format-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.format")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.format,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.format = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "HH:mm:ss",
              value: "HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "HH\u65F6mm\u5206ss\u79D2",
              value: "HH\u65F6mm\u5206ss\u79D2"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "hh:mm:ss",
              value: "hh:mm:ss"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var timeFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$p]]);
  var __glob_0_211 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$o = {
    name: "time-range-defaultValue-editor",
    mixins: [i18n$1, propertyMixin],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_time_picker = require$$0$1.resolveComponent("el-time-picker");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.defaultValue")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_time_picker, {
          modelValue: $props.optionModel.defaultValue,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.defaultValue = $event),
          "is-range": "",
          onChange: _ctx.emitDefaultValueChange,
          format: $props.optionModel.format,
          "value-format": "HH:mm:ss",
          style: { "width": "100%" }
        }, null, 8, ["modelValue", "onChange", "format"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var timeRangeDefaultValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["render", _sfc_render$o]]);
  var __glob_0_212 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeRangeDefaultValueEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$n = {
    name: "time-range-format-editor",
    mixins: [i18n$1],
    props: {
      designer: Object,
      selectedWidget: Object,
      optionModel: Object
    }
  };
  function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
      label: _ctx.i18nt("designer.setting.format")
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_select, {
          modelValue: $props.optionModel.format,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.optionModel.format = $event),
          filterable: "",
          "allow-create": ""
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_option, {
              label: "HH:mm:ss",
              value: "HH:mm:ss"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "HH\u65F6mm\u5206ss\u79D2",
              value: "HH\u65F6mm\u5206ss\u79D2"
            }),
            require$$0$1.createVNode(_component_el_option, {
              label: "hh:mm:ss",
              value: "hh:mm:ss"
            })
          ]),
          _: 1
        }, 8, ["modelValue"])
      ]),
      _: 1
    }, 8, ["label"]);
  }
  var timeRangeFormatEditor = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["render", _sfc_render$n]]);
  var __glob_0_213 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": timeRangeFormatEditor
  }, Symbol.toStringTag, { value: "Module" }));
  let comps = {};
  const modules$1 = { "./actionColumnPosition-editor.vue": __glob_0_0$1, "./allowCreate-editor.vue": __glob_0_1$1, "./appendButton-editor.vue": __glob_0_2$1, "./appendButtonDisabled-editor.vue": __glob_0_3$1, "./autoFullWidth-editor.vue": __glob_0_4$1, "./automaticDropdown-editor.vue": __glob_0_5$1, "./border-editor.vue": __glob_0_6$1, "./buttonIcon-editor.vue": __glob_0_7$1, "./buttonStyle-editor.vue": __glob_0_8$1, "./clearable-editor.vue": __glob_0_9$1, "./columnWidth-editor.vue": __glob_0_10$1, "./customClass-editor.vue": __glob_0_11$1, "./defaultValue-editor.vue": __glob_0_12$1, "./disabled-editor.vue": __glob_0_13$1, "./displayStyle-editor.vue": __glob_0_14, "./editable-editor.vue": __glob_0_15, "./endPlaceholder-editor.vue": __glob_0_16, "./fileMaxSize-editor.vue": __glob_0_17, "./filterable-editor.vue": __glob_0_18, "./formula-editor.vue": __glob_0_19, "./formulaEnabled-editor.vue": __glob_0_20, "./hidden-editor.vue": __glob_0_21, "./label-editor.vue": __glob_0_22, "./labelAlign-editor.vue": __glob_0_23, "./labelHidden-editor.vue": __glob_0_24, "./labelIconClass-editor.vue": __glob_0_25, "./labelIconPosition-editor.vue": __glob_0_26, "./labelTooltip-editor.vue": __glob_0_27, "./labelWidth-editor.vue": __glob_0_28, "./labelWrap-editor.vue": __glob_0_29, "./limit-editor.vue": __glob_0_30, "./max-editor.vue": __glob_0_31, "./maxLength-editor.vue": __glob_0_32, "./min-editor.vue": __glob_0_33, "./minLength-editor.vue": __glob_0_34, "./multiple-editor.vue": __glob_0_35, "./multipleLimit-editor.vue": __glob_0_36, "./multipleSelect-editor.vue": __glob_0_37, "./name-editor.vue": __glob_0_38, "./optionItems-editor.vue": __glob_0_39, "./placeholder-editor.vue": __glob_0_40, "./precision-editor.vue": __glob_0_41, "./prefixIcon-editor.vue": __glob_0_42, "./readonly-editor.vue": __glob_0_43, "./remote-editor.vue": __glob_0_44, "./required-editor.vue": __glob_0_45, "./requiredHint-editor.vue": __glob_0_46, "./rows-editor.vue": __glob_0_47, "./showFileList-editor.vue": __glob_0_48, "./showPassword-editor.vue": __glob_0_49, "./showWordLimit-editor.vue": __glob_0_50, "./size-editor.vue": __glob_0_51, "./startPlaceholder-editor.vue": __glob_0_52, "./step-editor.vue": __glob_0_53, "./suffixIcon-editor.vue": __glob_0_54, "./textAlign-editor.vue": __glob_0_55, "./type-editor.vue": __glob_0_56, "./uploadTip-editor.vue": __glob_0_57, "./uploadURL-editor.vue": __glob_0_58, "./validation-editor.vue": __glob_0_59, "./validationHint-editor.vue": __glob_0_60, "./withCredentials-editor.vue": __glob_0_61, "./container-button-group/button-group-customClass-editor.vue": __glob_0_62, "./container-button-group/button-group-size-editor.vue": __glob_0_63, "./container-data-table/data-table-customClass-editor.vue": __glob_0_64, "./container-grid/colHeight-editor.vue": __glob_0_65, "./container-grid/gutter-editor.vue": __glob_0_66, "./container-grid-col/grid-col-offset-editor.vue": __glob_0_67, "./container-grid-col/grid-col-pull-editor.vue": __glob_0_68, "./container-grid-col/grid-col-push-editor.vue": __glob_0_69, "./container-grid-col/grid-col-responsive-editor.vue": __glob_0_70, "./container-grid-col/grid-col-span-editor.vue": __glob_0_71, "./container-grid-sub-form/grid-sub-form-name-editor.vue": __glob_0_72, "./container-object-group/objectName-editor.vue": __glob_0_73, "./container-sub-form/showBlankRow-editor.vue": __glob_0_74, "./container-sub-form/showRowNumber-editor.vue": __glob_0_75, "./container-sub-form/sub-form-labelAlign-editor.vue": __glob_0_76, "./container-sub-form/sub-form-name-editor.vue": __glob_0_77, "./container-tab/tab-customClass-editor.vue": __glob_0_78, "./container-tab/tabPosition-editor.vue": __glob_0_79, "./container-tab/tabType-editor.vue": __glob_0_80, "./container-table-cell/cellHeight-editor.vue": __glob_0_81, "./container-table-cell/cellWidth-editor.vue": __glob_0_82, "./container-table-cell/wordBreak-editor.vue": __glob_0_83, "./container-tree/checkStrictly-editor.vue": __glob_0_84, "./container-tree/show-checkbox-editor.vue": __glob_0_85, "./container-tree/show-filter-editor.vue": __glob_0_86, "./container-tree/tree-customClass-editor.vue": __glob_0_87, "./container-tree/tree-defaultExpandAllNode-editor.vue": __glob_0_88, "./container-tree/tree-draggable-editor.vue": __glob_0_89, "./container-tree/tree-expandOnClickNode-editor.vue": __glob_0_90, "./container-tree/tree-expandRetractAllNode-editor.vue": __glob_0_91, "./container-tree/tree-lazy-editor.vue": __glob_0_92, "./container-tree/tree-nodeEdit-editor.vue": __glob_0_93, "./container-tree/tree-selectClearAllNode-editor.vue": __glob_0_94, "./container-tree/treeData-editor.vue": __glob_0_95, "./container-vf-dialog/cancelButtonHidden-editor.vue": __glob_0_96, "./container-vf-dialog/cancelButtonLabel-editor.vue": __glob_0_97, "./container-vf-dialog/center-editor.vue": __glob_0_98, "./container-vf-dialog/closeOnClickModal-editor.vue": __glob_0_99, "./container-vf-dialog/closeOnPressEscape-editor.vue": __glob_0_100, "./container-vf-dialog/disabledMode-editor.vue": __glob_0_101, "./container-vf-dialog/fullscreen-editor.vue": __glob_0_102, "./container-vf-dialog/okButtonHidden-editor.vue": __glob_0_103, "./container-vf-dialog/okButtonLabel-editor.vue": __glob_0_104, "./container-vf-dialog/readMode-editor.vue": __glob_0_105, "./container-vf-dialog/showClose-editor.vue": __glob_0_106, "./container-vf-dialog/showModal-editor.vue": __glob_0_107, "./container-vf-dialog/title-editor.vue": __glob_0_108, "./container-vf-dialog/width-editor.vue": __glob_0_109, "./container-vf-drawer/vf-drawer-direction-editor.vue": __glob_0_110, "./container-vf-drawer/vf-drawer-size-editor.vue": __glob_0_111, "./event-handler/onAppendButtonClick-editor.vue": __glob_0_112, "./event-handler/onBeforeUpload-editor.vue": __glob_0_113, "./event-handler/onBlur-editor.vue": __glob_0_114, "./event-handler/onButtonGroupClick-editor.vue": __glob_0_115, "./event-handler/onCancelButtonClick-editor.vue": __glob_0_116, "./event-handler/onCellClick-editor.vue": __glob_0_117, "./event-handler/onCellDoubleClick-editor.vue": __glob_0_118, "./event-handler/onChange-editor.vue": __glob_0_119, "./event-handler/onCheckChange-editor.vue": __glob_0_120, "./event-handler/onClick-editor.vue": __glob_0_121, "./event-handler/onCreated-editor.vue": __glob_0_122, "./event-handler/onCurrentPageChange-editor.vue": __glob_0_123, "./event-handler/onDialogBeforeClose-editor.vue": __glob_0_124, "./event-handler/onDialogOpened-editor.vue": __glob_0_125, "./event-handler/onDisableOperationButton-editor.vue": __glob_0_126, "./event-handler/onDrawerBeforeClose-editor.vue": __glob_0_127, "./event-handler/onDrawerOpened-editor.vue": __glob_0_128, "./event-handler/onFileRemove.vue": __glob_0_129, "./event-handler/onFocus-editor.vue": __glob_0_130, "./event-handler/onGetOperationButtonLabel-editor.vue": __glob_0_131, "./event-handler/onGetRowClassName-editor.vue": __glob_0_132, "./event-handler/onGetSpanMethod-editor.vue": __glob_0_133, "./event-handler/onHeaderClick-editor.vue": __glob_0_134, "./event-handler/onHideOperationButton-editor.vue": __glob_0_135, "./event-handler/onInput-editor.vue": __glob_0_136, "./event-handler/onMounted-editor.vue": __glob_0_137, "./event-handler/onNodeCheck-editor.vue": __glob_0_138, "./event-handler/onNodeClick-editor.vue": __glob_0_139, "./event-handler/onNodeContextmenu-editor.vue": __glob_0_140, "./event-handler/onOkButtonClick-editor.vue": __glob_0_141, "./event-handler/onOperationButtonClick-editor.vue": __glob_0_142, "./event-handler/onPageSizeChange-editor.vue": __glob_0_143, "./event-handler/onRemoteQuery-editor.vue": __glob_0_144, "./event-handler/onRowClick-editor.vue": __glob_0_145, "./event-handler/onRowDoubleClick-editor.vue": __glob_0_146, "./event-handler/onSelectionChange-editor.vue": __glob_0_147, "./event-handler/onSortChange-editor.vue": __glob_0_148, "./event-handler/onSubFormRowAdd-editor.vue": __glob_0_149, "./event-handler/onSubFormRowChange-editor.vue": __glob_0_150, "./event-handler/onSubFormRowDelete-editor.vue": __glob_0_151, "./event-handler/onSubFormRowInsert-editor.vue": __glob_0_152, "./event-handler/onTabClick-editor.vue": __glob_0_153, "./event-handler/onUploadError-editor.vue": __glob_0_154, "./event-handler/onUploadSuccess-editor.vue": __glob_0_155, "./event-handler/onValidate-editor.vue": __glob_0_156, "./field-button/button-type-editor.vue": __glob_0_157, "./field-button/circle-editor.vue": __glob_0_158, "./field-button/icon-editor.vue": __glob_0_159, "./field-button/plain-editor.vue": __glob_0_160, "./field-button/round-editor.vue": __glob_0_161, "./field-cascader/cascader-defaultValue-editor.vue": __glob_0_162, "./field-cascader/cascader-multiple-editor.vue": __glob_0_163, "./field-cascader/checkStrictly-editor.vue": __glob_0_164, "./field-cascader/showAllLevels-editor.vue": __glob_0_165, "./field-checkbox/checkbox-defaultValue-editor.vue": __glob_0_166, "./field-color/color-defaultValue-editor.vue": __glob_0_167, "./field-common/keyName-editor.vue": __glob_0_168, "./field-common/keyNameEnabled-editor.vue": __glob_0_169, "./field-date/date-defaultValue-editor.vue": __glob_0_170, "./field-date/date-format-editor.vue": __glob_0_171, "./field-date/date-type-editor.vue": __glob_0_172, "./field-date/date-valueFormat-editor.vue": __glob_0_173, "./field-date-range/date-range-defaultValue-editor.vue": __glob_0_174, "./field-date-range/date-range-format-editor.vue": __glob_0_175, "./field-date-range/date-range-type-editor.vue": __glob_0_176, "./field-date-range/date-range-valueFormat-editor.vue": __glob_0_177, "./field-divider/contentPosition-editor.vue": __glob_0_178, "./field-divider/divider-direction-editor.vue": __glob_0_179, "./field-file-upload/file-upload-fileTypes-editor.vue": __glob_0_180, "./field-html-text/htmlContent-editor.vue": __glob_0_181, "./field-number/controls-editor.vue": __glob_0_182, "./field-number/controlsPosition-editor.vue": __glob_0_183, "./field-number/number-defaultValue-editor.vue": __glob_0_184, "./field-picture-upload/picture-upload-fileTypes-editor.vue": __glob_0_185, "./field-radio/radio-defaultValue-editor.vue": __glob_0_186, "./field-rate/allowHalf-editor.vue": __glob_0_187, "./field-rate/highThreshold-editor.vue": __glob_0_188, "./field-rate/lowThreshold-editor.vue": __glob_0_189, "./field-rate/rate-defaultValue-editor.vue": __glob_0_190, "./field-rate/rate-max-editor.vue": __glob_0_191, "./field-rate/showScore-editor.vue": __glob_0_192, "./field-rate/showText-editor.vue": __glob_0_193, "./field-rich-editor/rich-editor-contentHeight-editor.vue": __glob_0_194, "./field-select/collapseTags-editor.vue": __glob_0_195, "./field-select/select-defaultValue-editor.vue": __glob_0_196, "./field-slider/range-editor.vue": __glob_0_197, "./field-slider/showStops-editor.vue": __glob_0_198, "./field-slider/vertical-editor.vue": __glob_0_199, "./field-static-text/fontSize-editor.vue": __glob_0_200, "./field-static-text/preWrap-editor.vue": __glob_0_201, "./field-static-text/textContent-editor.vue": __glob_0_202, "./field-switch/activeColor-editor.vue": __glob_0_203, "./field-switch/activeText-editor.vue": __glob_0_204, "./field-switch/inactiveColor-editor.vue": __glob_0_205, "./field-switch/inactiveText-editor.vue": __glob_0_206, "./field-switch/switch-defaultValue-editor.vue": __glob_0_207, "./field-switch/switchWidth-editor.vue": __glob_0_208, "./field-textarea/autosize-editor.vue": __glob_0_209, "./field-time/time-defaultValue-editor.vue": __glob_0_210, "./field-time/time-format-editor.vue": __glob_0_211, "./field-time-range/time-range-defaultValue-editor.vue": __glob_0_212, "./field-time-range/time-range-format-editor.vue": __glob_0_213 };
  for (const path in modules$1) {
    let cname = modules$1[path].default.name;
    comps[cname] = modules$1[path].default;
  }
  var formSetting_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$m = {
    name: "form-setting",
    mixins: [i18n$1],
    components: {
      CodeEditor
    },
    props: {
      designer: Object,
      formConfig: Object
    },
    inject: ["getDesignerConfig"],
    data() {
      return {
        designerConfig: this.getDesignerConfig(),
        formActiveCollapseNames: ["1", "2"],
        formSizes: [
          { label: "default", value: "" },
          { label: "large", value: "large" },
          { label: "small", value: "small" }
        ],
        showEditFormCssDialogFlag: false,
        formCssCode: "",
        cssClassList: [],
        showEditFunctionsDialogFlag: false,
        functionsCode: "",
        showFormEventDialogFlag: false,
        formEventHandlerCode: "",
        curEventName: "",
        eventParamsMap: {
          "onFormCreated": "onFormCreated() {",
          "onFormMounted": "onFormMounted() {",
          "onFormDataChange": "onFormDataChange(fieldName, newValue, oldValue, formModel, subFormName, subFormRowIndex,formThis) {",
          "onFormValidate": "onFormValidate(formModel) {"
        }
      };
    },
    created() {
      this.designer.handleEvent("form-json-imported", () => {
        this.formCssCode = this.formConfig.cssCode;
        insertCustomCssToHead(this.formCssCode);
        this.extractCssClass();
        this.designer.emitEvent("form-css-updated", deepClone(this.cssClassList));
      });
    },
    mounted() {
      setTimeout(() => {
        this.formCssCode = this.formConfig.cssCode;
        insertCustomCssToHead(this.formCssCode);
        this.extractCssClass();
        this.designer.emitEvent("form-css-updated", deepClone(this.cssClassList));
      }, 1200);
    },
    methods: {
      getFormEventHandled(eventName) {
        return !!this.formConfig[eventName] && this.formConfig[eventName].length > 0;
      },
      showEventCollapse() {
        if (this.designerConfig["eventCollapse"] === void 0) {
          return true;
        }
        return !!this.designerConfig["eventCollapse"];
      },
      editFormCss() {
        this.formCssCode = this.designer.formConfig.cssCode;
        this.showEditFormCssDialogFlag = true;
      },
      extractCssClass() {
        let regExp = /\..*{/g;
        let result = this.formCssCode.match(regExp);
        let cssNameArray = [];
        if (!!result && result.length > 0) {
          result.forEach((rItem) => {
            let classArray = rItem.split(",");
            if (classArray.length > 0) {
              classArray.forEach((cItem) => {
                let caItem = cItem.trim();
                if (caItem.indexOf(".", 1) !== -1) {
                  let newClass = caItem.substring(caItem.indexOf(".") + 1, caItem.indexOf(".", 1));
                  if (!!newClass) {
                    cssNameArray.push(newClass.trim());
                  }
                } else if (caItem.indexOf(" ") !== -1) {
                  let newClass = caItem.substring(caItem.indexOf(".") + 1, caItem.indexOf(" "));
                  if (!!newClass) {
                    cssNameArray.push(newClass.trim());
                  }
                } else {
                  if (caItem.indexOf("{") !== -1) {
                    let newClass = caItem.substring(caItem.indexOf(".") + 1, caItem.indexOf("{"));
                    cssNameArray.push(newClass.trim());
                  } else {
                    let newClass = caItem.substring(caItem.indexOf(".") + 1);
                    cssNameArray.push(newClass.trim());
                  }
                }
              });
            }
          });
        }
        this.cssClassList.splice(0, this.cssClassList.length);
        this.cssClassList = Array.from(new Set(cssNameArray));
      },
      saveFormCss() {
        this.extractCssClass();
        this.designer.formConfig.cssCode = this.formCssCode;
        insertCustomCssToHead(this.formCssCode);
        this.showEditFormCssDialogFlag = false;
        this.designer.emitEvent("form-css-updated", deepClone(this.cssClassList));
      },
      editGlobalFunctions() {
        this.functionsCode = this.designer.formConfig.functions;
        this.showEditFunctionsDialogFlag = true;
      },
      saveGlobalFunctions() {
        const codeHints = this.$refs.gfEditor.getEditorAnnotations();
        let syntaxErrorFlag = false;
        if (!!codeHints && codeHints.length > 0) {
          codeHints.forEach((chItem) => {
            if (chItem.type === "error") {
              syntaxErrorFlag = true;
            }
          });
          if (syntaxErrorFlag) {
            this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
            return;
          }
        }
        this.designer.formConfig.functions = this.functionsCode;
        insertGlobalFunctionsToHtml(this.functionsCode);
        this.showEditFunctionsDialogFlag = false;
      },
      editFormEventHandler(eventName) {
        this.curEventName = eventName;
        this.formEventHandlerCode = this.escape2Html(this.formConfig[eventName]);
        this.showFormEventDialogFlag = true;
      },
      escape2Html(str) {
        if (str) {
          var arrEntities = { "lt": "<", "gt": ">", "nbsp": " ", "amp": "&", "quot": '"' };
          return str.replace(/&(lt|gt|nbsp|amp|quot);/ig, function(all, t2) {
            return arrEntities[t2];
          });
        } else {
          return str;
        }
      },
      html2escape(sHtml) {
        return sHtml.replace(/[<>&"]/g, function(c) {
          return { "<": "&lt;", ">": "&gt;", "&": "&amp;", '"': "&quot;" }[c];
        });
      },
      saveFormEventHandler() {
        const codeHints = this.$refs.ecEditor.getEditorAnnotations();
        let syntaxErrorFlag = false;
        if (!!codeHints && codeHints.length > 0) {
          codeHints.forEach((chItem) => {
            if (chItem.type === "error") {
              syntaxErrorFlag = true;
            }
          });
          if (syntaxErrorFlag) {
            this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
            return;
          }
        }
        this.formConfig[this.curEventName] = this.html2escape(this.formEventHandlerCode);
        this.showFormEventDialogFlag = false;
      }
    }
  };
  const _hoisted_1$g = {
    key: 0,
    class: ""
  };
  const _hoisted_2$8 = { class: "dialog-footer" };
  const _hoisted_3$6 = {
    key: 1,
    class: ""
  };
  const _hoisted_4$6 = { class: "dialog-footer" };
  const _hoisted_5$5 = {
    key: 2,
    class: ""
  };
  const _hoisted_6$5 = { class: "dialog-footer" };
  function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_input_number = require$$0$1.resolveComponent("el-input-number");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_divider = require$$0$1.resolveComponent("el-divider");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_collapse_item = require$$0$1.resolveComponent("el-collapse-item");
    const _component_el_collapse = require$$0$1.resolveComponent("el-collapse");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", null, [
      require$$0$1.createVNode(_component_el_form, {
        model: $props.formConfig,
        size: "small",
        "label-position": "left",
        "label-width": "120px",
        class: "setting-form",
        onSubmit: _cache[13] || (_cache[13] = require$$0$1.withModifiers(() => {
        }, ["prevent"]))
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_collapse, {
            modelValue: $data.formActiveCollapseNames,
            "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.formActiveCollapseNames = $event),
            class: "setting-collapse"
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_collapse_item, {
                name: "1",
                title: _ctx.i18nt("designer.setting.basicSetting")
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.formSize")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_select, {
                        modelValue: $props.formConfig.size,
                        "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $props.formConfig.size = $event)
                      }, {
                        default: require$$0$1.withCtx(() => [
                          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.formSizes, (item) => {
                            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                              key: item.value,
                              label: item.label,
                              value: item.value
                            }, null, 8, ["label", "value"]);
                          }), 128))
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.labelPosition")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_radio_group, {
                        modelValue: $props.formConfig.labelPosition,
                        "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $props.formConfig.labelPosition = $event),
                        class: "radio-group-custom"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_radio_button, { label: "left" }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftPosition")), 1)
                            ]),
                            _: 1
                          }),
                          require$$0$1.createVNode(_component_el_radio_button, { label: "top" }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.topPosition")), 1)
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.labelAlign")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_radio_group, {
                        modelValue: $props.formConfig.labelAlign,
                        "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $props.formConfig.labelAlign = $event),
                        class: "radio-group-custom"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_radio_button, { label: "label-left-align" }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.leftAlign")), 1)
                            ]),
                            _: 1
                          }),
                          require$$0$1.createVNode(_component_el_radio_button, { label: "label-center-align" }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.centerAlign")), 1)
                            ]),
                            _: 1
                          }),
                          require$$0$1.createVNode(_component_el_radio_button, { label: "label-right-align" }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.rightAlign")), 1)
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.labelWidth")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_input_number, {
                        modelValue: $props.formConfig.labelWidth,
                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $props.formConfig.labelWidth = $event),
                        min: 0,
                        style: { "width": "100%" }
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.formCss")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        onClick: $options.editFormCss
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addCss")), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.customClass")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_select, {
                        modelValue: $props.formConfig.customClass,
                        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $props.formConfig.customClass = $event),
                        multiple: "",
                        filterable: "",
                        "allow-create": "",
                        "default-first-option": ""
                      }, {
                        default: require$$0$1.withCtx(() => [
                          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.cssClassList, (item, idx) => {
                            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_option, {
                              key: idx,
                              label: item,
                              value: item
                            }, null, 8, ["label", "value"]);
                          }), 128))
                        ]),
                        _: 1
                      }, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.globalFunctions")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        onClick: $options.editGlobalFunctions
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
                        ]),
                        _: 1
                      }, 8, ["onClick"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, { "label-width": "0" }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_divider, { class: "custom-divider" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.formSFCSetting")), 1)
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.formModelName")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_input, {
                        type: "text",
                        modelValue: $props.formConfig.modelName,
                        "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $props.formConfig.modelName = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.formRefName")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_input, {
                        type: "text",
                        modelValue: $props.formConfig.refName,
                        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $props.formConfig.refName = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: _ctx.i18nt("designer.setting.formRulesName")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_input, {
                        type: "text",
                        modelValue: $props.formConfig.rulesName,
                        "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $props.formConfig.rulesName = $event)
                      }, null, 8, ["modelValue"])
                    ]),
                    _: 1
                  }, 8, ["label"])
                ]),
                _: 1
              }, 8, ["title"]),
              $options.showEventCollapse() ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                key: 0,
                name: "2",
                title: _ctx.i18nt("designer.setting.eventSetting")
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: "onFormCreated",
                    "label-width": "150px"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        class: require$$0$1.normalizeClass([$options.getFormEventHandled("onFormCreated") ? "button-text-highlight" : ""]),
                        onClick: _cache[8] || (_cache[8] = ($event) => $options.editFormEventHandler("onFormCreated"))
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
                        ]),
                        _: 1
                      }, 8, ["class"])
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: "onFormMounted",
                    "label-width": "150px"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        class: require$$0$1.normalizeClass([$options.getFormEventHandled("onFormMounted") ? "button-text-highlight" : ""]),
                        onClick: _cache[9] || (_cache[9] = ($event) => $options.editFormEventHandler("onFormMounted"))
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
                        ]),
                        _: 1
                      }, 8, ["class"])
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: "onFormDataChange",
                    "label-width": "150px"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        class: require$$0$1.normalizeClass([$options.getFormEventHandled("onFormDataChange") ? "button-text-highlight" : ""]),
                        onClick: _cache[10] || (_cache[10] = ($event) => $options.editFormEventHandler("onFormDataChange"))
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
                        ]),
                        _: 1
                      }, 8, ["class"])
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_form_item, {
                    label: "onFormValidate",
                    "label-width": "150px"
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_button, {
                        type: "info",
                        icon: "el-icon-edit",
                        plain: "",
                        round: "",
                        class: require$$0$1.normalizeClass([$options.getFormEventHandled("onFormValidate") ? "button-text-highlight" : ""]),
                        onClick: _cache[11] || (_cache[11] = ($event) => $options.editFormEventHandler("onFormValidate"))
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addEventHandler")), 1)
                        ]),
                        _: 1
                      }, 8, ["class"])
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["title"])) : require$$0$1.createCommentVNode("", true)
            ]),
            _: 1
          }, 8, ["modelValue"])
        ]),
        _: 1
      }, 8, ["model"]),
      $data.showFormEventDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$g, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.editFormEventHandler"),
          modelValue: $data.showFormEventDialogFlag,
          "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.showFormEventDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_2$8, [
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[15] || (_cache[15] = ($event) => $data.showFormEventDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.saveFormEventHandler
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: "form." + $data.eventParamsMap[$data.curEventName]
            }, null, 8, ["title"]),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "javascript",
              readonly: false,
              modelValue: $data.formEventHandlerCode,
              "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.formEventHandlerCode = $event),
              ref: "ecEditor"
            }, null, 8, ["modelValue"]),
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: "}"
            })
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showEditFormCssDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_3$6, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.formCss"),
          modelValue: $data.showEditFormCssDialogFlag,
          "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.showEditFormCssDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_4$6, [
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[18] || (_cache[18] = ($event) => $data.showEditFormCssDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.saveFormCss
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_code_editor, {
              mode: "css",
              readonly: false,
              modelValue: $data.formCssCode,
              "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.formCssCode = $event)
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showEditFunctionsDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_5$5, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.globalFunctions"),
          modelValue: $data.showEditFunctionsDialogFlag,
          "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => $data.showEditFunctionsDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          footer: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_6$5, [
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[21] || (_cache[21] = ($event) => $data.showEditFunctionsDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.saveGlobalFunctions
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                ]),
                _: 1
              }, 8, ["onClick"])
            ])
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_code_editor, {
              mode: "javascript",
              readonly: false,
              modelValue: $data.functionsCode,
              "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.functionsCode = $event),
              ref: "gfEditor"
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ]);
  }
  var FormSetting = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["render", _sfc_render$m], ["__scopeId", "data-v-755f7770"]]);
  var dataSourceSetting_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$l = {
    name: "data-source-setting",
    mixins: [i18n$1],
    inject: ["getGlobalDsv"],
    components: {
      Platform: ElementPlusIconsVue.Platform,
      CodeEditor
    },
    props: {
      designer: Object,
      formConfig: Object
    },
    data() {
      return {
        activeNames: "2",
        dsModel: {
          dataSourceId: null,
          uniqueName: "",
          requestURL: "",
          requestURLType: "String",
          description: "",
          headers: [],
          params: [],
          data: [],
          requestMethod: "get",
          configHandlerCode: "  return config",
          dataHandlerCode: "  return result.data.data;",
          errorHandlerCode: "  $message.error(error.message);",
          dataSetEnabled: false,
          dataSets: []
        },
        curEditDSIdx: -1,
        formRules: {
          uniqueName: [
            { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
          ],
          requestURL: [
            { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
          ],
          requestMethod: [
            { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
          ]
        },
        nameRules: [
          { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") }
        ],
        valueRules: [
          { required: true, trigger: ["blur", "change"], message: this.i18nt("designer.setting.fieldValueRequired") },
          { validator: this.validateValueInput, trigger: ["blur", "change"] }
        ],
        showDataSourceDialogFlag: false,
        dsvJson: "{\n  \n}",
        dsResultJson: "",
        showTestDataSourceDialogFlag: false,
        showImportDSDialogFlag: false,
        importDSTemplate: "",
        clearOldDSFlag: false,
        showExportDSDialogFlag: false,
        activeExportTab: "setting",
        exportDSArray: [],
        dsExportContent: "",
        dsRawExportContent: ""
      };
    },
    methods: {
      validateValueInput(rule, value2, callback) {
        let ruleField = rule.field;
        let fieldType = ruleField.substring(0, ruleField.indexOf("."));
        let fieldIdx = Number(ruleField.substring(ruleField.indexOf(".") + 1, ruleField.lastIndexOf(".")));
        let valueType = this.dsModel[fieldType][fieldIdx].type;
        if (valueType === "Number") {
          if (isNaN(value2)) {
            callback(new Error(this.i18nt("designer.setting.dsRequestNumberTypeError")));
          } else {
            callback();
          }
        } else if (valueType === "Boolean") {
          if (value2.toLowerCase() === "true" || value2.toLowerCase() === "false" || value2.toLowerCase() === "null" || value2 === "1" || value2 === "0") {
            callback();
          } else {
            callback(new Error(this.i18nt("designer.setting.dsRequestBooleanTypeError")));
          }
        } else {
          callback();
        }
      },
      addDataSource() {
        this.curEditDSIdx = -1;
        this.dsModel = new Object({});
        this.dsModel.dataSourceId = null;
        this.dsModel.uniqueName = "";
        this.dsModel.requestURL = "";
        this.dsModel.requestURLType = "String";
        this.dsModel.requestMethod = "get";
        this.dsModel.description = "";
        this.dsModel.headers = [];
        this.dsModel.params = [];
        this.dsModel.data = [];
        this.dsModel.configHandlerCode = "  return config";
        this.dsModel.dataHandlerCode = "  return result.data.data;";
        this.dsModel.errorHandlerCode = "  $message.error(error.message);";
        this.dsModel.dataSetEnabled = false;
        this.dsModel.dataSets = [];
        this.showDataSourceDialogFlag = true;
      },
      editDataSource(dsIdx) {
        this.dsModel = deepClone(this.formConfig.dataSources[dsIdx]);
        if (!this.dsModel.hasOwnProperty("dataSets")) {
          this.dsModel.dataSets = [];
        }
        this.curEditDSIdx = dsIdx;
        this.showDataSourceDialogFlag = true;
      },
      saveDataSource() {
        this.$refs["dsForm"].validate((valid, fields) => {
          if (!valid) {
            this.$message.error(this.i18nt("designer.setting.dsValidationError"));
            return;
          }
          this.dsModel.dataSourceId = this.dsModel.dataSourceId || "ds" + generateId();
          let curDSId = this.dsModel.dataSourceId;
          let curDSName = this.dsModel.uniqueName;
          let sameNameFlag = false;
          this.formConfig.dataSources.map((dsItem) => {
            if (dsItem.uniqueName === curDSName && dsItem.dataSourceId !== curDSId) {
              sameNameFlag = true;
            }
          });
          if (sameNameFlag) {
            this.$message.error(this.i18nt("designer.setting.dsDuplicatedNameError"));
            return;
          }
          if (this.curEditDSIdx >= 0) {
            this.formConfig.dataSources.splice(this.curEditDSIdx, 1, this.dsModel);
            this.showDataSourceDialogFlag = false;
          } else {
            this.formConfig.dataSources.push(this.dsModel);
            this.showDataSourceDialogFlag = false;
          }
        });
      },
      deleteDataSource(dsIdx) {
        this.$confirm(this.i18nt("designer.setting.deleteDataSourceHint"), this.i18nt("render.hint.prompt"), {
          confirmButtonText: this.i18nt("render.hint.confirm"),
          cancelButtonText: this.i18nt("render.hint.cancel")
        }).then(() => {
          this.formConfig.dataSources.splice(dsIdx, 1);
        }).catch((error2) => {
        });
      },
      addRequestHeader() {
        this.dsModel.headers.push({
          name: "",
          type: "String",
          value: ""
        });
      },
      deleteRequestHeader(idx) {
        this.dsModel.headers.splice(idx, 1);
      },
      addRequestParam() {
        this.dsModel.params.push({
          name: "",
          type: "String",
          value: ""
        });
      },
      deleteRequestParam(idx) {
        this.dsModel.params.splice(idx, 1);
      },
      addRequestData() {
        this.dsModel.data.push({
          name: "",
          type: "String",
          value: ""
        });
      },
      deleteRequestData(idx) {
        this.dsModel.data.splice(idx, 1);
      },
      testDataSource() {
        let globalDsv = this.getGlobalDsv() || {};
        this.dsvJson = JSON.stringify(globalDsv, null, "  ");
        this.showTestDataSourceDialogFlag = true;
      },
      async doDataSourceRequest() {
        let dsvObj = JSON.parse(this.dsvJson);
        let dsResult = await runDataSourceRequest(this.dsModel, dsvObj, null, true, this.$message);
        this.$refs.dsResultEditor.setValue(JSON.stringify(dsResult, null, "  "));
      },
      clearRequestResult() {
        this.$refs.dsResultEditor.setValue("");
      },
      addDataSet() {
        this.dsModel.dataSets.push({
          name: "",
          remark: ""
        });
      },
      deleteDataSet(idx) {
        this.dsModel.dataSets.splice(idx, 1);
      },
      importDataSource() {
        this.importDSTemplate = "";
        this.showImportDSDialogFlag = true;
      },
      doImportDataSource() {
        try {
          let importDSArray = JSON.parse(this.importDSTemplate);
          if (!!this.clearOldDSFlag) {
            this.formConfig.dataSources.splice(0, this.formConfig.dataSources.length);
          }
          this.formConfig.dataSources = this.formConfig.dataSources.concat(importDSArray);
          this.$message.success(this.i18nt("designer.hint.importJsonSuccess"));
          this.designer.emitHistoryChange();
          this.showImportDSDialogFlag = false;
        } catch (ex) {
          this.$message.error(ex.message);
        }
      },
      exportDataSource() {
        this.dsExportContent = "";
        this.dsRawExportContent = "";
        this.exportDSArray.splice(0, this.exportDSArray.length);
        if (!!this.formConfig.dataSources && this.formConfig.dataSources.length > 0) {
          this.formConfig.dataSources.forEach((ds) => {
            let newDS = deepClone(ds);
            newDS.checked = false;
            this.exportDSArray.push(newDS);
          });
        }
        this.showExportDSDialogFlag = true;
      },
      copyDataSourceJson(e) {
        copyToClipboard(this.dsRawExportContent, e, this.$message, this.i18nt("designer.hint.copyJsonSuccess"), this.i18nt("designer.hint.copyJsonFail"));
      },
      handleExportDSChange(val) {
        let selectedDSArray = [];
        this.exportDSArray.forEach((ds) => {
          if (!!ds.checked) {
            let selectedDs = deepClone(ds);
            delete selectedDs["checked"];
            selectedDSArray.push(selectedDs);
          }
        });
        this.dsExportContent = JSON.stringify(selectedDSArray, null, "  ");
        this.dsRawExportContent = JSON.stringify(selectedDSArray);
      },
      handleExportTabClick() {
        this.$nextTick(() => {
          this.$refs.exportDSEditor.setValue(this.dsExportContent);
        });
      }
    }
  };
  const _hoisted_1$f = { class: "ds-list" };
  const _hoisted_2$7 = ["title"];
  const _hoisted_3$5 = ["title"];
  const _hoisted_4$5 = { class: "ds-button-wrapper" };
  const _hoisted_5$4 = { class: "dialog-footer" };
  const _hoisted_6$4 = {
    key: 0,
    class: ""
  };
  const _hoisted_7$2 = { class: "footer-button" };
  const _hoisted_8$2 = {
    key: 1,
    class: ""
  };
  const _hoisted_9$1 = {
    slot: "footer",
    class: "dialog-footer-center"
  };
  const _hoisted_10$1 = {
    key: 2,
    class: ""
  };
  const _hoisted_11$1 = {
    key: 0,
    class: "export-ds-list"
  };
  const _hoisted_12 = ["title"];
  const _hoisted_13 = ["title"];
  const _hoisted_14 = {
    slot: "footer",
    class: "dialog-footer-center"
  };
  function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_platform = require$$0$1.resolveComponent("platform");
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_el_descriptions_item = require$$0$1.resolveComponent("el-descriptions-item");
    const _component_el_descriptions = require$$0$1.resolveComponent("el-descriptions");
    const _component_el_empty = require$$0$1.resolveComponent("el-empty");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_form_item = require$$0$1.resolveComponent("el-form-item");
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    const _component_el_option = require$$0$1.resolveComponent("el-option");
    const _component_el_select = require$$0$1.resolveComponent("el-select");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_el_radio_button = require$$0$1.resolveComponent("el-radio-button");
    const _component_el_radio_group = require$$0$1.resolveComponent("el-radio-group");
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_el_switch = require$$0$1.resolveComponent("el-switch");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_el_drawer = require$$0$1.resolveComponent("el-drawer");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_el_checkbox = require$$0$1.resolveComponent("el-checkbox");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
      require$$0$1.createElementVNode("div", _hoisted_1$f, [
        !!$props.formConfig.dataSources && $props.formConfig.dataSources.length > 0 ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, require$$0$1.renderList($props.formConfig.dataSources, (ds, dsIdx) => {
          return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_descriptions, {
            column: 1,
            size: "small",
            border: ""
          }, {
            title: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("span", {
                title: ds.description
              }, require$$0$1.toDisplayString(ds.uniqueName), 9, _hoisted_2$7)
            ]),
            extra: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                icon: "el-icon-edit",
                plain: "",
                circle: "",
                size: "small",
                onClick: ($event) => $options.editDataSource(dsIdx)
              }, null, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "danger",
                icon: "el-icon-delete",
                plian: "",
                circle: "",
                size: "small",
                onClick: ($event) => $options.deleteDataSource(dsIdx)
              }, null, 8, ["onClick"])
            ]),
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_descriptions_item, null, {
                label: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("div", {
                    title: ds.requestURL
                  }, [
                    require$$0$1.createVNode(_component_el_icon, null, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_platform)
                      ]),
                      _: 1
                    })
                  ], 8, _hoisted_3$5)
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(ds.requestURL), 1)
                ]),
                _: 2
              }, 1024)
            ]),
            _: 2
          }, 1024);
        }), 256)) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_empty, {
          key: 1,
          description: _ctx.i18nt("designer.setting.noDataSource")
        }, null, 8, ["description"])),
        require$$0$1.createElementVNode("div", _hoisted_4$5, [
          require$$0$1.createVNode(_component_el_button_group, null, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                icon: "el-icon-plus",
                plain: "",
                onClick: $options.addDataSource
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addDataSource")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                icon: "el-icon-bottom-left",
                plain: "",
                title: _ctx.i18nt("designer.setting.importDataSource"),
                onClick: $options.importDataSource
              }, null, 8, ["title", "onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                icon: "el-icon-top-right",
                plain: "",
                title: _ctx.i18nt("designer.setting.exportDataSource"),
                onClick: $options.exportDataSource
              }, null, 8, ["title", "onClick"])
            ]),
            _: 1
          })
        ])
      ]),
      require$$0$1.createVNode(_component_el_drawer, {
        title: _ctx.i18nt("designer.setting.dataSourceSetting"),
        direction: "rtl",
        modelValue: $data.showDataSourceDialogFlag,
        "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => $data.showDataSourceDialogFlag = $event),
        modal: true,
        size: 820,
        "destroy-on-close": true,
        "append-to-body": true,
        "close-on-click-modal": false,
        "close-on-press-escape": false,
        class: "ds-setting-drawer header-small-mb"
      }, {
        default: require$$0$1.withCtx(() => [
          require$$0$1.createVNode(_component_el_form, {
            model: $data.dsModel,
            rules: $data.formRules,
            ref: "dsForm",
            "label-width": "160px",
            "label-position": "left",
            class: "ds-form"
          }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsUniqueName"),
                prop: "uniqueName"
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_input, {
                    modelValue: $data.dsModel.uniqueName,
                    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.dsModel.uniqueName = $event)
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_row, { style: { "width": "100%" } }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_col, { span: 20 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_form_item, {
                        label: _ctx.i18nt("designer.setting.dsRequestURL"),
                        prop: "requestURL"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_input, {
                            modelValue: $data.dsModel.requestURL,
                            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.dsModel.requestURL = $event)
                          }, null, 8, ["modelValue"])
                        ]),
                        _: 1
                      }, 8, ["label"])
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_col, { span: 4 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_form_item, {
                        "label-width": 0,
                        prop: "requestURLType",
                        class: "no-left-margin"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_select, {
                            modelValue: $data.dsModel.requestURLType,
                            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.dsModel.requestURLType = $event),
                            placeholder: _ctx.i18nt("designer.setting.dsRequestURLType")
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createVNode(_component_el_option, {
                                label: _ctx.i18nt("designer.setting.dsURLStringType"),
                                value: "String"
                              }, null, 8, ["label"]),
                              require$$0$1.createVNode(_component_el_option, {
                                label: _ctx.i18nt("designer.setting.dsURLVariableType"),
                                value: "Variable"
                              }, null, 8, ["label"])
                            ]),
                            _: 1
                          }, 8, ["modelValue", "placeholder"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }),
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsDescription"),
                prop: "description"
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_input, {
                    type: "textarea",
                    modelValue: $data.dsModel.description,
                    "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => $data.dsModel.description = $event),
                    rows: 2
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsRequestMethod"),
                prop: "requestMethod"
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_radio_group, {
                    modelValue: $data.dsModel.requestMethod,
                    "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.dsModel.requestMethod = $event)
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_radio_button, { label: "get" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode("get")
                        ]),
                        _: 1
                      }),
                      require$$0$1.createVNode(_component_el_radio_button, { label: "post" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode("post")
                        ]),
                        _: 1
                      }),
                      require$$0$1.createVNode(_component_el_radio_button, { label: "put" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode("put")
                        ]),
                        _: 1
                      }),
                      require$$0$1.createVNode(_component_el_radio_button, { label: "delete" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode("delete")
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }, 8, ["modelValue"])
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsRequestHeaders")
              }, {
                default: require$$0$1.withCtx(() => [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dsModel.headers, (rh, hIdx) => {
                    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
                      class: "rh-row",
                      gutter: 8
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "headers." + hIdx + ".name",
                              rules: $data.nameRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rh.name,
                                  "onUpdate:modelValue": ($event) => rh.name = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestNameInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 5 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "headers." + hIdx + ".type",
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: rh.type,
                                  "onUpdate:modelValue": ($event) => rh.type = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestTypeInputPlaceholder")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueStringType"),
                                      value: "String"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueNumberType"),
                                      value: "Number"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueBooleanType"),
                                      value: "Boolean"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueVariableType"),
                                      value: "Variable"
                                    }, null, 8, ["label"])
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "headers." + hIdx + ".value",
                              rules: $data.valueRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rh.value,
                                  "onUpdate:modelValue": ($event) => rh.value = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestValueInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_button, {
                              icon: "el-icon-delete",
                              plain: "",
                              circle: "",
                              onClick: ($event) => $options.deleteRequestHeader(hIdx)
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      _: 2
                    }, 1024);
                  }), 256)),
                  require$$0$1.createVNode(_component_el_row, null, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_button, {
                            link: "",
                            type: "primary",
                            icon: "el-icon-plus",
                            onClick: $options.addRequestHeader
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addRequestHeader")), 1)
                            ]),
                            _: 1
                          }, 8, ["onClick"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsRequestParams")
              }, {
                default: require$$0$1.withCtx(() => [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dsModel.params, (rp, pIdx) => {
                    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
                      class: "rd-row",
                      gutter: 8
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "params." + pIdx + ".name",
                              rules: $data.nameRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rp.name,
                                  "onUpdate:modelValue": ($event) => rp.name = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestNameInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 5 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "params." + pIdx + ".type",
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: rp.type,
                                  "onUpdate:modelValue": ($event) => rp.type = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestTypeInputPlaceholder")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueStringType"),
                                      value: "String"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueNumberType"),
                                      value: "Number"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueBooleanType"),
                                      value: "Boolean"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueVariableType"),
                                      value: "Variable"
                                    }, null, 8, ["label"])
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "params." + pIdx + ".value",
                              rules: $data.valueRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rp.value,
                                  "onUpdate:modelValue": ($event) => rp.value = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestValueInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_button, {
                              icon: "el-icon-delete",
                              plain: "",
                              circle: "",
                              onClick: ($event) => $options.deleteRequestParam(pIdx)
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      _: 2
                    }, 1024);
                  }), 256)),
                  require$$0$1.createVNode(_component_el_row, null, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_button, {
                            link: "",
                            type: "primary",
                            icon: "el-icon-plus",
                            onClick: $options.addRequestParam
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addRequestParam")), 1)
                            ]),
                            _: 1
                          }, 8, ["onClick"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_form_item, {
                label: _ctx.i18nt("designer.setting.dsRequestData")
              }, {
                default: require$$0$1.withCtx(() => [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dsModel.data, (rd, dIdx) => {
                    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
                      class: "rd-row",
                      gutter: 8
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "data." + dIdx + ".name",
                              rules: $data.nameRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rd.name,
                                  "onUpdate:modelValue": ($event) => rd.name = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestNameInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 5 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "data." + dIdx + ".type",
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_select, {
                                  modelValue: rd.type,
                                  "onUpdate:modelValue": ($event) => rd.type = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestTypeInputPlaceholder")
                                }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueStringType"),
                                      value: "String"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueNumberType"),
                                      value: "Number"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueBooleanType"),
                                      value: "Boolean"
                                    }, null, 8, ["label"]),
                                    require$$0$1.createVNode(_component_el_option, {
                                      label: _ctx.i18nt("designer.setting.dsRequestValueVariableType"),
                                      value: "Variable"
                                    }, null, 8, ["label"])
                                  ]),
                                  _: 2
                                }, 1032, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_form_item, {
                              prop: "data." + dIdx + ".value",
                              rules: $data.valueRules,
                              "label-width": 0
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_input, {
                                  modelValue: rd.value,
                                  "onUpdate:modelValue": ($event) => rd.value = $event,
                                  placeholder: _ctx.i18nt("designer.setting.dsRequestValueInputPlaceholder")
                                }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                              ]),
                              _: 2
                            }, 1032, ["prop", "rules"])
                          ]),
                          _: 2
                        }, 1024),
                        require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_button, {
                              icon: "el-icon-delete",
                              plain: "",
                              circle: "",
                              onClick: ($event) => $options.deleteRequestData(dIdx)
                            }, null, 8, ["onClick"])
                          ]),
                          _: 2
                        }, 1024)
                      ]),
                      _: 2
                    }, 1024);
                  }), 256)),
                  require$$0$1.createVNode(_component_el_row, null, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_button, {
                            link: "",
                            type: "primary",
                            icon: "el-icon-plus",
                            onClick: $options.addRequestData
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addRequestData")), 1)
                            ]),
                            _: 1
                          }, 8, ["onClick"])
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                _: 1
              }, 8, ["label"]),
              require$$0$1.createVNode(_component_el_tabs, {
                modelValue: $data.activeNames,
                "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $data.activeNames = $event),
                type: "border-card"
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_tab_pane, {
                    name: "1",
                    label: _ctx.i18nt("designer.setting.dsConfigHandlerTitle")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "(config, isSandbox, DSV, VFR) => {"
                      }),
                      require$$0$1.createVNode(_component_code_editor, {
                        mode: "javascript",
                        readonly: false,
                        modelValue: $data.dsModel.configHandlerCode,
                        "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.dsModel.configHandlerCode = $event),
                        ref: "chEditor"
                      }, null, 8, ["modelValue"]),
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "}"
                      })
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_tab_pane, {
                    name: "2",
                    label: _ctx.i18nt("designer.setting.dsDataHandlerTitle")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "(result, isSandbox, DSV, VFR) => {"
                      }),
                      require$$0$1.createVNode(_component_code_editor, {
                        mode: "javascript",
                        readonly: false,
                        modelValue: $data.dsModel.dataHandlerCode,
                        "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $data.dsModel.dataHandlerCode = $event),
                        ref: "dhEditor"
                      }, null, 8, ["modelValue"]),
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "}"
                      })
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_tab_pane, {
                    name: "3",
                    label: _ctx.i18nt("designer.setting.dsErrorHandlerTitle")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "(error, isSandbox, DSV, $message, VFR) => {"
                      }),
                      require$$0$1.createVNode(_component_code_editor, {
                        mode: "javascript",
                        readonly: false,
                        modelValue: $data.dsModel.errorHandlerCode,
                        "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.dsModel.errorHandlerCode = $event),
                        ref: "ehEditor"
                      }, null, 8, ["modelValue"]),
                      require$$0$1.createVNode(_component_el_alert, {
                        type: "info",
                        closable: false,
                        title: "}"
                      })
                    ]),
                    _: 1
                  }, 8, ["label"]),
                  require$$0$1.createVNode(_component_el_tab_pane, {
                    name: "4",
                    label: _ctx.i18nt("designer.setting.dataSetSettingTitle")
                  }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_form_item, {
                        label: _ctx.i18nt("designer.setting.dataSetEnabled")
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createVNode(_component_el_switch, {
                            modelValue: $data.dsModel.dataSetEnabled,
                            "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $data.dsModel.dataSetEnabled = $event)
                          }, null, 8, ["modelValue"])
                        ]),
                        _: 1
                      }, 8, ["label"]),
                      $data.dsModel.dataSetEnabled ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form_item, {
                        key: 0,
                        label: _ctx.i18nt("designer.setting.dataSetSetting"),
                        class: "display-block"
                      }, {
                        default: require$$0$1.withCtx(() => [
                          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.dsModel.dataSets, (dSet, dIdx) => {
                            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
                              class: "rd-row",
                              gutter: 8
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createVNode(_component_el_col, { span: 7 }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_form_item, {
                                      prop: "dataSets." + dIdx + ".name",
                                      rules: $data.nameRules,
                                      "label-width": "0"
                                    }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createVNode(_component_el_input, {
                                          modelValue: dSet.name,
                                          "onUpdate:modelValue": ($event) => dSet.name = $event,
                                          placeholder: _ctx.i18nt("designer.setting.dsRequestNameInputPlaceholder")
                                        }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                                      ]),
                                      _: 2
                                    }, 1032, ["prop", "rules"])
                                  ]),
                                  _: 2
                                }, 1024),
                                require$$0$1.createVNode(_component_el_col, { span: 8 }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_form_item, {
                                      prop: "dataSets." + dIdx + ".remark",
                                      "label-width": "0"
                                    }, {
                                      default: require$$0$1.withCtx(() => [
                                        require$$0$1.createVNode(_component_el_input, {
                                          modelValue: dSet.remark,
                                          "onUpdate:modelValue": ($event) => dSet.remark = $event,
                                          placeholder: _ctx.i18nt("designer.setting.dataSetRemarkInputPlaceholder")
                                        }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
                                      ]),
                                      _: 2
                                    }, 1032, ["prop"])
                                  ]),
                                  _: 2
                                }, 1024),
                                require$$0$1.createVNode(_component_el_col, { span: 3 }, {
                                  default: require$$0$1.withCtx(() => [
                                    require$$0$1.createVNode(_component_el_button, {
                                      icon: "el-icon-delete",
                                      plain: "",
                                      circle: "",
                                      onClick: ($event) => $options.deleteDataSet(dIdx)
                                    }, null, 8, ["onClick"])
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024);
                          }), 256)),
                          require$$0$1.createVNode(_component_el_row, {
                            class: "rd-row",
                            gutter: 8
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createVNode(_component_el_col, { span: 6 }, {
                                default: require$$0$1.withCtx(() => [
                                  require$$0$1.createVNode(_component_el_button, {
                                    link: "",
                                    type: "primary",
                                    icon: "el-icon-plus",
                                    onClick: $options.addDataSet
                                  }, {
                                    default: require$$0$1.withCtx(() => [
                                      require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.addDataSet")), 1)
                                    ]),
                                    _: 1
                                  }, 8, ["onClick"])
                                ]),
                                _: 1
                              })
                            ]),
                            _: 1
                          })
                        ]),
                        _: 1
                      }, 8, ["label"])) : require$$0$1.createCommentVNode("", true)
                    ]),
                    _: 1
                  }, 8, ["label"])
                ]),
                _: 1
              }, 8, ["modelValue"])
            ]),
            _: 1
          }, 8, ["model", "rules"])
        ]),
        footer: require$$0$1.withCtx(() => [
          require$$0$1.createElementVNode("div", _hoisted_5$4, [
            require$$0$1.createVNode(_component_el_button, {
              style: { "float": "left" },
              type: "primary",
              plain: "",
              onClick: $options.testDataSource
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.testDataSource")), 1)
              ]),
              _: 1
            }, 8, ["onClick"]),
            require$$0$1.createVNode(_component_el_button, {
              onClick: _cache[10] || (_cache[10] = ($event) => $data.showDataSourceDialogFlag = false)
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
              ]),
              _: 1
            }),
            require$$0$1.createVNode(_component_el_button, {
              type: "primary",
              onClick: $options.saveDataSource
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
              ]),
              _: 1
            }, 8, ["onClick"])
          ])
        ]),
        _: 1
      }, 8, ["title", "modelValue"]),
      $data.showTestDataSourceDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_6$4, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.testDataSource"),
          modelValue: $data.showTestDataSourceDialogFlag,
          "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => $data.showTestDataSourceDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: _ctx.i18nt("designer.setting.dsvTitle")
            }, null, 8, ["title"]),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: false,
              modelValue: $data.dsvJson,
              "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => $data.dsvJson = $event),
              class: "dsv-json-editor"
            }, null, 8, ["modelValue"]),
            require$$0$1.createElementVNode("div", _hoisted_7$2, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.doDataSourceRequest
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.executeDataSource")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                plain: "",
                onClick: $options.clearRequestResult
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.clearRequestResult")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[13] || (_cache[13] = ($event) => $data.showTestDataSourceDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ]),
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              closable: false,
              title: _ctx.i18nt("designer.setting.dsRequestResult")
            }, null, 8, ["title"]),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: true,
              modelValue: $data.dsResultJson,
              "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $data.dsResultJson = $event),
              ref: "dsResultEditor"
            }, null, 8, ["modelValue"])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showImportDSDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_8$2, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.importDataSource"),
          modelValue: $data.showImportDSDialogFlag,
          "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => $data.showImportDSDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          center: "",
          "append-to-body": "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_alert, {
              type: "info",
              title: _ctx.i18nt("designer.hint.importDSHint"),
              "show-icon": "",
              class: "alert-padding"
            }, null, 8, ["title"]),
            require$$0$1.createVNode(_component_code_editor, {
              mode: "json",
              readonly: false,
              modelValue: $data.importDSTemplate,
              "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => $data.importDSTemplate = $event)
            }, null, 8, ["modelValue"]),
            require$$0$1.createVNode(_component_el_switch, {
              modelValue: $data.clearOldDSFlag,
              "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => $data.clearOldDSFlag = $event),
              style: { "margin-top": "10px" },
              "active-text": _ctx.i18nt("designer.setting.clearExistingDataSource"),
              "inactive-text": _ctx.i18nt("designer.setting.remainExistingDataSource")
            }, null, 8, ["modelValue", "active-text", "inactive-text"]),
            require$$0$1.createElementVNode("div", _hoisted_9$1, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                onClick: $options.doImportDataSource
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.import")), 1)
                ]),
                _: 1
              }, 8, ["onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                onClick: _cache[18] || (_cache[18] = ($event) => $data.showImportDSDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true),
      $data.showExportDSDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_10$1, [
        require$$0$1.createVNode(_component_el_dialog, {
          title: _ctx.i18nt("designer.setting.exportDataSource"),
          modelValue: $data.showExportDSDialogFlag,
          "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => $data.showExportDSDialogFlag = $event),
          "show-close": true,
          class: "drag-dialog small-padding-dialog",
          center: "",
          "close-on-click-modal": false,
          "close-on-press-escape": false,
          "destroy-on-close": true
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_tabs, {
              type: "border-card",
              class: "no-box-shadow no-padding",
              modelValue: $data.activeExportTab,
              "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => $data.activeExportTab = $event),
              onTabClick: $options.handleExportTabClick
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: _ctx.i18nt("designer.setting.selectDataSourceForExport"),
                  name: "setting"
                }, {
                  default: require$$0$1.withCtx(() => [
                    $data.exportDSArray && $data.exportDSArray.length > 0 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_11$1, [
                      (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.exportDSArray, (ds, dsIdx) => {
                        return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_descriptions, {
                          key: dsIdx,
                          column: 1,
                          size: "small",
                          border: ""
                        }, {
                          title: require$$0$1.withCtx(() => [
                            require$$0$1.createElementVNode("span", {
                              title: ds.description
                            }, require$$0$1.toDisplayString(ds.uniqueName), 9, _hoisted_12)
                          ]),
                          extra: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_checkbox, {
                              modelValue: ds.checked,
                              "onUpdate:modelValue": ($event) => ds.checked = $event,
                              onChange: $options.handleExportDSChange
                            }, {
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.dataSourceChecked")), 1)
                              ]),
                              _: 2
                            }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])
                          ]),
                          default: require$$0$1.withCtx(() => [
                            require$$0$1.createVNode(_component_el_descriptions_item, null, {
                              label: require$$0$1.withCtx(() => [
                                require$$0$1.createElementVNode("div", {
                                  title: ds.requestURL
                                }, [
                                  require$$0$1.createVNode(_component_el_icon, null, {
                                    default: require$$0$1.withCtx(() => [
                                      require$$0$1.createVNode(_component_platform)
                                    ]),
                                    _: 1
                                  })
                                ], 8, _hoisted_13)
                              ]),
                              default: require$$0$1.withCtx(() => [
                                require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString(ds.requestURL), 1)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          _: 2
                        }, 1024);
                      }), 128))
                    ])) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_empty, {
                      key: 1,
                      description: _ctx.i18nt("designer.setting.noDataSource")
                    }, null, 8, ["description"]))
                  ]),
                  _: 1
                }, 8, ["label"]),
                require$$0$1.createVNode(_component_el_tab_pane, {
                  label: _ctx.i18nt("designer.setting.previewDataSourceExportResult"),
                  name: "result"
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_code_editor, {
                      mode: "json",
                      readonly: true,
                      modelValue: $data.dsExportContent,
                      "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => $data.dsExportContent = $event),
                      ref: "exportDSEditor"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                }, 8, ["label"])
              ]),
              _: 1
            }, 8, ["modelValue", "onTabClick"]),
            require$$0$1.createElementVNode("div", _hoisted_14, [
              require$$0$1.createVNode(_component_el_button, {
                type: "primary",
                class: "copy-json-btn",
                "data-clipboard-text": $data.dsRawExportContent,
                onClick: $options.copyDataSourceJson
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.copyJson")), 1)
                ]),
                _: 1
              }, 8, ["data-clipboard-text", "onClick"]),
              require$$0$1.createVNode(_component_el_button, {
                type: "",
                onClick: _cache[22] || (_cache[22] = ($event) => $data.showExportDSDialogFlag = false)
              }, {
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.closePreview")), 1)
                ]),
                _: 1
              })
            ])
          ]),
          _: 1
        }, 8, ["title", "modelValue"])
      ])), [
        [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
      ]) : require$$0$1.createCommentVNode("", true)
    ], 64);
  }
  var DataSourceSetting = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["render", _sfc_render$l], ["__scopeId", "data-v-212ec5b6"]]);
  const COMMON_PROPERTIES$1 = {
    "name": "name-editor",
    "keyNameEnabled": "keyNameEnabled-editor",
    "keyName": "keyName-editor",
    "objectName": "objectName-editor",
    "label": "label-editor",
    "labelAlign": "labelAlign-editor",
    "type": "type-editor",
    "defaultValue": "defaultValue-editor",
    "placeholder": "placeholder-editor",
    "startPlaceholder": "startPlaceholder-editor",
    "endPlaceholder": "endPlaceholder-editor",
    "columnWidth": "columnWidth-editor",
    "autoFullWidth": "autoFullWidth-editor",
    "size": "size-editor",
    "controls": "controls-editor",
    "controlsPosition": "controlsPosition-editor",
    "showStops": "showStops-editor",
    "displayStyle": "displayStyle-editor",
    "buttonStyle": "buttonStyle-editor",
    "border": "border-editor",
    "labelWidth": "labelWidth-editor",
    "labelHidden": "labelHidden-editor",
    "labelWrap": "labelWrap-editor",
    "rows": "rows-editor",
    "autosize": "autosize-editor",
    "required": "required-editor",
    "requiredHint": "requiredHint-editor",
    "validation": "validation-editor",
    "validationHint": "validationHint-editor",
    "readonly": "readonly-editor",
    "disabled": "disabled-editor",
    "hidden": "hidden-editor",
    "clearable": "clearable-editor",
    "editable": "editable-editor",
    "showPassword": "showPassword-editor",
    "textContent": "textContent-editor",
    "textAlign": "textAlign-editor",
    "fontSize": "fontSize-editor",
    "preWrap": "preWrap-editor",
    "htmlContent": "htmlContent-editor",
    "format": "format-editor",
    "valueFormat": "valueFormat-editor",
    "filterable": "filterable-editor",
    "allowCreate": "allowCreate-editor",
    "remote": "remote-editor",
    "automaticDropdown": "automaticDropdown-editor",
    "checkStrictly": "checkStrictly-editor",
    "showAllLevels": "showAllLevels-editor",
    "multiple": "multiple-editor",
    "multipleLimit": "multipleLimit-editor",
    "collapseTags": "collapseTags-editor",
    "contentPosition": "contentPosition-editor",
    "optionItems": "optionItems-editor",
    "uploadURL": "uploadURL-editor",
    "uploadTip": "uploadTip-editor",
    "withCredentials": "withCredentials-editor",
    "multipleSelect": "multipleSelect-editor",
    "limit": "limit-editor",
    "fileMaxSize": "fileMaxSize-editor",
    "fileTypes": "fileTypes-editor",
    "contentHeight": "contentHeight-editor",
    "tabType": "tabType-editor",
    "tabPosition": "tabPosition-editor",
    "customClass": "customClass-editor",
    "showCheckBox": "show-checkbox-editor",
    "filter": "show-filter-editor",
    "defaultExpandAllNode": "show-defaultExpandAllNode-editor",
    "expandRetractAllNode": "tree-expandRetractAllNode-editor",
    "selectClearAllNode": "tree-selectClearAllNode-editor",
    "expandOnClickNode": "show-expandOnClickNode-editor",
    "nodeEdit": "tree-nodeEdit-editor",
    "draggable": "show-draggable-editor",
    "lazy": "tree-lazy-editor",
    "treeDataEdit": "treeData-editor",
    "formulaEnabled": "formulaEnabled-editor",
    "formula": "formula-editor",
    "showBlankRow": "showBlankRow-editor",
    "showRowNumber": "showRowNumber-editor",
    "actionColumnPosition": "actionColumnPosition-editor",
    "cellWidth": "cellWidth-editor",
    "cellHeight": "cellHeight-editor",
    "colHeight": "colHeight-editor",
    "wordBreak": "wordBreak-editor",
    "gutter": "gutter-editor",
    "responsive": "responsive-editor",
    "span": "span-editor",
    "offset": "offset-editor",
    "push": "push-editor",
    "pull": "pull-editor",
    "title": "title-editor",
    "width": "width-editor",
    "fullscreen": "fullscreen-editor",
    "showModal": "showModal-editor",
    "showClose": "showClose-editor",
    "closeOnClickModal": "closeOnClickModal-editor",
    "closeOnPressEscape": "closeOnPressEscape-editor",
    "center": "center-editor",
    "direction": "direction-editor",
    "readMode": "readMode-editor",
    "disabledMode": "disabledMode-editor",
    "okButtonLabel": "okButtonLabel-editor",
    "okButtonHidden": "okButtonHidden-editor",
    "cancelButtonLabel": "cancelButtonLabel-editor",
    "cancelButtonHidden": "cancelButtonHidden-editor"
  };
  const ADVANCED_PROPERTIES$1 = {
    "min": "min-editor",
    "max": "max-editor",
    "precision": "precision-editor",
    "step": "step-editor",
    "minLength": "minLength-editor",
    "maxLength": "maxLength-editor",
    "showWordLimit": "showWordLimit-editor",
    "prefixIcon": "prefixIcon-editor",
    "suffixIcon": "suffixIcon-editor",
    "switchWidth": "switchWidth-editor",
    "activeText": "activeText-editor",
    "inactiveText": "inactiveText-editor",
    "activeColor": "activeColor-editor",
    "inactiveColor": "inactiveColor-editor",
    "lowThreshold": "lowThreshold-editor",
    "highThreshold": "highThreshold-editor",
    "allowHalf": "allowHalf-editor",
    "showText": "showText-editor",
    "showScore": "showScore-editor",
    "range": "range-editor",
    "vertical": "vertical-editor",
    "plain": "plain-editor",
    "round": "round-editor",
    "circle": "circle-editor",
    "icon": "icon-editor",
    "labelIconClass": "labelIconClass-editor",
    "labelIconPosition": "labelIconPosition-editor",
    "labelTooltip": "labelTooltip-editor",
    "appendButton": "appendButton-editor",
    "appendButtonDisabled": "appendButtonDisabled-editor",
    "buttonIcon": "buttonIcon-editor"
  };
  const EVENT_PROPERTIES$1 = {
    "onCreated": "onCreated-editor",
    "onMounted": "onMounted-editor",
    "onClick": "onClick-editor",
    "onInput": "onInput-editor",
    "onChange": "onChange-editor",
    "onFocus": "onFocus-editor",
    "onBlur": "onBlur-editor",
    "onRemoteQuery": "onRemoteQuery-editor",
    "onBeforeUpload": "onBeforeUpload-editor",
    "onUploadSuccess": "onUploadSuccess-editor",
    "onUploadError": "onUploadError-editor",
    "onFileRemove": "onFileRemove-editor",
    "onValidate": "onValidate-editor",
    "onAppendButtonClick": "onAppendButtonClick-editor",
    "onTabClick": "onTabClick-editor",
    "onSubFormRowAdd": "onSubFormRowAdd-editor",
    "onSubFormRowInsert": "onSubFormRowInsert-editor",
    "onSubFormRowDelete": "onSubFormRowDelete-editor",
    "onSubFormRowChange": "onSubFormRowChange-editor",
    "onPageSizeChange": "onPageSizeChange-editor",
    "onCurrentPageChange": "onCurrentPageChange-editor",
    "onSortChange": "onSortChange-editor",
    "onSelectionChange": "onSelectionChange-editor",
    "onHideOperationButton": "onHideOperationButton-editor",
    "onDisableOperationButton": "onDisableOperationButton-editor",
    "onGetOperationButtonLabel": "onGetOperationButtonLabel-editor",
    "onOperationButtonClick": "onOperationButtonClick-editor",
    "onHeaderClick": "onHeaderClick-editor",
    "onRowClick": "onRowClick-editor",
    "onRowDoubleClick": "onRowDoubleClick-editor",
    "onCellClick": "onCellClick-editor",
    "onCellDoubleClick": "onCellDoubleClick-editor",
    "onGetRowClassName": "onGetRowClassName-editor",
    "onGetSpanMethod": "onGetSpanMethod-editor",
    "onOkButtonClick": "onOkButtonClick-editor",
    "onCancelButtonClick": "onCancelButtonClick-editor",
    "onDialogOpened": "onDialogOpened-editor",
    "onDialogBeforeClose": "onDialogBeforeClose-editor",
    "onDrawerOpened": "onDrawerOpened-editor",
    "onDrawerBeforeClose": "onDrawerBeforeClose-editor",
    "onButtonGroupClick": "onButtonGroupClick-editor",
    "onNodeClick": "onNodeClick-editor",
    "onNodeCheck": "onNodeCheck-editor",
    "onNodeContextmenu": "onNodeContextmenu-editor",
    "onCheckChange": "onCheckChange-editor"
  };
  function registerCommonProperty(uniquePropName, propEditorName) {
    COMMON_PROPERTIES$1[uniquePropName] = propEditorName;
  }
  function registerAdvancedProperty(uniquePropName, propEditorName) {
    ADVANCED_PROPERTIES$1[uniquePropName] = propEditorName;
  }
  function registerEventProperty(uniquePropName, propEditorName) {
    EVENT_PROPERTIES$1[uniquePropName] = propEditorName;
  }
  function propertyRegistered(uniquePropName) {
    return !!COMMON_PROPERTIES$1[uniquePropName] || !!ADVANCED_PROPERTIES$1[uniquePropName] || !!EVENT_PROPERTIES$1[uniquePropName];
  }
  function registerCPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent);
    registerCommonProperty(uniquePropName, propEditorName);
  }
  function registerAPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent);
    registerAdvancedProperty(uniquePropName, propEditorName);
  }
  function registerEPEditor(app, uniquePropName, propEditorName, editorComponent) {
    app.component(propEditorName, editorComponent);
    registerEventProperty(uniquePropName, propEditorName);
  }
  var WidgetProperties = {
    COMMON_PROPERTIES: COMMON_PROPERTIES$1,
    ADVANCED_PROPERTIES: ADVANCED_PROPERTIES$1,
    EVENT_PROPERTIES: EVENT_PROPERTIES$1
  };
  var PERegister = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    registerCommonProperty,
    registerAdvancedProperty,
    registerEventProperty,
    propertyRegistered,
    registerCPEditor,
    registerAPEditor,
    registerEPEditor,
    "default": WidgetProperties
  }, Symbol.toStringTag, { value: "Module" }));
  var index_vue_vue_type_style_index_0_scoped_true_lang$2 = "";
  var index_vue_vue_type_style_index_1_lang = "";
  const { COMMON_PROPERTIES, ADVANCED_PROPERTIES, EVENT_PROPERTIES } = WidgetProperties;
  const _sfc_main$k = {
    name: "SettingPanel",
    componentName: "SettingPanel",
    mixins: [i18n$1, emitter],
    components: __spreadValues({
      CodeEditor,
      FormSetting,
      DataSourceSetting
    }, comps),
    props: {
      designer: Object,
      selectedWidget: Object,
      formConfig: Object,
      globalDsv: {
        type: Object,
        default: () => ({})
      }
    },
    provide() {
      return {
        isSubFormChildWidget: () => this.subFormChildWidgetFlag,
        getGlobalDsv: () => this.globalDsv
      };
    },
    inject: ["getDesignerConfig"],
    data() {
      return {
        designerConfig: this.getDesignerConfig(),
        activeTab: "2",
        widgetActiveCollapseNames: ["1", "3"],
        formActiveCollapseNames: ["1", "2"],
        commonProps: COMMON_PROPERTIES,
        advProps: ADVANCED_PROPERTIES,
        eventProps: EVENT_PROPERTIES,
        showWidgetEventDialogFlag: false,
        eventHandlerCode: "",
        curEventName: "",
        eventHeader: "",
        subFormChildWidgetFlag: false
      };
    },
    computed: {
      optionModel: {
        get() {
          return this.selectedWidget.options;
        },
        set(newValue) {
          this.selectedWidget.options = newValue;
        }
      }
    },
    watch: {
      "designer.selectedWidget": {
        handler(val) {
          if (!!val) {
            this.activeTab = "1";
          }
        }
      },
      "selectedWidget.options": {
        deep: true,
        handler() {
          this.designer.saveCurrentHistoryStep();
        }
      },
      formConfig: {
        deep: true,
        handler() {
          this.designer.saveCurrentHistoryStep();
        }
      }
    },
    created() {
      this.on$("editEventHandler", (eventParams) => {
        this.editEventHandler(eventParams[0], eventParams[1]);
      });
      this.designer.handleEvent("form-css-updated", (cssClassList) => {
        this.designer.setCssClassList(cssClassList);
      });
      this.designer.handleEvent("field-selected", (parentWidget) => {
        this.subFormChildWidgetFlag = !!parentWidget && parentWidget.type === "sub-form";
      });
    },
    mounted() {
      if (!this.designer.selectedWidget) {
        this.activeTab = "2";
      } else {
        this.activeTab = "1";
      }
    },
    methods: {
      getEventHandled(eventName) {
        return !!this.optionModel[eventName] && this.optionModel[eventName].length > 0;
      },
      showEventCollapse() {
        if (this.designerConfig["eventCollapse"] === void 0) {
          return true;
        }
        return !!this.designerConfig["eventCollapse"];
      },
      hasPropEditor(propName, editorName) {
        if (!editorName) {
          return false;
        }
        if (propName.indexOf("-") <= -1) {
          let uniquePropName = this.selectedWidget.type + "-" + propName;
          if (propertyRegistered(uniquePropName)) {
            return false;
          }
        }
        let originalPropName = propName.replace(this.selectedWidget.type + "-", "");
        return this.designer.hasConfig(this.selectedWidget, originalPropName);
      },
      getPropEditor(propName, editorName) {
        let originalPropName = propName.replace(this.selectedWidget.type + "-", "");
        let ownPropEditorName = `${this.selectedWidget.type}-${originalPropName}-editor`;
        if (!!this.$options.components[ownPropEditorName]) {
          return ownPropEditorName;
        }
        return !!this.$root.$.appContext.components[ownPropEditorName] ? ownPropEditorName : editorName;
      },
      showCollapse(propsObj) {
        let result = false;
        for (let propName in propsObj) {
          if (!propsObj.hasOwnProperty(propName)) {
            continue;
          }
          if (this.hasPropEditor(propName, propsObj[propName])) {
            result = true;
            break;
          }
        }
        return result;
      },
      editEventHandler(eventName, eventParams) {
        this.curEventName = eventName;
        this.eventHeader = `${this.optionModel.name}.${eventName}(${eventParams.join(", ")}) {`;
        this.eventHandlerCode = this.selectedWidget.options[eventName] || "";
        if (eventName === "onValidate" && !this.optionModel["onValidate"]) {
          this.eventHandlerCode = "  /* sample code */\n  /*\n  if ((value > 100) || (value < 0)) {\n    callback(new Error('error message'))  //fail\n  } else {\n    callback();  //pass\n  }\n  */";
        }
        this.showWidgetEventDialogFlag = true;
      },
      saveEventHandler() {
        const codeHints = this.$refs.ecEditor.getEditorAnnotations();
        let syntaxErrorFlag = false;
        if (!!codeHints && codeHints.length > 0) {
          codeHints.forEach((chItem) => {
            if (chItem.type === "error") {
              syntaxErrorFlag = true;
            }
          });
          if (syntaxErrorFlag) {
            this.$message.error(this.i18nt("designer.setting.syntaxCheckWarning"));
            return;
          }
        }
        this.selectedWidget.options[this.curEventName] = this.eventHandlerCode;
        this.showWidgetEventDialogFlag = false;
      }
    }
  };
  const _hoisted_1$e = {
    key: 0,
    class: ""
  };
  const _hoisted_2$6 = { class: "dialog-footer" };
  function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_collapse_item = require$$0$1.resolveComponent("el-collapse-item");
    const _component_el_collapse = require$$0$1.resolveComponent("el-collapse");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_el_empty = require$$0$1.resolveComponent("el-empty");
    const _component_el_scrollbar = require$$0$1.resolveComponent("el-scrollbar");
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_form_setting = require$$0$1.resolveComponent("form-setting");
    const _component_data_source_setting = require$$0$1.resolveComponent("data-source-setting");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _component_code_editor = require$$0$1.resolveComponent("code-editor");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_dialog = require$$0$1.resolveComponent("el-dialog");
    const _component_el_container = require$$0$1.resolveComponent("el-container");
    const _directive_drag = require$$0$1.resolveDirective("drag");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_container, { class: "panel-container" }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_tabs, {
          modelValue: $data.activeTab,
          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => $data.activeTab = $event),
          style: { "height": "100%", "width": "100%", "overflow": "hidden" }
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_tab_pane, {
              label: _ctx.i18nt("designer.hint.widgetSetting"),
              name: "1"
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_scrollbar, { class: "setting-scrollbar" }, {
                  default: require$$0$1.withCtx(() => [
                    !!$props.designer.selectedWidget && !$props.designer.selectedWidget.category ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form, {
                      key: 0,
                      model: $options.optionModel,
                      size: "small",
                      "label-position": "left",
                      "label-width": "120px",
                      class: "setting-form",
                      onSubmit: _cache[1] || (_cache[1] = require$$0$1.withModifiers(() => {
                      }, ["prevent"]))
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_collapse, {
                          modelValue: $data.widgetActiveCollapseNames,
                          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.widgetActiveCollapseNames = $event),
                          class: "setting-collapse"
                        }, {
                          default: require$$0$1.withCtx(() => [
                            $options.showCollapse($data.commonProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 0,
                              name: "1",
                              title: _ctx.i18nt("designer.setting.commonSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.commonProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel
                                    }, null, 8, ["designer", "selected-widget", "option-model"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true),
                            $options.showCollapse($data.advProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 1,
                              name: "2",
                              title: _ctx.i18nt("designer.setting.advancedSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.advProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel
                                    }, null, 8, ["designer", "selected-widget", "option-model"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true),
                            $options.showEventCollapse() && $options.showCollapse($data.eventProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 2,
                              name: "3",
                              title: _ctx.i18nt("designer.setting.eventSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.eventProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel,
                                      "event-handled": $options.getEventHandled(propName)
                                    }, null, 8, ["designer", "selected-widget", "option-model", "event-handled"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true)
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    }, 8, ["model"])) : require$$0$1.createCommentVNode("", true),
                    !!$props.designer.selectedWidget && !!$props.designer.selectedWidget.category ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_form, {
                      key: 1,
                      model: $options.optionModel,
                      size: "small",
                      "label-position": "left",
                      "label-width": "120px",
                      class: "setting-form",
                      onSubmit: _cache[3] || (_cache[3] = require$$0$1.withModifiers(() => {
                      }, ["prevent"]))
                    }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_el_collapse, {
                          modelValue: $data.widgetActiveCollapseNames,
                          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => $data.widgetActiveCollapseNames = $event),
                          class: "setting-collapse"
                        }, {
                          default: require$$0$1.withCtx(() => [
                            $options.showCollapse($data.commonProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 0,
                              name: "1",
                              title: _ctx.i18nt("designer.setting.commonSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.commonProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel
                                    }, null, 8, ["designer", "selected-widget", "option-model"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true),
                            $options.showCollapse($data.advProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 1,
                              name: "2",
                              title: _ctx.i18nt("designer.setting.advancedSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.advProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel
                                    }, null, 8, ["designer", "selected-widget", "option-model"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true),
                            $options.showEventCollapse() && $options.showCollapse($data.eventProps) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_collapse_item, {
                              key: 2,
                              name: "3",
                              title: _ctx.i18nt("designer.setting.eventSetting")
                            }, {
                              default: require$$0$1.withCtx(() => [
                                (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($data.eventProps, (editorName, propName) => {
                                  return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                                    $options.hasPropEditor(propName, editorName) ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getPropEditor(propName, editorName)), {
                                      key: 0,
                                      designer: $props.designer,
                                      "selected-widget": $props.selectedWidget,
                                      "option-model": $options.optionModel,
                                      "event-handled": $options.getEventHandled(propName)
                                    }, null, 8, ["designer", "selected-widget", "option-model", "event-handled"])) : require$$0$1.createCommentVNode("", true)
                                  ], 64);
                                }), 256))
                              ]),
                              _: 1
                            }, 8, ["title"])) : require$$0$1.createCommentVNode("", true)
                          ]),
                          _: 1
                        }, 8, ["modelValue"])
                      ]),
                      _: 1
                    }, 8, ["model"])) : require$$0$1.createCommentVNode("", true),
                    !$props.designer.selectedWidget ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_empty, {
                      key: 2,
                      description: _ctx.i18nt("designer.hint.noSelectedWidgetHint")
                    }, null, 8, ["description"])) : require$$0$1.createCommentVNode("", true)
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["label"]),
            !!$props.designer ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
              key: 0,
              label: _ctx.i18nt("designer.hint.formSetting"),
              name: "2"
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_scrollbar, { class: "setting-scrollbar" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_form_setting, {
                      designer: $props.designer,
                      "form-config": $props.formConfig
                    }, null, 8, ["designer", "form-config"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
            require$$0$1.createVNode(_component_el_tab_pane, {
              label: _ctx.i18nt("designer.setting.dataSource"),
              name: "3"
            }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_scrollbar, { class: "ds-setting-scrollbar" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_data_source_setting, {
                      designer: $props.designer,
                      "form-config": $props.formConfig
                    }, null, 8, ["designer", "form-config"])
                  ]),
                  _: 1
                })
              ]),
              _: 1
            }, 8, ["label"])
          ]),
          _: 1
        }, 8, ["modelValue"]),
        $data.showWidgetEventDialogFlag ? require$$0$1.withDirectives((require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$e, [
          require$$0$1.createVNode(_component_el_dialog, {
            title: _ctx.i18nt("designer.setting.editWidgetEventHandler"),
            modelValue: $data.showWidgetEventDialogFlag,
            "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $data.showWidgetEventDialogFlag = $event),
            "show-close": true,
            class: "drag-dialog small-padding-dialog",
            "append-to-body": "",
            "close-on-click-modal": false,
            "close-on-press-escape": false,
            "destroy-on-close": true
          }, {
            footer: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", _hoisted_2$6, [
                require$$0$1.createVNode(_component_el_button, {
                  onClick: _cache[6] || (_cache[6] = ($event) => $data.showWidgetEventDialogFlag = false)
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.cancel")), 1)
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_button, {
                  type: "primary",
                  onClick: $options.saveEventHandler
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.hint.confirm")), 1)
                  ]),
                  _: 1
                }, 8, ["onClick"])
              ])
            ]),
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_alert, {
                type: "info",
                closable: false,
                title: $data.eventHeader
              }, null, 8, ["title"]),
              require$$0$1.createVNode(_component_code_editor, {
                mode: "javascript",
                readonly: false,
                modelValue: $data.eventHandlerCode,
                "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => $data.eventHandlerCode = $event),
                ref: "ecEditor"
              }, null, 8, ["modelValue"]),
              require$$0$1.createVNode(_component_el_alert, {
                type: "info",
                closable: false,
                title: "}"
              })
            ]),
            _: 1
          }, 8, ["title", "modelValue"])
        ])), [
          [_directive_drag, [".drag-dialog.el-dialog", ".drag-dialog .el-dialog__header"]]
        ]) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    });
  }
  var SettingPanel = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["render", _sfc_render$k], ["__scopeId", "data-v-179dc52a"]]);
  var containerMixin = {
    inject: ["getFormConfig", "getGlobalDsv"],
    computed: {
      formConfig() {
        return this.getFormConfig();
      }
    },
    methods: {
      appendTableRow(widget) {
        this.designer.appendTableRow(widget);
      },
      appendTableCol(widget) {
        this.designer.appendTableCol(widget);
      },
      onContainerDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", this.widget);
      },
      onContainerDragUpdate() {
        this.designer.emitHistoryChange();
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      selectWidget(widget) {
        this.designer.setSelected(widget);
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
        this.designer.emitHistoryChange();
      },
      cloneContainer(widget) {
        if (!!this.parentList) {
          let newCon = this.designer.cloneContainer(widget);
          this.parentList.splice(this.indexOfParentList + 1, 0, newCon);
          this.designer.setSelected(newCon);
          this.designer.emitHistoryChange();
        }
      },
      removeWidget() {
        if (!!this.parentList) {
          const widgetRefName = this.designer.selectedWidgetName;
          const childrenRefNames = [];
          const fwHandler = (fw) => {
            childrenRefNames.push(fw.options.name);
          };
          const cwHandler = (cw) => {
            childrenRefNames.push(cw.options.name);
          };
          traverseWidgetsOfContainer(this.designer.selectedWidget, fwHandler, cwHandler);
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.formWidget.deleteWidgetRef(widgetRefName);
            this.designer.formWidget.deletedChildrenRef(childrenRefNames);
            this.designer.emitHistoryChange();
          });
        }
      },
      setWidgetOption(optionName, optionValue) {
        if (this.widget.options.hasOwnProperty(optionName)) {
          this.widget.options[optionName] = optionValue;
        }
      }
    }
  };
  var containerWrapper_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$j = {
    name: "container-wrapper",
    mixins: [i18n$1, containerMixin],
    components: {
      SvgIcon
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    computed: {
      customClass() {
        return !!this.widget.options.customClass ? this.widget.options.customClass.join(" ") : "";
      }
    }
  };
  const _hoisted_1$d = {
    key: 0,
    class: "container-action"
  };
  const _hoisted_2$5 = ["title"];
  const _hoisted_3$4 = ["title"];
  const _hoisted_4$4 = ["title"];
  const _hoisted_5$3 = ["title"];
  const _hoisted_6$3 = ["title"];
  const _hoisted_7$1 = ["title"];
  const _hoisted_8$1 = ["title"];
  const _hoisted_9 = {
    key: 1,
    class: "drag-handler"
  };
  const _hoisted_10 = ["title"];
  const _hoisted_11 = { key: 0 };
  function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", {
      class: require$$0$1.normalizeClass(["container-wrapper", [$options.customClass]])
    }, [
      require$$0$1.renderSlot(_ctx.$slots, "default", {}, void 0, true),
      $props.designer.selectedId === $props.widget.id && !$props.widget.internal ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$d, [
        require$$0$1.createElementVNode("i", {
          title: _ctx.i18nt("designer.hint.selectParentWidget"),
          onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => _ctx.selectParentWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-back" })
        ], 8, _hoisted_2$5),
        !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
          key: 0,
          title: _ctx.i18nt("designer.hint.moveUpWidget"),
          onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => _ctx.moveUpWidget(), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-up" })
        ], 8, _hoisted_3$4)) : require$$0$1.createCommentVNode("", true),
        !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
          key: 1,
          title: _ctx.i18nt("designer.hint.moveDownWidget"),
          onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => _ctx.moveDownWidget(), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-down" })
        ], 8, _hoisted_4$4)) : require$$0$1.createCommentVNode("", true),
        $props.widget.type === "table" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
          key: 2,
          title: _ctx.i18nt("designer.hint.insertRow"),
          onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => _ctx.appendTableRow($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-insert-row" })
        ], 8, _hoisted_5$3)) : require$$0$1.createCommentVNode("", true),
        $props.widget.type === "table" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
          key: 3,
          title: _ctx.i18nt("designer.hint.insertColumn"),
          onClick: _cache[4] || (_cache[4] = require$$0$1.withModifiers(($event) => _ctx.appendTableCol($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-insert-column" })
        ], 8, _hoisted_6$3)) : require$$0$1.createCommentVNode("", true),
        $props.widget.type === "grid" || $props.widget.type === "table" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
          key: 4,
          title: _ctx.i18nt("designer.hint.cloneWidget"),
          onClick: _cache[5] || (_cache[5] = require$$0$1.withModifiers(($event) => _ctx.cloneContainer($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-clone" })
        ], 8, _hoisted_7$1)) : require$$0$1.createCommentVNode("", true),
        require$$0$1.createElementVNode("i", {
          title: _ctx.i18nt("designer.hint.remove"),
          onClick: _cache[6] || (_cache[6] = require$$0$1.withModifiers((...args) => _ctx.removeWidget && _ctx.removeWidget(...args), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
        ], 8, _hoisted_8$1)
      ])) : require$$0$1.createCommentVNode("", true),
      $props.designer.selectedId === $props.widget.id && !$props.widget.internal ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_9, [
        require$$0$1.createElementVNode("i", {
          title: _ctx.i18nt("designer.hint.dragHandler")
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-drag-move" })
        ], 8, _hoisted_10),
        require$$0$1.createElementVNode("i", null, require$$0$1.toDisplayString(_ctx.i18n2t(`designer.widgetLabel.${$props.widget.type}`, `extension.widgetLabel.${$props.widget.type}`)), 1),
        $props.widget.options.hidden === true ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", _hoisted_11, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-hide" })
        ])) : require$$0$1.createCommentVNode("", true)
      ])) : require$$0$1.createCommentVNode("", true)
    ], 2);
  }
  var ContainerWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["render", _sfc_render$j], ["__scopeId", "data-v-dc661e70"]]);
  var __glob_0_1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": ContainerWrapper
  }, Symbol.toStringTag, { value: "Module" }));
  var refMixinDesign = {
    methods: {
      initRefList() {
        if (this.refList !== null && !!this.widget.options.name) {
          this.refList[this.widget.options.name] = this;
        }
      },
      getWidgetRef(widgetName, showError) {
        let foundRef = this.refList[widgetName];
        if (!foundRef && !!showError) {
          this.$message.error(this.i18nt("render.hint.refNotFound") + widgetName);
        }
        return foundRef;
      },
      registerToRefList(oldRefName) {
        if (this.refList !== null && !!this.widget.options.name) {
          if (!!oldRefName) {
            delete this.refList[oldRefName];
          }
          this.refList[this.widget.options.name] = this;
        }
      }
    }
  };
  var buttonGroupWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$i = {
    name: "button-group-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: {
      ContainerWrapper
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    data() {
      return {};
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    }
  };
  function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["button-group-container", { "selected": $options.selected }]),
          onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_el_button_group, null, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.buttons, (btn, idx) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                  disabled: btn.disabled || $props.widget.options.disabled,
                  size: $props.widget.options.size,
                  type: btn.type,
                  round: btn.round,
                  icon: btn.icon,
                  class: require$$0$1.normalizeClass(["data-table-" + btn.name + "-button"])
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(btn.label), 1)
                  ]),
                  _: 2
                }, 1032, ["disabled", "size", "type", "round", "icon", "class"]);
              }), 256))
            ]),
            _: 1
          })
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var buttonGroupWidget = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render$i], ["__scopeId", "data-v-5db93d4b"]]);
  var __glob_0_0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": buttonGroupWidget
  }, Symbol.toStringTag, { value: "Module" }));
  const _sfc_main$h = {
    name: "table-multi-level-column",
    props: {
      columnSchema: {
        type: Object
      },
      tableOptions: {
        type: Object
      }
    },
    computed: {
      colMinWidth() {
        return this.tableOptions.autoColumnWidthDisabled === true ? void 0 : this.columnSchema.width;
      },
      colWidth() {
        return this.tableOptions.autoColumnWidthDisabled === true ? this.columnSchema.width : void 0;
      }
    },
    methods: {
      formatterValue(row, column, cellValue) {
        if (!cellValue) {
          return "";
        }
        if (!!column.formatS && !!column.show) {
          switch (column.formatS) {
            case "d1":
              return formatDate1(cellValue);
            case "d2":
              return formatDate2(cellValue);
            case "d3":
              return formatDate3(cellValue);
            case "d4":
              return formatDate4(cellValue);
            case "d5":
              return formatDate5(cellValue);
            case "n1":
              return formatNumber1(cellValue);
            case "n2":
              return formatNumber2(cellValue);
            case "n3":
              return formatNumber3(cellValue);
            case "n4":
              return formatNumber4(cellValue);
            case "n5":
              return formatNumber5(cellValue);
            case "n6":
              return formatNumber6(cellValue);
            case "n7":
              return formatNumber7(cellValue);
          }
        }
        return cellValue;
      }
    }
  };
  function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_table_multi_level_column = require$$0$1.resolveComponent("table-multi-level-column", true);
    const _component_el_table_column = require$$0$1.resolveComponent("el-table-column");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
      !!$props.columnSchema.headerFlag && (!!$props.columnSchema.children && $props.columnSchema.children.length > 0) ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
        key: 0,
        label: $props.columnSchema.label,
        align: $props.columnSchema.align ? $props.columnSchema.align : "center"
      }, {
        default: require$$0$1.withCtx(() => [
          (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.columnSchema.children, (child) => {
            return require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_multi_level_column, {
              "column-schema": child,
              "table-options": $props.tableOptions
            }, null, 8, ["column-schema", "table-options"]);
          }), 256))
        ]),
        _: 1
      }, 8, ["label", "align"])) : require$$0$1.createCommentVNode("", true),
      !$props.columnSchema.headerFlag && $props.columnSchema.show !== false && !$props.columnSchema.children ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
        key: $props.columnSchema.columnId,
        prop: $props.columnSchema.prop,
        label: $props.columnSchema.label,
        sortable: $props.columnSchema.sortable,
        fixed: !$props.columnSchema.fixed ? false : $props.columnSchema.fixed,
        align: $props.columnSchema.align ? $props.columnSchema.align : "center",
        formatter: $options.formatterValue,
        format: $props.columnSchema.format,
        "show-overflow-tooltip": true,
        "min-width": $options.colMinWidth,
        width: $options.colWidth
      }, null, 8, ["prop", "label", "sortable", "fixed", "align", "formatter", "format", "min-width", "width"])) : require$$0$1.createCommentVNode("", true)
    ], 64);
  }
  var TableMultiLevelColumn = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h]]);
  var dataTableWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$g = {
    name: "DataTableWidget",
    componentName: "DataTableWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      TableMultiLevelColumn,
      ContainerWrapper
    }, comps$1),
    data() {
      return {
        selectAllFlag: false
      };
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    created() {
      this.initRefList();
    },
    mounted() {
    },
    beforeDestroy() {
    },
    computed: {
      paginationLayout() {
        return !!this.widget.options.smallPagination ? "prev, pager, next" : "total, sizes, prev, pager, next, jumper";
      },
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      },
      widgetSize() {
        return this.widget.options.tableSize || "default";
      },
      buttonsColumnFixed() {
        if (this.widget.options.buttonsColumnFixed === void 0) {
          return "right";
        }
        return !this.widget.options.buttonsColumnFixed ? false : this.widget.options.buttonsColumnFixed;
      },
      tableHeight() {
        return this.widget.options.tableHeight || void 0;
      },
      selectionWidth() {
        return !this.widget.options.showSummary ? !this.widget.options.treeDataEnabled ? 42 : 70 : 53;
      },
      tableRowKey() {
        return !this.widget.options.treeDataEnabled ? null : this.widget.options.rowKey;
      },
      paginationAlign() {
        let alignType = !this.widget.options.paginationAlign ? "left" : this.widget.options.paginationAlign;
        return "align-" + alignType;
      }
    },
    methods: {
      selectWidget(widget) {
        this.designer.setSelected(widget);
      },
      formatter(row, column, cellValue) {
        return cellValue;
      },
      formatterValue(row, column, cellValue) {
        if (!cellValue) {
          return "";
        }
        if (!!column.formatS && !!column.show) {
          switch (column.formatS) {
            case "d1":
              return formatDate1(cellValue);
            case "d2":
              return formatDate2(cellValue);
            case "d3":
              return formatDate3(cellValue);
            case "d4":
              return formatDate4(cellValue);
            case "d5":
              return formatDate5(cellValue);
            case "n1":
              return formatNumber1(cellValue);
            case "n2":
              return formatNumber2(cellValue);
            case "n3":
              return formatNumber3(cellValue);
            case "n4":
              return formatNumber4(cellValue);
            case "n5":
              return formatNumber5(cellValue);
            case "n6":
              return formatNumber6(cellValue);
            case "n7":
              return formatNumber7(cellValue);
          }
        }
        return cellValue;
      },
      handlePageSizeChange(pageSize) {
      },
      handleCurrentPageChange(currentPage) {
      },
      refreshLayout() {
        this.$refs["dataTable"].doLayout();
      },
      getTableColumns() {
        return this.widget.options.tableColumns;
      },
      setChildrenSelected(children, flag) {
        let childrenKey = this.widget.options.childrenKey;
        children.map((child) => {
          this.toggleSelection(child, flag);
          if (child[childrenKey]) {
            this.setChildrenSelected(child[childrenKey], flag);
          }
        });
      },
      toggleSelection(row, flag) {
        if (row) {
          this.$nextTick(() => {
            this.$refs.dataTable.toggleRowSelection(row, flag);
          });
        }
      },
      handleRowSelect(selection, row) {
        let childrenKey = this.widget.options.childrenKey;
        if (selection.some((el) => {
          return row.id === el.id;
        })) {
          if (row[childrenKey]) {
            this.setChildrenSelected(row[childrenKey], true);
          }
        } else {
          if (row[childrenKey]) {
            this.setChildrenSelected(row[childrenKey], false);
          }
        }
      },
      setSelectedFlag(data2, flag) {
        let childrenKey = this.widget.options.childrenKey;
        data2.forEach((row) => {
          this.$refs.dataTable.toggleRowSelection(row, flag);
          if (row[childrenKey]) {
            this.setSelectedFlag(row[childrenKey], flag);
          }
        });
      },
      handleAllSelect(selection) {
        this.selectAllFlag = !this.selectAllFlag;
        this.setSelectedFlag(this.widget.options.tableData, this.selectAllFlag);
      },
      getOperationButtonType(operationButton) {
        if (operationButton.type !== "text") {
          return operationButton.type;
        } else {
          return "primary";
        }
      },
      isLinkOperationButton(operationButton) {
        return operationButton.type === "text";
      },
      getNativeTable() {
        return this.$refs.dataTable;
      }
    }
  };
  function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_table_column = require$$0$1.resolveComponent("el-table-column");
    const _component_table_multi_level_column = require$$0$1.resolveComponent("table-multi-level-column");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_table = require$$0$1.resolveComponent("el-table");
    const _component_el_pagination = require$$0$1.resolveComponent("el-pagination");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["collapse-container data-table-container", { "selected": $options.selected }]),
          onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_el_table, {
            ref: "dataTable",
            data: $props.widget.options.tableData,
            class: require$$0$1.normalizeClass([$options.customClass]),
            height: $options.tableHeight,
            style: require$$0$1.normalizeStyle({ "width": $props.widget.options.tableWidth }),
            border: $props.widget.options.border,
            "show-summary": $props.widget.options.showSummary,
            "row-key": $options.tableRowKey,
            "tree-props": { children: $props.widget.options.childrenKey },
            size: $options.widgetSize,
            onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"])),
            stripe: $props.widget.options.stripe,
            onSelect: $options.handleRowSelect,
            onSelectAll: $options.handleAllSelect,
            "cell-style": { padding: $props.widget.options.rowSpacing + "px 0" }
          }, {
            default: require$$0$1.withCtx(() => [
              $props.widget.options.showIndex ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
                key: 0,
                type: "index",
                width: "60",
                fixed: "left",
                label: _ctx.i18nt("designer.setting.lineNumber")
              }, null, 8, ["label"])) : require$$0$1.createCommentVNode("", true),
              $props.widget.options.showCheckBox ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
                key: 1,
                type: "selection",
                width: $options.selectionWidth,
                fixed: "left"
              }, null, 8, ["width"])) : require$$0$1.createCommentVNode("", true),
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.tableColumns, (item, index2) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_multi_level_column, {
                  "column-schema": item,
                  "table-options": $props.widget.options
                }, null, 8, ["column-schema", "table-options"]);
              }), 256)),
              !!$props.widget.options.showButtonsColumn ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_table_column, {
                key: 2,
                fixed: $options.buttonsColumnFixed,
                "class-name": "data-table-buttons-column",
                align: "center",
                label: $props.widget.options.buttonsColumnTitle,
                width: $props.widget.options.buttonsColumnWidth
              }, {
                default: require$$0$1.withCtx((scope) => [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.options.operationButtons, (ob, idx) => {
                    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                      !ob.hidden ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                        key: 0,
                        type: $options.getOperationButtonType(ob),
                        link: $options.isLinkOperationButton(ob),
                        size: ob.size,
                        round: ob.round,
                        disabled: ob.disabled,
                        class: require$$0$1.normalizeClass(["data-table-" + ob.name + "-button"])
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(ob.label), 1)
                        ]),
                        _: 2
                      }, 1032, ["type", "link", "size", "round", "disabled", "class"])) : require$$0$1.createCommentVNode("", true)
                    ], 64);
                  }), 256))
                ]),
                _: 1
              }, 8, ["fixed", "label", "width"])) : require$$0$1.createCommentVNode("", true)
            ]),
            _: 1
          }, 8, ["data", "class", "height", "style", "border", "show-summary", "row-key", "tree-props", "size", "stripe", "onSelect", "onSelectAll", "cell-style"]),
          $props.widget.options.showPagination ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_pagination, {
            key: 0,
            class: require$$0$1.normalizeClass($options.paginationAlign),
            small: $props.widget.options.smallPagination,
            "current-page": $props.widget.options.pagination.currentPage,
            "page-sizes": $props.widget.options.pagination.pageSizes,
            "page-size": $props.widget.options.pagination.pageSize,
            layout: $options.paginationLayout,
            total: $props.widget.options.pagination.total,
            onSizeChange: $options.handlePageSizeChange,
            onCurrentChange: $options.handleCurrentPageChange
          }, null, 8, ["class", "small", "current-page", "page-sizes", "page-size", "layout", "total", "onSizeChange", "onCurrentChange"])) : require$$0$1.createCommentVNode("", true)
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var dataTableWidget = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$g], ["__scopeId", "data-v-4b438bf4"]]);
  var __glob_0_2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": dataTableWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var gridColWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$f = {
    name: "GridColWidget",
    componentName: "GridColWidget",
    mixins: [i18n$1, refMixinDesign],
    inject: ["refList"],
    components: __spreadProps(__spreadValues({}, comps$1), {
      SvgIcon
    }),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      colHeight: {
        type: String,
        default: null
      }
    },
    data() {
      return {
        layoutProps: {
          span: this.widget.options.span || 12,
          offset: this.widget.options.offset || 0,
          push: this.widget.options.push || 0,
          pull: this.widget.options.pull || 0
        }
      };
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      },
      colHeightStyle() {
        return !!this.colHeight ? { height: this.colHeight + "px" } : {};
      }
    },
    watch: {
      "designer.formConfig.layoutType": {
        handler(val) {
          if (!!this.widget.options.responsive) {
            if (val === "H5") {
              this.layoutProps.span = this.widget.options.xs || 12;
            } else if (val === "Pad") {
              this.layoutProps.span = this.widget.options.sm || 12;
            } else {
              this.layoutProps.span = this.widget.options.md || 12;
            }
          } else {
            this.layoutProps.span = this.widget.options.span || 12;
          }
        }
      },
      "widget.options.responsive": {
        handler(val) {
          let lyType = this.designer.formConfig.layoutType;
          if (!!val) {
            if (lyType === "H5") {
              this.layoutProps.span = this.widget.options.xs || 12;
            } else if (lyType === "Pad") {
              this.layoutProps.span = this.widget.options.sm || 12;
            } else {
              this.layoutProps.span = this.widget.options.md || 12;
            }
          } else {
            this.layoutProps.span = this.widget.options.span || 12;
          }
        }
      },
      "widget.options.span": {
        handler(val) {
          this.layoutProps.span = val;
        }
      },
      "widget.options.md": {
        handler(val) {
          this.layoutProps.span = val;
        }
      },
      "widget.options.sm": {
        handler(val) {
          this.layoutProps.span = val;
        }
      },
      "widget.options.xs": {
        handler(val) {
          this.layoutProps.span = val;
        }
      },
      "widget.options.offset": {
        handler(val) {
          this.layoutProps.offset = val;
        }
      },
      "widget.options.push": {
        handler(val) {
          this.layoutProps.push = val;
        }
      },
      "widget.options.pull": {
        handler(val) {
          this.layoutProps.pull = val;
        }
      }
    },
    created() {
      this.initRefList();
      this.initLayoutProps();
    },
    methods: {
      initLayoutProps() {
        if (!!this.widget.options.responsive) {
          let lyType = this.designer.formConfig.layoutType;
          if (lyType === "H5") {
            this.layoutProps.span = this.widget.options.xs || 12;
          } else if (lyType === "Pad") {
            this.layoutProps.span = this.widget.options.sm || 12;
          } else {
            this.layoutProps.span = this.widget.options.md || 12;
          }
        } else {
          this.layoutProps.span = this.widget.options.span;
        }
      },
      onGridDragEnd(evt, subList) {
      },
      onGridDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", this.widget);
      },
      onGridDragUpdate() {
        this.designer.emitHistoryChange();
      },
      selectWidget(widget) {
        console.log("id: " + widget.id);
        this.designer.setSelected(widget);
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
      },
      cloneGridCol(widget) {
        this.designer.cloneGridCol(widget, this.parentWidget);
      },
      removeWidget() {
        if (!!this.parentList) {
          const widgetRefName = this.designer.selectedWidgetName;
          const childrenRefNames = [];
          const fwHandler = (fw) => {
            childrenRefNames.push(fw.options.name);
          };
          const cwHandler = (cw) => {
            childrenRefNames.push(cw.options.name);
          };
          traverseWidgetsOfContainer(this.designer.selectedWidget, fwHandler, cwHandler);
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.formWidget.deleteWidgetRef(widgetRefName);
            this.designer.formWidget.deletedChildrenRef(childrenRefNames);
            this.designer.emitHistoryChange();
          });
        }
      }
    }
  };
  const _hoisted_1$c = { class: "form-widget-list" };
  const _hoisted_2$4 = {
    key: 0,
    class: "grid-col-action"
  };
  const _hoisted_3$3 = ["title"];
  const _hoisted_4$3 = ["title"];
  const _hoisted_5$2 = ["title"];
  const _hoisted_6$2 = ["title"];
  const _hoisted_7 = ["title"];
  const _hoisted_8 = {
    key: 1,
    class: "grid-col-handler"
  };
  function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_col = require$$0$1.resolveComponent("el-col");
    return $props.widget.type === "grid-col" ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_col, require$$0$1.mergeProps({
      key: 0,
      class: "grid-cell"
    }, $data.layoutProps, {
      class: [$options.selected ? "selected" : "", $options.customClass],
      style: $options.colHeightStyle,
      onClick: _cache[7] || (_cache[7] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
    }), {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
          list: $props.widget.widgetList,
          "item-key": "id"
        }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
          tag: "div",
          "component-data": { name: "fade", class: "drag-drop-zone" },
          handle: ".drag-handler",
          onEnd: _cache[0] || (_cache[0] = (evt) => $options.onGridDragEnd(evt, $props.widget.widgetList)),
          onAdd: _cache[1] || (_cache[1] = (evt) => $options.onGridDragAdd(evt, $props.widget.widgetList)),
          onUpdate: $options.onGridDragUpdate,
          move: $options.checkContainerMove
        }), {
          item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
            require$$0$1.createElementVNode("div", _hoisted_1$c, [
              subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                widget: subWidget,
                designer: $props.designer,
                key: subWidget.id,
                "parent-list": $props.widget.widgetList,
                "index-of-parent-list": swIdx,
                "parent-widget": $props.widget
              }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                field: subWidget,
                designer: $props.designer,
                key: subWidget.id,
                "parent-list": $props.widget.widgetList,
                "index-of-parent-list": swIdx,
                "parent-widget": $props.widget,
                "design-state": true
              }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
            ])
          ]),
          _: 1
        }, 16, ["list", "onUpdate", "move"]),
        $props.designer.selectedId === $props.widget.id && $props.widget.type === "grid-col" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_2$4, [
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.selectParentWidget"),
            onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.selectParentWidget($props.widget), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-back" })
          ], 8, _hoisted_3$3),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 0,
            title: _ctx.i18nt("designer.hint.moveUpWidget"),
            onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => $options.moveUpWidget(), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-up" })
          ], 8, _hoisted_4$3)) : require$$0$1.createCommentVNode("", true),
          !!$props.parentList && $props.parentList.length > 1 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
            key: 1,
            title: _ctx.i18nt("designer.hint.moveDownWidget"),
            onClick: _cache[4] || (_cache[4] = require$$0$1.withModifiers(($event) => $options.moveDownWidget(), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-move-down" })
          ], 8, _hoisted_5$2)) : require$$0$1.createCommentVNode("", true),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.cloneWidget"),
            onClick: _cache[5] || (_cache[5] = require$$0$1.withModifiers(($event) => $options.cloneGridCol($props.widget), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-clone" })
          ], 8, _hoisted_6$2),
          require$$0$1.createElementVNode("i", {
            title: _ctx.i18nt("designer.hint.remove"),
            onClick: _cache[6] || (_cache[6] = require$$0$1.withModifiers((...args) => $options.removeWidget && $options.removeWidget(...args), ["stop"]))
          }, [
            require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-delete" })
          ], 8, _hoisted_7)
        ])) : require$$0$1.createCommentVNode("", true),
        $props.designer.selectedId === $props.widget.id && $props.widget.type === "grid-col" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_8, [
          require$$0$1.createElementVNode("i", null, require$$0$1.toDisplayString(_ctx.i18nt("designer.widgetLabel." + $props.widget.type)), 1)
        ])) : require$$0$1.createCommentVNode("", true)
      ]),
      _: 1
    }, 16, ["class", "style"])) : require$$0$1.createCommentVNode("", true);
  }
  var GridColWidget = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-3ca16a1e"]]);
  var __glob_0_3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": GridColWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var gridSubFormWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$e = {
    name: "grid-sub-form-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    provide() {
      return {
        getSubFormFieldFlag: () => true,
        getSubFormName: () => this.widget.options.name
      };
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    mounted() {
    },
    methods: {
      onSubFormDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        console.log("test", "onSubFormDragAdd");
        this.designer.emitEvent("field-selected", this.widget);
      },
      onSubFormDragEnd(evt) {
        console.log("sub form drag end: ", evt);
      }
    }
  };
  const _hoisted_1$b = { class: "grid-sub-form" };
  function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["sub-form-container", { "selected": $options.selected }]),
          onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createElementVNode("div", _hoisted_1$b, [
            require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
              list: $props.widget.widgetList,
              "item-key": "id"
            }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
              tag: "div",
              "component-data": { name: "fade", class: "grid-sub-form-drag-drop-zone" },
              handle: ".drag-handler",
              onAdd: _cache[0] || (_cache[0] = (evt) => $options.onSubFormDragAdd(evt, $props.widget.widgetList)),
              onEnd: $options.onSubFormDragEnd,
              onUpdate: _ctx.onContainerDragUpdate,
              move: _ctx.checkContainerMove
            }), {
              item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
                subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  widget: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget
                }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : require$$0$1.createCommentVNode("", true)
              ]),
              _: 1
            }, 16, ["list", "onEnd", "onUpdate", "move"])
          ])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var gridSubFormWidget = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["render", _sfc_render$e], ["__scopeId", "data-v-70978c5f"]]);
  var __glob_0_4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridSubFormWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var gridWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$d = {
    name: "grid-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: {
      ContainerWrapper,
      GridColWidget
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    mounted() {
    },
    methods: {}
  };
  function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_grid_col_widget = require$$0$1.resolveComponent("grid-col-widget");
    const _component_el_row = require$$0$1.resolveComponent("el-row");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_row, {
          key: $props.widget.id,
          gutter: $props.widget.options.gutter,
          class: require$$0$1.normalizeClass(["grid-container", [$options.selected ? "selected" : "", $options.customClass]]),
          onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, {
          default: require$$0$1.withCtx(() => [
            (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.cols, (colWidget, colIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createBlock(_component_grid_col_widget, {
                key: colWidget.id,
                widget: colWidget,
                designer: $props.designer,
                "parent-list": $props.widget.cols,
                "index-of-parent-list": colIdx,
                "parent-widget": $props.widget,
                "col-height": $props.widget.options.colHeight
              }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget", "col-height"]);
            }), 128))
          ]),
          _: 1
        }, 8, ["gutter", "class"]))
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var gridWidget = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["render", _sfc_render$d], ["__scopeId", "data-v-0a068dd0"]]);
  var __glob_0_5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": gridWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var objectGroupWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$c = {
    name: "object-group-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    provide() {
      return {
        getObjectFieldFlag: () => true,
        getObjectName: () => this.widget.options.objectName
      };
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
      this.initRefList();
    },
    methods: {
      checkContainerMove(evt) {
        return true;
      },
      toggleCard() {
        this.widget.options.folded = !this.widget.options.folded;
      },
      setFolded(folded) {
        this.widget.options.folded = !!folded;
      }
    }
  };
  const _hoisted_1$a = { class: "object-group" };
  function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["object-group-container", [$options.selected ? "selected" : "", $options.customClass]]),
          onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createElementVNode("div", _hoisted_1$a, [
            require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
              list: $props.widget.widgetList,
              "item-key": "id"
            }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
              tag: "div",
              "component-data": { name: "fade", class: "object-group-drag-drop-zone" },
              handle: ".drag-handler",
              onAdd: _cache[0] || (_cache[0] = (evt) => _ctx.onContainerDragAdd(evt, $props.widget.widgetList)),
              onUpdate: _ctx.onContainerDragUpdate,
              move: $options.checkContainerMove
            }), {
              item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
                subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  widget: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget
                }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  field: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget,
                  "design-state": true
                }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
              ]),
              _: 1
            }, 16, ["list", "onUpdate", "move"])
          ])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var objectGroupWidget = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["render", _sfc_render$c], ["__scopeId", "data-v-724603f6"]]);
  var __glob_0_6 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": objectGroupWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var subFormWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$b = {
    name: "sub-form-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    provide() {
      return {
        getSubFormFieldFlag: () => true,
        getSubFormName: () => this.widget.options.name
      };
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    mounted() {
    },
    methods: {
      onSubFormDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        console.log("test", "onSubFormDragAdd");
        this.designer.emitEvent("field-selected", this.widget);
      },
      onSubFormDragEnd(evt) {
        console.log("sub form drag end: ", evt);
      }
    }
  };
  const _hoisted_1$9 = { class: "sub-form-table" };
  function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["sub-form-container", { "selected": $options.selected }]),
          onClick: _cache[1] || (_cache[1] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_el_form, { "label-position": "top" }, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", _hoisted_1$9, [
                require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
                  list: $props.widget.widgetList,
                  "item-key": "id"
                }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
                  tag: "div",
                  "component-data": { name: "fade", class: "sub-form-drag-drop-zone" },
                  handle: ".drag-handler",
                  onAdd: _cache[0] || (_cache[0] = (evt) => $options.onSubFormDragAdd(evt, $props.widget.widgetList)),
                  onEnd: $options.onSubFormDragEnd,
                  onUpdate: _ctx.onContainerDragUpdate,
                  move: _ctx.checkContainerMove
                }), {
                  item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
                    require$$0$1.createElementVNode("div", {
                      class: "sub-form-table-column",
                      style: require$$0$1.normalizeStyle({ width: subWidget.options.columnWidth })
                    }, [
                      (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                        field: subWidget,
                        designer: $props.designer,
                        key: subWidget.id,
                        "parent-list": $props.widget.widgetList,
                        "index-of-parent-list": swIdx,
                        "parent-widget": $props.widget,
                        "design-state": true,
                        "sub-form-item-flag": true
                      }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
                    ], 4)
                  ]),
                  _: 1
                }, 16, ["list", "onEnd", "onUpdate", "move"])
              ])
            ]),
            _: 1
          })
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var subFormWidget = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$b], ["__scopeId", "data-v-30b39229"]]);
  var __glob_0_7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": subFormWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var tabWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$a = {
    name: "tab-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    data() {
      return {
        activeTab: "tab1"
      };
    },
    computed: {
      tabDisplayType() {
        return !this.widget.options.tabType ? "border-card" : this.widget.options.tabType;
      },
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    mounted() {
    },
    methods: {
      onTabClick(evt) {
        let paneName = evt.paneName;
        this.widget.tabs.forEach((tp) => {
          tp.options.active = tp.options.name === paneName;
        });
      }
    }
  };
  const _hoisted_1$8 = { class: "form-widget-list" };
  function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_tab_pane = require$$0$1.resolveComponent("el-tab-pane");
    const _component_el_tabs = require$$0$1.resolveComponent("el-tabs");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["tab-container", { "selected": $options.selected }]),
          onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_el_tabs, {
            type: $options.tabDisplayType,
            "tab-position": $props.widget.options.tabPosition,
            modelValue: $data.activeTab,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.activeTab = $event),
            onTabClick: $options.onTabClick
          }, {
            default: require$$0$1.withCtx(() => [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.tabs, (tab, index2) => {
                return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_tab_pane, {
                  key: index2,
                  label: tab.options.label,
                  name: tab.options.name,
                  onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
                      list: tab.widgetList,
                      "item-key": "id"
                    }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
                      handle: ".drag-handler",
                      tag: "div",
                      "component-data": { name: "fade", class: "drag-drop-zone" },
                      onAdd: (evt) => _ctx.onContainerDragAdd(evt, tab.widgetList),
                      onUpdate: _ctx.onContainerDragUpdate,
                      move: _ctx.checkContainerMove
                    }), {
                      item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
                        require$$0$1.createElementVNode("div", _hoisted_1$8, [
                          subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                            widget: subWidget,
                            designer: $props.designer,
                            key: subWidget.id,
                            "parent-list": tab.widgetList,
                            "index-of-parent-list": swIdx,
                            "parent-widget": $props.widget
                          }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                            field: subWidget,
                            designer: $props.designer,
                            key: subWidget.id,
                            "parent-list": tab.widgetList,
                            "index-of-parent-list": swIdx,
                            "parent-widget": $props.widget,
                            "design-state": true
                          }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
                        ])
                      ]),
                      _: 2
                    }, 1040, ["list", "onAdd", "onUpdate", "move"])
                  ]),
                  _: 2
                }, 1032, ["label", "name"]);
              }), 128))
            ]),
            _: 1
          }, 8, ["type", "tab-position", "modelValue", "onTabClick"])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var tabWidget = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$a], ["__scopeId", "data-v-c3bc4af8"]]);
  var __glob_0_8 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tabWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var tableCellWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$9 = {
    name: "TableCellWidget",
    componentName: "TableCellWidget",
    mixins: [i18n$1, refMixinDesign],
    inject: ["refList"],
    components: __spreadProps(__spreadValues({}, comps$1), {
      SvgIcon
    }),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      rowIndex: Number,
      colIndex: Number,
      rowLength: Number,
      colLength: Number,
      colArray: Array,
      rowArray: Array,
      designer: Object
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      },
      mergeLeftColDisabled() {
        return this.colIndex <= 0 || this.colArray[this.colIndex - 1].options.rowspan !== this.widget.options.rowspan;
      },
      mergeRightColDisabled() {
        let rightColIndex = this.colIndex + this.widget.options.colspan;
        return this.colIndex >= this.colLength - 1 || rightColIndex > this.colLength - 1 || this.colArray[rightColIndex].options.rowspan !== this.widget.options.rowspan;
      },
      mergeWholeRowDisabled() {
        return this.colLength <= 1 || this.colLength === this.widget.options.colspan;
      },
      mergeAboveRowDisabled() {
        return this.rowIndex <= 0 || this.rowArray[this.rowIndex - 1].cols[this.colIndex].options.colspan !== this.widget.options.colspan;
      },
      mergeBelowRowDisabled() {
        let belowRowIndex = this.rowIndex + this.widget.options.rowspan;
        return this.rowIndex >= this.rowLength - 1 || belowRowIndex > this.rowLength - 1 || this.rowArray[belowRowIndex].cols[this.colIndex].options.colspan !== this.widget.options.colspan;
      },
      mergeWholeColDisabled() {
        return this.rowLength <= 1 || this.rowLength === this.widget.options.rowspan;
      },
      undoMergeColDisabled() {
        return this.widget.merged || this.widget.options.colspan <= 1;
      },
      undoMergeRowDisabled() {
        return this.widget.merged || this.widget.options.rowspan <= 1;
      },
      deleteWholeColDisabled() {
        return this.colLength === 1 || this.widget.options.colspan === this.colLength;
      },
      deleteWholeRowDisabled() {
        return this.rowLength === 1 || this.widget.options.rowspan === this.rowLength;
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    methods: {
      selectWidget(widget) {
        this.designer.setSelected(widget);
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      onTableDragEnd(obj, subList) {
      },
      onTableDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", this.widget);
      },
      onTableDragUpdate() {
        this.designer.emitHistoryChange();
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      handleTableCellCommand(command2) {
        if (command2 === "insertLeftCol") {
          this.insertLeftCol();
        } else if (command2 === "insertRightCol") {
          this.insertRightCol();
        } else if (command2 === "insertAboveRow") {
          this.insertAboveRow();
        } else if (command2 === "insertBelowRow") {
          this.insertBelowRow();
        } else if (command2 === "mergeLeftCol") {
          this.mergeLeftCol();
        } else if (command2 === "mergeRightCol") {
          this.mergeRightCol();
        } else if (command2 === "mergeWholeCol") {
          this.mergeWholeCol();
        } else if (command2 === "mergeAboveRow") {
          this.mergeAboveRow();
        } else if (command2 === "mergeBelowRow") {
          this.mergeBelowRow();
        } else if (command2 === "mergeWholeRow") {
          this.mergeWholeRow();
        } else if (command2 === "undoMergeCol") {
          this.undoMergeCol();
        } else if (command2 === "undoMergeRow") {
          this.undoMergeRow();
        } else if (command2 === "deleteWholeCol") {
          this.deleteWholeCol();
        } else if (command2 === "deleteWholeRow") {
          this.deleteWholeRow();
        }
      },
      insertLeftCol() {
        this.designer.insertTableCol(this.parentWidget, this.colIndex, this.rowIndex, true);
      },
      insertRightCol() {
        this.designer.insertTableCol(this.parentWidget, this.colIndex, this.rowIndex, false);
      },
      insertAboveRow() {
        this.designer.insertTableRow(this.parentWidget, this.rowIndex, this.rowIndex, this.colIndex, true);
      },
      insertBelowRow() {
        this.designer.insertTableRow(this.parentWidget, this.rowIndex, this.rowIndex, this.colIndex, false);
      },
      mergeLeftCol() {
        this.designer.mergeTableCol(this.rowArray, this.colArray, this.rowIndex, this.colIndex, true, this.widget);
      },
      mergeRightCol() {
        this.designer.mergeTableCol(this.rowArray, this.colArray, this.rowIndex, this.colIndex, false, this.widget);
      },
      mergeWholeRow() {
        this.designer.mergeTableWholeRow(this.rowArray, this.colArray, this.rowIndex, this.colIndex);
      },
      mergeAboveRow() {
        this.designer.mergeTableRow(this.rowArray, this.rowIndex, this.colIndex, true, this.widget);
      },
      mergeBelowRow() {
        this.designer.mergeTableRow(this.rowArray, this.rowIndex, this.colIndex, false, this.widget);
      },
      mergeWholeCol() {
        this.designer.mergeTableWholeCol(this.rowArray, this.colArray, this.rowIndex, this.colIndex);
      },
      undoMergeCol() {
        this.designer.undoMergeTableCol(this.rowArray, this.rowIndex, this.colIndex, this.widget.options.colspan, this.widget.options.rowspan);
      },
      undoMergeRow() {
        this.designer.undoMergeTableRow(this.rowArray, this.rowIndex, this.colIndex, this.widget.options.colspan, this.widget.options.rowspan);
      },
      deleteWholeCol() {
        this.designer.deleteTableWholeCol(this.rowArray, this.colIndex);
      },
      deleteWholeRow() {
        this.designer.deleteTableWholeRow(this.rowArray, this.rowIndex);
      }
    }
  };
  const _hoisted_1$7 = ["colspan", "rowspan"];
  const _hoisted_2$3 = { class: "form-widget-list" };
  const _hoisted_3$2 = {
    key: 0,
    class: "table-cell-action"
  };
  const _hoisted_4$2 = ["title"];
  const _hoisted_5$1 = ["title"];
  const _hoisted_6$1 = {
    key: 1,
    class: "table-cell-handler"
  };
  function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_dropdown_item = require$$0$1.resolveComponent("el-dropdown-item");
    const _component_el_dropdown_menu = require$$0$1.resolveComponent("el-dropdown-menu");
    const _component_el_dropdown = require$$0$1.resolveComponent("el-dropdown");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("td", {
      class: require$$0$1.normalizeClass(["table-cell", [$options.selected ? "selected" : "", $options.customClass]]),
      style: require$$0$1.normalizeStyle({ width: $props.widget.options.cellWidth + "!important" || "", height: $props.widget.options.cellHeight + "!important" || "", "word-break": !!$props.widget.options.wordBreak ? "break-all" : "normal" }),
      colspan: $props.widget.options.colspan || 1,
      rowspan: $props.widget.options.rowspan || 1,
      onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
    }, [
      require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
        list: $props.widget.widgetList,
        "item-key": "id"
      }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
        tag: "div",
        "component-data": { name: "fade", class: "drag-drop-zone" },
        handle: ".drag-handler",
        onEnd: _cache[0] || (_cache[0] = (evt) => $options.onTableDragEnd(evt, $props.widget.widgetList)),
        onAdd: _cache[1] || (_cache[1] = (evt) => $options.onTableDragAdd(evt, $props.widget.widgetList)),
        onUpdate: $options.onTableDragUpdate,
        move: $options.checkContainerMove
      }), {
        item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
          require$$0$1.createElementVNode("div", _hoisted_2$3, [
            subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
              widget: subWidget,
              designer: $props.designer,
              key: subWidget.id,
              "parent-list": $props.widget.widgetList,
              "index-of-parent-list": swIdx,
              "parent-widget": $props.widget
            }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
              field: subWidget,
              designer: $props.designer,
              key: subWidget.id,
              "parent-list": $props.widget.widgetList,
              "index-of-parent-list": swIdx,
              "parent-widget": $props.widget,
              "design-state": true
            }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
          ])
        ]),
        _: 1
      }, 16, ["list", "onUpdate", "move"]),
      $props.designer.selectedId === $props.widget.id && $props.widget.type === "table-cell" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_3$2, [
        require$$0$1.createElementVNode("i", {
          title: _ctx.i18nt("designer.hint.selectParentWidget"),
          onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.selectParentWidget(), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-back" })
        ], 8, _hoisted_4$2),
        require$$0$1.createVNode(_component_el_dropdown, {
          trigger: "click",
          onCommand: $options.handleTableCellCommand,
          size: "small"
        }, {
          dropdown: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_el_dropdown_menu, null, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_dropdown_item, { command: "insertLeftCol" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertColumnToLeft")), 1)
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_dropdown_item, { command: "insertRightCol" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertColumnToRight")), 1)
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_dropdown_item, { command: "insertAboveRow" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertRowAbove")), 1)
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_dropdown_item, { command: "insertBelowRow" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.insertRowBelow")), 1)
                  ]),
                  _: 1
                }),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeLeftCol",
                  disabled: $options.mergeLeftColDisabled,
                  divided: ""
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeLeftColumn")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeRightCol",
                  disabled: $options.mergeRightColDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeRightColumn")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeWholeRow",
                  disabled: $options.mergeWholeRowDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeEntireRow")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeAboveRow",
                  disabled: $options.mergeAboveRowDisabled,
                  divided: ""
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeRowAbove")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeBelowRow",
                  disabled: $options.mergeBelowRowDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeRowBelow")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "mergeWholeCol",
                  disabled: $options.mergeWholeColDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.mergeEntireColumn")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "undoMergeRow",
                  disabled: $options.undoMergeRowDisabled,
                  divided: ""
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.undoMergeRow")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "undoMergeCol",
                  disabled: $options.undoMergeColDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.undoMergeCol")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "deleteWholeCol",
                  disabled: $options.deleteWholeColDisabled,
                  divided: ""
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.deleteEntireCol")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"]),
                require$$0$1.createVNode(_component_el_dropdown_item, {
                  command: "deleteWholeRow",
                  disabled: $options.deleteWholeRowDisabled
                }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.deleteEntireRow")), 1)
                  ]),
                  _: 1
                }, 8, ["disabled"])
              ]),
              _: 1
            })
          ]),
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("i", {
              title: _ctx.i18nt("designer.hint.cellSetting")
            }, [
              require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-menu" })
            ], 8, _hoisted_5$1)
          ]),
          _: 1
        }, 8, ["onCommand"])
      ])) : require$$0$1.createCommentVNode("", true),
      $props.designer.selectedId === $props.widget.id && $props.widget.type === "table-cell" ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_6$1, [
        require$$0$1.createElementVNode("i", null, require$$0$1.toDisplayString(_ctx.i18nt("designer.widgetLabel." + $props.widget.type)), 1)
      ])) : require$$0$1.createCommentVNode("", true)
    ], 14, _hoisted_1$7);
  }
  var TableCellWidget = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9], ["__scopeId", "data-v-d0c6273c"]]);
  var __glob_0_9 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": TableCellWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var tableWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$8 = {
    name: "table-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: {
      ContainerWrapper,
      TableCellWidget
    },
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    watch: {},
    created() {
      this.initRefList();
    },
    mounted() {
    },
    methods: {}
  };
  const _hoisted_1$6 = { class: "table-layout" };
  function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_table_cell_widget = require$$0$1.resolveComponent("table-cell-widget");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["table-container", [$options.selected ? "selected" : "", $options.customClass]]),
          onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createElementVNode("table", _hoisted_1$6, [
            require$$0$1.createElementVNode("tbody", null, [
              (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList($props.widget.rows, (row, rowIdx) => {
                return require$$0$1.openBlock(), require$$0$1.createElementBlock("tr", {
                  key: row.id
                }, [
                  (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, null, require$$0$1.renderList(row.cols, (colWidget, colIdx) => {
                    return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                      !colWidget.merged ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_table_cell_widget, {
                        widget: colWidget,
                        designer: $props.designer,
                        key: colWidget.id,
                        "parent-list": $props.widget.cols,
                        "row-index": rowIdx,
                        "row-length": $props.widget.rows.length,
                        "col-index": colIdx,
                        "col-length": row.cols.length,
                        "col-array": row.cols,
                        "row-array": $props.widget.rows,
                        "parent-widget": $props.widget
                      }, null, 8, ["widget", "designer", "parent-list", "row-index", "row-length", "col-index", "col-length", "col-array", "row-array", "parent-widget"])) : require$$0$1.createCommentVNode("", true)
                    ], 64);
                  }), 256))
                ]);
              }), 128))
            ])
          ])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var tableWidget = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8], ["__scopeId", "data-v-3f1a7449"]]);
  var __glob_0_10 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": tableWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var treeWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  let id = 1e3;
  const _sfc_main$7 = {
    name: "TreeWidget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    data() {
      return {
        isExpanded: true,
        isChecked: false,
        currentKey: "",
        filterText: "",
        defaultProps: {
          children: "children",
          label: "label"
        }
      };
    },
    watch: {
      filterText(val) {
        this.$refs.tree.filter(val);
      }
    },
    created() {
      this.initRefList();
    },
    methods: {
      append(data2) {
        this.$prompt(this.i18nt("designer.setting.inputNodeName"), this.i18nt("designer.setting.tips"), {
          confirmButtonText: this.i18nt("designer.hint.confirm"),
          cancelButtonText: this.i18nt("designer.hint.cancel")
        }).then(({ value: value2 }) => {
          const newChild = { id: id++, label: value2, children: [] };
          if (!data2.children) {
            data2.children = [];
          }
          data2.children.push(newChild);
        }).catch((err) => {
          console.error(err);
        });
      },
      remove(node, data2) {
        this.$confirm(this.i18nt("designer.setting.deleteNode"), this.i18nt("designer.setting.tips"), {
          confirmButtonText: this.i18nt("designer.hint.confirm"),
          cancelButtonText: this.i18nt("designer.hint.cancel"),
          type: "warning"
        }).then(() => {
          const parent = node.parent;
          const children = parent.data.children || parent.data;
          const index2 = children.findIndex((d) => d.id === data2.id);
          children.splice(index2, 1);
          this.$message({
            type: "success",
            message: "\u5220\u9664\u6210\u529F!"
          });
        }).catch((err) => {
          console.error(err);
        });
      },
      filterNode(value2, data2) {
        if (!value2)
          return true;
        return data2.label.indexOf(value2) !== -1;
      },
      setNodeExpanded(node, flag) {
        node.expanded = flag;
        for (let i2 = 0; i2 < node.childNodes.length; i2++) {
          node.childNodes[i2].expanded = flag;
          if (node.childNodes[i2].childNodes.length > 0) {
            this.setNodeExpanded(node.childNodes[i2], flag);
          }
        }
      },
      setNodeChecked(node, flag) {
        node.checked = flag;
        for (let i2 = 0; i2 < node.childNodes.length; i2++) {
          node.childNodes[i2].checked = flag;
          if (node.childNodes[i2].childNodes.length > 0) {
            this.setNodeChecked(node.childNodes[i2], flag);
          }
        }
      },
      getNativeTree() {
        return this.$refs.tree;
      },
      setTreeData(data2) {
        this.widget.options.treeData = data2;
        this.currentKey = data2[0].id;
      },
      getTreeData() {
        return this.widget.options.treeData;
      },
      expandAllNodes(flag) {
        this.isExpanded = flag || !this.isExpanded;
        this.setNodeExpanded(this.$refs.tree.store.root, this.isExpanded);
      },
      checkAllNodes(flag) {
        this.isChecked = flag || !this.isChecked;
        this.setNodeChecked(this.$refs.tree.store.root, this.isChecked);
      }
    }
  };
  const _hoisted_1$5 = { class: "custom-tree-node" };
  const _hoisted_2$2 = { key: 0 };
  function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_input = require$$0$1.resolveComponent("el-input");
    const _component_el_button = require$$0$1.resolveComponent("el-button");
    const _component_el_button_group = require$$0$1.resolveComponent("el-button-group");
    const _component_el_tree = require$$0$1.resolveComponent("el-tree");
    const _component_el_main = require$$0$1.resolveComponent("el-main");
    const _component_el_container = require$$0$1.resolveComponent("el-container");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["tree-container", { "selected": $options.selected }]),
          onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_el_container, null, {
            default: require$$0$1.withCtx(() => [
              require$$0$1.createVNode(_component_el_main, { style: { "align-items": "baseline" } }, {
                default: require$$0$1.withCtx(() => [
                  $props.widget.options.filter ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_input, {
                    key: 0,
                    size: $props.widget.options.size,
                    placeholder: _ctx.i18nt("designer.setting.enterForQuery"),
                    modelValue: $data.filterText,
                    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.filterText = $event)
                  }, null, 8, ["size", "placeholder", "modelValue"])) : require$$0$1.createCommentVNode("", true),
                  require$$0$1.createVNode(_component_el_button_group, null, {
                    default: require$$0$1.withCtx(() => [
                      $props.widget.options.expandRetractAllNode ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                        key: 0,
                        type: "primary",
                        round: "",
                        plain: "",
                        size: $props.widget.options.size,
                        onClick: _cache[1] || (_cache[1] = ($event) => $options.expandAllNodes())
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.expandRetractAllNode")), 1)
                        ]),
                        _: 1
                      }, 8, ["size"])) : require$$0$1.createCommentVNode("", true),
                      $props.widget.options.selectClearAllNode && $props.widget.options.showCheckBox ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_button, {
                        key: 1,
                        type: "primary",
                        round: "",
                        plain: "",
                        size: $props.widget.options.size,
                        onClick: _cache[2] || (_cache[2] = ($event) => $options.checkAllNodes())
                      }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.selectClearAllNode")), 1)
                        ]),
                        _: 1
                      }, 8, ["size"])) : require$$0$1.createCommentVNode("", true)
                    ]),
                    _: 1
                  }),
                  require$$0$1.createVNode(_component_el_tree, {
                    data: $props.widget.options.treeData,
                    props: $data.defaultProps,
                    ref: "tree",
                    border: "",
                    lazy: $props.widget.options.lazy,
                    "node-key": "id",
                    "highlight-current": "",
                    "current-node-key": $data.currentKey,
                    "show-checkbox": $props.widget.options.showCheckBox,
                    "expand-on-click-node": $props.widget.options.expandOnClickNode,
                    "default-expand-all": $props.widget.options.defaultExpandAllNode,
                    draggable: $props.widget.options.draggable,
                    "check-strictly": $props.widget.options.checkStrictly,
                    "filter-node-method": $options.filterNode
                  }, {
                    default: require$$0$1.withCtx(({ node, data: data2 }) => [
                      require$$0$1.createElementVNode("span", _hoisted_1$5, [
                        require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString(node.label), 1),
                        $props.widget.options.nodeEdit ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", _hoisted_2$2, [
                          require$$0$1.createVNode(_component_el_button, {
                            type: "primary",
                            link: "",
                            size: $props.widget.options.size
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.add")), 1)
                            ]),
                            _: 1
                          }, 8, ["size"]),
                          require$$0$1.createVNode(_component_el_button, {
                            type: "primary",
                            link: "",
                            size: $props.widget.options.size
                          }, {
                            default: require$$0$1.withCtx(() => [
                              require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("designer.setting.delete")), 1)
                            ]),
                            _: 1
                          }, 8, ["size"])
                        ])) : require$$0$1.createCommentVNode("", true)
                      ])
                    ]),
                    _: 1
                  }, 8, ["data", "props", "lazy", "current-node-key", "show-checkbox", "expand-on-click-node", "default-expand-all", "draggable", "check-strictly", "filter-node-method"])
                ]),
                _: 1
              })
            ]),
            _: 1
          })
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var treeWidget = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7], ["__scopeId", "data-v-777203ed"]]);
  var __glob_0_11 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": treeWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var vfDialogWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$6 = {
    name: "vf-dialog-widget",
    componentName: "VfDialogWidget",
    mixins: [i18n$1, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    data() {
      return {};
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
      this.initRefList();
    },
    methods: {
      onDialogDragEnd(evt, subList) {
      },
      onDialogDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", this.widget);
      },
      onDialogDragUpdate() {
        this.designer.emitHistoryChange();
      },
      selectWidget(widget) {
        console.log("id: " + widget.id);
        this.designer.setSelected(widget);
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
      },
      removeWidget() {
        if (!!this.parentList) {
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.emitHistoryChange();
          });
        }
      }
    }
  };
  const _hoisted_1$4 = { class: "vf-dialog-drop-zone" };
  function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["dialog-container", [$options.selected ? "selected" : "", $options.customClass]]),
          onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
            list: $props.widget.widgetList,
            "item-key": "id"
          }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
            handle: ".drag-handler",
            onEnd: _cache[0] || (_cache[0] = (evt) => $options.onDialogDragEnd(evt, $props.widget.widgetList)),
            onAdd: _cache[1] || (_cache[1] = (evt) => $options.onDialogDragAdd(evt, $props.widget.widgetList)),
            onUpdate: $options.onDialogDragUpdate,
            move: $options.checkContainerMove
          }), {
            item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
              require$$0$1.createElementVNode("div", _hoisted_1$4, [
                subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  widget: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget
                }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  field: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget,
                  "design-state": true
                }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
              ])
            ]),
            _: 1
          }, 16, ["list", "onUpdate", "move"])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var vfDialogWidget = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6], ["__scopeId", "data-v-f85dd3b2"]]);
  var __glob_0_12 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDialogWidget
  }, Symbol.toStringTag, { value: "Module" }));
  var vfDrawerWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$5 = {
    name: "vf-drawer-widget",
    componentName: "VfDialogWidget",
    mixins: [i18n$1, refMixinDesign],
    inject: ["refList"],
    components: __spreadValues({
      ContainerWrapper
    }, comps$1),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    data() {
      return {};
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
      this.initRefList();
    },
    methods: {
      onDrawerDragEnd(evt, subList) {
      },
      onDrawerDragAdd(evt, subList) {
        const newIndex2 = evt.newIndex;
        if (!!subList[newIndex2]) {
          this.designer.setSelected(subList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", this.widget);
      },
      onDrawerDragUpdate() {
        this.designer.emitHistoryChange();
      },
      selectWidget(widget) {
        console.log("id: " + widget.id);
        this.designer.setSelected(widget);
      },
      checkContainerMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      selectParentWidget() {
        if (this.parentWidget) {
          this.designer.setSelected(this.parentWidget);
        } else {
          this.designer.clearSelected();
        }
      },
      moveUpWidget() {
        this.designer.moveUpWidget(this.parentList, this.indexOfParentList);
      },
      moveDownWidget() {
        this.designer.moveDownWidget(this.parentList, this.indexOfParentList);
      },
      removeWidget() {
        if (!!this.parentList) {
          let nextSelected = null;
          if (this.parentList.length === 1) {
            if (!!this.parentWidget) {
              nextSelected = this.parentWidget;
            }
          } else if (this.parentList.length === 1 + this.indexOfParentList) {
            nextSelected = this.parentList[this.indexOfParentList - 1];
          } else {
            nextSelected = this.parentList[this.indexOfParentList + 1];
          }
          this.$nextTick(() => {
            this.parentList.splice(this.indexOfParentList, 1);
            this.designer.setSelected(nextSelected);
            this.designer.emitHistoryChange();
          });
        }
      }
    }
  };
  const _hoisted_1$3 = { class: "vf-drawer-drop-zone" };
  function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createElementVNode("div", {
          class: require$$0$1.normalizeClass(["drawer-container", [$options.selected ? "selected" : "", $options.customClass]]),
          onClick: _cache[2] || (_cache[2] = require$$0$1.withModifiers(($event) => $options.selectWidget($props.widget), ["stop"]))
        }, [
          require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
            list: $props.widget.widgetList,
            "item-key": "id"
          }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
            handle: ".drag-handler",
            onEnd: _cache[0] || (_cache[0] = (evt) => $options.onDrawerDragEnd(evt, $props.widget.widgetList)),
            onAdd: _cache[1] || (_cache[1] = (evt) => $options.onDrawerDragAdd(evt, $props.widget.widgetList)),
            onUpdate: $options.onDrawerDragUpdate,
            move: $options.checkContainerMove
          }), {
            item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
              require$$0$1.createElementVNode("div", _hoisted_1$3, [
                subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  widget: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget
                }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  field: subWidget,
                  designer: $props.designer,
                  key: subWidget.id,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget,
                  "design-state": true
                }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
              ])
            ]),
            _: 1
          }, 16, ["list", "onUpdate", "move"])
        ], 2)
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var vfDrawerWidget = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-87d1b93c"]]);
  var __glob_0_13 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    "default": vfDrawerWidget
  }, Symbol.toStringTag, { value: "Module" }));
  const modules = { "./button-group-widget.vue": __glob_0_0, "./container-wrapper.vue": __glob_0_1, "./data-table-widget.vue": __glob_0_2, "./grid-col-widget.vue": __glob_0_3, "./grid-sub-form-widget.vue": __glob_0_4, "./grid-widget.vue": __glob_0_5, "./object-group-widget.vue": __glob_0_6, "./sub-form-widget.vue": __glob_0_7, "./tab-widget.vue": __glob_0_8, "./table-cell-widget.vue": __glob_0_9, "./table-widget.vue": __glob_0_10, "./tree-widget.vue": __glob_0_11, "./vf-dialog-widget.vue": __glob_0_12, "./vf-drawer-widget.vue": __glob_0_13 };
  var ContainerWidgets = {
    install(app) {
      for (const path in modules) {
        let cname = modules[path].default.name;
        app.component(cname, modules[path].default);
      }
    }
  };
  var index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
  const _sfc_main$4 = {
    name: "VFormWidget",
    componentName: "VFormWidget",
    mixins: [i18n$1],
    components: __spreadValues({}, comps$1),
    props: {
      designer: Object,
      formConfig: Object,
      optionData: {
        type: Object,
        default: () => ({})
      },
      globalDsv: {
        type: Object,
        default: () => ({})
      }
    },
    provide() {
      return {
        refList: this.widgetRefList,
        getFormConfig: () => this.formConfig,
        getGlobalDsv: () => this.globalDsv,
        globalOptionData: this.optionData,
        getOptionData: () => this.optionData,
        getReadMode: () => false,
        globalModel: {
          formModel: this.formModel
        },
        getSubFormFieldFlag: () => false,
        getSubFormName: () => "",
        getObjectFieldFlag: () => false,
        getObjectName: () => "",
        getDSResultCache: () => this.dsResultCache
      };
    },
    inject: ["getDesignerConfig"],
    data() {
      return {
        formModel: {},
        widgetRefList: {},
        dsResultCache: {}
      };
    },
    computed: {
      labelPosition() {
        if (!!this.designer.formConfig && !!this.designer.formConfig.labelPosition) {
          return this.designer.formConfig.labelPosition;
        }
        return "left";
      },
      size() {
        if (!!this.designer.formConfig && !!this.designer.formConfig.size) {
          return this.designer.formConfig.size;
        }
        return "default";
      },
      customClass() {
        return this.designer.formConfig.customClass || "";
      },
      layoutType() {
        return this.designer.getLayoutType();
      }
    },
    watch: {
      "designer.widgetList": {
        deep: true,
        handler(val) {
        }
      },
      "designer.formConfig": {
        deep: true,
        handler(val) {
        }
      }
    },
    created() {
      this.designer.loadPresetCssCode(this.getDesignerConfig().presetCssCode);
    },
    mounted() {
      this.disableFirefoxDefaultDrop();
      this.designer.registerFormWidget(this);
    },
    methods: {
      getWidgetName(widget) {
        return widget.type + "-widget";
      },
      disableFirefoxDefaultDrop() {
        let isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
        if (isFirefox) {
          document.body.ondrop = function(event) {
            event.stopPropagation();
            event.preventDefault();
          };
        }
      },
      onDragEnd(evt) {
      },
      onDragAdd(evt) {
        const newIndex2 = evt.newIndex;
        if (!!this.designer.widgetList[newIndex2]) {
          this.designer.setSelected(this.designer.widgetList[newIndex2]);
        }
        this.designer.emitHistoryChange();
        this.designer.emitEvent("field-selected", null);
      },
      onDragUpdate() {
        this.designer.emitHistoryChange();
      },
      checkMove(evt) {
        return this.designer.checkWidgetMove(evt);
      },
      getFormData() {
        return this.formModel;
      },
      getWidgetRef(widgetName, showError = false) {
        let foundRef = this.widgetRefList[widgetName];
        if (!foundRef && !!showError) {
          this.$message.error(this.i18nt("designer.hint.refNotFound") + widgetName);
        }
        return foundRef;
      },
      getSelectedWidgetRef() {
        let wName = this.designer.selectedWidgetName;
        return this.getWidgetRef(wName);
      },
      clearWidgetRefList() {
        Object.keys(this.widgetRefList).forEach((key) => {
          delete this.widgetRefList[key];
        });
      },
      deleteWidgetRef(widgetRefName) {
        delete this.widgetRefList[widgetRefName];
      },
      deletedChildrenRef(childrenRefNames) {
        childrenRefNames.forEach((childRefName) => {
          delete this.widgetRefList[childRefName];
        });
      }
    }
  };
  const _hoisted_1$2 = { class: "form-widget-container" };
  const _hoisted_2$1 = {
    key: 0,
    class: "no-widget-hint"
  };
  const _hoisted_3$1 = { class: "form-widget-canvas" };
  const _hoisted_4$1 = { class: "transition-group-el" };
  function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_form = require$$0$1.resolveComponent("el-form");
    return require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_1$2, [
      require$$0$1.createVNode(_component_el_form, {
        class: require$$0$1.normalizeClass(["full-height-width widget-form", [$options.customClass, $options.layoutType + "-layout"]]),
        "label-position": $options.labelPosition,
        size: $options.size,
        "validate-on-rule-change": false
      }, {
        default: require$$0$1.withCtx(() => [
          $props.designer.widgetList.length === 0 ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("div", _hoisted_2$1, require$$0$1.toDisplayString(_ctx.i18nt("designer.noWidgetHint")), 1)) : require$$0$1.createCommentVNode("", true),
          require$$0$1.createElementVNode("div", _hoisted_3$1, [
            require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
              list: $props.designer.widgetList,
              "item-key": "id"
            }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
              tag: "div",
              "component-data": { name: "fade", class: "canvas-drag-drop-zone" },
              handle: ".drag-handler",
              onEnd: $options.onDragEnd,
              onAdd: $options.onDragAdd,
              onUpdate: $options.onDragUpdate,
              move: $options.checkMove
            }), {
              item: require$$0$1.withCtx(({ element: widget, index: index2 }) => [
                require$$0$1.createElementVNode("div", _hoisted_4$1, [
                  widget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getWidgetName(widget)), {
                    widget,
                    designer: $props.designer,
                    key: widget.id,
                    "parent-list": $props.designer.widgetList,
                    "index-of-parent-list": index2,
                    "parent-widget": null
                  }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent($options.getWidgetName(widget)), {
                    field: widget,
                    designer: $props.designer,
                    key: widget.id,
                    "parent-list": $props.designer.widgetList,
                    "index-of-parent-list": index2,
                    "parent-widget": null,
                    "design-state": true
                  }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list"]))
                ])
              ]),
              _: 1
            }, 16, ["list", "onEnd", "onAdd", "onUpdate", "move"])
          ])
        ]),
        _: 1
      }, 8, ["label-position", "class", "size"])
    ]);
  }
  var VFormWidget = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-9f47222c"]]);
  function mitt(n) {
    return { all: n = n || new Map(), on: function(t2, e) {
      var i2 = n.get(t2);
      i2 ? i2.push(e) : n.set(t2, [e]);
    }, off: function(t2, e) {
      var i2 = n.get(t2);
      i2 && (e ? i2.splice(i2.indexOf(e) >>> 0, 1) : n.set(t2, []));
    }, emit: function(t2, e) {
      var i2 = n.get(t2);
      i2 && i2.slice().map(function(n2) {
        n2(e);
      }), (i2 = n.get("*")) && i2.slice().map(function(n2) {
        n2(t2, e);
      });
    } };
  }
  const instance = mitt();
  const eventBus = {};
  eventBus.$on = instance.on;
  eventBus.$off = instance.off;
  eventBus.$emit = instance.emit;
  function createDesigner(vueInstance) {
    let defaultFormConfig = deepClone(getDefaultFormConfig());
    return {
      widgetList: [],
      formConfig: { cssCode: "" },
      selectedId: null,
      selectedWidget: null,
      selectedWidgetName: null,
      vueInstance,
      formWidget: null,
      cssClassList: [],
      historyData: {
        index: -1,
        maxStep: 20,
        steps: []
      },
      initDesigner(resetFormJson) {
        this.widgetList = [];
        this.formConfig = deepClone(defaultFormConfig);
        if (!resetFormJson) {
          this.initHistoryData();
        }
      },
      clearDesigner(skipHistoryChange) {
        let emptyWidgetListFlag = this.widgetList.length === 0;
        this.widgetList = [];
        this.selectedId = null;
        this.selectedWidgetName = null;
        this.selectedWidget = {};
        overwriteObj(this.formConfig, defaultFormConfig);
        if (!!skipHistoryChange)
          ;
        else if (!emptyWidgetListFlag) {
          this.emitHistoryChange();
        } else {
          this.saveCurrentHistoryStep();
        }
      },
      loadPresetCssCode(preCssCode) {
        if (this.formConfig.cssCode === "" && !!preCssCode) {
          this.formConfig.cssCode = preCssCode;
        }
      },
      getLayoutType() {
        return this.formConfig.layoutType || "PC";
      },
      changeLayoutType(newType) {
        this.formConfig.layoutType = newType;
      },
      getImportTemplate() {
        return {
          widgetList: [],
          formConfig: deepClone(defaultFormConfig)
        };
      },
      loadFormJson(formJson) {
        let modifiedFlag = false;
        if (!!formJson && !!formJson.widgetList) {
          this.formWidget.clearWidgetRefList();
          this.widgetList = formJson.widgetList;
          modifiedFlag = true;
        }
        if (!!formJson && !!formJson.formConfig) {
          overwriteObj(this.formConfig, formJson.formConfig);
          modifiedFlag = true;
        }
        if (modifiedFlag) {
          this.emitEvent("form-json-imported", []);
        }
        return modifiedFlag;
      },
      setSelected(selected) {
        if (!selected) {
          this.clearSelected();
          return;
        }
        this.selectedWidget = selected;
        if (!!selected.id) {
          this.selectedId = selected.id;
          this.selectedWidgetName = selected.options.name;
        }
      },
      updateSelectedWidgetNameAndLabel(selectedWidget, newName, newLabel) {
        this.selectedWidgetName = newName;
        if (!!newLabel && Object.keys(selectedWidget.options).indexOf("label") > -1) {
          selectedWidget.options.label = newLabel;
        }
      },
      clearSelected() {
        this.selectedId = null;
        this.selectedWidgetName = null;
        this.selectedWidget = {};
      },
      checkWidgetMove(evt) {
        if (!!evt.draggedContext && !!evt.draggedContext.element) {
          let wgCategory = evt.draggedContext.element.category;
          let wgType = evt.draggedContext.element.type + "";
          if (!!evt.to) {
            if (evt.to.className === "sub-form-drag-drop-zone" && wgCategory === "container") {
              return false;
            }
            if (evt.to.className === "grid-sub-form-drag-drop-zone" && wgType !== "grid") {
              return false;
            }
            if (evt.to.className === "vf-dialog-drop-zone" && (wgType === "vf-dialog" || wgType === "vf-drawer")) {
              return false;
            }
            if (evt.to.className === "vf-drawer-drop-zone" && (wgType === "vf-dialog" || wgType === "vf-drawer")) {
              return false;
            }
            if (evt.to.className !== "form-widget-canvas" && evt.to.className !== "canvas-drag-drop-zone" && (wgType === "vf-dialog" || wgType === "vf-drawer")) {
              return false;
            }
            if (evt.to.className === "object-group-drag-drop-zone" && (wgType === "object-group" || wgType === "sub-form" || wgType === "grid-sub-form" || wgType === "table-sub-form" || wgType === "vf-dialog" || wgType === "vf-drawer")) {
              return false;
            }
          }
        }
        return true;
      },
      checkFieldMove(evt) {
        if (!!evt.draggedContext && !!evt.draggedContext.element) {
          evt.draggedContext.element.category;
          let wgType = evt.draggedContext.element.type + "";
          if (!!evt.to) {
            if ((evt.to.className === "sub-form-table" || evt.to.className === "grid-sub-form") && wgType === "slot") {
              return false;
            }
            if (evt.to.className === "grid-sub-form" && wgType !== "grid") {
              return false;
            }
          }
        }
        return true;
      },
      appendTableRow(widget) {
        let rowIdx = widget.rows.length;
        let newRow = deepClone(widget.rows[widget.rows.length - 1]);
        newRow.id = "table-row-" + generateId();
        newRow.merged = false;
        newRow.cols.forEach((col) => {
          col.id = "table-cell-" + generateId();
          col.options.name = col.id;
          col.merged = false;
          col.options.colspan = 1;
          col.options.rowspan = 1;
          col.widgetList.length = 0;
        });
        widget.rows.splice(rowIdx, 0, newRow);
        this.emitHistoryChange();
      },
      appendTableCol(widget) {
        let colIdx = widget.rows[0].cols.length;
        widget.rows.forEach((row) => {
          let newCol = deepClone(this.getContainerByType("table-cell"));
          newCol.id = "table-cell-" + generateId();
          newCol.options.name = newCol.id;
          newCol.merged = false;
          newCol.options.colspan = 1;
          newCol.options.rowspan = 1;
          newCol.widgetList.length = 0;
          row.cols.splice(colIdx, 0, newCol);
        });
        this.emitHistoryChange();
      },
      insertTableRow(widget, insertPos, cloneRowIdx, curCol, aboveFlag) {
        let newRowIdx = !!aboveFlag ? insertPos : insertPos + 1;
        if (!aboveFlag) {
          let tmpRowIdx = newRowIdx;
          let rowFoundFlag = false;
          while (tmpRowIdx < widget.rows.length) {
            if (!widget.rows[tmpRowIdx].cols[curCol].merged) {
              newRowIdx = tmpRowIdx;
              rowFoundFlag = true;
              break;
            } else {
              tmpRowIdx++;
            }
          }
          if (!rowFoundFlag) {
            newRowIdx = widget.rows.length;
          }
        }
        let newRow = deepClone(widget.rows[cloneRowIdx]);
        newRow.id = "table-row-" + generateId();
        newRow.merged = false;
        newRow.cols.forEach((col) => {
          col.id = "table-cell-" + generateId();
          col.options.name = col.id;
          col.merged = false;
          col.options.colspan = 1;
          col.options.rowspan = 1;
          col.widgetList.length = 0;
        });
        widget.rows.splice(newRowIdx, 0, newRow);
        let colNo = 0;
        while (newRowIdx < widget.rows.length - 1 && colNo < widget.rows[0].cols.length) {
          const cellOfNextRow = widget.rows[newRowIdx + 1].cols[colNo];
          const rowMerged = cellOfNextRow.merged;
          if (!!rowMerged) {
            let rowArray = widget.rows;
            let unMergedCell = {};
            let startRowIndex = null;
            for (let i2 = newRowIdx; i2 >= 0; i2--) {
              if (!rowArray[i2].cols[colNo].merged && rowArray[i2].cols[colNo].options.rowspan > 1) {
                startRowIndex = i2;
                unMergedCell = rowArray[i2].cols[colNo];
                break;
              }
            }
            if (!!unMergedCell.options) {
              let newRowspan = unMergedCell.options.rowspan + 1;
              this.setPropsOfMergedRows(widget.rows, startRowIndex, colNo, unMergedCell.options.colspan, newRowspan);
              colNo += unMergedCell.options.colspan;
            } else {
              colNo += 1;
            }
          } else {
            colNo += cellOfNextRow.options.colspan || 1;
          }
        }
        this.emitHistoryChange();
      },
      insertTableCol(widget, insertPos, curRow, leftFlag) {
        let newColIdx = !!leftFlag ? insertPos : insertPos + 1;
        if (!leftFlag) {
          let tmpColIdx = newColIdx;
          let colFoundFlag = false;
          while (tmpColIdx < widget.rows[curRow].cols.length) {
            if (!widget.rows[curRow].cols[tmpColIdx].merged) {
              newColIdx = tmpColIdx;
              colFoundFlag = true;
              break;
            } else {
              tmpColIdx++;
            }
            if (!colFoundFlag) {
              newColIdx = widget.rows[curRow].cols.length;
            }
          }
        }
        widget.rows.forEach((row) => {
          let newCol = deepClone(this.getContainerByType("table-cell"));
          newCol.id = "table-cell-" + generateId();
          newCol.options.name = newCol.id;
          newCol.merged = false;
          newCol.options.colspan = 1;
          newCol.options.rowspan = 1;
          newCol.widgetList.length = 0;
          row.cols.splice(newColIdx, 0, newCol);
        });
        let rowNo = 0;
        while (newColIdx < widget.rows[0].cols.length - 1 && rowNo < widget.rows.length) {
          const cellOfNextCol = widget.rows[rowNo].cols[newColIdx + 1];
          const colMerged = cellOfNextCol.merged;
          if (!!colMerged) {
            let colArray = widget.rows[rowNo].cols;
            let unMergedCell = {};
            let startColIndex = null;
            for (let i2 = newColIdx; i2 >= 0; i2--) {
              if (!colArray[i2].merged && colArray[i2].options.colspan > 1) {
                startColIndex = i2;
                unMergedCell = colArray[i2];
                break;
              }
            }
            if (!!unMergedCell.options) {
              let newColspan = unMergedCell.options.colspan + 1;
              this.setPropsOfMergedCols(widget.rows, rowNo, startColIndex, newColspan, unMergedCell.options.rowspan);
              rowNo += unMergedCell.options.rowspan;
            } else {
              rowNo += 1;
            }
          } else {
            rowNo += cellOfNextCol.options.rowspan || 1;
          }
        }
        this.emitHistoryChange();
      },
      setPropsOfMergedCols(rowArray, startRowIndex, startColIndex, newColspan, rowspan) {
        for (let i2 = startRowIndex; i2 < startRowIndex + rowspan; i2++) {
          for (let j = startColIndex; j < startColIndex + newColspan; j++) {
            if (i2 === startRowIndex && j === startColIndex) {
              rowArray[i2].cols[j].options.colspan = newColspan;
              continue;
            }
            rowArray[i2].cols[j].merged = true;
            rowArray[i2].cols[j].options.colspan = newColspan;
            rowArray[i2].cols[j].widgetList = [];
          }
        }
      },
      setPropsOfMergedRows(rowArray, startRowIndex, startColIndex, colspan, newRowspan) {
        for (let i2 = startRowIndex; i2 < startRowIndex + newRowspan; i2++) {
          for (let j = startColIndex; j < startColIndex + colspan; j++) {
            if (i2 === startRowIndex && j === startColIndex) {
              rowArray[i2].cols[j].options.rowspan = newRowspan;
              continue;
            }
            rowArray[i2].cols[j].merged = true;
            rowArray[i2].cols[j].options.rowspan = newRowspan;
            rowArray[i2].cols[j].widgetList = [];
          }
        }
      },
      setPropsOfSplitCol(rowArray, startRowIndex, startColIndex, colspan, rowspan) {
        for (let i2 = startRowIndex; i2 < startRowIndex + rowspan; i2++) {
          for (let j = startColIndex; j < startColIndex + colspan; j++) {
            rowArray[i2].cols[j].merged = false;
            rowArray[i2].cols[j].options.rowspan = 1;
            rowArray[i2].cols[j].options.colspan = 1;
          }
        }
      },
      setPropsOfSplitRow(rowArray, startRowIndex, startColIndex, colspan, rowspan) {
        for (let i2 = startRowIndex; i2 < startRowIndex + rowspan; i2++) {
          for (let j = startColIndex; j < startColIndex + colspan; j++) {
            rowArray[i2].cols[j].merged = false;
            rowArray[i2].cols[j].options.rowspan = 1;
            rowArray[i2].cols[j].options.colspan = 1;
          }
        }
      },
      mergeTableCol(rowArray, colArray, curRow, curCol, leftFlag, cellWidget) {
        let mergedColIdx = !!leftFlag ? curCol : curCol + colArray[curCol].options.colspan;
        let remainedColIdx = !!leftFlag ? curCol - 1 : curCol;
        if (!!leftFlag) {
          let tmpColIdx = remainedColIdx;
          while (tmpColIdx >= 0) {
            if (!rowArray[curRow].cols[tmpColIdx].merged) {
              remainedColIdx = tmpColIdx;
              break;
            } else {
              tmpColIdx--;
            }
          }
        }
        if (!!colArray[mergedColIdx].widgetList && colArray[mergedColIdx].widgetList.length > 0) {
          if (!colArray[remainedColIdx].widgetList || colArray[remainedColIdx].widgetList.length === 0) {
            colArray[remainedColIdx].widgetList = deepClone(colArray[mergedColIdx].widgetList);
          }
        }
        let newColspan = colArray[mergedColIdx].options.colspan * 1 + colArray[remainedColIdx].options.colspan * 1;
        this.setPropsOfMergedCols(rowArray, curRow, remainedColIdx, newColspan, cellWidget.options.rowspan);
        this.emitHistoryChange();
      },
      mergeTableWholeRow(rowArray, colArray, rowIndex, colIndex) {
        let startRowspan = rowArray[rowIndex].cols[0].options.rowspan;
        let unmatchedFlag = false;
        for (let i2 = 1; i2 < rowArray[rowIndex].cols.length; i2++) {
          if (rowArray[rowIndex].cols[i2].options.rowspan !== startRowspan) {
            unmatchedFlag = true;
            break;
          }
        }
        if (unmatchedFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.rowspanNotConsistentForMergeEntireRow"));
          return;
        }
        let widgetListCols = colArray.filter((colItem) => {
          return !colItem.merged && !!colItem.widgetList && colItem.widgetList.length > 0;
        });
        if (!!widgetListCols && widgetListCols.length > 0) {
          if (widgetListCols[0].id !== colArray[0].id && (!colArray[0].widgetList || colArray[0].widgetList.length <= 0)) {
            colArray[0].widgetList = deepClone(widgetListCols[0].widgetList);
          }
        }
        this.setPropsOfMergedCols(rowArray, rowIndex, 0, colArray.length, colArray[colIndex].options.rowspan);
        this.emitHistoryChange();
      },
      mergeTableRow(rowArray, curRow, curCol, aboveFlag, cellWidget) {
        let mergedRowIdx = !!aboveFlag ? curRow : curRow + cellWidget.options.rowspan;
        let remainedRowIdx = !!aboveFlag ? curRow - 1 : curRow;
        if (!!aboveFlag) {
          let tmpRowIdx = remainedRowIdx;
          while (tmpRowIdx >= 0) {
            if (!rowArray[tmpRowIdx].cols[curCol].merged) {
              remainedRowIdx = tmpRowIdx;
              break;
            } else {
              tmpRowIdx--;
            }
          }
        }
        if (!!rowArray[mergedRowIdx].cols[curCol].widgetList && rowArray[mergedRowIdx].cols[curCol].widgetList.length > 0) {
          if (!rowArray[remainedRowIdx].cols[curCol].widgetList || rowArray[remainedRowIdx].cols[curCol].widgetList.length === 0) {
            rowArray[remainedRowIdx].cols[curCol].widgetList = deepClone(rowArray[mergedRowIdx].cols[curCol].widgetList);
          }
        }
        let newRowspan = rowArray[mergedRowIdx].cols[curCol].options.rowspan * 1 + rowArray[remainedRowIdx].cols[curCol].options.rowspan * 1;
        this.setPropsOfMergedRows(rowArray, remainedRowIdx, curCol, cellWidget.options.colspan, newRowspan);
        this.emitHistoryChange();
      },
      mergeTableWholeCol(rowArray, colArray, rowIndex, colIndex) {
        let startColspan = rowArray[0].cols[colIndex].options.colspan;
        let unmatchedFlag = false;
        for (let i2 = 1; i2 < rowArray.length; i2++) {
          if (rowArray[i2].cols[colIndex].options.colspan !== startColspan) {
            unmatchedFlag = true;
            break;
          }
        }
        if (unmatchedFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.colspanNotConsistentForMergeEntireColumn"));
          return;
        }
        let widgetListCols = [];
        rowArray.forEach((rowItem) => {
          let tempCell = rowItem.cols[colIndex];
          if (!tempCell.merged && !!tempCell.widgetList && tempCell.widgetList.length > 0) {
            widgetListCols.push(tempCell);
          }
        });
        let firstCellOfCol = rowArray[0].cols[colIndex];
        if (!!widgetListCols && widgetListCols.length > 0) {
          if (widgetListCols[0].id !== firstCellOfCol.id && (!firstCellOfCol.widgetList || firstCellOfCol.widgetList.length <= 0)) {
            firstCellOfCol.widgetList = deepClone(widgetListCols[0].widgetList);
          }
        }
        this.setPropsOfMergedRows(rowArray, 0, colIndex, firstCellOfCol.options.colspan, rowArray.length);
        this.emitHistoryChange();
      },
      undoMergeTableCol(rowArray, rowIndex, colIndex, colspan, rowspan) {
        this.setPropsOfSplitCol(rowArray, rowIndex, colIndex, colspan, rowspan);
        this.emitHistoryChange();
      },
      undoMergeTableRow(rowArray, rowIndex, colIndex, colspan, rowspan) {
        this.setPropsOfSplitRow(rowArray, rowIndex, colIndex, colspan, rowspan);
        this.emitHistoryChange();
      },
      deleteTableWholeCol(rowArray, colIndex) {
        let onlyOneColFlag = true;
        rowArray.forEach((ri) => {
          if (ri.cols[0].options.colspan !== rowArray[0].cols.length) {
            onlyOneColFlag = false;
          }
        });
        if (onlyOneColFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.lastColCannotBeDeleted"));
          return;
        }
        let startColspan = rowArray[0].cols[colIndex].options.colspan;
        let unmatchedFlag = false;
        for (let i2 = 1; i2 < rowArray.length; i2++) {
          if (rowArray[i2].cols[colIndex].options.colspan !== startColspan) {
            unmatchedFlag = true;
            break;
          }
        }
        if (unmatchedFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.colspanNotConsistentForDeleteEntireColumn"));
          return;
        }
        rowArray.forEach((rItem) => {
          rItem.cols.splice(colIndex, startColspan);
        });
        this.emitHistoryChange();
      },
      deleteTableWholeRow(rowArray, rowIndex) {
        let onlyOneRowFlag = true;
        rowArray[0].cols.forEach((ci) => {
          if (ci.options.rowspan !== rowArray.length) {
            onlyOneRowFlag = false;
          }
        });
        if (onlyOneRowFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.lastRowCannotBeDeleted"));
          return;
        }
        let startRowspan = rowArray[rowIndex].cols[0].options.rowspan;
        let unmatchedFlag = false;
        for (let i2 = 1; i2 < rowArray[rowIndex].cols.length; i2++) {
          if (rowArray[rowIndex].cols[i2].options.rowspan !== startRowspan) {
            unmatchedFlag = true;
            break;
          }
        }
        if (unmatchedFlag) {
          this.vueInstance.$message.info(this.vueInstance.i18nt("designer.hint.rowspanNotConsistentForDeleteEntireRow"));
          return;
        }
        rowArray.splice(rowIndex, startRowspan);
        this.emitHistoryChange();
      },
      getContainerByType(typeName2) {
        let allWidgets = [
          ...containers,
          ...basicFields,
          ...advancedFields,
          ...customFields,
          ...chartContainers,
          ...chartWidgets
        ];
        let foundCon = null;
        allWidgets.forEach((con) => {
          if (!!con.category && !!con.type && con.type === typeName2) {
            foundCon = con;
          }
        });
        return foundCon;
      },
      getFieldWidgetByType(typeName2) {
        let allWidgets = [...containers, ...basicFields, ...advancedFields, ...customFields, ...chartContainers, ...chartWidgets];
        let foundWidget = null;
        allWidgets.forEach((widget) => {
          if (!!!widget.category && !!widget.type && widget.type === typeName2) {
            foundWidget = widget;
          }
        });
        return foundWidget;
      },
      hasConfig(widget, configName) {
        let originalWidget = null;
        if (!!widget.category) {
          originalWidget = this.getContainerByType(widget.type);
        } else {
          originalWidget = this.getFieldWidgetByType(widget.type);
        }
        if (!originalWidget || !originalWidget.options) {
          return false;
        }
        return Object.keys(originalWidget.options).indexOf(configName) > -1;
      },
      upgradeWidgetConfig(oldWidget) {
        let newWidget = null;
        if (!!oldWidget.category) {
          newWidget = this.getContainerByType(oldWidget.type);
        } else {
          newWidget = this.getFieldWidgetByType(oldWidget.type);
        }
        if (!newWidget || !newWidget.options) {
          return;
        }
        Object.keys(newWidget.options).forEach((ck) => {
          if (!oldWidget.hasOwnProperty(ck)) {
            oldWidget.options[ck] = deepClone(newWidget.options[ck]);
          }
        });
      },
      upgradeFormConfig(oldFormConfig) {
        Object.keys(this.formConfig).forEach((fc) => {
          if (!oldFormConfig.hasOwnProperty(fc)) {
            oldFormConfig[fc] = deepClone(this.formConfig[fc]);
          }
        });
      },
      cloneGridCol(widget, parentWidget) {
        let newGridCol = deepClone(this.getContainerByType("grid-col"));
        newGridCol.options = deepClone(widget.options);
        let tmpId = generateId();
        newGridCol.id = "grid-col-" + tmpId;
        newGridCol.options.name = "gridCol" + tmpId;
        if (widget.widgetList.length === 1) {
          const firstChildWidget = widget.widgetList[0];
          if (!firstChildWidget.category) {
            let newField = deepClone(firstChildWidget);
            const tempId = generateId();
            newField.id = newField.type.replace(/-/g, "") + tempId;
            newField.options.name = newField.id;
            newGridCol.widgetList.push(newField);
          }
        }
        parentWidget.cols.push(newGridCol);
      },
      cloneContainer(containWidget) {
        if (containWidget.type === "grid") {
          let newGrid = deepClone(this.getContainerByType("grid"));
          newGrid.id = newGrid.type + generateId();
          newGrid.options.name = newGrid.id;
          containWidget.cols.forEach((gridCol) => {
            let newGridCol = deepClone(this.getContainerByType("grid-col"));
            let tmpId = generateId();
            newGridCol.id = "grid-col-" + tmpId;
            newGridCol.options.name = "gridCol" + tmpId;
            newGridCol.options.span = gridCol.options.span;
            newGrid.cols.push(newGridCol);
          });
          return newGrid;
        } else if (containWidget.type === "table") {
          let newTable = deepClone(this.getContainerByType("table"));
          newTable.id = newTable.type + generateId();
          newTable.options.name = newTable.id;
          containWidget.rows.forEach((tRow) => {
            let newRow = deepClone(tRow);
            newRow.id = "table-row-" + generateId();
            newRow.cols.forEach((col) => {
              col.id = "table-cell-" + generateId();
              col.options.name = col.id;
              if (col.widgetList.length === 1) {
                const firstChildWidget = col.widgetList[0];
                if (!firstChildWidget.category) {
                  const tempId = generateId();
                  firstChildWidget.id = firstChildWidget.type.replace(/-/g, "") + tempId;
                  firstChildWidget.options.name = firstChildWidget.id;
                } else {
                  col.widgetList = [];
                }
              } else {
                col.widgetList = [];
              }
            });
            newTable.rows.push(newRow);
          });
          return newTable;
        } else {
          return null;
        }
      },
      cloneFieldWidget(fieldWidget2, parentList) {
        let newField = deepClone(fieldWidget2);
        const tempId = generateId();
        newField.id = newField.type.replace(/-/g, "") + tempId;
        newField.options.name = newField.id;
        if (!!parentList) {
          parentList.push(newField);
        } else {
          this.widgetList.push(newField);
        }
      },
      moveUpWidget(parentList, indexOfParentList) {
        if (!!parentList) {
          if (indexOfParentList === 0) {
            this.vueInstance.$message(this.vueInstance.i18nt("designer.hint.moveUpFirstChildHint"));
            return;
          }
          let tempWidget = parentList[indexOfParentList];
          parentList.splice(indexOfParentList, 1);
          parentList.splice(indexOfParentList - 1, 0, tempWidget);
        }
      },
      moveDownWidget(parentList, indexOfParentList) {
        if (!!parentList) {
          if (indexOfParentList === parentList.length - 1) {
            this.vueInstance.$message(this.vueInstance.i18nt("designer.hint.moveDownLastChildHint"));
            return;
          }
          let tempWidget = parentList[indexOfParentList];
          parentList.splice(indexOfParentList, 1);
          parentList.splice(indexOfParentList + 1, 0, tempWidget);
        }
      },
      copyNewFieldWidget(origin) {
        let newWidget = deepClone(origin);
        if (!newWidget.sourceTable) {
          let tempId = generateId();
          newWidget.id = newWidget.type.replace(/-/g, "") + tempId;
          if (!newWidget.nameReadonly) {
            newWidget.options.name = newWidget.id;
            newWidget.options.label = newWidget.options.label || newWidget.type.toLowerCase();
          }
        } else {
          let tempId = generateId();
          newWidget.id = newWidget.type.replace(/-/g, "") + tempId;
        }
        delete newWidget.displayName;
        this.emitEvent("canvas-add-field", newWidget.options.name);
        return newWidget;
      },
      buildColsOfGrid(gridCon, colNum, colSpan) {
        const newSpan = !!colSpan ? colSpan : 24 / colNum;
        for (let i2 = 0; i2 < colNum; i2++) {
          let newCol = deepClone(this.getContainerByType("grid-col"));
          let tmpId = generateId();
          newCol.id = "grid-col-" + tmpId;
          newCol.options.name = "gridCol" + tmpId;
          newCol.options.span = newSpan;
          newCol.options.md = newSpan;
          newCol.options.sm = newSpan;
          newCol.options.xs = newSpan;
          gridCon.cols.push(newCol);
        }
      },
      copyNewContainerWidget(origin) {
        let newCon = deepClone(origin);
        newCon.id = newCon.type.replace(/-/g, "") + generateId();
        newCon.options.name = newCon.id;
        if (newCon.type === "grid") {
          if (newCon.alias === "column-1-grid") {
            this.buildColsOfGrid(newCon, 1);
          } else if (newCon.alias === "column-2-grid") {
            this.buildColsOfGrid(newCon, 2);
          } else if (newCon.alias === "column-3-grid") {
            this.buildColsOfGrid(newCon, 3);
          } else if (newCon.alias === "column-4-grid") {
            this.buildColsOfGrid(newCon, 4);
          }
        } else if (newCon.type === "table") {
          let newRow = { cols: [] };
          newRow.id = "table-row-" + generateId();
          newRow.merged = false;
          let newCell = deepClone(this.getContainerByType("table-cell"));
          newCell.id = "table-cell-" + generateId();
          newCell.options.name = newCell.id;
          newCell.merged = false;
          newCell.options.colspan = 1;
          newCell.options.rowspan = 1;
          newRow.cols.push(newCell);
          newCon.rows.push(newRow);
        } else if (newCon.type === "tab") {
          let newTabPane = deepClone(this.getContainerByType("tab-pane"));
          newTabPane.id = "tab-pane-" + generateId();
          newTabPane.options.name = "tab1";
          newTabPane.options.label = "tab 1";
          newCon.tabs.push(newTabPane);
        } else if (newCon.type === "grid-sub-form") {
          const col2Grid = deepClone(this.getContainerByType("grid"));
          col2Grid.id = newCon.type.replace(/-/g, "") + generateId();
          col2Grid.options.name = col2Grid.id;
          this.buildColsOfGrid(col2Grid, 4, 12);
          newCon.widgetList.push(col2Grid);
        }
        delete newCon.displayName;
        delete newCon.commonFlag;
        return newCon;
      },
      addContainerByDbClick(container) {
        let newCon = this.copyNewContainerWidget(container);
        this.widgetList.push(newCon);
        this.setSelected(newCon);
      },
      addFieldByDbClick(widget) {
        let newWidget = this.copyNewFieldWidget(widget);
        if (!!this.selectedWidget && this.selectedWidget.type === "tab") {
          let activeTab = this.selectedWidget.tabs[0];
          this.selectedWidget.tabs.forEach((tabPane) => {
            if (!!tabPane.options.active) {
              activeTab = tabPane;
            }
          });
          !!activeTab && activeTab.widgetList.push(newWidget);
        } else if (!!this.selectedWidget && !!this.selectedWidget.widgetList) {
          this.selectedWidget.widgetList.push(newWidget);
        } else {
          this.widgetList.push(newWidget);
        }
        this.setSelected(newWidget);
        this.emitEvent("canvas-add-field", newWidget.options.name);
        this.emitHistoryChange();
      },
      findDashboardContainer() {
        if (this.widgetList.length < 1) {
          console.error("Dashboard container not found");
          return null;
        }
        let dashboardCon = null;
        this.widgetList.forEach((w) => {
          if (w.type === "dashboard-container") {
            dashboardCon = w;
          }
        });
        if (!dashboardCon) {
          console.error("Dashboard container not found");
          return null;
        } else {
          return dashboardCon;
        }
      },
      addChartContainerByDbClick(container) {
        const dbCon = this.findDashboardContainer();
        if (dbCon) {
          const newCon = deepClone(container);
          newCon.id = "chartCon" + generateId();
          newCon.options.name = newCon.id;
          const ccLayout = {
            x: newCon.options.x,
            y: newCon.options.y,
            w: newCon.options.w,
            h: newCon.options.h,
            i: newCon.id
          };
          dbCon.options.layout.push(ccLayout);
          dbCon.widgetList.push(newCon);
          this.setSelected(newCon);
          this.emitHistoryChange();
        }
      },
      addChartByDbClick(chart) {
        const dbCon = this.findDashboardContainer();
        if (dbCon) {
          const newChart = deepClone(chart);
          newChart.id = "chart" + generateId();
          newChart.options.name = newChart.id;
          const chartLayout = {
            x: newChart.options.x,
            y: newChart.options.y,
            w: newChart.options.w,
            h: newChart.options.h,
            i: newChart.id
          };
          dbCon.options.layout.push(chartLayout);
          dbCon.widgetList.push(newChart);
          this.setSelected(chart);
          this.emitHistoryChange();
        }
      },
      deleteColOfGrid(gridWidget2, colIdx) {
        if (!!gridWidget2 && !!gridWidget2.cols) {
          gridWidget2.cols.splice(colIdx, 1);
        }
      },
      insertNewColOfGrid(gridWidget2, colIdx) {
        const cols = gridWidget2.cols;
        let newGridCol = deepClone(this.getContainerByType("grid-col"));
        let tmpId = generateId();
        newGridCol.id = "grid-col-" + tmpId;
        newGridCol.options.name = "gridCol" + tmpId;
        if (!!cols && cols.length > 0) {
          let spanSum = 0;
          cols.forEach((col) => {
            spanSum += col.options.span;
          });
          if (spanSum >= 24) {
            console.log("\u5217\u6805\u683C\u4E4B\u548C\u8D85\u51FA24");
            gridWidget2.cols.splice(colIdx + 1, 0, newGridCol);
          } else {
            newGridCol.options.span = 24 - spanSum > 12 ? 12 : 24 - spanSum;
            gridWidget2.cols.splice(colIdx + 1, 0, newGridCol);
          }
        } else {
          gridWidget2.cols = [newGridCol];
        }
      },
      addNewColOfGrid(gridWidget2) {
        const cols = gridWidget2.cols;
        let newGridCol = deepClone(this.getContainerByType("grid-col"));
        let tmpId = generateId();
        newGridCol.id = "grid-col-" + tmpId;
        newGridCol.options.name = "gridCol" + tmpId;
        if (!!cols && cols.length > 0) {
          let spanSum = 0;
          cols.forEach((col) => {
            spanSum += col.options.span;
          });
          if (spanSum >= 24) {
            console.log("\u5217\u6805\u683C\u4E4B\u548C\u8D85\u51FA24");
            gridWidget2.cols.push(newGridCol);
          } else {
            newGridCol.options.span = 24 - spanSum > 12 ? 12 : 24 - spanSum;
            gridWidget2.cols.push(newGridCol);
          }
        } else {
          gridWidget2.cols = [newGridCol];
        }
      },
      addTabPaneOfTabs(tabsWidget) {
        const tabPanes = tabsWidget.tabs;
        let newTabPane = deepClone(this.getContainerByType("tab-pane"));
        newTabPane.id = "tab-pane-" + generateId();
        newTabPane.options.name = newTabPane.id;
        newTabPane.options.label = "tab " + (tabPanes.length + 1);
        tabPanes.push(newTabPane);
      },
      deleteTabPaneOfTabs(tabsWidget, tpIdx) {
        tabsWidget.tabs.splice(tpIdx, 1);
      },
      emitEvent(evtName, evtData) {
        eventBus.$emit(evtName, evtData);
      },
      handleEvent(evtName, callback) {
        eventBus.$on(evtName, (data2) => callback(data2));
      },
      setCssClassList(cssClassList) {
        this.cssClassList = cssClassList;
      },
      getCssClassList() {
        return this.cssClassList;
      },
      registerFormWidget(formWidget) {
        this.formWidget = formWidget;
      },
      initHistoryData() {
        this.loadFormContentFromStorage();
        this.historyData.index++;
        this.historyData.steps[this.historyData.index] = {
          widgetList: deepClone(this.widgetList),
          formConfig: deepClone(this.formConfig)
        };
      },
      emitHistoryChange() {
        if (this.historyData.index === this.historyData.maxStep - 1) {
          this.historyData.steps.shift();
        } else {
          this.historyData.index++;
        }
        this.historyData.steps[this.historyData.index] = {
          widgetList: deepClone(this.widgetList),
          formConfig: deepClone(this.formConfig)
        };
        this.saveFormContentToStorage();
        if (this.historyData.index < this.historyData.steps.length - 1) {
          this.historyData.steps = this.historyData.steps.slice(0, this.historyData.index + 1);
        }
      },
      saveCurrentHistoryStep() {
        this.historyData.steps[this.historyData.index] = deepClone({
          widgetList: this.widgetList,
          formConfig: this.formConfig
        });
        this.saveFormContentToStorage();
      },
      undoHistoryStep() {
        if (this.historyData.index !== 0) {
          this.historyData.index--;
        }
        this.widgetList = deepClone(this.historyData.steps[this.historyData.index].widgetList);
        this.formConfig = deepClone(this.historyData.steps[this.historyData.index].formConfig);
      },
      redoHistoryStep() {
        if (this.historyData.index !== this.historyData.steps.length - 1) {
          this.historyData.index++;
        }
        this.widgetList = deepClone(this.historyData.steps[this.historyData.index].widgetList);
        this.formConfig = deepClone(this.historyData.steps[this.historyData.index].formConfig);
      },
      undoEnabled() {
        return this.historyData.index > 0 && this.historyData.steps.length > 0;
      },
      redoEnabled() {
        return this.historyData.index < this.historyData.steps.length - 1;
      },
      saveFormContentToStorage() {
        window.localStorage.setItem("widget__list__backup", JSON.stringify(this.widgetList));
        window.localStorage.setItem("form__config__backup", JSON.stringify(this.formConfig));
      },
      loadFormContentFromStorage() {
        let widgetListBackup = window.localStorage.getItem("widget__list__backup");
        if (!!widgetListBackup) {
          this.widgetList = JSON.parse(widgetListBackup);
        }
        let formConfigBackup = window.localStorage.getItem("form__config__backup");
        if (!!formConfigBackup) {
          overwriteObj(this.formConfig, JSON.parse(formConfigBackup));
        }
      }
    };
  }
  var _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWdJREFUeNrsmjFuwjAUhp8jxJQBujQH4ABhYmaDU7Sdu/QIcIKKE0APwM7GEQgLU/dmo0N3178SI0Qx2KpQ8sJ7kpUojsn/2S/JrxeImhRa64lpe13fgLbJsWZVCu+Yzdq0lMlcZ0qpPnai8sAbI/GI1K6EXYG92XSYZfy3WYWuBdAc71kDoFquzo+MaLHx+6H1S9iYNCF6Hxf7w/n180c9otcBUdz+2xdxmOnVJ9Fyd74v4pIu2RdzAFcIgAAIgABUG62qBTz3/c57jGsK8JRKClVgC3I/E+cygPIUEgABEAABEIDGADjrQvlP0XzfkqFjQgMlld7DiXiEC4DF7F8qbMGvbPPbXBjWGMUqBIphoWO8zBzE+1bmQgMpZ8X4XuN4jDyFBEAABEAA7g8giRkDwAPhE9PNzNx/jFmWh5u4c2aO7WdWm0Izhvfv7JBC5SrAVrH9qwGVB6ZYmjqnDTRa8Y2IXwEGAI1dAiVnUcUMAAAAAElFTkSuQmCC";
  var index_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$3 = {
    name: "VFormDesigner",
    componentName: "VFormDesigner",
    mixins: [i18n$1],
    components: {
      SvgIcon,
      WidgetPanel,
      ToolbarPanel,
      SettingPanel,
      VFormWidget,
      CaretLeft: ElementPlusIconsVue.CaretLeft,
      CaretRight: ElementPlusIconsVue.CaretRight
    },
    props: {
      fieldListApi: {
        type: Object,
        default: null
      },
      fieldListData: {
        type: Object,
        default: null
      },
      bannedWidgets: {
        type: Array,
        default: () => []
      },
      designerConfig: {
        type: Object,
        default: () => {
          return {
            languageMenu: false,
            externalLink: false,
            formTemplates: true,
            componentLib: true,
            chartLib: false,
            metadataLib: false,
            layoutTypeButton: true,
            eventCollapse: true,
            widgetNameReadonly: false,
            clearDesignerButton: true,
            previewFormButton: true,
            importJsonButton: true,
            exportJsonButton: true,
            exportCodeButton: true,
            generateSFCButton: true,
            logoHeader: false,
            toolbarMaxWidth: 450,
            toolbarMinWidth: 300,
            productName: "",
            productTitle: "",
            presetCssCode: "",
            languageName: "zh-CN",
            resetFormJson: false
          };
        }
      },
      globalDsv: {
        type: Object,
        default: () => ({})
      },
      formTemplates: {
        type: Array,
        default: null
      },
      testOptionData: {
        type: Object,
        default: null
      }
    },
    data() {
      return {
        vFormVersion: VARIANT_FORM_VERSION,
        curLangName: "",
        curLocale: "",
        vsCodeFlag: false,
        caseName: "",
        docUrl: "https://www.vform666.com/document3.html",
        gitUrl: "https://github.com/vform666/variant-form3-vite",
        chatUrl: "https://www.vform666.com/chat-group.html",
        subScribeUrl: "https://www.vform666.com/subscribe.html",
        designer: createDesigner(this),
        fieldList: [],
        subFormList: [],
        optionData: this.testOptionData,
        externalComponents: {},
        leftAsideVisible: true,
        rightAsideVisible: true
      };
    },
    provide() {
      return {
        getServerFieldList: () => this.fieldList,
        getServerSubFormList: () => this.subFormList,
        getDesignerConfig: () => this.designerConfig,
        getBannedWidgets: () => this.bannedWidgets,
        getTestOptionData: () => this.optionData
      };
    },
    computed: {
      vfProductName() {
        return this.designerConfig && this.designerConfig.productName || "VForm Pro";
      },
      vfProductTitle() {
        return this.designerConfig && this.designerConfig.productTitle || this.i18nt("application.productTitle");
      }
    },
    created() {
      this.designer.initDesigner(!!this.designerConfig.resetFormJson);
      this.vsCodeFlag = getQueryParam("vscode") == 1;
      this.caseName = getQueryParam("case");
      this.designer.handleEvent("canvas-add-field", (fieldWidgetName) => {
        this.$emit("field-widget-used", fieldWidgetName);
      });
      this.designer.handleEvent("canvas-remove-field", (fieldWidgetName) => {
        this.$emit("field-widget-removed", fieldWidgetName);
      });
      this.designer.handleEvent("form-json-imported", () => {
        this.$emit("form-json-updated", "form-json-imported");
      });
      this.designer.handleEvent("canvas-undo", () => {
        this.$emit("form-json-updated", "canvas-undo");
      });
      this.designer.handleEvent("canvas-redo", () => {
        this.$emit("form-json-updated", "canvas-redo");
      });
    },
    mounted() {
      this.initLocale();
      this.initFormTemplates();
      this.loadCase();
      this.initServerFields();
    },
    methods: {
      testEEH(eventName, eventParams) {
        console.log("test", eventName);
        console.log("test222222", eventParams);
      },
      showLink(configName) {
        if (this.designerConfig[configName] === void 0) {
          return true;
        }
        return !!this.designerConfig[configName];
      },
      openHome() {
        if (!!this.vsCodeFlag) {
          const msgObj = {
            cmd: "openUrl",
            data: {
              url: "https://www.vform666.com/"
            }
          };
          window.parent.postMessage(msgObj, "*");
        }
      },
      openUrl(event, url) {
        if (!!this.vsCodeFlag) {
          const msgObj = {
            cmd: "openUrl",
            data: {
              url
            }
          };
          window.parent.postMessage(msgObj, "*");
        } else {
          let aDom = event.currentTarget;
          aDom.href = url;
        }
      },
      loadCase() {
        if (!this.caseName) {
          return;
        }
        axios.get(MOCK_CASE_URL + this.caseName + ".txt").then((res) => {
          if (!!res.data.code) {
            this.$message.error(this.i18nt("designer.hint.sampleLoadedFail"));
            return;
          }
          this.setFormJson(res.data);
          this.$message.success(this.i18nt("designer.hint.sampleLoadedSuccess"));
        }).catch((error2) => {
          this.$message.error(this.i18nt("designer.hint.sampleLoadedFail") + ":" + error2);
        });
      },
      initLocale() {
        this.curLocale = localStorage.getItem("v_form_locale");
        if (!!this.vsCodeFlag) {
          this.curLocale = this.curLocale || "en-US";
        } else {
          this.curLocale = this.curLocale || "zh-CN";
        }
        this.curLangName = this.i18nt("application." + this.curLocale);
        this.changeLanguage(this.curLocale);
      },
      initFormTemplates() {
        if (!!this.formTemplates && this.formTemplates.length > 0) {
          clearFormTemplates();
          this.formTemplates.forEach((fm) => {
            addFormTemplate(fm);
          });
        }
      },
      loadFieldListFromServer() {
        if (!this.fieldListApi) {
          return;
        }
        let headers = this.fieldListApi.headers || {};
        axios.get(this.fieldListApi.URL, { "headers": headers }).then((res) => {
          let labelKey = this.fieldListApi.labelKey || "label";
          let nameKey = this.fieldListApi.nameKey || "name";
          let resDataName = this.fieldListApi.resultDataName || "";
          let resData = !!resDataName ? res.data[resDataName] : res.data;
          this.fieldList.splice(0, this.fieldList.length);
          resData.forEach((fieldItem) => {
            this.fieldList.push({
              label: fieldItem[labelKey],
              name: fieldItem[nameKey]
            });
          });
        }).catch((error2) => {
          this.$message.error(error2);
        });
      },
      setFieldList(list) {
        this.fieldList = list;
      },
      initServerFields() {
        if (!!this.fieldListData && !!this.fieldListData.fieldList) {
          this.fieldList.splice(0, this.fieldList.length, ...this.fieldListData.fieldList);
          if (!!this.fieldListData.subFormList) {
            this.subFormList.splice(0, this.subFormList.length, ...this.fieldListData.subFormList);
          }
        } else {
          this.loadFieldListFromServer();
        }
      },
      setFieldListData(fieldListData) {
        if (!!fieldListData && !!fieldListData.fieldList) {
          this.fieldList.splice(0, this.fieldList.length, ...fieldListData.fieldList);
          if (!!fieldListData.subFormList) {
            this.subFormList.splice(0, this.subFormList.length, ...fieldListData.subFormList);
          }
        }
      },
      handleLanguageChanged(command2) {
        this.changeLanguage(command2);
        this.curLangName = this.i18nt("application." + command2);
      },
      changeLanguage(langName) {
        changeLocale(langName);
      },
      setFormJson(formJson) {
        let modifiedFlag = false;
        if (!!formJson) {
          if (typeof formJson === "string") {
            modifiedFlag = this.designer.loadFormJson(JSON.parse(formJson));
          } else if (formJson.constructor === Object) {
            modifiedFlag = this.designer.loadFormJson(formJson);
          }
          if (modifiedFlag) {
            this.designer.emitHistoryChange();
          }
        }
      },
      getFormJson() {
        return {
          widgetList: deepClone(this.designer.widgetList),
          formConfig: deepClone(this.designer.formConfig)
        };
      },
      clearDesigner() {
        this.$refs.toolbarRef.clearFormWidget();
      },
      refreshDesigner() {
        let fJson = this.getFormJson();
        this.designer.clearDesigner(true);
        this.designer.loadFormJson(fJson);
      },
      previewForm() {
        this.$refs.toolbarRef.previewForm();
      },
      importJson() {
        this.$refs.toolbarRef.importJson();
      },
      exportJson() {
        this.$refs.toolbarRef.exportJson();
      },
      exportCode() {
        this.$refs.toolbarRef.exportCode();
      },
      generateSFC() {
        this.$refs.toolbarRef.generateSFC();
      },
      getFieldWidgets(widgetList2 = null, staticWidgetsIncluded = false) {
        return !!widgetList2 ? getAllFieldWidgets(widgetList2, staticWidgetsIncluded) : getAllFieldWidgets(this.designer.widgetList, staticWidgetsIncluded);
      },
      getContainerWidgets(widgetList2 = null) {
        return !!widgetList2 ? getAllContainerWidgets(widgetList2) : getAllContainerWidgets(this.designer.widgetList);
      },
      upgradeFormJson(formJson) {
        if (!formJson.widgetList || !formJson.formConfig) {
          this.$message.error("Invalid form json!");
          return;
        }
        traverseAllWidgets(formJson.widgetList, (w) => {
          this.designer.upgradeWidgetConfig(w);
        });
        this.designer.upgradeFormConfig(formJson.formConfig);
        return formJson;
      },
      getWidgetRef(widgetName, showError = false) {
        return this.$refs["formRef"].getWidgetRef(widgetName, showError);
      },
      getSelectedWidgetRef() {
        return this.$refs["formRef"].getSelectedWidgetRef();
      },
      addDataSource(dsObj) {
        this.designer.formConfig.dataSources.push(dsObj);
      },
      addEC(componentName, externalComponent) {
        this.externalComponents[componentName] = externalComponent;
      },
      hasEC(componentName) {
        return this.externalComponents.hasOwnProperty(componentName);
      },
      getEC(componentName) {
        return this.externalComponents[componentName];
      },
      buildFormDataSchema() {
        let dataSchema = {};
        let allCws = getAllContainerWidgets(this.designer.widgetList);
        let subFormCws = [], objectCws = [];
        allCws.forEach((ctn) => {
          if (ctn.type === "sub-form" || ctn.type === "grid-sub-form") {
            subFormCws.push(ctn.container);
          } else if (ctn.type === "object-group") {
            objectCws.push(ctn.container);
          }
        });
        let allSFFields = [];
        subFormCws.forEach((sf) => {
          let sfDataSchema = {};
          traverseFieldWidgetsOfContainer(sf, (w) => {
            if (!!w.formItemFlag) {
              sfDataSchema[w.options.name] = w.type;
              allSFFields.push(w.options.name);
            }
          });
          dataSchema[sf.options.name] = sfDataSchema;
        });
        let allObjectFields = [];
        objectCws.forEach((oc) => {
          let ocDataSchema = {};
          traverseFieldWidgetsOfContainer(oc, (w) => {
            if (!!w.formItemFlag) {
              ocDataSchema[w.options.name] = w.type;
              allObjectFields.push(w.options.name);
            }
          });
          let objectName = oc.options.objectName;
          setObjectValue(dataSchema, objectName, ocDataSchema);
        });
        let allFields = getAllFieldWidgets(this.designer.widgetList);
        allFields.forEach((fld) => {
          if (allSFFields.indexOf(fld.name) === -1 && allObjectFields.indexOf(fld.name) === -1) {
            dataSchema[fld.name] = fld.type;
          }
        });
        return dataSchema;
      },
      getFormTemplates() {
        return getAllFormTemplates();
      },
      clearFormTemplates() {
        clearFormTemplates();
      },
      addFormTemplate(newFormTemplate) {
        addFormTemplate(newFormTemplate);
      },
      toggleLeftAside() {
        this.leftAsideVisible = !this.leftAsideVisible;
      },
      toggleRightAside() {
        this.rightAsideVisible = !this.rightAsideVisible;
      },
      changePrimaryColor(newColor) {
        document.documentElement.style.setProperty("--el-color-primary", newColor);
        document.documentElement.style.setProperty("--vf-color-primary", newColor);
      },
      setMetaFields(metaFields) {
        this.$refs.widgetPanelRef.setMetaFields(metaFields);
      },
      setTestOptionData(optionData) {
        this.optionData = optionData;
      }
    }
  };
  const _withScopeId = (n) => (require$$0$1.pushScopeId("data-v-301572af"), n = n(), require$$0$1.popScopeId(), n);
  const _hoisted_1$1 = { class: "float-left main-title" };
  const _hoisted_2 = { class: "bold" };
  const _hoisted_3 = { class: "version-span" };
  const _hoisted_4 = { class: "float-right external-link" };
  const _hoisted_5 = { class: "el-dropdown-link" };
  const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ require$$0$1.createElementVNode("a", { href: "javascript:void(0)" }, "\xA0", -1));
  function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_svg_icon = require$$0$1.resolveComponent("svg-icon");
    const _component_el_dropdown_item = require$$0$1.resolveComponent("el-dropdown-item");
    const _component_el_dropdown_menu = require$$0$1.resolveComponent("el-dropdown-menu");
    const _component_el_dropdown = require$$0$1.resolveComponent("el-dropdown");
    const _component_el_header = require$$0$1.resolveComponent("el-header");
    const _component_widget_panel = require$$0$1.resolveComponent("widget-panel");
    const _component_el_aside = require$$0$1.resolveComponent("el-aside");
    const _component_CaretLeft = require$$0$1.resolveComponent("CaretLeft");
    const _component_CaretRight = require$$0$1.resolveComponent("CaretRight");
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_toolbar_panel = require$$0$1.resolveComponent("toolbar-panel");
    const _component_v_form_widget = require$$0$1.resolveComponent("v-form-widget");
    const _component_el_scrollbar = require$$0$1.resolveComponent("el-scrollbar");
    const _component_el_main = require$$0$1.resolveComponent("el-main");
    const _component_el_container = require$$0$1.resolveComponent("el-container");
    const _component_setting_panel = require$$0$1.resolveComponent("setting-panel");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_container, { class: "main-container full-height" }, {
      default: require$$0$1.withCtx(() => [
        $props.designerConfig.logoHeader !== false ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_header, {
          key: 0,
          class: "main-header"
        }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.createElementVNode("div", _hoisted_1$1, [
              require$$0$1.createElementVNode("img", {
                src: _imports_0,
                onClick: _cache[0] || (_cache[0] = (...args) => $options.openHome && $options.openHome(...args))
              }),
              require$$0$1.createElementVNode("span", _hoisted_2, require$$0$1.toDisplayString($options.vfProductName), 1),
              require$$0$1.createTextVNode(" " + require$$0$1.toDisplayString($options.vfProductTitle) + " ", 1),
              require$$0$1.createElementVNode("span", _hoisted_3, "Ver " + require$$0$1.toDisplayString($data.vFormVersion), 1)
            ]),
            require$$0$1.createElementVNode("div", _hoisted_4, [
              $options.showLink("languageMenu") ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_dropdown, {
                key: 0,
                "hide-timeout": 2e3,
                onCommand: $options.handleLanguageChanged
              }, {
                dropdown: require$$0$1.withCtx(() => [
                  require$$0$1.createVNode(_component_el_dropdown_menu, null, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_el_dropdown_item, { command: "zh-CN" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("application.zh-CN")), 1)
                        ]),
                        _: 1
                      }),
                      require$$0$1.createVNode(_component_el_dropdown_item, { command: "en-US" }, {
                        default: require$$0$1.withCtx(() => [
                          require$$0$1.createTextVNode(require$$0$1.toDisplayString(_ctx.i18nt("application.en-US")), 1)
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  })
                ]),
                default: require$$0$1.withCtx(() => [
                  require$$0$1.createElementVNode("span", _hoisted_5, [
                    require$$0$1.createTextVNode(require$$0$1.toDisplayString($data.curLangName), 1),
                    require$$0$1.createVNode(_component_svg_icon, { "icon-class": "el-arrow-down" })
                  ])
                ]),
                _: 1
              }, 8, ["onCommand"])) : require$$0$1.createCommentVNode("", true),
              _hoisted_6
            ])
          ]),
          _: 1
        })) : require$$0$1.createCommentVNode("", true),
        require$$0$1.createVNode(_component_el_container, { class: "main-content" }, {
          default: require$$0$1.withCtx(() => [
            require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_aside, { class: "side-panel" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_widget_panel, {
                  ref: "widgetPanelRef",
                  designer: $data.designer
                }, null, 8, ["designer"])
              ]),
              _: 1
            }, 512), [
              [require$$0$1.vShow, $data.leftAsideVisible]
            ]),
            require$$0$1.createElementVNode("div", {
              class: require$$0$1.normalizeClass(["left-aside-toggle-bar", { "aside-hidden": !$data.leftAsideVisible }]),
              onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleLeftAside && $options.toggleLeftAside(...args))
            }, [
              require$$0$1.createVNode(_component_el_icon, { size: 18 }, {
                default: require$$0$1.withCtx(() => [
                  $data.leftAsideVisible ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_CaretLeft, { key: 0 })) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_CaretRight, { key: 1 }))
                ]),
                _: 1
              })
            ], 2),
            require$$0$1.createVNode(_component_el_container, { class: "center-layout-container" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_el_header, { class: "toolbar-header" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_toolbar_panel, {
                      designer: $data.designer,
                      "global-dsv": $props.globalDsv,
                      ref: "toolbarRef"
                    }, require$$0$1.createSlots({ _: 2 }, [
                      require$$0$1.renderList(_ctx.$slots, (idx, slotName) => {
                        return {
                          name: slotName,
                          fn: require$$0$1.withCtx(() => [
                            require$$0$1.renderSlot(_ctx.$slots, slotName, {}, void 0, true)
                          ])
                        };
                      })
                    ]), 1032, ["designer", "global-dsv"])
                  ]),
                  _: 3
                }),
                require$$0$1.createVNode(_component_el_main, { class: "form-widget-main" }, {
                  default: require$$0$1.withCtx(() => [
                    require$$0$1.createVNode(_component_el_scrollbar, { class: "container-scroll-bar" }, {
                      default: require$$0$1.withCtx(() => [
                        require$$0$1.createVNode(_component_v_form_widget, {
                          designer: $data.designer,
                          "form-config": $data.designer.formConfig,
                          "global-dsv": $props.globalDsv,
                          ref: "formRef"
                        }, null, 8, ["designer", "form-config", "global-dsv"])
                      ]),
                      _: 1
                    })
                  ]),
                  _: 1
                })
              ]),
              _: 3
            }),
            require$$0$1.createElementVNode("div", {
              class: require$$0$1.normalizeClass(["right-aside-toggle-bar", { "aside-hidden": !$data.rightAsideVisible }]),
              onClick: _cache[2] || (_cache[2] = (...args) => $options.toggleRightAside && $options.toggleRightAside(...args))
            }, [
              require$$0$1.createVNode(_component_el_icon, { size: 18 }, {
                default: require$$0$1.withCtx(() => [
                  $data.rightAsideVisible ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_CaretRight, { key: 0 })) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_CaretLeft, { key: 1 }))
                ]),
                _: 1
              })
            ], 2),
            require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_aside, { class: "setting-panel" }, {
              default: require$$0$1.withCtx(() => [
                require$$0$1.createVNode(_component_setting_panel, {
                  designer: $data.designer,
                  "selected-widget": $data.designer.selectedWidget,
                  "global-dsv": $props.globalDsv,
                  "form-config": $data.designer.formConfig,
                  onEditEventHandler: $options.testEEH
                }, null, 8, ["designer", "selected-widget", "global-dsv", "form-config", "onEditEventHandler"])
              ]),
              _: 1
            }, 512), [
              [require$$0$1.vShow, $data.rightAsideVisible]
            ])
          ]),
          _: 3
        })
      ]),
      _: 3
    });
  }
  var VFormDesigner = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-301572af"]]);
  var vuedraggable_umd = { exports: {} };
  (function(module2, exports2) {
    (function webpackUniversalModuleDefinition(root, factory) {
      module2.exports = factory(require$$0__default["default"], Sortable);
    })(typeof self !== "undefined" ? self : commonjsGlobal, function(__WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a352__) {
      return function(modules2) {
        var installedModules = {};
        function __webpack_require__(moduleId) {
          if (installedModules[moduleId]) {
            return installedModules[moduleId].exports;
          }
          var module3 = installedModules[moduleId] = {
            i: moduleId,
            l: false,
            exports: {}
          };
          modules2[moduleId].call(module3.exports, module3, module3.exports, __webpack_require__);
          module3.l = true;
          return module3.exports;
        }
        __webpack_require__.m = modules2;
        __webpack_require__.c = installedModules;
        __webpack_require__.d = function(exports3, name2, getter) {
          if (!__webpack_require__.o(exports3, name2)) {
            Object.defineProperty(exports3, name2, { enumerable: true, get: getter });
          }
        };
        __webpack_require__.r = function(exports3) {
          if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
            Object.defineProperty(exports3, Symbol.toStringTag, { value: "Module" });
          }
          Object.defineProperty(exports3, "__esModule", { value: true });
        };
        __webpack_require__.t = function(value2, mode) {
          if (mode & 1)
            value2 = __webpack_require__(value2);
          if (mode & 8)
            return value2;
          if (mode & 4 && typeof value2 === "object" && value2 && value2.__esModule)
            return value2;
          var ns = Object.create(null);
          __webpack_require__.r(ns);
          Object.defineProperty(ns, "default", { enumerable: true, value: value2 });
          if (mode & 2 && typeof value2 != "string")
            for (var key in value2)
              __webpack_require__.d(ns, key, function(key2) {
                return value2[key2];
              }.bind(null, key));
          return ns;
        };
        __webpack_require__.n = function(module3) {
          var getter = module3 && module3.__esModule ? function getDefault() {
            return module3["default"];
          } : function getModuleExports() {
            return module3;
          };
          __webpack_require__.d(getter, "a", getter);
          return getter;
        };
        __webpack_require__.o = function(object, property) {
          return Object.prototype.hasOwnProperty.call(object, property);
        };
        __webpack_require__.p = "";
        return __webpack_require__(__webpack_require__.s = "fb15");
      }({
        "00ee": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          var TO_STRING_TAG = wellKnownSymbol("toStringTag");
          var test = {};
          test[TO_STRING_TAG] = "z";
          module3.exports = String(test) === "[object z]";
        },
        "0366": function(module3, exports3, __webpack_require__) {
          var aFunction = __webpack_require__("1c0b");
          module3.exports = function(fn, that, length) {
            aFunction(fn);
            if (that === void 0)
              return fn;
            switch (length) {
              case 0:
                return function() {
                  return fn.call(that);
                };
              case 1:
                return function(a) {
                  return fn.call(that, a);
                };
              case 2:
                return function(a, b) {
                  return fn.call(that, a, b);
                };
              case 3:
                return function(a, b, c) {
                  return fn.call(that, a, b, c);
                };
            }
            return function() {
              return fn.apply(that, arguments);
            };
          };
        },
        "057f": function(module3, exports3, __webpack_require__) {
          var toIndexedObject = __webpack_require__("fc6a");
          var nativeGetOwnPropertyNames = __webpack_require__("241c").f;
          var toString2 = {}.toString;
          var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
          var getWindowNames = function(it) {
            try {
              return nativeGetOwnPropertyNames(it);
            } catch (error2) {
              return windowNames.slice();
            }
          };
          module3.exports.f = function getOwnPropertyNames(it) {
            return windowNames && toString2.call(it) == "[object Window]" ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it));
          };
        },
        "06cf": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var propertyIsEnumerableModule = __webpack_require__("d1e7");
          var createPropertyDescriptor = __webpack_require__("5c6c");
          var toIndexedObject = __webpack_require__("fc6a");
          var toPrimitive = __webpack_require__("c04e");
          var has = __webpack_require__("5135");
          var IE8_DOM_DEFINE = __webpack_require__("0cfb");
          var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
          exports3.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
            O = toIndexedObject(O);
            P = toPrimitive(P, true);
            if (IE8_DOM_DEFINE)
              try {
                return nativeGetOwnPropertyDescriptor(O, P);
              } catch (error2) {
              }
            if (has(O, P))
              return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]);
          };
        },
        "0cfb": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var fails = __webpack_require__("d039");
          var createElement = __webpack_require__("cc12");
          module3.exports = !DESCRIPTORS && !fails(function() {
            return Object.defineProperty(createElement("div"), "a", {
              get: function() {
                return 7;
              }
            }).a != 7;
          });
        },
        "13d5": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $reduce = __webpack_require__("d58f").left;
          var arrayMethodIsStrict = __webpack_require__("a640");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var STRICT_METHOD = arrayMethodIsStrict("reduce");
          var USES_TO_LENGTH = arrayMethodUsesToLength("reduce", { 1: 0 });
          $({ target: "Array", proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
            reduce: function reduce(callbackfn) {
              return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
        },
        "14c3": function(module3, exports3, __webpack_require__) {
          var classof = __webpack_require__("c6b6");
          var regexpExec = __webpack_require__("9263");
          module3.exports = function(R, S) {
            var exec = R.exec;
            if (typeof exec === "function") {
              var result = exec.call(R, S);
              if (typeof result !== "object") {
                throw TypeError("RegExp exec method returned something other than an Object or null");
              }
              return result;
            }
            if (classof(R) !== "RegExp") {
              throw TypeError("RegExp#exec called on incompatible receiver");
            }
            return regexpExec.call(R, S);
          };
        },
        "159b": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var DOMIterables = __webpack_require__("fdbc");
          var forEach2 = __webpack_require__("17c2");
          var createNonEnumerableProperty = __webpack_require__("9112");
          for (var COLLECTION_NAME in DOMIterables) {
            var Collection = global2[COLLECTION_NAME];
            var CollectionPrototype = Collection && Collection.prototype;
            if (CollectionPrototype && CollectionPrototype.forEach !== forEach2)
              try {
                createNonEnumerableProperty(CollectionPrototype, "forEach", forEach2);
              } catch (error2) {
                CollectionPrototype.forEach = forEach2;
              }
          }
        },
        "17c2": function(module3, exports3, __webpack_require__) {
          var $forEach = __webpack_require__("b727").forEach;
          var arrayMethodIsStrict = __webpack_require__("a640");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var STRICT_METHOD = arrayMethodIsStrict("forEach");
          var USES_TO_LENGTH = arrayMethodUsesToLength("forEach");
          module3.exports = !STRICT_METHOD || !USES_TO_LENGTH ? function forEach2(callbackfn) {
            return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
          } : [].forEach;
        },
        "1be4": function(module3, exports3, __webpack_require__) {
          var getBuiltIn = __webpack_require__("d066");
          module3.exports = getBuiltIn("document", "documentElement");
        },
        "1c0b": function(module3, exports3) {
          module3.exports = function(it) {
            if (typeof it != "function") {
              throw TypeError(String(it) + " is not a function");
            }
            return it;
          };
        },
        "1c7e": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          var ITERATOR = wellKnownSymbol("iterator");
          var SAFE_CLOSING = false;
          try {
            var called = 0;
            var iteratorWithReturn = {
              next: function() {
                return { done: !!called++ };
              },
              "return": function() {
                SAFE_CLOSING = true;
              }
            };
            iteratorWithReturn[ITERATOR] = function() {
              return this;
            };
            Array.from(iteratorWithReturn, function() {
              throw 2;
            });
          } catch (error2) {
          }
          module3.exports = function(exec, SKIP_CLOSING) {
            if (!SKIP_CLOSING && !SAFE_CLOSING)
              return false;
            var ITERATION_SUPPORT = false;
            try {
              var object = {};
              object[ITERATOR] = function() {
                return {
                  next: function() {
                    return { done: ITERATION_SUPPORT = true };
                  }
                };
              };
              exec(object);
            } catch (error2) {
            }
            return ITERATION_SUPPORT;
          };
        },
        "1d80": function(module3, exports3) {
          module3.exports = function(it) {
            if (it == void 0)
              throw TypeError("Can't call method on " + it);
            return it;
          };
        },
        "1dde": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          var wellKnownSymbol = __webpack_require__("b622");
          var V8_VERSION = __webpack_require__("2d00");
          var SPECIES = wellKnownSymbol("species");
          module3.exports = function(METHOD_NAME) {
            return V8_VERSION >= 51 || !fails(function() {
              var array = [];
              var constructor = array.constructor = {};
              constructor[SPECIES] = function() {
                return { foo: 1 };
              };
              return array[METHOD_NAME](Boolean).foo !== 1;
            });
          };
        },
        "23cb": function(module3, exports3, __webpack_require__) {
          var toInteger = __webpack_require__("a691");
          var max = Math.max;
          var min = Math.min;
          module3.exports = function(index2, length) {
            var integer = toInteger(index2);
            return integer < 0 ? max(integer + length, 0) : min(integer, length);
          };
        },
        "23e7": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
          var createNonEnumerableProperty = __webpack_require__("9112");
          var redefine = __webpack_require__("6eeb");
          var setGlobal = __webpack_require__("ce4e");
          var copyConstructorProperties = __webpack_require__("e893");
          var isForced = __webpack_require__("94ca");
          module3.exports = function(options, source) {
            var TARGET = options.target;
            var GLOBAL = options.global;
            var STATIC = options.stat;
            var FORCED, target, key, targetProperty, sourceProperty, descriptor;
            if (GLOBAL) {
              target = global2;
            } else if (STATIC) {
              target = global2[TARGET] || setGlobal(TARGET, {});
            } else {
              target = (global2[TARGET] || {}).prototype;
            }
            if (target)
              for (key in source) {
                sourceProperty = source[key];
                if (options.noTargetGet) {
                  descriptor = getOwnPropertyDescriptor(target, key);
                  targetProperty = descriptor && descriptor.value;
                } else
                  targetProperty = target[key];
                FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
                if (!FORCED && targetProperty !== void 0) {
                  if (typeof sourceProperty === typeof targetProperty)
                    continue;
                  copyConstructorProperties(sourceProperty, targetProperty);
                }
                if (options.sham || targetProperty && targetProperty.sham) {
                  createNonEnumerableProperty(sourceProperty, "sham", true);
                }
                redefine(target, key, sourceProperty, options);
              }
          };
        },
        "241c": function(module3, exports3, __webpack_require__) {
          var internalObjectKeys = __webpack_require__("ca84");
          var enumBugKeys = __webpack_require__("7839");
          var hiddenKeys = enumBugKeys.concat("length", "prototype");
          exports3.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
            return internalObjectKeys(O, hiddenKeys);
          };
        },
        "25f0": function(module3, exports3, __webpack_require__) {
          var redefine = __webpack_require__("6eeb");
          var anObject = __webpack_require__("825a");
          var fails = __webpack_require__("d039");
          var flags = __webpack_require__("ad6d");
          var TO_STRING = "toString";
          var RegExpPrototype = RegExp.prototype;
          var nativeToString = RegExpPrototype[TO_STRING];
          var NOT_GENERIC = fails(function() {
            return nativeToString.call({ source: "a", flags: "b" }) != "/a/b";
          });
          var INCORRECT_NAME = nativeToString.name != TO_STRING;
          if (NOT_GENERIC || INCORRECT_NAME) {
            redefine(RegExp.prototype, TO_STRING, function toString2() {
              var R = anObject(this);
              var p = String(R.source);
              var rf = R.flags;
              var f = String(rf === void 0 && R instanceof RegExp && !("flags" in RegExpPrototype) ? flags.call(R) : rf);
              return "/" + p + "/" + f;
            }, { unsafe: true });
          }
        },
        "2ca0": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var getOwnPropertyDescriptor = __webpack_require__("06cf").f;
          var toLength = __webpack_require__("50c4");
          var notARegExp = __webpack_require__("5a34");
          var requireObjectCoercible = __webpack_require__("1d80");
          var correctIsRegExpLogic = __webpack_require__("ab13");
          var IS_PURE = __webpack_require__("c430");
          var nativeStartsWith = "".startsWith;
          var min = Math.min;
          var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith");
          var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
            var descriptor = getOwnPropertyDescriptor(String.prototype, "startsWith");
            return descriptor && !descriptor.writable;
          }();
          $({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
            startsWith: function startsWith(searchString) {
              var that = String(requireObjectCoercible(this));
              notARegExp(searchString);
              var index2 = toLength(min(arguments.length > 1 ? arguments[1] : void 0, that.length));
              var search = String(searchString);
              return nativeStartsWith ? nativeStartsWith.call(that, search, index2) : that.slice(index2, index2 + search.length) === search;
            }
          });
        },
        "2d00": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var userAgent2 = __webpack_require__("342f");
          var process2 = global2.process;
          var versions = process2 && process2.versions;
          var v8 = versions && versions.v8;
          var match, version2;
          if (v8) {
            match = v8.split(".");
            version2 = match[0] + match[1];
          } else if (userAgent2) {
            match = userAgent2.match(/Edge\/(\d+)/);
            if (!match || match[1] >= 74) {
              match = userAgent2.match(/Chrome\/(\d+)/);
              if (match)
                version2 = match[1];
            }
          }
          module3.exports = version2 && +version2;
        },
        "342f": function(module3, exports3, __webpack_require__) {
          var getBuiltIn = __webpack_require__("d066");
          module3.exports = getBuiltIn("navigator", "userAgent") || "";
        },
        "35a1": function(module3, exports3, __webpack_require__) {
          var classof = __webpack_require__("f5df");
          var Iterators = __webpack_require__("3f8c");
          var wellKnownSymbol = __webpack_require__("b622");
          var ITERATOR = wellKnownSymbol("iterator");
          module3.exports = function(it) {
            if (it != void 0)
              return it[ITERATOR] || it["@@iterator"] || Iterators[classof(it)];
          };
        },
        "37e8": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var definePropertyModule = __webpack_require__("9bf2");
          var anObject = __webpack_require__("825a");
          var objectKeys = __webpack_require__("df75");
          module3.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
            anObject(O);
            var keys2 = objectKeys(Properties);
            var length = keys2.length;
            var index2 = 0;
            var key;
            while (length > index2)
              definePropertyModule.f(O, key = keys2[index2++], Properties[key]);
            return O;
          };
        },
        "3bbe": function(module3, exports3, __webpack_require__) {
          var isObject2 = __webpack_require__("861d");
          module3.exports = function(it) {
            if (!isObject2(it) && it !== null) {
              throw TypeError("Can't set " + String(it) + " as a prototype");
            }
            return it;
          };
        },
        "3ca3": function(module3, exports3, __webpack_require__) {
          var charAt = __webpack_require__("6547").charAt;
          var InternalStateModule = __webpack_require__("69f3");
          var defineIterator = __webpack_require__("7dd0");
          var STRING_ITERATOR = "String Iterator";
          var setInternalState = InternalStateModule.set;
          var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
          defineIterator(String, "String", function(iterated) {
            setInternalState(this, {
              type: STRING_ITERATOR,
              string: String(iterated),
              index: 0
            });
          }, function next() {
            var state = getInternalState(this);
            var string2 = state.string;
            var index2 = state.index;
            var point;
            if (index2 >= string2.length)
              return { value: void 0, done: true };
            point = charAt(string2, index2);
            state.index += point.length;
            return { value: point, done: false };
          });
        },
        "3f8c": function(module3, exports3) {
          module3.exports = {};
        },
        "4160": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var forEach2 = __webpack_require__("17c2");
          $({ target: "Array", proto: true, forced: [].forEach != forEach2 }, {
            forEach: forEach2
          });
        },
        "428f": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          module3.exports = global2;
        },
        "44ad": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          var classof = __webpack_require__("c6b6");
          var split = "".split;
          module3.exports = fails(function() {
            return !Object("z").propertyIsEnumerable(0);
          }) ? function(it) {
            return classof(it) == "String" ? split.call(it, "") : Object(it);
          } : Object;
        },
        "44d2": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          var create = __webpack_require__("7c73");
          var definePropertyModule = __webpack_require__("9bf2");
          var UNSCOPABLES = wellKnownSymbol("unscopables");
          var ArrayPrototype = Array.prototype;
          if (ArrayPrototype[UNSCOPABLES] == void 0) {
            definePropertyModule.f(ArrayPrototype, UNSCOPABLES, {
              configurable: true,
              value: create(null)
            });
          }
          module3.exports = function(key) {
            ArrayPrototype[UNSCOPABLES][key] = true;
          };
        },
        "44e7": function(module3, exports3, __webpack_require__) {
          var isObject2 = __webpack_require__("861d");
          var classof = __webpack_require__("c6b6");
          var wellKnownSymbol = __webpack_require__("b622");
          var MATCH2 = wellKnownSymbol("match");
          module3.exports = function(it) {
            var isRegExp;
            return isObject2(it) && ((isRegExp = it[MATCH2]) !== void 0 ? !!isRegExp : classof(it) == "RegExp");
          };
        },
        "4930": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          module3.exports = !!Object.getOwnPropertySymbols && !fails(function() {
            return !String(Symbol());
          });
        },
        "4d64": function(module3, exports3, __webpack_require__) {
          var toIndexedObject = __webpack_require__("fc6a");
          var toLength = __webpack_require__("50c4");
          var toAbsoluteIndex = __webpack_require__("23cb");
          var createMethod = function(IS_INCLUDES) {
            return function($this, el, fromIndex) {
              var O = toIndexedObject($this);
              var length = toLength(O.length);
              var index2 = toAbsoluteIndex(fromIndex, length);
              var value2;
              if (IS_INCLUDES && el != el)
                while (length > index2) {
                  value2 = O[index2++];
                  if (value2 != value2)
                    return true;
                }
              else
                for (; length > index2; index2++) {
                  if ((IS_INCLUDES || index2 in O) && O[index2] === el)
                    return IS_INCLUDES || index2 || 0;
                }
              return !IS_INCLUDES && -1;
            };
          };
          module3.exports = {
            includes: createMethod(true),
            indexOf: createMethod(false)
          };
        },
        "4de4": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $filter = __webpack_require__("b727").filter;
          var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
          var USES_TO_LENGTH = arrayMethodUsesToLength("filter");
          $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
            filter: function filter(callbackfn) {
              return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
        },
        "4df4": function(module3, exports3, __webpack_require__) {
          var bind2 = __webpack_require__("0366");
          var toObject = __webpack_require__("7b0b");
          var callWithSafeIterationClosing = __webpack_require__("9bdd");
          var isArrayIteratorMethod = __webpack_require__("e95a");
          var toLength = __webpack_require__("50c4");
          var createProperty = __webpack_require__("8418");
          var getIteratorMethod = __webpack_require__("35a1");
          module3.exports = function from(arrayLike) {
            var O = toObject(arrayLike);
            var C2 = typeof this == "function" ? this : Array;
            var argumentsLength = arguments.length;
            var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
            var mapping = mapfn !== void 0;
            var iteratorMethod = getIteratorMethod(O);
            var index2 = 0;
            var length, result, step, iterator, next, value2;
            if (mapping)
              mapfn = bind2(mapfn, argumentsLength > 2 ? arguments[2] : void 0, 2);
            if (iteratorMethod != void 0 && !(C2 == Array && isArrayIteratorMethod(iteratorMethod))) {
              iterator = iteratorMethod.call(O);
              next = iterator.next;
              result = new C2();
              for (; !(step = next.call(iterator)).done; index2++) {
                value2 = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index2], true) : step.value;
                createProperty(result, index2, value2);
              }
            } else {
              length = toLength(O.length);
              result = new C2(length);
              for (; length > index2; index2++) {
                value2 = mapping ? mapfn(O[index2], index2) : O[index2];
                createProperty(result, index2, value2);
              }
            }
            result.length = index2;
            return result;
          };
        },
        "4fad": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $entries = __webpack_require__("6f53").entries;
          $({ target: "Object", stat: true }, {
            entries: function entries(O) {
              return $entries(O);
            }
          });
        },
        "50c4": function(module3, exports3, __webpack_require__) {
          var toInteger = __webpack_require__("a691");
          var min = Math.min;
          module3.exports = function(argument) {
            return argument > 0 ? min(toInteger(argument), 9007199254740991) : 0;
          };
        },
        "5135": function(module3, exports3) {
          var hasOwnProperty = {}.hasOwnProperty;
          module3.exports = function(it, key) {
            return hasOwnProperty.call(it, key);
          };
        },
        "5319": function(module3, exports3, __webpack_require__) {
          var fixRegExpWellKnownSymbolLogic = __webpack_require__("d784");
          var anObject = __webpack_require__("825a");
          var toObject = __webpack_require__("7b0b");
          var toLength = __webpack_require__("50c4");
          var toInteger = __webpack_require__("a691");
          var requireObjectCoercible = __webpack_require__("1d80");
          var advanceStringIndex = __webpack_require__("8aa5");
          var regExpExec = __webpack_require__("14c3");
          var max = Math.max;
          var min = Math.min;
          var floor = Math.floor;
          var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g;
          var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g;
          var maybeToString = function(it) {
            return it === void 0 ? it : String(it);
          };
          fixRegExpWellKnownSymbolLogic("replace", 2, function(REPLACE2, nativeReplace, maybeCallNative, reason) {
            var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = reason.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE;
            var REPLACE_KEEPS_$0 = reason.REPLACE_KEEPS_$0;
            var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
            return [
              function replace(searchValue, replaceValue) {
                var O = requireObjectCoercible(this);
                var replacer = searchValue == void 0 ? void 0 : searchValue[REPLACE2];
                return replacer !== void 0 ? replacer.call(searchValue, O, replaceValue) : nativeReplace.call(String(O), searchValue, replaceValue);
              },
              function(regexp, replaceValue) {
                if (!REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE && REPLACE_KEEPS_$0 || typeof replaceValue === "string" && replaceValue.indexOf(UNSAFE_SUBSTITUTE) === -1) {
                  var res = maybeCallNative(nativeReplace, regexp, this, replaceValue);
                  if (res.done)
                    return res.value;
                }
                var rx = anObject(regexp);
                var S = String(this);
                var functionalReplace = typeof replaceValue === "function";
                if (!functionalReplace)
                  replaceValue = String(replaceValue);
                var global2 = rx.global;
                if (global2) {
                  var fullUnicode = rx.unicode;
                  rx.lastIndex = 0;
                }
                var results = [];
                while (true) {
                  var result = regExpExec(rx, S);
                  if (result === null)
                    break;
                  results.push(result);
                  if (!global2)
                    break;
                  var matchStr = String(result[0]);
                  if (matchStr === "")
                    rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
                }
                var accumulatedResult = "";
                var nextSourcePosition = 0;
                for (var i2 = 0; i2 < results.length; i2++) {
                  result = results[i2];
                  var matched = String(result[0]);
                  var position = max(min(toInteger(result.index), S.length), 0);
                  var captures = [];
                  for (var j = 1; j < result.length; j++)
                    captures.push(maybeToString(result[j]));
                  var namedCaptures = result.groups;
                  if (functionalReplace) {
                    var replacerArgs = [matched].concat(captures, position, S);
                    if (namedCaptures !== void 0)
                      replacerArgs.push(namedCaptures);
                    var replacement = String(replaceValue.apply(void 0, replacerArgs));
                  } else {
                    replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
                  }
                  if (position >= nextSourcePosition) {
                    accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
                    nextSourcePosition = position + matched.length;
                  }
                }
                return accumulatedResult + S.slice(nextSourcePosition);
              }
            ];
            function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
              var tailPos = position + matched.length;
              var m = captures.length;
              var symbols2 = SUBSTITUTION_SYMBOLS_NO_NAMED;
              if (namedCaptures !== void 0) {
                namedCaptures = toObject(namedCaptures);
                symbols2 = SUBSTITUTION_SYMBOLS;
              }
              return nativeReplace.call(replacement, symbols2, function(match, ch) {
                var capture;
                switch (ch.charAt(0)) {
                  case "$":
                    return "$";
                  case "&":
                    return matched;
                  case "`":
                    return str.slice(0, position);
                  case "'":
                    return str.slice(tailPos);
                  case "<":
                    capture = namedCaptures[ch.slice(1, -1)];
                    break;
                  default:
                    var n = +ch;
                    if (n === 0)
                      return match;
                    if (n > m) {
                      var f = floor(n / 10);
                      if (f === 0)
                        return match;
                      if (f <= m)
                        return captures[f - 1] === void 0 ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
                      return match;
                    }
                    capture = captures[n - 1];
                }
                return capture === void 0 ? "" : capture;
              });
            }
          });
        },
        "5692": function(module3, exports3, __webpack_require__) {
          var IS_PURE = __webpack_require__("c430");
          var store = __webpack_require__("c6cd");
          (module3.exports = function(key, value2) {
            return store[key] || (store[key] = value2 !== void 0 ? value2 : {});
          })("versions", []).push({
            version: "3.6.5",
            mode: IS_PURE ? "pure" : "global",
            copyright: "\xA9 2020 Denis Pushkarev (zloirock.ru)"
          });
        },
        "56ef": function(module3, exports3, __webpack_require__) {
          var getBuiltIn = __webpack_require__("d066");
          var getOwnPropertyNamesModule = __webpack_require__("241c");
          var getOwnPropertySymbolsModule = __webpack_require__("7418");
          var anObject = __webpack_require__("825a");
          module3.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys2(it) {
            var keys2 = getOwnPropertyNamesModule.f(anObject(it));
            var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
            return getOwnPropertySymbols ? keys2.concat(getOwnPropertySymbols(it)) : keys2;
          };
        },
        "5a34": function(module3, exports3, __webpack_require__) {
          var isRegExp = __webpack_require__("44e7");
          module3.exports = function(it) {
            if (isRegExp(it)) {
              throw TypeError("The method doesn't accept regular expressions");
            }
            return it;
          };
        },
        "5c6c": function(module3, exports3) {
          module3.exports = function(bitmap, value2) {
            return {
              enumerable: !(bitmap & 1),
              configurable: !(bitmap & 2),
              writable: !(bitmap & 4),
              value: value2
            };
          };
        },
        "5db7": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var flattenIntoArray = __webpack_require__("a2bf");
          var toObject = __webpack_require__("7b0b");
          var toLength = __webpack_require__("50c4");
          var aFunction = __webpack_require__("1c0b");
          var arraySpeciesCreate = __webpack_require__("65f0");
          $({ target: "Array", proto: true }, {
            flatMap: function flatMap(callbackfn) {
              var O = toObject(this);
              var sourceLen = toLength(O.length);
              var A;
              aFunction(callbackfn);
              A = arraySpeciesCreate(O, 0);
              A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
              return A;
            }
          });
        },
        "6547": function(module3, exports3, __webpack_require__) {
          var toInteger = __webpack_require__("a691");
          var requireObjectCoercible = __webpack_require__("1d80");
          var createMethod = function(CONVERT_TO_STRING) {
            return function($this, pos) {
              var S = String(requireObjectCoercible($this));
              var position = toInteger(pos);
              var size = S.length;
              var first, second;
              if (position < 0 || position >= size)
                return CONVERT_TO_STRING ? "" : void 0;
              first = S.charCodeAt(position);
              return first < 55296 || first > 56319 || position + 1 === size || (second = S.charCodeAt(position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 55296 << 10) + (second - 56320) + 65536;
            };
          };
          module3.exports = {
            codeAt: createMethod(false),
            charAt: createMethod(true)
          };
        },
        "65f0": function(module3, exports3, __webpack_require__) {
          var isObject2 = __webpack_require__("861d");
          var isArray2 = __webpack_require__("e8b5");
          var wellKnownSymbol = __webpack_require__("b622");
          var SPECIES = wellKnownSymbol("species");
          module3.exports = function(originalArray, length) {
            var C2;
            if (isArray2(originalArray)) {
              C2 = originalArray.constructor;
              if (typeof C2 == "function" && (C2 === Array || isArray2(C2.prototype)))
                C2 = void 0;
              else if (isObject2(C2)) {
                C2 = C2[SPECIES];
                if (C2 === null)
                  C2 = void 0;
              }
            }
            return new (C2 === void 0 ? Array : C2)(length === 0 ? 0 : length);
          };
        },
        "69f3": function(module3, exports3, __webpack_require__) {
          var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
          var global2 = __webpack_require__("da84");
          var isObject2 = __webpack_require__("861d");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var objectHas = __webpack_require__("5135");
          var sharedKey = __webpack_require__("f772");
          var hiddenKeys = __webpack_require__("d012");
          var WeakMap2 = global2.WeakMap;
          var set, get2, has;
          var enforce = function(it) {
            return has(it) ? get2(it) : set(it, {});
          };
          var getterFor = function(TYPE2) {
            return function(it) {
              var state;
              if (!isObject2(it) || (state = get2(it)).type !== TYPE2) {
                throw TypeError("Incompatible receiver, " + TYPE2 + " required");
              }
              return state;
            };
          };
          if (NATIVE_WEAK_MAP) {
            var store = new WeakMap2();
            var wmget = store.get;
            var wmhas = store.has;
            var wmset = store.set;
            set = function(it, metadata) {
              wmset.call(store, it, metadata);
              return metadata;
            };
            get2 = function(it) {
              return wmget.call(store, it) || {};
            };
            has = function(it) {
              return wmhas.call(store, it);
            };
          } else {
            var STATE = sharedKey("state");
            hiddenKeys[STATE] = true;
            set = function(it, metadata) {
              createNonEnumerableProperty(it, STATE, metadata);
              return metadata;
            };
            get2 = function(it) {
              return objectHas(it, STATE) ? it[STATE] : {};
            };
            has = function(it) {
              return objectHas(it, STATE);
            };
          }
          module3.exports = {
            set,
            get: get2,
            has,
            enforce,
            getterFor
          };
        },
        "6eeb": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var has = __webpack_require__("5135");
          var setGlobal = __webpack_require__("ce4e");
          var inspectSource = __webpack_require__("8925");
          var InternalStateModule = __webpack_require__("69f3");
          var getInternalState = InternalStateModule.get;
          var enforceInternalState = InternalStateModule.enforce;
          var TEMPLATE = String(String).split("String");
          (module3.exports = function(O, key, value2, options) {
            var unsafe = options ? !!options.unsafe : false;
            var simple = options ? !!options.enumerable : false;
            var noTargetGet = options ? !!options.noTargetGet : false;
            if (typeof value2 == "function") {
              if (typeof key == "string" && !has(value2, "name"))
                createNonEnumerableProperty(value2, "name", key);
              enforceInternalState(value2).source = TEMPLATE.join(typeof key == "string" ? key : "");
            }
            if (O === global2) {
              if (simple)
                O[key] = value2;
              else
                setGlobal(key, value2);
              return;
            } else if (!unsafe) {
              delete O[key];
            } else if (!noTargetGet && O[key]) {
              simple = true;
            }
            if (simple)
              O[key] = value2;
            else
              createNonEnumerableProperty(O, key, value2);
          })(Function.prototype, "toString", function toString2() {
            return typeof this == "function" && getInternalState(this).source || inspectSource(this);
          });
        },
        "6f53": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var objectKeys = __webpack_require__("df75");
          var toIndexedObject = __webpack_require__("fc6a");
          var propertyIsEnumerable = __webpack_require__("d1e7").f;
          var createMethod = function(TO_ENTRIES) {
            return function(it) {
              var O = toIndexedObject(it);
              var keys2 = objectKeys(O);
              var length = keys2.length;
              var i2 = 0;
              var result = [];
              var key;
              while (length > i2) {
                key = keys2[i2++];
                if (!DESCRIPTORS || propertyIsEnumerable.call(O, key)) {
                  result.push(TO_ENTRIES ? [key, O[key]] : O[key]);
                }
              }
              return result;
            };
          };
          module3.exports = {
            entries: createMethod(true),
            values: createMethod(false)
          };
        },
        "73d9": function(module3, exports3, __webpack_require__) {
          var addToUnscopables = __webpack_require__("44d2");
          addToUnscopables("flatMap");
        },
        "7418": function(module3, exports3) {
          exports3.f = Object.getOwnPropertySymbols;
        },
        "746f": function(module3, exports3, __webpack_require__) {
          var path = __webpack_require__("428f");
          var has = __webpack_require__("5135");
          var wrappedWellKnownSymbolModule = __webpack_require__("e538");
          var defineProperty = __webpack_require__("9bf2").f;
          module3.exports = function(NAME) {
            var Symbol2 = path.Symbol || (path.Symbol = {});
            if (!has(Symbol2, NAME))
              defineProperty(Symbol2, NAME, {
                value: wrappedWellKnownSymbolModule.f(NAME)
              });
          };
        },
        "7839": function(module3, exports3) {
          module3.exports = [
            "constructor",
            "hasOwnProperty",
            "isPrototypeOf",
            "propertyIsEnumerable",
            "toLocaleString",
            "toString",
            "valueOf"
          ];
        },
        "7b0b": function(module3, exports3, __webpack_require__) {
          var requireObjectCoercible = __webpack_require__("1d80");
          module3.exports = function(argument) {
            return Object(requireObjectCoercible(argument));
          };
        },
        "7c73": function(module3, exports3, __webpack_require__) {
          var anObject = __webpack_require__("825a");
          var defineProperties = __webpack_require__("37e8");
          var enumBugKeys = __webpack_require__("7839");
          var hiddenKeys = __webpack_require__("d012");
          var html = __webpack_require__("1be4");
          var documentCreateElement = __webpack_require__("cc12");
          var sharedKey = __webpack_require__("f772");
          var GT2 = ">";
          var LT2 = "<";
          var PROTOTYPE = "prototype";
          var SCRIPT = "script";
          var IE_PROTO = sharedKey("IE_PROTO");
          var EmptyConstructor = function() {
          };
          var scriptTag = function(content2) {
            return LT2 + SCRIPT + GT2 + content2 + LT2 + "/" + SCRIPT + GT2;
          };
          var NullProtoObjectViaActiveX = function(activeXDocument2) {
            activeXDocument2.write(scriptTag(""));
            activeXDocument2.close();
            var temp = activeXDocument2.parentWindow.Object;
            activeXDocument2 = null;
            return temp;
          };
          var NullProtoObjectViaIFrame = function() {
            var iframe = documentCreateElement("iframe");
            var JS = "java" + SCRIPT + ":";
            var iframeDocument;
            iframe.style.display = "none";
            html.appendChild(iframe);
            iframe.src = String(JS);
            iframeDocument = iframe.contentWindow.document;
            iframeDocument.open();
            iframeDocument.write(scriptTag("document.F=Object"));
            iframeDocument.close();
            return iframeDocument.F;
          };
          var activeXDocument;
          var NullProtoObject = function() {
            try {
              activeXDocument = document.domain && new ActiveXObject("htmlfile");
            } catch (error2) {
            }
            NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
            var length = enumBugKeys.length;
            while (length--)
              delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
            return NullProtoObject();
          };
          hiddenKeys[IE_PROTO] = true;
          module3.exports = Object.create || function create(O, Properties) {
            var result;
            if (O !== null) {
              EmptyConstructor[PROTOTYPE] = anObject(O);
              result = new EmptyConstructor();
              EmptyConstructor[PROTOTYPE] = null;
              result[IE_PROTO] = O;
            } else
              result = NullProtoObject();
            return Properties === void 0 ? result : defineProperties(result, Properties);
          };
        },
        "7dd0": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var createIteratorConstructor = __webpack_require__("9ed3");
          var getPrototypeOf = __webpack_require__("e163");
          var setPrototypeOf = __webpack_require__("d2bb");
          var setToStringTag = __webpack_require__("d44e");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var redefine = __webpack_require__("6eeb");
          var wellKnownSymbol = __webpack_require__("b622");
          var IS_PURE = __webpack_require__("c430");
          var Iterators = __webpack_require__("3f8c");
          var IteratorsCore = __webpack_require__("ae93");
          var IteratorPrototype = IteratorsCore.IteratorPrototype;
          var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
          var ITERATOR = wellKnownSymbol("iterator");
          var KEYS = "keys";
          var VALUES = "values";
          var ENTRIES = "entries";
          var returnThis = function() {
            return this;
          };
          module3.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
            createIteratorConstructor(IteratorConstructor, NAME, next);
            var getIterationMethod = function(KIND) {
              if (KIND === DEFAULT && defaultIterator)
                return defaultIterator;
              if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype)
                return IterablePrototype[KIND];
              switch (KIND) {
                case KEYS:
                  return function keys2() {
                    return new IteratorConstructor(this, KIND);
                  };
                case VALUES:
                  return function values() {
                    return new IteratorConstructor(this, KIND);
                  };
                case ENTRIES:
                  return function entries() {
                    return new IteratorConstructor(this, KIND);
                  };
              }
              return function() {
                return new IteratorConstructor(this);
              };
            };
            var TO_STRING_TAG = NAME + " Iterator";
            var INCORRECT_VALUES_NAME = false;
            var IterablePrototype = Iterable.prototype;
            var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
            var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
            var anyNativeIterator = NAME == "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
            var CurrentIteratorPrototype, methods, KEY;
            if (anyNativeIterator) {
              CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
              if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
                if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
                  if (setPrototypeOf) {
                    setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
                  } else if (typeof CurrentIteratorPrototype[ITERATOR] != "function") {
                    createNonEnumerableProperty(CurrentIteratorPrototype, ITERATOR, returnThis);
                  }
                }
                setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
                if (IS_PURE)
                  Iterators[TO_STRING_TAG] = returnThis;
              }
            }
            if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
              INCORRECT_VALUES_NAME = true;
              defaultIterator = function values() {
                return nativeIterator.call(this);
              };
            }
            if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
              createNonEnumerableProperty(IterablePrototype, ITERATOR, defaultIterator);
            }
            Iterators[NAME] = defaultIterator;
            if (DEFAULT) {
              methods = {
                values: getIterationMethod(VALUES),
                keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
                entries: getIterationMethod(ENTRIES)
              };
              if (FORCED)
                for (KEY in methods) {
                  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
                    redefine(IterablePrototype, KEY, methods[KEY]);
                  }
                }
              else
                $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
            }
            return methods;
          };
        },
        "7f9a": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var inspectSource = __webpack_require__("8925");
          var WeakMap2 = global2.WeakMap;
          module3.exports = typeof WeakMap2 === "function" && /native code/.test(inspectSource(WeakMap2));
        },
        "825a": function(module3, exports3, __webpack_require__) {
          var isObject2 = __webpack_require__("861d");
          module3.exports = function(it) {
            if (!isObject2(it)) {
              throw TypeError(String(it) + " is not an object");
            }
            return it;
          };
        },
        "83ab": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          module3.exports = !fails(function() {
            return Object.defineProperty({}, 1, { get: function() {
              return 7;
            } })[1] != 7;
          });
        },
        "8418": function(module3, exports3, __webpack_require__) {
          var toPrimitive = __webpack_require__("c04e");
          var definePropertyModule = __webpack_require__("9bf2");
          var createPropertyDescriptor = __webpack_require__("5c6c");
          module3.exports = function(object, key, value2) {
            var propertyKey = toPrimitive(key);
            if (propertyKey in object)
              definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value2));
            else
              object[propertyKey] = value2;
          };
        },
        "861d": function(module3, exports3) {
          module3.exports = function(it) {
            return typeof it === "object" ? it !== null : typeof it === "function";
          };
        },
        "8875": function(module3, exports3, __webpack_require__) {
          var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
          (function(root, factory) {
            {
              !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports3, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__ !== void 0 && (module3.exports = __WEBPACK_AMD_DEFINE_RESULT__));
            }
          })(typeof self !== "undefined" ? self : this, function() {
            function getCurrentScript() {
              var descriptor = Object.getOwnPropertyDescriptor(document, "currentScript");
              if (!descriptor && "currentScript" in document && document.currentScript) {
                return document.currentScript;
              }
              if (descriptor && descriptor.get !== getCurrentScript && document.currentScript) {
                return document.currentScript;
              }
              try {
                throw new Error();
              } catch (err) {
                var ieStackRegExp = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, ffStackRegExp = /@([^@]*):(\d+):(\d+)\s*$/ig, stackDetails = ieStackRegExp.exec(err.stack) || ffStackRegExp.exec(err.stack), scriptLocation = stackDetails && stackDetails[1] || false, line = stackDetails && stackDetails[2] || false, currentLocation = document.location.href.replace(document.location.hash, ""), pageSource, inlineScriptSourceRegExp, inlineScriptSource, scripts = document.getElementsByTagName("script");
                if (scriptLocation === currentLocation) {
                  pageSource = document.documentElement.outerHTML;
                  inlineScriptSourceRegExp = new RegExp("(?:[^\\n]+?\\n){0," + (line - 2) + "}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*", "i");
                  inlineScriptSource = pageSource.replace(inlineScriptSourceRegExp, "$1").trim();
                }
                for (var i2 = 0; i2 < scripts.length; i2++) {
                  if (scripts[i2].readyState === "interactive") {
                    return scripts[i2];
                  }
                  if (scripts[i2].src === scriptLocation) {
                    return scripts[i2];
                  }
                  if (scriptLocation === currentLocation && scripts[i2].innerHTML && scripts[i2].innerHTML.trim() === inlineScriptSource) {
                    return scripts[i2];
                  }
                }
                return null;
              }
            }
            return getCurrentScript;
          });
        },
        "8925": function(module3, exports3, __webpack_require__) {
          var store = __webpack_require__("c6cd");
          var functionToString = Function.toString;
          if (typeof store.inspectSource != "function") {
            store.inspectSource = function(it) {
              return functionToString.call(it);
            };
          }
          module3.exports = store.inspectSource;
        },
        "8aa5": function(module3, exports3, __webpack_require__) {
          var charAt = __webpack_require__("6547").charAt;
          module3.exports = function(S, index2, unicode) {
            return index2 + (unicode ? charAt(S, index2).length : 1);
          };
        },
        "8bbf": function(module3, exports3) {
          module3.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__;
        },
        "90e3": function(module3, exports3) {
          var id2 = 0;
          var postfix = Math.random();
          module3.exports = function(key) {
            return "Symbol(" + String(key === void 0 ? "" : key) + ")_" + (++id2 + postfix).toString(36);
          };
        },
        "9112": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var definePropertyModule = __webpack_require__("9bf2");
          var createPropertyDescriptor = __webpack_require__("5c6c");
          module3.exports = DESCRIPTORS ? function(object, key, value2) {
            return definePropertyModule.f(object, key, createPropertyDescriptor(1, value2));
          } : function(object, key, value2) {
            object[key] = value2;
            return object;
          };
        },
        "9263": function(module3, exports3, __webpack_require__) {
          var regexpFlags = __webpack_require__("ad6d");
          var stickyHelpers = __webpack_require__("9f7f");
          var nativeExec = RegExp.prototype.exec;
          var nativeReplace = String.prototype.replace;
          var patchedExec = nativeExec;
          var UPDATES_LAST_INDEX_WRONG = function() {
            var re1 = /a/;
            var re2 = /b*/g;
            nativeExec.call(re1, "a");
            nativeExec.call(re2, "a");
            return re1.lastIndex !== 0 || re2.lastIndex !== 0;
          }();
          var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y || stickyHelpers.BROKEN_CARET;
          var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
          var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y;
          if (PATCH) {
            patchedExec = function exec(str) {
              var re = this;
              var lastIndex, reCopy, match, i2;
              var sticky = UNSUPPORTED_Y && re.sticky;
              var flags = regexpFlags.call(re);
              var source = re.source;
              var charsAdded = 0;
              var strCopy = str;
              if (sticky) {
                flags = flags.replace("y", "");
                if (flags.indexOf("g") === -1) {
                  flags += "g";
                }
                strCopy = String(str).slice(re.lastIndex);
                if (re.lastIndex > 0 && (!re.multiline || re.multiline && str[re.lastIndex - 1] !== "\n")) {
                  source = "(?: " + source + ")";
                  strCopy = " " + strCopy;
                  charsAdded++;
                }
                reCopy = new RegExp("^(?:" + source + ")", flags);
              }
              if (NPCG_INCLUDED) {
                reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
              }
              if (UPDATES_LAST_INDEX_WRONG)
                lastIndex = re.lastIndex;
              match = nativeExec.call(sticky ? reCopy : re, strCopy);
              if (sticky) {
                if (match) {
                  match.input = match.input.slice(charsAdded);
                  match[0] = match[0].slice(charsAdded);
                  match.index = re.lastIndex;
                  re.lastIndex += match[0].length;
                } else
                  re.lastIndex = 0;
              } else if (UPDATES_LAST_INDEX_WRONG && match) {
                re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
              }
              if (NPCG_INCLUDED && match && match.length > 1) {
                nativeReplace.call(match[0], reCopy, function() {
                  for (i2 = 1; i2 < arguments.length - 2; i2++) {
                    if (arguments[i2] === void 0)
                      match[i2] = void 0;
                  }
                });
              }
              return match;
            };
          }
          module3.exports = patchedExec;
        },
        "94ca": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          var replacement = /#|\.prototype\./;
          var isForced = function(feature, detection) {
            var value2 = data2[normalize(feature)];
            return value2 == POLYFILL ? true : value2 == NATIVE ? false : typeof detection == "function" ? fails(detection) : !!detection;
          };
          var normalize = isForced.normalize = function(string2) {
            return String(string2).replace(replacement, ".").toLowerCase();
          };
          var data2 = isForced.data = {};
          var NATIVE = isForced.NATIVE = "N";
          var POLYFILL = isForced.POLYFILL = "P";
          module3.exports = isForced;
        },
        "99af": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var fails = __webpack_require__("d039");
          var isArray2 = __webpack_require__("e8b5");
          var isObject2 = __webpack_require__("861d");
          var toObject = __webpack_require__("7b0b");
          var toLength = __webpack_require__("50c4");
          var createProperty = __webpack_require__("8418");
          var arraySpeciesCreate = __webpack_require__("65f0");
          var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
          var wellKnownSymbol = __webpack_require__("b622");
          var V8_VERSION = __webpack_require__("2d00");
          var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable");
          var MAX_SAFE_INTEGER = 9007199254740991;
          var MAXIMUM_ALLOWED_INDEX_EXCEEDED = "Maximum allowed index exceeded";
          var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() {
            var array = [];
            array[IS_CONCAT_SPREADABLE] = false;
            return array.concat()[0] !== array;
          });
          var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("concat");
          var isConcatSpreadable = function(O) {
            if (!isObject2(O))
              return false;
            var spreadable = O[IS_CONCAT_SPREADABLE];
            return spreadable !== void 0 ? !!spreadable : isArray2(O);
          };
          var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT;
          $({ target: "Array", proto: true, forced: FORCED }, {
            concat: function concat(arg) {
              var O = toObject(this);
              var A = arraySpeciesCreate(O, 0);
              var n = 0;
              var i2, k, length, len, E;
              for (i2 = -1, length = arguments.length; i2 < length; i2++) {
                E = i2 === -1 ? O : arguments[i2];
                if (isConcatSpreadable(E)) {
                  len = toLength(E.length);
                  if (n + len > MAX_SAFE_INTEGER)
                    throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
                  for (k = 0; k < len; k++, n++)
                    if (k in E)
                      createProperty(A, n, E[k]);
                } else {
                  if (n >= MAX_SAFE_INTEGER)
                    throw TypeError(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
                  createProperty(A, n++, E);
                }
              }
              A.length = n;
              return A;
            }
          });
        },
        "9bdd": function(module3, exports3, __webpack_require__) {
          var anObject = __webpack_require__("825a");
          module3.exports = function(iterator, fn, value2, ENTRIES) {
            try {
              return ENTRIES ? fn(anObject(value2)[0], value2[1]) : fn(value2);
            } catch (error2) {
              var returnMethod = iterator["return"];
              if (returnMethod !== void 0)
                anObject(returnMethod.call(iterator));
              throw error2;
            }
          };
        },
        "9bf2": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var IE8_DOM_DEFINE = __webpack_require__("0cfb");
          var anObject = __webpack_require__("825a");
          var toPrimitive = __webpack_require__("c04e");
          var nativeDefineProperty = Object.defineProperty;
          exports3.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) {
            anObject(O);
            P = toPrimitive(P, true);
            anObject(Attributes);
            if (IE8_DOM_DEFINE)
              try {
                return nativeDefineProperty(O, P, Attributes);
              } catch (error2) {
              }
            if ("get" in Attributes || "set" in Attributes)
              throw TypeError("Accessors not supported");
            if ("value" in Attributes)
              O[P] = Attributes.value;
            return O;
          };
        },
        "9ed3": function(module3, exports3, __webpack_require__) {
          var IteratorPrototype = __webpack_require__("ae93").IteratorPrototype;
          var create = __webpack_require__("7c73");
          var createPropertyDescriptor = __webpack_require__("5c6c");
          var setToStringTag = __webpack_require__("d44e");
          var Iterators = __webpack_require__("3f8c");
          var returnThis = function() {
            return this;
          };
          module3.exports = function(IteratorConstructor, NAME, next) {
            var TO_STRING_TAG = NAME + " Iterator";
            IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) });
            setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
            Iterators[TO_STRING_TAG] = returnThis;
            return IteratorConstructor;
          };
        },
        "9f7f": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          function RE(s, f) {
            return RegExp(s, f);
          }
          exports3.UNSUPPORTED_Y = fails(function() {
            var re = RE("a", "y");
            re.lastIndex = 2;
            return re.exec("abcd") != null;
          });
          exports3.BROKEN_CARET = fails(function() {
            var re = RE("^r", "gy");
            re.lastIndex = 2;
            return re.exec("str") != null;
          });
        },
        "a2bf": function(module3, exports3, __webpack_require__) {
          var isArray2 = __webpack_require__("e8b5");
          var toLength = __webpack_require__("50c4");
          var bind2 = __webpack_require__("0366");
          var flattenIntoArray = function(target, original, source, sourceLen, start, depth, mapper, thisArg) {
            var targetIndex = start;
            var sourceIndex = 0;
            var mapFn = mapper ? bind2(mapper, thisArg, 3) : false;
            var element;
            while (sourceIndex < sourceLen) {
              if (sourceIndex in source) {
                element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
                if (depth > 0 && isArray2(element)) {
                  targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
                } else {
                  if (targetIndex >= 9007199254740991)
                    throw TypeError("Exceed the acceptable array length");
                  target[targetIndex] = element;
                }
                targetIndex++;
              }
              sourceIndex++;
            }
            return targetIndex;
          };
          module3.exports = flattenIntoArray;
        },
        "a352": function(module3, exports3) {
          module3.exports = __WEBPACK_EXTERNAL_MODULE_a352__;
        },
        "a434": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var toAbsoluteIndex = __webpack_require__("23cb");
          var toInteger = __webpack_require__("a691");
          var toLength = __webpack_require__("50c4");
          var toObject = __webpack_require__("7b0b");
          var arraySpeciesCreate = __webpack_require__("65f0");
          var createProperty = __webpack_require__("8418");
          var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice");
          var USES_TO_LENGTH = arrayMethodUsesToLength("splice", { ACCESSORS: true, 0: 0, 1: 2 });
          var max = Math.max;
          var min = Math.min;
          var MAX_SAFE_INTEGER = 9007199254740991;
          var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = "Maximum allowed length exceeded";
          $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
            splice: function splice(start, deleteCount) {
              var O = toObject(this);
              var len = toLength(O.length);
              var actualStart = toAbsoluteIndex(start, len);
              var argumentsLength = arguments.length;
              var insertCount, actualDeleteCount, A, k, from, to;
              if (argumentsLength === 0) {
                insertCount = actualDeleteCount = 0;
              } else if (argumentsLength === 1) {
                insertCount = 0;
                actualDeleteCount = len - actualStart;
              } else {
                insertCount = argumentsLength - 2;
                actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart);
              }
              if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
                throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
              }
              A = arraySpeciesCreate(O, actualDeleteCount);
              for (k = 0; k < actualDeleteCount; k++) {
                from = actualStart + k;
                if (from in O)
                  createProperty(A, k, O[from]);
              }
              A.length = actualDeleteCount;
              if (insertCount < actualDeleteCount) {
                for (k = actualStart; k < len - actualDeleteCount; k++) {
                  from = k + actualDeleteCount;
                  to = k + insertCount;
                  if (from in O)
                    O[to] = O[from];
                  else
                    delete O[to];
                }
                for (k = len; k > len - actualDeleteCount + insertCount; k--)
                  delete O[k - 1];
              } else if (insertCount > actualDeleteCount) {
                for (k = len - actualDeleteCount; k > actualStart; k--) {
                  from = k + actualDeleteCount - 1;
                  to = k + insertCount - 1;
                  if (from in O)
                    O[to] = O[from];
                  else
                    delete O[to];
                }
              }
              for (k = 0; k < insertCount; k++) {
                O[k + actualStart] = arguments[k + 2];
              }
              O.length = len - actualDeleteCount + insertCount;
              return A;
            }
          });
        },
        "a4d3": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var global2 = __webpack_require__("da84");
          var getBuiltIn = __webpack_require__("d066");
          var IS_PURE = __webpack_require__("c430");
          var DESCRIPTORS = __webpack_require__("83ab");
          var NATIVE_SYMBOL = __webpack_require__("4930");
          var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
          var fails = __webpack_require__("d039");
          var has = __webpack_require__("5135");
          var isArray2 = __webpack_require__("e8b5");
          var isObject2 = __webpack_require__("861d");
          var anObject = __webpack_require__("825a");
          var toObject = __webpack_require__("7b0b");
          var toIndexedObject = __webpack_require__("fc6a");
          var toPrimitive = __webpack_require__("c04e");
          var createPropertyDescriptor = __webpack_require__("5c6c");
          var nativeObjectCreate = __webpack_require__("7c73");
          var objectKeys = __webpack_require__("df75");
          var getOwnPropertyNamesModule = __webpack_require__("241c");
          var getOwnPropertyNamesExternal = __webpack_require__("057f");
          var getOwnPropertySymbolsModule = __webpack_require__("7418");
          var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
          var definePropertyModule = __webpack_require__("9bf2");
          var propertyIsEnumerableModule = __webpack_require__("d1e7");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var redefine = __webpack_require__("6eeb");
          var shared = __webpack_require__("5692");
          var sharedKey = __webpack_require__("f772");
          var hiddenKeys = __webpack_require__("d012");
          var uid = __webpack_require__("90e3");
          var wellKnownSymbol = __webpack_require__("b622");
          var wrappedWellKnownSymbolModule = __webpack_require__("e538");
          var defineWellKnownSymbol = __webpack_require__("746f");
          var setToStringTag = __webpack_require__("d44e");
          var InternalStateModule = __webpack_require__("69f3");
          var $forEach = __webpack_require__("b727").forEach;
          var HIDDEN = sharedKey("hidden");
          var SYMBOL = "Symbol";
          var PROTOTYPE = "prototype";
          var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
          var setInternalState = InternalStateModule.set;
          var getInternalState = InternalStateModule.getterFor(SYMBOL);
          var ObjectPrototype = Object[PROTOTYPE];
          var $Symbol = global2.Symbol;
          var $stringify = getBuiltIn("JSON", "stringify");
          var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
          var nativeDefineProperty = definePropertyModule.f;
          var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
          var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
          var AllSymbols = shared("symbols");
          var ObjectPrototypeSymbols = shared("op-symbols");
          var StringToSymbolRegistry = shared("string-to-symbol-registry");
          var SymbolToStringRegistry = shared("symbol-to-string-registry");
          var WellKnownSymbolsStore = shared("wks");
          var QObject = global2.QObject;
          var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
          var setSymbolDescriptor = DESCRIPTORS && fails(function() {
            return nativeObjectCreate(nativeDefineProperty({}, "a", {
              get: function() {
                return nativeDefineProperty(this, "a", { value: 7 }).a;
              }
            })).a != 7;
          }) ? function(O, P, Attributes) {
            var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P);
            if (ObjectPrototypeDescriptor)
              delete ObjectPrototype[P];
            nativeDefineProperty(O, P, Attributes);
            if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
              nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
            }
          } : nativeDefineProperty;
          var wrap = function(tag, description) {
            var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]);
            setInternalState(symbol, {
              type: SYMBOL,
              tag,
              description
            });
            if (!DESCRIPTORS)
              symbol.description = description;
            return symbol;
          };
          var isSymbol = USE_SYMBOL_AS_UID ? function(it) {
            return typeof it == "symbol";
          } : function(it) {
            return Object(it) instanceof $Symbol;
          };
          var $defineProperty = function defineProperty(O, P, Attributes) {
            if (O === ObjectPrototype)
              $defineProperty(ObjectPrototypeSymbols, P, Attributes);
            anObject(O);
            var key = toPrimitive(P, true);
            anObject(Attributes);
            if (has(AllSymbols, key)) {
              if (!Attributes.enumerable) {
                if (!has(O, HIDDEN))
                  nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
                O[HIDDEN][key] = true;
              } else {
                if (has(O, HIDDEN) && O[HIDDEN][key])
                  O[HIDDEN][key] = false;
                Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
              }
              return setSymbolDescriptor(O, key, Attributes);
            }
            return nativeDefineProperty(O, key, Attributes);
          };
          var $defineProperties = function defineProperties(O, Properties) {
            anObject(O);
            var properties = toIndexedObject(Properties);
            var keys2 = objectKeys(properties).concat($getOwnPropertySymbols(properties));
            $forEach(keys2, function(key) {
              if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key))
                $defineProperty(O, key, properties[key]);
            });
            return O;
          };
          var $create = function create(O, Properties) {
            return Properties === void 0 ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
          };
          var $propertyIsEnumerable = function propertyIsEnumerable(V) {
            var P = toPrimitive(V, true);
            var enumerable = nativePropertyIsEnumerable.call(this, P);
            if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P))
              return false;
            return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
          };
          var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
            var it = toIndexedObject(O);
            var key = toPrimitive(P, true);
            if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key))
              return;
            var descriptor = nativeGetOwnPropertyDescriptor(it, key);
            if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) {
              descriptor.enumerable = true;
            }
            return descriptor;
          };
          var $getOwnPropertyNames = function getOwnPropertyNames(O) {
            var names = nativeGetOwnPropertyNames(toIndexedObject(O));
            var result = [];
            $forEach(names, function(key) {
              if (!has(AllSymbols, key) && !has(hiddenKeys, key))
                result.push(key);
            });
            return result;
          };
          var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
            var IS_OBJECT_PROTOTYPE = O === ObjectPrototype;
            var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O));
            var result = [];
            $forEach(names, function(key) {
              if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) {
                result.push(AllSymbols[key]);
              }
            });
            return result;
          };
          if (!NATIVE_SYMBOL) {
            $Symbol = function Symbol2() {
              if (this instanceof $Symbol)
                throw TypeError("Symbol is not a constructor");
              var description = !arguments.length || arguments[0] === void 0 ? void 0 : String(arguments[0]);
              var tag = uid(description);
              var setter = function(value2) {
                if (this === ObjectPrototype)
                  setter.call(ObjectPrototypeSymbols, value2);
                if (has(this, HIDDEN) && has(this[HIDDEN], tag))
                  this[HIDDEN][tag] = false;
                setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value2));
              };
              if (DESCRIPTORS && USE_SETTER)
                setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
              return wrap(tag, description);
            };
            redefine($Symbol[PROTOTYPE], "toString", function toString2() {
              return getInternalState(this).tag;
            });
            redefine($Symbol, "withoutSetter", function(description) {
              return wrap(uid(description), description);
            });
            propertyIsEnumerableModule.f = $propertyIsEnumerable;
            definePropertyModule.f = $defineProperty;
            getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
            getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
            getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
            wrappedWellKnownSymbolModule.f = function(name2) {
              return wrap(wellKnownSymbol(name2), name2);
            };
            if (DESCRIPTORS) {
              nativeDefineProperty($Symbol[PROTOTYPE], "description", {
                configurable: true,
                get: function description() {
                  return getInternalState(this).description;
                }
              });
              if (!IS_PURE) {
                redefine(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
              }
            }
          }
          $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
            Symbol: $Symbol
          });
          $forEach(objectKeys(WellKnownSymbolsStore), function(name2) {
            defineWellKnownSymbol(name2);
          });
          $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
            "for": function(key) {
              var string2 = String(key);
              if (has(StringToSymbolRegistry, string2))
                return StringToSymbolRegistry[string2];
              var symbol = $Symbol(string2);
              StringToSymbolRegistry[string2] = symbol;
              SymbolToStringRegistry[symbol] = string2;
              return symbol;
            },
            keyFor: function keyFor(sym) {
              if (!isSymbol(sym))
                throw TypeError(sym + " is not a symbol");
              if (has(SymbolToStringRegistry, sym))
                return SymbolToStringRegistry[sym];
            },
            useSetter: function() {
              USE_SETTER = true;
            },
            useSimple: function() {
              USE_SETTER = false;
            }
          });
          $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
            create: $create,
            defineProperty: $defineProperty,
            defineProperties: $defineProperties,
            getOwnPropertyDescriptor: $getOwnPropertyDescriptor
          });
          $({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
            getOwnPropertyNames: $getOwnPropertyNames,
            getOwnPropertySymbols: $getOwnPropertySymbols
          });
          $({ target: "Object", stat: true, forced: fails(function() {
            getOwnPropertySymbolsModule.f(1);
          }) }, {
            getOwnPropertySymbols: function getOwnPropertySymbols(it) {
              return getOwnPropertySymbolsModule.f(toObject(it));
            }
          });
          if ($stringify) {
            var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails(function() {
              var symbol = $Symbol();
              return $stringify([symbol]) != "[null]" || $stringify({ a: symbol }) != "{}" || $stringify(Object(symbol)) != "{}";
            });
            $({ target: "JSON", stat: true, forced: FORCED_JSON_STRINGIFY }, {
              stringify: function stringify(it, replacer, space2) {
                var args = [it];
                var index2 = 1;
                var $replacer;
                while (arguments.length > index2)
                  args.push(arguments[index2++]);
                $replacer = replacer;
                if (!isObject2(replacer) && it === void 0 || isSymbol(it))
                  return;
                if (!isArray2(replacer))
                  replacer = function(key, value2) {
                    if (typeof $replacer == "function")
                      value2 = $replacer.call(this, key, value2);
                    if (!isSymbol(value2))
                      return value2;
                  };
                args[1] = replacer;
                return $stringify.apply(null, args);
              }
            });
          }
          if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) {
            createNonEnumerableProperty($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
          }
          setToStringTag($Symbol, SYMBOL);
          hiddenKeys[HIDDEN] = true;
        },
        "a630": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var from = __webpack_require__("4df4");
          var checkCorrectnessOfIteration = __webpack_require__("1c7e");
          var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
            Array.from(iterable);
          });
          $({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
            from
          });
        },
        "a640": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          module3.exports = function(METHOD_NAME, argument) {
            var method = [][METHOD_NAME];
            return !!method && fails(function() {
              method.call(null, argument || function() {
                throw 1;
              }, 1);
            });
          };
        },
        "a691": function(module3, exports3) {
          var ceil = Math.ceil;
          var floor = Math.floor;
          module3.exports = function(argument) {
            return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument);
          };
        },
        "ab13": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          var MATCH2 = wellKnownSymbol("match");
          module3.exports = function(METHOD_NAME) {
            var regexp = /./;
            try {
              "/./"[METHOD_NAME](regexp);
            } catch (e) {
              try {
                regexp[MATCH2] = false;
                return "/./"[METHOD_NAME](regexp);
              } catch (f) {
              }
            }
            return false;
          };
        },
        "ac1f": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var exec = __webpack_require__("9263");
          $({ target: "RegExp", proto: true, forced: /./.exec !== exec }, {
            exec
          });
        },
        "ad6d": function(module3, exports3, __webpack_require__) {
          var anObject = __webpack_require__("825a");
          module3.exports = function() {
            var that = anObject(this);
            var result = "";
            if (that.global)
              result += "g";
            if (that.ignoreCase)
              result += "i";
            if (that.multiline)
              result += "m";
            if (that.dotAll)
              result += "s";
            if (that.unicode)
              result += "u";
            if (that.sticky)
              result += "y";
            return result;
          };
        },
        "ae40": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var fails = __webpack_require__("d039");
          var has = __webpack_require__("5135");
          var defineProperty = Object.defineProperty;
          var cache2 = {};
          var thrower = function(it) {
            throw it;
          };
          module3.exports = function(METHOD_NAME, options) {
            if (has(cache2, METHOD_NAME))
              return cache2[METHOD_NAME];
            if (!options)
              options = {};
            var method = [][METHOD_NAME];
            var ACCESSORS = has(options, "ACCESSORS") ? options.ACCESSORS : false;
            var argument0 = has(options, 0) ? options[0] : thrower;
            var argument1 = has(options, 1) ? options[1] : void 0;
            return cache2[METHOD_NAME] = !!method && !fails(function() {
              if (ACCESSORS && !DESCRIPTORS)
                return true;
              var O = { length: -1 };
              if (ACCESSORS)
                defineProperty(O, 1, { enumerable: true, get: thrower });
              else
                O[1] = 1;
              method.call(O, argument0, argument1);
            });
          };
        },
        "ae93": function(module3, exports3, __webpack_require__) {
          var getPrototypeOf = __webpack_require__("e163");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var has = __webpack_require__("5135");
          var wellKnownSymbol = __webpack_require__("b622");
          var IS_PURE = __webpack_require__("c430");
          var ITERATOR = wellKnownSymbol("iterator");
          var BUGGY_SAFARI_ITERATORS = false;
          var returnThis = function() {
            return this;
          };
          var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
          if ([].keys) {
            arrayIterator = [].keys();
            if (!("next" in arrayIterator))
              BUGGY_SAFARI_ITERATORS = true;
            else {
              PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
              if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
                IteratorPrototype = PrototypeOfArrayIteratorPrototype;
            }
          }
          if (IteratorPrototype == void 0)
            IteratorPrototype = {};
          if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) {
            createNonEnumerableProperty(IteratorPrototype, ITERATOR, returnThis);
          }
          module3.exports = {
            IteratorPrototype,
            BUGGY_SAFARI_ITERATORS
          };
        },
        "b041": function(module3, exports3, __webpack_require__) {
          var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
          var classof = __webpack_require__("f5df");
          module3.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString2() {
            return "[object " + classof(this) + "]";
          };
        },
        "b0c0": function(module3, exports3, __webpack_require__) {
          var DESCRIPTORS = __webpack_require__("83ab");
          var defineProperty = __webpack_require__("9bf2").f;
          var FunctionPrototype = Function.prototype;
          var FunctionPrototypeToString = FunctionPrototype.toString;
          var nameRE = /^\s*function ([^ (]*)/;
          var NAME = "name";
          if (DESCRIPTORS && !(NAME in FunctionPrototype)) {
            defineProperty(FunctionPrototype, NAME, {
              configurable: true,
              get: function() {
                try {
                  return FunctionPrototypeToString.call(this).match(nameRE)[1];
                } catch (error2) {
                  return "";
                }
              }
            });
          }
        },
        "b622": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var shared = __webpack_require__("5692");
          var has = __webpack_require__("5135");
          var uid = __webpack_require__("90e3");
          var NATIVE_SYMBOL = __webpack_require__("4930");
          var USE_SYMBOL_AS_UID = __webpack_require__("fdbf");
          var WellKnownSymbolsStore = shared("wks");
          var Symbol2 = global2.Symbol;
          var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2 : Symbol2 && Symbol2.withoutSetter || uid;
          module3.exports = function(name2) {
            if (!has(WellKnownSymbolsStore, name2)) {
              if (NATIVE_SYMBOL && has(Symbol2, name2))
                WellKnownSymbolsStore[name2] = Symbol2[name2];
              else
                WellKnownSymbolsStore[name2] = createWellKnownSymbol("Symbol." + name2);
            }
            return WellKnownSymbolsStore[name2];
          };
        },
        "b64b": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var toObject = __webpack_require__("7b0b");
          var nativeKeys = __webpack_require__("df75");
          var fails = __webpack_require__("d039");
          var FAILS_ON_PRIMITIVES = fails(function() {
            nativeKeys(1);
          });
          $({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
            keys: function keys2(it) {
              return nativeKeys(toObject(it));
            }
          });
        },
        "b727": function(module3, exports3, __webpack_require__) {
          var bind2 = __webpack_require__("0366");
          var IndexedObject = __webpack_require__("44ad");
          var toObject = __webpack_require__("7b0b");
          var toLength = __webpack_require__("50c4");
          var arraySpeciesCreate = __webpack_require__("65f0");
          var push = [].push;
          var createMethod = function(TYPE2) {
            var IS_MAP = TYPE2 == 1;
            var IS_FILTER = TYPE2 == 2;
            var IS_SOME = TYPE2 == 3;
            var IS_EVERY = TYPE2 == 4;
            var IS_FIND_INDEX = TYPE2 == 6;
            var NO_HOLES = TYPE2 == 5 || IS_FIND_INDEX;
            return function($this, callbackfn, that, specificCreate) {
              var O = toObject($this);
              var self2 = IndexedObject(O);
              var boundFunction = bind2(callbackfn, that, 3);
              var length = toLength(self2.length);
              var index2 = 0;
              var create = specificCreate || arraySpeciesCreate;
              var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : void 0;
              var value2, result;
              for (; length > index2; index2++)
                if (NO_HOLES || index2 in self2) {
                  value2 = self2[index2];
                  result = boundFunction(value2, index2, O);
                  if (TYPE2) {
                    if (IS_MAP)
                      target[index2] = result;
                    else if (result)
                      switch (TYPE2) {
                        case 3:
                          return true;
                        case 5:
                          return value2;
                        case 6:
                          return index2;
                        case 2:
                          push.call(target, value2);
                      }
                    else if (IS_EVERY)
                      return false;
                  }
                }
              return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
            };
          };
          module3.exports = {
            forEach: createMethod(0),
            map: createMethod(1),
            filter: createMethod(2),
            some: createMethod(3),
            every: createMethod(4),
            find: createMethod(5),
            findIndex: createMethod(6)
          };
        },
        "c04e": function(module3, exports3, __webpack_require__) {
          var isObject2 = __webpack_require__("861d");
          module3.exports = function(input, PREFERRED_STRING) {
            if (!isObject2(input))
              return input;
            var fn, val;
            if (PREFERRED_STRING && typeof (fn = input.toString) == "function" && !isObject2(val = fn.call(input)))
              return val;
            if (typeof (fn = input.valueOf) == "function" && !isObject2(val = fn.call(input)))
              return val;
            if (!PREFERRED_STRING && typeof (fn = input.toString) == "function" && !isObject2(val = fn.call(input)))
              return val;
            throw TypeError("Can't convert object to primitive value");
          };
        },
        "c430": function(module3, exports3) {
          module3.exports = false;
        },
        "c6b6": function(module3, exports3) {
          var toString2 = {}.toString;
          module3.exports = function(it) {
            return toString2.call(it).slice(8, -1);
          };
        },
        "c6cd": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var setGlobal = __webpack_require__("ce4e");
          var SHARED = "__core-js_shared__";
          var store = global2[SHARED] || setGlobal(SHARED, {});
          module3.exports = store;
        },
        "c740": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $findIndex = __webpack_require__("b727").findIndex;
          var addToUnscopables = __webpack_require__("44d2");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var FIND_INDEX = "findIndex";
          var SKIPS_HOLES = true;
          var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
          if (FIND_INDEX in [])
            Array(1)[FIND_INDEX](function() {
              SKIPS_HOLES = false;
            });
          $({ target: "Array", proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
            findIndex: function findIndex(callbackfn) {
              return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
          addToUnscopables(FIND_INDEX);
        },
        "c8ba": function(module3, exports3) {
          var g;
          g = function() {
            return this;
          }();
          try {
            g = g || new Function("return this")();
          } catch (e) {
            if (typeof window === "object")
              g = window;
          }
          module3.exports = g;
        },
        "c975": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $indexOf = __webpack_require__("4d64").indexOf;
          var arrayMethodIsStrict = __webpack_require__("a640");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var nativeIndexOf = [].indexOf;
          var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0;
          var STRICT_METHOD = arrayMethodIsStrict("indexOf");
          var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { ACCESSORS: true, 1: 0 });
          $({ target: "Array", proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
            indexOf: function indexOf(searchElement) {
              return NEGATIVE_ZERO ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
        },
        "ca84": function(module3, exports3, __webpack_require__) {
          var has = __webpack_require__("5135");
          var toIndexedObject = __webpack_require__("fc6a");
          var indexOf = __webpack_require__("4d64").indexOf;
          var hiddenKeys = __webpack_require__("d012");
          module3.exports = function(object, names) {
            var O = toIndexedObject(object);
            var i2 = 0;
            var result = [];
            var key;
            for (key in O)
              !has(hiddenKeys, key) && has(O, key) && result.push(key);
            while (names.length > i2)
              if (has(O, key = names[i2++])) {
                ~indexOf(result, key) || result.push(key);
              }
            return result;
          };
        },
        "caad": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $includes = __webpack_require__("4d64").includes;
          var addToUnscopables = __webpack_require__("44d2");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var USES_TO_LENGTH = arrayMethodUsesToLength("indexOf", { ACCESSORS: true, 1: 0 });
          $({ target: "Array", proto: true, forced: !USES_TO_LENGTH }, {
            includes: function includes(el) {
              return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
          addToUnscopables("includes");
        },
        "cc12": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var isObject2 = __webpack_require__("861d");
          var document2 = global2.document;
          var EXISTS = isObject2(document2) && isObject2(document2.createElement);
          module3.exports = function(it) {
            return EXISTS ? document2.createElement(it) : {};
          };
        },
        "ce4e": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var createNonEnumerableProperty = __webpack_require__("9112");
          module3.exports = function(key, value2) {
            try {
              createNonEnumerableProperty(global2, key, value2);
            } catch (error2) {
              global2[key] = value2;
            }
            return value2;
          };
        },
        "d012": function(module3, exports3) {
          module3.exports = {};
        },
        "d039": function(module3, exports3) {
          module3.exports = function(exec) {
            try {
              return !!exec();
            } catch (error2) {
              return true;
            }
          };
        },
        "d066": function(module3, exports3, __webpack_require__) {
          var path = __webpack_require__("428f");
          var global2 = __webpack_require__("da84");
          var aFunction = function(variable) {
            return typeof variable == "function" ? variable : void 0;
          };
          module3.exports = function(namespace, method) {
            return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global2[namespace]) : path[namespace] && path[namespace][method] || global2[namespace] && global2[namespace][method];
          };
        },
        "d1e7": function(module3, exports3, __webpack_require__) {
          var nativePropertyIsEnumerable = {}.propertyIsEnumerable;
          var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
          var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1);
          exports3.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
            var descriptor = getOwnPropertyDescriptor(this, V);
            return !!descriptor && descriptor.enumerable;
          } : nativePropertyIsEnumerable;
        },
        "d28b": function(module3, exports3, __webpack_require__) {
          var defineWellKnownSymbol = __webpack_require__("746f");
          defineWellKnownSymbol("iterator");
        },
        "d2bb": function(module3, exports3, __webpack_require__) {
          var anObject = __webpack_require__("825a");
          var aPossiblePrototype = __webpack_require__("3bbe");
          module3.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
            var CORRECT_SETTER = false;
            var test = {};
            var setter;
            try {
              setter = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set;
              setter.call(test, []);
              CORRECT_SETTER = test instanceof Array;
            } catch (error2) {
            }
            return function setPrototypeOf(O, proto) {
              anObject(O);
              aPossiblePrototype(proto);
              if (CORRECT_SETTER)
                setter.call(O, proto);
              else
                O.__proto__ = proto;
              return O;
            };
          }() : void 0);
        },
        "d3b7": function(module3, exports3, __webpack_require__) {
          var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
          var redefine = __webpack_require__("6eeb");
          var toString2 = __webpack_require__("b041");
          if (!TO_STRING_TAG_SUPPORT) {
            redefine(Object.prototype, "toString", toString2, { unsafe: true });
          }
        },
        "d44e": function(module3, exports3, __webpack_require__) {
          var defineProperty = __webpack_require__("9bf2").f;
          var has = __webpack_require__("5135");
          var wellKnownSymbol = __webpack_require__("b622");
          var TO_STRING_TAG = wellKnownSymbol("toStringTag");
          module3.exports = function(it, TAG, STATIC) {
            if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
              defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
            }
          };
        },
        "d58f": function(module3, exports3, __webpack_require__) {
          var aFunction = __webpack_require__("1c0b");
          var toObject = __webpack_require__("7b0b");
          var IndexedObject = __webpack_require__("44ad");
          var toLength = __webpack_require__("50c4");
          var createMethod = function(IS_RIGHT) {
            return function(that, callbackfn, argumentsLength, memo) {
              aFunction(callbackfn);
              var O = toObject(that);
              var self2 = IndexedObject(O);
              var length = toLength(O.length);
              var index2 = IS_RIGHT ? length - 1 : 0;
              var i2 = IS_RIGHT ? -1 : 1;
              if (argumentsLength < 2)
                while (true) {
                  if (index2 in self2) {
                    memo = self2[index2];
                    index2 += i2;
                    break;
                  }
                  index2 += i2;
                  if (IS_RIGHT ? index2 < 0 : length <= index2) {
                    throw TypeError("Reduce of empty array with no initial value");
                  }
                }
              for (; IS_RIGHT ? index2 >= 0 : length > index2; index2 += i2)
                if (index2 in self2) {
                  memo = callbackfn(memo, self2[index2], index2, O);
                }
              return memo;
            };
          };
          module3.exports = {
            left: createMethod(false),
            right: createMethod(true)
          };
        },
        "d784": function(module3, exports3, __webpack_require__) {
          __webpack_require__("ac1f");
          var redefine = __webpack_require__("6eeb");
          var fails = __webpack_require__("d039");
          var wellKnownSymbol = __webpack_require__("b622");
          var regexpExec = __webpack_require__("9263");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var SPECIES = wellKnownSymbol("species");
          var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
            var re = /./;
            re.exec = function() {
              var result = [];
              result.groups = { a: "7" };
              return result;
            };
            return "".replace(re, "$<a>") !== "7";
          });
          var REPLACE_KEEPS_$0 = function() {
            return "a".replace(/./, "$0") === "$0";
          }();
          var REPLACE2 = wellKnownSymbol("replace");
          var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
            if (/./[REPLACE2]) {
              return /./[REPLACE2]("a", "$0") === "";
            }
            return false;
          }();
          var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function() {
            var re = /(?:)/;
            var originalExec = re.exec;
            re.exec = function() {
              return originalExec.apply(this, arguments);
            };
            var result = "ab".split(re);
            return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
          });
          module3.exports = function(KEY, length, exec, sham) {
            var SYMBOL = wellKnownSymbol(KEY);
            var DELEGATES_TO_SYMBOL = !fails(function() {
              var O = {};
              O[SYMBOL] = function() {
                return 7;
              };
              return ""[KEY](O) != 7;
            });
            var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() {
              var execCalled = false;
              var re = /a/;
              if (KEY === "split") {
                re = {};
                re.constructor = {};
                re.constructor[SPECIES] = function() {
                  return re;
                };
                re.flags = "";
                re[SYMBOL] = /./[SYMBOL];
              }
              re.exec = function() {
                execCalled = true;
                return null;
              };
              re[SYMBOL]("");
              return !execCalled;
            });
            if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || KEY === "replace" && !(REPLACE_SUPPORTS_NAMED_GROUPS && REPLACE_KEEPS_$0 && !REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE) || KEY === "split" && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) {
              var nativeRegExpMethod = /./[SYMBOL];
              var methods = exec(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
                if (regexp.exec === regexpExec) {
                  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
                    return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
                  }
                  return { done: true, value: nativeMethod.call(str, regexp, arg2) };
                }
                return { done: false };
              }, {
                REPLACE_KEEPS_$0,
                REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE
              });
              var stringMethod = methods[0];
              var regexMethod = methods[1];
              redefine(String.prototype, KEY, stringMethod);
              redefine(RegExp.prototype, SYMBOL, length == 2 ? function(string2, arg) {
                return regexMethod.call(string2, this, arg);
              } : function(string2) {
                return regexMethod.call(string2, this);
              });
            }
            if (sham)
              createNonEnumerableProperty(RegExp.prototype[SYMBOL], "sham", true);
          };
        },
        "d81d": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var $map = __webpack_require__("b727").map;
          var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map");
          var USES_TO_LENGTH = arrayMethodUsesToLength("map");
          $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
            map: function map(callbackfn) {
              return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
            }
          });
        },
        "da84": function(module3, exports3, __webpack_require__) {
          (function(global2) {
            var check = function(it) {
              return it && it.Math == Math && it;
            };
            module3.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global2 == "object" && global2) || Function("return this")();
          }).call(this, __webpack_require__("c8ba"));
        },
        "dbb4": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var DESCRIPTORS = __webpack_require__("83ab");
          var ownKeys2 = __webpack_require__("56ef");
          var toIndexedObject = __webpack_require__("fc6a");
          var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
          var createProperty = __webpack_require__("8418");
          $({ target: "Object", stat: true, sham: !DESCRIPTORS }, {
            getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
              var O = toIndexedObject(object);
              var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
              var keys2 = ownKeys2(O);
              var result = {};
              var index2 = 0;
              var key, descriptor;
              while (keys2.length > index2) {
                descriptor = getOwnPropertyDescriptor(O, key = keys2[index2++]);
                if (descriptor !== void 0)
                  createProperty(result, key, descriptor);
              }
              return result;
            }
          });
        },
        "dbf1": function(module3, __webpack_exports__, __webpack_require__) {
          (function(global2) {
            __webpack_require__.d(__webpack_exports__, "a", function() {
              return console2;
            });
            function getConsole() {
              if (typeof window !== "undefined") {
                return window.console;
              }
              return global2.console;
            }
            var console2 = getConsole();
          }).call(this, __webpack_require__("c8ba"));
        },
        "ddb0": function(module3, exports3, __webpack_require__) {
          var global2 = __webpack_require__("da84");
          var DOMIterables = __webpack_require__("fdbc");
          var ArrayIteratorMethods = __webpack_require__("e260");
          var createNonEnumerableProperty = __webpack_require__("9112");
          var wellKnownSymbol = __webpack_require__("b622");
          var ITERATOR = wellKnownSymbol("iterator");
          var TO_STRING_TAG = wellKnownSymbol("toStringTag");
          var ArrayValues = ArrayIteratorMethods.values;
          for (var COLLECTION_NAME in DOMIterables) {
            var Collection = global2[COLLECTION_NAME];
            var CollectionPrototype = Collection && Collection.prototype;
            if (CollectionPrototype) {
              if (CollectionPrototype[ITERATOR] !== ArrayValues)
                try {
                  createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
                } catch (error2) {
                  CollectionPrototype[ITERATOR] = ArrayValues;
                }
              if (!CollectionPrototype[TO_STRING_TAG]) {
                createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
              }
              if (DOMIterables[COLLECTION_NAME])
                for (var METHOD_NAME in ArrayIteratorMethods) {
                  if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
                    try {
                      createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
                    } catch (error2) {
                      CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
                    }
                }
            }
          }
        },
        "df75": function(module3, exports3, __webpack_require__) {
          var internalObjectKeys = __webpack_require__("ca84");
          var enumBugKeys = __webpack_require__("7839");
          module3.exports = Object.keys || function keys2(O) {
            return internalObjectKeys(O, enumBugKeys);
          };
        },
        "e01a": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var DESCRIPTORS = __webpack_require__("83ab");
          var global2 = __webpack_require__("da84");
          var has = __webpack_require__("5135");
          var isObject2 = __webpack_require__("861d");
          var defineProperty = __webpack_require__("9bf2").f;
          var copyConstructorProperties = __webpack_require__("e893");
          var NativeSymbol = global2.Symbol;
          if (DESCRIPTORS && typeof NativeSymbol == "function" && (!("description" in NativeSymbol.prototype) || NativeSymbol().description !== void 0)) {
            var EmptyStringDescriptionStore = {};
            var SymbolWrapper = function Symbol2() {
              var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : String(arguments[0]);
              var result = this instanceof SymbolWrapper ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
              if (description === "")
                EmptyStringDescriptionStore[result] = true;
              return result;
            };
            copyConstructorProperties(SymbolWrapper, NativeSymbol);
            var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype;
            symbolPrototype.constructor = SymbolWrapper;
            var symbolToString = symbolPrototype.toString;
            var native = String(NativeSymbol("test")) == "Symbol(test)";
            var regexp = /^Symbol\((.*)\)[^)]+$/;
            defineProperty(symbolPrototype, "description", {
              configurable: true,
              get: function description() {
                var symbol = isObject2(this) ? this.valueOf() : this;
                var string2 = symbolToString.call(symbol);
                if (has(EmptyStringDescriptionStore, symbol))
                  return "";
                var desc = native ? string2.slice(7, -1) : string2.replace(regexp, "$1");
                return desc === "" ? void 0 : desc;
              }
            });
            $({ global: true, forced: true }, {
              Symbol: SymbolWrapper
            });
          }
        },
        "e163": function(module3, exports3, __webpack_require__) {
          var has = __webpack_require__("5135");
          var toObject = __webpack_require__("7b0b");
          var sharedKey = __webpack_require__("f772");
          var CORRECT_PROTOTYPE_GETTER = __webpack_require__("e177");
          var IE_PROTO = sharedKey("IE_PROTO");
          var ObjectPrototype = Object.prototype;
          module3.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function(O) {
            O = toObject(O);
            if (has(O, IE_PROTO))
              return O[IE_PROTO];
            if (typeof O.constructor == "function" && O instanceof O.constructor) {
              return O.constructor.prototype;
            }
            return O instanceof Object ? ObjectPrototype : null;
          };
        },
        "e177": function(module3, exports3, __webpack_require__) {
          var fails = __webpack_require__("d039");
          module3.exports = !fails(function() {
            function F2() {
            }
            F2.prototype.constructor = null;
            return Object.getPrototypeOf(new F2()) !== F2.prototype;
          });
        },
        "e260": function(module3, exports3, __webpack_require__) {
          var toIndexedObject = __webpack_require__("fc6a");
          var addToUnscopables = __webpack_require__("44d2");
          var Iterators = __webpack_require__("3f8c");
          var InternalStateModule = __webpack_require__("69f3");
          var defineIterator = __webpack_require__("7dd0");
          var ARRAY_ITERATOR = "Array Iterator";
          var setInternalState = InternalStateModule.set;
          var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
          module3.exports = defineIterator(Array, "Array", function(iterated, kind) {
            setInternalState(this, {
              type: ARRAY_ITERATOR,
              target: toIndexedObject(iterated),
              index: 0,
              kind
            });
          }, function() {
            var state = getInternalState(this);
            var target = state.target;
            var kind = state.kind;
            var index2 = state.index++;
            if (!target || index2 >= target.length) {
              state.target = void 0;
              return { value: void 0, done: true };
            }
            if (kind == "keys")
              return { value: index2, done: false };
            if (kind == "values")
              return { value: target[index2], done: false };
            return { value: [index2, target[index2]], done: false };
          }, "values");
          Iterators.Arguments = Iterators.Array;
          addToUnscopables("keys");
          addToUnscopables("values");
          addToUnscopables("entries");
        },
        "e439": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var fails = __webpack_require__("d039");
          var toIndexedObject = __webpack_require__("fc6a");
          var nativeGetOwnPropertyDescriptor = __webpack_require__("06cf").f;
          var DESCRIPTORS = __webpack_require__("83ab");
          var FAILS_ON_PRIMITIVES = fails(function() {
            nativeGetOwnPropertyDescriptor(1);
          });
          var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES;
          $({ target: "Object", stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
            getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
              return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key);
            }
          });
        },
        "e538": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          exports3.f = wellKnownSymbol;
        },
        "e893": function(module3, exports3, __webpack_require__) {
          var has = __webpack_require__("5135");
          var ownKeys2 = __webpack_require__("56ef");
          var getOwnPropertyDescriptorModule = __webpack_require__("06cf");
          var definePropertyModule = __webpack_require__("9bf2");
          module3.exports = function(target, source) {
            var keys2 = ownKeys2(source);
            var defineProperty = definePropertyModule.f;
            var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
            for (var i2 = 0; i2 < keys2.length; i2++) {
              var key = keys2[i2];
              if (!has(target, key))
                defineProperty(target, key, getOwnPropertyDescriptor(source, key));
            }
          };
        },
        "e8b5": function(module3, exports3, __webpack_require__) {
          var classof = __webpack_require__("c6b6");
          module3.exports = Array.isArray || function isArray2(arg) {
            return classof(arg) == "Array";
          };
        },
        "e95a": function(module3, exports3, __webpack_require__) {
          var wellKnownSymbol = __webpack_require__("b622");
          var Iterators = __webpack_require__("3f8c");
          var ITERATOR = wellKnownSymbol("iterator");
          var ArrayPrototype = Array.prototype;
          module3.exports = function(it) {
            return it !== void 0 && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
          };
        },
        "f5df": function(module3, exports3, __webpack_require__) {
          var TO_STRING_TAG_SUPPORT = __webpack_require__("00ee");
          var classofRaw = __webpack_require__("c6b6");
          var wellKnownSymbol = __webpack_require__("b622");
          var TO_STRING_TAG = wellKnownSymbol("toStringTag");
          var CORRECT_ARGUMENTS = classofRaw(function() {
            return arguments;
          }()) == "Arguments";
          var tryGet = function(it, key) {
            try {
              return it[key];
            } catch (error2) {
            }
          };
          module3.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
            var O, tag, result;
            return it === void 0 ? "Undefined" : it === null ? "Null" : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : (result = classofRaw(O)) == "Object" && typeof O.callee == "function" ? "Arguments" : result;
          };
        },
        "f772": function(module3, exports3, __webpack_require__) {
          var shared = __webpack_require__("5692");
          var uid = __webpack_require__("90e3");
          var keys2 = shared("keys");
          module3.exports = function(key) {
            return keys2[key] || (keys2[key] = uid(key));
          };
        },
        "fb15": function(module3, __webpack_exports__, __webpack_require__) {
          __webpack_require__.r(__webpack_exports__);
          if (typeof window !== "undefined") {
            var currentScript = window.document.currentScript;
            {
              var getCurrentScript = __webpack_require__("8875");
              currentScript = getCurrentScript();
              if (!("currentScript" in document)) {
                Object.defineProperty(document, "currentScript", { get: getCurrentScript });
              }
            }
            var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);
            if (src) {
              __webpack_require__.p = src[1];
            }
          }
          __webpack_require__("99af");
          __webpack_require__("4de4");
          __webpack_require__("4160");
          __webpack_require__("c975");
          __webpack_require__("d81d");
          __webpack_require__("a434");
          __webpack_require__("159b");
          __webpack_require__("a4d3");
          __webpack_require__("e439");
          __webpack_require__("dbb4");
          __webpack_require__("b64b");
          function _defineProperty2(obj, key, value2) {
            if (key in obj) {
              Object.defineProperty(obj, key, {
                value: value2,
                enumerable: true,
                configurable: true,
                writable: true
              });
            } else {
              obj[key] = value2;
            }
            return obj;
          }
          function ownKeys2(object, enumerableOnly) {
            var keys2 = Object.keys(object);
            if (Object.getOwnPropertySymbols) {
              var symbols2 = Object.getOwnPropertySymbols(object);
              if (enumerableOnly)
                symbols2 = symbols2.filter(function(sym) {
                  return Object.getOwnPropertyDescriptor(object, sym).enumerable;
                });
              keys2.push.apply(keys2, symbols2);
            }
            return keys2;
          }
          function _objectSpread22(target) {
            for (var i2 = 1; i2 < arguments.length; i2++) {
              var source = arguments[i2] != null ? arguments[i2] : {};
              if (i2 % 2) {
                ownKeys2(Object(source), true).forEach(function(key) {
                  _defineProperty2(target, key, source[key]);
                });
              } else if (Object.getOwnPropertyDescriptors) {
                Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
              } else {
                ownKeys2(Object(source)).forEach(function(key) {
                  Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
                });
              }
            }
            return target;
          }
          function _arrayWithHoles(arr) {
            if (Array.isArray(arr))
              return arr;
          }
          __webpack_require__("e01a");
          __webpack_require__("d28b");
          __webpack_require__("e260");
          __webpack_require__("d3b7");
          __webpack_require__("3ca3");
          __webpack_require__("ddb0");
          function _iterableToArrayLimit(arr, i2) {
            if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr)))
              return;
            var _arr = [];
            var _n = true;
            var _d = false;
            var _e = void 0;
            try {
              for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                _arr.push(_s.value);
                if (i2 && _arr.length === i2)
                  break;
              }
            } catch (err) {
              _d = true;
              _e = err;
            } finally {
              try {
                if (!_n && _i["return"] != null)
                  _i["return"]();
              } finally {
                if (_d)
                  throw _e;
              }
            }
            return _arr;
          }
          __webpack_require__("a630");
          __webpack_require__("fb6a");
          __webpack_require__("b0c0");
          __webpack_require__("25f0");
          function _arrayLikeToArray(arr, len) {
            if (len == null || len > arr.length)
              len = arr.length;
            for (var i2 = 0, arr2 = new Array(len); i2 < len; i2++) {
              arr2[i2] = arr[i2];
            }
            return arr2;
          }
          function _unsupportedIterableToArray(o, minLen) {
            if (!o)
              return;
            if (typeof o === "string")
              return _arrayLikeToArray(o, minLen);
            var n = Object.prototype.toString.call(o).slice(8, -1);
            if (n === "Object" && o.constructor)
              n = o.constructor.name;
            if (n === "Map" || n === "Set")
              return Array.from(o);
            if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
              return _arrayLikeToArray(o, minLen);
          }
          function _nonIterableRest() {
            throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }
          function _slicedToArray(arr, i2) {
            return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i2) || _unsupportedIterableToArray(arr, i2) || _nonIterableRest();
          }
          function _arrayWithoutHoles(arr) {
            if (Array.isArray(arr))
              return _arrayLikeToArray(arr);
          }
          function _iterableToArray(iter) {
            if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter))
              return Array.from(iter);
          }
          function _nonIterableSpread() {
            throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
          }
          function _toConsumableArray(arr) {
            return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
          }
          var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_ = __webpack_require__("a352");
          var external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default = /* @__PURE__ */ __webpack_require__.n(external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_);
          function removeNode(node) {
            if (node.parentElement !== null) {
              node.parentElement.removeChild(node);
            }
          }
          function insertNodeAt(fatherNode, node, position) {
            var refNode = position === 0 ? fatherNode.children[0] : fatherNode.children[position - 1].nextSibling;
            fatherNode.insertBefore(node, refNode);
          }
          var util_console = __webpack_require__("dbf1");
          __webpack_require__("13d5");
          __webpack_require__("4fad");
          __webpack_require__("ac1f");
          __webpack_require__("5319");
          function cached(fn) {
            var cache2 = Object.create(null);
            return function cachedFn(str) {
              var hit = cache2[str];
              return hit || (cache2[str] = fn(str));
            };
          }
          var regex = /-(\w)/g;
          var camelize = cached(function(str) {
            return str.replace(regex, function(_, c) {
              return c.toUpperCase();
            });
          });
          __webpack_require__("5db7");
          __webpack_require__("73d9");
          var manageAndEmit = ["Start", "Add", "Remove", "Update", "End"];
          var emit = ["Choose", "Unchoose", "Sort", "Filter", "Clone"];
          var manage = ["Move"];
          var eventHandlerNames = [manage, manageAndEmit, emit].flatMap(function(events2) {
            return events2;
          }).map(function(evt) {
            return "on".concat(evt);
          });
          var events = {
            manage,
            manageAndEmit,
            emit
          };
          function isReadOnly(eventName) {
            return eventHandlerNames.indexOf(eventName) !== -1;
          }
          __webpack_require__("caad");
          __webpack_require__("2ca0");
          var tags2 = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
          function isHtmlTag(name2) {
            return tags2.includes(name2);
          }
          function isTransition(name2) {
            return ["transition-group", "TransitionGroup"].includes(name2);
          }
          function isHtmlAttribute(value2) {
            return ["id", "class", "role", "style"].includes(value2) || value2.startsWith("data-") || value2.startsWith("aria-") || value2.startsWith("on");
          }
          function project(entries) {
            return entries.reduce(function(res, _ref) {
              var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value2 = _ref2[1];
              res[key] = value2;
              return res;
            }, {});
          }
          function getComponentAttributes(_ref3) {
            var $attrs = _ref3.$attrs, _ref3$componentData = _ref3.componentData, componentData = _ref3$componentData === void 0 ? {} : _ref3$componentData;
            var attributes = project(Object.entries($attrs).filter(function(_ref4) {
              var _ref5 = _slicedToArray(_ref4, 2), key = _ref5[0];
              _ref5[1];
              return isHtmlAttribute(key);
            }));
            return _objectSpread22(_objectSpread22({}, attributes), componentData);
          }
          function createSortableOption(_ref6) {
            var $attrs = _ref6.$attrs, callBackBuilder = _ref6.callBackBuilder;
            var options = project(getValidSortableEntries($attrs));
            Object.entries(callBackBuilder).forEach(function(_ref7) {
              var _ref8 = _slicedToArray(_ref7, 2), eventType = _ref8[0], eventBuilder = _ref8[1];
              events[eventType].forEach(function(event) {
                options["on".concat(event)] = eventBuilder(event);
              });
            });
            var draggable = "[data-draggable]".concat(options.draggable || "");
            return _objectSpread22(_objectSpread22({}, options), {}, {
              draggable
            });
          }
          function getValidSortableEntries(value2) {
            return Object.entries(value2).filter(function(_ref9) {
              var _ref10 = _slicedToArray(_ref9, 2), key = _ref10[0];
              _ref10[1];
              return !isHtmlAttribute(key);
            }).map(function(_ref11) {
              var _ref12 = _slicedToArray(_ref11, 2), key = _ref12[0], value3 = _ref12[1];
              return [camelize(key), value3];
            }).filter(function(_ref13) {
              var _ref14 = _slicedToArray(_ref13, 2), key = _ref14[0];
              _ref14[1];
              return !isReadOnly(key);
            });
          }
          __webpack_require__("c740");
          function _classCallCheck(instance2, Constructor) {
            if (!(instance2 instanceof Constructor)) {
              throw new TypeError("Cannot call a class as a function");
            }
          }
          function _defineProperties(target, props2) {
            for (var i2 = 0; i2 < props2.length; i2++) {
              var descriptor = props2[i2];
              descriptor.enumerable = descriptor.enumerable || false;
              descriptor.configurable = true;
              if ("value" in descriptor)
                descriptor.writable = true;
              Object.defineProperty(target, descriptor.key, descriptor);
            }
          }
          function _createClass(Constructor, protoProps, staticProps) {
            if (protoProps)
              _defineProperties(Constructor.prototype, protoProps);
            if (staticProps)
              _defineProperties(Constructor, staticProps);
            return Constructor;
          }
          var getHtmlElementFromNode = function getHtmlElementFromNode2(node) {
            var el = node.el || Array.isArray(node.children) && node.children[0].el.parentNode;
            if (!el) {
              console.error("\u4F7F\u7528 transition-group , \u9700\u8981\u5728slot\u4E2Dtemplate\u5185\u81F3\u5C112\u5C42html\u6807\u7B7E");
            }
            return el || {};
          };
          var addContext = function addContext2(domElement, context) {
            return domElement.__draggable_context = context;
          };
          var getContext = function getContext2(domElement) {
            return domElement.__draggable_context;
          };
          var componentStructure_ComponentStructure = /* @__PURE__ */ function() {
            function ComponentStructure(_ref) {
              var _ref$nodes = _ref.nodes, header = _ref$nodes.header, defaultNodes = _ref$nodes.default, footer = _ref$nodes.footer, root = _ref.root, realList = _ref.realList;
              _classCallCheck(this, ComponentStructure);
              this.defaultNodes = defaultNodes;
              this.children = [].concat(_toConsumableArray(header), _toConsumableArray(defaultNodes), _toConsumableArray(footer));
              this.externalComponent = root.externalComponent;
              this.rootTransition = root.transition;
              this.tag = root.tag;
              this.realList = realList;
            }
            _createClass(ComponentStructure, [{
              key: "render",
              value: function render(h, attributes) {
                var tag = this.tag, children = this.children, _isRootComponent = this._isRootComponent;
                var option = !_isRootComponent ? children : {
                  default: function _default() {
                    return children;
                  }
                };
                return h(tag, attributes, option);
              }
            }, {
              key: "updated",
              value: function updated() {
                var defaultNodes = this.defaultNodes, realList = this.realList;
                defaultNodes.forEach(function(node, index2) {
                  addContext(getHtmlElementFromNode(node), {
                    element: realList[index2],
                    index: index2
                  });
                });
              }
            }, {
              key: "getUnderlyingVm",
              value: function getUnderlyingVm(domElement) {
                return getContext(domElement);
              }
            }, {
              key: "getVmIndexFromDomIndex",
              value: function getVmIndexFromDomIndex(domIndex2, element) {
                var defaultNodes = this.defaultNodes;
                var length = defaultNodes.length;
                var domChildren = element.children;
                var domElement = domChildren.item(domIndex2);
                if (domElement === null) {
                  return length;
                }
                var context = getContext(domElement);
                if (context) {
                  return context.index;
                }
                if (length === 0) {
                  return 0;
                }
                var firstDomListElement = getHtmlElementFromNode(defaultNodes[0]);
                var indexFirstDomListElement = _toConsumableArray(domChildren).findIndex(function(element2) {
                  return element2 === firstDomListElement;
                });
                return domIndex2 < indexFirstDomListElement ? 0 : length;
              }
            }, {
              key: "_isRootComponent",
              get: function get2() {
                return this.externalComponent || this.rootTransition;
              }
            }]);
            return ComponentStructure;
          }();
          var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf");
          function getSlot(slots, key) {
            var slotValue = slots[key];
            return slotValue ? slotValue() : [];
          }
          function computeNodes(_ref) {
            var $slots = _ref.$slots, realList = _ref.realList, getKey = _ref.getKey;
            var normalizedList = realList || [];
            var _map = ["header", "footer"].map(function(name2) {
              return getSlot($slots, name2);
            }), _map2 = _slicedToArray(_map, 2), header = _map2[0], footer = _map2[1];
            var item = $slots.item;
            if (!item) {
              throw new Error("draggable element must have an item slot");
            }
            var defaultNodes = normalizedList.flatMap(function(element, index2) {
              return item({
                element,
                index: index2
              }).map(function(node) {
                node.key = getKey(element);
                node.props = _objectSpread22(_objectSpread22({}, node.props || {}), {}, {
                  "data-draggable": true
                });
                return node;
              });
            });
            if (defaultNodes.length !== normalizedList.length) {
              throw new Error("Item slot must have only one child");
            }
            return {
              header,
              footer,
              default: defaultNodes
            };
          }
          function getRootInformation(tag) {
            var transition = isTransition(tag);
            var externalComponent = !isHtmlTag(tag) && !transition;
            return {
              transition,
              externalComponent,
              tag: externalComponent ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])(tag) : transition ? external_commonjs_vue_commonjs2_vue_root_Vue_["TransitionGroup"] : tag
            };
          }
          function computeComponentStructure(_ref2) {
            var $slots = _ref2.$slots, tag = _ref2.tag, realList = _ref2.realList, getKey = _ref2.getKey;
            var nodes = computeNodes({
              $slots,
              realList,
              getKey
            });
            var root = getRootInformation(tag);
            return new componentStructure_ComponentStructure({
              nodes,
              root,
              realList
            });
          }
          function _emit(evtName, evtData) {
            var _this = this;
            Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function() {
              return _this.$emit(evtName.toLowerCase(), evtData);
            });
          }
          function _manage(evtName) {
            var _this2 = this;
            return function(evtData, originalElement) {
              if (_this2.realList !== null) {
                return _this2["onDrag".concat(evtName)](evtData, originalElement);
              }
            };
          }
          function _manageAndEmit(evtName) {
            var _this3 = this;
            var delegateCallBack = _manage.call(this, evtName);
            return function(evtData, originalElement) {
              delegateCallBack.call(_this3, evtData, originalElement);
              _emit.call(_this3, evtName, evtData);
            };
          }
          var draggingElement = null;
          var props = {
            list: {
              type: Array,
              required: false,
              default: null
            },
            modelValue: {
              type: Array,
              required: false,
              default: null
            },
            itemKey: {
              type: [String, Function],
              required: true
            },
            clone: {
              type: Function,
              default: function _default(original) {
                return original;
              }
            },
            tag: {
              type: String,
              default: "div"
            },
            move: {
              type: Function,
              default: null
            },
            componentData: {
              type: Object,
              required: false,
              default: null
            }
          };
          var emits = ["update:modelValue", "change"].concat(_toConsumableArray([].concat(_toConsumableArray(events.manageAndEmit), _toConsumableArray(events.emit)).map(function(evt) {
            return evt.toLowerCase();
          })));
          var draggableComponent = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({
            name: "draggable",
            inheritAttrs: false,
            props,
            emits,
            data: function data2() {
              return {
                error: false
              };
            },
            render: function render() {
              try {
                this.error = false;
                var $slots = this.$slots, $attrs = this.$attrs, tag = this.tag, componentData = this.componentData, realList = this.realList, getKey = this.getKey;
                var componentStructure = computeComponentStructure({
                  $slots,
                  tag,
                  realList,
                  getKey
                });
                this.componentStructure = componentStructure;
                var attributes = getComponentAttributes({
                  $attrs,
                  componentData
                });
                return componentStructure.render(external_commonjs_vue_commonjs2_vue_root_Vue_["h"], attributes);
              } catch (err) {
                this.error = true;
                return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["h"])("pre", {
                  style: {
                    color: "red"
                  }
                }, err.stack);
              }
            },
            created: function created() {
              if (this.list !== null && this.modelValue !== null) {
                util_console["a"].error("modelValue and list props are mutually exclusive! Please set one or another.");
              }
            },
            mounted: function mounted() {
              var _this4 = this;
              if (this.error) {
                return;
              }
              var $attrs = this.$attrs, $el = this.$el, componentStructure = this.componentStructure;
              componentStructure.updated();
              var sortableOptions = createSortableOption({
                $attrs,
                callBackBuilder: {
                  manageAndEmit: function manageAndEmit2(event) {
                    return _manageAndEmit.call(_this4, event);
                  },
                  emit: function emit2(event) {
                    return _emit.bind(_this4, event);
                  },
                  manage: function manage2(event) {
                    return _manage.call(_this4, event);
                  }
                }
              });
              var targetDomElement = $el.nodeType === 1 ? $el : $el.parentElement;
              this._sortable = new external_commonjs_sortablejs_commonjs2_sortablejs_amd_sortablejs_root_Sortable_default.a(targetDomElement, sortableOptions);
              this.targetDomElement = targetDomElement;
              targetDomElement.__draggable_component__ = this;
            },
            updated: function updated() {
              this.componentStructure.updated();
            },
            beforeUnmount: function beforeUnmount() {
              if (this._sortable !== void 0)
                this._sortable.destroy();
            },
            computed: {
              realList: function realList() {
                var list = this.list;
                return list ? list : this.modelValue;
              },
              getKey: function getKey() {
                var itemKey = this.itemKey;
                if (typeof itemKey === "function") {
                  return itemKey;
                }
                return function(element) {
                  return element[itemKey];
                };
              }
            },
            watch: {
              $attrs: {
                handler: function handler(newOptionValue) {
                  var _sortable = this._sortable;
                  if (!_sortable)
                    return;
                  getValidSortableEntries(newOptionValue).forEach(function(_ref) {
                    var _ref2 = _slicedToArray(_ref, 2), key = _ref2[0], value2 = _ref2[1];
                    _sortable.option(key, value2);
                  });
                },
                deep: true
              }
            },
            methods: {
              getUnderlyingVm: function getUnderlyingVm(domElement) {
                return this.componentStructure.getUnderlyingVm(domElement) || null;
              },
              getUnderlyingPotencialDraggableComponent: function getUnderlyingPotencialDraggableComponent(htmElement) {
                return htmElement.__draggable_component__;
              },
              emitChanges: function emitChanges(evt) {
                var _this5 = this;
                Object(external_commonjs_vue_commonjs2_vue_root_Vue_["nextTick"])(function() {
                  return _this5.$emit("change", evt);
                });
              },
              alterList: function alterList(onList) {
                if (this.list) {
                  onList(this.list);
                  return;
                }
                var newList = _toConsumableArray(this.modelValue);
                onList(newList);
                this.$emit("update:modelValue", newList);
              },
              spliceList: function spliceList() {
                var _arguments = arguments;
                var spliceList2 = function spliceList3(list) {
                  return list.splice.apply(list, _toConsumableArray(_arguments));
                };
                this.alterList(spliceList2);
              },
              updatePosition: function updatePosition(oldIndex2, newIndex2) {
                var updatePosition2 = function updatePosition3(list) {
                  return list.splice(newIndex2, 0, list.splice(oldIndex2, 1)[0]);
                };
                this.alterList(updatePosition2);
              },
              getRelatedContextFromMoveEvent: function getRelatedContextFromMoveEvent(_ref3) {
                var to = _ref3.to, related = _ref3.related;
                var component = this.getUnderlyingPotencialDraggableComponent(to);
                if (!component) {
                  return {
                    component
                  };
                }
                var list = component.realList;
                var context = {
                  list,
                  component
                };
                if (to !== related && list) {
                  var destination = component.getUnderlyingVm(related) || {};
                  return _objectSpread22(_objectSpread22({}, destination), context);
                }
                return context;
              },
              getVmIndexFromDomIndex: function getVmIndexFromDomIndex(domIndex2) {
                return this.componentStructure.getVmIndexFromDomIndex(domIndex2, this.targetDomElement);
              },
              onDragStart: function onDragStart(evt) {
                this.context = this.getUnderlyingVm(evt.item);
                evt.item._underlying_vm_ = this.clone(this.context.element);
                draggingElement = evt.item;
              },
              onDragAdd: function onDragAdd(evt) {
                var element = evt.item._underlying_vm_;
                if (element === void 0) {
                  return;
                }
                removeNode(evt.item);
                var newIndex2 = this.getVmIndexFromDomIndex(evt.newIndex);
                this.spliceList(newIndex2, 0, element);
                var added = {
                  element,
                  newIndex: newIndex2
                };
                this.emitChanges({
                  added
                });
              },
              onDragRemove: function onDragRemove(evt) {
                insertNodeAt(evt.from, evt.item, evt.oldIndex);
                if (evt.pullMode === "clone") {
                  removeNode(evt.clone);
                  return;
                }
                var _this$context = this.context, oldIndex2 = _this$context.index, element = _this$context.element;
                this.spliceList(oldIndex2, 1);
                var removed = {
                  element,
                  oldIndex: oldIndex2
                };
                this.emitChanges({
                  removed
                });
              },
              onDragUpdate: function onDragUpdate(evt) {
                removeNode(evt.item);
                insertNodeAt(evt.from, evt.item, evt.oldIndex);
                var oldIndex2 = this.context.index;
                var newIndex2 = this.getVmIndexFromDomIndex(evt.newIndex);
                this.updatePosition(oldIndex2, newIndex2);
                var moved2 = {
                  element: this.context.element,
                  oldIndex: oldIndex2,
                  newIndex: newIndex2
                };
                this.emitChanges({
                  moved: moved2
                });
              },
              computeFutureIndex: function computeFutureIndex(relatedContext, evt) {
                if (!relatedContext.element) {
                  return 0;
                }
                var domChildren = _toConsumableArray(evt.to.children).filter(function(el) {
                  return el.style["display"] !== "none";
                });
                var currentDomIndex = domChildren.indexOf(evt.related);
                var currentIndex = relatedContext.component.getVmIndexFromDomIndex(currentDomIndex);
                var draggedInList = domChildren.indexOf(draggingElement) !== -1;
                return draggedInList || !evt.willInsertAfter ? currentIndex : currentIndex + 1;
              },
              onDragMove: function onDragMove(evt, originalEvent) {
                var move = this.move, realList = this.realList;
                if (!move || !realList) {
                  return true;
                }
                var relatedContext = this.getRelatedContextFromMoveEvent(evt);
                var futureIndex = this.computeFutureIndex(relatedContext, evt);
                var draggedContext = _objectSpread22(_objectSpread22({}, this.context), {}, {
                  futureIndex
                });
                var sendEvent = _objectSpread22(_objectSpread22({}, evt), {}, {
                  relatedContext,
                  draggedContext
                });
                return move(sendEvent, originalEvent);
              },
              onDragEnd: function onDragEnd() {
                draggingElement = null;
              }
            }
          });
          var vuedraggable = draggableComponent;
          __webpack_exports__["default"] = vuedraggable;
        },
        "fb6a": function(module3, exports3, __webpack_require__) {
          var $ = __webpack_require__("23e7");
          var isObject2 = __webpack_require__("861d");
          var isArray2 = __webpack_require__("e8b5");
          var toAbsoluteIndex = __webpack_require__("23cb");
          var toLength = __webpack_require__("50c4");
          var toIndexedObject = __webpack_require__("fc6a");
          var createProperty = __webpack_require__("8418");
          var wellKnownSymbol = __webpack_require__("b622");
          var arrayMethodHasSpeciesSupport = __webpack_require__("1dde");
          var arrayMethodUsesToLength = __webpack_require__("ae40");
          var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
          var USES_TO_LENGTH = arrayMethodUsesToLength("slice", { ACCESSORS: true, 0: 0, 1: 2 });
          var SPECIES = wellKnownSymbol("species");
          var nativeSlice = [].slice;
          var max = Math.max;
          $({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
            slice: function slice(start, end) {
              var O = toIndexedObject(this);
              var length = toLength(O.length);
              var k = toAbsoluteIndex(start, length);
              var fin = toAbsoluteIndex(end === void 0 ? length : end, length);
              var Constructor, result, n;
              if (isArray2(O)) {
                Constructor = O.constructor;
                if (typeof Constructor == "function" && (Constructor === Array || isArray2(Constructor.prototype))) {
                  Constructor = void 0;
                } else if (isObject2(Constructor)) {
                  Constructor = Constructor[SPECIES];
                  if (Constructor === null)
                    Constructor = void 0;
                }
                if (Constructor === Array || Constructor === void 0) {
                  return nativeSlice.call(O, k, fin);
                }
              }
              result = new (Constructor === void 0 ? Array : Constructor)(max(fin - k, 0));
              for (n = 0; k < fin; k++, n++)
                if (k in O)
                  createProperty(result, n, O[k]);
              result.length = n;
              return result;
            }
          });
        },
        "fc6a": function(module3, exports3, __webpack_require__) {
          var IndexedObject = __webpack_require__("44ad");
          var requireObjectCoercible = __webpack_require__("1d80");
          module3.exports = function(it) {
            return IndexedObject(requireObjectCoercible(it));
          };
        },
        "fdbc": function(module3, exports3) {
          module3.exports = {
            CSSRuleList: 0,
            CSSStyleDeclaration: 0,
            CSSValueList: 0,
            ClientRectList: 0,
            DOMRectList: 0,
            DOMStringList: 0,
            DOMTokenList: 1,
            DataTransferItemList: 0,
            FileList: 0,
            HTMLAllCollection: 0,
            HTMLCollection: 0,
            HTMLFormElement: 0,
            HTMLSelectElement: 0,
            MediaList: 0,
            MimeTypeArray: 0,
            NamedNodeMap: 0,
            NodeList: 1,
            PaintRequestList: 0,
            Plugin: 0,
            PluginArray: 0,
            SVGLengthList: 0,
            SVGNumberList: 0,
            SVGPathSegList: 0,
            SVGPointList: 0,
            SVGStringList: 0,
            SVGTransformList: 0,
            SourceBufferList: 0,
            StyleSheetList: 0,
            TextTrackCueList: 0,
            TextTrackList: 0,
            TouchList: 0
          };
        },
        "fdbf": function(module3, exports3, __webpack_require__) {
          var NATIVE_SYMBOL = __webpack_require__("4930");
          module3.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
        }
      })["default"];
    });
  })(vuedraggable_umd);
  var Draggable = /* @__PURE__ */ getDefaultExportFromCjs(vuedraggable_umd.exports);
  if (typeof window !== "undefined") {
    let loadSvg = function() {
      var body = document.body;
      var svgDom = document.getElementById("__svg__icons__dom__1726652702966__");
      if (!svgDom) {
        svgDom = document.createElementNS("http://www.w3.org/2000/svg", "svg");
        svgDom.style.position = "absolute";
        svgDom.style.width = "0";
        svgDom.style.height = "0";
        svgDom.id = "__svg__icons__dom__1726652702966__";
        svgDom.setAttribute("xmlns", "http://www.w3.org/2000/svg");
        svgDom.setAttribute("xmlns:link", "http://www.w3.org/1999/xlink");
      }
      svgDom.innerHTML = '<symbol class="icon" viewBox="0 0 1024 1024"  id="icon-alert"><path d="M512 85.163a319.573 319.573 0 0 1 319.83 309.333l.17 10.667v174.805l58.88 134.656a53.29 53.29 0 0 1-48.853 74.71L640 789.418a128 128 0 0 1-255.787 7.509l-.213-7.637-201.6.042a53.333 53.333 0 0 1-48.939-74.581L192 580.011V405.163c0-177.28 143.019-320 320-320zm64 704.17-128 .128a64 64 0 0 0 127.701 6.144l.256-6.272zm-64-640.17c-141.653 0-256 114.09-256 256v188.16l-57.344 132.01h627.072L768 593.365V405.717l-.17-9.6A255.488 255.488 0 0 0 512 149.163zM896 352h85.333a32 32 0 0 1 4.352 63.701l-4.352.299H896a32 32 0 0 1-4.352-63.701L896 352zm-853.333 0H128a32 32 0 0 1 4.352 63.701L128 416H42.667a32 32 0 0 1-4.352-63.701l4.352-.299zm921.6-243.2a32 32 0 0 1-2.816 41.685l-3.584 3.115-85.334 64a32 32 0 0 1-41.984-48.085l3.584-3.115 85.334-64a32 32 0 0 1 44.8 6.4zm-859.734-6.4 85.334 64a32 32 0 1 1-38.4 51.2l-85.334-64a32 32 0 1 1 38.4-51.2z" /></symbol><symbol class="icon" viewBox="0 0 1387 1024"  id="icon-button-group"><path d="M1024 0c99.03 0 181.116 72.671 195.848 167.54a198.194 198.194 0 0 1 167.507 195.815v462.451A198.194 198.194 0 0 1 1189.16 1024H363.355a198.227 198.227 0 0 1-195.848-167.54A198.194 198.194 0 0 1 .132 668.077L0 660.645V198.194A198.194 198.194 0 0 1 190.761.132L198.194 0H1024zm165.161 297.29H363.355a66.065 66.065 0 0 0-66.065 66.065v462.451a66.065 66.065 0 0 0 66.065 66.065h825.806a66.065 66.065 0 0 0 66.065-66.065V363.355a66.065 66.065 0 0 0-66.065-66.065zm-355.03 128.232 5.945.396c7.862 1.123 15.063 4.46 21.34 9.744 9.15 7.697 13.278 19.16 13.278 33.198 0 14.534-4.46 26.36-14.336 33.924-6.672 5.12-13.94 8.258-21.603 9.15l-4.624.264h-42.678l-.033 234-.43 4.923a40.795 40.795 0 0 1-10.933 21.768c-8.258 8.786-20.249 12.618-35.18 12.618-15.095 0-27.284-4.129-35.51-13.444-6.11-6.937-9.876-14.666-10.834-22.924l-.231-4.196V512.165h-43.867l-4.525-.396a44.164 44.164 0 0 1-20.48-8.985c-9.91-7.564-14.37-19.357-14.37-33.924 0-14.006 4.13-25.501 13.28-33.198 6.54-5.549 14.104-8.918 22.296-9.843l4.988-.297h178.507zm287.644-4.625c14.931 0 26.955 3.832 35.18 12.618 6.342 6.805 10.174 14.766 11.165 23.52l.231 4.426-.033 287.942-.463 5.12c-.99 6.342-3.402 12.288-7.2 17.606-6.97 9.745-18.664 13.378-34.255 13.378-10.108 0-19.192-3.27-26.459-9.711-3.303-2.973-6.276-5.946-8.919-8.92l-3.633-4.491-116.075-151.42v135.234l-.43 4.922a40.795 40.795 0 0 1-10.934 21.768c-8.258 8.786-20.248 12.618-35.179 12.618-15.096 0-27.285-4.129-35.51-13.444-6.11-6.937-9.876-14.666-10.834-22.924l-.231-4.196.033-286.95.43-5.286a42.419 42.419 0 0 1 7.068-17.97c6.97-10.074 18.894-13.84 34.882-13.84 10.273 0 19.423 3.37 26.459 10.14a125.51 125.51 0 0 1 8.225 8.721l3.534 4.46L1075.2 600.725l.066-140.652.43-4.657c1.32-7.63 4.954-14.7 10.57-21.075 8.225-9.315 20.414-13.444 35.51-13.444zm-628.471 4.625 8.588.132c17.177.627 32.107 3.072 44.924 7.465 14.964 5.186 27.35 12.156 36.996 21.042 9.844 9.116 16.946 19.819 21.108 32.04a108.941 108.941 0 0 1 5.714 34.916c0 12.717-1.883 24.113-5.714 34.122-3.865 10.009-9.25 18.696-16.153 26.03l-4.195 4.129-4.46 3.798-1.618 1.123a82.268 82.268 0 0 1 7.498 5.286l3.469 2.84 5.02 4.625c8.193 8.258 14.766 18.366 19.754 30.324 5.054 12.188 7.498 26.26 7.498 42.182 0 32.437-10.24 58.698-30.786 77.626-18.762 17.21-44.726 26.227-77.328 27.515l-8.292.166h-96.95l-4.789-.265c-10.042-.925-18.663-4.624-25.071-11.23a37.194 37.194 0 0 1-10.637-21.736l-.231-4.096.066-282.095.43-4.493c1.32-7.597 5.053-14.369 10.801-20.15 6.607-6.573 15.195-10.173 25.105-11.065l5.087-.231h84.166zM1024 132.129H198.194a66.065 66.065 0 0 0-65.9 61.11l-.165 4.955v462.451a66.065 66.065 0 0 0 33.032 57.245V363.355A198.194 198.194 0 0 1 363.355 165.16h717.89a66.065 66.065 0 0 0-52.323-32.867l-4.922-.165zM482.205 637.06H460.8v58.996h28.804c14.402 0 24.94-2.709 31.843-7.598 5.186-3.666 7.796-9.81 7.598-20.744 0-7.333-.991-12.816-2.643-16.417a17.177 17.177 0 0 0-6.342-7.465 36.302 36.302 0 0 0-13.675-4.955 127.207 127.207 0 0 0-17.442-1.685l-6.738-.132zm9.711-126.712H460.8v39.11h31.116c11.529 0 18.201-2.113 20.844-5.02 3.468-3.799 5.186-8.523 5.186-14.997a21.14 21.14 0 0 0-1.288-7.432 14.865 14.865 0 0 0-3.601-5.384 19.885 19.885 0 0 0-7.267-4.295 34.882 34.882 0 0 0-9.712-1.85l-4.162-.132z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-button"><path d="M912 176v416H732.48v-32H880V208H144v352h175.488v32H112V176z" /><path d="m436.384 788.512.544 2.688a16 16 0 0 0 27.776 5.504l44.032-54.336 56.768 97.664a16 16 0 0 0 21.792 5.856l68.672-39.392 2.368-1.664a16 16 0 0 0 3.52-20.256l-55.904-96.16 68.8-12.064a16 16 0 0 0 6.464-28.8l-256-180.64a16 16 0 0 0-25.12 14.976l36.288 306.624z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-card"><path d="M858.656 864H165.344C109.472 864 64 818.56 64 762.688V261.312C64 205.44 109.472 160 165.344 160h693.312C914.528 160 960 205.44 960 261.312v501.376C960 818.56 914.528 864 858.656 864zM165.344 224C144.736 224 128 240.736 128 261.312v501.376C128 783.264 144.736 800 165.344 800h693.312C879.264 800 896 783.264 896 762.688V261.312C896 240.736 879.264 224 858.656 224H165.344zM800 416H224c-17.664 0-32-14.336-32-32s14.336-32 32-32h576c17.696 0 32 14.336 32 32s-14.304 32-32 32zM320 736h-96c-17.664 0-32-14.304-32-32s14.336-32 32-32h96c17.664 0 32 14.304 32 32s-14.336 32-32 32z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-cascader-field"><path d="M661.377 411.07v64.595H314.175v395.654H871.32V475.665h-48.447V411.07h48.447c35.675 0 64.595 28.92 64.595 64.595v395.654c0 35.675-28.92 64.595-64.595 64.595H314.175c-35.675 0-64.6-28.92-64.6-64.595V475.665c0-35.675 28.925-64.595 64.6-64.595h347.202zm48.448-322.984c35.675 0 64.6 28.92 64.6 64.595v403.73c0 35.676-28.925 64.595-64.6 64.595H362.623v-64.594h347.202V152.68H152.68v403.73h48.447v64.595H152.68c-35.675 0-64.595-28.92-64.595-64.594V152.68c0-35.675 28.92-64.595 64.595-64.595h557.144z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-checkbox-field"><path d="M897.94 896.77c6.259-6.278 10.257-14.835 10.257-24.531V147.672c0-9.118-3.998-18.235-10.257-24.533-6.277-6.258-14.815-9.696-24.51-9.696H149.644c-9.688 0-18.236 3.437-24.503 9.696-6.268 6.297-9.687 15.414-9.687 24.533V872.24c0 9.696 3.42 18.253 9.687 24.53 6.267 6.278 14.815 10.276 24.503 10.276h723.784c9.697 0 18.234-3.998 24.511-10.276zM149.645 61.52h723.784c23.933 0 45.586 9.697 60.98 25.111 15.397 15.974 25.073 37.666 25.073 61.04v724.567c0 23.97-9.676 45.643-25.073 61.056-15.394 15.396-37.047 25.093-60.98 25.093H149.645c-23.364 0-45.017-9.697-60.972-25.093-15.396-15.414-25.082-37.087-25.082-61.056V147.672c0-23.374 9.686-45.065 25.082-61.039 15.955-15.415 37.608-25.112 60.972-25.112z" /><path d="M417.42 698.27a23.556 23.556 0 0 1-16.668-6.9L259.5 550.12c-9.173-9.15-9.173-24.095 0-33.291 9.17-9.147 24.115-9.147 33.288 0l124.583 124.607 312.895-312.917c9.194-9.172 24.14-9.172 33.288 0 9.196 9.172 9.196 24.116 0 33.29L433.992 691.37c-4.618 4.645-10.643 6.9-16.666 6.9h.093z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-color-field"><path d="M619.52 490.667h-.853l-85.334-85.334h.854z" /><path d="M619.52 507.733h-.853a17.067 17.067 0 1 1 0-34.133c9.438 0 17.476 7.646 17.476 17.067s-7.185 17.066-16.623 17.066zM534.187 422.4c-9.438 0-17.494-7.646-17.494-17.067s7.202-17.066 16.64-17.066h.854a17.067 17.067 0 1 1 0 34.133zM192 866.133a34.133 34.133 0 0 1-24.132-58.265l42.666-42.667a34.133 34.133 0 1 1 48.265 48.265l-42.667 42.666A33.963 33.963 0 0 1 192 866.133z" /><path d="m619.52 490.667-.427-.427-84.906-84.907L746.667 192H832v85.333z" /><path d="M662.187 567.467a33.997 33.997 0 0 1-24.133-10.001L467.388 386.799a34.133 34.133 0 0 1 48.281-48.282l170.667 170.667a34.133 34.133 0 0 1-24.15 58.283z" /><path d="M320 806.4h-85.333a17.067 17.067 0 0 1-17.067-17.067V704c0-4.54 1.792-8.875 5-12.066L521.695 392.84a16.52 16.52 0 0 1 3.567-2.731l209.305-210.142a17.117 17.117 0 0 1 12.1-5.018H832a17.067 17.067 0 0 1 17.067 17.067v85.333a17.067 17.067 0 0 1-4.967 12.05L631.62 502.732a17.954 17.954 0 0 1-3.618 2.782L332.066 801.434A17.135 17.135 0 0 1 320 806.4zm-68.267-34.133h61.201l294.093-294.093a16.52 16.52 0 0 1 3.567-2.73l204.34-205.16v-61.217h-61.185L546.287 417.382a17.954 17.954 0 0 1-3.618 2.782L251.733 711.066v61.2z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-column-1-grid"><path d="M874.667 117.333H149.333c-40.533 0-74.666 34.134-74.666 74.667v640c0 40.533 34.133 74.667 74.666 74.667h725.334c40.533 0 74.666-34.134 74.666-74.667V192c0-40.533-34.133-74.667-74.666-74.667zm-725.334 64h725.334c6.4 0 10.666 4.267 10.666 10.667v288H138.667V192c0-6.4 4.266-10.667 10.666-10.667zm725.334 661.334H149.333c-6.4 0-10.666-4.267-10.666-10.667V544h746.666v288c0 6.4-4.266 10.667-10.666 10.667z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-column-2-grid"><path d="M874.667 117.333H149.333c-40.533 0-74.666 34.134-74.666 74.667v640c0 40.533 34.133 74.667 74.666 74.667h725.334c40.533 0 74.666-34.134 74.666-74.667V192c0-40.533-34.133-74.667-74.666-74.667zM138.667 832V192c0-6.4 4.266-10.667 10.666-10.667H480v661.334H149.333c-6.4 0-10.666-4.267-10.666-10.667zm746.666 0c0 6.4-4.266 10.667-10.666 10.667H544V181.333h330.667c6.4 0 10.666 4.267 10.666 10.667v640z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-column-3-grid"><path d="M874.667 117.333H149.333c-40.533 0-74.666 34.134-74.666 74.667v640c0 40.533 34.133 74.667 74.666 74.667h725.334c40.533 0 74.666-34.134 74.666-74.667V192c0-40.533-34.133-74.667-74.666-74.667zm-245.334 64v661.334H394.667V181.333h234.666zM138.667 832V192c0-6.4 4.266-10.667 10.666-10.667h181.334v661.334H149.333c-6.4 0-10.666-4.267-10.666-10.667zm746.666 0c0 6.4-4.266 10.667-10.666 10.667H693.333V181.333h181.334c6.4 0 10.666 4.267 10.666 10.667v640z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-column-4-grid"><path d="M874.667 117.333H149.333c-40.533 0-74.666 34.134-74.666 74.667v640c0 40.533 34.133 74.667 74.666 74.667h725.334c40.533 0 74.666-34.134 74.666-74.667V192c0-40.533-34.133-74.667-74.666-74.667zm-330.667 64h128v661.334H544V181.333zm-64 661.334H352V181.333h128v661.334zM138.667 832V192c0-6.4 4.266-10.667 10.666-10.667H288v661.334H149.333c-6.4 0-10.666-4.267-10.666-10.667zm746.666 0c0 6.4-4.266 10.667-10.666 10.667H736V181.333h138.667c6.4 0 10.666 4.267 10.666 10.667v640z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-custom-component"><path d="M811.008 335.872c-2.048-7.168-11.264-9.216-17.408-4.096L690.176 435.2c-8.192 8.192-20.48 8.192-28.672 0L588.8 362.496c-8.192-8.192-8.192-20.48 0-28.672l104.448-104.448c5.12-5.12 3.072-14.336-4.096-17.408-17.408-4.096-35.84-7.168-54.272-7.168-108.544 0-195.584 94.208-183.296 204.8 2.048 17.408 6.144 32.768 12.288 48.128L225.28 697.344c-27.648 27.648-27.648 73.728 0 101.376 14.336 14.336 32.768 21.504 51.2 21.504s36.864-7.168 51.2-21.504l238.592-238.592c15.36 6.144 31.744 10.24 48.128 12.288 111.616 12.288 204.8-74.752 204.8-183.296 0-18.432-3.072-36.864-8.192-53.248z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-data-table"><path d="M915.692 39.385H108.308c-15.754 0-29.539 13.784-29.539 29.538v98.462c0 15.753 13.785 29.538 29.539 29.538h807.384c15.754 0 29.539-13.785 29.539-29.538V68.923c0-15.754-13.785-29.538-29.539-29.538zM285.538 275.692h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V305.23c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V305.23c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V305.23c0-15.754-13.785-29.539-29.539-29.539zM285.538 472.615h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zM285.538 669.538h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zm315.077 0h-177.23c-15.754 0-29.539 13.785-29.539 29.539v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538v-59.077c0-15.754-13.785-29.539-29.539-29.539zM285.538 866.462h-177.23c-15.754 0-29.539 13.784-29.539 29.538v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V896c0-15.754-13.785-29.538-29.539-29.538zm315.077 0h-177.23c-15.754 0-29.539 13.784-29.539 29.538v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V896c0-15.754-13.785-29.538-29.539-29.538zm315.077 0h-177.23c-15.754 0-29.539 13.784-29.539 29.538v59.077c0 15.754 13.785 29.538 29.539 29.538h177.23c15.754 0 29.539-13.784 29.539-29.538V896c0-15.754-13.785-29.538-29.539-29.538z" /></symbol><symbol class="icon" viewBox="0 0 1132 1024"  id="icon-date-field"><path d="M1023.995 1023.995H107.789C48.262 1023.995 0 975.732 0 916.205V188.63C0 129.105 48.262 80.843 107.789 80.843h80.842v53.894h-80.842c-29.777 0-53.895 24.118-53.895 53.895V296.42H1077.89V188.63c0-29.776-24.117-53.894-53.894-53.894h-80.842V80.842h80.842c59.526 0 107.789 48.262 107.789 107.789v727.575c0 59.526-48.263 107.789-107.79 107.789Zm53.894-673.681H53.894v565.892c0 29.777 24.118 53.894 53.895 53.894h916.206c29.777 0 53.894-24.117 53.894-53.894V350.314ZM794.943 628.086l-3.584 5.632c-3.314 6.306-7.087 12.153-11.237 17.731L646.734 861.476H589.12l98.358-160.875c-.108 0-.216.027-.324.027-66.963 0-121.262-60.335-121.262-134.736 0-74.401 54.299-134.736 121.262-134.736 66.964 0 121.263 60.335 121.263 134.736 0 22.42-5.39 43.25-14.12 61.844l.646.35ZM687.154 485.05c-37.214 0-67.368 36.19-67.368 80.842 0 44.651 30.154 80.842 67.368 80.842 19.052 0 36.164-9.567 48.425-24.819l9.781-16.006c5.66-11.83 9.163-25.385 9.163-40.017 0-44.652-30.154-80.842-67.369-80.842Zm-310.216 21.881-80.734 72.327v-66.991l82.405-80.41h52.062v429.727h-53.733V506.93Zm512.32-291.353c-14.874 0-26.947-12.072-26.947-26.947V26.947C862.311 12.072 874.384 0 889.26 0s26.947 12.072 26.947 26.947v161.684c0 14.875-12.072 26.947-26.947 26.947ZM296.42 80.842h538.944v53.894H296.42V80.842Zm-53.895 134.736c-14.875 0-26.947-12.072-26.947-26.947V26.947C215.578 12.072 227.65 0 242.525 0s26.947 12.072 26.947 26.947v161.684c0 14.875-12.072 26.947-26.947 26.947Z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-date-range-field"><path d="M887.467 192.853H786.773v-73.386c0-10.24-6.826-17.067-17.066-17.067s-17.067 6.827-17.067 17.067v73.386H303.787v-73.386c0-10.24-6.827-17.067-17.067-17.067s-17.067 6.827-17.067 17.067v73.386H168.96c-46.08 0-85.333 37.547-85.333 85.334v558.08c0 46.08 37.546 85.333 85.333 85.333h718.507c46.08 0 85.333-37.547 85.333-85.333v-558.08c0-47.787-37.547-85.334-85.333-85.334zM168.96 226.987h100.693v66.56c0 10.24 6.827 17.066 17.067 17.066s17.067-6.826 17.067-17.066v-66.56h450.56v66.56c0 10.24 6.826 17.066 17.066 17.066s17.067-6.826 17.067-17.066v-66.56h98.987c27.306 0 51.2 22.186 51.2 51.2v88.746H117.76v-88.746c0-29.014 22.187-51.2 51.2-51.2zm718.507 660.48H168.96c-27.307 0-51.2-22.187-51.2-51.2v-435.2h820.907v435.2c0 27.306-22.187 51.2-51.2 51.2z" /><path d="M858.453 493.227H327.68c-10.24 0-17.067 6.826-17.067 17.066V624.64H194.56c-10.24 0-17.067 6.827-17.067 17.067v133.12c0 10.24 6.827 17.066 17.067 17.066H460.8c10.24 0 17.067-6.826 17.067-17.066V660.48h380.586c10.24 0 17.067-6.827 17.067-17.067v-133.12c0-10.24-6.827-17.066-17.067-17.066zM445.44 527.36v97.28h-98.987v-97.28h98.987zm-230.4 131.413h98.987v98.987H215.04v-98.987zm131.413 97.28v-97.28h98.987v97.28h-98.987zm133.12-228.693h97.28v98.987h-97.28V527.36zm131.414 0h98.986v98.987h-98.986V527.36zm230.4 97.28H742.4v-98.987h98.987v98.987z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-divider"><path d="M62.5 491.773h899v74.918h-899v-74.918z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-document"><path d="M979.478 706.382a44.522 44.522 0 0 1-11.843 57.967l-4.363 2.85L569.478 995.06l-5.388 4.764a84.013 84.013 0 0 1-43.943 17.808l-8.102.401c-19.056 0-37.31-6.545-52.046-18.254l-5.432-4.72L60.817 767.2a44.522 44.522 0 0 1-18.61-56.187l2.36-4.63a44.522 44.522 0 0 1 60.816-16.25l405.326 234.54 1.336 1.514 1.335-1.514 405.282-234.54a44.522 44.522 0 0 1 60.86 16.25zm0-222.609a44.522 44.522 0 0 1-11.843 57.968l-4.363 2.849-393.794 227.862-5.388 4.764a84.013 84.013 0 0 1-43.943 17.809l-8.102.4c-19.056 0-37.31-6.544-52.046-18.254l-5.432-4.719L60.817 544.59a44.522 44.522 0 0 1-18.61-56.187l2.36-4.63a44.522 44.522 0 0 1 60.816-16.25l405.326 234.54 1.336 1.514 1.335-1.514 405.282-234.54a44.522 44.522 0 0 1 60.86 16.25zM512 0c18.788 0 36.864 6.1 51.645 17.185l4.586 3.74 403.5 199.68 5.61 6.144c32.501 35.44 32.501 89.89 0 125.329l-5.61 6.144-403.5 199.59-4.541 3.785a86.239 86.239 0 0 1-43.676 16.83l-8.014.356c-18.788 0-36.864-6.1-51.645-17.186l-4.63-3.784L52.269 358.222l-5.61-6.144a92.739 92.739 0 0 1 0-125.329l5.61-6.144 403.456-199.68 4.585-3.74C473 7.702 488.136 1.87 503.986.356z" fill="#008df0" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-drag"><path d="M574.958 267.016h-63.454 204.649L511.213 63.655 307.85 267.016h141.191V456.68H258.688v125.917H449.04V772.95h125.917V582.596h188.875V456.679H574.958V267.016zm-63.704 693.33 189.62-187.396H323.126l188.129 187.395zM71.292 518.891l187.395 189.62v-377.75L71.292 518.892zm692.54-188.13v377.75L952.708 518.89 763.833 330.762z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-file-upload-field"><path d="m676.48 72.96 209.92 211.2 9.6 23.04V928l-32 32H160l-32-32V96l32-32h494.08l22.4 8.96zM640 320h192L640 128v192zM192 128v768h640V384H608l-32-32V128H192zm512 320H320v64h384v-64zM320 576h384v64H320v-64zm384 128H320v64h384v-64z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-github"><path d="M512 0C229.284 0 .142 234.943.142 524.868c0 231.829 146.647 428.553 350.068 497.952 25.593 4.82 34.977-11.389 34.977-25.294 0-12.455-.469-45.47-.725-89.277-142.382 31.735-172.453-70.38-172.453-70.38-23.247-60.57-56.817-76.694-56.817-76.694-46.493-32.588 3.54-31.948 3.54-31.948 51.357 3.71 78.358 54.086 78.358 54.086 45.683 80.191 119.817 57.072 148.993 43.594 4.65-33.911 17.915-57.03 32.503-70.168-113.675-13.223-233.151-58.224-233.151-259.341 0-57.285 19.92-104.163 52.678-140.846-5.246-13.266-22.82-66.627 4.991-138.884 0 0 42.996-14.076 140.76 53.787 40.864-11.644 84.628-17.445 128.179-17.659 43.465.214 87.271 6.015 128.135 17.66 97.68-67.907 140.59-53.788 140.59-53.788 27.939 72.257 10.408 125.618 5.119 138.884 32.844 36.683 52.593 83.56 52.593 140.846 0 201.587-119.647 245.99-233.663 258.957 18.341 16.21 34.72 48.2 34.72 97.21 0 70.168-.639 126.728-.639 143.96 0 14.034 9.214 30.371 35.19 25.21 203.25-69.528 349.77-266.124 349.77-497.867C1023.858 234.943 794.674 0 512 0" fill="#3E75C3" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-grid-sub-form"><defs><style>@font-face{font-family:feedback-iconfont;src:url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944) format("woff2"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944) format("woff"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944) format("truetype")}</style></defs><path d="M448 768h128V640H448v128zM256 384h128V256H256v128zm192 192h128V448H448v128zM256 768h128V640H256v128zm0-192h128V448H256v128zM832 0H192A192 192 0 0 0 0 192v640c0 105.984 85.952 192 192 192h640c105.984 0 192-86.016 192-192V192C1024 85.952 937.984 0 832 0zm64 832c0 35.392-28.608 64-64 64H192a64 64 0 0 1-64-64V192c0-35.328 28.672-64 64-64h640a64 64 0 0 1 64 64v640zM640 576h128V448H640v128zm0-192h128V256H640v128zm-192 0h128V256H448v128zm192 384h128V640H640v128z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-grid"><path d="M819.354 921.6h102.4V819.2h-102.4v102.4zm102.4-204.8h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V819.2a102.4 102.4 0 0 0-102.4-102.4zm-460.8 204.8h102.4V819.2h-102.4v102.4zm102.4-204.8h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V819.2a102.4 102.4 0 0 0-102.4-102.4zm-460.8 204.8h102.4V819.2h-102.4v102.4zm102.4-204.8h-102.4A102.4 102.4 0 0 0 .154 819.2v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V819.2a102.4 102.4 0 0 0-102.4-102.4zm614.4-153.6h102.4V460.8h-102.4v102.4zm102.4-204.8h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V460.8a102.4 102.4 0 0 0-102.4-102.4zm-460.8 204.8h102.4V460.8h-102.4v102.4zm102.4-204.8h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V460.8a102.4 102.4 0 0 0-102.4-102.4zm-460.8 204.8h102.4V460.8h-102.4v102.4zm102.4-204.8h-102.4A102.4 102.4 0 0 0 .154 460.8v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V460.8a102.4 102.4 0 0 0-102.4-102.4zm614.4-153.6h102.4V102.4h-102.4v102.4zM921.754 0h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V102.4A102.4 102.4 0 0 0 921.754 0zm-460.8 204.8h102.4V102.4h-102.4v102.4zM563.354 0h-102.4a102.4 102.4 0 0 0-102.4 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V102.4A102.4 102.4 0 0 0 563.354 0zm-460.8 204.8h102.4V102.4h-102.4v102.4zM204.954 0h-102.4A102.4 102.4 0 0 0 .154 102.4v102.4a102.4 102.4 0 0 0 102.4 102.4h102.4a102.4 102.4 0 0 0 102.4-102.4V102.4A102.4 102.4 0 0 0 204.954 0z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-html-text"><path d="m137.6 512 204.8-204.8c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L70.4 489.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4l227.2 227.2c12.8 12.8 32 12.8 44.8 0 12.8-12.8 12.8-32 0-44.8L137.6 512zm464-339.2c-16-3.2-35.2 6.4-38.4 22.4L396.8 812.8c-3.2 16 6.4 35.2 22.4 38.4 16 3.2 35.2-6.4 38.4-22.4L624 211.2c6.4-16-3.2-35.2-22.4-38.4zm352 316.8L726.4 262.4c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8L886.4 512 681.6 716.8c-12.8 12.8-12.8 32 0 44.8 12.8 12.8 32 12.8 44.8 0l227.2-227.2c6.4-6.4 9.6-16 9.6-22.4 0-9.6-3.2-16-9.6-22.4z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-node-tree"><path d="M332.48 500.864a25.6 25.6 0 1 0 0-51.2H192.384v-184.96a115.2 115.2 0 0 0 89.6-112.128c0-63.488-51.712-115.2-115.2-115.2s-115.2 51.712-115.2 115.2a115.2 115.2 0 0 0 89.6 112.128v696.192a25.6 25.6 0 1 0 51.2 0v-141.12c2.304.192 4.48.512 6.912.512H332.48a25.6 25.6 0 1 0 0-51.2H199.296c-3.456 0-5.504-.448-6.08-.256a29.184 29.184 0 0 1-.896-8.576V500.8h140.16zM102.784 152.64c0-35.264 28.736-64 64-64s64 28.736 64 64-28.736 64-64 64-64-28.736-64-64zm818.432 207.424h-486.4c-28.224 0-51.2 22.976-51.2 51.2v128c0 28.224 22.976 51.2 51.2 51.2h486.4c28.224 0 51.2-22.976 51.2-51.2v-128c0-28.224-22.976-51.2-51.2-51.2zm-486.336 179.2v-128h486.4v128h-486.4zm486.336 140.352h-486.4c-28.224 0-51.2 22.976-51.2 51.2v128c0 28.224 22.976 51.2 51.2 51.2h486.4c28.224 0 51.2-22.976 51.2-51.2v-128c0-28.224-22.976-51.2-51.2-51.2zm-486.336 179.2v-128h486.4v128h-486.4z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-number-field"><path d="M960 1024H64a64 64 0 0 1-64-64V64A64 64 0 0 1 64 0h896a64 64 0 0 1 64 64v896a64 64 0 0 1-64 64zm0-896a64 64 0 0 0-64-64H128a64 64 0 0 0-64 64v768a64 64 0 0 0 64 64h768a64 64 0 0 0 64-64V128zM832 768H704a64 64 0 0 1 0-128h64v-64h-64a64 64 0 0 1 0-128h64v-64h-64a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v384a64 64 0 0 1-64 64zM512 640a64 64 0 0 1 0 128H384a64 64 0 0 1-64-64V512a64 64 0 0 1 64-64h64v-64h-64a64 64 0 0 1 0-128h128a64 64 0 0 1 64 64v192a64 64 0 0 1-64 64h-64v64h64zM192 768a64 64 0 0 1-64-64V320a64 64 0 0 1 128 0v384a64 64 0 0 1-64 64z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-object-group"><path d="M90.68 508.739c19.567 0 32.612-13.045 32.612-32.612V300.025c0-13.044 6.522-26.089 19.566-26.089L501.585 65.223c6.522 0 19.566 0 32.611 6.522l91.312 52.179c13.045 6.522 32.612 0 39.134-13.045s6.522-32.611-6.522-45.656l-91.313-52.178c-32.611-19.567-65.222-19.567-97.834 0L110.247 221.758c-32.611 13.045-52.178 45.656-52.178 84.79V482.65c0 13.044 13.044 26.089 32.611 26.089zM710.298 854.42 534.196 958.777c-13.045 6.522-26.09 6.522-32.611 0L142.858 750.064c-13.044-6.523-19.566-19.567-19.566-32.612V606.573c0-19.567-13.045-32.611-32.612-32.611S58.07 593.529 58.07 613.096v104.356c0 32.612 19.567 65.223 45.656 84.79l358.726 208.713c13.044 6.523 32.611 13.045 45.656 13.045 19.567 0 32.611-6.522 45.656-13.045L729.865 906.6c13.044-6.523 19.567-26.09 13.044-45.656 0-13.045-19.566-19.567-32.611-6.523zm215.236-632.662-150.013-84.79c-13.045-6.522-32.612-6.522-45.656 13.045-6.522 13.044-6.522 32.611 13.044 45.656l150.013 84.79c6.522 0 13.045 13.044 13.045 26.089v417.427c0 13.044-6.523 26.089-19.567 26.089l-52.179 32.611c-13.044 6.522-19.566 26.09-13.044 45.656 6.522 13.045 19.567 13.045 26.09 13.045 6.521 0 13.044 0 13.044-6.522l58.7-32.612c32.612-19.567 45.656-52.178 45.656-84.79V300.025c6.523-32.611-13.044-65.222-39.133-78.267z" /><path d="M755.954 352.204 534.196 221.758c-13.045-6.522-19.567-6.522-32.611 0L279.827 352.204c-13.045 6.522-19.567 19.567-19.567 32.611v260.892c0 13.045 6.522 19.567 13.044 26.09l221.758 130.445c6.523 0 13.045 6.522 13.045 6.522 6.522 0 13.044 0 13.044-6.522L742.91 671.796c13.045-6.522 13.045-19.567 13.045-26.089V384.815c13.045-13.044 6.522-26.089 0-32.611zM514.629 286.98l163.057 91.312-163.057 97.834-163.057-91.312 163.057-97.834zM318.96 436.994l163.058 91.312v189.146L318.96 626.14V436.994zm228.28 280.458V528.306l163.058-91.312v182.624L547.24 717.452z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-picture-upload-field"><path d="M896 1024H128C57.312 1024 0 966.688 0 896V128C0 57.312 57.312 0 128 0h768c70.688 0 128 57.312 128 128v768c0 70.688-57.312 128-128 128zm0-64c35.328 0 64-28.672 64-64V639.968l-192-192L494.816 721.12 730.624 960H896zM64 896c0 35.328 28.672 64 64 64h512.032L318.24 638.208 64 865.952V896zm896-768c0-35.328-28.672-64-64-64H128c-35.328 0-64 28.672-64 64v650.752L320 544l129.856 131.552L768 352l192 196.096V128zM256 384c-70.688 0-128-57.312-128-128s57.312-128 128-128 128 57.312 128 128-57.312 128-128 128zm0-192c-35.328 0-64 28.672-64 64s28.672 64 64 64 64-28.672 64-64-28.672-64-64-64z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-radio-field"><path d="M512 65.983C266.08 65.983 65.983 266.08 65.983 512c0 245.952 200.065 446.017 446.017 446.017S958.017 757.952 958.017 512c0-245.92-200.065-446.017-446.017-446.017zm0 828.034c-210.656 0-382.017-171.392-382.017-382.017 0-210.656 171.36-382.017 382.017-382.017 210.625 0 382.017 171.36 382.017 382.017 0 210.625-171.392 382.017-382.017 382.017zM512 352C423.776 352 352 423.776 352 512s71.774 160 160 160 160-71.774 160-160-71.776-160-160-160z" /></symbol><symbol class="icon" viewBox="0 0 1069 1024"  id="icon-rate-field"><path d="m633.73 378.02 9.498 18.688 20.78 2.798 206.616 27.332a11.465 11.465 0 0 1 6.61 19.473L729.966 593.665l-14.893 14.893 3.8 20.683 37.847 204.89a11.465 11.465 0 0 1-16.481 12.296l-185.55-94.58-18.687-9.493-18.487 9.992-183.24 99.35a11.465 11.465 0 0 1-16.784-11.867l32.543-205.796 3.297-20.786-15.192-14.492-151.033-143.484a11.465 11.465 0 0 1 6.1-19.64L399 402.998l20.786-3.296 9.092-18.98 89.713-188.078a11.465 11.465 0 0 1 20.569-.263l94.568 185.635zM496.647 85.52 374.89 340.501l-279.126 44.26a34.395 34.395 0 0 0-18.303 58.908l204.873 194.663-44.169 279.115a34.395 34.395 0 0 0 50.366 35.616l248.4-134.679L788.776 946.66a34.395 34.395 0 0 0 49.437-36.894l-51.306-277.854 199.731-199.909a34.395 34.395 0 0 0-19.828-58.408l-280.118-37.032L558.33 84.713a34.395 34.395 0 0 0-61.682.802z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-redo"><path d="M412.081 346.3h443.415L640.168 133.871c-18.973-18.973-18.973-46.064 0-65.038s44.325-19.884 63.381-.83l291.385 284.591c18.973 18.973 18.973 44.159 0 63.132L703.549 700.649c-18.973 18.973-44.325 18.973-63.381-.083-18.973-18.973-18.973-43.91 0-62.883l215.328-208.534H412.081c-177.3 0-314.335 138.359-314.335 309.364v44.325c0 25.354-16.074 44.325-41.425 44.325s-41.425-18.973-41.425-44.325v-44.325c0-221.709 169.181-392.213 397.185-392.213z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-rich-editor-field"><path d="M313.36 448.094H632.63v31.927H313.36v-31.927ZM313.36 583.784h223.49v31.927H313.36v-31.927ZM313.36 719.474h127.709v31.927h-127.71v-31.927ZM889.412 554.809l-39.955-39.971-39.957-39.941c-7.358-7.358-19.285-7.358-26.642 0l-329.7 329.694a14.08 14.08 0 0 0-4.592 6.873L412.078 932.86a14.158 14.158 0 0 0 3.54 14.079l.99.763.77.982a14.174 14.174 0 0 0 14.062 3.555l121.395-36.495a14.04 14.04 0 0 0 6.938-4.677l329.639-329.63c7.35-7.343 7.35-19.284 0-26.627zM541.136 889.756l-95.198 28.622 28.623-95.235 255.02-255.02 66.6 66.599-255.045 255.034zM856.112 574.78l-46.611 46.611-66.59-66.598 46.605-46.597c3.677-3.68 9.641-3.68 13.319-.016l26.892 26.892 26.384 26.394c3.68 3.68 3.68 9.65.001 13.314z" /><path d="M671.874 224.898v-28.934c0-22.004-17.905-39.909-39.909-39.909H314.026c-22.004 0-39.909 17.905-39.909 39.91v28.933h-104.43v643.564c0 35.26 28.592 63.854 63.855 63.854h127.709v-47.89H249.506c-17.632 0-31.928-14.299-31.928-31.928v-579.71h56.54v10.976c0 22.004 17.904 39.909 39.908 39.909h317.938c22.004 0 39.91-17.905 39.91-39.91V272.79h56.538V437.45h47.89V224.898H671.875zm-47.89 50.884H322.007v-71.836h301.974v71.836z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-section"><path d="M141.074 906.496h741.852c89.581 0 134.583-44.562 134.583-132.846V250.331c0-88.283-45.002-132.845-134.583-132.845H141.074c-89.143.018-134.583 44.16-134.583 132.845V773.67c0 88.704 45.44 132.845 134.583 132.845zm1.28-68.992c-42.861 0-66.852-22.71-66.852-67.291V253.806c0-44.58 23.99-67.292 66.852-67.292h739.292c42.423 0 66.852 22.711 66.852 67.292v516.388c0 44.58-24.43 67.292-66.852 67.292z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-select-field"><path d="M374.784 649.515a32 32 0 0 1 3.072 41.685l-3.115 3.584L225.28 843.947a32 32 0 0 1-37.845 5.504l-3.968-2.56-85.334-64a32 32 0 0 1 34.432-53.76l3.968 2.56 63.147 47.36 129.835-129.622a32 32 0 0 1 45.269.043zm531.37 75.818a32 32 0 0 1 4.31 63.702l-4.31.298h-448a32 32 0 0 1-4.351-63.744l4.352-.256h448zm.513-256a32 32 0 0 1 4.352 63.702l-4.352.298h-448a32 32 0 0 1-4.352-63.701l4.352-.299h448zm-531.84-331.776a32 32 0 0 1 2.986 41.686l-3.114 3.584-149.846 149.205a32 32 0 0 1-37.888 5.419l-3.925-2.56-84.907-64a32 32 0 0 1 34.518-53.675l3.968 2.56 62.72 47.275L329.6 137.472a32 32 0 0 1 45.227.085zm531.328 75.819a32 32 0 0 1 4.309 63.701l-4.31.299H459.35a32 32 0 0 1-4.352-63.744l4.352-.256h446.806z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-slider-field"><path d="M951.453 476.844H523.672a131.836 131.836 0 0 0-254.18 0H72.547v70.312h196.945a131.836 131.836 0 0 0 254.18 0h427.781z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-slot-component"><path d="M512 102.4c-212.48 0-384 171.52-384 384s171.52 384 384 384 384-171.52 384-384-171.52-384-384-384zm25.6 716.8v-128c0-15.36-10.24-25.6-25.6-25.6s-25.6 10.24-25.6 25.6v128C322.56 806.4 192 675.84 179.2 512h128c15.36 0 25.6-10.24 25.6-25.6s-10.24-25.6-25.6-25.6h-128C192 296.96 322.56 166.4 486.4 156.16V281.6c0 15.36 10.24 25.6 25.6 25.6s25.6-10.24 25.6-25.6V156.16C701.44 168.96 832 299.52 844.8 460.8h-128c-15.36 0-25.6 10.24-25.6 25.6s10.24 25.6 25.6 25.6h128C832 675.84 701.44 806.4 537.6 819.2z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-slot-field"><path d="M493.969 244.87h36.285q18.031 0 18.031 18.03v217.267q0 18.031-18.031 18.031h-36.285q-18.032 0-18.032-18.031V262.901q0-18.031 18.032-18.031ZM323.45000000000005 525.802h36.286q18.031 0 18.031 18.031v217.266q0 18.031-18.031 18.031H323.45q-18.03 0-18.03-18.03V543.832q0-18.031 18.03-18.031ZM664.2639999999999 525.802h36.286q18.03 0 18.03 18.031v217.266q0 18.031-18.03 18.031h-36.286q-18.031 0-18.031-18.03V543.832q0-18.031 18.031-18.031Z" /><path d="M827.437 122.212H196.563a74.574 74.574 0 0 0-74.35 74.351v630.874a74.574 74.574 0 0 0 74.35 74.35h630.874a74.574 74.574 0 0 0 74.35-74.35V196.563a74.574 74.574 0 0 0-74.35-74.35zm52.09 705.225a52.09 52.09 0 0 1-52.09 52.09H196.563a52.09 52.09 0 0 1-52.09-52.09V196.563a52.09 52.09 0 0 1 52.09-52.09h630.874a52.09 52.09 0 0 1 52.09 52.09z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-static-text"><path d="M213.333 160c-4.821 0-9.472.64-13.824 1.792a32 32 0 0 1-16.554-61.824C192.683 97.408 202.88 96 213.333 96h33.195a32 32 0 0 1 0 64h-33.195zm133.931-32a32 32 0 0 1 32-32h66.347a32 32 0 1 1 0 64h-66.304a32 32 0 0 1-32-32zm199.125 0a32 32 0 0 1 32-32h66.347a32 32 0 0 1 0 64h-66.347a32 32 0 0 1-32-32zm199.083 0a32 32 0 0 1 32-32h33.195c10.453 0 20.65 1.365 30.378 3.968a32 32 0 1 1-16.554 61.867A53.419 53.419 0 0 0 810.667 160h-33.195a32 32 0 0 1-32-32zm-606.293 32.341a32 32 0 0 1 22.613 39.168A53.461 53.461 0 0 0 160 213.333v33.195a32 32 0 0 1-64 0v-33.195c0-10.453 1.365-20.65 3.968-30.378a32 32 0 0 1 39.168-22.614zm745.685 0a32 32 0 0 1 39.168 22.614c2.56 9.728 3.968 19.925 3.968 30.378v33.195a32 32 0 0 1-64 0v-33.195c0-4.821-.64-9.472-1.792-13.824a32 32 0 0 1 22.613-39.168zM128 347.221a32 32 0 0 1 32 32v66.39a32 32 0 1 1-64 0v-66.304a32 32 0 0 1 32-32zm768 0a32 32 0 0 1 32 32v66.39a32 32 0 1 1-64 0v-66.304a32 32 0 0 1 32-32zM128 546.432a32 32 0 0 1 32 32v66.347a32 32 0 0 1-64 0v-66.347a32 32 0 0 1 32-32zm768 0a32 32 0 0 1 32 32v66.347a32 32 0 0 1-64 0v-66.347a32 32 0 0 1 32-32zm0 199.083a32 32 0 0 1 32 32v33.152c0 10.453-1.365 20.65-3.968 30.378a32 32 0 1 1-61.867-16.554c1.195-4.352 1.835-8.96 1.835-13.824v-33.195a32 32 0 0 1 32-32zm-768 0a32 32 0 0 1 32 32v33.152c0 4.821.64 9.472 1.792 13.824a32 32 0 0 1-61.824 16.512A117.461 117.461 0 0 1 96 810.667v-33.195a32 32 0 0 1 32-32zm32.341 139.392a32 32 0 0 1 39.168-22.656 53.814 53.814 0 0 0 13.824 1.792h33.195a32 32 0 0 1 0 64h-33.195c-10.453 0-20.65-1.366-30.378-3.968a32 32 0 0 1-22.614-39.168zm703.318 0a32 32 0 0 1-22.614 39.168c-9.728 2.56-19.925 3.968-30.378 3.968h-33.195a32 32 0 0 1 0-64h33.195c4.821 0 9.472-.64 13.824-1.792a32 32 0 0 1 39.168 22.613zM347.307 896a32 32 0 0 1 32-32h66.346a32 32 0 1 1 0 64h-66.346a32 32 0 0 1-32-32zm199.125 0a32 32 0 0 1 32-32h66.347a32 32 0 0 1 0 64h-66.347a32 32 0 0 1-32-32zM341.333 352a32 32 0 0 0 0 64H480v266.667a32 32 0 0 0 64 0V416h138.667a32 32 0 0 0 0-64H341.333z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-sub-form"><path d="M512 106.667H112a5.333 5.333 0 0 0-5.333 5.333v800a5.333 5.333 0 0 0 5.333 5.333h800a5.333 5.333 0 0 0 5.333-5.333V112a5.333 5.333 0 0 0-5.333-5.333zm0 74.666h325.333a5.333 5.333 0 0 1 5.334 5.334v160a5.333 5.333 0 0 1-5.334 5.333H186.667a5.333 5.333 0 0 1-5.334-5.333v-160a5.333 5.333 0 0 1 5.334-5.334zM597.333 432v405.333a5.333 5.333 0 0 1-5.333 5.334H432a5.333 5.333 0 0 1-5.333-5.334V432a5.333 5.333 0 0 1 5.333-5.333h160a5.333 5.333 0 0 1 5.333 5.333zm-410.666-5.333h160A5.333 5.333 0 0 1 352 432v405.333a5.333 5.333 0 0 1-5.333 5.334h-160a5.333 5.333 0 0 1-5.334-5.334V432a5.333 5.333 0 0 1 5.334-5.333zM672 837.333V432a5.333 5.333 0 0 1 5.333-5.333h160a5.333 5.333 0 0 1 5.334 5.333v405.333a5.333 5.333 0 0 1-5.334 5.334h-160a5.333 5.333 0 0 1-5.333-5.334z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-switch-field"><path d="M692 792H332C182 792 62 672 62 522s120-270 270-270h360c150 0 270 120 270 270 0 147-120 270-270 270zM332 312c-117 0-210 93-210 210s93 210 210 210h360c117 0 210-93 210-210s-93-210-210-210H332z" /><path d="M191 522a150 150 0 1 0 300 0 150 150 0 1 0-300 0z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-tab"><path d="M908.8 1005.44H115.2A101.76 101.76 0 0 1 14.08 903.68V110.72A101.76 101.76 0 0 1 115.2 8.96h296.96a32.64 32.64 0 0 1 32 32V262.4a32 32 0 0 1-32 32 32 32 0 0 1-32-32v-192H115.2a37.76 37.76 0 0 0-37.12 37.76v795.52a37.76 37.76 0 0 0 37.12 37.76h793.6a37.76 37.76 0 0 0 37.12-37.76V267.52a32 32 0 0 1 32-32 32 32 0 0 1 32 32v636.16a101.76 101.76 0 0 1-101.12 101.76z" /><path d="M977.92 299.52a32.64 32.64 0 0 1-32-32v-87.04a37.12 37.12 0 0 0-37.12-37.76H421.12a32 32 0 0 1-32-32 32 32 0 0 1 32-32H908.8a101.76 101.76 0 0 1 101.12 101.76v87.04a32 32 0 0 1-32 32z" /><path d="M977.92 299.52H64a32 32 0 0 1-32-32 32 32 0 0 1 32-32h913.92a32 32 0 0 1 32 32 32 32 0 0 1-32 32z" /><path d="M699.52 299.52a32 32 0 0 1-32-32v-156.8a32 32 0 0 1 64 0v156.8a32 32 0 0 1-32 32z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-table"><path d="M925.586 0H101.369C69.885 0 42.24 28.924 42.24 62.328v902.8c0 33.403 27.645 58.872 59.129 58.872h824.217c31.484 0 56.057-25.469 56.057-58.873V62.328C981.643 28.924 957.198 0 925.586 0zM373.719 735.908V543.932h276.445v191.976zm276.445 42.235v203.494H373.719V778.143zm287.964-276.446h-244.45V298.203h244.45zm-287.964 0H373.719V298.203h276.445zm-319.96 0H85.754V298.203h244.45zm-244.45 42.235h244.45v191.976H85.754zm607.925 0h244.449v191.976h-244.45zM101.369 42.235h824.217c7.807 0 12.542 10.366 12.542 20.093v193.64H85.755V62.328c0-9.727 7.807-20.093 15.614-20.093zM85.755 964.999V778.143h244.449v203.494H101.369c-7.807 0-15.614-6.91-15.614-16.51zm839.83 16.638H693.68V778.143h244.449v186.856c0 9.727-4.607 16.638-12.542 16.638z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-text-field"><path d="M896 224H128c-35.2 0-64 28.8-64 64v448c0 35.2 28.8 64 64 64h768c35.2 0 64-28.8 64-64V288c0-35.2-28.8-64-64-64zm0 480c0 19.2-12.8 32-32 32H160c-19.2 0-32-12.8-32-32V320c0-19.2 12.8-32 32-32h704c19.2 0 32 12.8 32 32v384z" /><path d="M224 352c-19.2 0-32 12.8-32 32v256c0 16 12.8 32 32 32s32-12.8 32-32V384c0-16-12.8-32-32-32z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-textarea-field"><path d="M896.4 173.1H128.9c-35.2 0-49 13.8-49 49v575.6c0 35.2 13.8 49 49 49h767.5c35.2 0 49-13.8 49-49V222.1c0-35.2-13.8-49-49-49zm0 592.6c0 16-12.8 32-32 32H160.9c-19.2 0-32-12.8-32-32V254.1c0-16 12.8-32 32-32h703.5c19.2 0 32 12.8 32 32v511.6z" /><path d="M710.2 766.7h141.5c8.1 0 14.7-6.6 14.7-14.7V610.4c0-1.3-1.6-2-2.6-1.1L709.1 764.1c-1 1-.3 2.6 1.1 2.6zm-503-172.4h-13.5c-10 0-18.2-8.2-18.2-18.2V291.8c0-10.2 8.4-18.6 18.6-18.6h12.8c10.2 0 18.6 8.4 18.6 18.6v284.3c-.1 10-8.3 18.2-18.3 18.2z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-time-field"><path d="M512 39.385A472.615 472.615 0 1 0 984.615 512 472.615 472.615 0 0 0 512 39.385zm0 866.461A393.846 393.846 0 1 1 905.846 512 393.846 393.846 0 0 1 512 905.846zm75.855-373.72A77.154 77.154 0 0 0 590.769 512a78.454 78.454 0 0 0-39.384-67.86V196.923a39.385 39.385 0 0 0-78.77 0V444.14a78.336 78.336 0 0 0 59.55 143.715l70.144 70.144a39.385 39.385 0 0 0 55.69-55.69zM512 551.385A39.385 39.385 0 1 1 551.385 512 39.385 39.385 0 0 1 512 551.385zm315.077-78.77A39.385 39.385 0 1 0 866.462 512a39.385 39.385 0 0 0-39.385-39.385zm-630.154 0A39.385 39.385 0 1 0 236.308 512a39.385 39.385 0 0 0-39.385-39.385zm509.991 234.3a39.385 39.385 0 1 0 55.69 0 39.385 39.385 0 0 0-55.69 0zM317.007 317.006a39.385 39.385 0 1 0-55.73 0 39.385 39.385 0 0 0 55.809.04zM512 787.692a39.385 39.385 0 1 0 39.385 39.385A39.385 39.385 0 0 0 512 787.692zm-250.604-80.778a39.385 39.385 0 1 0 55.69 0 39.385 39.385 0 0 0-55.69-.039zm445.518-445.518a39.385 39.385 0 1 0 55.69 0 39.385 39.385 0 0 0-55.69-.04z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-time-range-field"><path d="M498.596 482.29H345.42v57.308h210.478V274.197h-57.301V482.29zm79.089 162.695h379.88v57.302h-379.88v-57.302zm0 128.78h379.88v57.307h-379.88v-57.307zm0 128.785h379.88v57.307h-379.88V902.55zm0 0" /><path d="M102.523 382.29a28.668 28.668 0 0 0 23.367 2.56l190.81-61.886c15.053-4.883 23.298-21.04 18.415-36.09-4.882-15.052-21.04-23.297-36.093-18.415l-123.346 40c15.994-26.117 35.17-50.538 57.37-72.745 73.768-73.767 171.847-114.388 276.169-114.388 104.32 0 202.395 40.622 276.161 114.388S899.77 407.56 899.77 511.882c0 26.428-2.616 52.45-7.71 77.78h58.303c4.465-25.499 6.709-51.47 6.709-77.78 0-60.45-11.846-119.102-35.205-174.336-22.56-53.335-54.85-101.227-95.969-142.35-41.122-41.122-89.017-73.408-142.348-95.968-55.233-23.361-113.89-35.207-174.334-35.207-60.45 0-119.107 11.846-174.337 35.208-53.335 22.56-101.23 54.846-142.35 95.969-23.98 23.98-44.933 50.278-62.727 78.6l-20.738-105.654c-3.043-15.528-18.105-25.642-33.632-22.6-15.528 3.048-25.643 18.105-22.6 33.637l36.103 183.932a28.666 28.666 0 0 0 13.588 19.178zm23.497 205.652H67.768c5.76 33.679 15.368 66.544 28.79 98.278 22.56 53.334 54.85 101.225 95.972 142.348 41.123 41.123 89.014 73.409 142.349 95.969 54.112 22.888 111.518 34.711 170.668 35.182v-57.324c-102.95-.941-199.595-41.446-272.5-114.349-55.501-55.502-92.237-124.77-107.027-200.104zm0 0" /></symbol><symbol class="icon" viewBox="0 0 1280 1024"  id="icon-tree"><path d="M292.058 791.091H510.49a26.24 26.24 0 0 1 0 52.467H266.035a26.214 26.214 0 0 1-26.406-26.048V318.963h-26.125a26.406 26.406 0 0 1-26.342-26.342V187.917a26.368 26.368 0 0 1 26.342-26.33h104.704c14.554 0 26.342 11.815 26.342 26.33V292.62a26.342 26.342 0 0 1-26.342 26.342H292.07V511.31h218.432a26.227 26.227 0 0 1 0 52.454H292.058v227.328zm157.376-603.174c0-14.541 10.636-26.33 23.692-26.33h596.058c13.069 0 23.667 11.815 23.667 26.33V292.62c0 14.553-10.611 26.342-23.667 26.342H473.126c-13.068 0-23.667-11.789-23.692-26.342V187.917zM622.08 485.184c0-14.54 10.496-26.342 23.667-26.342h423.437c13.069 0 23.667 11.827 23.667 26.342v104.704c0 14.554-10.483 26.342-23.667 26.342h-423.45c-13.056-.012-23.641-11.801-23.667-26.342V485.184zm0 279.782c0-14.553 10.496-26.342 23.667-26.342h423.437c13.069 0 23.667 11.827 23.667 26.342v104.717c0 14.541-10.483 26.33-23.667 26.33h-423.45c-13.056-.013-23.641-11.802-23.667-26.33V764.966z" /><path d="M292.058 757.517H510.49a26.24 26.24 0 1 1 0 52.467H266.035a26.227 26.227 0 0 1-26.406-26.06V285.375h-26.125a26.394 26.394 0 0 1-26.342-26.33V154.33a26.368 26.368 0 0 1 26.342-26.343h104.704c14.554 0 26.342 11.815 26.342 26.343v104.716a26.342 26.342 0 0 1-26.342 26.33H292.07v192.346h218.432a26.24 26.24 0 0 1 0 52.467H292.058v227.328zM449.434 154.342c0-14.54 10.636-26.342 23.692-26.342h596.058c13.069 0 23.667 11.814 23.667 26.342V259.06c0 14.541-10.611 26.33-23.667 26.33H473.126c-13.068 0-23.667-11.789-23.692-26.33V154.342zM622.08 451.61c0-14.541 10.496-26.343 23.667-26.343h423.437c13.069 0 23.667 11.815 23.667 26.343v104.716c0 14.541-10.483 26.33-23.667 26.33h-423.45c-13.056-.013-23.641-11.802-23.667-26.33V451.61zm0 279.782c0-14.54 10.496-26.342 23.667-26.342h423.437c13.069 0 23.667 11.827 23.667 26.342v104.717c0 14.553-10.483 26.33-23.667 26.33h-423.45c-13.056-.013-23.641-11.79-23.667-26.33V731.392z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-undo"><path d="M609.206 396.656H193.504l201.87-199.152c17.787-17.787 17.787-43.185 0-60.973s-41.555-18.641-59.42-.778L62.857 402.557c-17.787 17.787-17.787 41.399 0 59.186L336.03 728.858c17.787 17.787 41.555 17.787 59.42-.078 17.787-17.787 17.787-41.166 0-58.953L193.502 474.326h415.702c166.219 0 311.155 129.712 311.155 290.029v41.555c0 23.769 15.069 41.555 38.836 41.555s38.836-17.787 38.836-41.555v-41.555c0-207.852-175.073-367.7-388.828-367.7z" /></symbol><symbol class="icon" viewBox="0 0 1026 1024"  id="icon-vf-dialog"><defs><style>@font-face{font-family:"feedback-iconfont";src:url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944) format("woff2"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944) format("woff"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944) format("truetype")}</style></defs><path d="M897.024 0q26.624 0 49.664 10.24t40.448 27.648 27.648 40.448 10.24 49.664v576.512q0 26.624-10.24 49.664t-27.648 40.448-40.448 27.648-49.664 10.24h-128v-128h63.488q26.624 0 45.568-18.432t18.944-45.056V320.512q0-26.624-18.944-45.568T832.512 256h-512q-26.624 0-45.568 18.944T256 320.512V384H128V128q0-26.624 10.24-49.664t27.648-40.448 40.448-27.648T256 0h641.024zM576.512 448.512q26.624 0 49.664 10.24t40.448 27.648 27.648 40.448 10.24 49.664v256q0 26.624-10.24 49.664t-27.648 40.448-40.448 27.648-49.664 10.24h-384q-26.624 0-50.176-10.24t-40.96-27.648-27.648-40.448-10.24-49.664v-256q0-26.624 10.24-49.664t27.648-40.448 40.96-27.648 50.176-10.24h384zm0 256q0-26.624-18.944-45.056T512 641.024H256q-26.624 0-45.056 18.432t-18.432 45.056v64.512q0 26.624 18.432 45.056T256 832.512h256q26.624 0 45.568-18.432t18.944-45.056v-64.512z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-vf-drawer"><defs><style>@font-face{font-family:"feedback-iconfont";src:url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff2?t=1630033759944) format("woff2"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.woff?t=1630033759944) format("woff"),url(//at.alicdn.com/t/font_1031158_u69w8yhxdu.ttf?t=1630033759944) format("truetype")}</style></defs><path d="M128 765.952q0 26.624 18.432 45.056t45.056 18.432h191.488v128H128q-26.624 0-49.664-10.24t-40.448-27.648-27.648-40.448T0 829.44V191.488q0-25.6 10.24-49.152t27.648-40.448 40.448-27.136T128 64.512h701.44q26.624 0 49.664 10.24t40.448 27.136 27.648 40.448 10.24 49.152v251.904l-128 1.024v-61.44q0-26.624-18.432-45.056t-45.056-18.432H191.488q-26.624 0-45.056 18.432T128 382.976v382.976zm862.208-60.416q21.504 18.432 22.016 34.304t-20.992 33.28q-21.504 18.432-51.2 41.472t-60.928 48.128-61.952 49.152-55.296 43.52q-26.624 20.48-43.52 15.36t-16.896-31.744q1.024-16.384 0-40.448t-1.024-41.472q0-19.456-10.752-24.064t-31.232-4.608q-21.504 0-39.936-.512t-35.84-.512-36.352-.512-41.472-.512q-9.216 0-19.968-2.048t-19.456-7.168-14.336-15.36-5.632-27.648v-80.896q0-31.744 15.36-42.496T508.928 640q30.72 1.024 61.44 1.024t71.68 1.024q29.696 0 46.08-5.12t16.384-25.6q-1.024-14.336.512-35.328t1.536-37.376q0-26.624 14.336-33.28t36.864 10.752q22.528 18.432 52.736 43.008t61.952 50.688 62.976 51.2 54.784 44.544z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-vue-sfc"><path d="M454.138 11.176 54.066 174.092c-72.088 29.49-72.088 120.523 0 150.014l400.276 162.916c36.454 14.95 78.847 14.95 115.506 0l400.071-162.814c72.191-29.593 72.089-120.83-.307-150.116L569.746 11.278a155.339 155.339 0 0 0-115.608-.205zm469.19 237.872L532.37 408.585l-7.885 2.457a55.09 55.09 0 0 1-32.562-2.457L100.35 249.048l391.265-159.23a55.09 55.09 0 0 1 40.447 0l391.162 159.23z" fill="#1890FF" /><path d="M498.681 729.911c-20.275 0-40.652-3.788-59.391-11.673L53.76 561.26C20.48 547.847 0 519.89 0 488.558c0-31.436 20.582-59.391 53.862-72.703l36.556-15.053c21.401-8.806 47.103-1.024 57.24 17.408 10.24 18.227 1.025 40.14-20.479 48.947l-36.454 14.95c-3.072 1.229-4.71 3.584-4.71 6.45 0 3.073 1.536 5.12 4.71 6.452l385.326 156.875c14.336 5.939 30.924 5.939 45.362 0L906.74 495.009c3.072-1.229 4.915-3.584 4.915-6.451 0-3.072-1.536-5.222-4.607-6.451l-44.851-18.227c-21.401-8.806-30.412-30.72-20.377-48.947 10.342-18.329 35.84-26.214 57.24-17.407l44.851 18.431c33.177 13.517 53.76 41.267 53.76 72.703 0 31.334-20.48 59.391-53.76 72.703L558.482 718.238a161.585 161.585 0 0 1-59.801 11.673z" fill="#5DE1C8" /><path d="M498.681 966.247c-20.275 0-40.652-3.89-59.391-11.673L53.76 797.597C20.48 784.08 0 756.227 0 724.997c0-31.437 20.582-59.494 53.862-72.806l36.556-14.95c21.401-8.807 47.103-1.024 57.24 17.407 10.24 18.227 1.025 40.14-20.479 48.947l-36.454 14.95c-3.072 1.126-4.71 3.584-4.71 6.451 0 3.072 1.536 5.12 4.71 6.349l385.326 156.977c14.336 5.939 30.924 5.939 45.362 0L906.74 731.14c3.072-1.126 4.915-3.584 4.915-6.349 0-3.072-1.536-5.324-4.607-6.45l-44.851-18.33c-21.401-8.806-30.412-30.72-20.377-48.947 10.342-18.431 35.84-26.214 57.24-17.407l44.851 18.329c33.177 13.517 53.76 41.369 53.76 72.703 0 31.436-20.48 59.494-53.76 72.805l-385.428 157.08a161.585 161.585 0 0 1-59.801 11.673z" fill="#FF7272" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-custom-search"><path d="M863.3 641.94A416.1 416.1 0 0 0 96.7 318.06a416.1 416.1 0 0 0 766.6 323.88zM480 832a352 352 0 1 1 248.9-103.1A349.69 349.69 0 0 1 480 832z" /><path d="m950.63 841.37-96-96a32 32 0 0 0-45.25 45.25l96 96a13.25 13.25 0 1 1-18.75 18.75l-96-96a32 32 0 0 0-45.25 45.25l96 96a77.25 77.25 0 1 0 109.25-109.25z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-arrow-down"><path d="M512 714.667c-8.533 0-17.067-2.134-23.467-8.534L147.2 364.8c-12.8-12.8-12.8-32 0-44.8 12.8-12.8 32-12.8 44.8 0l320 317.867 317.867-320c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8L533.333 704c-4.266 8.533-12.8 10.667-21.333 10.667z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-back"><path fill="currentColor" d="M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64z" /><path fill="currentColor" d="m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312L237.248 512z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-chart"><path d="M503.339 42.773a8.533 8.533 0 0 1 8.469 6.699l.192 1.856v366.805A93.867 93.867 0 0 0 605.867 512h366.805c4.715 0 8.533 3.84 8.533 8.533v.15c-.106 5.674-.213 10.176-.384 13.504C969.237 783.104 763.776 981.333 512 981.333 252.8 981.333 42.667 771.2 42.667 512c0-251.627 198.016-457.003 446.72-468.8l12.096-.384 1.856-.043zm-61.739 76.48-6.144 1.131C251.435 156.117 113.066 318.251 113.066 512c0 220.33 178.603 398.933 398.934 398.933 193.984 0 355.627-138.453 391.51-321.92l1.215-6.613H605.867a164.267 164.267 0 0 1-164.182-159.061l-.085-5.206v-298.88zm149.333-69.76h.726l9.13 1.622c2.56.469 4.822.896 6.827 1.301l2.859.597c182.229 38.912 325.269 183.595 361.792 366.699l2.154 11.925a8.533 8.533 0 0 1-6.954 9.835l-1.451.128H629.333a46.933 46.933 0 0 1-46.805-43.584l-.128-3.37V58.025a8.533 8.533 0 0 1 8.533-8.533zm62.144 93.803a4.267 4.267 0 0 0-.298 1.557v222.059a4.28 4.28 0 0 0 4.266 4.267h222.08a4.267 4.267 0 0 0 3.968-5.824 400.512 400.512 0 0 0-224.49-224.47 4.267 4.267 0 0 0-5.547 2.411z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-clone"><path d="M774.144 839.68c-.683 36.864-13.483 67.755-38.4 92.672s-55.808 37.717-92.672 38.4H184.32c-36.864-.683-67.755-13.483-92.672-38.4s-37.717-55.808-38.4-92.672V380.928c.683-36.864 13.483-67.755 38.4-92.672s55.808-37.717 92.672-38.4v65.536c-18.432.683-33.792 7.168-46.08 19.456s-18.773 27.648-19.456 46.08V839.68c.683 18.432 7.168 33.792 19.456 46.08s27.648 18.773 46.08 19.456h458.752c18.432-.683 33.792-7.168 46.08-19.456s18.773-27.648 19.456-46.08h65.536zM380.928 118.784c-18.432.683-33.792 7.168-46.08 19.456s-18.773 27.648-19.456 46.08v458.752c.683 18.432 7.168 33.792 19.456 46.08s27.648 18.773 46.08 19.456H839.68c18.432-.683 33.792-7.168 46.08-19.456s18.773-27.648 19.456-46.08V184.32c-.683-18.432-7.168-33.792-19.456-46.08s-27.648-18.773-46.08-19.456H380.928zm0-65.536H839.68c36.864.683 67.755 13.483 92.672 38.4s37.717 55.808 38.4 92.672v458.752c-.683 36.864-13.483 67.755-38.4 92.672s-55.808 37.717-92.672 38.4H380.928c-36.864-.683-67.755-13.483-92.672-38.4s-37.717-55.808-38.4-92.672V184.32c.683-36.864 13.483-67.755 38.4-92.672s55.808-37.717 92.672-38.4z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-delete"><path fill="currentColor" d="M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-download"><path d="M896 672c-17.067 0-32 14.933-32 32v128c0 6.4-4.267 10.667-10.667 10.667H170.667c-6.4 0-10.667-4.267-10.667-10.667V704c0-17.067-14.933-32-32-32s-32 14.933-32 32v128c0 40.533 34.133 74.667 74.667 74.667h682.666C893.867 906.667 928 872.533 928 832V704c0-17.067-14.933-32-32-32z" /><path d="M488.533 727.467c6.4 6.4 14.934 8.533 23.467 8.533s17.067-2.133 23.467-8.533L748.8 514.133c12.8-12.8 12.8-32 0-44.8-12.8-12.8-32-12.8-44.8 0L546.133 627.2V170.667c0-17.067-14.933-32-32-32S480 153.6 480 170.667V627.2L322.133 469.333c-12.8-12.8-32-12.8-44.8 0-12.8 12.8-12.8 32 0 44.8l211.2 213.334z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-drag-move"><path d="M909.3 506.3 781.7 405.6c-4.7-3.7-11.7-.4-11.7 5.7V476H548V254h64.8c6 0 9.4-7 5.7-11.7L517.7 114.7c-2.9-3.7-8.5-3.7-11.3 0L405.6 242.3c-3.7 4.7-.4 11.7 5.7 11.7H476v222H254v-64.8c0-6-7-9.4-11.7-5.7L114.7 506.3c-3.7 2.9-3.7 8.5 0 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h222v222h-64.8c-6 0-9.4 7-5.7 11.7l100.8 127.5c2.9 3.7 8.5 3.7 11.3 0l100.8-127.5c3.7-4.7.4-11.7-5.7-11.7H548V548h222v64.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.7-2.9 3.7-8.5.1-11.4z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-form-template"><path d="M298.667 981.333A85.333 85.333 0 0 1 213.333 896V128a85.333 85.333 0 0 1 85.334-85.333h426.666A85.333 85.333 0 0 1 810.667 128v768a85.333 85.333 0 0 1-85.334 85.333zm0-832v725.334A21.333 21.333 0 0 0 320 896h384a21.333 21.333 0 0 0 21.333-21.333V149.333A21.333 21.333 0 0 0 704 128H320a21.333 21.333 0 0 0-21.333 21.333zm640 618.667V256a42.667 42.667 0 0 1 42.666-42.667A42.667 42.667 0 0 1 1024 256v512a42.667 42.667 0 0 1-42.667 42.667A42.667 42.667 0 0 1 938.667 768zM0 768V256a42.667 42.667 0 0 1 42.667-42.667A42.667 42.667 0 0 1 85.333 256v512a42.667 42.667 0 0 1-42.666 42.667A42.667 42.667 0 0 1 0 768z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-hide"><path d="M956.8 496c-41.6-70.4-99.2-147.2-176-204.8l105.6-105.6c12.8-12.8 12.8-32 0-44.8s-32-12.8-44.8 0L726.4 256C665.6 214.4 592 192 512 192c-214.4 0-358.4 166.4-444.8 304-6.4 9.6-6.4 22.4 0 32 41.6 70.4 102.4 147.2 176 204.8L134.4 841.6c-12.8 12.8-12.8 32 0 44.8 9.6 6.4 16 9.6 25.6 9.6s16-3.2 22.4-9.6l115.2-115.2C358.4 809.6 432 832 512 832c185.6 0 374.4-128 444.8-307.2 3.2-9.6 3.2-19.2 0-28.8zm-822.4 16C211.2 390.4 336 256 512 256c60.8 0 118.4 16 166.4 44.8l-80 80C576 361.6 544 352 512 352c-89.6 0-160 70.4-160 160 0 32 9.6 64 25.6 89.6L288 691.2C224 640 172.8 572.8 134.4 512zm473.6 0c0 54.4-41.6 96-96 96-16 0-28.8-3.2-41.6-9.6l128-128c6.4 12.8 9.6 25.6 9.6 41.6zm-192 0c0-54.4 41.6-96 96-96 16 0 28.8 3.2 41.6 9.6l-128 128c-6.4-12.8-9.6-25.6-9.6-41.6zm96 256c-60.8 0-118.4-16-166.4-44.8l80-80C448 662.4 480 672 512 672c89.6 0 160-70.4 160-160 0-32-9.6-64-25.6-89.6l89.6-89.6C803.2 384 854.4 451.2 892.8 512 825.6 659.2 665.6 768 512 768z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-info"><path d="M512.001 928.997c230.524 0 418.076-187.552 418.075-418.077 0-230.527-187.552-418.077-418.075-418.077S93.924 280.393 93.924 510.92c0 230.525 187.552 418.077 418.077 418.077zM512 301.88c28.86 0 52.26 23.399 52.26 52.263 0 28.858-23.399 52.257-52.26 52.257s-52.26-23.399-52.26-52.257c0-28.863 23.399-52.263 52.26-52.263zm-52.26 209.042c0-28.86 23.399-52.26 52.26-52.26s52.26 23.399 52.26 52.26v156.775c0 28.86-23.399 52.26-52.26 52.26s-52.26-23.399-52.26-52.26V510.922z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-insert-column"><path d="M653.184 713.6c12.864-12.864 33.6-12.864 46.528 0 6.4 6.4 3.776 14.72 3.776 23.232a32.675 32.675 0 0 1-9.6 23.104L569.92 886.4c-.128.128-.32.192-.512.32-2.88 2.88-9.536 5.184-13.312 6.784-3.456 1.344-.64 1.856-4.096 2.112-.768 0-1.344.384-2.048.384-.512 0-.896-.256-1.344-.256-3.84-.192-5.76-.896-9.344-2.24-3.264-1.344-6.016-3.52-8.64-5.76-.64-.512-1.472-.768-2.048-1.344L391.232 760c-12.864-12.736-6.976-33.6 5.888-46.4 12.8-12.864 33.6-12.864 46.464 0l105.472 100.352L653.184 713.6zM384 64v576h320V64H384zM128 704v256H64V640h256v320h-62.976L256 704H128m704 0v256h-64V640h256v320h-62.976L960 704H832" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-insert-row"><path d="M310.336 653.184c12.864 12.864 12.864 33.6 0 46.528-6.4 6.4-14.72 3.776-23.168 3.776s-16.832-3.264-23.168-9.6L137.6 569.92c-.128-.128-.192-.32-.256-.512-2.88-2.816-5.248-9.536-6.848-13.312-1.344-3.392-1.856-.576-2.112-4.096 0-.768-.384-1.344-.384-2.048 0-.512.256-.896.256-1.344.192-3.84.896-5.76 2.24-9.344 1.344-3.264 3.52-6.016 5.76-8.64.512-.704.768-1.536 1.344-2.112l126.336-137.344c12.8-12.864 33.6-6.976 46.4 5.888 12.864 12.8 12.864 33.6 0 46.464L210.048 548.992l100.288 104.192zM960 384H384v320h576V384zM320 128H64V64h320v256H64v-62.976L320 256V128m0 704H64v-64h320v256H64v-62.976L320 960V832" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-menu"><path d="M844.8 883.2h-256c-19.2 0-38.4-19.2-38.4-38.4v-256c0-19.2 19.2-38.4 38.4-38.4h256c19.2 0 38.4 19.2 38.4 38.4v256c0 19.2-19.2 38.4-38.4 38.4zm0-403.2h-256c-19.2 0-38.4-19.2-38.4-38.4v-256c0-19.2 19.2-38.4 38.4-38.4h256c19.2 0 38.4 19.2 38.4 38.4v256c0 19.2-19.2 38.4-38.4 38.4zM435.2 883.2h-256c-19.2 0-38.4-19.2-38.4-38.4v-256c0-19.2 19.2-38.4 38.4-38.4h256c19.2 0 38.4 19.2 38.4 38.4v256c6.4 19.2-12.8 38.4-38.4 38.4zm0-403.2h-256c-19.2 0-38.4-19.2-38.4-38.4v-256c0-19.2 19.2-38.4 38.4-38.4h256c19.2 0 38.4 19.2 38.4 38.4v256c6.4 19.2-12.8 38.4-38.4 38.4z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-module"><path d="m511.92 991.84-3.84-1.92L31.92 752.38V271.46l480-239.42 3.84 1.92 476.16 237.5v480.92l-480 239.46zM90.355 716.343l392.328 195.744v-381.97L90.355 338.853v377.49zM511.92 97.195 124.393 290.539 511.92 479.483l387.527-188.944L511.92 97.195zm421.565 241.66L541.157 530.117v381.968l392.328-195.744V338.855zm-288.936 234.22 197.144-96.152a29.598 29.598 0 0 1 39.117 13.4 29.198 29.198 0 0 1-13.4 38.996l-197.184 96.152a29.397 29.397 0 0 1-39.076-13.359 29.198 29.198 0 0 1 13.4-39.037zM366.452 628.39a29.198 29.198 0 0 1-12.76-2.92L156.43 529.28a29.157 29.157 0 0 1-13.4-38.997 29.758 29.758 0 0 1 39.078-13.399l197.223 96.152a29.198 29.198 0 0 1-12.879 55.355z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-move-down"><path d="M898.133 512c-12.8-12.8-32-12.8-44.8-2.133L544 800V149.333c0-17.066-14.933-32-32-32s-32 14.934-32 32V800L170.667 509.867c-12.8-12.8-34.134-10.667-44.8 2.133-12.8 12.8-10.667 34.133 2.133 44.8l362.667 341.333c2.133 2.134 6.4 4.267 8.533 6.4 4.267 2.134 6.4 2.134 10.667 2.134s8.533 0 10.666-2.134c4.267-2.133 6.4-4.266 8.534-6.4L891.733 556.8c17.067-12.8 19.2-32 6.4-44.8z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-move-up"><path d="M896 467.2 533.333 125.867c-2.133-2.134-6.4-4.267-8.533-6.4-4.267-2.134-6.4-2.134-10.667-2.134s-8.533 0-10.666 2.134c-4.267 2.133-6.4 4.266-8.534 6.4L132.267 467.2c-12.8 12.8-12.8 32-2.134 44.8 12.8 12.8 32 12.8 44.8 2.133L484.267 224v650.667c0 17.066 14.933 32 32 32s32-14.934 32-32V224l305.066 290.133c6.4 6.4 14.934 8.534 21.334 8.534 8.533 0 17.066-4.267 23.466-10.667 12.8-12.8 10.667-32-2.133-44.8z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-plus"><path d="M554.667 213.333h-85.334v256h-256v85.334h256v256h85.334v-256h256v-85.334h-256z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-set-up"><path d="M217.088 151.552c-18.432.683-33.792 7.168-46.08 19.456s-18.773 27.648-19.456 46.08v589.824c.683 18.432 7.168 33.792 19.456 46.08s27.648 18.773 46.08 19.456h589.824c18.432-.683 33.792-7.168 46.08-19.456s18.773-27.648 19.456-46.08V217.088c-.683-18.432-7.168-33.792-19.456-46.08s-27.648-18.773-46.08-19.456H217.088zm0-65.536h589.824c36.864.683 67.755 13.483 92.672 38.4s37.717 55.808 38.4 92.672v589.824c-.683 36.864-13.483 67.755-38.4 92.672s-55.808 37.717-92.672 38.4H217.088c-36.864-.683-67.755-13.483-92.672-38.4s-37.717-55.808-38.4-92.672V217.088c.683-36.864 13.483-67.755 38.4-92.672s55.808-37.717 92.672-38.4zm163.84 327.68c18.432-.683 33.792-7.168 46.08-19.456s18.432-27.648 18.432-46.08-6.144-33.792-18.432-46.08-27.648-18.432-46.08-18.432-33.792 6.144-46.08 18.432-18.432 27.648-18.432 46.08 6.144 33.792 18.432 46.08 27.648 18.773 46.08 19.456zm0 65.536c-36.864-.683-67.755-13.483-92.672-38.4s-37.717-55.808-38.4-92.672c.683-36.864 13.483-67.755 38.4-92.672s55.808-37.717 92.672-38.4c36.864.683 67.755 13.483 92.672 38.4s37.717 55.808 38.4 92.672c-.683 36.864-13.483 67.755-38.4 92.672s-55.808 37.717-92.672 38.4zm98.304-163.84h262.144c21.845 0 32.768 10.923 32.768 32.768s-10.923 32.768-32.768 32.768H479.232c-21.845 0-32.768-10.923-32.768-32.768s10.923-32.768 32.768-32.768zm163.84 425.984c18.432-.683 33.792-7.168 46.08-19.456s18.432-27.648 18.432-46.08-6.144-33.792-18.432-46.08-27.648-18.432-46.08-18.432-33.792 6.144-46.08 18.432-18.432 27.648-18.432 46.08 6.144 33.792 18.432 46.08 27.648 18.773 46.08 19.456zm0 65.536c-36.864-.683-67.755-13.483-92.672-38.4s-37.717-55.808-38.4-92.672c.683-36.864 13.483-67.755 38.4-92.672s55.808-37.717 92.672-38.4c36.864.683 67.755 13.483 92.672 38.4s37.717 55.808 38.4 92.672c-.683 36.864-13.483 67.755-38.4 92.672s-55.808 37.717-92.672 38.4zm-360.448-163.84h262.144c21.845 0 32.768 10.923 32.768 32.768s-10.923 32.768-32.768 32.768H282.624c-21.845 0-32.768-10.923-32.768-32.768s10.923-32.768 32.768-32.768z" /></symbol><symbol class="icon" viewBox="0 0 1024 1024"  id="icon-el-view"><path fill="currentColor" d="M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z" /></symbol>';
      body.insertBefore(svgDom, body.firstChild);
    };
    if (document.readyState === "loading") {
      document.addEventListener("DOMContentLoaded", loadSvg);
    } else {
      loadSvg();
    }
  }
  var iconfont = "";
  function addDirective(app) {
    app.directive("drag", {
      mounted(el, binding) {
        if (!binding.value)
          return false;
        binding.instance.$nextTick(() => {
          const dragDom = document.querySelector(binding.value[0]);
          const dragHeader = document.querySelector(binding.value[1]);
          dragHeader.onmouseover = () => dragHeader.style.cursor = `move`;
          function down(e, type) {
            const disX = type === "pc" ? e.clientX - dragHeader.offsetLeft : e.touches[0].clientX - dragHeader.offsetLeft;
            const disY = type === "pc" ? e.clientY - dragHeader.offsetTop : e.touches[0].clientY - dragHeader.offsetTop;
            const screenWidth = document.body.clientWidth;
            const screenHeight = document.documentElement.clientHeight;
            const dragDomWidth = dragDom.offsetWidth;
            const dragDomheight = dragDom.offsetHeight;
            const minDragDomLeft = dragDom.offsetLeft;
            const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
            const minDragDomTop = dragDom.offsetTop;
            const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomheight;
            let styL = getComputedStyle(dragDom).left;
            let styT = getComputedStyle(dragDom).top;
            if (styL.includes("%")) {
              styL = +document.body.clientWidth * (+styL.replace(/%/g, "") / 100);
              styT = +document.body.clientHeight * (+styT.replace(/%/g, "") / 100);
            } else {
              styL = +styL.replace(/\px/g, "");
              styT = +styT.replace(/\px/g, "");
            }
            return {
              disX,
              disY,
              minDragDomLeft,
              maxDragDomLeft,
              minDragDomTop,
              maxDragDomTop,
              styL,
              styT
            };
          }
          function move(e, type, obj) {
            let { disX, disY, minDragDomLeft, maxDragDomLeft, minDragDomTop, maxDragDomTop, styL, styT } = obj;
            let left = type === "pc" ? e.clientX - disX : e.touches[0].clientX - disX;
            let top2 = type === "pc" ? e.clientY - disY : e.touches[0].clientY - disY;
            if (-left > minDragDomLeft) {
              left = -minDragDomLeft;
            } else if (left > maxDragDomLeft) {
              left = maxDragDomLeft;
            }
            if (-top2 > minDragDomTop) {
              top2 = -minDragDomTop;
            } else if (top2 > maxDragDomTop) {
              top2 = maxDragDomTop;
            }
            dragDom.style.cssText += `;left:${left + styL}px;top:${top2 + styT}px;`;
          }
          dragHeader.onmousedown = (e) => {
            const obj = down(e, "pc");
            document.onmousemove = (e2) => {
              move(e2, "pc", obj);
            };
            document.onmouseup = () => {
              document.onmousemove = null;
              document.onmouseup = null;
            };
          };
          dragHeader.ontouchstart = (e) => {
            const obj = down(e, "app");
            document.ontouchmove = (e2) => {
              move(e2, "app", obj);
            };
            document.ontouchend = () => {
              document.ontouchmove = null;
              document.ontouchend = null;
            };
          };
        });
      }
    });
    app.directive("dialogDragWidth", {
      mounted(el, binding) {
        binding.instance.$nextTick(() => {
          const dragDom = binding.value.$el.querySelector(".el-dialog");
          el.onmousedown = (e) => {
            const disX = e.clientX - el.offsetLeft;
            document.onmousemove = function(e2) {
              e2.preventDefault();
              const l = e2.clientX - disX;
              dragDom.style.width = `${l}px`;
            };
            document.onmouseup = function(e2) {
              document.onmousemove = null;
              document.onmouseup = null;
            };
          };
        });
      }
    });
  }
  function _isSlot(s) {
    return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !require$$0$1.isVNode(s);
  }
  const createInputTextEditor = function(propName, propLabelKey) {
    return {
      props: {
        optionModel: Object
      },
      render(h) {
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-input"), {
            "type": "text",
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event
          }, null)]
        });
      }
    };
  };
  const createInputNumberEditor = function(propName, propLabelKey) {
    return {
      props: {
        optionModel: Object
      },
      methods: {
        updateValue(newValue) {
          if (newValue === void 0 || newValue === null || isNaN(newValue)) {
            this.optionModel[propName] = null;
          } else {
            this.optionModel[propName] = Number(newValue);
          }
        }
      },
      render(h) {
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-input-number"), {
            "type": "text",
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event,
            "onChange": this.updateValue,
            "style": "width: 100%"
          }, null)]
        });
      }
    };
  };
  const createBooleanEditor = function(propName, propLabelKey) {
    return {
      props: {
        optionModel: Object
      },
      render(h) {
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-switch"), {
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event
          }, null)]
        });
      }
    };
  };
  const createCheckboxGroupEditor = function(propName, propLabelKey, configs) {
    return {
      props: {
        optionModel: Object
      },
      render(h) {
        let _slot;
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-checkbox-group"), {
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event
          }, _isSlot(_slot = configs.optionItems.map((item) => {
            return require$$0$1.createVNode(require$$0$1.resolveComponent("el-checkbox"), {
              "label": item.value
            }, {
              default: () => [item.label]
            });
          })) ? _slot : {
            default: () => [_slot]
          })]
        });
      }
    };
  };
  const createRadioGroupEditor = function(propName, propLabelKey, configs) {
    return {
      props: {
        optionModel: Object
      },
      render(h) {
        let _slot2;
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-radio-group"), {
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event
          }, _isSlot(_slot2 = configs.optionItems.map((item) => {
            return require$$0$1.createVNode(require$$0$1.resolveComponent("el-radio"), {
              "label": item.value
            }, {
              default: () => [item.label]
            });
          })) ? _slot2 : {
            default: () => [_slot2]
          })]
        });
      }
    };
  };
  const createRadioButtonGroupEditor = function(propName, propLabelKey, configs) {
    return {
      props: {
        optionModel: Object
      },
      render(h) {
        let _slot3;
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": translate(propLabelKey)
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-radio-group"), {
            "modelValue": this.optionModel[propName],
            "onUpdate:modelValue": ($event) => this.optionModel[propName] = $event
          }, _isSlot(_slot3 = configs.optionItems.map((item) => {
            return require$$0$1.createVNode(require$$0$1.resolveComponent("el-radio-button"), {
              "label": item.value
            }, {
              default: () => [item.label]
            });
          })) ? _slot3 : {
            default: () => [_slot3]
          })]
        });
      }
    };
  };
  const createSelectEditor = function(propName, propLabelKey, configs) {
    return {
      template: `
    <el-form-item :label="propLabel">
      <el-select v-model="optionModel.${propName}">
        <el-option v-for="item in optionItems" :key="item.value" :label="item.label"
                   :value="item.value">
        </el-option>
      </el-select>
    </el-form-item>
  `,
      props: {
        designer: Object,
        selectedWidget: Object,
        optionModel: Object
      },
      data() {
        return {
          optionItems: configs.optionItems,
          propLabel: translate(propLabelKey)
        };
      }
    };
  };
  const createEventHandlerEditor = function(eventPropName, eventParams) {
    return {
      props: {
        optionModel: Object
      },
      mixins: [emitter],
      methods: {
        editEventHandler() {
          this.dispatch("SettingPanel", "editEventHandler", [eventPropName, [...eventParams]]);
        }
      },
      render(h) {
        let _slot4;
        return require$$0$1.createVNode(require$$0$1.resolveComponent("el-form-item"), {
          "label": eventPropName,
          "label-width": "150px"
        }, {
          default: () => [require$$0$1.createVNode(require$$0$1.resolveComponent("el-button"), {
            "type": "info",
            "icon": "el-icon-edit",
            "plain": true,
            "round": true,
            "onClick": this.editEventHandler
          }, _isSlot(_slot4 = translate("designer.setting.addEventHandler")) ? _slot4 : {
            default: () => [_slot4]
          })]
        });
      }
    };
  };
  const createEmptyEditor = function() {
    return {
      render() {
        return require$$0$1.createVNode("div", {
          "style": "display: none"
        }, null);
      }
    };
  };
  var PEFactory = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
    __proto__: null,
    createInputTextEditor,
    createInputNumberEditor,
    createBooleanEditor,
    createCheckboxGroupEditor,
    createRadioGroupEditor,
    createRadioButtonGroupEditor,
    createSelectEditor,
    createEventHandlerEditor,
    createEmptyEditor
  }, Symbol.toStringTag, { value: "Module" }));
  const cardSchema = {
    type: "card",
    category: "container",
    icon: "card",
    commonFlag: true,
    widgetList: [],
    options: {
      name: "",
      label: "card",
      hidden: false,
      headerHidden: false,
      folded: false,
      showFold: true,
      cardWidth: "100%",
      shadow: "never",
      customClass: ""
    }
  };
  const alertSchema = {
    type: "alert",
    icon: "alert",
    formItemFlag: false,
    options: {
      name: "",
      title: "Good things are coming...",
      type: "info",
      description: "",
      closable: true,
      closeText: "",
      center: true,
      showIcon: false,
      effect: "light",
      hidden: false,
      onClose: "",
      customClass: ""
    }
  };
  var cardWidget_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$2 = {
    name: "card-widget",
    componentName: "ContainerWidget",
    mixins: [i18n$1, containerMixin, refMixinDesign],
    inject: ["refList"],
    components: __spreadProps(__spreadValues({
      ContainerWrapper
    }, comps$1), {
      ArrowDown: ElementPlusIconsVue.ArrowDown,
      ArrowUp: ElementPlusIconsVue.ArrowUp
    }),
    props: {
      widget: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object
    },
    computed: {
      selected() {
        return this.widget.id === this.designer.selectedId;
      },
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
      this.initRefList();
    },
    methods: {
      checkContainerMove(evt) {
        return true;
      },
      toggleCard() {
        this.widget.options.folded = !this.widget.options.folded;
      },
      setFolded(folded) {
        this.widget.options.folded = !!folded;
      }
    }
  };
  const _hoisted_1 = { class: "form-widget-list" };
  function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_ArrowDown = require$$0$1.resolveComponent("ArrowDown");
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_ArrowUp = require$$0$1.resolveComponent("ArrowUp");
    const _component_draggable = require$$0$1.resolveComponent("draggable");
    const _component_el_card = require$$0$1.resolveComponent("el-card");
    const _component_container_wrapper = require$$0$1.resolveComponent("container-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_wrapper, {
      designer: $props.designer,
      widget: $props.widget,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_card, {
          class: require$$0$1.normalizeClass(["card-container", [$options.selected ? "selected" : "", !!$props.widget.options.folded ? "folded" : "", $options.customClass]]),
          onClick: _cache[3] || (_cache[3] = require$$0$1.withModifiers(($event) => _ctx.selectWidget($props.widget), ["stop"])),
          shadow: $props.widget.options.shadow,
          style: require$$0$1.normalizeStyle({ width: $props.widget.options.cardWidth + "!important" || "" })
        }, require$$0$1.createSlots({
          default: require$$0$1.withCtx(() => [
            require$$0$1.createVNode(_component_draggable, require$$0$1.mergeProps({
              list: $props.widget.widgetList,
              "item-key": "id"
            }, { group: "dragGroup", ghostClass: "ghost", animation: 400 }, {
              handle: ".drag-handler",
              tag: "div",
              "component-data": { name: "fade", class: "drag-drop-zone" },
              onAdd: _cache[2] || (_cache[2] = (evt) => _ctx.onContainerDragAdd(evt, $props.widget.widgetList)),
              onUpdate: _ctx.onContainerDragUpdate,
              move: $options.checkContainerMove
            }), {
              item: require$$0$1.withCtx(({ element: subWidget, index: swIdx }) => [
                require$$0$1.createElementVNode("div", _hoisted_1, [
                  subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                    widget: subWidget,
                    designer: $props.designer,
                    key: subWidget.id,
                    "parent-list": $props.widget.widgetList,
                    "index-of-parent-list": swIdx,
                    "parent-widget": $props.widget
                  }, null, 8, ["widget", "designer", "parent-list", "index-of-parent-list", "parent-widget"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                    field: subWidget,
                    designer: $props.designer,
                    key: subWidget.id,
                    "parent-list": $props.widget.widgetList,
                    "index-of-parent-list": swIdx,
                    "parent-widget": $props.widget,
                    "design-state": true
                  }, null, 8, ["field", "designer", "parent-list", "index-of-parent-list", "parent-widget"]))
                ])
              ]),
              _: 1
            }, 16, ["list", "onUpdate", "move"])
          ]),
          _: 2
        }, [
          !$props.widget.options.headerHidden ? {
            name: "header",
            fn: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", {
                class: "clear-fix",
                onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleCard && $options.toggleCard(...args))
              }, [
                require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString($props.widget.options.label), 1),
                $props.widget.options.showFold ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("i", {
                  key: 0,
                  class: "float-right",
                  onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers((...args) => $options.toggleCard && $options.toggleCard(...args), ["stop"]))
                }, [
                  !$props.widget.options.folded ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_icon, { key: 0 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_ArrowDown)
                    ]),
                    _: 1
                  })) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_icon, { key: 1 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_ArrowUp)
                    ]),
                    _: 1
                  }))
                ])) : require$$0$1.createCommentVNode("", true)
              ])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["shadow", "style", "class"])
      ]),
      _: 1
    }, 8, ["designer", "widget", "parent-widget", "parent-list", "index-of-parent-list"]);
  }
  var CardWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-511b2d7e"]]);
  var cardItem_vue_vue_type_style_index_0_scoped_true_lang = "";
  const _sfc_main$1 = {
    name: "card-item",
    componentName: "ContainerItem",
    mixins: [emitter, i18n$1, refMixin, containerItemMixin],
    components: __spreadProps(__spreadValues({
      ContainerItemWrapper
    }, comps$1), {
      ArrowDown: ElementPlusIconsVue.ArrowDown,
      ArrowUp: ElementPlusIconsVue.ArrowUp
    }),
    props: {
      widget: Object,
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    inject: ["refList", "sfRefList", "globalModel"],
    computed: {
      customClass() {
        return this.widget.options.customClass || "";
      }
    },
    created() {
      this.initRefList();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      toggleCard() {
        if (!this.widget.options.showFold) {
          return;
        }
        this.widget.options.folded = !this.widget.options.folded;
      }
    }
  };
  function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_ArrowDown = require$$0$1.resolveComponent("ArrowDown");
    const _component_el_icon = require$$0$1.resolveComponent("el-icon");
    const _component_ArrowUp = require$$0$1.resolveComponent("ArrowUp");
    const _component_el_card = require$$0$1.resolveComponent("el-card");
    const _component_container_item_wrapper = require$$0$1.resolveComponent("container-item-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_container_item_wrapper, { widget: $props.widget }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.withDirectives(require$$0$1.createVNode(_component_el_card, {
          class: require$$0$1.normalizeClass(["card-container", [!!$props.widget.options.folded ? "folded" : "", $options.customClass]]),
          shadow: $props.widget.options.shadow,
          style: require$$0$1.normalizeStyle({ width: $props.widget.options.cardWidth + "!important" || "" }),
          ref: $props.widget.id
        }, require$$0$1.createSlots({
          default: require$$0$1.withCtx(() => [
            !!$props.widget.widgetList && $props.widget.widgetList.length > 0 ? (require$$0$1.openBlock(true), require$$0$1.createElementBlock(require$$0$1.Fragment, { key: 0 }, require$$0$1.renderList($props.widget.widgetList, (subWidget, swIdx) => {
              return require$$0$1.openBlock(), require$$0$1.createElementBlock(require$$0$1.Fragment, null, [
                subWidget.category === "container" ? (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(_ctx.getComponentByContainer(subWidget)), {
                  widget: subWidget,
                  key: swIdx,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget,
                  "sub-form-row-id": $props.subFormRowId,
                  "sub-form-row-index": $props.subFormRowIndex,
                  "sub-form-col-index": $props.subFormColIndex
                }, require$$0$1.createSlots({ _: 2 }, [
                  require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                    return {
                      name: slot,
                      fn: require$$0$1.withCtx((scope) => [
                        require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                      ])
                    };
                  })
                ]), 1032, ["widget", "parent-list", "index-of-parent-list", "parent-widget", "sub-form-row-id", "sub-form-row-index", "sub-form-col-index"])) : (require$$0$1.openBlock(), require$$0$1.createBlock(require$$0$1.resolveDynamicComponent(subWidget.type + "-widget"), {
                  field: subWidget,
                  designer: null,
                  key: swIdx,
                  "parent-list": $props.widget.widgetList,
                  "index-of-parent-list": swIdx,
                  "parent-widget": $props.widget
                }, require$$0$1.createSlots({ _: 2 }, [
                  require$$0$1.renderList(Object.keys(_ctx.$slots), (slot) => {
                    return {
                      name: slot,
                      fn: require$$0$1.withCtx((scope) => [
                        require$$0$1.renderSlot(_ctx.$slots, slot, require$$0$1.normalizeProps(require$$0$1.guardReactiveProps(scope)), void 0, true)
                      ])
                    };
                  })
                ]), 1032, ["field", "parent-list", "index-of-parent-list", "parent-widget"]))
              ], 64);
            }), 256)) : require$$0$1.createCommentVNode("", true)
          ]),
          _: 2
        }, [
          !$props.widget.options.headerHidden ? {
            name: "header",
            fn: require$$0$1.withCtx(() => [
              require$$0$1.createElementVNode("div", {
                class: "clear-fix",
                onClick: _cache[1] || (_cache[1] = (...args) => $options.toggleCard && $options.toggleCard(...args))
              }, [
                require$$0$1.createElementVNode("span", null, require$$0$1.toDisplayString($props.widget.options.label), 1),
                $props.widget.options.showFold ? (require$$0$1.openBlock(), require$$0$1.createElementBlock("span", {
                  key: 0,
                  class: "float-right",
                  onClick: _cache[0] || (_cache[0] = require$$0$1.withModifiers((...args) => $options.toggleCard && $options.toggleCard(...args), ["stop"]))
                }, [
                  !$props.widget.options.folded ? (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_icon, { key: 0 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_ArrowDown)
                    ]),
                    _: 1
                  })) : (require$$0$1.openBlock(), require$$0$1.createBlock(_component_el_icon, { key: 1 }, {
                    default: require$$0$1.withCtx(() => [
                      require$$0$1.createVNode(_component_ArrowUp)
                    ]),
                    _: 1
                  }))
                ])) : require$$0$1.createCommentVNode("", true)
              ])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["class", "shadow", "style"]), [
          [require$$0$1.vShow, !$props.widget.options.hidden]
        ])
      ]),
      _: 3
    }, 8, ["widget"]);
  }
  var CardItem = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-0438f4d3"]]);
  const cardTemplateGenerator = function(cw, formConfig2, vue3Flag = false) {
    const wop = cw.options;
    const classAttr = buildClassAttr(cw);
    const styleAttr = !!wop.cardWidth ? `style="{width: ${wop.cardWidth} !important}"` : "";
    const shadowAttr = `shadow="${wop.shadow}"`;
    const vShowAttr = !!wop.hidden ? `v-show="false"` : "";
    const cardTemplate = `<div class="card-container">
  <el-card ${classAttr} ${styleAttr} ${shadowAttr} ${vShowAttr}>
    <template #header>
      <div class="clear-fix">
        <span>${wop.label}</span>
        ${!!wop.showFold ? `<i class="float-right el-icon-arrow-down"></i>` : ""}
      </div>
    </template>
    ${cw.widgetList.map((wItem) => {
      if (wItem.category === "container") {
        return buildContainerWidget(wItem, formConfig2, vue3Flag);
      } else {
        return buildFieldWidget(wItem, formConfig2, vue3Flag);
      }
    }).join("")}
  </el-card>
</div>`;
    return cardTemplate;
  };
  const alertTemplateGenerator = function(fw, formConfig2, vue3Flag = false) {
    const wop = fw.options;
    const titleAttr = `title="${wop.title}"`;
    const typeAttr = `type=${wop.type}`;
    const descriptionAttr = !!wop.description ? `description="${wop.description}"` : "";
    const closableAttr = `:closable="${wop.closable}"`;
    const closeTextAttr = !!wop.closeText ? `close-text="${wop.closeText}"` : "";
    const centerAttr = `:center="${wop.center}"`;
    const showIconAttr = `:show-icon="${wop.showIcon}"`;
    const effectAttr = `effect="${wop.effect}"`;
    const alertTemplate = `<el-alert ${titleAttr} ${typeAttr} ${descriptionAttr} ${closableAttr} ${closeTextAttr} ${centerAttr} 
  ${showIconAttr} ${effectAttr}>
</el-alert>`;
    return alertTemplate;
  };
  const _sfc_main = {
    name: "alert-widget",
    componentName: "FieldWidget",
    mixins: [emitter, fieldMixin, i18n$1],
    props: {
      field: Object,
      parentWidget: Object,
      parentList: Array,
      indexOfParentList: Number,
      designer: Object,
      designState: {
        type: Boolean,
        default: false
      },
      subFormRowIndex: {
        type: Number,
        default: -1
      },
      subFormColIndex: {
        type: Number,
        default: -1
      },
      subFormRowId: {
        type: String,
        default: ""
      }
    },
    components: {
      StaticContentWrapper
    },
    created() {
      this.registerToRefList();
      this.initEventHandler();
    },
    beforeUnmount() {
      this.unregisterFromRefList();
    },
    methods: {
      handleCloseCustomEvent() {
        if (!!this.field.options.onClose) {
          let changeFn = new Function(this.field.options.onClose);
          changeFn.call(this);
        }
      }
    }
  };
  function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
    const _component_el_alert = require$$0$1.resolveComponent("el-alert");
    const _component_static_content_wrapper = require$$0$1.resolveComponent("static-content-wrapper");
    return require$$0$1.openBlock(), require$$0$1.createBlock(_component_static_content_wrapper, {
      designer: $props.designer,
      field: $props.field,
      "design-state": $props.designState,
      "parent-widget": $props.parentWidget,
      "parent-list": $props.parentList,
      "index-of-parent-list": $props.indexOfParentList,
      "sub-form-row-index": $props.subFormRowIndex,
      "sub-form-col-index": $props.subFormColIndex,
      "sub-form-row-id": $props.subFormRowId
    }, {
      default: require$$0$1.withCtx(() => [
        require$$0$1.createVNode(_component_el_alert, {
          ref: "fieldEditor",
          title: $props.field.options.title,
          type: $props.field.options.type,
          description: $props.field.options.description,
          closable: $props.field.options.closable,
          center: $props.field.options.center,
          "close-text": $props.field.options.closeText,
          "show-icon": $props.field.options.showIcon,
          effect: $props.field.options.effect,
          onClose: $options.handleCloseCustomEvent
        }, null, 8, ["title", "type", "description", "closable", "center", "close-text", "show-icon", "effect", "onClose"])
      ]),
      _: 1
    }, 8, ["designer", "field", "design-state", "parent-widget", "parent-list", "index-of-parent-list", "sub-form-row-index", "sub-form-col-index", "sub-form-row-id"]);
  }
  var AlertWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
  const loadExtension = function(app) {
    addContainerWidgetSchema(cardSchema);
    app.component(CardWidget.name, CardWidget);
    app.component(CardItem.name, CardItem);
    registerCPEditor(app, "card-headerHidden", "card-headerHidden-editor", createBooleanEditor("headerHidden", "extension.setting.headerHidden"));
    registerCPEditor(app, "card-folded", "card-folded-editor", createBooleanEditor("folded", "extension.setting.cardFolded"));
    registerCPEditor(app, "card-showFold", "card-showFold-editor", createBooleanEditor("showFold", "extension.setting.cardShowFold"));
    registerCPEditor(app, "card-cardWidth", "card-cardWidth-editor", createInputTextEditor("cardWidth", "extension.setting.cardWidth"));
    let shadowOptions = [
      { label: "never", value: "never" },
      { label: "hover", value: "hover" },
      { label: "always", value: "always" }
    ];
    registerCPEditor(app, "card-shadow", "card-shadow-editor", createSelectEditor("shadow", "extension.setting.cardShadow", { optionItems: shadowOptions }));
    registerCWGenerator("card", cardTemplateGenerator);
    addCustomWidgetSchema(alertSchema);
    app.component(AlertWidget.name, AlertWidget);
    registerCPEditor(app, "alert-title", "alert-title-editor", createInputTextEditor("title", "extension.setting.alertTitle"));
    let typeOptions = [
      { label: "success", value: "success" },
      { label: "warning", value: "warning" },
      { label: "info", value: "info" },
      { label: "error", value: "error" }
    ];
    app.component("alert-type-editor", createSelectEditor("type", "extension.setting.alertType", { optionItems: typeOptions }));
    registerCPEditor(app, "alert-description", "alert-description-editor", createInputTextEditor("description", "extension.setting.description"));
    registerCPEditor(app, "alert-closable", "alert-closable-editor", createBooleanEditor("closable", "extension.setting.closable"));
    registerCPEditor(app, "alert-closeText", "alert-closeText-editor", createInputTextEditor("closeText", "extension.setting.closeText"));
    registerCPEditor(app, "alert-center", "alert-center-editor", createBooleanEditor("center", "extension.setting.center"));
    registerCPEditor(app, "alert-showIcon", "alert-showIcon-editor", createBooleanEditor("showIcon", "extension.setting.showIcon"));
    let effectOptions = [
      { label: "light", value: "light" },
      { label: "dark", value: "dark" }
    ];
    registerCPEditor(app, "alert-effect", "alert-effect-editor", createRadioButtonGroupEditor("effect", "extension.setting.effect", { optionItems: effectOptions }));
    registerEPEditor(app, "alert-onClose", "alert-onClose-editor", createEventHandlerEditor("onClose", []));
    registerFWGenerator("alert", alertTemplateGenerator);
  };
  VFormDesigner.install = function(app) {
    addDirective(app);
    loadExtension(app);
    app.use(ContainerWidgets);
    app.use(ContainerItems);
    registerIcon(app);
    app.component("draggable", Draggable);
    app.component(VFormDesigner.name, VFormDesigner);
    app.component(TableMultiLevelColumn.name, TableMultiLevelColumn);
    app.component(TableHighLevelColumn.name, TableHighLevelColumn);
  };
  VFormRender.install = function(app) {
    loadExtension(app);
    app.use(ContainerItems);
    registerIcon(app);
    app.component(VFormRender.name, VFormRender);
    app.component(TableHighLevelColumn.name, TableHighLevelColumn);
  };
  const components = [
    VFormDesigner,
    VFormRender,
    TableMultiLevelColumn,
    TableHighLevelColumn
  ];
  const install = (app) => {
    addDirective(app);
    loadExtension(app);
    app.use(ContainerWidgets);
    app.use(ContainerItems);
    registerIcon(app);
    app.component("draggable", Draggable);
    components.forEach((component) => {
      app.component(component.name, component);
    });
    window.axios = axios;
  };
  const VFormSDK = {
    addContainerWidgetSchema,
    addBasicFieldSchema,
    addAdvancedFieldSchema,
    addCustomWidgetSchema,
    addChartContainerSchema,
    addChartSchema,
    PERegister,
    PEFactory,
    registerCWGenerator,
    registerFWGenerator,
    addZHExtensionLang,
    addENExtensionLang,
    i18n: i18n$1,
    Utils,
    containerMixin,
    Draggable,
    ContainerWrapper,
    FieldComponents: comps$1,
    refMixinDesign,
    ContainerItemWrapper,
    containerItemMixin,
    refMixin,
    StaticContentWrapper,
    FormItemWrapper,
    emitter,
    fieldMixin,
    eventMixin
  };
  var install$1 = {
    install,
    VFormDesigner,
    VFormRender,
    VFormSDK
  };
  return install$1;
});
