UNPKG

filecat

Version:
1 lines 2.39 kB
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[903],{505:(e,t,n)=>{function r(e){var t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.setSelectionRange(0,99999),document.execCommand("copy"),document.body.removeChild(t)}n.d(t,{l:()=>r})},4903:(e,t,n)=>{n.r(t),n.d(t,{default:()=>s});var r=n(6540),o=n(7444),c=n(6417),a=n(5997),i=n(7952),l=n(2042),u=n(505);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,c,a,i=[],l=!0,u=!1;try{if(c=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=c.call(n)).done)&&(i.push(r.value),i.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var m=r.lazy((function(){return Promise.all([n.e(916),n.e(10)]).then(n.bind(n,4299))}));function s(e){var t=f((0,o.L4)(c.A.markdown),2),n=t[0],d=t[1],s=function(e){(0,u.l)(e),(0,l.LW)("复制成功")};if((0,r.useEffect)((function(){var e=document.querySelectorAll(".copy-btn");return e.forEach((function(e){e.addEventListener("click",(function(){var e=this.getAttribute("data-code");s(e)}))})),function(){e.forEach((function(e){e.removeEventListener("click",(function(){var e=this.getAttribute("data-code");s(e)}))}))}}),[n]),n.context)return r.createElement("div",{id:"md-container"},r.createElement(i.A,{ignore_tags:!0,left_children:[r.createElement(a.rA,{key:1,title:"取消",icon:"close",onClick:function(){d({context:"",filename:""})}}),r.createElement("title",{key:2},n.filename)]}),r.createElement("div",{className:"md-context markdown-body "},r.createElement(m,{context:n.context})))}}}]);