/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/hexo-butterfly-clock@1.0.7/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";const pluginname="butterfly_clock",pug=require("pug"),path=require("path"),urlFor=require("hexo-util").url_for.bind(hexo),util=require("hexo-util");hexo.extend.filter.register("after_generate",(function(e){const t=hexo.config.electric_clock?hexo.config.electric_clock:hexo.theme.config.electric_clock;if(!t||!t.enable)return;const i={enable_page:t.enable_page?t.enable_page:"all",exclude:t.exclude,layout_type:t.layout.type,layout_name:t.layout.name,layout_index:t.layout.index?t.layout.index:0,loading:t.loading?urlFor(t.loading):"https://unpkg.zhimg.com/hexo-butterfly-clock/lib/loading.gif",clock_css:t.clock_css?urlFor(t.clock_css):"https://unpkg.zhimg.com/hexo-butterfly-clock/lib/clock.min.css",clock_js:t.clock_js?urlFor(t.clock_js):"https://unpkg.zhimg.com/hexo-butterfly-clock/lib/clock.min.js",ip_api:t.ip_api?urlFor(t.ip_api):"https://pv.sohu.com/cityjson?ie=utf-8"},n=t.temple_html?t.temple_html:pug.renderFile(path.join(__dirname,"./lib/html.pug"),i),l=`<link rel="stylesheet" href="${i.clock_css}" />`,c=`<script src="${i.ip_api}"><\/script><script data-pjax src="${i.clock_js}"><\/script>`;var o=`<script data-pjax>\n  function ${pluginname}_injector_config(){\n    var parent_div_git = ${"class"===i.layout_type?`document.getElementsByClassName('${i.layout_name}')[${i.layout_index}]`:`document.getElementById('${i.layout_name}')`};\n    var item_html = '${n}';\n    console.log('已挂载${pluginname}')\n    parent_div_git.insertAdjacentHTML("afterbegin",item_html)\n    }\n  var elist = '${i.exclude}'.split(',');\n  var cpage = location.pathname;\n  var epage = '${i.enable_page}';\n  var flag = 0;\n\n  for (var i=0;i<elist.length;i++){\n    if (cpage.includes(elist[i])){\n      flag++;\n    }\n  }\n\n  if ((epage ==='all')&&(flag == 0)){\n    ${pluginname}_injector_config();\n  }\n  else if (epage === cpage){\n    ${pluginname}_injector_config();\n  }\n  <\/script>`;hexo.extend.injector.register("body_end",o,"default"),hexo.extend.injector.register("body_end",c,"default"),hexo.extend.injector.register("head_end",l,"default")}),hexo.extend.helper.register("priority",(function(){const e=hexo.config.electric_clock.priority?hexo.config.electric_clock.priority:hexo.theme.config.electric_clock.priority;return e||10})));
//# sourceMappingURL=/sm/3bda622c1d12998761883d1b7198c976f5abb972cb68b078e51e6935fdb1dfca.map