/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/

(function initCjs() {
  // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
  const globalThisRecord = globalThis;
  globalThisRecord['__name'] ??= name;
  const originalRequire = require;
  if (originalRequire && !originalRequire.__isPatched) {
    // eslint-disable-next-line no-global-assign, no-implicit-globals -- We need to patch the `require()` function.
    require = Object.assign(
      (id) => requirePatched(id),
      originalRequire,
      {
        __isPatched: true
      }
    );
  }

  const newFuncs = {
    __extractDefault() {
      return extractDefault;
    },
    process() {
      const browserProcess = {
        browser: true,
        cwd() {
          return '/';
        },
        env: {},
        platform: 'android'
      };
      return browserProcess;
    }
  };

  for (const key of Object.keys(newFuncs)) {
    globalThisRecord[key] ??= newFuncs[key]?.();
  }

  function name(obj) {
    return obj;
  }

  function extractDefault(module) {
    return module && module.__esModule && 'default' in module ? module.default : module;
  }

  const OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  'obsidian',
  '@codemirror/autocomplete',
  '@codemirror/collab',
  '@codemirror/commands',
  '@codemirror/language',
  '@codemirror/lint',
  '@codemirror/search',
  '@codemirror/state',
  '@codemirror/text',
  '@codemirror/view',
  '@lezer/common',
  '@lezer/lr',
  '@lezer/highlight'];


  const DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES = [
  '@codemirror/closebrackets',
  '@codemirror/comment',
  '@codemirror/fold',
  '@codemirror/gutter',
  '@codemirror/highlight',
  '@codemirror/history',
  '@codemirror/matchbrackets',
  '@codemirror/panel',
  '@codemirror/rangeset',
  '@codemirror/rectangular-selection',
  '@codemirror/stream-parser',
  '@codemirror/tooltip'];


  function requirePatched(id) {
    if (OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id) || DEPRECATED_OBSIDIAN_BUILT_IN_MODULE_NAMES.includes(id)) {
      return originalRequire?.(id);
    }

    // eslint-disable-next-line @typescript-eslint/no-deprecated, obsidianmd/no-global-this  -- Need access to app. Actively use globalThis.
    if (globalThis.app.isMobile) {
      if (id === 'process' || id === 'node:process') {
        // eslint-disable-next-line no-console -- Valid usage.
        console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Fake process object is returned instead.`);
        // eslint-disable-next-line obsidianmd/no-global-this -- Actively use globalThis.
        return globalThis.process;
      }
    } else {
      const module = originalRequire?.(id);
      if (module) {
        return extractDefault(module);
      }
    }

    // eslint-disable-next-line no-console -- Valid usage.
    console.debug(`The most likely you can safely ignore this error. Module not found: ${id}. Empty object is returned instead.`);
    return {};
  }
})();

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var set_transformer_exports = {};
__export(set_transformer_exports, {
  SetTransformer: () => SetTransformer
});
module.exports = __toCommonJS(set_transformer_exports);
var import_typed_transformer = require('./typed-transformer.cjs');
class SetTransformer extends import_typed_transformer.TypedTransformer {
  /**
   * An id of the transformer.
   *
   * @returns The ID of the transformer.
   */
  get id() {
    return "set";
  }
  /**
   * Checks if the value is a Set.
   *
   * @param value - The value to check.
   * @returns `true` if the value is a Set, `false` otherwise.
   */
  canTransform(value) {
    return value instanceof Set;
  }
  /**
   * Restores the value from an array.
   *
   * @param transformedValue - The array to restore the value from.
   * @returns The restored value.
   */
  restoreValue(transformedValue) {
    return new Set(transformedValue);
  }
  /**
   * Transforms the value to an array.
   *
   * @param value - The value to transform.
   * @returns The transformed value.
   */
  transformValue(value) {
    return Array.from(value);
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  SetTransformer
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3RyYW5zZm9ybWVycy9zZXQtdHJhbnNmb3JtZXIudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbIi8qKlxuICogQGZpbGVcbiAqXG4gKiBBIHRyYW5zZm9ybWVyIHRoYXQgY2FuIHRyYW5zZm9ybSBhIFNldCB0byBhbiBhcnJheSBhbmQgYmFjay5cbiAqL1xuXG5pbXBvcnQgeyBUeXBlZFRyYW5zZm9ybWVyIH0gZnJvbSAnLi90eXBlZC10cmFuc2Zvcm1lci50cyc7XG5cbi8qKlxuICogQSB0cmFuc2Zvcm1lciB0aGF0IGNhbiB0cmFuc2Zvcm0gYSBTZXQgdG8gYW4gYXJyYXkgYW5kIGJhY2suXG4gKi9cbmV4cG9ydCBjbGFzcyBTZXRUcmFuc2Zvcm1lciBleHRlbmRzIFR5cGVkVHJhbnNmb3JtZXI8U2V0PHVua25vd24+LCB1bmtub3duW10+IHtcbiAgLyoqXG4gICAqIEFuIGlkIG9mIHRoZSB0cmFuc2Zvcm1lci5cbiAgICpcbiAgICogQHJldHVybnMgVGhlIElEIG9mIHRoZSB0cmFuc2Zvcm1lci5cbiAgICovXG4gIHB1YmxpYyBvdmVycmlkZSBnZXQgaWQoKTogc3RyaW5nIHtcbiAgICByZXR1cm4gJ3NldCc7XG4gIH1cblxuICAvKipcbiAgICogQ2hlY2tzIGlmIHRoZSB2YWx1ZSBpcyBhIFNldC5cbiAgICpcbiAgICogQHBhcmFtIHZhbHVlIC0gVGhlIHZhbHVlIHRvIGNoZWNrLlxuICAgKiBAcmV0dXJucyBgdHJ1ZWAgaWYgdGhlIHZhbHVlIGlzIGEgU2V0LCBgZmFsc2VgIG90aGVyd2lzZS5cbiAgICovXG4gIHB1YmxpYyBv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