/*
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 duration_transformer_exports = {};
__export(duration_transformer_exports, {
  DurationTransformer: () => DurationTransformer
});
module.exports = __toCommonJS(duration_transformer_exports);
var import_obsidian = require('obsidian');
var import_typed_transformer = require('./typed-transformer.cjs');
class DurationTransformer extends import_typed_transformer.TypedTransformer {
  /**
   * An id of the transformer.
   *
   * @returns The id of the transformer.
   */
  get id() {
    return "duration";
  }
  /**
   * Checks if the value is a Duration.
   *
   * @param value - The value to check.
   * @returns `true` if the value is a Duration, `false` otherwise.
   */
  canTransform(value) {
    const maybeDuration = value ?? {};
    return !!maybeDuration.asHours && !!maybeDuration.asMinutes && !!maybeDuration.asSeconds && !!maybeDuration.asMilliseconds;
  }
  /**
   * Restores the value from a string.
   *
   * @param transformedValue - The string to restore the value from.
   * @returns The restored value.
   */
  restoreValue(transformedValue) {
    return import_obsidian.moment.duration(transformedValue);
  }
  /**
   * Transforms the value to a string.
   *
   * @param value - The value to transform.
   * @returns The transformed value.
   */
  transformValue(value) {
    return value.toISOString();
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  DurationTransformer
});
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsiLi4vLi4vLi4vLi4vc3JjL3RyYW5zZm9ybWVycy9kdXJhdGlvbi10cmFuc2Zvcm1lci50cyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsiLyoqXG4gKiBAZmlsZVxuICpcbiAqIEEgdHJhbnNmb3JtZXIgdGhhdCBjYW4gdHJhbnNmb3JtIER1cmF0aW9uIHRvIGFuIElTTyBzdHJpbmcgYW5kIGJhY2suXG4gKi9cblxuaW1wb3J0IHsgbW9tZW50IH0gZnJvbSAnb2JzaWRpYW4nO1xuXG5pbXBvcnQgeyBUeXBlZFRyYW5zZm9ybWVyIH0gZnJvbSAnLi90eXBlZC10cmFuc2Zvcm1lci50cyc7XG5cbi8qKlxuICogQSB0cmFuc2Zvcm1lciB0aGF0IGNvbnZlcnRzIGEgRHVyYXRpb24gdG8gYW4gSVNPIHN0cmluZyBhbmQgYmFjay5cbiAqL1xuZXhwb3J0IGNsYXNzIER1cmF0aW9uVHJhbnNmb3JtZXIgZXh0ZW5kcyBUeXBlZFRyYW5zZm9ybWVyPG1vbWVudC5EdXJhdGlvbiwgc3RyaW5nPiB7XG4gIC8qKlxuICAgKiBBbiBpZCBvZiB0aGUgdHJhbnNmb3JtZXIuXG4gICAqXG4gICAqIEByZXR1cm5zIFRoZSBpZCBvZiB0aGUgdHJhbnNmb3JtZXIuXG4gICAqL1xuICBwdWJsaWMgb3ZlcnJpZGUgZ2V0IGlkKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuICdkdXJhdGlvbic7XG4gIH1cblxuICAvKipcbiAgICogQ2hlY2tzI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