{"version":3,"sources":["jsdelivr-header.js","/npm/@markedjs/html-differ@5.0.3/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,aAAgB,uBAClB,iCAAkC,2BAChC,aAAgB,uBAClB,gBAAiB,kBAExB,eAAe,kBAAkB,EAAM,GAErC,aADqB,6BAA6B,EAAM,IAC1C,MAAM,kDAAkD,QAAO,GAAK,GACpF,QAaO,MAAM,WACX,WAAA,CAAY,GACV,KAAK,QAAU,SAAS,EAC1B,CAUA,cAAM,CAAS,EAAO,GAGpB,MAAM,EAAS,CACb,YAAa,kBAAkB,EAAO,KAAK,SAC3C,YAAa,kBAAkB,EAAO,KAAK,UAOvC,EAJa,IAAI,SAAS,KAAK,QAAS,GAItB,KAAK,QAAS,QAAS,KAAK,SAEpD,OAAO,YAAY,EACrB,CAUA,aAAM,CAAQ,EAAO,GACnB,GAAI,IAAU,EACZ,OAAO,EAGT,MAAM,QAAa,KAAK,SAAS,EAAO,GAExC,OAAwB,IAAhB,EAAK,SAAiB,EAAK,GAAG,QAAU,EAAK,GAAG,OAC1D,EAGF,MAAM,WAAa,IAAI,kBAEhB,MAAM,SAAW,WAAW,SAAS,KAAK,mBAC1C,MAAM,QAAU,WAAW,QAAQ,KAAK","file":"/npm/@markedjs/html-differ@5.0.3/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@markedjs/html-differ@5.0.3/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { HtmlDiff } from './HtmlDiff.js';\nimport modifyHtmlAccordingToOptions from './utils/modify.js';\nimport { defaults } from './defaults.js';\nimport handleMasks from './utils/mask.js';\n\nasync function getModifiedTokens(html, options) {\n  const tokens = await modifyHtmlAccordingToOptions(html, options);\n  return tokens.split(/({{.+?}}(?!})|[{}\\(\\)\\[\\]#\\*`=:;,.<>\"'\\/]|\\s+)/).filter(i => i);\n}\n\n/**\n * @class HtmlDiffer\n * @constructor\n * @param {Object}   [options]\n * @param {String[]} [options.ignoreAttributes]\n * @param {String[]} [options.compareAttributesAsJSON]\n * @param {Boolean}  [options.ignoreWhitespaces=true]\n * @param {Boolean}  [options.ignoreComments=true]\n * @param {Boolean}  [options.ignoreEndTags=false]\n * @param {Boolean}  [options.ignoreSelfClosingSlash=false]\n */\nexport class HtmlDiffer {\n  constructor(options) {\n    this.options = defaults(options);\n  }\n\n  /**\n   * Returns the diff between two given chunks of HTML\n   * @class HtmlDiffer\n   * @method\n   * @param {String} html1\n   * @param {String} html2\n   * @returns {Diff}\n   */\n  async diffHtml(html1, html2) {\n    // precompute the tokenized html here, since it can't do it in `Diff.tokenize()` because\n    // the sax parser is async\n    const tokens = {\n      html1: await getModifiedTokens(html1, this.options),\n      html2: await getModifiedTokens(html2, this.options),\n    };\n\n    const htmlDiffer = new HtmlDiff(this.options, tokens);\n\n    // just pass in keys for the left and right html, the original strings are no longer used\n    // after tokenize()\n    const diff = htmlDiffer.diff('html1', 'html2', this.options);\n\n    return handleMasks(diff);\n  }\n\n  /**\n   * Compares two given chunks of HTML\n   * @class HtmlDiffer\n   * @method\n   * @param {String} html1\n   * @param {String} html2\n   * @returns {Boolean}\n   */\n  async isEqual(html1, html2) {\n    if (html1 === html2) {\n      return true;\n    }\n\n    const diff = await this.diffHtml(html1, html2);\n\n    return (diff.length === 1 && !diff[0].added && !diff[0].removed);\n  }\n}\n\nconst htmlDiffer = new HtmlDiffer();\n\nexport const diffHtml = htmlDiffer.diffHtml.bind(htmlDiffer);\nexport const isEqual = htmlDiffer.isEqual.bind(htmlDiffer);\n"]}