Comparing version 0.2.4 to 0.2.5
/*! | ||
* Vditor v0.2.4 - A markdown editor written in TypeScript. | ||
* Vditor v0.2.5 - A markdown editor written in TypeScript. | ||
* | ||
@@ -27,2 +27,2 @@ * MIT License | ||
*/ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Vditor=e():t.Vditor=e()}(window,function(){return function(t){function e(e){for(var n,i,r=e[0],s=e[1],l=0,c=[];l<r.length;l++)i=r[l],o[i]&&c.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n]);for(a&&a(e);c.length;)c.shift()()}var n={},o={0:0};function i(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.e=function(t){var e=[],n=o[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,i){n=o[t]=[e,i]});e.push(n[2]=r);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=function(t){return i.p+""+({1:"vditor",2:"vendors~vditor"}[t]||t)+".bundle.js"}(t),s=function(e){l.onerror=l.onload=null,clearTimeout(a);var n=o[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src,s=new Error("Loading chunk "+t+" failed.\n("+i+": "+r+")");s.type=i,s.request=r,n[1](s)}o[t]=void 0}};var a=setTimeout(function(){s({type:"timeout",target:l})},12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="https://cdn.jsdelivr.net/npm/vditor@0.2.4/dist/",i.oe=function(t){throw console.error(t),t};var r=window.webpackJsonpVditor=window.webpackJsonpVditor||[],s=r.push.bind(r);r.push=e,r=r.slice();for(var l=0;l<r.length;l++)e(r[l]);var a=s;return i(i.s=24)}([function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M32 0v13l-5-5-6 6-3-3 6-6-5-5zM14 21l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=128 height=32 viewBox="0 0 128 32"> <path d="M0 0h128v6.4h-128zM0 12.8h128v6.4h-128zM0 25.6h128v6.4h-128z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M22.996 15.023c1.339-1.591 2.147-3.643 2.147-5.88 0-5.041-4.102-9.143-9.143-9.143h-11.429v32h13.714c5.041 0 9.143-4.102 9.143-9.143 0-3.32-1.779-6.232-4.433-7.834zM11.429 4.571h3.625c1.999 0 3.625 2.051 3.625 4.571s-1.626 4.571-3.625 4.571h-3.625v-9.143zM17.107 27.429h-5.679v-9.143h5.679c2.087 0 3.786 2.051 3.786 4.571s-1.698 4.571-3.786 4.571z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M27.094 19.485v6.12c0 3.059-2.483 5.542-5.542 5.542h-16.010c-3.059 0-5.542-2.483-5.542-5.542v-16.010c0-3.059 2.483-5.542 5.542-5.542h16.010c0.769 0 1.54 0.154 2.251 0.481 0.174 0.077 0.308 0.25 0.346 0.443 0.039 0.211-0.019 0.404-0.174 0.558l-0.943 0.943c-0.115 0.115-0.289 0.193-0.443 0.193-0.058 0-0.115-0.019-0.174-0.039-0.289-0.077-0.578-0.115-0.866-0.115h-16.010c-1.693 0-3.079 1.386-3.079 3.079v16.010c0 1.693 1.386 3.079 3.079 3.079h16.010c1.693 0 3.079-1.386 3.079-3.079v-4.888c0-0.154 0.058-0.308 0.174-0.424l1.232-1.232c0.135-0.135 0.289-0.193 0.443-0.193 0.077 0 0.154 0.019 0.231 0.058 0.231 0.096 0.385 0.308 0.385 0.558zM31.54 10.076l-15.664 15.664c-0.615 0.615-1.578 0.615-2.194 0l-8.275-8.275c-0.615-0.615-0.615-1.578 0-2.194l2.116-2.116c0.615-0.615 1.578-0.615 2.194 0l5.060 5.060 12.451-12.451c0.615-0.615 1.578-0.615 2.194 0l2.116 2.116c0.615 0.615 0.615 1.578 0 2.194z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.053 21.895l2.526 2.526 8.421-8.421-8.421-8.421-2.526 2.526 5.895 5.895z"></path> <path d="M10.947 10.105l-2.526-2.526-8.421 8.421 8.421 8.421 2.526-2.526-5.895-5.895z"></path> <path d="M17.613 6.487l1.828 0.499-5.052 18.527-1.828-0.499 5.052-18.527z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M16 24.789c-3.756 0-6.911-2.254-8.188-5.559h16.376c-1.277 3.305-4.432 5.559-8.188 5.559zM10.366 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM21.634 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM16 28.845c7.061 0 12.845-5.784 12.845-12.845s-5.784-12.845-12.845-12.845-12.845 5.784-12.845 12.845 5.784 12.845 12.845 12.845zM16 0c8.864 0 16 7.136 16 16s-7.136 16-16 16-16-7.136-16-16 7.136-16 16-16z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M14 18v13l-5-5-6 6-3-3 6-6-5-5zM32 3l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.45 0h3.594c0.595 0 1.078 0.384 1.078 0.858v30.284c0 0.474-0.482 0.858-1.078 0.858h-3.594c-0.595 0-1.078-0.384-1.078-0.858v-30.284c-0-0.474 0.482-0.858 1.078-0.858zM23.888 0h3.673c0.59 0 1.068 0.384 1.068 0.858v30.284c0 0.474-0.478 0.858-1.068 0.858h-3.673c-0.59 0-1.068-0.384-1.068-0.858v-30.284c0-0.474 0.478-0.858 1.068-0.858z"></path> <path d="M25.069 14.167v3.667c0 0.589-0.384 1.065-0.858 1.065h-15.655c-0.474 0-0.858-0.477-0.858-1.065v-3.667c0-0.589 0.384-1.065 0.858-1.065h15.655c0.474 0 0.858 0.477 0.858 1.065z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.652 25v6c0 0.55-0.45 1-1 1h-6c-0.55 0-1-0.45-1-1v-6c0-0.55 0.45-1 1-1h6c0.55 0 1 0.45 1 1zM27.552 10c0 4.75-3.225 6.575-5.6 7.9-1.475 0.85-2.4 2.575-2.4 3.3v0c0 0.55-0.425 1.2-1 1.2h-6c-0.55 0-0.9-0.85-0.9-1.4v-1.125c0-3.025 3-5.625 5.2-6.625 1.925-0.875 2.725-1.7 2.725-3.3 0-1.4-1.825-2.65-3.85-2.65-1.125 0-2.15 0.35-2.7 0.725-0.6 0.425-1.2 1.025-2.675 2.875-0.2 0.25-0.5 0.4-0.775 0.4-0.225 0-0.425-0.075-0.625-0.2l-4.1-3.125c-0.425-0.325-0.525-0.875-0.25-1.325 2.7-4.475 6.5-6.65 11.6-6.65 5.35 0 11.35 4.275 11.35 10z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M23.273 27.636v2.909c0 0.795-0.659 1.455-1.455 1.455h-11.636c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h1.455v-8.727h-1.455c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h8.727c0.795 0 1.455 0.659 1.455 1.455v13.091h1.455c0.795 0 1.455 0.659 1.455 1.455zM20.364 1.455v4.364c0 0.795-0.659 1.455-1.455 1.455h-5.818c-0.795 0-1.455-0.659-1.455-1.455v-4.364c0-0.795 0.659-1.455 1.455-1.455h5.818c0.795 0 1.455 0.659 1.455 1.455z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M18.133 23.467l3.2 3.2 10.667-10.667-10.667-10.667-3.2 3.2 7.467 7.467z"></path> <path d="M13.867 8.533l-3.2-3.2-10.667 10.667 10.667 10.667 3.2-3.2-7.467-7.467z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.714 0v2.286h-4.571l-11.429 27.429h4.571v2.286h-16v-2.286h4.571l11.429-27.429h-4.571v-2.286z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M31.68 14.56h-31.36c-0.176 0-0.32 0.144-0.32 0.32v2.24c0 0.176 0.144 0.32 0.32 0.32h31.36c0.176 0 0.32-0.144 0.32-0.32v-2.24c0-0.176-0.144-0.32-0.32-0.32z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.187 2.933l-0.12-0.121c-2.813-2.812-7.415-2.812-10.228 0l-6.516 6.517c-2.812 2.812-2.812 7.415 0 10.227l0.12 0.12c0.234 0.234 0.482 0.446 0.739 0.641l2.386-2.386c-0.278-0.164-0.542-0.361-0.78-0.599l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l6.517-6.516c1.527-1.527 4.012-1.527 5.539 0l0.121 0.12c1.527 1.527 1.527 4.012 0 5.539l-2.948 2.948c0.512 1.264 0.754 2.611 0.733 3.955l4.559-4.559c2.812-2.812 2.812-7.415-0-10.227zM19.557 12.323c-0.234-0.234-0.482-0.446-0.739-0.641l-2.386 2.385c0.278 0.164 0.542 0.361 0.78 0.599l0.121 0.121c1.527 1.527 1.527 4.012 0 5.539l-6.517 6.517c-1.527 1.527-4.012 1.527-5.539 0l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l2.948-2.948c-0.512-1.264-0.754-2.611-0.733-3.955l-4.559 4.559c-2.812 2.812-2.812 7.415 0 10.228l0.12 0.12c2.813 2.812 7.415 2.812 10.228 0l6.516-6.517c2.812-2.812 2.812-7.415 0-10.228l-0.12-0.12z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12 2h20v4h-20v-4zM12 14h20v4h-20v-4zM12 26h20v4h-20v-4zM0 4c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 16c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 28c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M11 26h20v4h-20zM11 14h20v4h-20zM11 2h20v4h-20zM5 0v8h-2v-6h-2v-2zM3 16.438v1.563h4v2h-6v-4.563l4-1.875v-1.563h-4v-2h6v4.563zM7 22v10h-6v-2h4v-2h-4v-2h4v-2h-4v-2z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M0 16c3.037-5.864 9.058-9.802 16-9.802s12.963 3.938 15.953 9.703l0.047 0.1c-3.037 5.864-9.058 9.802-16 9.802s-12.963-3.938-15.953-9.703l-0.047-0.1zM16 22.531c3.607 0 6.531-2.924 6.531-6.531s-2.924-6.531-6.531-6.531v0c-3.607 0-6.531 2.924-6.531 6.531s2.924 6.531 6.531 6.531v0zM16 19.265c-1.804 0-3.265-1.461-3.265-3.265s1.461-3.265 3.265-3.265v0c1.804 0 3.265 1.461 3.265 3.265s-1.461 3.265-3.265 3.265v0z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M7.024 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086zM25.007 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.571 16c0 6.312 5.117 11.429 11.429 11.429s11.429-5.117 11.429-11.429v0c0-6.312-5.117-11.429-11.429-11.429s-11.429 5.117-11.429 11.429v0z"></path> <path d="M16 30.857c-8.229 0-14.933-6.705-14.933-14.933s6.705-14.933 14.933-14.933 15.010 6.705 15.010 15.010c0 8.152-6.705 14.857-15.010 14.857zM16 0c-8.838 0-16 7.162-16 16s7.162 16 16 16 16-7.162 16-16-7.162-16-16-16z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.583 9.75q-8.667 1.25-13.375 6.625t-6.208 12.958q6.417-9.083 19.583-9.083v7.25l12.417-12.417-12.417-12.417v7.083z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M32 16v2h-7.328c0.86 1.203 1.328 2.584 1.328 4 0 2.215-1.146 4.345-3.143 5.843-1.855 1.391-4.29 2.157-6.857 2.157s-5.002-0.766-6.857-2.157c-1.998-1.498-3.143-3.628-3.143-5.843h4c0 2.168 2.748 4 6 4s6-1.832 6-4c0-2.168-2.748-4-6-4h-16v-2h9.36c-0.073-0.052-0.146-0.104-0.217-0.157-1.998-1.498-3.143-3.628-3.143-5.843s1.146-4.345 3.143-5.843c1.855-1.391 4.29-2.157 6.857-2.157s5.002 0.766 6.857 2.157c1.997 1.498 3.143 3.628 3.143 5.843h-4c0-2.168-2.748-4-6-4s-6 1.832-6 4c0 2.168 2.748 4 6 4 2.468 0 4.814 0.709 6.64 2h9.36z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M9.846 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM32 5.538v20.923c0 1.692-1.385 3.077-3.077 3.077h-25.846c-1.692 0-3.077-1.385-3.077-3.077v-20.923c0-1.692 1.385-3.077 3.077-3.077h25.846c1.692 0 3.077 1.385 3.077 3.077z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12.417 9.75q8.667 1.25 13.375 6.625t6.208 12.958q-6.417-9.083-19.583-9.083v7.25l-12.417-12.417 12.417-12.417v7.083z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.334 16.532q0-0.233-0.15-0.384l-5.867-5.867q-0.15-0.15-0.384-0.15t-0.384 0.15l-5.85 5.85q-0.167 0.2-0.167 0.399 0 0.233 0.15 0.384t0.384 0.15h3.733v5.867q0 0.217 0.159 0.375t0.375 0.159h3.2q0.217 0 0.375-0.159t0.159-0.375v-5.867h3.734q0.217 0 0.375-0.159t0.159-0.375zM32 21.332q0 2.65-1.875 4.525t-4.525 1.875h-18.133q-3.083 0-5.275-2.192t-2.192-5.275q0-2.166 1.167-4t3.134-2.75q-0.034-0.5-0.034-0.717 0-3.533 2.5-6.033t6.033-2.5q2.6 0 4.759 1.45t3.142 3.849q1.184-1.033 2.767-1.033 1.767 0 3.017 1.25t1.25 3.017q0 1.267-0.683 2.3 2.166 0.516 3.558 2.258t1.392 3.975z"></path> </svg>'},function(t,e,n){"use strict";n.r(e);var o="0.2.4",i=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-counter",this.render(0,t.options.counter)}return t.prototype.render=function(t,e){this.element.className=t>e?"vditor-counter vditor-counter--error":"vditor-counter",this.element.innerHTML=t+"/"+e},t}(),r=/highlight-(?:text|source)-([a-z0-9]+)/;function s(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&r.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(r)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function l(t){t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var a=Array.prototype.indexOf,c=Array.prototype.every,p={};function u(t){var e,n,o=t.parentNode;return"THEAD"===o.nodeName||o.firstChild===t&&("TABLE"===o.nodeName||(n=(e=o).previousSibling,"TBODY"===e.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&c.call(t.childNodes,function(t){return"TH"===t.nodeName})}function d(t,e){var n=" ";return 0===a.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function h(t){for(var e in t.keep(function(t){return"TABLE"===t.nodeName&&!u(t.rows[0])}),p)t.addRule(e,p[e])}function f(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function v(t){t.use([s,l,h,f])}p.tableCell={filter:["th","td"],replacement:function(t,e){return d(t,e)}},p.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(u(e))for(var i=0;i<e.childNodes.length;i++){var r="---",s=(e.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=d(r,e.childNodes[i])}return"\n"+t+(n?"\n"+n:"")}},p.table={filter:function(t){return"TABLE"===t.nodeName&&u(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},p.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var m,g={en_US:{bold:"Blod",check:"Task List",code:"Code Block",emoji:"Emoji",fullscreen:"Fullscreen",headings:"Headings",help:"Help",info:"Info","inline-code":"Inline Code",italic:"Italic",line:"Line",link:"Link",list:"List","ordered-list":"Order List",over:"over",preview:"Preview",quote:"Quote",record:"Start Record/End Record",recording:"recording...",redo:"Redo",strike:"Strike",table:"Table",undo:"Undo",upload:"Upload image or file",uploading:"uploading..."},zh_CN:{bold:"粗体",check:"任务列表",code:"代码块",emoji:"表情",fullscreen:"全屏",headings:"标题",help:"帮助",info:"关于","inline-code":"行内代码",italic:"斜体",line:"分隔线",link:"链接",list:"无序列表","ordered-list":"有序列表",over:"超过",preview:"预览",quote:"引用",record:"开始录音/结束录音",recording:"录音中...",redo:"重做",strike:"删除线",table:"表格",undo:"撤销",upload:"上传图片或文件",uploading:"上传中..."}},y=function(){return function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload",this.element.innerHTML='<div class="vditor-upload__progress"></div><div class="vditor-upload__close">x</div>',this.element.children[1].addEventListener("click",function(){this.parentElement.style.opacity=0,this.parentElement.className="vditor-upload"})}}(),w=function(t,e,n){for(var o=new FormData,i=[],r=0,s=e.length;r<s;r++){var l=e[r];l instanceof DataTransferItem&&(l=l.getAsFile()),l.size<=t.options.upload.max&&(o.append("file[]",l),i.push(l))}if(t.upload.element.className="vditor-upload",t.upload.element.children[0].innerHTML="",_(t.editor.element,function(t,e){for(var n="",o=e.length,i=0;i<o;i++){var r=e[i];r instanceof DataTransferItem&&(r=r.getAsFile());var s=-1===r.type.indexOf("image")?"":"!";if(!r.name)return"";var l=r.name.lastIndexOf("."),a=t.options.upload.filename(r.name.substr(0,l))+r.name.substr(l),c=t.options.lang;r.size>t.options.upload.max?(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=r.name+" "+g[c].over+" "+t.options.upload.max/1024/1024+"M"):n+=s+"["+a+"]("+g[c].uploading+")\n"}return n}(t,e),""),0!==i.length){if(!t.options.upload.url||!t.upload)return n&&(n.value=""),void alert("please config: options.upload.url");var a=new XMLHttpRequest;a.open("POST",t.options.upload.url),t.options.upload.token&&a.setRequestHeader("X-Upload-Token",t.options.upload.token),t.upload.isUploading=!0,t.editor.element.setAttribute("disabled","disabled"),a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(t.upload.isUploading=!1,n&&(n.value=""),t.editor.element.removeAttribute("disabled"),200===a.status?(t.options.upload.success?t.options.upload.success(t.editor.element,a.responseText):function(t,e,n,o){t.focus();var i=JSON.parse(e);1===i.code&&(o.className="vditor-upload vditor-upload--tip",o.children[0].innerHTML=i.msg),i.data.errFiles.forEach(function(e){var o=e.lastIndexOf("."),i="["+(n.upload.filename(e.substr(0,o))+e.substr(o))+"]("+g[n.lang].uploading+")";t.selectionStart=t.value.split(i)[0].length,t.selectionEnd=t.selectionStart+i.length,_(t,"","",!0)}),Object.keys(i.data.succMap).forEach(function(e){var o=i.data.succMap[e];if(o.indexOf(".wav")!==o.length-4){var r=e.lastIndexOf("."),s=n.upload.filename(e.substr(0,r))+e.substr(r),l="["+s+"]("+g[n.lang].uploading+")";t.selectionStart=t.value.split(l)[0].length,t.selectionEnd=t.selectionStart+l.length,_(t,"["+s+"]("+o+")","",!0)}else _(t,'<audio controls="controls" src="'+o+'"></audio>\n',"")})}(t.editor.element,a.responseText,t.options,t.upload.element),t.upload.element.style.opacity="0"):t.options.upload.error?t.options.upload.error(a.responseText):(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=a.responseText||"401"))},a.upload.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total*100;t.upload.element.style.opacity="1",t.upload.element.children[0].style.width=n+"%"}},a.send(o)}else n&&(n.value="")},b=function(){function t(t){this.element=document.createElement("textarea"),this.element.className="vditor-textarea",this.element.setAttribute("placeholder",t.options.placeholder),t.options.cache&&(this.element.value=localStorage.getItem("vditor"+t.id),t.options.counter>0&&t.counter.render(this.element.value.length,t.options.counter)),this.bindEvent(t)}return t.prototype.html2md=function(t,e,n,o){var i=!1;t.prototype.escape=function(t){return t};var r=new t;r.addRule("strikethrough",{filter:["pre","code"],replacement:function(t,e){return"PRE"===e.parentElement.tagName?t:t.split("\n").length>1?(i=!0,"```\n"+t+"\n```"):"`"+t+"`"}}),r.addRule("strikethrough",{filter:["img"],replacement:function(t,n){if(!n.getAttribute("src"))return"";if(e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&200===o.status){var t=JSON.parse(o.responseText);if(0!==t.code)return void alert(t.msg);var i=n.getAttribute("src");e.editor.element.selectionStart=e.editor.element.value.split(i)[0].length,e.editor.element.selectionEnd=e.editor.element.selectionStart+i.length,_(e.editor.element,t.data.url,"",!0)}},o.send(JSON.stringify({url:n.getAttribute("src")}))}return"+")"}}),r.use(v);var s=r.turndown(n);if(i){var l=document.createElement("div");l.innerHTML=n,l.querySelectorAll("pre").length>1?i=!1:"```"===s.substr(0,3)&&"```"===s.substr(s.length-3,3)||(i=!1)}_(e.editor.element,i?"```\n"+o+"\n```":s,"",!0)},t.prototype.bindEvent=function(t){var e,o=this;this.element.addEventListener("input",function(){t.options.counter>0&&t.counter.render(o.element.value.length,t.options.counter),"function"==typeof t.options.input&&t.options.input(o.element.value,t.preview&&t.preview.element),t.hint&&t.hint.render(),t.options.cache&&localStorage.setItem("vditor"+t.id,t.editor.element.value),t.preview&&t.preview.render(t)}),this.element.addEventListener("focus",function(){(t.options.focus&&t.options.focus(o.element.value),t.toolbar.elements.emoji&&t.toolbar.elements.emoji.children[1])&&(t.toolbar.elements.emoji.children[1].style.display="none");t.toolbar.elements.headings&&t.toolbar.elements.headings.children[1]&&(t.toolbar.elements.headings.children[1].style.display="none")}),this.element.addEventListener("blur",function(){t.options.blur&&t.options.blur(o.element.value)}),t.options.select&&(this.element.onselect=function(){t.options.select(o.element.value.substring(o.element.selectionStart,o.element.selectionEnd))}),this.element.addEventListener("scroll",function(){if("none"!==t.preview.element.style.display||t.preview){var e=o.element.scrollTop,n=o.element.clientHeight,i=o.element.scrollHeight,r=t.preview.element;r.scrollTop=e/n>.5?(e+n)*r.scrollHeight/i-n:e*r.scrollHeight/i}}),t.options.upload.url&&this.element.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault();var n=e.dataTransfer.items;0!==n.length&&w(t,n)});var i=this.html2md;this.element.addEventListener("paste",function(o){o.stopPropagation(),o.preventDefault();var r=o;if(""!==r.clipboardData.getData("text/html").replace(/(^\s*)|(\s*)$/g,"")){var s=r.clipboardData.getData("text/html"),l=r.clipboardData.getData("text/plain");if(!e)return void n.e(1).then(n.bind(null,26)).then(function(n){e=n.default,i(e,t,s,l)}).catch(function(t){console.error("Failed to load turndown",t)});i(e,t,s,l)}else if(""!==r.clipboardData.getData("text/plain").replace(/(^\s*)|(\s*)$/g,"")&&0===r.clipboardData.files.length)_(o.target,r.clipboardData.getData("text/plain"),"",!0);else if(r.clipboardData.files.length>0){if(!t.options.upload.url)return;w(t,r.clipboardData.files)}})},t}(),_=function(t,e,n,o){if("number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd){var i=t.selectionStart,r=t.selectionEnd,s=t.value;if(t.focus(),/firefox/i.test(navigator.userAgent)||/edge/i.test(navigator.userAgent)||/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)){i===r?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=t.selectionStart=r+e.length):o?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=i+e.length+n.length):s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n?(t.value=s.substring(0,i-e.length)+s.substring(i,r)+s.substring(r+n.length,s.length),t.selectionStart=i-e.length,t.selectionEnd=r-e.length):(t.value=s.substring(0,i)+e+s.substring(i,r)+n+s.substring(r,s.length),t.selectionStart=i+e.length,t.selectionEnd=r+e.length);var l=document.createEvent("HTMLEvents");l.initEvent("input",!0,!1),t.dispatchEvent(l)}else if(i===r)document.execCommand("insertText",!1,e+n),t.selectionStart=t.selectionEnd=t.selectionStart-n.length;else if(o)document.execCommand("insertText",!1,e+n);else if(s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n){document.execCommand("delete",!1);for(var a=0,c=e.length;a<c;a++)document.execCommand("delete",!1);for(var p=0,u=n.length;p<u;p++)document.execCommand("forwardDelete",!1);document.execCommand("insertText",!1,s.substring(i,r)),t.selectionStart=i-e.length,t.selectionEnd=r-e.length}else document.execCommand("insertText",!1,e+s.substring(i,r)+n),t.selectionStart=i+e.length,t.selectionEnd=r+e.length}},E=function(t){var e=window.getComputedStyle(t),n=document.querySelector(".vditor-position");n||((n=document.createElement("div")).className="vditor-position",document.body.appendChild(n));var o=n.style;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.overflow="hidden",o.left="-100%",["direction","box-sizing","width","height","overflow-x","overflow-y","border-top-width","border-right-width","border-bottom-width","border-left-width","border-style","padding-top","padding-right","padding-bottom","padding-left","font-style","font-variant","font-weight","font-stretch","font-size","text-size-adjust","line-height","font-family","text-align","text-transform","text-indent","text-decoration","letter-spacing","word-spacing","tab-size","tab-size"].forEach(function(t){o.setProperty(t,e.getPropertyValue(t))}),n.textContent=t.value.substring(0,t.selectionEnd);var i=document.createElement("span");return i.textContent=t.value.substring(t.selectionEnd)||".",n.appendChild(i),{left:i.offsetLeft-t.scrollLeft,top:i.offsetTop-t.scrollTop+parseInt(e.lineHeight,10)}},x=function(){function t(t){this.timeId=-1,this.hint=t.options.hint,this.editorElement=t.editor.element,this.element=document.createElement("ul"),this.element.className="vditor-hint",this.editorElement.parentElement.appendChild(this.element)}return t.prototype.render=function(){var t=this,e=this.editorElement.value.substr(0,this.editorElement.selectionStart).split("\n").slice(-1).pop(),o=this.getKey(e,"@"),i=this.getKey(e,":");void 0===o&&void 0===i?(this.element.style.display="none",clearTimeout(this.timeId)):(void 0!==o&&this.hint.at&&(clearTimeout(this.timeId),this.timeId=setTimeout(function(){t.genHTML(t.hint.at(o),o)},this.hint.delay)),void 0!==i&&n.e(2).then(n.bind(null,27)).then(function(e){var n=""===i?t.hint.emoji:e.getAllEmoji(t.hint.emojiPath),o=[];Object.keys(n).forEach(function(t){0===t.indexOf(i.toLowerCase())&&(n[t].indexOf(".")>-1?o.push({html:'<img src="'+n[t]+'" title=":'+t+':"/> :'+t+":",value:":"+t+":"}):o.push({html:n[t]+" "+t,value:n[t]}))}),t.genHTML(o,i)}).catch(function(t){console.error("Failed to load emoji",t)}))},t.prototype.getKey=function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n,o=t.split(e);if(o.length>1)if(2===o.length&&""===o[0])(""===o[1]||""!==o[1].trim())&&-1===o[1].indexOf(" ")&&o[1].length<33&&(n=o[1]);else{var i=o[o.length-2],r=o.slice(-1).pop();" "===i.slice(-1)&&-1===r.indexOf(" ")&&(""===r||""!==r.trim())&&r.length<33&&(n=r)}return n},t.prototype.genHTML=function(t,e){var n=this;if(0!==t.length){var o=E(this.editorElement),i=o.left,r=o.top-4,s="";t.forEach(function(t,n){if(!(n>7)){var o=t.html;if(""!==e){var i=o.lastIndexOf(">")+1,r=o.substr(i),l=r.toLowerCase().indexOf(e.toLowerCase());l>-1&&(r=r.substring(0,l)+"<b>"+r.substring(l,l+e.length)+"</b>"+r.substring(l+e.length),o=o.substr(0,i)+r)}s+='<li data-value="'+t.value+' " class="'+(n||"vditor-hint--current")+'"> '+o+"</li>"}}),this.element.innerHTML=s,this.element.style.top=r+"px",this.element.style.left=i+"px",this.element.style.display="block",this.element.querySelectorAll("li").forEach(function(t){t.addEventListener("click",function(){n.element.style.display="none";var e=t.getAttribute("data-value"),o=0===e.indexOf("@")?"@":":";n.editorElement.selectionStart=n.editorElement.value.substr(0,n.editorElement.selectionEnd).lastIndexOf(o),_(n.editorElement,e,"",!0)})}),r+this.element.offsetHeight-this.editorElement.offsetHeight>window.innerHeight-(this.editorElement.parentElement.offsetHeight+this.editorElement.parentElement.offsetTop-document.documentElement.scrollTop)&&(this.element.style.top=r-this.element.offsetHeight+"px")}else this.element.style.display="none"},t}(),O=function(){function t(t){this.editorElement=t.editor.element,this.toolbarElements=t.toolbar.elements,this.options=t.options,this.hintElement=t.hint.element,this.bindHotkey()}return t.prototype.bindHotkey=function(){var t=this;this.editorElement.addEventListener("keydown",function(e){t.options.esc&&e.key.toLowerCase()==="Escape".toLowerCase()&&t.options.esc(t.editorElement.value),t.options.ctrlEnter&&(e.metaKey||e.ctrlKey)&&"enter"===e.key.toLowerCase()&&t.options.ctrlEnter(t.editorElement.value),t.options.toolbar.forEach(function(n){if(n.hotkey){var o=n.hotkey.split("-");"ctrl"!==o[0]&&"⌘"!==o[0]||!e.metaKey&&!e.ctrlKey||e.key===o[1]&&(t.toolbarElements[n.name].children[0].click(),e.preventDefault(),e.stopPropagation())}}),(t.options.hint.at||t.toolbarElements.emoji)&&t.hint(e)})},t.prototype.hint=function(t){if(0!==this.hintElement.querySelectorAll("li").length&&"none"!==this.hintElement.style.display){var e=this.hintElement.querySelector(".vditor-hint--current");if("arrowdown"===t.key.toLowerCase())t.preventDefault(),t.stopPropagation(),e.nextElementSibling?e.nextElementSibling.className="vditor-hint--current":this.hintElement.children[0].className="vditor-hint--current",e.removeAttribute("class");else if("arrowup"===t.key.toLowerCase()){if(t.preventDefault(),t.stopPropagation(),e.previousElementSibling)e.previousElementSibling.className="vditor-hint--current";else{var n=this.hintElement.children.length;this.hintElement.children[n-1].className="vditor-hint--current"}e.removeAttribute("class")}else if("enter"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),this.hintElement.style.display="none";var o=e.getAttribute("data-value"),i=0===o.indexOf("@")?"@":":";this.editorElement.selectionStart=this.editorElement.value.substr(0,this.editorElement.selectionEnd).lastIndexOf(i),_(this.editorElement,o,"",!0)}}},t}(),M=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-preview"+(t.options.classes.preview?" "+t.options.classes.preview:""),t.options.preview.show||(this.element.style.display="none"),"none"!==this.element.style.display&&this.render(t)}return t.prototype.render=function(t,e){var n=this;"none"!==this.element.style.display&&(e?this.element.innerHTML=e:""!==t.editor.element.value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")?t.options.preview.url?(clearTimeout(t.mdTimeoutId),t.mdTimeoutId=setTimeout(function(){var e=new XMLHttpRequest;e.open("POST",t.options.preview.url),e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&200===e.status){var o=JSON.parse(e.responseText);if(0!==o.code)return void alert(o.msg);n.element.innerHTML=o.data,t.options.preview.parse&&t.options.preview.parse(n.element)}},e.send(JSON.stringify({markdownText:t.editor.element.value}))},t.options.preview.delay)):this.element.innerHTML=t.editor.element.value:this.element.innerHTML="")},t}(),k=n(1),L=n.n(k),T=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-resize",this.element.innerHTML=L.a,this.bindEvent(t)}return t.prototype.bindEvent=function(t){this.element.addEventListener("mousedown",function(e){var n=document,o=document.getElementById(t.id),i=e.clientY,r=o.offsetHeight;n.ondragstart=function(){return!1},n.onselectstart="return false;",n.onselect=function(){document.selection.empty()},window.captureEvents&&window.captureEvents(),n.onmousemove=function(e){"top"===t.options.resize.position?o.style.height=Math.max(100,r+(i-e.clientY))+"px":o.style.height=Math.max(100,r+(e.clientY-i))+"px"},n.onmouseup=function(){t.options.resize.after&&t.options.resize.after(o.offsetHeight-r),window.captureEvents&&window.captureEvents(),n.onmousemove=null,n.onmouseup=null,n.ondragstart=null,n.onselectstart=null,n.onselect=null}})},t}(),P=n(2),A=n.n(P),j=function(){function t(t,e){this.menuItem=e,this.editorElement=t.editor.element,this.element=document.createElement("div");var n=document.createElement("div");n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition;var o=this.menuItem.hotkey?" <"+this.menuItem.hotkey+">":"";o=/Mac/.test(navigator.platform)?o.replace("ctrl","⌘"):o.replace("⌘","ctrl"),n.setAttribute("aria-label",this.menuItem.tip||g[t.options.lang][this.menuItem.name]+o),this.element.appendChild(n)}return t.prototype.bindEvent=function(){var t=this;this.element.children[0].addEventListener("click",function(){_(t.editorElement,t.menuItem.prefix||"",t.menuItem.suffix||"")})},t}(),z=(m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||A.a,o.bindEvent(),o}return z(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),H=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__br"}}(),N=n(3),C=n.n(N),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),F=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||C.a,o.bindEvent(),o}return B(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),D=n(4),I=n.n(D),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),q=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||I.a,o.bindEvent(),o}return R(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),U=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__divider"}}(),V=n(5),W=n.n(V),J=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),K=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||W.a;var i=document.createElement("div");i.className="vditor-panel";var r="";Object.keys(e.options.hint.emoji).forEach(function(t){var n=e.options.hint.emoji[t];n.indexOf(".")>-1?r+='<span data-value=":'+t+': " title=":'+t+':"><img data-value=":'+t+': "\nsrc="'+n+'"/></span>':r+='<span data-value="'+n+' " title="'+t+'">'+n+"</span>"});var s=e.options.hint.emojiTail?'<div class="vditor-emojis__tail">'+e.options.hint.emojiTail+"</div>":"";return i.innerHTML='<div class="vditor-emojis">'+r+"</div>"+s,o.element.appendChild(i),o._bindEvent(i,e),o}return J(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.headings&&(e.toolbar.elements.headings.children[1].style.display="none"))}),t.querySelectorAll(".vditor-emojis span").forEach(function(n){n.addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),"",!0),t.style.display="none"})})},e}(j),X=n(6),$=n.n(X),Y=n(0),G=n.n(Y),Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Z=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||G.a,o._bindEvent(e,n),o}return Q(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n=document.getElementById(t.id);n.className.indexOf("vditor--fullscreen")>-1?(this.innerHTML=e.icon||G.a,n.className=n.className.replace(" vditor--fullscreen",""),Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__s","__n"))})):(this.innerHTML=e.icon||$.a,n.className=n.className+" vditor--fullscreen",Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__n","__s"))}))})},e}(j),tt=n(7),et=n.n(tt),nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ot=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||et.a;var i=document.createElement("div");return i.className="vditor-panel",i.innerHTML='<h1 data-value="# ">Heading 1</h1>\n<h2 data-value="## ">Heading 2</h2>\n<h3 data-value="### ">Heading 3</h3>\n<h4 data-value="#### ">Heading 4</h4>\n<h5 data-value="##### ">Heading 5</h5>\n<h6 data-value="###### ">Heading 6</h6>',o.element.appendChild(i),o._bindEvent(i,e),o}return nt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.children[1].style.display="none"))});for(var n=0;n<6;n++)t.children.item(n).addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),""),t.style.display="none"})},e}(j),it=n(8),rt=n.n(it),st=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||rt.a,o.bindEvent(),o}return st(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://hacpai.com/guide/markdown")})},e}(j),at=n(9),ct=n.n(at),pt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ut=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ct.a,o.bindEvent(),o}return pt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://github.com/b3log/vditor")})},e}(j),dt=n(10),ht=n.n(dt),ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ht.a,o.bindEvent(),o}return ft(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),mt=n(11),gt=n.n(mt),yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),wt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||gt.a,o.bindEvent(),o}return yt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),bt=n(12),_t=n.n(bt),Et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||_t.a,o.bindEvent(),o}return Et(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Ot=n(13),Mt=n.n(Ot),kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Lt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Mt.a,o.bindEvent(),o}return kt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Tt=n(14),Pt=n.n(Tt),At=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Pt.a,o.bindEvent(),o}return At(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),zt=n(15),St=n.n(zt),Ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||St.a,o.bindEvent(),o}return Ht(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Ct=n(16),Bt=n.n(Ct),Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Bt.a,e.options.preview.show&&(o.element.children[0].className="vditor-tooltipped vditor-tooltipped__"+n.tipPosition+" vditor-menu--current"),o._bindEvent(e,n),o}return Ft(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n,o=document.getElementById(t.id);"block"===t.preview.element.style.display?(t.preview.element.style.display="none",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition):(t.preview.element.style.display="block",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition+" vditor-menu--current",t.preview.render(t)),o.className.indexOf("vditor--fullscreen")>-1&&(n=n.replace("__n","__s")),this.className=n})},e}(j),It=n(17),Rt=n.n(It),qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ut=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Rt.a,o.bindEvent(),o}return qt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Vt=n(18),Wt=n.n(Vt),Jt=function(){function t(t){var e;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)e=new AudioContext;else{if(!webkitAudioContext)return;e=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=e.sampleRate;var n=e.createGain();e.createMediaStreamSource(t).connect(n),this.recorder=e.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(e.destination),this.readyFlag=!0}return t.prototype.cloneChannelData=function(t,e){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(e)),this.recordingLength+=2048},t.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},t.prototype.stopRecording=function(){this.isRecording=!1},t.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),e=this.mergeBuffers(this.rightChannel),n=new Float32Array(t.length),o=0;o<t.length;++o)n[o]=.5*(t[o]+e[o]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var i=44+2*n.length,r=new ArrayBuffer(i),s=new DataView(r);this.writeUTFBytes(s,0,"RIFF"),s.setUint32(4,i,!0),this.writeUTFBytes(s,8,"WAVE"),this.writeUTFBytes(s,12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,this.SAMPLE_RATE,!0),s.setUint32(28,2*this.SAMPLE_RATE,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0);var l=2*n.length;this.writeUTFBytes(s,36,"data"),s.setUint32(40,l,!0);for(var a=n.length,c=44,p=0;p<a;p++)s.setInt16(c,32767*n[p],!0),c+=2;return new Blob([s],{type:"audio/wav"})},t.prototype.downSampleBuffer=function(t,e){if(e===this.DEFAULT_SAMPLE_RATE)return t;if(e>this.DEFAULT_SAMPLE_RATE)return t;for(var n=this.DEFAULT_SAMPLE_RATE/e,o=Math.round(t.length/n),i=new Float32Array(o),r=0,s=0;r<i.length;){for(var l=Math.round((r+1)*n),a=0,c=0,p=s;p<l&&p<t.length;p++)a+=t[p],c++;i[r]=a/c,r++,s=l}return i},t.prototype.mergeBuffers=function(t){for(var e=new Float32Array(this.recordingLength),n=0,o=t.length,i=0;i<o;++i){var r=t[i];e.set(r,n),n+=r.length}return e},t.prototype.writeUTFBytes=function(t,e,n){for(var o=n.length,i=0;i<o;i++)t.setUint8(e+i,n.charCodeAt(i))},t}(),Kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Wt.a,o._bindEvent(e),o}return Kt(e,t),e.prototype._bindEvent=function(t){var e;this.element.children[0].addEventListener("click",function(){if(e)if(e.isRecording){e.stopRecording(),t.upload.element.className="vditor-upload";var n=new File([e.buildWavFileBlob()],"record"+(new Date).getTime()+".wav",{type:"video/webm"});w(t,[n])}else t.upload.element.children[0].innerHTML=g[t.options.lang].recording,t.upload.element.style.opacity="1",t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled"),e.startRecordingNewWavFile();else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(n){(e=new Jt(n)).recorder.onaudioprocess=function(t){if(e.isRecording){var n=t.inputBuffer.getChannelData(0),o=t.inputBuffer.getChannelData(1);e.cloneChannelData(n,o)}},e.startRecordingNewWavFile(),t.upload.element.children[0].innerHTML=g[t.options.lang].recording,t.upload.element.style.opacity="1",t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled")}).catch(function(t){console.error("init media error:",t)})})},e}(j),$t=n(19),Yt=n.n($t),Gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Qt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Yt.a,o.bindEvent(),o}return Gt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("redo")})},e}(j),Zt=n(20),te=n.n(Zt),ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ne=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||te.a,o.bindEvent(),o}return ee(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),oe=n(21),ie=n.n(oe),re=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),se=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ie.a,o.bindEvent(),o}return re(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),le=n(22),ae=n.n(le),ce=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pe=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ae.a,o.bindEvent(),o}return ce(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("undo")})},e}(j),ue=n(23),de=n.n(ue),he=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fe=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML="<label>"+(n.icon||de.a)+'<input multiple="multiple" type="file"></label>',o._bindEvent(e),o}return he(e,t),e.prototype._bindEvent=function(t){this.element.querySelector("input").addEventListener("change",function(e){0!==e.target.files.length&&w(t,e.target.files,e.target)})},e}(j),ve=function(){return function(t){var e=this,n=t.options;this.elements={},n.toolbar.forEach(function(n,o){var i;switch(n.name){case"emoji":i=new K(t,n);break;case"bold":i=new S(t,n);break;case"headings":i=new ot(t,n);break;case"|":i=new U;break;case"br":i=new H;break;case"italic":i=new wt(t,n);break;case"strike":i=new ne(t,n);break;case"line":i=new xt(t,n);break;case"quote":i=new Ut(t,n);break;case"list":i=new jt(t,n);break;case"ordered-list":i=new Nt(t,n);break;case"check":i=new F(t,n);break;case"undo":i=new pe(t,n);break;case"redo":i=new Qt(t,n);break;case"code":i=new q(t,n);break;case"inline-code":i=new vt(t,n);break;case"link":i=new Lt(t,n);break;case"help":i=new lt(t,n);break;case"table":i=new se(t,n);break;case"preview":i=new Dt(t,n);break;case"fullscreen":i=new Z(t,n);break;case"upload":i=new fe(t,n);break;case"record":i=new Xt(t,n);break;case"info":i=new ut(t,n);break;default:console.error("menu item no matched")}var r=n.name;"br"!==r&&"|"!==r||(r+=o),e.elements[r]=i.element})}}(),me=function(){return function(t){var e=document.getElementById(t.id);e.className="vditor"+(e.className?" "+e.className:""),"number"==typeof t.options.height&&(e.style.height=t.options.height+"px"),"number"==typeof t.options.width?e.style.width=t.options.width+"px":e.style.width=t.options.width;var n=document.createElement("div");n.className="vditor-toolbar",Object.keys(t.toolbar.elements).forEach(function(e){n.appendChild(t.toolbar.elements[e])}),e.appendChild(n),t.options.resize.enable&&"top"===t.options.resize.position&&e.appendChild(t.resize.element);var o=document.createElement("div");o.className="vditor-content",o.appendChild(t.editor.element),t.preview&&o.appendChild(t.preview.element),t.options.counter>0&&o.appendChild(t.counter.element),t.upload&&o.appendChild(t.upload.element),e.appendChild(o),t.options.resize.enable&&"bottom"===t.options.resize.position&&e.appendChild(t.resize.element),document.onclick=function(t){var e=t.target.closest(".vditor-tooltipped");e&&e.nextSibling&&"vditor-panel"===e.nextSibling.className||(document.querySelectorAll(".vditor-hint").forEach(function(t){t.style.display="none"}),document.querySelectorAll(".vditor-panel").forEach(function(t){t.style.display="none"}))}}}(),ge=function(){function t(t){this.defaultOptions={cache:!0,classes:{preview:""},counter:0,height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",cold_sweat:"😰",heart:"❤️"},emojiPath:"https://cdn.jsdelivr.net/npm/vditor/src/assets/emoji"},lang:"zh_CN",placeholder:"",preview:{delay:1e3,show:!1},resize:{enable:!1,position:"bottom"},toolbar:[{hotkey:"⌘-e",name:"emoji",tipPosition:"ne"},{hotkey:"⌘-h",name:"headings",tipPosition:"ne"},{hotkey:"⌘-b",name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘-i",name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘-s",name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{name:"|"},{hotkey:"⌘-d",name:"line",prefix:"---\n",tipPosition:"n"},{hotkey:"⌘-.",name:"quote",prefix:"> ",tipPosition:"n"},{name:"|"},{hotkey:"⌘-l",name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘-o",name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘-j",name:"check",prefix:"* [ ] ",tipPosition:"n"},{name:"|"},{hotkey:"⌘-u",name:"code",prefix:"```\n",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘-g",name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{name:"|"},{hotkey:"⌘-z",name:"undo",tipPosition:"n"},{hotkey:"⌘-y",name:"redo",tipPosition:"n"},{name:"|"},{name:"upload",tipPosition:"n"},{hotkey:"⌘-k",name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{hotkey:"⌘-m",name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"record",tipPosition:"n"},{name:"|"},{hotkey:"⌘-p",name:"preview",tipPosition:"nw"},{hotkey:"⌘-f",name:"fullscreen",tipPosition:"nw"},{name:"info",tipPosition:"nw"},{name:"help",tipPosition:"nw"},{name:"br"}],upload:{filename:function(t){return t.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,url:""},width:"auto"},this.options=t}return t.prototype.merge=function(){var t=this,e=[];this.options&&(this.options.toolbar&&this.options.toolbar.forEach(function(n){var o;t.defaultOptions.toolbar.forEach(function(t){"string"==typeof n&&t.name===n&&(o=t),"object"==typeof n&&t.name===n.name&&(o=Object.assign({},t,n))}),e.push(o)}),this.options.upload&&(this.options.upload=Object.assign({},this.defaultOptions.upload,this.options.upload)),this.options.classes&&(this.options.classes=Object.assign({},this.defaultOptions.classes,this.options.classes)),this.options.preview&&(this.options.preview=Object.assign({},this.defaultOptions.preview,this.options.preview)),this.options.hint&&(this.options.hint=Object.assign({},this.defaultOptions.hint,this.options.hint)),this.options.resize&&(this.options.resize=Object.assign({},this.defaultOptions.resize,this.options.resize)));var n=Object.assign({},this.defaultOptions,this.options);return e.length>0&&(n.toolbar=e),n},t}(),ye=function(){function t(t,e){this.version=o;var n=new ge(e).merge();if(this.vditor={id:t,mdTimeoutId:-1,options:n},n.counter>0){var r=new i(this.vditor);this.vditor.counter=r}var s=new b(this.vditor);if(this.vditor.editor=s,n.resize.enable){var l=new T(this.vditor);this.vditor.resize=l}if(n.toolbar){var a=new ve(this.vditor);this.vditor.toolbar=a}if(this.vditor.toolbar.elements.preview){var c=new M(this.vditor);this.vditor.preview=c}if(n.upload.url){var p=new y;this.vditor.upload=p}new me(this.vditor);if(this.vditor.options.hint.at||this.vditor.toolbar.elements.emoji){var u=new x(this.vditor);this.vditor.hint=u}new O(this.vditor)}return t.prototype.getValue=function(){return this.vditor.editor.element.value},t.prototype.insertValue=function(t){_(this.vditor.editor.element,t,"")},t.prototype.focus=function(){this.vditor.editor.element.focus()},t.prototype.blur=function(){this.vditor.editor.element.blur()},t.prototype.disabled=function(){this.vditor.editor.element.setAttribute("disabled","disabled")},t.prototype.enable=function(){this.vditor.editor.element.removeAttribute("disabled")},t.prototype.setSelection=function(t,e){this.vditor.editor.element.selectionStart=t,this.vditor.editor.element.selectionEnd=e,this.vditor.editor.element.focus()},t.prototype.getSelection=function(){return this.vditor.editor.element.value.substring(this.vditor.editor.element.selectionStart,this.vditor.editor.element.selectionEnd)},t.prototype.setValue=function(t){this.vditor.editor.element.selectionStart=0,this.vditor.editor.element.selectionEnd=this.vditor.editor.element.value.length,_(this.vditor.editor.element,t,"",!0),t||localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.renderPreview=function(t){this.vditor.preview.render(this.vditor,t)},t.prototype.getCursorPosition=function(){return E(this.vditor.editor.element)},t.prototype.deleteValue=function(){_(this.vditor.editor.element,"","",!0)},t.prototype.updateValue=function(t){_(this.vditor.editor.element,t,"",!0)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.disabledCache=function(){this.vditor.options.cache=!1},t.prototype.enableCache=function(){this.vditor.options.cache=!0},t}();e.default=ye}]).default}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Vditor=e():t.Vditor=e()}(window,function(){return function(t){function e(e){for(var n,i,r=e[0],s=e[1],l=0,c=[];l<r.length;l++)i=r[l],o[i]&&c.push(o[i][0]),o[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n]);for(a&&a(e);c.length;)c.shift()()}var n={},o={0:0};function i(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.e=function(t){var e=[],n=o[t];if(0!==n)if(n)e.push(n[2]);else{var r=new Promise(function(e,i){n=o[t]=[e,i]});e.push(n[2]=r);var s,l=document.createElement("script");l.charset="utf-8",l.timeout=120,i.nc&&l.setAttribute("nonce",i.nc),l.src=function(t){return i.p+""+({1:"vditor",2:"vendors~vditor"}[t]||t)+".bundle.js"}(t),s=function(e){l.onerror=l.onload=null,clearTimeout(a);var n=o[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),r=e&&e.target&&e.target.src,s=new Error("Loading chunk "+t+" failed.\n("+i+": "+r+")");s.type=i,s.request=r,n[1](s)}o[t]=void 0}};var a=setTimeout(function(){s({type:"timeout",target:l})},12e4);l.onerror=l.onload=s,document.head.appendChild(l)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="https://cdn.jsdelivr.net/npm/vditor@0.2.5/dist/",i.oe=function(t){throw console.error(t),t};var r=window.webpackJsonpVditor=window.webpackJsonpVditor||[],s=r.push.bind(r);r.push=e,r=r.slice();for(var l=0;l<r.length;l++)e(r[l]);var a=s;return i(i.s=24)}([function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M32 0v13l-5-5-6 6-3-3 6-6-5-5zM14 21l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=128 height=32 viewBox="0 0 128 32"> <path d="M0 0h128v6.4h-128zM0 12.8h128v6.4h-128zM0 25.6h128v6.4h-128z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M22.996 15.023c1.339-1.591 2.147-3.643 2.147-5.88 0-5.041-4.102-9.143-9.143-9.143h-11.429v32h13.714c5.041 0 9.143-4.102 9.143-9.143 0-3.32-1.779-6.232-4.433-7.834zM11.429 4.571h3.625c1.999 0 3.625 2.051 3.625 4.571s-1.626 4.571-3.625 4.571h-3.625v-9.143zM17.107 27.429h-5.679v-9.143h5.679c2.087 0 3.786 2.051 3.786 4.571s-1.698 4.571-3.786 4.571z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M27.094 19.485v6.12c0 3.059-2.483 5.542-5.542 5.542h-16.010c-3.059 0-5.542-2.483-5.542-5.542v-16.010c0-3.059 2.483-5.542 5.542-5.542h16.010c0.769 0 1.54 0.154 2.251 0.481 0.174 0.077 0.308 0.25 0.346 0.443 0.039 0.211-0.019 0.404-0.174 0.558l-0.943 0.943c-0.115 0.115-0.289 0.193-0.443 0.193-0.058 0-0.115-0.019-0.174-0.039-0.289-0.077-0.578-0.115-0.866-0.115h-16.010c-1.693 0-3.079 1.386-3.079 3.079v16.010c0 1.693 1.386 3.079 3.079 3.079h16.010c1.693 0 3.079-1.386 3.079-3.079v-4.888c0-0.154 0.058-0.308 0.174-0.424l1.232-1.232c0.135-0.135 0.289-0.193 0.443-0.193 0.077 0 0.154 0.019 0.231 0.058 0.231 0.096 0.385 0.308 0.385 0.558zM31.54 10.076l-15.664 15.664c-0.615 0.615-1.578 0.615-2.194 0l-8.275-8.275c-0.615-0.615-0.615-1.578 0-2.194l2.116-2.116c0.615-0.615 1.578-0.615 2.194 0l5.060 5.060 12.451-12.451c0.615-0.615 1.578-0.615 2.194 0l2.116 2.116c0.615 0.615 0.615 1.578 0 2.194z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.053 21.895l2.526 2.526 8.421-8.421-8.421-8.421-2.526 2.526 5.895 5.895z"></path> <path d="M10.947 10.105l-2.526-2.526-8.421 8.421 8.421 8.421 2.526-2.526-5.895-5.895z"></path> <path d="M17.613 6.487l1.828 0.499-5.052 18.527-1.828-0.499 5.052-18.527z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M16 24.789c-3.756 0-6.911-2.254-8.188-5.559h16.376c-1.277 3.305-4.432 5.559-8.188 5.559zM10.366 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM21.634 14.423c-1.352 0-2.404-1.052-2.404-2.404s1.052-2.404 2.404-2.404 2.404 1.052 2.404 2.404-1.052 2.404-2.404 2.404zM16 28.845c7.061 0 12.845-5.784 12.845-12.845s-5.784-12.845-12.845-12.845-12.845 5.784-12.845 12.845 5.784 12.845 12.845 12.845zM16 0c8.864 0 16 7.136 16 16s-7.136 16-16 16-16-7.136-16-16 7.136-16 16-16z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 32 32" width=32px height=32px> <path d="M14 18v13l-5-5-6 6-3-3 6-6-5-5zM32 3l-6 6 5 5h-13v-13l5 5 6-6z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.45 0h3.594c0.595 0 1.078 0.384 1.078 0.858v30.284c0 0.474-0.482 0.858-1.078 0.858h-3.594c-0.595 0-1.078-0.384-1.078-0.858v-30.284c-0-0.474 0.482-0.858 1.078-0.858zM23.888 0h3.673c0.59 0 1.068 0.384 1.068 0.858v30.284c0 0.474-0.478 0.858-1.068 0.858h-3.673c-0.59 0-1.068-0.384-1.068-0.858v-30.284c0-0.474 0.478-0.858 1.068-0.858z"></path> <path d="M25.069 14.167v3.667c0 0.589-0.384 1.065-0.858 1.065h-15.655c-0.474 0-0.858-0.477-0.858-1.065v-3.667c0-0.589 0.384-1.065 0.858-1.065h15.655c0.474 0 0.858 0.477 0.858 1.065z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.652 25v6c0 0.55-0.45 1-1 1h-6c-0.55 0-1-0.45-1-1v-6c0-0.55 0.45-1 1-1h6c0.55 0 1 0.45 1 1zM27.552 10c0 4.75-3.225 6.575-5.6 7.9-1.475 0.85-2.4 2.575-2.4 3.3v0c0 0.55-0.425 1.2-1 1.2h-6c-0.55 0-0.9-0.85-0.9-1.4v-1.125c0-3.025 3-5.625 5.2-6.625 1.925-0.875 2.725-1.7 2.725-3.3 0-1.4-1.825-2.65-3.85-2.65-1.125 0-2.15 0.35-2.7 0.725-0.6 0.425-1.2 1.025-2.675 2.875-0.2 0.25-0.5 0.4-0.775 0.4-0.225 0-0.425-0.075-0.625-0.2l-4.1-3.125c-0.425-0.325-0.525-0.875-0.25-1.325 2.7-4.475 6.5-6.65 11.6-6.65 5.35 0 11.35 4.275 11.35 10z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M23.273 27.636v2.909c0 0.795-0.659 1.455-1.455 1.455h-11.636c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h1.455v-8.727h-1.455c-0.795 0-1.455-0.659-1.455-1.455v-2.909c0-0.795 0.659-1.455 1.455-1.455h8.727c0.795 0 1.455 0.659 1.455 1.455v13.091h1.455c0.795 0 1.455 0.659 1.455 1.455zM20.364 1.455v4.364c0 0.795-0.659 1.455-1.455 1.455h-5.818c-0.795 0-1.455-0.659-1.455-1.455v-4.364c0-0.795 0.659-1.455 1.455-1.455h5.818c0.795 0 1.455 0.659 1.455 1.455z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M18.133 23.467l3.2 3.2 10.667-10.667-10.667-10.667-3.2 3.2 7.467 7.467z"></path> <path d="M13.867 8.533l-3.2-3.2-10.667 10.667 10.667 10.667 3.2-3.2-7.467-7.467z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.714 0v2.286h-4.571l-11.429 27.429h4.571v2.286h-16v-2.286h4.571l11.429-27.429h-4.571v-2.286z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M31.68 14.56h-31.36c-0.176 0-0.32 0.144-0.32 0.32v2.24c0 0.176 0.144 0.32 0.32 0.32h31.36c0.176 0 0.32-0.144 0.32-0.32v-2.24c0-0.176-0.144-0.32-0.32-0.32z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M29.187 2.933l-0.12-0.121c-2.813-2.812-7.415-2.812-10.228 0l-6.516 6.517c-2.812 2.812-2.812 7.415 0 10.227l0.12 0.12c0.234 0.234 0.482 0.446 0.739 0.641l2.386-2.386c-0.278-0.164-0.542-0.361-0.78-0.599l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l6.517-6.516c1.527-1.527 4.012-1.527 5.539 0l0.121 0.12c1.527 1.527 1.527 4.012 0 5.539l-2.948 2.948c0.512 1.264 0.754 2.611 0.733 3.955l4.559-4.559c2.812-2.812 2.812-7.415-0-10.227zM19.557 12.323c-0.234-0.234-0.482-0.446-0.739-0.641l-2.386 2.385c0.278 0.164 0.542 0.361 0.78 0.599l0.121 0.121c1.527 1.527 1.527 4.012 0 5.539l-6.517 6.517c-1.527 1.527-4.012 1.527-5.539 0l-0.121-0.121c-1.527-1.527-1.527-4.012 0-5.539l2.948-2.948c-0.512-1.264-0.754-2.611-0.733-3.955l-4.559 4.559c-2.812 2.812-2.812 7.415 0 10.228l0.12 0.12c2.813 2.812 7.415 2.812 10.228 0l6.516-6.517c2.812-2.812 2.812-7.415 0-10.228l-0.12-0.12z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12 2h20v4h-20v-4zM12 14h20v4h-20v-4zM12 26h20v4h-20v-4zM0 4c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 16c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4zM0 28c0 2.209 1.791 4 4 4s4-1.791 4-4c0-2.209-1.791-4-4-4s-4 1.791-4 4z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M11 26h20v4h-20zM11 14h20v4h-20zM11 2h20v4h-20zM5 0v8h-2v-6h-2v-2zM3 16.438v1.563h4v2h-6v-4.563l4-1.875v-1.563h-4v-2h6v4.563zM7 22v10h-6v-2h4v-2h-4v-2h4v-2h-4v-2z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M0 16c3.037-5.864 9.058-9.802 16-9.802s12.963 3.938 15.953 9.703l0.047 0.1c-3.037 5.864-9.058 9.802-16 9.802s-12.963-3.938-15.953-9.703l-0.047-0.1zM16 22.531c3.607 0 6.531-2.924 6.531-6.531s-2.924-6.531-6.531-6.531v0c-3.607 0-6.531 2.924-6.531 6.531s2.924 6.531 6.531 6.531v0zM16 19.265c-1.804 0-3.265-1.461-3.265-3.265s1.461-3.265 3.265-3.265v0c1.804 0 3.265 1.461 3.265 3.265s-1.461 3.265-3.265 3.265v0z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M7.024 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086zM25.007 13.003c3.862 0 6.993 3.131 6.993 6.993s-3.131 6.993-6.993 6.993-6.993-3.131-6.993-6.993l-0.031-0.999c0-7.724 6.262-13.986 13.986-13.986v3.996c-2.668 0-5.177 1.039-7.064 2.926-0.363 0.363-0.695 0.75-0.994 1.156 0.357-0.056 0.723-0.086 1.096-0.086z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M4.571 16c0 6.312 5.117 11.429 11.429 11.429s11.429-5.117 11.429-11.429v0c0-6.312-5.117-11.429-11.429-11.429s-11.429 5.117-11.429 11.429v0z"></path> <path d="M16 30.857c-8.229 0-14.933-6.705-14.933-14.933s6.705-14.933 14.933-14.933 15.010 6.705 15.010 15.010c0 8.152-6.705 14.857-15.010 14.857zM16 0c-8.838 0-16 7.162-16 16s7.162 16 16 16 16-7.162 16-16-7.162-16-16-16z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M19.583 9.75q-8.667 1.25-13.375 6.625t-6.208 12.958q6.417-9.083 19.583-9.083v7.25l12.417-12.417-12.417-12.417v7.083z"></path> </svg>'},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M32 16v2h-7.328c0.86 1.203 1.328 2.584 1.328 4 0 2.215-1.146 4.345-3.143 5.843-1.855 1.391-4.29 2.157-6.857 2.157s-5.002-0.766-6.857-2.157c-1.998-1.498-3.143-3.628-3.143-5.843h4c0 2.168 2.748 4 6 4s6-1.832 6-4c0-2.168-2.748-4-6-4h-16v-2h9.36c-0.073-0.052-0.146-0.104-0.217-0.157-1.998-1.498-3.143-3.628-3.143-5.843s1.146-4.345 3.143-5.843c1.855-1.391 4.29-2.157 6.857-2.157s5.002 0.766 6.857 2.157c1.997 1.498 3.143 3.628 3.143 5.843h-4c0-2.168-2.748-4-6-4s-6 1.832-6 4c0 2.168 2.748 4 6 4 2.468 0 4.814 0.709 6.64 2h9.36z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M9.846 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM9.846 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 26.462v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM19.692 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 19.077v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM29.538 11.692v-3.692c0-0.346-0.269-0.615-0.615-0.615h-6.154c-0.346 0-0.615 0.269-0.615 0.615v3.692c0 0.346 0.269 0.615 0.615 0.615h6.154c0.346 0 0.615-0.269 0.615-0.615zM32 5.538v20.923c0 1.692-1.385 3.077-3.077 3.077h-25.846c-1.692 0-3.077-1.385-3.077-3.077v-20.923c0-1.692 1.385-3.077 3.077-3.077h25.846c1.692 0 3.077 1.385 3.077 3.077z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M12.417 9.75q8.667 1.25 13.375 6.625t6.208 12.958q-6.417-9.083-19.583-9.083v7.25l-12.417-12.417 12.417-12.417v7.083z"></path> </svg> '},function(t,e){t.exports='<svg xmlns=http://www.w3.org/2000/svg width=32 height=32 viewBox="0 0 32 32"> <path d="M21.334 16.532q0-0.233-0.15-0.384l-5.867-5.867q-0.15-0.15-0.384-0.15t-0.384 0.15l-5.85 5.85q-0.167 0.2-0.167 0.399 0 0.233 0.15 0.384t0.384 0.15h3.733v5.867q0 0.217 0.159 0.375t0.375 0.159h3.2q0.217 0 0.375-0.159t0.159-0.375v-5.867h3.734q0.217 0 0.375-0.159t0.159-0.375zM32 21.332q0 2.65-1.875 4.525t-4.525 1.875h-18.133q-3.083 0-5.275-2.192t-2.192-5.275q0-2.166 1.167-4t3.134-2.75q-0.034-0.5-0.034-0.717 0-3.533 2.5-6.033t6.033-2.5q2.6 0 4.759 1.45t3.142 3.849q1.184-1.033 2.767-1.033 1.767 0 3.017 1.25t1.25 3.017q0 1.267-0.683 2.3 2.166 0.516 3.558 2.258t1.392 3.975z"></path> </svg>'},function(t,e,n){"use strict";n.r(e);var o="0.2.5",i=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-counter",this.render(0,t.options.counter)}return t.prototype.render=function(t,e){this.element.className=t>e?"vditor-counter vditor-counter--error":"vditor-counter",this.element.innerHTML=t+"/"+e},t}(),r=/highlight-(?:text|source)-([a-z0-9]+)/;function s(t){t.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return"DIV"===t.nodeName&&r.test(t.className)&&e&&"PRE"===e.nodeName},replacement:function(t,e,n){var o=((e.className||"").match(r)||[null,""])[1];return"\n\n"+n.fence+o+"\n"+e.firstChild.textContent+"\n"+n.fence+"\n\n"}})}function l(t){t.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~"+t+"~"}})}var a=Array.prototype.indexOf,c=Array.prototype.every,p={};function u(t){var e,n,o=t.parentNode;return"THEAD"===o.nodeName||o.firstChild===t&&("TABLE"===o.nodeName||(n=(e=o).previousSibling,"TBODY"===e.nodeName&&(!n||"THEAD"===n.nodeName&&/^\s*$/i.test(n.textContent))))&&c.call(t.childNodes,function(t){return"TH"===t.nodeName})}function d(t,e){var n=" ";return 0===a.call(e.parentNode.childNodes,e)&&(n="| "),n+t+" |"}function h(t){for(var e in t.keep(function(t){return"TABLE"===t.nodeName&&!u(t.rows[0])}),p)t.addRule(e,p[e])}function f(t){t.addRule("taskListItems",{filter:function(t){return"checkbox"===t.type&&"LI"===t.parentNode.nodeName},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function v(t){t.use([s,l,h,f])}p.tableCell={filter:["th","td"],replacement:function(t,e){return d(t,e)}},p.tableRow={filter:"tr",replacement:function(t,e){var n="",o={left:":--",right:"--:",center:":-:"};if(u(e))for(var i=0;i<e.childNodes.length;i++){var r="---",s=(e.childNodes[i].getAttribute("align")||"").toLowerCase();s&&(r=o[s]||r),n+=d(r,e.childNodes[i])}return"\n"+t+(n?"\n"+n:"")}},p.table={filter:function(t){return"TABLE"===t.nodeName&&u(t.rows[0])},replacement:function(t){return"\n\n"+(t=t.replace("\n\n","\n"))+"\n\n"}},p.tableSection={filter:["thead","tbody","tfoot"],replacement:function(t){return t}};var m,g={en_US:{bold:"Blod",check:"Task List",code:"Code Block",emoji:"Emoji",fullscreen:"Fullscreen",headings:"Headings",help:"Help",info:"Info","inline-code":"Inline Code",italic:"Italic",line:"Line",link:"Link",list:"List","ordered-list":"Order List",over:"over",preview:"Preview",quote:"Quote",record:"Start Record/End Record",recording:"recording...",redo:"Redo",strike:"Strike",table:"Table",undo:"Undo",upload:"Upload image or file",uploading:"uploading..."},zh_CN:{bold:"粗体",check:"任务列表",code:"代码块",emoji:"表情",fullscreen:"全屏",headings:"标题",help:"帮助",info:"关于","inline-code":"行内代码",italic:"斜体",line:"分隔线",link:"链接",list:"无序列表","ordered-list":"有序列表",over:"超过",preview:"预览",quote:"引用",record:"开始录音/结束录音",recording:"录音中...",redo:"重做",strike:"删除线",table:"表格",undo:"撤销",upload:"上传图片或文件",uploading:"上传中..."}},y=function(){return function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload",this.element.innerHTML='<div class="vditor-upload__progress"></div><div class="vditor-upload__close">x</div>',this.element.children[1].addEventListener("click",function(){this.parentElement.style.opacity=0,this.parentElement.className="vditor-upload"})}}(),w=function(t,e,n){for(var o=new FormData,i=[],r=0,s=e.length;r<s;r++){var l=e[r];l instanceof DataTransferItem&&(l=l.getAsFile()),l.size<=t.options.upload.max&&(o.append("file[]",l),i.push(l))}if(t.upload.element.className="vditor-upload",t.upload.element.children[0].innerHTML="",_(t.editor.element,function(t,e){for(var n="",o=e.length,i=0;i<o;i++){var r=e[i];r instanceof DataTransferItem&&(r=r.getAsFile());var s=-1===r.type.indexOf("image")?"":"!";if(!r.name)return"";var l=r.name.lastIndexOf("."),a=t.options.upload.filename(r.name.substr(0,l))+r.name.substr(l),c=t.options.lang;r.size>t.options.upload.max?(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=r.name+" "+g[c].over+" "+t.options.upload.max/1024/1024+"M"):n+=s+"["+a+"]("+g[c].uploading+")\n"}return n}(t,e),""),0!==i.length){if(!t.options.upload.url||!t.upload)return n&&(n.value=""),void alert("please config: options.upload.url");var a=new XMLHttpRequest;a.open("POST",t.options.upload.url),t.options.upload.token&&a.setRequestHeader("X-Upload-Token",t.options.upload.token),t.upload.isUploading=!0,t.editor.element.setAttribute("disabled","disabled"),a.onreadystatechange=function(){a.readyState===XMLHttpRequest.DONE&&(t.upload.isUploading=!1,n&&(n.value=""),t.editor.element.removeAttribute("disabled"),200===a.status?(t.options.upload.success?t.options.upload.success(t.editor.element,a.responseText):function(t,e,n,o){t.focus();var i=JSON.parse(e);1===i.code&&(o.className="vditor-upload vditor-upload--tip",o.children[0].innerHTML=i.msg),i.data.errFiles.forEach(function(e){var o=e.lastIndexOf("."),i="["+(n.upload.filename(e.substr(0,o))+e.substr(o))+"]("+g[n.lang].uploading+")";t.selectionStart=t.value.split(i)[0].length,t.selectionEnd=t.selectionStart+i.length,_(t,"","",!0)}),Object.keys(i.data.succMap).forEach(function(e){var o=i.data.succMap[e];if(o.indexOf(".wav")!==o.length-4){var r=e.lastIndexOf("."),s=n.upload.filename(e.substr(0,r))+e.substr(r),l="["+s+"]("+g[n.lang].uploading+")";t.selectionStart=t.value.split(l)[0].length,t.selectionEnd=t.selectionStart+l.length,_(t,"["+s+"]("+o+")","",!0)}else _(t,'<audio controls="controls" src="'+o+'"></audio>\n',"")})}(t.editor.element,a.responseText,t.options,t.upload.element),t.upload.element.style.opacity="0"):t.options.upload.error?t.options.upload.error(a.responseText):(t.upload.element.className="vditor-upload vditor-upload--tip",t.upload.element.children[0].innerHTML=a.responseText||"401"))},a.upload.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total*100;t.upload.element.style.opacity="1",t.upload.element.children[0].style.width=n+"%"}},a.send(o)}else n&&(n.value="")},b=function(){function t(t){this.element=document.createElement("textarea"),this.element.className="vditor-textarea",this.element.setAttribute("placeholder",t.options.placeholder),t.options.cache&&(this.element.value=localStorage.getItem("vditor"+t.id),t.options.counter>0&&t.counter.render(this.element.value.length,t.options.counter)),this.bindEvent(t)}return t.prototype.html2md=function(t,e,n,o){var i=!1;t.prototype.escape=function(t){return t};var r=new t;r.addRule("strikethrough",{filter:["pre","code"],replacement:function(t,e){return"PRE"===e.parentElement.tagName?t:t.split("\n").length>1?(i=!0,"```\n"+t+"\n```"):"`"+t+"`"}}),r.addRule("strikethrough",{filter:["img"],replacement:function(t,n){if(!n.getAttribute("src"))return"";if(e.options.upload.linkToImgUrl){var o=new XMLHttpRequest;o.open("POST",e.options.upload.linkToImgUrl),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE&&200===o.status){var t=JSON.parse(o.responseText);if(0!==t.code)return void alert(t.msg);var i=n.getAttribute("src");e.editor.element.selectionStart=e.editor.element.value.split(i)[0].length,e.editor.element.selectionEnd=e.editor.element.selectionStart+i.length,_(e.editor.element,t.data.url,"",!0)}},o.send(JSON.stringify({url:n.getAttribute("src")}))}return"+")"}}),r.use(v);var s=r.turndown(n);if(i){var l=document.createElement("div");l.innerHTML=n,l.querySelectorAll("pre").length>1?i=!1:"```"===s.substr(0,3)&&"```"===s.substr(s.length-3,3)||(i=!1)}_(e.editor.element,i?"```\n"+o+"\n```":s,"",!0)},t.prototype.bindEvent=function(t){var e,o=this;this.element.addEventListener("input",function(){t.options.counter>0&&t.counter.render(o.element.value.length,t.options.counter),"function"==typeof t.options.input&&t.options.input(o.element.value,t.preview&&t.preview.element),t.hint&&t.hint.render(),t.options.cache&&localStorage.setItem("vditor"+t.id,t.editor.element.value),t.preview&&t.preview.render(t)}),this.element.addEventListener("focus",function(){(t.options.focus&&t.options.focus(o.element.value),t.toolbar.elements.emoji&&t.toolbar.elements.emoji.children[1])&&(t.toolbar.elements.emoji.children[1].style.display="none");t.toolbar.elements.headings&&t.toolbar.elements.headings.children[1]&&(t.toolbar.elements.headings.children[1].style.display="none")}),this.element.addEventListener("blur",function(){t.options.blur&&t.options.blur(o.element.value)}),t.options.select&&(this.element.onselect=function(){t.options.select(o.element.value.substring(o.element.selectionStart,o.element.selectionEnd))}),this.element.addEventListener("scroll",function(){if("none"!==t.preview.element.style.display||t.preview){var e=o.element.scrollTop,n=o.element.clientHeight,i=o.element.scrollHeight,r=t.preview.element;r.scrollTop=e/n>.5?(e+n)*r.scrollHeight/i-n:e*r.scrollHeight/i}}),t.options.upload.url&&this.element.addEventListener("drop",function(e){e.stopPropagation(),e.preventDefault();var n=e.dataTransfer.items;0!==n.length&&w(t,n)});var i=this.html2md;this.element.addEventListener("paste",function(o){o.stopPropagation(),o.preventDefault();var r=o;if(""!==r.clipboardData.getData("text/html").replace(/(^\s*)|(\s*)$/g,"")){var s=r.clipboardData.getData("text/html"),l=r.clipboardData.getData("text/plain");if(!e)return void n.e(1).then(n.bind(null,26)).then(function(n){e=n.default,i(e,t,s,l)}).catch(function(t){console.error("Failed to load turndown",t)});i(e,t,s,l)}else if(""!==r.clipboardData.getData("text/plain").replace(/(^\s*)|(\s*)$/g,"")&&0===r.clipboardData.files.length)_(o.target,r.clipboardData.getData("text/plain"),"",!0);else if(r.clipboardData.files.length>0){if(!t.options.upload.url)return;w(t,r.clipboardData.files)}})},t}(),_=function(t,e,n,o){if("number"==typeof t.selectionStart&&"number"==typeof t.selectionEnd){var i=t.selectionStart,r=t.selectionEnd,s=t.value;if(t.focus(),/firefox/i.test(navigator.userAgent)||/edge/i.test(navigator.userAgent)||/msie/i.test(navigator.userAgent)||/trident/i.test(navigator.userAgent)){i===r?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=t.selectionStart=r+e.length):o?(t.value=s.substring(0,i)+e+n+s.substring(r,s.length),t.selectionEnd=i+e.length+n.length):s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n?(t.value=s.substring(0,i-e.length)+s.substring(i,r)+s.substring(r+n.length,s.length),t.selectionStart=i-e.length,t.selectionEnd=r-e.length):(t.value=s.substring(0,i)+e+s.substring(i,r)+n+s.substring(r,s.length),t.selectionStart=i+e.length,t.selectionEnd=r+e.length);var l=document.createEvent("HTMLEvents");l.initEvent("input",!0,!1),t.dispatchEvent(l)}else if(i===r)document.execCommand("insertText",!1,e+n),t.selectionStart=t.selectionEnd=t.selectionStart-n.length;else if(o)document.execCommand("insertText",!1,e+n);else if(s.substring(i-e.length,i)===e&&s.substring(r,r+n.length)===n){document.execCommand("delete",!1);for(var a=0,c=e.length;a<c;a++)document.execCommand("delete",!1);for(var p=0,u=n.length;p<u;p++)document.execCommand("forwardDelete",!1);document.execCommand("insertText",!1,s.substring(i,r)),t.selectionStart=i-e.length,t.selectionEnd=r-e.length}else document.execCommand("insertText",!1,e+s.substring(i,r)+n),t.selectionStart=i+e.length,t.selectionEnd=r+e.length}},E=function(t){var e=window.getComputedStyle(t),n=document.querySelector(".vditor-position");n||((n=document.createElement("div")).className="vditor-position",document.body.appendChild(n));var o=n.style;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.overflow="hidden",o.left="-100%",["direction","box-sizing","width","height","overflow-x","overflow-y","border-top-width","border-right-width","border-bottom-width","border-left-width","border-style","padding-top","padding-right","padding-bottom","padding-left","font-style","font-variant","font-weight","font-stretch","font-size","text-size-adjust","line-height","font-family","text-align","text-transform","text-indent","text-decoration","letter-spacing","word-spacing","tab-size","tab-size"].forEach(function(t){o.setProperty(t,e.getPropertyValue(t))}),n.textContent=t.value.substring(0,t.selectionEnd);var i=document.createElement("span");return i.textContent=t.value.substring(t.selectionEnd)||".",n.appendChild(i),{left:i.offsetLeft-t.scrollLeft,top:i.offsetTop-t.scrollTop+parseInt(e.lineHeight,10)}},x=function(){function t(t){this.timeId=-1,this.hint=t.options.hint,this.editorElement=t.editor.element,this.element=document.createElement("ul"),this.element.className="vditor-hint",this.editorElement.parentElement.appendChild(this.element)}return t.prototype.render=function(){var t=this,e=this.editorElement.value.substr(0,this.editorElement.selectionStart).split("\n").slice(-1).pop(),o=this.getKey(e,"@"),i=this.getKey(e,":");void 0===o&&void 0===i?(this.element.style.display="none",clearTimeout(this.timeId)):(void 0!==o&&this.hint.at&&(clearTimeout(this.timeId),this.timeId=setTimeout(function(){t.genHTML(t.hint.at(o),o)},this.hint.delay)),void 0!==i&&n.e(2).then(n.bind(null,27)).then(function(e){var n=""===i?t.hint.emoji:e.getAllEmoji(t.hint.emojiPath),o=[];Object.keys(n).forEach(function(t){0===t.indexOf(i.toLowerCase())&&(n[t].indexOf(".")>-1?o.push({html:'<img src="'+n[t]+'" title=":'+t+':"/> :'+t+":",value:":"+t+":"}):o.push({html:'<span class="vditor-hint__emoji">'+n[t]+"</span>"+t,value:n[t]}))}),t.genHTML(o,i)}).catch(function(t){console.error("Failed to load emoji",t)}))},t.prototype.getKey=function(t,e){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n,o=t.split(e);if(o.length>1)if(2===o.length&&""===o[0])(""===o[1]||""!==o[1].trim())&&-1===o[1].indexOf(" ")&&o[1].length<33&&(n=o[1]);else{var i=o[o.length-2],r=o.slice(-1).pop();" "===i.slice(-1)&&-1===r.indexOf(" ")&&(""===r||""!==r.trim())&&r.length<33&&(n=r)}return n},t.prototype.genHTML=function(t,e){var n=this;if(0!==t.length){var o=E(this.editorElement),i=o.left,r=o.top-4,s="";t.forEach(function(t,n){if(!(n>7)){var o=t.html;if(""!==e){var i=o.lastIndexOf(">")+1,r=o.substr(i),l=r.toLowerCase().indexOf(e.toLowerCase());l>-1&&(r=r.substring(0,l)+"<b>"+r.substring(l,l+e.length)+"</b>"+r.substring(l+e.length),o=o.substr(0,i)+r)}s+='<li data-value="'+t.value+' " class="'+(n||"vditor-hint--current")+'"> '+o+"</li>"}}),this.element.innerHTML=s,this.element.style.top=r+"px",this.element.style.left=i+"px",this.element.style.display="block",this.element.querySelectorAll("li").forEach(function(t){t.addEventListener("click",function(){n.element.style.display="none";var e=t.getAttribute("data-value"),o=0===e.indexOf("@")?"@":":";n.editorElement.selectionStart=n.editorElement.value.substr(0,n.editorElement.selectionEnd).lastIndexOf(o),_(n.editorElement,e,"",!0)})}),r+this.element.offsetHeight-this.editorElement.offsetHeight>window.innerHeight-(this.editorElement.parentElement.offsetHeight+this.editorElement.parentElement.offsetTop-document.documentElement.scrollTop)&&(this.element.style.top=r-this.element.offsetHeight+"px")}else this.element.style.display="none"},t}(),O=function(){function t(t){this.editorElement=t.editor.element,this.toolbarElements=t.toolbar.elements,this.options=t.options,this.hintElement=t.hint.element,this.bindHotkey()}return t.prototype.bindHotkey=function(){var t=this;this.editorElement.addEventListener("keydown",function(e){t.options.esc&&e.key.toLowerCase()==="Escape".toLowerCase()&&t.options.esc(t.editorElement.value),t.options.ctrlEnter&&(e.metaKey||e.ctrlKey)&&"enter"===e.key.toLowerCase()&&t.options.ctrlEnter(t.editorElement.value),t.options.toolbar.forEach(function(n){if(n.hotkey){var o=n.hotkey.split("-");"ctrl"!==o[0]&&"⌘"!==o[0]||!e.metaKey&&!e.ctrlKey||e.key===o[1]&&(t.toolbarElements[n.name].children[0].click(),e.preventDefault(),e.stopPropagation())}}),(t.options.hint.at||t.toolbarElements.emoji)&&t.hint(e)})},t.prototype.hint=function(t){if(0!==this.hintElement.querySelectorAll("li").length&&"none"!==this.hintElement.style.display){var e=this.hintElement.querySelector(".vditor-hint--current");if("arrowdown"===t.key.toLowerCase())t.preventDefault(),t.stopPropagation(),e.nextElementSibling?e.nextElementSibling.className="vditor-hint--current":this.hintElement.children[0].className="vditor-hint--current",e.removeAttribute("class");else if("arrowup"===t.key.toLowerCase()){if(t.preventDefault(),t.stopPropagation(),e.previousElementSibling)e.previousElementSibling.className="vditor-hint--current";else{var n=this.hintElement.children.length;this.hintElement.children[n-1].className="vditor-hint--current"}e.removeAttribute("class")}else if("enter"===t.key.toLowerCase()){t.preventDefault(),t.stopPropagation(),this.hintElement.style.display="none";var o=e.getAttribute("data-value"),i=0===o.indexOf("@")?"@":":";this.editorElement.selectionStart=this.editorElement.value.substr(0,this.editorElement.selectionEnd).lastIndexOf(i),_(this.editorElement,o,"",!0)}}},t}(),M=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-preview"+(t.options.classes.preview?" "+t.options.classes.preview:""),t.options.preview.show||(this.element.style.display="none"),"none"!==this.element.style.display&&this.render(t)}return t.prototype.render=function(t,e){var n=this;"none"!==this.element.style.display&&(e?this.element.innerHTML=e:""!==t.editor.element.value.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")?t.options.preview.url?(clearTimeout(t.mdTimeoutId),t.mdTimeoutId=setTimeout(function(){var e=new XMLHttpRequest;e.open("POST",t.options.preview.url),e.onreadystatechange=function(){if(e.readyState===XMLHttpRequest.DONE&&200===e.status){var o=JSON.parse(e.responseText);if(0!==o.code)return void alert(o.msg);n.element.innerHTML=o.data,t.options.preview.parse&&t.options.preview.parse(n.element)}},e.send(JSON.stringify({markdownText:t.editor.element.value}))},t.options.preview.delay)):this.element.innerHTML=t.editor.element.value:this.element.innerHTML="")},t}(),k=n(1),L=n.n(k),T=function(){function t(t){this.element=document.createElement("div"),this.element.className="vditor-resize",this.element.innerHTML=L.a,this.bindEvent(t)}return t.prototype.bindEvent=function(t){this.element.addEventListener("mousedown",function(e){var n=document,o=document.getElementById(t.id),i=e.clientY,r=o.offsetHeight;n.ondragstart=function(){return!1},n.onselectstart="return false;",n.onselect=function(){document.selection.empty()},window.captureEvents&&window.captureEvents(),n.onmousemove=function(e){"top"===t.options.resize.position?o.style.height=Math.max(100,r+(i-e.clientY))+"px":o.style.height=Math.max(100,r+(e.clientY-i))+"px"},n.onmouseup=function(){t.options.resize.after&&t.options.resize.after(o.offsetHeight-r),window.captureEvents&&window.captureEvents(),n.onmousemove=null,n.onmouseup=null,n.ondragstart=null,n.onselectstart=null,n.onselect=null}})},t}(),P=n(2),A=n.n(P),j=function(){function t(t,e){this.menuItem=e,this.editorElement=t.editor.element,this.element=document.createElement("div");var n=document.createElement("div");n.className="vditor-tooltipped vditor-tooltipped__"+e.tipPosition;var o=this.menuItem.hotkey?" <"+this.menuItem.hotkey+">":"";o=/Mac/.test(navigator.platform)?o.replace("ctrl","⌘"):o.replace("⌘","ctrl"),n.setAttribute("aria-label",this.menuItem.tip||g[t.options.lang][this.menuItem.name]+o),this.element.appendChild(n)}return t.prototype.bindEvent=function(){var t=this;this.element.children[0].addEventListener("click",function(){_(t.editorElement,t.menuItem.prefix||"",t.menuItem.suffix||"")})},t}(),z=(m=function(t,e){return(m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}m(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),S=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||A.a,o.bindEvent(),o}return z(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),H=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__br"}}(),N=n(3),C=n.n(N),B=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),F=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||C.a,o.bindEvent(),o}return B(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),D=n(4),I=n.n(D),R=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),q=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||I.a,o.bindEvent(),o}return R(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),U=function(){return function(){this.element=document.createElement("div"),this.element.className="vditor-menu__divider"}}(),V=n(5),W=n.n(V),J=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),K=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||W.a;var i=document.createElement("div");i.className="vditor-panel";var r="";Object.keys(e.options.hint.emoji).forEach(function(t){var n=e.options.hint.emoji[t];n.indexOf(".")>-1?r+='<span data-value=":'+t+': " title=":'+t+':"><img data-value=":'+t+': "\nsrc="'+n+'"/></span>':r+='<span data-value="'+n+' " title="'+t+'">'+n+"</span>"});var s=e.options.hint.emojiTail?'<div class="vditor-emojis__tail">'+e.options.hint.emojiTail+"</div>":"";return i.innerHTML='<div class="vditor-emojis">'+r+"</div>"+s,o.element.appendChild(i),o._bindEvent(i,e),o}return J(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.headings&&(e.toolbar.elements.headings.children[1].style.display="none"))}),t.querySelectorAll(".vditor-emojis span").forEach(function(n){n.addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),"",!0),t.style.display="none"})})},e}(j),X=n(6),$=n.n(X),Y=n(0),G=n.n(Y),Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Z=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||G.a,o._bindEvent(e,n),o}return Q(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n=document.getElementById(t.id);n.className.indexOf("vditor--fullscreen")>-1?(this.innerHTML=e.icon||G.a,n.className=n.className.replace(" vditor--fullscreen",""),Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__s","__n"))})):(this.innerHTML=e.icon||$.a,n.className=n.className+" vditor--fullscreen",Object.keys(t.toolbar.elements).forEach(function(e){var n=t.toolbar.elements[e].firstChild;n&&(n.className=n.className.replace("__n","__s"))}))})},e}(j),tt=n(7),et=n.n(tt),nt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ot=function(t){function e(e,n){var o=t.call(this,e,n)||this;o.element.children[0].innerHTML=n.icon||et.a;var i=document.createElement("div");return i.className="vditor-panel",i.innerHTML='<h1 data-value="# ">Heading 1</h1>\n<h2 data-value="## ">Heading 2</h2>\n<h3 data-value="### ">Heading 3</h3>\n<h4 data-value="#### ">Heading 4</h4>\n<h5 data-value="##### ">Heading 5</h5>\n<h6 data-value="###### ">Heading 6</h6>',o.element.appendChild(i),o._bindEvent(i,e),o}return nt(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){"block"===t.style.display?t.style.display="none":(t.style.display="block",e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.children[1].style.display="none"))});for(var n=0;n<6;n++)t.children.item(n).addEventListener("click",function(n){_(e.editor.element,n.target.getAttribute("data-value"),""),t.style.display="none"})},e}(j),it=n(8),rt=n.n(it),st=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),lt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||rt.a,o.bindEvent(),o}return st(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://hacpai.com/guide/markdown")})},e}(j),at=n(9),ct=n.n(at),pt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ut=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ct.a,o.bindEvent(),o}return pt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){window.open("https://github.com/b3log/vditor")})},e}(j),dt=n(10),ht=n.n(dt),ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),vt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ht.a,o.bindEvent(),o}return ft(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),mt=n(11),gt=n.n(mt),yt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),wt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||gt.a,o.bindEvent(),o}return yt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),bt=n(12),_t=n.n(bt),Et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),xt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||_t.a,o.bindEvent(),o}return Et(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Ot=n(13),Mt=n.n(Ot),kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Lt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Mt.a,o.bindEvent(),o}return kt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Tt=n(14),Pt=n.n(Tt),At=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Pt.a,o.bindEvent(),o}return At(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),zt=n(15),St=n.n(zt),Ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Nt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||St.a,o.bindEvent(),o}return Ht(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Ct=n(16),Bt=n.n(Ct),Ft=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Dt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Bt.a,e.options.preview.show&&(o.element.children[0].className="vditor-tooltipped vditor-tooltipped__"+n.tipPosition+" vditor-menu--current"),o._bindEvent(e,n),o}return Ft(e,t),e.prototype._bindEvent=function(t,e){this.element.children[0].addEventListener("click",function(){var n,o=document.getElementById(t.id);"block"===t.preview.element.style.display?(t.preview.element.style.display="none",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition):(t.preview.element.style.display="block",n="vditor-tooltipped vditor-tooltipped__"+e.tipPosition+" vditor-menu--current",t.preview.render(t)),o.className.indexOf("vditor--fullscreen")>-1&&(n=n.replace("__n","__s")),this.className=n})},e}(j),It=n(17),Rt=n.n(It),qt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Ut=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Rt.a,o.bindEvent(),o}return qt(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),Vt=n(18),Wt=n.n(Vt),Jt=function(){function t(t){var e;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)e=new AudioContext;else{if(!webkitAudioContext)return;e=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=e.sampleRate;var n=e.createGain();e.createMediaStreamSource(t).connect(n),this.recorder=e.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(e.destination),this.readyFlag=!0}return t.prototype.cloneChannelData=function(t,e){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(e)),this.recordingLength+=2048},t.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},t.prototype.stopRecording=function(){this.isRecording=!1},t.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),e=this.mergeBuffers(this.rightChannel),n=new Float32Array(t.length),o=0;o<t.length;++o)n[o]=.5*(t[o]+e[o]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var i=44+2*n.length,r=new ArrayBuffer(i),s=new DataView(r);this.writeUTFBytes(s,0,"RIFF"),s.setUint32(4,i,!0),this.writeUTFBytes(s,8,"WAVE"),this.writeUTFBytes(s,12,"fmt "),s.setUint32(16,16,!0),s.setUint16(20,1,!0),s.setUint16(22,1,!0),s.setUint32(24,this.SAMPLE_RATE,!0),s.setUint32(28,2*this.SAMPLE_RATE,!0),s.setUint16(32,2,!0),s.setUint16(34,16,!0);var l=2*n.length;this.writeUTFBytes(s,36,"data"),s.setUint32(40,l,!0);for(var a=n.length,c=44,p=0;p<a;p++)s.setInt16(c,32767*n[p],!0),c+=2;return new Blob([s],{type:"audio/wav"})},t.prototype.downSampleBuffer=function(t,e){if(e===this.DEFAULT_SAMPLE_RATE)return t;if(e>this.DEFAULT_SAMPLE_RATE)return t;for(var n=this.DEFAULT_SAMPLE_RATE/e,o=Math.round(t.length/n),i=new Float32Array(o),r=0,s=0;r<i.length;){for(var l=Math.round((r+1)*n),a=0,c=0,p=s;p<l&&p<t.length;p++)a+=t[p],c++;i[r]=a/c,r++,s=l}return i},t.prototype.mergeBuffers=function(t){for(var e=new Float32Array(this.recordingLength),n=0,o=t.length,i=0;i<o;++i){var r=t[i];e.set(r,n),n+=r.length}return e},t.prototype.writeUTFBytes=function(t,e,n){for(var o=n.length,i=0;i<o;i++)t.setUint8(e+i,n.charCodeAt(i))},t}(),Kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Xt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Wt.a,o._bindEvent(e),o}return Kt(e,t),e.prototype._bindEvent=function(t){var e;this.element.children[0].addEventListener("click",function(){if(e)if(e.isRecording){e.stopRecording(),t.upload.element.className="vditor-upload";var n=new File([e.buildWavFileBlob()],"record"+(new Date).getTime()+".wav",{type:"video/webm"});w(t,[n])}else t.upload.element.children[0].innerHTML=g[t.options.lang].recording,t.upload.element.style.opacity="1",t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled"),e.startRecordingNewWavFile();else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(n){(e=new Jt(n)).recorder.onaudioprocess=function(t){if(e.isRecording){var n=t.inputBuffer.getChannelData(0),o=t.inputBuffer.getChannelData(1);e.cloneChannelData(n,o)}},e.startRecordingNewWavFile(),t.upload.element.children[0].innerHTML=g[t.options.lang].recording,t.upload.element.style.opacity="1",t.upload.element.className="vditor-upload vditor-upload--tip",t.editor.element.setAttribute("disabled","disabled")}).catch(function(t){console.error("init media error:",t)})})},e}(j),$t=n(19),Yt=n.n($t),Gt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Qt=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||Yt.a,o.bindEvent(),o}return Gt(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("redo")})},e}(j),Zt=n(20),te=n.n(Zt),ee=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ne=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||te.a,o.bindEvent(),o}return ee(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),oe=n(21),ie=n.n(oe),re=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),se=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ie.a,o.bindEvent(),o}return re(e,t),e.prototype.bindEvent=function(){t.prototype.bindEvent.call(this)},e}(j),le=n(22),ae=n.n(le),ce=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),pe=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML=n.icon||ae.a,o.bindEvent(),o}return ce(e,t),e.prototype.bindEvent=function(){this.element.children[0].addEventListener("click",function(){document.execCommand("undo")})},e}(j),ue=n(23),de=n.n(ue),he=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),fe=function(t){function e(e,n){var o=t.call(this,e,n)||this;return o.element.children[0].innerHTML="<label>"+(n.icon||de.a)+'<input multiple="multiple" type="file"></label>',o._bindEvent(e),o}return he(e,t),e.prototype._bindEvent=function(t){this.element.querySelector("input").addEventListener("change",function(e){0!==e.target.files.length&&w(t,e.target.files,e.target)})},e}(j),ve=function(){return function(t){var e=this,n=t.options;this.elements={},n.toolbar.forEach(function(n,o){var i;switch(n.name){case"emoji":i=new K(t,n);break;case"bold":i=new S(t,n);break;case"headings":i=new ot(t,n);break;case"|":i=new U;break;case"br":i=new H;break;case"italic":i=new wt(t,n);break;case"strike":i=new ne(t,n);break;case"line":i=new xt(t,n);break;case"quote":i=new Ut(t,n);break;case"list":i=new jt(t,n);break;case"ordered-list":i=new Nt(t,n);break;case"check":i=new F(t,n);break;case"undo":i=new pe(t,n);break;case"redo":i=new Qt(t,n);break;case"code":i=new q(t,n);break;case"inline-code":i=new vt(t,n);break;case"link":i=new Lt(t,n);break;case"help":i=new lt(t,n);break;case"table":i=new se(t,n);break;case"preview":i=new Dt(t,n);break;case"fullscreen":i=new Z(t,n);break;case"upload":i=new fe(t,n);break;case"record":i=new Xt(t,n);break;case"info":i=new ut(t,n);break;default:console.error("menu item no matched")}var r=n.name;"br"!==r&&"|"!==r||(r+=o),e.elements[r]=i.element})}}(),me=function(){return function(t){var e=document.getElementById(t.id);e.className="vditor"+(e.className?" "+e.className:""),"number"==typeof t.options.height&&(e.style.height=t.options.height+"px"),"number"==typeof t.options.width?e.style.width=t.options.width+"px":e.style.width=t.options.width;var n=document.createElement("div");n.className="vditor-toolbar",Object.keys(t.toolbar.elements).forEach(function(e){n.appendChild(t.toolbar.elements[e])}),e.appendChild(n),t.options.resize.enable&&"top"===t.options.resize.position&&e.appendChild(t.resize.element);var o=document.createElement("div");o.className="vditor-content",o.appendChild(t.editor.element),t.preview&&o.appendChild(t.preview.element),t.options.counter>0&&o.appendChild(t.counter.element),t.upload&&o.appendChild(t.upload.element),e.appendChild(o),t.options.resize.enable&&"bottom"===t.options.resize.position&&e.appendChild(t.resize.element),document.onclick=function(t){var e=t.target.closest(".vditor-tooltipped");e&&e.nextSibling&&"vditor-panel"===e.nextSibling.className||(document.querySelectorAll(".vditor-hint").forEach(function(t){t.style.display="none"}),document.querySelectorAll(".vditor-panel").forEach(function(t){t.style.display="none"}))}}}(),ge=function(){function t(t){this.defaultOptions={cache:!0,classes:{preview:""},counter:0,height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",cold_sweat:"😰",heart:"❤️"},emojiPath:"https://cdn.jsdelivr.net/npm/vditor/src/assets/emoji"},lang:"zh_CN",placeholder:"",preview:{delay:1e3,show:!1},resize:{enable:!1,position:"bottom"},toolbar:[{hotkey:"⌘-e",name:"emoji",tipPosition:"ne"},{hotkey:"⌘-h",name:"headings",tipPosition:"ne"},{hotkey:"⌘-b",name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘-i",name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘-s",name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{name:"|"},{hotkey:"⌘-d",name:"line",prefix:"---\n",tipPosition:"n"},{hotkey:"⌘-.",name:"quote",prefix:"> ",tipPosition:"n"},{name:"|"},{hotkey:"⌘-l",name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘-o",name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘-j",name:"check",prefix:"* [ ] ",tipPosition:"n"},{name:"|"},{hotkey:"⌘-u",name:"code",prefix:"```\n",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘-g",name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{name:"|"},{hotkey:"⌘-z",name:"undo",tipPosition:"n"},{hotkey:"⌘-y",name:"redo",tipPosition:"n"},{name:"|"},{name:"upload",tipPosition:"n"},{hotkey:"⌘-k",name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{hotkey:"⌘-m",name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"record",tipPosition:"n"},{name:"|"},{hotkey:"⌘-p",name:"preview",tipPosition:"nw"},{hotkey:"⌘-f",name:"fullscreen",tipPosition:"nw"},{name:"info",tipPosition:"nw"},{name:"help",tipPosition:"nw"},{name:"br"}],upload:{filename:function(t){return t.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,url:""},width:"auto"},this.options=t}return t.prototype.merge=function(){var t=this,e=[];this.options&&(this.options.toolbar&&this.options.toolbar.forEach(function(n){var o;t.defaultOptions.toolbar.forEach(function(t){"string"==typeof n&&t.name===n&&(o=t),"object"==typeof n&&t.name===n.name&&(o=Object.assign({},t,n))}),e.push(o)}),this.options.upload&&(this.options.upload=Object.assign({},this.defaultOptions.upload,this.options.upload)),this.options.classes&&(this.options.classes=Object.assign({},this.defaultOptions.classes,this.options.classes)),this.options.preview&&(this.options.preview=Object.assign({},this.defaultOptions.preview,this.options.preview)),this.options.hint&&(this.options.hint=Object.assign({},this.defaultOptions.hint,this.options.hint)),this.options.resize&&(this.options.resize=Object.assign({},this.defaultOptions.resize,this.options.resize)));var n=Object.assign({},this.defaultOptions,this.options);return e.length>0&&(n.toolbar=e),n},t}(),ye=function(){function t(t,e){this.version=o;var n=new ge(e).merge();if(this.vditor={id:t,mdTimeoutId:-1,options:n},n.counter>0){var r=new i(this.vditor);this.vditor.counter=r}var s=new b(this.vditor);if(this.vditor.editor=s,n.resize.enable){var l=new T(this.vditor);this.vditor.resize=l}if(n.toolbar){var a=new ve(this.vditor);this.vditor.toolbar=a}if(this.vditor.toolbar.elements.preview){var c=new M(this.vditor);this.vditor.preview=c}if(n.upload.url){var p=new y;this.vditor.upload=p}new me(this.vditor);if(this.vditor.options.hint.at||this.vditor.toolbar.elements.emoji){var u=new x(this.vditor);this.vditor.hint=u}new O(this.vditor)}return t.prototype.getValue=function(){return this.vditor.editor.element.value},t.prototype.insertValue=function(t){_(this.vditor.editor.element,t,"")},t.prototype.focus=function(){this.vditor.editor.element.focus()},t.prototype.blur=function(){this.vditor.editor.element.blur()},t.prototype.disabled=function(){this.vditor.editor.element.setAttribute("disabled","disabled")},t.prototype.enable=function(){this.vditor.editor.element.removeAttribute("disabled")},t.prototype.setSelection=function(t,e){this.vditor.editor.element.selectionStart=t,this.vditor.editor.element.selectionEnd=e,this.vditor.editor.element.focus()},t.prototype.getSelection=function(){return this.vditor.editor.element.value.substring(this.vditor.editor.element.selectionStart,this.vditor.editor.element.selectionEnd)},t.prototype.setValue=function(t){this.vditor.editor.element.selectionStart=0,this.vditor.editor.element.selectionEnd=this.vditor.editor.element.value.length,_(this.vditor.editor.element,t,"",!0),t||localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.renderPreview=function(t){this.vditor.preview.render(this.vditor,t)},t.prototype.getCursorPosition=function(){return E(this.vditor.editor.element)},t.prototype.deleteValue=function(){_(this.vditor.editor.element,"","",!0)},t.prototype.updateValue=function(t){_(this.vditor.editor.element,t,"",!0)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem("vditor"+this.vditor.id)},t.prototype.disabledCache=function(){this.vditor.options.cache=!1},t.prototype.enableCache=function(){this.vditor.options.cache=!0},t}();e.default=ye}]).default}); |
{ | ||
"name": "vditor", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "A markdown editor written in TypeScript", | ||
@@ -5,0 +5,0 @@ "author": " Vanessa <v@b3log.org> (http://vanessa.b3log.org)", |
@@ -51,3 +51,3 @@ import {insertText} from "../editor/index"; | ||
matchEmojiData.push({ | ||
html: `${emojiHint[key]} ${key}`, | ||
html: `<span class="vditor-hint__emoji">${emojiHint[key]}</span>${key}`, | ||
value: emojiHint[key], | ||
@@ -54,0 +54,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
285758