{"version":3,"sources":["jsdelivr-header.js","/npm/sharon-docsify-customize@1.0.5/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,OAAO,SAAS,SAAW,CACzB,SAAU,CAER,aAAc,WAEZ,IAAI,EAAW,SAAS,KAWxB,OAVI,EAAS,WAAW,OACtB,EAAW,EAAS,OAAO,IAE7B,IAAM,EAAS,YAAY,MACf,GAAR,MACF,EAAW,EAAS,OAAO,EAAG,IAAM,IAElC,EAAS,WAAW,OACtB,EAAW,EAAS,OAAO,IAEtB,CACT,EAEA,KAAM,SAAc,GAClB,IAAI,EAAM,EAAS,YAAY,KAC/B,OAAY,GAAR,EACK,EAAS,OAAO,EAAG,EAAM,GAE3B,EAAW,GACpB,EAEA,KAAM,SAAU,GAUd,OARK,EAAK,SAAS,QAAW,EAAK,WAAW,YAAe,EAAK,WAAW,cACvE,EAAK,WAAW,MAClB,EAAO,EAAK,OAAO,GACnB,EAAO,SAAS,OAAS,KAAK,KAAK,SAAS,UAAY,GAExD,EAAO,SAAS,OAAS,KAAK,KAAK,SAAS,UAAY,KAAK,eAAiB,GAG3E,KAAK,OAAO,KAAK,MAAM,KAAM,UACtC,EAEA,KAAM,SAAU,GAEd,IAAI,EAAY,IAAI,UACpB,IAAM,EAAU,gBAAgB,eAAiB,EAAO,iBAAkB,aAC1E,IAAI,EAAO,IAAI,iBAAiB,OAChC,OAAK,EAAK,QAIV,EAAK,SAAQ,IACX,IAAI,EAAM,EAAI,aAAa,OAE3B,GAAI,EAAI,WAAW,YAAc,EAAI,WAAW,aAAe,EAAI,WAAW,KAC5E,OAGF,IAAI,EAAW,KAAK,eACpB,EAAI,aAAa,MAAO,EAAW,EAAG,IAEjC,IAAI,cAAc,QAAQ,YAb/B,QAAQ,IAAI,GACL,EAaX","file":"/npm/sharon-docsify-customize@1.0.5/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/sharon-docsify-customize@1.0.5/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","window.$docsify.markdown = {\r\n  renderer: {\r\n    // 自定义函数，从 hash 中获取相对路径\r\n    relativePath: function () {\r\n      // 从 hash 获取需要加上的路径\r\n      let relative = location.hash\r\n      if (relative.startsWith('#')) {\r\n        relative = relative.substr(1)\r\n      }\r\n      idx = relative.lastIndexOf('/')\r\n      if (idx != -1) {\r\n        relative = relative.substr(0, idx + 1)\r\n      }\r\n      if (relative.startsWith('/')) {\r\n        relative = relative.substr(1)\r\n      }\r\n      return relative\r\n    },\r\n    // 删除到斜杠\r\n    path: function path(pathname) {\r\n      let idx = pathname.lastIndexOf('/')\r\n      if (idx != -1) {\r\n        return pathname.substr(0, idx + 1)\r\n      }\r\n      return pathname + '/'\r\n    },\r\n    // 解决非markdown链接路径问题\r\n    link: function (href) {\r\n      // 用绝对路径，否则默认处理后有问题\r\n      if (!href.endsWith('.md') && !href.startsWith('http://') && !href.startsWith('https://')) {\r\n        if (href.startsWith('/')) {\r\n          href = href.substr(1)\r\n          href = location.origin + this.path(location.pathname) + href\r\n        } else {\r\n          href = location.origin + this.path(location.pathname) + this.relativePath() + href\r\n        }\r\n      }\r\n      return this.origin.link.apply(this, arguments)\r\n    },\r\n    // 处理 img 标签路径问题\r\n    html: function (html) {\r\n      // 处理 hash 情况下 html 中 img 相对路径\r\n      let domParser = new DOMParser()\r\n      dom = domParser.parseFromString('<html><body>' + html + '</body></html>', 'text/html')\r\n      let imgs = dom.querySelectorAll('img')\r\n      if (!imgs.length) {\r\n        console.log(html)\r\n        return html\r\n      }\r\n      imgs.forEach(img => {\r\n        let src = img.getAttribute('src')\r\n        // 绝对路径不处理\r\n        if (src.startsWith('http://') || src.startsWith('https://') || src.startsWith('/')) {\r\n          return\r\n        }\r\n        // 从 hash 获取需要加上的路径\r\n        let relative = this.relativePath()\r\n        img.setAttribute('src', relative + src)\r\n      })\r\n      return dom.querySelector('body').innerHTML\r\n    }\r\n  }\r\n}\r\n"]}