{"version":3,"sources":["jsdelivr-header.js","/npm/html-assets-parser@1.0.0/src/attributesParser.js","/npm/html-assets-parser@1.0.0/src/replace.js","/npm/html-assets-parser@1.0.0/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,uJCJA,MAAM,aAAe,SAAsB,EAAO,EAAe,EAAM,EAAO,GACvE,KAAK,kBAAkB,KAAK,WAAY,IAC7C,KAAK,QAAQ,KAAK,CAChB,MAAO,EAAQ,EAAc,OAC7B,OAAQ,EAAM,OACd,S,EAIE,OAAS,IAAI,YAAO,CACxB,QAAS,CACP,oBAAc,EACd,mBAAmB,EACnB,eAAe,EACf,YAAY,EACZ,uBAAwB,SAAkB,EAAO,GAE/C,OADA,KAAK,WAAa,EACX,Q,GAGX,OAAQ,CACN,QAAQ,EACR,IAAK,UACL,yCAA0C,aAC1C,yCAA0C,aAC1C,0CAA2C,gBAI/C,IAAA,iBAAiB,SAAe,EAAM,GACpC,OAAO,OAAO,MAAM,UAAW,EAAM,CACnC,WAAY,KACZ,QAAS,GACT,sBACC,O,ECpCL,MAAM,KAAO,CACX,KAAM,EACN,IAAK,GAED,QAAU,SAAiB,EAAM,GACrC,IAAI,EAAS,EACb,MAAM,EAAQ,GAiBd,OAhBA,EAAY,SAAQ,EAAG,QAAO,SAAQ,YACpC,MAAM,EAAS,EAAK,MAAM,EAAQ,GAClC,EAAS,EAAQ,EACjB,EAAM,KAAK,CACT,KAAM,KAAK,KACX,KAAM,IAER,EAAM,KAAK,CACT,KAAM,KAAK,IACX,KAAM,GACN,IAEJ,EAAM,KAAK,CACT,KAAM,KAAK,KACX,KAAM,EAAK,MAAM,KAEZ,C,EAEH,IAAM,GAAa,EAAG,OAAM,UAC5B,IAAS,KAAK,KAAO,KAAQ,EACxB,EAAU,GAEZ,EAEH,QAAU,SAAiB,EAAM,EAAa,GAClD,GAAoB,iBAAT,EAAmB,MAAM,IAAI,UAAU,yBAElD,OADa,QAAQ,EAAM,GACf,IAAI,IAAI,IAAY,KAAK,G,EAEvC,IAAA,UAAiB,QCjCjB,MAAM,OAAS,CACb,OAAQ,MACR,IAAK,MACL,KAAM,OACN,IAAK,gBACL,IAAK,cAGP,IAAA,MAAiB,SAAe,EAAM,GACpC,MAAM,EAAc,iBAAU,GAAM,CAAC,EAAK,IAAS,OAAO,KAAS,IACnE,OAAO,UAAQ,EAAM,EAAa,E","file":"/npm/html-assets-parser@1.0.0/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/html-assets-parser@1.0.0/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","const Parser = require('fastparse');\n\nconst processMatch = function processMatch(match, strUntilValue, name, value, index) {\n  if (!this.isRelevantTagAttr(this.currentTag, name)) return;\n  this.results.push({\n    start: index + strUntilValue.length,\n    length: value.length,\n    value,\n  });\n};\n\nconst parser = new Parser({\n  outside: {\n    '<!--.*?-->': true,\n    '<![CDATA[.*?]]>': true,\n    '<[!\\\\?].*?>': true,\n    '</[^>]+>': true,\n    '<([a-zA-Z\\\\-:]+)\\\\s*': function matchTag(match, tagName) {\n      this.currentTag = tagName;\n      return 'inside';\n    },\n  },\n  inside: {\n    '\\\\s+': true, // eat up whitespace\n    '>': 'outside', // end of attributes\n    '(([0-9a-zA-Z\\\\-:]+)\\\\s*=\\\\s*\")([^\"]*)\"': processMatch,\n    \"(([0-9a-zA-Z\\\\-:]+)\\\\s*=\\\\s*')([^']*)'\": processMatch,\n    '(([0-9a-zA-Z\\\\-:]+)\\\\s*=\\\\s*)([^\\\\s>]+)': processMatch,\n  },\n});\n\nmodule.exports = function parse(html, isRelevantTagAttr) {\n  return parser.parse('outside', html, {\n    currentTag: null,\n    results: [],\n    isRelevantTagAttr,\n  }).results;\n};\n","const CODE = {\n  pass: 0,\n  pre: 1,\n};\nconst sliceUp = function sliceUp(text, replaceList) {\n  let cursor = 0;\n  const cache = [];\n  replaceList.forEach(({ start, length, value }) => {\n    const preStr = text.slice(cursor, start);\n    cursor = start + length;\n    cache.push({\n      code: CODE.pass,\n      text: preStr,\n    });\n    cache.push({\n      code: CODE.pre,\n      text: value,\n    });\n  });\n  cache.push({\n    code: CODE.pass,\n    text: text.slice(cursor),\n  });\n  return cache;\n};\nconst rev = sourceMap => ({ code, text }) => {\n  if (code === CODE.pre && text in sourceMap) {\n    return sourceMap[text];\n  }\n  return text;\n};\nconst replace = function replace(text, replaceList, sourceMap) {\n  if (typeof text !== 'string') throw new TypeError('text must be a string');\n  const list = sliceUp(text, replaceList);\n  return list.map(rev(sourceMap)).join('');\n};\nmodule.exports = replace;\n","const attrParse = require('./attributesParser');\nconst replace = require('./replace');\n\nconst tagMap = {\n  script: 'src',\n  img: 'src',\n  link: 'href',\n  div: 'data-videomp4',\n  use: 'xlink:href',\n};\n\nmodule.exports = function parse(html, sourceMap) {\n  const replaceList = attrParse(html, (tag, attr) => tagMap[tag] === attr);\n  return replace(html, replaceList, sourceMap);\n};\n"]}