1import{i as e,n as t,o as n,t as r}from"./react-COZjIs5k.js";import{t as i}from"./jsx-runtime-BcoINA9M.js";import{t as a}from"./useTranslation-jRmlomh4.js";import{t as o}from"./tooltip-B-_3Ciah.js";import{t as s}from"./message-BlM8fRTo.js";import{t as c}from"./send-C5P2rtrU.js";import{t as l}from"./upload-fon51nAB.js";import{Ci as u,Fn as d,Fr as f,Jr as p,Lr as m,Mr as h,Nr as g,Yn as _,Zr as v,ci as y}from"./index-DHugf5H0.js";import{t as ee}from"./textAreaPrinter-9cQDggqk.js";import{n as te}from"./axios-DrJ2YWvt.js";import{a as ne,c as b,d as re,f as ie,i as ae,l as oe,m as se,n as ce,o as le,p as ue,r as de,s as x,t as fe,u as pe}from"./punycode.es6-Cyre-V0m.js";var me=v(`refresh-ccw`,[[`path`,{d:`M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`14sxne`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16`,key:`1hlbsb`}],[`path`,{d:`M16 16h5v5`,key:`ccwih5`}]]),S={"input-container":`_input-container_p5h2p_2`,"send-btn":`_send-btn_p5h2p_35`,"file-list":`_file-list_p5h2p_54`,"file-chip":`_file-chip_p5h2p_61`,uploading:`_uploading_p5h2p_83`,spin:`_spin_p5h2p_1`,"remove-btn":`_remove-btn_p5h2p_87`,"progress-bar":`_progress-bar_p5h2p_95`,"progress-fill":`_progress-fill_p5h2p_104`,toolbar:`_toolbar_p5h2p_117`,"toolbar-left":`_toolbar-left_p5h2p_122`,"attach-btn":`_attach-btn_p5h2p_129`,active:`_active_p5h2p_146`,"toolbar-right":`_toolbar-right_p5h2p_150`,"char-counter"
1:`_char-counter_p5h2p_156`,"counter-label":`_counter-label_p5h2p_164`},C=n(r(),1),he=n(h(),1),ge=1e5,_e=[{value:`cn`,label:`ç®ä½ä¸æ-Chinese`},{value:`en`,label:`English-è±è¯`},{value:`ar`,label:`Ø¨Ø§ÙØ¹Ø±Ø¨ÙØ©-Arabic`},{value:`th`,label:`à¹à¸à¸à¹à¸à¸¢-Thai`},{value:`fr`,label:`Français-French`},{value:`es`,label:`Español-Spanish`},{value:`de`,label:`Deutsch-German`},{value:`ja`,label:`æ¥æ¬èª-Japanese`},{value:`ko`,label:`íêµì´-Korean`},{value:`ru`,label:`Ð ÑÑÑкий-Russian`},{value:`it`,label:`Italiano-Italian`},{value:`pt`,label:`Português-Portuguese`},{value:`nl`,label:`Nederlands-Dutch`},{value:`sv`,label:`Svenska-Swedish`},{value:`da`,label:`Dansk-Danish`},{value:`no`,label:`Norsk-Norwegian`},{value:`fi`,label:`Suomi-Finnish`},{value:`pl`,label:`Polski-Polish`},{value:`tr`,label:`Türkçe-Turkish`},{value:`el`,label:`Îλληνικά-Greek`},{value:`hu`,label:`Magyar-Hungarian`},{value:`cs`,label:`ÄeÅ¡tina-Czech`},{value:`ro`,label:`RomânÄ-Romanian`},{value:`vi`,label:`Tiếng Viá»t-Vietnamese`},{value:`id`,label:`Bahasa Indonesia-Indonesian`},{value:`ms`,label:`Bahasa Melayu-Malay`},{value:`bu`,label:`бÑлгаÑÑки-Bulgarian`}].map(e=>({...e,label:e.label.split(`-`)[0]})),ve=[{value:`brief`,label:`ç®ç¥`},{value:`medium`,label:`ä¸ç`},{value:`detailed`,label:`详ç»`}],ye=[{value:`compact`,label:`ç´§å`},{value:`medium`,label:`ä¸ç`},{value:`loose`,label:`çæ¾`}],be=[{value:`condense`,label:`æ¦è¦`},{value:`preserve`,label:`ä¿ç`},{value:`generate`,label:`å¢å¼º`}],xe=[{value:`dynamic`,label:`卿`},{value:`landscape`,label:`16:9`}],Se=[{value:`brief`,label:`Brief`},{value:`medium`,label:`Medium`},{value:`detailed`,label:`Detailed`}],Ce=[{value:`compact`,label:`Compact`},{value:`medium`,label:`Medium`},{value:`loose`,label:`Loose`}],we=[{value:`condense`,label:`Condense`},{value:`preserve`,label:`Preserve`},{value:`generate`,label:`Generate`}],Te=[{value:`dynamic`,label:`Dynamic`},{value:`landscape`,label:`16:9`}],w={"popover-content":`_popover-content_1ptl5_1`,"popover-item":`_popover-item_1ptl5_14`,selected:`_selected_1ptl5_20`,"custom-select":`_custom-select_1ptl5_24`,"select-label":`_select-label_1ptl5_40`,"select-value":`_select-value_1ptl5_47`,"select-chevron":`_select-chevron_1ptl5_52`},T=i();function Ee(e){let{title:t,options:n,value:r,onChange:i}=e,[a,o]=(0,C.useState)(!1),s=()=>{o(!1)},c=e=>{o(e)},l=n.find(e=>e.value===r);return(0,T.jsx)(u,{placement:`bottom`,color:`rgba(255, 255, 255, 0)`,content:(0,T.jsx)(`div`,{className:w[`popover-content`],children:n.map((e,t)=>(0,T.jsx)(`div`,{className:w[`popover-item`]+` `+(e.value===r?w.selected:``),onClick:()=>{i(e.value),s()},children:e.label},t))}),trigger:`hover`,open:a,onOpenChange:c,children:(0,T.jsxs)(`div`,{className:w[`custom-select`],children:[(0,T.jsxs)(`span`,{className:w[`select-label`],children:[t,`:`]}),(0,T.jsx)(`span`,{className:w[`select-value`],children:l?.label||r}),(0,T.jsx)(`svg`,{className:w[`select-chevron`],fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:`2`,children:(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]})})}var E={"popover-content":`_popover-content_1myaq_1`,"popover-item":`_popover-item_1myaq_14`,selected:`_selected_1myaq_20`,disabled:`_disabled_1myaq_24`,"custom-select":`_custom-select_1myaq_31`,"select-label":`_select-label_1myaq_46`,"select-value":`_select-value_1myaq_53`,"select-chevron":`_select-chevron_1myaq_58`},D=[{value:`3-5`,min:3,max:5},{value:`5-10`,min:5,max:10},{value:`10-15`,min:10,max:15},{value:`15-20`,min:15,max:20},{value:`20-25`,min:20,max:25},{value:`25-30`,min:25,max:30},{value:`30-35`,min:30,max:35},{value:`35-40`,min:35,max:40},{value:`40-45`,min:40,max:45},{value:`45-50`,min:45,max:50}],O={plus:30,pro:50,default:10};function De(e){return m()?e===``||e===`plus`?O.plus:e===`pro`?O.pro:O.default:O.pro}function Oe(e){let{title:t,value:n,onChange:r,subscriptionLevel:i}=e,[a,o]=(0,C.useState)(!1),s=(0,C.useMemo)(()=>De(i),[i]),c=()=>{o(!1)},l=e=>{o(e)},d=D.find(e=>e.value===n)||D[1];return(0,T.jsx)(u,{placement:`bottom`,color:`rgba(255, 255, 255, 0)`,content:(0,T.jsx)(`div`,{className:E[`popover-content`],children:D.map(e=>{let t=e.max>s;return(0,T.jsx)(`div`,{className:E[`popover-item`]+` `+(e.value===n?E.selected:``)+` `+(t?E.disabled:``),onClick:()=>{t||(r(e.value),c())},children:e.value},e.value)})}),trigger:`hover`,open:a,onOpenChange:l,children:(0,T.jsxs)(`div`,{className:E[`custom-select`],children:[(0,T.jsxs)(`span`,{className:E[`select-label`],children:[t,`:`]}),(0,T.jsx)(`span`,{className:E[`select-value`],children:d?.value||n}),(0,T.jsx)(`svg`,{className:E[`select-chevron`],fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:`2`,children:(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M19 9l-7 7-7-7`})})]})})}
vendor: 4,651 bytes, line 1
1var k={"modal-overlay":`_modal-overlay_1mihj_3`,"modal-content":`_modal-content_1mihj_21`,active:`_active_1mihj_35`,"modal-header":`_modal-header_1mihj_44`,"close-btn":`_close-btn_1mihj_58`,"tab-controls":`_tab-controls_1mihj_71`,"tab-btn":`_tab-btn_1mihj_78`,"tab-panel":`_tab-panel_1mihj_105`,"drop-area":`_drop-area_1mihj_113`,"drag-over":`_drag-over_1mihj_122`,"upload-btn-main":`_upload-btn-main_1mihj_141`,"url-input-group":`_url-input-group_1mihj_162`,"add-url-btn":`_add-url-btn_1mihj_181`,"url-hint":`_url-hint_1mihj_195`,"modal-footer":`_modal-footer_1mihj_203`,"cancel-btn":`_cancel-btn_1mihj_210`,"confirm-btn":`_confirm-btn_1mihj_223`},A=e({arrayReplaceAt:()=>N,asciiTrim:()=>Xe,assign:()=>M,escapeHtml:()=>I,escapeRE:()=>Ue,fromCodePoint:()=>P,has:()=>je,isMdAsciiPunct:()=>qe,isPunctChar:()=>Ge,isPunctCharCode:()=>Ke,isSpace:()=>L,isString:()=>j,isValidEntityCode:()=>Me,isWhiteSpace:()=>We,lib:()=>Ze,normalizeReference:()=>Je,unescapeAll:()=>F,unescapeMd:()=>Le});function ke(e){return Object.prototype.toString.call(e)}function j(e){return ke(e)===`[object String]`}var Ae=Object.prototype.hasOwnProperty;function je(e,t){return Ae.call(e,t)}function M(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!=`object`)throw TypeError(t+`must be object`);Object.keys(t).forEach(function(n){e[n]=t[n]})}}),e}function N(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Me(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function P(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var Ne=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Pe=RegExp(Ne.source+`|&([a-z#][a-z0-9]{1,31});`,`gi`),Fe=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Ie(e,t){if(t.charCodeAt(0)===35&&Fe.test(t)){let n=t[1].toLowerCase()===`x`?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Me(n)?P(n):e}let n=ce(e);return n===e?e:n}function Le(e){return e.indexOf(`\\`)<0?e:e.replace(Ne,`$1`)}function F(e){return e.indexOf(`\\`)<0&&e.indexOf(`&`)<0?e:e.replace(Pe,function(e,t,n){return t||Ie(e,n)})}var Re=/[&<>"]/,ze=/[&<>"]/g,Be={"&":`&`,"<":`<`,">":`>`,'"':`"`};function Ve(e){return Be[e]}function I(e){return Re.test(e)?e.replace(ze,Ve):e}var He=/[.?*+^$[\]\\(){}|-]/g;function Ue(e){return e.replace(He,`\\$&`)}function L(e){switch(e){case 9:case 32:return!0}return!1}function We(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Ge(e){return x.test(e)||le.test(e)}function Ke(e){return Ge(P(e))}function qe(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function Je(e){return e=e.trim().replace(/\s+/g,` `),e.toLowerCase().toUpperCase()}function Ye(e){return e===32||e===9||e===10||e===13}function Xe(e){let t=0;for(;t<e.length&&Ye(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&Ye(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Ze={mdurl:pe,ucmicro:ae};function Qe(e,t,n){let r,i,a,o,s=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<s;){if(a=e.src.charCodeAt(e.pos),a===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),a===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let l=-1;return i&&(l=e.pos),e.pos=c,l}function $e(e,t,n){let r,i=t,a={ok:!1,pos:0,str:``};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return a;if(r===62)return a.pos=i+1,a.str=F(e.slice(t+1,i)),a.ok=!0,a;if(r===92&&i+1<n){i+=2;continue}i++}return a}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return a;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0?a:(a.str=F(e.slice(t,i)),a.pos=i,a.ok=!0,a)}function et(e,t,n,r){let i,a=t,o={ok:!1,can_continue:!1,pos:0,str:``,marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(a>=n)return o;let r=e.charCodeAt(a);if(r!==34&&r!==39&&r!==40)return o;t++,a++,r===40&&(r=41),o.marker=r}for(;a<n;){if(i=e.charCodeAt(a),i===o.marker)return o.pos=a+1,o.str+=F(e.slice(t,a)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&a+1<n&&a++,a++}return o.can_continue=!0,o.str+=F(e.slice(t,a)),o}var tt=e({parseLinkDestination:()=>$e,parseLinkLabel:()=>Qe,parseLinkTitle:()=>et}),R={};
1R.code_inline=function(e,t,n,r,i){let a=e[t];return`<code`+i.renderAttrs(a)+`>`+I(a.content)+`</code>`},R.code_block=function(e,t,n,r,i){let a=e[t];return`<pre`+i.renderAttrs(a)+`><code>`+I(e[t].content)+`</code></pre> 2`},R.fence=function(e,t,n,r,i){let a=e[t],o=a.info?F(a.info).trim():``,s=``,c=``;if(o){let e=o.split(/(\s+)/g);s=e[0],c=e.slice(2).join(``)}let l;if(l=n.highlight&&n.highlight(a.content,s,c)||I(a.content),l.indexOf(`<pre`)===0)return l+` 3`;if(o){let e=a.attrIndex(`class`),t=a.attrs?a.attrs.slice():[];e<0?t.push([`class`,n.langPrefix+s]):(t[e]=t[e].slice(),t[e][1]+=` `+n.langPrefix+s);let r={attrs:t};return`<pre><code${i.renderAttrs(r)}>${l}</code></pre>\n`}return`<pre><code${i.renderAttrs(a)}>${l}</code></pre>\n`},R.image=function(e,t,n,r,i){let a=e[t];return a.attrs[a.attrIndex(`alt`)][1]=i.renderInlineAsText(a.children,n,r),i.renderToken(e,t,n)},R.hardbreak=function(e,t,n){return n.xhtmlOut?`<br /> 4`:`<br> 5`},R.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br /> 6`:`<br> 7`:` 8`},R.text=function(e,t){return I(e[t].content)},R.html_block=function(e,t){return e[t].content},R.html_inline=function(e,t){return e[t].content};function z(){this.rules=M({},R)}z.prototype.renderAttrs=function(e){let t,n,r;if(!e.attrs)return``;for(r=``,t=0,n=e.attrs.length;t<n;t++)r+=` `+I(e.attrs[t][0])+`="`+I(e.attrs[t][1])+`"`;return r},z.prototype.renderToken=function(e,t,n){let r=e[t],i=``;if(r.hidden)return``;r.block&&r.nesting!==-1&&t&&e[t-1].hidden&&(i+=` 9`),i+=(r.nesting===-1?`</`:`<`)+r.tag,i+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(i+=` /`);let a=!1;if(r.block&&(a=!0,r.nesting===1&&t+1<e.length)){let n=e[t+1];(n.type===`inline`||n.hidden||n.nesting===-1&&n.tag===r.tag)&&(a=!1)}return i+=a?`> 10`:`>`,i},z.prototype.renderInline=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;i[o]===void 0?r+=this.renderToken(e,a,t):r+=i[o](e,a,t,n,this)}return r},z.prototype.renderInlineAsText=function(e,t,n){let r=``;for(let i=0,a=e.length;i<a;i++)switch(e[i].type){case`text`:r+=e[i].content;break;case`image`:r+=this.renderInlineAsText(e[i].children,t,n);break;case`html_inline`:case`html_block`:r+=e[i].content;break;case`softbreak`:case`hardbreak`:r+=` 11`;break;default:}return r},z.prototype.render=function(e,t,n){let r=``,i=this.rules;for(let a=0,o=e.length;a<o;a++){let o=e[a].type;o===`inline`?r+=this.renderInline(e[a].children,t,n):i[o]===void 0?r+=this.renderToken(e,a,t,n):r+=i[o](e,a,t,n,this)}return r};function B(){this.__rules__=[],this.__cache__=null}B.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},B.prototype.__compile__=function(){let e=this,t=[``];e.__rules__.forEach(function(e){e.enabled&&e.alt.forEach(function(e){t.indexOf(e)<0&&t.push(e)})}),e.__cache__={},t.forEach(function(t){e.__cache__[t]=[],e.__rules__.forEach(function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))})})},B.prototype.at=function(e,t,n){let r=this.__find__(e),i=n||{};if(r===-1)throw Error(`Parser rule not found: `+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null},B.prototype.before=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},B.prototype.after=function(e,t,n,r){let i=this.__find__(e),a=r||{};if(i===-1)throw Error(`Parser rule not found: `+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:a.alt||[]}),this.__cache__=null},B.prototype.push=function(e,t,n){let r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},B.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!0,n.push(e)},this),this.__cache__=null,n},B.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(e){e.enabled=!1}),this.enable(e,t)},B.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(e){let r=this.__find__(e);
11if(r<0){if(t)return;throw Error(`Rules manager: invalid rule name `+e)}this.__rules__[r].enabled=!1,n.push(e)},this),this.__cache__=null,n},B.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function V(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content=``,this.markup=``,this.info=``,this.meta=null,this.block=!1,this.hidden=!1}V.prototype.attrIndex=function(e){if(!this.attrs)return-1;let t=this.attrs;for(let n=0,r=t.length;n<r;n++)if(t[n][0]===e)return n;return-1},V.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]},V.prototype.attrSet=function(e,t){let n=this.attrIndex(e),r=[e,t];n<0?this.attrPush(r):this.attrs[n]=r},V.prototype.attrGet=function(e){let t=this.attrIndex(e),n=null;return t>=0&&(n=this.attrs[t][1]),n},V.prototype.attrJoin=function(e,t){let n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+` `+t};function nt(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}nt.prototype.Token=V;var rt=/\r\n?|\n/g,it=/\0/g;function at(e){let t;t=e.src.replace(rt,` 12`),t=t.replace(it,`�`),e.src=t}function ot(e){let t;e.inlineMode?(t=new e.Token(`inline`,``,0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function st(e){let t=e.tokens;for(let n=0,r=t.length;n<r;n++){let r=t[n];r.type===`inline`&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function ct(e){return/^<a[>\s]/i.test(e)}function lt(e){return/^<\/a\s*>/i.test(e)}function ut(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!==`inline`||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=0;for(let a=r.length-1;a>=0;a--){let o=r[a];if(o.type===`link_close`){for(a--;r[a].level!==o.level&&r[a].type!==`link_open`;)a--;continue}if(o.type===`html_inline`&&(ct(o.content)&&i>0&&i--,lt(o.content)&&i++),!(i>0)&&o.type===`text`&&e.md.linkify.test(o.content)){let i=o.content,s=e.md.linkify.match(i),c=[],l=o.level,u=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type===`text_special`&&(s=s.slice(1));for(let t=0;t<s.length;t++){let n=s[t].url,r=e.md.normalizeLink(n);if(!e.md.validateLink(r))continue;let a=s[t].text;a=s[t].schema?s[t].schema===`mailto:`&&!/^mailto:/i.test(a)?e.md.normalizeLinkText(`mailto:`+a).replace(/^mailto:/,``):e.md.normalizeLinkText(a):e.md.normalizeLinkText(`http://`+a).replace(/^http:\/\//,``);let o=s[t].index;if(o>u){let t=new e.Token(`text`,``,0);t.content=i.slice(u,o),t.level=l,c.push(t)}let d=new e.Token(`link_open`,`a`,1);d.attrs=[[`href`,r]],d.level=l++,d.markup=`linkify`,d.info=`auto`,c.push(d);let f=new e.Token(`text`,``,0);f.content=a,f.level=l,c.push(f);let p=new e.Token(`link_close`,`a`,-1);p.level=--l,p.markup=`linkify`,p.info=`auto`,c.push(p),u=s[t].lastIndex}if(u<i.length){let t=new e.Token(`text`,``,0);t.content=i.slice(u),t.level=l,c.push(t)}t[n].children=r=N(r,a,c)}}}}var dt=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,ft=/\((c|tm|r)\)/i,pt=/\((c|tm|r)\)/gi,mt={c:`©`,r:`®`,tm:`â¢`};function ht(e,t){return mt[t.toLowerCase()]}function gt(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&(r.content=r.content.replace(pt,ht)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function _t(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];r.type===`text`&&!t&&dt.test(r.content)&&(r.content=r.content.replace(/\+-/g,`±`).replace(/\.{2,}/g,`â¦`).replace(/([?!])â¦/g,`$1..`).replace(/([?!]){4,}/g,`$1$1$1`).replace(/,{2,}/g,`,`).replace(/(^|[^-])---(?=[^-]|$)/gm,`$1â`).replace(/(^|\s)--(?=\s|$)/gm,`$1â`).replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,`$1â`)),r.type===`link_open`&&r.info===`auto`&&t--,r.type===`link_close`&&r.info===`auto`&&t++}}function vt(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type===`inline`&&(ft.test(e.tokens[t].content)&>(e.tokens[t].children),dt.test(e.tokens[t].content)&&_t(e.tokens[t].children))}var yt=/['"]/,bt=/['"]/g,xt=`â`;function St(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function Ct(e,t){let n=``,r=0;t.sort((e,t)=>
12e.pos-t.pos);for(let i=0;i<t.length;i++){let a=t[i];n+=e.slice(r,a.pos)+a.ch,r=a.pos+1}return n+e.slice(r)}function wt(e,t){let n,r=[],i={};for(let a=0;a<e.length;a++){let o=e[a],s=e[a].level;for(n=r.length-1;n>=0&&!(r[n].level<=s);n--);if(r.length=n+1,o.type!==`text`)continue;let c=o.content,l=0,u=c.length;OUTER:for(;l<u;){bt.lastIndex=l;let o=bt.exec(c);if(!o)break;let d=!0,f=!0;l=o.index+1;let p=o[0]===`'`,m=32;if(o.index-1>=0)m=c.charCodeAt(o.index-1);else for(n=a-1;n>=0&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n--)if(e[n].content){m=e[n].content.charCodeAt(e[n].content.length-1);break}let h=32;if(l<u)h=c.charCodeAt(l);else for(n=a+1;n<e.length&&!(e[n].type===`softbreak`||e[n].type===`hardbreak`);n++)if(e[n].content){h=e[n].content.charCodeAt(0);break}let g=qe(m)||Ke(m),_=qe(h)||Ke(h),v=We(m),y=We(h);if(y?d=!1:_&&(v||g||(d=!1)),v?f=!1:g&&(y||_||(f=!1)),h===34&&o[0]===`"`&&m>=48&&m<=57&&(f=d=!1),d&&f&&(d=g,f=_),!d&&!f){p&&St(i,a,o.index,xt);continue}if(f)for(n=r.length-1;n>=0;n--){let e=r[n];if(r[n].level<s)break;if(e.single===p&&r[n].level===s){e=r[n];let s,c;p?(s=t.md.options.quotes[2],c=t.md.options.quotes[3]):(s=t.md.options.quotes[0],c=t.md.options.quotes[1]),St(i,a,o.index,c),St(i,e.token,e.pos,s),r.length=n;continue OUTER}}d?r.push({token:a,pos:o.index,single:p,level:s}):f&&p&&St(i,a,o.index,xt)}}
vendor: 17,061 bytes, lines 12-13
12Object.keys(i).forEach(function(t){e[t].content=Ct(e[t].content,i[t])})}function Tt(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!==`inline`||!yt.test(e.tokens[t].content)||wt(e.tokens[t].children,e)}function Et(e){let t,n,r=e.tokens,i=r.length;for(let e=0;e<i;e++){if(r[e].type!==`inline`)continue;let i=r[e].children,a=i.length;for(t=0;t<a;t++)i[t].type===`text_special`&&(i[t].type=`text`);for(t=n=0;t<a;t++)i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}}var Dt=[[`normalize`,at],[`block`,ot],[`inline`,st],[`linkify`,ut],[`replacements`,vt],[`smartquotes`,Tt],[`text_join`,Et]];function Ot(){this.ruler=new B;for(let e=0;e<Dt.length;e++)this.ruler.push(Dt[e][0],Dt[e][1])}Ot.prototype.process=function(e){let t=this.ruler.getRules(``);for(let n=0,r=t.length;n<r;n++)t[n](e)},Ot.prototype.State=nt;function H(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType=`root`,this.level=0;let i=this.src;for(let e=0,t=0,n=0,r=0,a=i.length,o=!1;t<a;t++){let s=i.charCodeAt(t);if(!o)if(L(s)){n++,s===9?r+=4-r%4:r++;continue}else o=!0;(s===10||t===a-1)&&(s!==10&&t++,this.bMarks.push(e),this.eMarks.push(t),this.tShift.push(n),this.sCount.push(r),this.bsCount.push(0),o=!1,n=0,r=0,e=t+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}H.prototype.push=function(e,t,n){let r=new V(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r},H.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},H.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},H.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t&&L(this.src.charCodeAt(e));e++);return e},H.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!L(this.src.charCodeAt(--e)))return e+1;return e},H.prototype.skipChars=function(e,t){for(let n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},H.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},H.prototype.getLines=function(e,t,n,r){if(e>=t)return``;let i=Array(t-e);for(let a=0,o=e;o<t;o++,a++){let e=0,s=this.bMarks[o],c=s,l;for(l=o+1<t||r?this.eMarks[o]+1:this.eMarks[o];c<l&&e<n;){let t=this.src.charCodeAt(c);if(L(t))t===9?e+=4-(e+this.bsCount[o])%4:e++;else if(c-s<this.tShift[o])e++;else break;c++}e>n?i[a]=Array(e-n+1).join(` `)+this.src.slice(c,l):i[a]=this.src.slice(c,l)}return i.join(``)},H.prototype.Token=V;var kt=65536;function At(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function jt(e){let t=[],n=e.length,r=0,i=e.charCodeAt(r),a=!1,o=0,s=``;for(;r<n;)i===124&&(a?(s+=e.substring(o,r-1),o=r):(t.push(s+e.substring(o,r)),s=``,o=r+1)),a=i===92,r++,i=e.charCodeAt(r);return t.push(s+e.substring(o)),t}function Mt(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let a=e.bMarks[i]+e.tShift[i];if(a>=e.eMarks[i])return!1;let o=e.src.charCodeAt(a++);if(o!==124&&o!==45&&o!==58||a>=e.eMarks[i])return!1;let s=e.src.charCodeAt(a++);if(s!==124&&s!==45&&s!==58&&!L(s)||o===45&&L(s))return!1;for(;a<e.eMarks[i];){let t=e.src.charCodeAt(a);if(t!==124&&t!==45&&t!==58&&!L(t))return!1;a++}let c=At(e,t+1),l=c.split(`|`),u=[];for(let e=0;e<l.length;e++){let t=l[e].trim();if(!t){if(e===0||e===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(t))return!1;t.charCodeAt(t.length-1)===58?u.push(t.charCodeAt(0)===58?`center`:`right`):t.charCodeAt(0)===58?u.push(`left`):u.push(``)}if(c=At(e,t).trim(),c.indexOf(`|`)===-1||e.sCount[t]-e.blkIndent>=4)return!1;l=jt(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop();let d=l.length;if(d===0||d!==u.length)return!1;if(r)return!0;let f=e.parentType;e.parentType=`table`;let p=e.md.block.ruler.getRules(`blockquote`),m=e.push(`table_open`,`table`,1),h=[t,0];m.map=h;let g=e.push(`thead_open`,`thead`,1);g.map=[t,t+1];let _=e.push(`tr_open`,`tr`,1);_.map=[t,t+1];for(let t=0;t<l.length;t++){let n=e.push(`th_open`,`th`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t].trim(),r.children=[],e.push(`th_close`,`th`,-1)}e.push(`tr_close`,`tr`,-1),e.push(`thead_close`,`thead`,-1);let v,y=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let r=!1;for(let t=0,a=p.length;t<a;t++)if(p[t](e,i,n,!0)){r=!0;break}if(r||(c=At(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(l=jt(c),l.length&&l[0]===``&&l.shift(),l.length&&l[l.length-1]===``&&l.pop(),y+=d-l.length,y>kt))break;if(i===t+2){let n=e.push(`tbody_open`,`tbody`,1);n.map=v=[t+2,0]}let a=e.push(`tr_open`,`tr`,1);a.map=[i,i+1];for(let t=0;t<d;t++){let n=e.push(`td_open`,`td`,1);u[t]&&(n.attrs=[[`style`,`text-align:`+u[t]]]);let r=e.push(`inline`,``,0);r.content=l[t]?l[t].trim():``,r.children=[],e.push(`td_close`,`td`,-1)}e.push(`tr_close`,`tr`,-1)}return v&&(e.push(`tbody_close`,`tbody`,-1),v[1]=i),e.push(`table_close`,`table`,-1),h[1]=i,e.parentType=f,e.line=i,!0}function Nt(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;let a=e.push(`code_block`,`code`,0);return a.content=e.getLines(t,i,4+e.blkIndent,!1)+` 13`,a.map=[t,e.line],!0}function Pt(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>a)return!1;let o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;let l=e.src.slice(s,i),u=e.src.slice(i,a);if(o===96&&u.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let d=t,f=!1;for(;d++,!(d>=n||(i=s=e.bMarks[d]+e.tShift[d],a=e.eMarks[d],i<a&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[d]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-s<c)&&(i=e.skipSpaces(i),!(i<a)))){f=!0;break}c=e.sCount[t],e.line=d+ +!!f;let p=e.push(`fence`,`code`,0);return p.info=u,p.content=e.getLines(t+1,d,c,!0),p.markup=l,p.map=[t,e.line],!0}function Ft(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;let s=[],c=[],l=[],u=[],d=e.md.block.ruler.getRules(`blockquote`),f=e.parentType;e.parentType=`blockquote`;let p=!1,m;for(m=t;m<n;m++){let t=e.sCount[m]<e.blkIndent;if(i=e.bMarks[m]+e.tShift[m],a=e.eMarks[m],i>=a)break;if(e.src.charCodeAt(i++)===62&&!t){let t=e.sCount[m]+1,n,r;e.src.charCodeAt(i)===32?(i++,t++,r=!1,n=!0):e.src.charCodeAt(i)===9?(n=!0,(e.bsCount[m]+t)%4==3?(i++,t++,r=!1):r=!0):n=!1;let o=t;for(s.push(e.bMarks[m]),e.bMarks[m]=i;i<a;){let t=e.src.charCodeAt(i);if(L(t))t===9?o+=4-(o+e.bsCount[m]+ +!!r)%4:o++;else break;i++}p=i>=a,c.push(e.bsCount[m]),e.bsCount[m]=e.sCount[m]+1+ +!!n,l.push(e.sCount[m]),e.sCount[m]=o-t,u.push(e.tShift[m]),e.tShift[m]=i-e.bMarks[m];continue}if(p)break;let r=!1;for(let t=0,i=d.length;t<i;t++)if(d[t](e,m,n,!0)){r=!0;break}if(r){e.lineMax=m,e.blkIndent!==0&&(s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]-=e.blkIndent);break}s.push(e.bMarks[m]),c.push(e.bsCount[m]),u.push(e.tShift[m]),l.push(e.sCount[m]),e.sCount[m]=-1}let h=e.blkIndent;e.blkIndent=0;let g=e.push(`blockquote_open`,`blockquote`,1);g.markup=`>`;let _=[t,0];g.map=_,e.md.block.tokenize(e,t,m);let v=e.push(`blockquote_close`,`blockquote`,-1);v.markup=`>`,e.lineMax=o,e.parentType=f,_[1]=e.line;for(let n=0;n<u.length;n++)e.bMarks[n+t]=s[n],e.tShift[n+t]=u[n],e.sCount[n+t]=l[n],e.bsCount[n+t]=c[n];return e.blkIndent=h,!0}function It(e,t,n,r){let i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.bMarks[t]+e.tShift[t],o=e.src.charCodeAt(a++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;a<i;){let t=e.src.charCodeAt(a++);if(t!==o&&!L(t))return!1;t===o&&s++}if(s<3)return!1;if(r)return!0;e.line=t+1;let c=e.push(`hr`,`hr`,0);return c.map=[t,e.line],c.markup=Array(s+1).join(String.fromCharCode(o)),!0}function Lt(e,t){let n=e.eMarks[t],r=e.bMarks[t]+e.tShift[t],i=e.src.charCodeAt(r++);return i!==42&&i!==45&&i!==43||r<n&&!L(e.src.charCodeAt(r))?-1:r}function Rt(e,t){let n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t],i=n;if(i+1>=r)return-1;let a=e.src.charCodeAt(i++);if(a<48||a>57)return-1;for(;;){if(i>=r)return-1;if(a=e.src.charCodeAt(i++),a>=48&&a<=57){if(i-n>=10)return-1;continue}if(a===41||a===46)break;return-1}return i<r&&(a=e.src.charCodeAt(i),!L(a))?-1:i}function zt(e,t){let n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type===`paragraph_open`&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Bt(e,t,n,r){let i,a,o,s,c=t,l=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let u=!1;r&&e.parentType===`paragraph`&&e.sCount[c]>=e.blkIndent&&(u=!0);let d,f,p;if((p=Rt(e,c))>=0){if(d=!0,o=e.bMarks[c]+e.tShift[c],f=Number(e.src.slice(o,p-1)),u&&f!==1)return!1}else if((p=Lt(e,c))>=0)d=!1;else return!1;if(u&&e.skipSpaces(p)>=e.eMarks[c])return!1;if(r)return!0;let m=e.src.charCodeAt(p-1),h=e.tokens.length;d?(s=e.push(`ordered_list_open`,`ol`,1),f!==1&&(s.attrs=[[`start`,f]])):s=e.push(`bullet_list_open`,`ul`,1);let g=[c,0];s.map=g,s.markup=String.fromCharCode(m);let _=!1,v=e.md.block.ruler.getRules(`list`),y=e.parentType;for(e.parentType=`list`;c<n;){a=p,i=e.eMarks[c];let t=e.sCount[c]+p-(e.bMarks[c]+e.tShift[c]),r=t;for(;a<i;){let t=e.src.charCodeAt(a);if(t===9)r+=4-(r+e.bsCount[c])%4;else if(t===32)r++;else break;a++}let u=a,f;f=u>=i?1:r-t,f>4&&(f=1);let h=t+f;s=e.push(`list_item_open`,`li`,1),s.markup=String.fromCharCode(m);let g=[c,0];s.map=g,d&&(s.info=e.src.slice(o,p-1));let y=e.tight,ee=e.tShift[c],te=e.sCount[c],ne=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=h,e.tight=!0,e.tShift[c]=u-e.bMarks[c],e.sCount[c]=r,u>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||_)&&(l=!1),_=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ne,e.tShift[c]=ee,e.sCount[c]=te,e.tight=y,s=e.push(`list_item_close`,`li`,-1),s.markup=String.fromCharCode(m),c=e.line,g[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let b=!1;for(let t=0,r=v.length;t<r;t++)if(v[t](e,c,n,!0)){b=!0;break}if(b)break;if(d){if(p=Rt(e,c),p<0)break;o=e.bMarks[c]+e.tShift[c]}else if(p=Lt(e,c),p<0)break;if(m!==e.src.charCodeAt(p-1))break}return s=d?e.push(`ordered_list_close`,`ol`,-1):e.push(`bullet_list_close`,`ul`,-1),s.markup=String.fromCharCode(m),g[1]=c,e.line=c,e.parentType=y,l&&zt(e,h),!0}function Vt(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function s(t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return null;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){let r=e.md.block.ruler.getRules(`reference`),i=e.parentType;e.parentType=`reference`;let a=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,t,n,!0)){a=!0;break}if(e.parentType=i,a)return null}let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];return e.src.slice(i,a+1)}let c=e.src.slice(i,a+1);a=c.length;let l=-1;for(i=1;i<a;i++){let e=c.charCodeAt(i);if(e===91)return!1;if(e===93){l=i;break}else if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(e===92&&(i++,i<a&&c.charCodeAt(i)===10)){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}}if(l<0||c.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!L(e))break}let u=e.md.helpers.parseLinkDestination(c,i,a);if(!u.ok)return!1;let d=e.md.normalizeLink(u.str);if(!e.md.validateLink(d))return!1;i=u.pos;let f=i,p=o,m=i;for(;i<a;i++){let e=c.charCodeAt(i);if(e===10){let e=s(o);e!==null&&(c+=e,a=c.length,o++)}else if(!L(e))break}let h=e.md.helpers.parseLinkTitle(c,i,a);for(;h.can_continue;){let t=s(o);if(t===null)break;c+=t,i=a,a=c.length,o++,h=e.md.helpers.parseLinkTitle(c,i,a,h)}let g;for(i<a&&m!==i&&h.ok?(g=h.str,i=h.pos):(g=``,i=f,o=p);i<a&&L(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10&&g)for(g=``,i=f,o=p;i<a&&L(c.charCodeAt(i));)i++;if(i<a&&c.charCodeAt(i)!==10)return!1;let _=Je(c.slice(1,l));return _?r?!0:(e.env.references===void 0&&(e.env.references={}),e.env.references[_]===void 0&&(e.env.references[_]={title:g,href:d}),e.line=o,!0):!1}var Ht=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Ut=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`),Wt=RegExp(`^(?:<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>|<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>)`),U=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[RegExp(`^</?(`+Ht.join(`|`)+`)(?=(\\s|/?>|$))`,`i`),/^$/,!0],[RegExp(Wt.source+`\\s*$`),/^$/,!1]];function Gt(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,a),s=0;for(;s<U.length&&!U[s][0].test(o);s++);if(s===U.length)return!1;if(r)return U[s][2];let c=t+1,l=U[s][1].test(``);if(!U[s][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent&&(l||!e.isEmpty(c)));c++)if(i=e.bMarks[c]+e.tShift[c],a=e.eMarks[c],o=e.src.slice(i,a),U[s][1].test(o)){o.length!==0&&c++;break}}e.line=c;let u=e.push(`html_block`,``,0);return u.map=[t,c],u.content=e.getLines(t,c,e.blkIndent,!0),!0}function Kt(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=a)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i<a&&s<=6;)s++,o=e.src.charCodeAt(++i);if(s>6||i<a&&!L(o))return!1;if(r)return!0;a=e.skipSpacesBack(a,i);let c=e.skipCharsBack(a,35,i);c>i&&L(e.src.charCodeAt(c-1))&&(a=c),e.line=t+1;let l=e.push(`heading_open`,`h`+String(s),1);l.markup=`########`.slice(0,s),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=Xe(e.src.slice(i,a)),u.map=[t,e.line],u.children=[];let d=e.push(`heading_close`,`h`+String(s),-1);return d.markup=`########`.slice(0,s),!0}function qt(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`);if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.parentType;e.parentType=`paragraph`;let a=0,o,s=t+1;for(;s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let t=e.bMarks[s]+e.tShift[s],n=e.eMarks[s];if(t<n&&(o=e.src.charCodeAt(t),(o===45||o===61)&&(t=e.skipChars(t,o),t=e.skipSpaces(t),t>=n))){a=o===61?1:2;break}}if(e.sCount[s]<0)continue;let t=!1;for(let i=0,a=r.length;i<a;i++)if(r[i](e,s,n,!0)){t=!0;break}if(t)break}if(!a)return e.parentType=i,!1;let c=Xe(e.getLines(t,s,e.blkIndent,!1));e.line=s+1;let l=e.push(`heading_open`,`h`+String(a),1);l.markup=String.fromCharCode(o),l.map=[t,e.line];let u=e.push(`inline`,``,0);u.content=c,u.map=[t,e.line-1],u.children=[];let d=e.push(`heading_close`,`h`+String(a),-1);return d.markup=String.fromCharCode(o),e.parentType=i,!0}function Jt(e,t,n){let r=e.md.block.ruler.getRules(`paragraph`),i=e.parentType,a=t+1;for(e.parentType=`paragraph`;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3||e.sCount[a]<0)continue;let t=!1;for(let i=0,o=r.length;i<o;i++)if(r[i](e,a,n,!0)){t=!0;break}if(t)break}let o=Xe(e.getLines(t,a,e.blkIndent,!1));e.line=a;let s=e.push(`paragraph_open`,`p`,1);s.map=[t,e.line];let c=e.push(`inline`,``,0);return c.content=o,c.map=[t,e.line],c.children=[],e.push(`paragraph_close`,`p`,-1),e.parentType=i,!0}var Yt=[[`table`,Mt,[`paragraph`,`reference`]],[`code`,Nt],[`fence`,Pt,[`paragraph`,`reference`,`blockquote`,`list`]],[`blockquote`,Ft,[`paragraph`,`reference`,`blockquote`,`list`]],[`hr`,It,[`paragraph`,`reference`,`blockquote`,`list`]],[`list`,Bt,[`paragraph`,`reference`,`blockquote`]],[`reference`,Vt],[`html_block`,Gt,[`paragraph`,`reference`,`blockquote`]],[`heading`,Kt,[`paragraph`,`reference`,`blockquote`]],[`lheading`,qt],[`paragraph`,Jt]];function Xt(){this.ruler=new B;for(let e=0;e<Yt.length;e++)this.ruler.push(Yt[e][0],Yt[e][1],{alt:(Yt[e][2]||[]).slice()})}Xt.prototype.tokenize=function(e,t,n){let r=this.ruler.getRules(``),i=r.length,a=e.md.options.maxNesting,o=t,
13s=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=a){e.line=n;break}let t=e.line,c=!1;for(let a=0;a<i;a++)if(c=r[a](e,o,n,!1),c){if(t>=e.line)throw Error(`block rule didn't increment state.line`);break}if(!c)throw Error(`none of the block rules matched`);e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),o=e.line,o<n&&e.isEmpty(o)&&(s=!0,o++,e.line=o)}},Xt.prototype.parse=function(e,t,n,r){if(!e)return;let i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)},Xt.prototype.State=H;function Zt(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending=``,this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Zt.prototype.pushPending=function(){let e=new V(`text`,``,0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending=``,e},Zt.prototype.push=function(e,t,n){this.pending&&this.pushPending();let r=new V(e,t,n),i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r},Zt.prototype.scanDelims=function(e,t){let n=this.posMax,r=this.src.charCodeAt(e),i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)==55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)==56320){let t=this.src.charCodeAt(e-2);i=(t&64512)==55296?65536+(t-55296<<10)+(i-56320):65533}else(i&64512)==55296&&(i=65533);let a=e;for(;a<n&&this.src.charCodeAt(a)===r;)a++;let o=a-e,s=a<n?this.src.charCodeAt(a):32;if((s&64512)==55296){let e=this.src.charCodeAt(a+1);s=(e&64512)==56320?65536+(s-55296<<10)+(e-56320):65533}else(s&64512)==56320&&(s=65533);let c=qe(i)||Ke(i),l=qe(s)||Ke(s),u=We(i),d=We(s),f=!d&&(!l||u||c),p=!u&&(!c||d||l);return{can_open:f&&(t||!p||c),can_close:p&&(t||!f||l),length:o}},Zt.prototype.Token=V;function Qt(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function $t(e,t){let n=e.pos;for(;n<e.posMax&&!Qt(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}var en=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function tn(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let i=e.pending.match(en);if(!i)return!1;let a=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-a.length));if(!o)return!1;let s=o.url;if(s.length<=a.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));let l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-a.length);let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,l]],t.markup=`linkify`,t.info=`auto`;let n=e.push(`text`,``,0);n.content=e.md.normalizeLinkText(s);let r=e.push(`link_close`,`a`,-1);r.markup=`linkify`,r.info=`auto`}return e.pos+=s.length-a.length,!0}function nn(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let t=r-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),e.push(`hardbreak`,`br`,0)}else e.pending=e.pending.slice(0,-1),e.push(`softbreak`,`br`,0);else e.push(`softbreak`,`br`,0);for(n++;n<i&&L(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var rn=[];for(let e=0;e<256;e++)rn.push(0);`\\!"#$%&'()*+,./:;<=>?@[]^_\`{|}~-`.split(``).forEach(function(e){rn[e.charCodeAt(0)]=1});function an(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push(`hardbreak`,`br`,0),n++;
13n<r&&(i=e.src.charCodeAt(n),L(i));)n++;return e.pos=n,!0}if(i===32){if(!t){let t=e.push(`text_special`,``,0);t.content=`\\`,t.markup=`\\`,t.info=`escape`}return e.pos=n,!0}let a=e.src[n];if(i>=55296&&i<=56319&&n+1<r){let t=e.src.charCodeAt(n+1);t>=56320&&t<=57343&&(a+=e.src[n+1],n++)}let o=`\\`+a;if(!t){let t=e.push(`text_special`,``,0);i<256&&rn[i]!==0?t.content=a:t.content=o,t.markup=o,t.info=`escape`}return e.pos=n+1,!0}function on(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let a=e.src.slice(r,n),o=a.length;if(e.backticksScanned&&(e.backticks[o]||0)<=r)return t||(e.pending+=a),e.pos+=o,!0;let s=n,c;for(;(c=e.src.indexOf("`",s))!==-1;){for(s=c+1;s<i&&e.src.charCodeAt(s)===96;)s++;let r=s-c;if(r===o){if(!t){let t=e.push(`code_inline`,`code`,0);t.markup=a,t.content=e.src.slice(n,c).replace(/\n/g,` `).replace(/^ (.+) $/,`$1`)}return e.pos=s,!0}e.backticks[r]=c}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=o,!0}function sn(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;let i=e.scanDelims(e.pos,!0),a=i.length,o=String.fromCharCode(r);if(a<2)return!1;let s;a%2&&(s=e.push(`text`,``,0),s.content=o,a--);for(let t=0;t<a;t+=2)s=e.push(`text`,``,0),s.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function cn(e,t){let n,r=[],i=t.length;for(let a=0;a<i;a++){let i=t[a];if(i.marker!==126||i.end===-1)continue;let o=t[i.end];n=e.tokens[i.token],n.type=`s_open`,n.tag=`s`,n.nesting=1,n.markup=`~~`,n.content=``,n=e.tokens[o.token],n.type=`s_close`,n.tag=`s`,n.nesting=-1,n.markup=`~~`,n.content=``,e.tokens[o.token-1].type===`text`&&e.tokens[o.token-1].content===`~`&&r.push(o.token-1)}for(;r.length;){let t=r.pop(),i=t+1;for(;i<e.tokens.length&&e.tokens[i].type===`s_close`;)i++;i--,t!==i&&(n=e.tokens[i],e.tokens[i]=e.tokens[t],e.tokens[t]=n)}}function ln(e){let t=e.tokens_meta,n=e.tokens_meta.length;cn(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&cn(e,t[r].delimiters)}var un={tokenize:sn,postProcess:ln};function dn(e,t){let n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;let i=e.scanDelims(e.pos,r===42);for(let t=0;t<i.length;t++){let t=e.push(`text`,``,0);t.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function fn(e,t){let n=t.length;for(let r=n-1;r>=0;r--){let n=t[r];if(n.marker!==95&&n.marker!==42||n.end===-1)continue;let i=t[n.end],a=r>0&&t[r-1].end===n.end+1&&t[r-1].marker===n.marker&&t[r-1].token===n.token-1&&t[n.end+1].token===i.token+1,o=String.fromCharCode(n.marker),s=e.tokens[n.token];s.type=a?`strong_open`:`em_open`,s.tag=a?`strong`:`em`,s.nesting=1,s.markup=a?o+o:o,s.content=``;let c=e.tokens[i.token];c.type=a?`strong_close`:`em_close`,c.tag=a?`strong`:`em`,c.nesting=-1,c.markup=a?o+o:o,c.content=``,a&&(e.tokens[t[r-1].token].content=``,e.tokens[t[n.end+1].token].content=``,r--)}}function pn(e){let t=e.tokens_meta,n=e.tokens_meta.length;fn(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&fn(e,t[r].delimiters)}var mn={tokenize:dn,postProcess:pn};function hn(e,t){let n,r,i,a,o=``,s=``,c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let u=e.pos,d=e.posMax,f=e.pos+1,p=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(p<0)return!1;let m=p+1;if(m<d&&e.src.charCodeAt(m)===40){for(l=!1,m++;m<d&&(n=e.src.charCodeAt(m),!(!L(n)&&n!==10));m++);if(m>=d)return!1;if(c=m,i=e.md.helpers.parseLinkDestination(e.src,m,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?m=i.pos:o=``,c=m;m<d&&(n=e.src.charCodeAt(m),!(!L(n)&&n!==10));m++);if(i=e.md.helpers.parseLinkTitle(e.src,m,e.posMax),m<d&&c!==m&&i.ok)for(s=i.str,m=i.pos;m<d&&(n=e.src.charCodeAt(m),!(!L(n)&&n!==10));m++);}(m>=d||e.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(e.env.references===void 0)return!1;if(m<d&&e.src.charCodeAt(m)===91?(c=m+1,m=e.md.helpers.parseLinkLabel(e,m),m>=0?r=e.src.slice(c,m++):m=p+1):m=p+1,r||=e.src.slice(f,p),a=e.env.references[Je(r)],!a)return e.pos=u,!1;o=a.href,s=a.title}if(!t){e.pos=f,e.posMax=p;let t=e.push(`link_open`,`a`,1),n=[[`href`,o]];t.attrs=n,s&&n.push([`title`,s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push(`link_close`,`a`,-1)}return e.pos=m,e.posMax=d,!0}function gn(e,t){let n,r,i,a,o,s,c,l,u=``,d=e.pos,f=e.posMax;
vendor: 7,194 bytes, line 13
13if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let p=e.pos+2,m=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(m<0)return!1;if(a=m+1,a<f&&e.src.charCodeAt(a)===40){for(a++;a<f&&(n=e.src.charCodeAt(a),!(!L(n)&&n!==10));a++);if(a>=f)return!1;for(l=a,s=e.md.helpers.parseLinkDestination(e.src,a,e.posMax),s.ok&&(u=e.md.normalizeLink(s.str),e.md.validateLink(u)?a=s.pos:u=``),l=a;a<f&&(n=e.src.charCodeAt(a),!(!L(n)&&n!==10));a++);if(s=e.md.helpers.parseLinkTitle(e.src,a,e.posMax),a<f&&l!==a&&s.ok)for(c=s.str,a=s.pos;a<f&&(n=e.src.charCodeAt(a),!(!L(n)&&n!==10));a++);else c=``;if(a>=f||e.src.charCodeAt(a)!==41)return e.pos=d,!1;a++}else{if(e.env.references===void 0)return!1;if(a<f&&e.src.charCodeAt(a)===91?(l=a+1,a=e.md.helpers.parseLinkLabel(e,a),a>=0?i=e.src.slice(l,a++):a=m+1):a=m+1,i||=e.src.slice(p,m),o=e.env.references[Je(i)],!o)return e.pos=d,!1;u=o.href,c=o.title}if(!t){r=e.src.slice(p,m);let t=[];e.md.inline.parse(r,e.md,e.env,t);let n=e.push(`image`,`img`,0),i=[[`src`,u],[`alt`,``]];n.attrs=i,n.children=t,n.content=r,c&&i.push([`title`,c])}return e.pos=a,e.posMax=f,!0}var _n=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,vn=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function yn(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;let t=e.src.charCodeAt(n);if(t===60)return!1;if(t===62)break}let a=e.src.slice(r+1,n);if(vn.test(a)){let n=e.md.normalizeLink(a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}if(_n.test(a)){let n=e.md.normalizeLink(`mailto:`+a);if(!e.md.validateLink(n))return!1;if(!t){let t=e.push(`link_open`,`a`,1);t.attrs=[[`href`,n]],t.markup=`autolink`,t.info=`auto`;let r=e.push(`text`,``,0);r.content=e.md.normalizeLinkText(a);let i=e.push(`link_close`,`a`,-1);i.markup=`autolink`,i.info=`auto`}return e.pos+=a.length+2,!0}return!1}function bn(e){return/^<a[>\s]/i.test(e)}function xn(e){return/^<\/a\s*>/i.test(e)}function Sn(e){let t=e|32;return t>=97&&t<=122}function Cn(e,t){if(!e.md.options.html)return!1;let n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!Sn(i))return!1;let a=e.src.slice(r).match(Ut);if(!a)return!1;if(!t){let t=e.push(`html_inline`,``,0);t.content=a[0],bn(t.content)&&e.linkLevel++,xn(t.content)&&e.linkLevel--}return e.pos+=a[0].length,!0}var wn=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Tn=/^&([a-z][a-z0-9]{1,31});/i;function En(e,t){let n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){let r=e.src.slice(n).match(wn);if(r){if(!t){let t=r[1][0].toLowerCase()===`x`?parseInt(r[1].slice(1),16):parseInt(r[1],10),n=e.push(`text_special`,``,0);n.content=Me(t)?P(t):P(65533),n.markup=r[0],n.info=`entity`}return e.pos+=r[0].length,!0}}else{let r=e.src.slice(n).match(Tn);if(r){let n=de(r[0]);if(n!==r[0]){if(!t){let t=e.push(`text_special`,``,0);t.content=n,t.markup=r[0],t.info=`entity`}return e.pos+=r[0].length,!0}}}return!1}function Dn(e){let t={},n=e.length;if(!n)return;let r=0,i=-2,a=[];for(let o=0;o<n;o++){let n=e[o];if(a.push(0),(e[r].marker!==n.marker||i!==n.token-1)&&(r=o),i=n.token,n.length=n.length||0,!n.close)continue;t.hasOwnProperty(n.marker)||(t[n.marker]=[-1,-1,-1,-1,-1,-1]);let s=t[n.marker][(n.open?3:0)+n.length%3],c=r-a[r]-1,l=c;for(;c>s;c-=a[c]+1){let t=e[c];if(t.marker===n.marker&&t.open&&t.end<0){let r=!1;if((t.close||n.open)&&(t.length+n.length)%3==0&&(t.length%3!=0||n.length%3!=0)&&(r=!0),!r){let r=c>0&&!e[c-1].open?a[c-1]+1:0;a[o]=o-c+r,a[c]=r,n.open=!1,t.end=o,t.close=!1,l=-1,i=-2;break}}}l!==-1&&(t[n.marker][(n.open?3:0)+(n.length||0)%3]=l)}}function On(e){let t=e.tokens_meta,n=e.tokens_meta.length;Dn(e.delimiters);for(let e=0;e<n;e++)t[e]&&t[e].delimiters&&Dn(t[e].delimiters)}function kn(e){let t,n,r=0,i=e.tokens,a=e.tokens.length;for(t=n=0;t<a;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type===`text`&&t+1<a&&i[t+1].type===`text`?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}var An=[[`text`,$t],[`linkify`,tn],[`newline`,nn],[`escape`,an],[`backticks`,on],[`strikethrough`,un.tokenize],[`emphasis`,mn.tokenize],[`link`,hn],[`image`,gn],[`autolink`,yn],[`html_inline`,Cn],[`entity`,En]],jn=[[`balance_pairs`,On],[`strikethrough`,un.postProcess],[`emphasis`,mn.postProcess],[`fragments_join`,kn]];function Mn(){this.ruler=new B;for(let e=0;e<An.length;e++)this.ruler.push(An[e][0],An[e][1]);this.ruler2=new B;for(let e=0;e<jn.length;e++)this.ruler2.push(jn[e][0],jn[e][1])}Mn.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(``),r=n.length,i=e.md.options.maxNesting,a=e.cache;if(a[t]!==void 0){e.pos=a[t];return}let o=!1;if(e.level<i){for(let i=0;i<r;i++)if(e.level++,o=n[i](e,!0),e.level--,o){if(t>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}else e.pos=e.posMax;o||e.pos++,a[t]=e.pos},Mn.prototype.tokenize=function(e){let t=this.ruler.getRules(``),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){let a=e.pos,o=!1;if(e.level<i){for(let r=0;r<n;r++)if(o=t[r](e,!1),o){if(a>=e.pos)throw Error(`inline rule didn't increment state.pos`);break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Mn.prototype.parse=function(e,t,n,r){let i=new this.State(e,t,n,r);this.tokenize(i);let a=this.ruler2.getRules(``),o=a.length;for(let e=0;e<o;e++)a[e](i)},Mn.prototype.State=Zt;function Nn(e){let t={};e||={},t.src_Any=oe.source,t.src_Cc=b.source,t.src_Z=ne.source,t.src_P=x.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join(`|`),t.src_ZCc=[t.src_Z,t.src_Cc].join(`|`);let n=`[><ï½]`;return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4=`(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`,t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port=`(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?`,t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e[`---`]?`-(?!--)|`:`-|`}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e[`---`]?`\\-(?!--(?:[^-]|$))(?:-*)|`:`\\-+|`)+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name=`[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}`,t.src_xn=`xn--[a-z0-9\\-]{1,59}`,t.src_domain_root=`(?:`+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain=`(?:`+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}
13))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy=`(?:`+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${t.src_ZPCc}))((?![$+<=>^\`|\uff5c])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function Pn(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function Fn(e){return Object.prototype.toString.call(e)}function In(e){return Fn(e)===`[object String]`}function Ln(e){return Fn(e)===`[object Object]`}function Rn(e){return Fn(e)===`[object RegExp]`}function zn(e){return Fn(e)===`[object Function]`}function Bn(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,`\\$&`)}var Vn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Hn(e){return Object.keys(e||{}).reduce(function(e,t){return e||Vn.hasOwnProperty(t)},!1)}var Un={"http:":{validate:function(e,t,n){let r=e.slice(t);return n.re.http||(n.re.http=RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,`i`)),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":`http:`,"ftp:":`http:`,"//":{validate:function(e,t,n){let r=e.slice(t);return n.re.no_http||(n.re.no_http=RegExp(`^`+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,`i`)),n.re.no_http.test(r)?t>=3&&e[t-3]===`:`||t>=3&&e[t-3]===`/`?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let r=e.slice(t);return n.re.mailto||(n.re.mailto=RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,`i`)),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Wn=`a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]`,Gn=`biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|ÑÑ`.split(`|`);function Kn(e){return function(t,n){let r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function qn(){return function(e,t){t.normalize(e)}}function Jn(e){let t=e.re=Nn(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Wn),n.push(t.src_xn),t.src_tlds=n.join(`|`);function r(e){return e.replace(`%TLDS%`,t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),`i`),t.email_fuzzy_global=RegExp(r(t.tpl_email_fuzzy),`ig`),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),`i`),t.link_fuzzy_global=RegExp(r(t.tpl_link_fuzzy),`ig`),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),`i`),t.link_no_ip_fuzzy_global=RegExp(r(t.tpl_link_no_ip_fuzzy),`ig`),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),`i`);let i=[];e.__compiled__={};function a(e,t){throw Error(`(LinkifyIt) Invalid schema "${e}": ${t}`)}Object.keys(e.__schemas__).forEach(function(t){let n=e.__schemas__[t];if(n===null)return;let r={validate:null,link:null};if(e.__compiled__[t]=r,Ln(n)){Rn(n.validate)?r.validate=Kn(n.validate):zn(n.validate)?r.validate=n.validate:a(t,n),zn(n.normalize)?r.normalize=n.normalize:n.normalize?a(t,n):r.normalize=qn();return}if(In(n)){i.push(t);return}a(t,n)}
vendor: 5,956 bytes, line 13
13),i.forEach(function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)}),e.__compiled__[``]={validate:null,normalize:qn()};let o=Object.keys(e.__compiled__).filter(function(t){return t.length>0&&e.__compiled__[t]}).map(Bn).join(`|`);e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`i`),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uff5c]|${t.src_ZPCc}))(${o})`,`ig`),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,`i`),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,`i`)}function Yn(e,t,n,r){let i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}function W(e,t){if(!(this instanceof W))return new W(e,t);t||Hn(e)&&(t=e,e={}),this.__opts__=Pn({},Vn,t),this.__schemas__=Pn({},Un,e),this.__compiled__={},this.__tlds__=Gn,this.__tlds_replaced__=!1,this.re={},Jn(this)}W.prototype.add=function(e,t){return this.__schemas__[e]=t,Jn(this),this},W.prototype.set=function(e){return this.__opts__=Pn(this.__opts__,e),this},W.prototype.test=function(e){if(!e.length)return!1;let t,n;if(this.re.schema_test.test(e)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__[`http:`]&&e.search(this.re.host_fuzzy_test)>=0&&e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`]&&e.indexOf(`@`)>=0&&e.match(this.re.email_fuzzy)!==null)},W.prototype.pretest=function(e){return this.re.pretest.test(e)},W.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},W.prototype.match=function(e){let t=[],n=[],r=[],i=[],a,o,s;function c(e,t){return e?t?e.index===t.index?e.lastIndex>=t.lastIndex?e:t:e.index<t.index?e:t:e:t}if(!e.length)return null;if(this.re.schema_test.test(e))for(s=this.re.schema_search,s.lastIndex=0;(a=s.exec(e))!==null;)o=this.testSchemaAt(e,a[2],s.lastIndex),o&&n.push({schema:a[2],index:a.index+a[1].length,lastIndex:a.index+a[0].length+o});if(this.__opts__.fuzzyLink&&this.__compiled__[`http:`])for(s=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)r.push({schema:``,index:a.index+a[1].length,lastIndex:a.index+a[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__[`mailto:`])for(s=this.re.email_fuzzy_global,s.lastIndex=0;(a=s.exec(e))!==null;)i.push({schema:`mailto:`,index:a.index+a[1].length,lastIndex:a.index+a[0].length});let l=[0,0,0],u=0;for(;;){let a=[n[l[0]],i[l[1]],r[l[2]]],o=c(c(a[0],a[1]),a[2]);if(!o)break;if(o===a[0]?l[0]++:o===a[1]?l[1]++:l[2]++,o.index<u)continue;let s=new Yn(e,o.schema,o.index,o.lastIndex);this.__compiled__[s.schema].normalize(s,this),t.push(s),u=o.lastIndex}return t.length?t:null},W.prototype.matchAtStart=function(e){if(!e.length)return null;let t=this.re.schema_at_start.exec(e);if(!t)return null;let n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;let r=new Yn(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__compiled__[r.schema].normalize(r,this),r},W.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(e,t,n){return e!==n[t-1]}).reverse(),Jn(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Jn(this),this)},W.prototype.normalize=function(e){e.schema||(e.url=`http://${e.url}`),e.schema===`mailto:`&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)},W.prototype.onCompile=function(){};var Xn={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`ââââ`,highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`ââââ`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`paragraph`]},inline:{rules:[`text`],rules2:[`balance_pairs`,`fragments_join`]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:`language-`,linkify:!1,typographer:!1,quotes:`ââââ`,highlight:null,maxNesting:20},components:{core:{rules:[`normalize`,`block`,`inline`,`text_join`]},block:{rules:[`blockquote`,`code`,`fence`,`heading`,`hr`,`html_block`,`lheading`,`list`,`reference`,`paragraph`]},inline:{rules:[`autolink`,`backticks`,`emphasis`,`entity`,`escape`,`html_inline`,`image`,`link`,`newline`,`text`],rules2:[`balance_pairs`,`emphasis`,`fragments_join`]}}}},Zn=/^(vbscript|javascript|file|data):/,Qn=/^data:image\/(gif|png|jpeg|webp);/;function $n(e){let t=e.trim().toLowerCase();return Zn.test(t)?Qn.test(t):!0}var er=[`http:`,`https:`,`mailto:`];function tr(e){let t=re(e,!0);if(t.hostname&&(!t.protocol||er.indexOf(t.protocol)>=0))try{t.hostname=fe.toASCII(t.hostname)}catch{}return ue(ie(t))}function nr(e){let t=re(e,!0);if(t.hostname&&(!t.protocol||er.indexOf(t.protocol)>=0))try{t.hostname=fe.toUnicode(t.hostname)}catch{}return se(ie(t),se.defaultChars+`%`)}function G(e,t){if(!(this instanceof G))return new G(e,t);t||j(e)||(t=e||{},e=`default`),this.inline=new Mn,this.block=new Xt,this.core=new Ot,this.renderer=new z,this.linkify=new W,this.validateLink=$n,this.normalizeLink=tr,this.normalizeLinkText=nr,this.utils=A,this.helpers=M({},tt),this.options={},this.configure(e),t&&this.set(t)}G.prototype.set=function(e){return M(this.options,e),this},G.prototype.configure=function(e){let t=this;if(j(e)){let t=e;if(e=Xn[t],!e)throw Error('Wrong `markdown-it` preset "'+t+`", check name`)}if(!e)throw Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEac
13h(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},G.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to enable unknown rule(s): `+r);return this},G.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),[`core`,`block`,`inline`].forEach(function(t){n=n.concat(this[t].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let r=e.filter(function(e){return n.indexOf(e)<0});if(r.length&&!t)throw Error(`MarkdownIt. Failed to disable unknown rule(s): `+r);return this},G.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},G.prototype.parse=function(e,t){if(typeof e!=`string`)throw Error(`Input data should be a String`);let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},G.prototype.render=function(e,t){return t||={},this.renderer.render(this.parse(e,t),this.options,t)},G.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},G.prototype.renderInline=function(e,t){return t||={},this.renderer.render(this.parseInline(e,t),this.options,t)};var rr=class extends C.Component{constructor(e){super(e),this.handleClose=this.handleClose.bind(this)}handleClose(e){e.stopPropagation();let{onClose:t}=this.props;typeof t==`function`&&t()}render(){return C.createElement(`div`,{className:`drop-wrap ${this.props.show?`show`:`hidden`}`,onClick:this.handleClose},this.props.children)}},ir=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+=`-`:e+=`_`,e),``);function K(e){return C.createElement(`i`,{className:`rmel-iconfont rmel-icon-${e.type}`})}function ar(e){return C.createElement(`div`,{className:`rc-md-navigation ${e.visible?`visible`:`in-visible`}`},C.createElement(`div`,{className:`navigation-nav left`},C.createElement(`div`,{className:`button-wrap`},e.left)),C.createElement(`div`,{className:`navigation-nav right`},C.createElement(`div`,{className:`button-wrap`},e.right)))}function or(e){return C.createElement(`div`,{className:`tool-bar`,style:e.style},e.children)}var sr=t(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))(),cr=class extends sr.EventEmitter{EVENT_CHANGE=`a1`;EVENT_FULL_SCREEN=`a2`;EVENT_VIEW_CHANGE=`a3`;EVENT_KEY_DOWN=`a4`;EVENT_EDITOR_KEY_DOWN=`a5`;EVENT_FOCUS=`a5`;EVENT_BLUR=`a6`;EVENT_SCROLL=`a7`;EVENT_LANG_CHANGE=`b1`}
13,q=new cr,lr=cr,ur={clearTip:`Are you sure you want to clear all contents?`,btnHeader:`Header`,btnClear:`Clear`,btnBold:`Bold`,btnItalic:`Italic`,btnUnderline:`Underline`,btnStrikethrough:`Strikethrough`,btnUnordered:`Unordered list`,btnOrdered:`Ordered list`,btnQuote:`Quote`,btnLineBreak:`Line break`,btnInlineCode:`Inline code`,btnCode:`Code`,btnTable:`Table`,btnImage:`Image`,btnLink:`Link`,btnUndo:`Undo`,btnRedo:`Redo`,btnFullScreen:`Full screen`,btnExitFullScreen:`Exit full screen`,btnModeEditor:`Only display editor`,btnModePreview:`Only display preview`,btnModeAll:`Display both editor and preview`,selectTabMap:`Actual input when typing a Tab key`,tab:`Tab`,spaces:`Spaces`},dr={clearTip:`æ¨ç¡®å®è¦æ¸ 空ææå 容åï¼`,btnHeader:`æ é¢`,btnClear:`æ¸ ç©º`,btnBold:`å ç²`,btnItalic:`æä½`,btnUnderline:`ä¸å线`,btnStrikethrough:`å é¤çº¿`,btnUnordered:`æ åºå表`,btnOrdered:`æåºå表`,btnQuote:`å¼ç¨`,btnLineBreak:`æ¢è¡`,btnInlineCode:`è¡å 代ç `,btnCode:`代ç å`,btnTable:`è¡¨æ ¼`,btnImage:`å¾ç`,btnLink:`龿¥`,btnUndo:`æ¤é`,btnRedo:`éå`,btnFullScreen:`å ¨å±`,btnExitFullScreen:`éåºå ¨å±`,btnModeEditor:`ä» æ¾ç¤ºç¼è¾å¨`,btnModePreview:`ä» æ¾ç¤ºé¢è§`,btnModeAll:`æ¾ç¤ºç¼è¾å¨ä¸é¢è§`,selectTabMap:`æä¸ Tab 鮿¶å®é çè¾å ¥`,tab:`å¶è¡¨ç¬¦`,spaces:`ç©ºæ ¼`},J=new class{langs={enUS:ur,zhCN:dr};current=`enUS`;constructor(){this.setUp()}setUp(){if(`u`<typeof window)return;let e=`enUS`;if(navigator.language){let t=navigator.language.split(`-`);e=t[0],t.length!==1&&(e+=t[t.length-1].toUpperCase())}if(navigator.browserLanguage){let t=navigator.browserLanguage.split(`-`);e=t[0],t[1]&&(e+=t[1].toUpperCase())}this.current!==e&&this.isAvailable(e)&&(this.current=e,q.emit(q.EVENT_LANG_CHANGE,this,e,this.langs[e]))}isAvailable(e){return this.langs[e]!==void 0}add(e,t){this.langs[e]=t}setCurrent(e){if(!this.isAvailable(e))throw Error(`Language ${e} is not exists`);this.current!==e&&(this.current=e,q.emit(q.EVENT_LANG_CHANGE,this,e,this.langs[e]))}get(e,t){let n=this.langs[this.current][e]||``;return t&&Object.keys(t).forEach(e=>{n=n.replace(RegExp(`\\{${e}\\}`,`g`),t[e])}),n}getCurrent(){return this.current}},Y=class extends C.Component{static pluginName=``;static align=`left`;static defaultConfig={};get editor(){return this.props.editor}get editorConfig(){return this.props.editorConfig}get config(){return this.props.config}getConfig(e,t){return this.props.config[e]!==void 0&&this.props.config[e]!==null?this.props.config[e]:t}},fr=class extends Y{static pluginName=`divider`;render(){return C.createElement(`span`,{className:`rc-md-divider`})}},pr={start:0,end:0,text:``};function mr(e){return e&&(e instanceof Promise||(typeof e==`object`||typeof e==`function`)&&typeof e.then==`function`)}function hr(e,t){let n=``,r=t;for(;r--;)n+=e;return n}function gr(e,t){let{withKey:n,keyCode:r,key:i,aliasCommand:a}=t,o={ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,shiftKey:e.shiftKey,keyCode:e.keyCode,key:e.key};if(a&&(o.ctrlKey=o.ctrlKey||o.metaKey),n&&n.length>0){for(let e of n)if(o[e]!==void 0&&!o[e])return!1}else if(o.metaKey||o.ctrlKey||o.shiftKey||o.altKey)return!1;return o.key?o.key===i:o.keyCode===r}function _r(e,t){let n=e.split(` 14`),r=e.substr(0,t).split(` 15`),i=r.length,a=r[r.length-1].length,o=n[r.length-1],s=r.length>1?r[r.length-2]:null,c=n.length>r.length?n[r.length]:null;return{line:i,col:a,beforeText:e.substr(0,t),afterText:e.substr(t),curLine:o,prevLine:s,nextLine:c}}var X={bold:[`**`,`**`],italic:[`*`,`*`],underline:[`++`,`++`],strikethrough:[`~~`,`~~`],quote:[` 16> `,` 17`],inlinecode:["`","`"],code:["\n```\n","\n```\n"]};for(let e=1;e<=6;e++)X[`h${e}`]=[`\n${hr(`#`,e)} `,` 18`];function vr(e){let{row:t=2,col:n=2}=e,r=[`|`],i=[`|`],a=[`|`],o=``;for(let e=1;e<=n;e++)r.push(` Head |`),a.push(` --- |`),i.push(` Data |`);for(let e=1;e<=t;e++)o+=` 19`+i.join(``);return`${r.join(``)}\n${a.join(``)}${o}`}function yr(e,t){let n=t;if(n.substr(0,1)!==` 20`&&(n=` 21`+n),e===`unordered`)return n.length>1?n.replace(/\n/g,` 22* `).trim():`* `;{let e=1;return n.length>1?n.replace(/\n/g,()=>`\n${e++}. `).trim():`1. `}}function br(e,t){return{text:e,newBlock:t,selection:{start:e.length,end:e.length}}}function xr(e,t,n){if(X[t]!==void 0)return{text:`${X[t][0]}${e}${X[t][1]}`,selection:{start:X[t][0].length,end:X[t][0].length+e.length}};switch(t){case`tab`:let t=n.tabMapValue===1?` `:` `.repeat(n.tabMapValue),r=t+e.replace(/\n/g,`\n${t}`),i=e.includes(` 23`)?e.match(/\n/g).length:0;return{text:r,selection:{start:n.tabMapValue,end:n.tabMapValue*(i+1)+e.length}};case`unordered`:return br(yr(`unordered`,e),!0);case`order`:return br(yr(`order`,e),!0);case`hr`:return br(`---`,!0);case`table`:return{text:vr(n),newBlock:!0};case`image`:return{text:``,selection:{start:2,end:e.length+2}};case`link`:return{text:`[${e}](${n.linkUrl||``})`,selection:{start:1,end:e.length+1}}}return{text:e,selection:{start:0,end:e.length}}}var Sr=xr;function Cr(e,t){let n={};return Object.keys(e).forEach(r=>{if(t[r]===void 0){n[r]=e[r];return}if(typeof t[r]==`object`){Array.isArray(t[r])?n[r]=[...t[r]]:n[r]=Cr(e[r],t[r]);return}n[r]=t[r]}),n}function wr(e,...t){let n={...e};
23return t.forEach(e=>{typeof e==`object`&&(n=Cr(n,e))}),n}function Tr(e,t){return{placeholder:Sr(``,`image`,{target:`Uploading_${ir()}`,imageUrl:``}).text,uploaded:new Promise(n=>{let r=!0,i=t=>{r&&console.warn(`Deprecated: onImageUpload should return a Promise, callback will be removed in future`),n(Sr(``,`image`,{target:e.name,imageUrl:t}).text)},a=t(e,i);mr(a)&&(r=!1,a.then(i))})}}var Er=Tr,Dr={theme:`default`,view:{menu:!0,md:!0,html:!0},canView:{menu:!0,md:!0,html:!0,both:!0,fullScreen:!0,hideMenu:!0},htmlClass:``,markdownClass:``,syncScrollMode:[`rightFollowLeft`,`leftFollowRight`],imageUrl:``,imageAccept:``,linkUrl:``,loggerMaxSize:100,loggerInterval:600,table:{maxRow:4,maxCol:6},allowPasteImage:!0,onImageUpload:void 0,onCustomImageUpload:void 0,shortcuts:!0,onChangeTrigger:`both`},Or=class extends C.Component{el;constructor(e){super(e),this.el=C.createRef()}getElement(){return this.el.current}getHeight(){return this.el.current?this.el.current.offsetHeight:0}},kr=class extends Or{getHtml(){return typeof this.props.html==`string`?this.props.html:this.el.current?this.el.current.innerHTML:``}render(){return typeof this.props.html==`string`?C.createElement(`div`,{ref:this.el,dangerouslySetInnerHTML:{__html:this.props.html},className:this.props.className||`custom-html-style`}):C.createElement(`div`,{ref:this.el,className:this.props.className||`custom-html-style`},this.props.html)}},Z=class e extends C.Component{static plugins=[];static use(t,n={}){for(let r=0;r<e.plugins.length;r++)if(e.plugins[r][0]===t)return void e.plugins.splice(r,1,[t,n]);e.plugins.push([t,n])}static register=e.use.bind(e);static unuse(t){for(let n=0;n<e.plugins.length;n++)if(e.plugins[n][0]===t)return void e.plugins.splice(n,1)}static unregister=e.unuse.bind(e);static unuseAll(){e.plugins=[]}static addLocale=J.add.bind(J);static useLocale=J.setCurrent.bind(J);static getLocale=J.getCurrent.bind(J);config;emitter;nodeMdText=C.createRef();nodeMdPreview=C.createRef();nodeMdPreviewWrapper=C.createRef();hasContentChanged=!0;composing=!1;pluginApis=new Map;handleInputScroll;handlePreviewScroll;constructor(e){super(e),this.emitter=new lr,this.config=wr(Dr,this.props.config,this.props),this.state={text:(this.props.value||this.props.defaultValue||``).replace(/âµ/g,` 24`),html:``,view:this.config.view||Dr.view,fullScreen:!1,plugins:this.getPlugins()},this.config.canView&&!this.config.canView.menu&&(this.state.view.menu=!1),this.nodeMdText=C.createRef(),this.nodeMdPreviewWrapper=C.createRef(),this.handleChange=this.handleChange.bind(this),this.handlePaste=this.handlePaste.bind(this),this.handleDrop=this.handleDrop.bind(this),this.handleToggleMenu=this.handleToggleMenu.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleEditorKeyDown=this.handleEditorKeyDown.bind(this),this.handleLocaleUpdate=this.handleLocaleUpdate.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleInputScroll=this.handleSyncScroll.bind(this,`md`),this.handlePreviewScroll=this.handleSyncScroll.bind(this,`html`)}componentDidMount(){let{text:e}=this.state;this.renderHTML(e),q.on(q.EVENT_LANG_CHANGE,this.handleLocaleUpdate),J.setUp()}componentWillUnmount(){q.off(q.EVENT_LANG_CHANGE,this.handleLocaleUpdate)}componentDidUpdate(e){if(this.props.value!==void 0&&this.props.value!==this.state.text){let{value:e}=this.props;typeof e!=`string`&&(e=String(e).toString()),e=e.replace(/âµ/g,` 25`),this.state.text!==e&&(this.setState({text:e}),this.renderHTML(e))}e.plugins!==this.props.plugins&&this.setState({plugins:this.getPlugins()})}isComposing(){return this.composing}getPlugins(){let t=[];if(this.props.plugins){let n=n=>{if(n===fr.pluginName)return void t.push([fr,{}]);for(let r of e.plugins)if(r[0].pluginName===n)return void t.push(r)};for(let e of this.props.plugins)e===`fonts`?(n(`font-bold`),n(`font-italic`),n(`font-underline`),n(`font-strikethrough`),n(`list-unordered`),n(`list-ordered`),n(`block-quote`),n(`block-wrap`),n(`block-code-inline`),n(`block-code-block`)):n(e)}else t=[...e.plugins];let n={};return t.forEach(e=>{let{align:t=`left`,pluginName:r=``}=e[0];n[t]===void 0&&(n[t]=[]);let i=r===`divider`?ir():r;n[t].push(C.createElement(e[0],{editor:this,editorConfig:this.config,config:{...e[0].defaultConfig||{},...e[1]||{},...this.props.pluginConfig?.[r]||{}},key:i}))}),n}scrollScale=1;isSyncingScroll=!1;shouldSyncScroll=`md`;handleSyncScroll(e,t){if(e!==this.shouldSyncScroll)return;this.props.onScroll&&this.props.onScroll(t,e),this.emitter.emit(this.emitter.EVENT_SCROLL,t,e);let{syncScrollMode:n=[]}=this.config;n.includes(e===`md`?`rightFollowLeft`:`leftFollowRight`)&&(this.hasContentChanged&&this.nodeMdText.current&&this.nodeMdPreviewWrapper.current&&(this.scrollScale=this.nodeMdText.current.scrollHeight/this.nodeMdPreviewWrapper.current.scrollHeight,this.hasContentChanged=!1),this.isSyncingScroll||(this.isSyncingScroll=!0,requestAnimationFrame(()=>{this.nodeMdText.current&&this.nodeMdPreviewWrapper.current&&(e===`md`?this.nodeMdPreviewWrapper.current.scrollTop=this.nodeMdText.current.scrollTop/this.scrollScale:this.nodeMdText.current.scrollTop=this.nodeMdPreviewWrapper.current.scrollTop*this.scrollScale),this.isSyncingScroll=!1})))}renderHTML(e){if(!this.props.renderHTML)return console.error(`renderHTML props is required!`),Promise.resolve();let t=this.props.renderHTML(e);return mr(t)?t.then(e=>this.setHtml(e)):typeof t==`function`?this.setHtml(t()):this.setHtml(t)}
25setHtml(e){return new Promise(t=>{this.setState({html:e},t)})}handleToggleMenu(){this.setView({menu:!this.state.view.menu})}handleFocus(e){let{onFocus:t}=this.props;t&&t(e),this.emitter.emit(this.emitter.EVENT_FOCUS,e)}handleBlur(e){let{onBlur:t}=this.props;t&&t(e),this.emitter.emit(this.emitter.EVENT_BLUR,e)}handleChange(e){e.persist();let{value:t}=e.target;this.setText(t,e)}handlePaste(e){if(!this.config.allowPasteImage||!this.config.onImageUpload)return;let t=(e.nativeEvent.clipboardData||window.clipboardData).items;t&&(e.preventDefault(),this.uploadWithDataTransfer(t))}handleDrop(e){if(!this.config.onImageUpload)return;let t=e.nativeEvent;if(!t.dataTransfer)return;let{items:n}=t.dataTransfer;n&&(e.preventDefault(),this.uploadWithDataTransfer(n))}handleEditorKeyDown(e){let{keyCode:t,key:n,currentTarget:r}=e;if((t===13||n===`Enter`)&&!1===this.composing){let t=r.value,n=r.selectionStart,i=_r(t,n),a=()=>{let t=r.value.substr(0,n-i.curLine.length)+r.value.substr(n);this.setText(t,void 0,{start:n-i.curLine.length,end:n-i.curLine.length}),e.preventDefault()},o=t=>{this.insertText(`\n${t}`,!1,{start:t.length+1,end:t.length+1}),e.preventDefault()},s=i.curLine.match(/^(\s*?)\* /);if(s){if(/^(\s*?)\* $/.test(i.curLine))return void a();o(s[0]);return}let c=i.curLine.match(/^(\s*?)(\d+)\. /);if(c){if(/^(\s*?)(\d+)\. $/.test(i.curLine))return void a();o(`${c[1]}${parseInt(c[2],10)+1}. `);return}}this.emitter.emit(this.emitter.EVENT_EDITOR_KEY_DOWN,e)}handleLocaleUpdate(){this.forceUpdate()}getMdElement(){return this.nodeMdText.current}getHtmlElement(){return this.nodeMdPreviewWrapper.current}clearSelection(){this.nodeMdText.current&&this.nodeMdText.current.setSelectionRange(0,0,`none`)}getSelection(){let e=this.nodeMdText.current;if(!e)return{...pr};let t=e.selectionStart,n=e.selectionEnd;return{start:t,end:n,text:(e.value||``).slice(t,n)}}setSelection(e){this.nodeMdText.current&&(this.nodeMdText.current.setSelectionRange(e.start,e.end,`forward`),this.nodeMdText.current.focus())}insertMarkdown(e,t={}){let n=this.getSelection(),r=t?{...t}:{};if(e===`image`&&(r={...r,target:t.target||n.text||``,imageUrl:t.imageUrl||this.config.imageUrl}),e===`link`&&(r={...r,linkUrl:this.config.linkUrl}),e===`tab`&&n.start!==n.end){let e=this.getMdValue().slice(0,n.start).lastIndexOf(` 26`)+1;this.setSelection({start:e,end:n.end})}let i=Sr(n.text,e,r),{text:a}=i,{selection:o}=i;if(i.newBlock){let e=_r(this.getMdValue(),n.start),{col:t,curLine:r}=e;t>0&&r.length>0&&(a=`\n${a}`,o&&(o.start++,o.end++));let{afterText:i}=e;n.start!==n.end&&(i=_r(this.getMdValue(),n.end).afterText),i.trim()!==``&&i.substr(0,2)!==` 27 28`&&(i.substr(0,1)!==` 29`&&(a+=` 30`),a+=` 31`)}this.insertText(a,!0,o)}insertPlaceholder(e,t){this.insertText(e,!0),t.then(t=>{let n=this.getMdValue().replace(e,t);this.setText(n)})}insertText(e=``,t=!1,n){let{text:r}=this.state,i=this.getSelection(),a=r.slice(0,i.start),o=r.slice(t?i.end:i.start,r.length);this.setText(a+e+o,void 0,n?{start:n.start+a.length,end:n.end+a.length}:{start:i.start,end:i.start})}setText(e=``,t,n){let{onChangeTrigger:r=`both`}=this.config,i=e.replace(/âµ/g,` 32`);if(this.state.text===e)return;this.setState({text:i}),this.props.onChange&&(r===`both`||r===`beforeRender`)&&this.props.onChange({text:i,html:this.getHtmlValue()},t),this.emitter.emit(this.emitter.EVENT_CHANGE,e,t,t===void 0),n&&setTimeout(()=>this.setSelection(n)),this.hasContentChanged||=!0;let a=this.renderHTML(i);(r===`both`||r===`afterRender`)&&a.then(()=>{this.props.onChange&&this.props.onChange({text:this.state.text,html:this.getHtmlValue()},t)})}getMdValue(){return this.state.text}getHtmlValue(){return typeof this.state.html==`string`?this.state.html:this.nodeMdPreview.current?this.nodeMdPreview.current.getHtml():``}keyboardListeners=[];onKeyboard(e){if(Array.isArray(e))return void e.forEach(e=>this.onKeyboard(e));this.keyboardListeners.includes(e)||this.keyboardListeners.push(e)}offKeyboard(e){if(Array.isArray(e))return void e.forEach(e=>this.offKeyboard(e));let t=this.keyboardListeners.indexOf(e);t>=0&&this.keyboardListeners.splice(t,1)}handleKeyDown(e){for(let t of this.keyboardListeners)if(gr(e,t)){e.preventDefault(),t.callback(e);return}this.emitter.emit(this.emitter.EVENT_KEY_DOWN,e)}getEventType(e){switch(e){case`change`:return this.emitter.EVENT_CHANGE;case`fullscreen`:return this.emitter.EVENT_FULL_SCREEN;case`viewchange`:return this.emitter.EVENT_VIEW_CHANGE;case`keydown`:return this.emitter.EVENT_KEY_DOWN;
32case`editor_keydown`:return this.emitter.EVENT_EDITOR_KEY_DOWN;case`blur`:return this.emitter.EVENT_BLUR;case`focus`:return this.emitter.EVENT_FOCUS;case`scroll`:return this.emitter.EVENT_SCROLL}}on(e,t){let n=this.getEventType(e);n&&this.emitter.on(n,t)}off(e,t){let n=this.getEventType(e);n&&this.emitter.off(n,t)}setView(e){let t={...this.state.view,...e};this.setState({view:t},()=>{this.emitter.emit(this.emitter.EVENT_VIEW_CHANGE,t)})}getView(){return{...this.state.view}}fullScreen(e){this.state.fullScreen!==e&&this.setState({fullScreen:e},()=>{this.emitter.emit(this.emitter.EVENT_FULL_SCREEN,e)})}registerPluginApi(e,t){this.pluginApis.set(e,t)}unregisterPluginApi(e){this.pluginApis.delete(e)}callPluginApi(e,...t){let n=this.pluginApis.get(e);if(!n)throw Error(`API ${e} not found`);return n(...t)}isFullScreen(){return this.state.fullScreen}uploadWithDataTransfer(e){let{onImageUpload:t}=this.config;if(!t)return;let n=[];Array.prototype.forEach.call(e,e=>{if(e.kind===`file`&&e.type.includes(`image`)){let r=e.getAsFile();if(r){let e=Er(r,t);n.push(Promise.resolve(e.placeholder)),e.uploaded.then(t=>{let n=this.getMdValue().replace(e.placeholder,t),r=t.length-e.placeholder.length,i=this.getSelection();this.setText(n,void 0,{start:i.start+r,end:i.start+r})})}}else e.kind===`string`&&e.type.indexOf(`text/`)===0&&n.push(new Promise(t=>e.getAsString(t)))}),Promise.all(n).then(e=>{let t=e.join(``),n=this.getSelection();this.insertText(t,!0,{start:n.start===n.end?t.length:0,end:t.length})})}render(){let{view:e,fullScreen:t,text:n,html:r}=this.state,{id:i,className:a=``,style:o,name:s=`textarea`,autoFocus:c,placeholder:l,readOnly:u}=this.props,{canView:d}=this.config,f=d?.hideMenu&&d?.menu,p=e=>this.state.plugins[e]||[],m=!!e.menu,h=i?`${i}_md`:void 0,g=i?`${i}_html`:void 0;return C.createElement(`div`,{id:i,className:`rc-md-editor ${t?`full`:``} ${a}`,style:o,onKeyDown:this.handleKeyDown,onDrop:this.handleDrop},C.createElement(ar,{visible:m,left:p(`left`),right:p(`right`)}),C.createElement(`div`,{className:`editor-container`},f&&C.createElement(or,null,C.createElement(`span`,{className:`button button-type-menu`,title:m?`hidden menu`:`show menu`,onClick:this.handleToggleMenu},C.createElement(K,{type:`expand-${m?`less`:`more`}`}))),C.createElement(`section`,{className:`section sec-md ${e.md?`visible`:`in-visible`}`},C.createElement(`textarea`,{id:h,ref:this.nodeMdText,name:s,autoFocus:c,placeholder:l,readOnly:u,value:n,className:`section-container input ${this.config.markdownClass||``}`,wrap:`hard`,onChange:this.handleChange,onScroll:this.handleInputScroll,onMouseOver:()=>this.shouldSyncScroll=`md`,onKeyDown:this.handleEditorKeyDown,onCompositionStart:()=>this.composing=!0,onCompositionEnd:()=>this.composing=!1,onPaste:this.handlePaste,onFocus:this.handleFocus,onBlur:this.handleBlur})),C.createElement(`section`,{className:`section sec-html ${e.html?`visible`:`in-visible`}`},C.createElement(`div`,{id:g,className:`section-container html-wrap`,ref:this.nodeMdPreviewWrapper,onMouseOver:()=>this.shouldSyncScroll=`html`,onScroll:this.handlePreviewScroll},C.createElement(kr,{html:r,className:this.config.htmlClass,ref:this.nodeMdPreview})))))}},Ar=class extends Y{static pluginName=`block-code-block`;render(){return C.createElement(`span`,{className:`button button-type-code-block`,title:J.get(`btnCode`),onClick:()=>this.editor.insertMarkdown(`code`)},C.createElement(K,{type:`code-block`}))}},jr=class extends Y{static pluginName=`block-code-inline`;render(){return C.createElement(`span`,{className:`button button-type-code-inline`,title:J.get(`btnInlineCode`),onClick:()=>this.editor.insertMarkdown(`inlinecode`)},C.createElement(K,{type:`code`}))}},Mr=class extends Y{static pluginName=`block-quote`;render(){return C.createElement(`span`,{className:`button button-type-quote`,title:J.get(`btnQuote`),onClick:()=>this.editor.insertMarkdown(`quote`)},C.createElement(K,{type:`quote`}))}},Nr=class extends Y{static pluginName=`block-wrap`;render(){return C.createElement(`span`,{className:`button button-type-wrap`,title:J.get(`btnLineBreak`),onClick:()=>this.editor.insertMarkdown(`hr`)},C.createElement(K,{type:`wrap`}))}},Pr=class extends Y{static pluginName=`clear`;constructor(e){super(e),this.handleClick=this.handleClick.bind(this)}handleClick(){this.editor.getMdValue()!==``&&window.confirm&&typeof window.confirm==`function`&&window.confirm(J.get(`clearTip`))&&this.editor.setText(``)}
32render(){return C.createElement(`span`,{className:`button button-type-clear`,title:J.get(`btnClear`),onClick:this.handleClick},C.createElement(K,{type:`delete`}))}},Fr=class extends Y{static pluginName=`font-bold`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`b`,keyCode:66,aliasCommand:!0,withKey:[`ctrlKey`],callback:()=>this.editor.insertMarkdown(`bold`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-bold`,title:J.get(`btnBold`),onClick:()=>this.editor.insertMarkdown(`bold`)},C.createElement(K,{type:`bold`}))}},Ir=class extends Y{static pluginName=`font-italic`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`i`,keyCode:73,aliasCommand:!0,withKey:[`ctrlKey`],callback:()=>this.editor.insertMarkdown(`italic`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-italic`,title:J.get(`btnItalic`),onClick:()=>this.editor.insertMarkdown(`italic`)},C.createElement(K,{type:`italic`}))}},Lr=class extends Y{static pluginName=`font-strikethrough`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`d`,keyCode:68,aliasCommand:!0,withKey:[`ctrlKey`],callback:()=>this.editor.insertMarkdown(`strikethrough`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-strikethrough`,title:J.get(`btnStrikethrough`),onClick:()=>this.editor.insertMarkdown(`strikethrough`)},C.createElement(K,{type:`strikethrough`}))}},Rr=class extends Y{static pluginName=`font-underline`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`u`,keyCode:85,withKey:[`ctrlKey`],callback:()=>this.editor.insertMarkdown(`underline`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-underline`,title:J.get(`btnUnderline`),onClick:()=>this.editor.insertMarkdown(`underline`)},C.createElement(K,{type:`underline`}))}},zr=class extends Y{static pluginName=`full-screen`;static align=`right`;constructor(e){super(e),this.handleClick=this.handleClick.bind(this),this.handleChange=this.handleChange.bind(this),this.state={enable:this.editor.isFullScreen()}}handleClick(){this.editor.fullScreen(!this.state.enable)}handleChange(e){this.setState({enable:e})}componentDidMount(){this.editor.on(`fullscreen`,this.handleChange)}componentWillUnmount(){this.editor.off(`fullscreen`,this.handleChange)}render(){if(this.editorConfig.canView&&this.editorConfig.canView.fullScreen){let{enable:e}=this.state;return C.createElement(`span`,{className:`button button-type-fullscreen`,title:J.get(e?`btnExitFullScreen`:`btnFullScreen`),onClick:this.handleClick},C.createElement(K,{type:e?`fullscreen-exit`:`fullscreen`}))}return null}},Br=class extends C.Component{handleHeader(e){let{onSelectHeader:t}=this.props;typeof t==`function`&&t(e)}render(){return C.createElement(`ul`,{className:`header-list`},C.createElement(`li`,{className:`list-item`},C.createElement(`h1`,{onClick:this.handleHeader.bind(this,`h1`)},`H1`)),C.createElement(`li`,{className:`list-item`},C.createElement(`h2`,{onClick:this.handleHeader.bind(this,`h2`)},`H2`)),C.createElement(`li`,{className:`list-item`},C.createElement(`h3`,{onClick:this.handleHeader.bind(this,`h3`)},`H3`)),C.createElement(`li`,{className:`list-item`},C.createElement(`h4`,{onClick:this.handleHeader.bind(this,`h4`)},`H4`)),C.createElement(`li`,{className:`list-item`},C.createElement(`h5`,{onClick:this.handleHeader.bind(this,`h5`)},`H5`)),C.createElement(`li`,{className:`list-item`},C.createElement(`h6`,{onClick:this.handleHeader.bind(this,`h6`)},`H6`)))}},Vr=class extends Y{static pluginName=`header`;constructor(e){super(e),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.state={show:!1}}
32show(){this.setState({show:!0})}hide(){this.setState({show:!1})}render(){return C.createElement(`span`,{className:`button button-type-header`,title:J.get(`btnHeader`),onMouseEnter:this.show,onMouseLeave:this.hide},C.createElement(K,{type:`font-size`}),C.createElement(rr,{show:this.state.show,onClose:this.hide},C.createElement(Br,{onSelectHeader:e=>this.editor.insertMarkdown(e)})))}},Hr=class extends C.Component{timerId;locked;input;constructor(e){super(e),this.timerId=void 0,this.locked=!1,this.input=C.createRef()}click(){this.locked||!this.input.current||(this.locked=!0,this.input.current.value=``,this.input.current.click(),this.timerId&&window.clearTimeout(this.timerId),this.timerId=window.setTimeout(()=>{this.locked=!1,window.clearTimeout(this.timerId),this.timerId=void 0},200))}componentWillUnmount(){this.timerId&&window.clearTimeout(this.timerId)}render(){return C.createElement(`input`,{type:`file`,ref:this.input,accept:this.props.accept,style:{position:`absolute`,zIndex:-1,left:0,top:0,width:0,height:0,opacity:0},onChange:this.props.onChange})}},Ur=class extends Y{static pluginName=`image`;inputFile;constructor(e){super(e),this.inputFile=C.createRef(),this.onImageChanged=this.onImageChanged.bind(this),this.handleCustomImageUpload=this.handleCustomImageUpload.bind(this),this.handleImageUpload=this.handleImageUpload.bind(this),this.state={show:!1}}handleImageUpload(){let{onImageUpload:e}=this.editorConfig;typeof e==`function`?this.inputFile.current&&this.inputFile.current.click():this.editor.insertMarkdown(`image`)}onImageChanged(e){let{onImageUpload:t}=this.editorConfig;if(t){let n=Er(e,t);this.editor.insertPlaceholder(n.placeholder,n.uploaded)}}handleCustomImageUpload(e){let{onCustomImageUpload:t}=this.editorConfig;if(t){let n=t.call(this,e);mr(n)&&n.then(e=>{e&&e.url&&this.editor.insertMarkdown(`image`,{target:e.text,imageUrl:e.url})})}}render(){return this.editorConfig.onCustomImageUpload?C.createElement(`span`,{className:`button button-type-image`,title:J.get(`btnImage`),onClick:this.handleCustomImageUpload},C.createElement(K,{type:`image`})):C.createElement(`span`,{className:`button button-type-image`,title:J.get(`btnImage`),onClick:this.handleImageUpload,style:{position:`relative`}},C.createElement(K,{type:`image`}),C.createElement(Hr,{accept:this.editorConfig.imageAccept||``,ref:this.inputFile,onChange:e=>{e.persist(),e.target.files&&e.target.files.length>0&&this.onImageChanged(e.target.files[0])}}))}},Wr=class extends Y{static pluginName=`link`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`k`,keyCode:75,aliasCommand:!0,withKey:[`ctrlKey`],callback:()=>this.editor.insertMarkdown(`link`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-link`,title:J.get(`btnLink`),onClick:()=>this.editor.insertMarkdown(`link`)},C.createElement(K,{type:`link`}))}},Gr=class extends Y{static pluginName=`list-ordered`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`7`,keyCode:55,withKey:[`ctrlKey`,`shiftKey`],aliasCommand:!0,callback:()=>this.editor.insertMarkdown(`order`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-ordered`,title:J.get(`btnOrdered`),onClick:()=>this.editor.insertMarkdown(`order`)},C.createElement(K,{type:`list-ordered`}))}},Kr=class extends Y{static pluginName=`list-unordered`;handleKeyboard;constructor(e){super(e),this.handleKeyboard={key:`8`,keyCode:56,withKey:[`ctrlKey`,`shiftKey`],aliasCommand:!0,callback:()=>this.editor.insertMarkdown(`unordered`)}}componentDidMount(){this.editorConfig.shortcuts&&this.editor.onKeyboard(this.handleKeyboard)}componentWillUnmount(){this.editor.offKeyboard(this.handleKeyboard)}render(){return C.createElement(`span`,{className:`button button-type-unordered`,title:J.get(`btnUnordered`),onClick:()=>this.editor.insertMarkdown(`unordered`)},C.createElement(K,{type:`list-unordered`}))}},qr=100,Jr=class{record=[];recycle=[];maxSize;initValue=``;constructor(e={}){let{maxSize:t=qr}=e;this.maxSize=t}push(e){let t=this.record.push(e);for(;this.record.length>this.maxSize;)this.record.shift();return t}get(){return this.record}
32getLast(){let{length:e}=this.record;return this.record[e-1]}undo(e){let t=this.record.pop();if(t===void 0)return this.initValue;if(t!==e)return this.recycle.push(t),t;let n=this.record.pop();return n===void 0?(this.recycle.push(t),this.initValue):(this.recycle.push(t),n)}redo(){let e=this.recycle.pop();if(e!==void 0)return this.push(e),e}cleanRedo(){this.recycle=[]}getUndoCount(){return this.undo.length}getRedoCount(){return this.recycle.length}},Yr=class extends Y{static pluginName=`logger`;logger;timerId;handleKeyboards=[];lastPop=null;constructor(e){super(e),this.handleChange=this.handleChange.bind(this),this.handleRedo=this.handleRedo.bind(this),this.handleUndo=this.handleUndo.bind(this),this.handleKeyboards=[{key:`y`,keyCode:89,withKey:[`ctrlKey`],callback:this.handleRedo},{key:`z`,keyCode:90,withKey:[`metaKey`,`shiftKey`],callback:this.handleRedo},{key:`z`,keyCode:90,aliasCommand:!0,withKey:[`ctrlKey`],callback:this.handleUndo}],this.logger=new Jr({maxSize:this.editorConfig.loggerMaxSize}),this.editor.registerPluginApi(`undo`,this.handleUndo),this.editor.registerPluginApi(`redo`,this.handleRedo)}handleUndo(){let e=this.logger.undo(this.editor.getMdValue());e!==void 0&&(this.pause(),this.lastPop=e,this.editor.setText(e),this.forceUpdate())}handleRedo(){let e=this.logger.redo();e!==void 0&&(this.lastPop=e,this.editor.setText(e),this.forceUpdate())}handleChange(e,t,n){if(!(this.logger.getLast()===e||this.lastPop!==null&&this.lastPop===e)){if(this.logger.cleanRedo(),n){this.logger.push(e),this.lastPop=null,this.forceUpdate();return}this.timerId&&=(window.clearTimeout(this.timerId),0),this.timerId=window.setTimeout(()=>{this.logger.getLast()!==e&&(this.logger.push(e),this.lastPop=null,this.forceUpdate()),window.clearTimeout(this.timerId),this.timerId=0},this.editorConfig.loggerInterval)}}componentDidMount(){this.editor.on(`change`,this.handleChange),this.handleKeyboards.forEach(e=>this.editor.onKeyboard(e)),this.logger.initValue=this.editor.getMdValue(),this.forceUpdate()}componentWillUnmount(){this.timerId&&window.clearTimeout(this.timerId),this.editor.off(`change`,this.handleChange),this.editor.unregisterPluginApi(`undo`),this.editor.unregisterPluginApi(`redo`),this.handleKeyboards.forEach(e=>this.editor.offKeyboard(e))}pause(){this.timerId&&=(window.clearTimeout(this.timerId),void 0)}render(){let e=this.logger.getUndoCount()>1||this.logger.initValue!==this.editor.getMdValue(),t=this.logger.getRedoCount()>0;return C.createElement(C.Fragment,null,C.createElement(`span`,{className:`button button-type-undo ${e?``:`disabled`}`,title:J.get(`btnUndo`),onClick:this.handleUndo},C.createElement(K,{type:`undo`})),C.createElement(`span`,{className:`button button-type-redo ${t?``:`disabled`}`,title:J.get(`btnRedo`),onClick:this.handleRedo},C.createElement(K,{type:`redo`})))}},Xr=class extends Y{static pluginName=`mode-toggle`;static align=`right`;get isDisplay(){let{canView:e}=this.editorConfig;return e?[e.html,e.md,e.both].filter(e=>e).length>=2:!1}get next(){let{canView:e}=this.editorConfig,{view:t}=this.state,n=[0,1,2];e&&(e.both||n.splice(n.indexOf(0),1),e.md||n.splice(n.indexOf(1),1),e.html||n.splice(n.indexOf(2),1));let r=1;if(t.html&&(r=2),t.html&&t.md&&(r=0),n.length===0)return r;if(n.length===1)return n[0];let i=n.indexOf(r);return i<n.length-1?n[i+1]:n[0]}constructor(e){super(e),this.handleClick=this.handleClick.bind(this),this.handleChange=this.handleChange.bind(this),this.state={view:this.editor.getView()}}handleClick(){switch(this.next){case 0:this.editor.setView({html:!0,md:!0});break;case 2:this.editor.setView({html:!0,md:!1});break;case 1:this.editor.setView({html:!1,md:!0});break}}handleChange(e){this.setState({view:e})}componentDidMount(){this.editor.on(`viewchange`,this.handleChange)}componentWillUnmount(){this.editor.off(`viewchange`,this.handleChange)}getDisplayInfo(){let{next:e}=this;switch(e){case 0:return{icon:`view-split`,title:`All`};case 2:return{icon:`visibility`,title:`Preview`};default:return{icon:`keyboard`,title:`Editor`}}}render(){if(this.isDisplay){let e=this.getDisplayInfo();return C.createElement(`span`,{className:`button button-type-mode`,title:J.get(`btnMode${e.title}`),onClick:this.handleClick},C.createElement(K,{type:e.icon}))}return null}};d(),C.Component;var Zr=class extends C.Component{config={padding:3,width:20,height:20};constructor(e){super(e);let{maxRow:t=5,maxCol:n=6}=e;this.state={maxRow:t,maxCol:n,list:this.formatTableModel(t,n)}}formatTableModel(e=0,t=0){return Array(e).fill(void 0).map(e=>Array(t).fill(0))}
32calcWrapStyle(){let{maxRow:e,maxCol:t}=this.state,{width:n,height:r,padding:i}=this.config,a=(n+i)*t-i,o=(r+i)*e-i;return{width:`${a}px`,height:`${o}px`}}calcItemStyle(e=0,t=0){let{width:n,height:r,padding:i}=this.config,a=(r+i)*e,o=(n+i)*t;return{top:`${a}px`,left:`${o}px`}}getList(e,t){let{list:n}=this.state;return n.map((n,r)=>n.map((n,i)=>+(r<=e&&i<=t)))}handleHover(e,t){this.setState({list:this.getList(e,t)})}handleSetTable(e,t){let{onSetTable:n}=this.props;typeof n==`function`&&n({row:e+1,col:t+1})}componentDidUpdate(e){!1===this.props.visibility&&e.visibility!==this.props.visibility&&this.setState({list:this.getList(-1,-1)})}render(){return C.createElement(`ul`,{className:`table-list wrap`,style:this.calcWrapStyle()},this.state.list.map((e,t)=>e.map((e,n)=>C.createElement(`li`,{className:`list-item ${e===1?`active`:``}`,key:`${t}-${n}`,style:this.calcItemStyle(t,n),onMouseOver:this.handleHover.bind(this,t,n),onClick:this.handleSetTable.bind(this,t,n)}))))}},Qr=class extends Y{static pluginName=`table`;static defaultConfig={maxRow:6,maxCol:6};constructor(e){super(e),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this.state={show:!1}}show(){this.setState({show:!0})}hide(){this.setState({show:!1})}render(){let e=this.editorConfig.table||this.props.config;return C.createElement(`span`,{className:`button button-type-table`,title:J.get(`btnTable`),onMouseEnter:this.show,onMouseLeave:this.hide},C.createElement(K,{type:`grid`}),C.createElement(rr,{show:this.state.show,onClose:this.hide},C.createElement(Zr,{visibility:this.state.show,maxRow:e.maxRow,maxCol:e.maxCol,onSetTable:e=>this.editor.insertMarkdown(`table`,e)})))}};Z.use(Vr),Z.use(Fr),Z.use(Ir),Z.use(Rr),Z.use(Lr),Z.use(Kr),Z.use(Gr),Z.use(Mr),Z.use(Nr),Z.use(jr),Z.use(Ar),Z.use(Qr),Z.use(Ur),Z.use(Wr),Z.use(Pr),Z.use(Yr),Z.use(Xr),Z.use(zr);var $r=Z,ei=new G;function ti(e){let{showMdModal:t,setShowMdModal:n,mdContent:r,setMdContent:i,fileList:o,setFileList:s}=e,{t:c}=a(),l=(0,C.useRef)(null);return(0,T.jsx)(`div`,{id:`mdModal`,className:k[`modal-overlay`]+` `+(t?k.active:``),children:(0,T.jsxs)(`div`,{className:k[`modal-content`],style:{maxWidth:960},children:[t?(0,T.jsx)($r,{ref:l,style:{height:`500px`},value:r,canView:{fullScreen:!1},renderHTML:e=>ei.render(e),onChange:({text:e})=>{i(e)}}):null,(0,T.jsxs)(`div`,{className:k[`modal-footer`],children:[(0,T.jsx)(`button`,{className:k[`cancel-btn`],onClick:()=>n(null),children:c(`fastmode.cancel`)}),(0,T.jsx)(`button`,{className:k[`confirm-btn`]+` `+(r.trim()?``:k.disabled),onClick:()=>{let e=he.default.cloneDeep(o).map(e=>(e.id===t.id&&(e.data.content=r),e));s(e),n(null),i(``)},children:c(`fastmode.ok`)})]})]})})}var Q={"modal-overlay":`_modal-overlay_1sk72_1`,"modal-content":`_modal-content_1sk72_16`,active:`_active_1sk72_30`,"modal-header":`_modal-header_1sk72_37`,"close-btn":`_close-btn_1sk72_51`,"tab-controls":`_tab-controls_1sk72_63`,"tab-btn":`_tab-btn_1sk72_70`,"tab-panel":`_tab-panel_1sk72_96`,"drop-area":`_drop-area_1sk72_103`,"drag-over":`_drag-over_1sk72_111`,"upload-btn-main":`_upload-btn-main_1sk72_129`,"progress-container":`_progress-container_1sk72_149`,"progress-bar":`_progress-bar_1sk72_156`,"progress-fill":`_progress-fill_1sk72_164`,shimmer:`_shimmer_1sk72_1`,"progress-text":`_progress-text_1sk72_183`,"url-input-group":`_url-input-group_1sk72_190`,"add-url-btn":`_add-url-btn_1sk72_209`,"url-hint":`_url-hint_1sk72_223`};function ni(e){let{visible:t,onClose:n,workspace:r,setFileList:i,getExtractTask:o}=e,{t:c}=a(),[u,d]=(0,C.useState)(`file`),[p,m]=(0,C.useState)(!1),[h,_]=(0,C.useState)(``),[v,y]=(0,C.useState)(0);return(0,T.jsx)(`div`,{id:`uploadModal`,className:`${Q[`modal-overlay`]} ${t?Q.active:``}`,children:(0,T.jsxs)(`div`,{className:Q[`modal-content`],children:[(0,T.jsxs)(`div`,{className:Q[`modal-header`],children:[(0,T.jsx)(`h3`,{children:c(`conversation.attachResources`)}),(0,T.jsx)(`button`,{className:Q[`close-btn`],onClick:n,children:`Ã`})]}),(0,T.jsxs)(`div`,{className:Q[`tab-controls`],children:[(0,T.jsxs)(`button`,{className:`${Q[`tab-btn`]} ${u===`file`?Q.active:``}`,"data-tab":`file`,onClick:()=>{d(`file`)}
32,children:[(0,T.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,children:(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1M16 12l-4-4m0 0L8 12m4-4v12`})}),c(`conversation.fileUpload`)]}),(0,T.jsxs)(`button`,{className:`${Q[`tab-btn`]} ${u===`url`?Q.active:``}`,"data-tab":`url`,onClick:()=>{d(`url`)},children:[(0,T.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,children:(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1`})}),c(`conversation.pasteUrl`)]})]}),(0,T.jsxs)(`div`,{className:Q[`tab-panels`],children:[(0,T.jsx)(`div`,{id:`file`,className:`${Q[`tab-panel`]} ${u===`file`?Q.active:``}`,children:(0,T.jsxs)(`div`,{className:Q[`drop-area`],children:[(0,T.jsx)(l,{}),(0,T.jsx)(`p`,{children:c(`conversation.selectFilesToUpload`)}),(0,T.jsx)(`input`,{type:`file`,id:`fileInput`,accept:`.pdf,.doc,.docx,.ppt,.pptx,.txt,.md`,style:{display:`none`},onChange:async e=>{if(p)return;m(!0),y(0);let t=e.target.files[0],n=new FormData;n.append(`file`,t);let a;try{let t=await te.post(f(!0)+`/api/v1/workspace/${r.id}/upload`,n,{headers:{"Content-Type":`multipart/form-data`,Authorization:localStorage.getItem(`auth`)},onUploadProgress:e=>{if(e.total){let t=Math.round(e.loaded*100/e.total);y(t)}}});e.target.value=``;let i=t.data.data,s=(await g({method:`POST`,url:`/api/v1/workspace/${r.id}/extract_queue/${i.id}`})).data;a=s.id,await o(s)}catch{i(e=>e.filter(e=>e.id!==a)),s.error(c(`message.error.failedGetExtractTask`))}finally{m(!1),setTimeout(()=>y(0),500)}}}),(0,T.jsx)(`label`,{htmlFor:`fileInput`,className:Q[`upload-btn-main`],children:c(p?`conversation.uploading`:`conversation.browseFiles`)}),(0,T.jsxs)(`small`,{children:[c(`conversation.supports`),` PDF, DOC, DOCX, PPT, PPTX, TXT, MD`]}),v>0&&(0,T.jsxs)(`div`,{className:Q[`progress-container`],children:[(0,T.jsx)(`div`,{className:Q[`progress-bar`],children:(0,T.jsx)(`div`,{className:Q[`progress-fill`],style:{width:`${v}%`}})}),(0,T.jsxs)(`span`,{className:Q[`progress-text`],children:[v,`%`]})]})]})}),(0,T.jsxs)(`div`,{id:`url`,className:`${Q[`tab-panel`]} ${u===`url`?Q.active:``}`,children:[(0,T.jsxs)(`div`,{className:Q[`url-input-group`],children:[(0,T.jsx)(`input`,{type:`url`,placeholder:c(`conversation.pasteUrlHere`),value:h,onChange:e=>_(e.target.value)}),(0,T.jsx)(`button`,{className:Q[`add-url-btn`],onClick:async()=>{if(h&&!p){m(!0);try{let e=await g({method:`POST`,url:`/api/v1/workspace/${r.id}/extract/web`,data:{url:h}});_(``),await o(e.data)}catch(e){s.error(e.response?.data?.message||c(`message.error.failedAddUrl`))}finally{m(!1)}}},children:c(p?`conversation.uploading`:`conversation.addUrl`)})]}),(0,T.jsx)(`small`,{className:Q[`url-hint`],children:c(`conversation.acceptedLinks`)})]})]})]})})}var ri=({risks:e,initialContent:t,onCancel:n,onSuccess:r})=>{let{t:i}=a(`riskEditor`),[o,c]=(0,C.useState)(t),l=(0,C.useRef)(null),[u,d]=(0,C.useState)(!1),f=(0,C.useMemo)(()=>{if(!e.length||!o)return o;let t=[...e].sort((e,t)=>t.length-e.length),n=RegExp(`(${t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)})`,`g`);return o.replace(n,e=>`<span class="risk-highlight" data-risk="${e}">${e}</span>`)},[o,e]),m=()=>{l.current&&c(l.current.innerText)},h=e=>{if(!l.current)return;let t=l.current.querySelectorAll(`span[data-risk="${e}"]`);if(t.length>0){let e=t[0];e.scrollIntoView({behavior:`smooth`,block:`center`});let n=document.createRange(),r=window.getSelection();n.selectNodeContents(e),r?.removeAllRanges(),r?.addRange(n)}};return(0,C.useEffect)(()=>{l.current&&l.current.innerText!==o&&(l.current.innerHTML=f)},[f]),(0,T.jsx)(y,{title:(0,T.jsxs)(`div`,{style:$.riskTitle,children:[(0,T.jsx)(p,{style:{width:20,height:20,display:`block`}}),(0,T.jsx)(`span`,{children:i(`editRiskWords`)})]}),open:!0,onCancel:()=>{n()},cancelText:i(`cancel`,{ns:`common`}),okText:i(u?`loading`:`confirm`,{ns:`common`}),onOk:async()=>{if(!u){if(e.filter(e=>o.includes(e)).length>0){s.error(i(`mustRemoveRiskWords`));return}d(!0);try{await r(l.current.innerText)}catch{s.error(i(`updateFileFailed`))}finally{d(!1)}}},width:800,children:(0,T.jsxs)(`div`,{style:$.riskContainer,children:[(0,T.jsx)(`div`,{style:$.editorWrapper,children:(0,T.jsx)(`div`,{ref:l,contentEditable:!0,suppressContentEditableWarning:!0,onBlur:m,style:$.riskEditor})}),(0,T.jsxs)(`div`,{style:$.riskSidebar,children:[(0,T.jsxs)(`div`,{style:$.riskLabel,children:[i(`detectedRiskWords`),` (`,e.filter(e=>o.includes(e)).length,`)`]}),(0,T.jsx)(`div`,{style:$.riskList,children:e.filter(e=>o.includes(e)).map((e,t)=>(0,T.jsx)(`button`,{onClick:()=>h(e),style:$.riskItem,children:e},t))})]}),(0,T.jsx)(`style`,{children:` 33 .risk-highlight { 34 background-color: #ffe58f; 35 border-bottom: 2px solid #faad14; 36 cursor: pointer; 37 border-radius: 2px; 38 padding: 0 2px; 39 } 40 `})]})})},$={riskTitle:{display:`flex`,alignItems:`center`,gap:`8px`,fontWeight:`bold`},riskContainer:{display:`flex`,gap:`20px`,maxWidth:`800px`,margin:`0 auto`},editorWrapper:{flex:2,display:`flex`,flexDirection:`column`,width:`488px`},riskLabel:{marginBottom:`8px`,fontWeight:`bold`,fontSize:`16px`},riskEditor:{borderRadius:`4px`,padding:`12px`,minHeight:`200px`,maxHeight:`400px`,overflowY:`auto`,whiteSpace:`pre-wrap`,outline:`none`,backgroundColor:`var(--tag-bg)`,fontSize:`16px`},riskSidebar:{flex:1,display:`flex`,flexDirection:`column`,maxHeight:`400px`},riskList:{display:`flex`,flexDirection:`column`,gap:`8px`,overflowY:`auto`},riskItem:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,padding:`8px 12px`,backgroundColor:`var(--loading-color)`,border:`1px solid var(--loading-color)`,color:`var(--text-main)`,borderRadius:`4px`,cursor:`pointer`,textAlign:`left`,transition:`all 0.2s`}};function ii(e){let{t}=a(),{workspace:n,fileList:r,setFileList:i,msg:l,setMessage:u,settings:d}=e,[p,m]=(0,C.useState)(!1),[h,v]=(0,C.useState)(null),[y,ne]=(0,C.useState)(`5-10`),[b,re]=(0,C.useState)(d?.language||(localStorage.getItem(`locale`)===`en`?`en`:`cn`)),[ie,ae]=(0,C.useState)(d?.text_amount||`medium`),[oe,se]=(0,C.useState)(d?.layout_density||`medium`),[ce,le]=(0,C.useState)(d?.text_mode||`preserve`),[ue,de]=(0,C.useState)(d?.card_size||`landscape`),[x,fe]=(0,C.useState)(d?.search||!1),[pe,w]=(0,C.useState)(null),[E,D]=(0,C.useState)(``),[O,k]=(0,C.useState)(!1),[A,ke]=(0,C.useState)(null);(0,C.useEffect)(()=>{async function e(){try{let e=(await _())?.data?.subscription?.level;v(e),De(e)<10&&ne(`5-10`)}catch(e){console.error(`Failed to fetch subscription level:`,e)}}e()},[]);let j=(0,C.useCallback)(async()=>{let e=r.filter(e=>e.status===`done`);if(!l.trim()&&e.length===0||O)return;k(!0);let i={generation_type:`document`,inputs:{type:`ai`,content:l},settings:{cards_range:y,text_amount:ie},content:``};r.length>0&&(i.inputs.attachments=e.map(e=>e.data),i.settings={layout_density:oe,text_mode:ce}),i.settings.language=b,i.settings.card_size=ue,x&&(i.settings.search=!0);try{let e=await g({method:`POST`,url:`/api/v1/workspace/${n.id}/generation`,data:i});window.location.href=`/create/${e.data.id}`}catch(e){s.error(e.response?.data?.message||t(`fastmode.submitFailed`))}finally{k(!1)}},[l,r,b,y,ie,oe,ce,ue,x]),Ae=0;for(let e of r)e.status===`done`&&(Ae+=e.data.tokens);let je=(0,C.useCallback)(async e=>{let t=he.default.cloneDeep(r);t.push({id:e.id,filename:e.filename,status:e.status,progress:0,data:e}),i(t),m(!1);let a=async()=>{let t=await g({method:`GET`,url:`/api/v1/workspace/${n.id}/extract/${e.id}`});i(n=>n.map(n=>n.id===e.id?{id:e.id,filename:e.filename,status:`done`,progress:100,data:t.data}
40:n)),he.default.isArray(t.data.risks)&&t.data.risks.length>0&&ke({id:e.id,risks:t.data.risks,content:t.data.content})};if(e.status===`done`){await a();return}if(e.status===`fail`||e.status===`illegal`)return;if(!e.media_id)throw Error(`Extract task is missing media_id`);let o=e=>new Promise(t=>setTimeout(t,e)),s=async()=>{let t=await g({method:`POST`,url:`/api/v1/workspace/${n.id}/extract_queue/${e.media_id}/${e.id}`});t.data.status===`create`||t.data.status===`running`?(i(n=>n.map(n=>n.id===e.id?{id:e.id,filename:e.filename,status:t.data.status,progress:he.default.min([n.progress+10,100]),data:e}:n)),await o(3e3),await s()):t.data.status===`done`?await a():i(n=>n.map(n=>n.id===e.id?{id:e.id,filename:e.filename,status:t.data.status,progress:n.progress,data:t.data}:n))};await s()},[r,i,n]),M=async(e,r={})=>{let{maxNameLength:i=50,fileExt:a=`.txt`,mimeType:o=`text/plain`}=r,c=e.split(/\r?\n/)[0]?.trim()||``;c||=`upload`;let l=`${c.slice(0,i).replace(/[/:*?"<>|]/g,`_`)}_${Math.random().toString(36).substring(2,8)}${a}`,u=new Blob([e],{type:o}),d=new File([u],l,{type:o}),p=new FormData;p.append(`file`,d);try{let e=(await te.post(f(!0)+`/api/v1/workspace/${n.id}/upload`,p,{headers:{"Content-Type":`multipart/form-data`,Authorization:localStorage.getItem(`auth`)}})).data.data,t=(await g({method:`POST`,url:`/api/v1/workspace/${n.id}/extract_queue/${e.id}`})).data;await je(t)}catch(e){console.error(`å符串ä¸ä¼ 失败`,e),s.error(t(`fastmode.failedToUpload`))}},N=localStorage.getItem(`locale`)===`en`;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:S[`input-container`],children:[(0,T.jsx)(ee,{placeholder:t(`fastmode.placeholder`),message:l,onChange:u,onSend:j,onUpload:async e=>{await M(e)}}),r.length>0?(0,T.jsx)(`div`,{className:S[`file-list`],children:r.map((e,t)=>(0,T.jsxs)(`div`,{className:S[`file-chip`]+` `+(e.status===`done`?S.uploaded:S.uploading),children:[(0,T.jsx)(`svg`,{fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:e.status===`done`?(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`}):(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:`2`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})}),(0,T.jsx)(`span`,{style:{cursor:`pointer`},onClick:()=>{e.status===`done`&&(w(e),D(e.data.content))},children:e.filename}),(0,T.jsx)(`span`,{className:S[`remove-btn`],onClick:e=>{e.stopPropagation(),i(r.filter((e,n)=>n!==t))},children:`Ã`}),(0,T.jsx)(`div`,{className:S[`progress-bar`],children:(0,T.jsx)(`div`,{className:S[`progress-fill`],style:e.status===`done`?{width:`100%`,opacity:0}:{width:e.progress+`%`,opacity:1}})})]},t))}):null,(0,T.jsxs)(`div`,{className:S.toolbar,children:[(0,T.jsxs)(`div`,{className:S[`toolbar-left`],children:[(0,T.jsx)(o,{title:t(`fastmode.tokenLimit`)+` ${Ae} / ${ge}`,children:(0,T.jsx)(`button`,{className:S[`attach-btn`],disabled:Ae>=ge,onClick:()=>{m(!0)},children:(0,T.jsx)(`svg`,{width:`20`,height:`20`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,strokeWidth:`2`,children:(0,T.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13`})})})}),r.length===0&&(0,T.jsx)(o,{title:t(`fastmode.enableWebSearch`),children:(0,T.jsx)(`button`,{className:S[`attach-btn`]+(x?` `+S.active:``),onClick:()=>{fe(!x)},children:(0,T.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,children:(0,T.jsx)(`path`,{d:`M10 18.9286C14.9311 18.9286 18.9286 14.9311 18.9286 10C18.9286 5.06888 14.9311 1.07143 10 1.07143C5.06888 1.07143 1.07143 5.06888 1.07143 10C1.07143 14.9311 5.06888 18.9286 10 18.9286ZM10 20C4.47714 20 0 15.5229 0 10C0 4.47714 4.47714 0 10 0C15.5229 0 20 4.47714 20 10C20 15.5229 15.5229 20 10 20ZM1.49018 5.80902L1.05496 5.49665L1.67969 4.62621L2.11491 4.93857C2.70723 5.36366 3.53674 5.70029 4.60129 5.94478C5.40355 3.44783 7.02692 1.58518 9.46429 0.384196V0.0892857H10.5357V0.471138C12.876 1.67368 14.4412 3.50551 15.2247 5.94118C16.2818 5.69699 17.1061 5.36158 17.6956 4.93857L18.1308 4.62621L18.7555 5.49665L18.3203 5.80902C17.6187 6.31254 16.6802 6.70038 15.5027 6.97634C15.7093 7.9204 15.8128 8.94357 15.8128 10.
400446C15.8128 10.9783 15.7384 11.8558 15.5898 12.6767C16.8103 12.9506 17.7811 13.3376 18.5047 13.8415L18.9443 14.1476L18.3321 15.0269L17.8924 14.7208C17.2864 14.2988 16.4389 13.9644 15.3523 13.7213C14.619 16.3707 13.0108 18.3463 10.5357 19.6181V19.9107H10.1225L10.0799 19.9999L9.91359 19.9205L9.74725 19.9999L9.70469 19.9107H9.46429V19.7051C6.89011 18.4367 5.22388 16.4303 4.47402 13.7181C3.38065 13.9615 2.52848 14.2969 1.91987 14.7208L1.48022 15.0269L0.867969 14.1476L1.30759 13.8415C2.03404 13.3357 3.0096 12.9476 4.23676 12.6735C4.08859 11.8536 4.0144 10.977 4.0144 10.0446C4.0144 8.94502 4.11759 7.92308 4.32364 6.98004C3.13868 6.70386 2.19496 6.31482 1.4902 5.80902H1.49018ZM10.5357 12.1761C12.0516 12.1975 13.3851 12.2973 14.5379 12.4781C14.6736 11.7238 14.7414 10.9129 14.7414 10.0446C14.7414 9.00964 14.6451 8.05612 14.4522 7.18275C13.3243 7.36612 12.0192 7.46763 10.5357 7.48973V12.1761ZM14.1644 6.14344C13.5115 4.20944 12.3035 2.73212 10.5357 1.69333V6.41813C11.9171 6.39685 13.1271 6.30451 14.1644 6.14344ZM5.37442 7.18538C5.18192 8.05804 5.08583 9.01067 5.08583 10.0446C5.08583 10.912 5.15346 11.7221 5.28888 12.4758C6.48576 12.2891 7.87701 12.1893 9.46429 12.1739V7.4921C7.90929 7.47616 6.54652 7.37482 5.37442 7.18538ZM9.46429 1.69966C7.63293 2.74268 6.40186 4.22397 5.75767 6.16281C6.87796 6.32288 8.09933 6.41454 9.46429 6.43552V1.69966Z`,fill:`currentColor`})})})}),(0,T.jsx)(`div`,{style:{width:1,height:20,background:`#E5E7EB`,margin:`0 4px`}}),(0,T.jsx)(Ee,{title:t(`fastmode.lang`),options:_e,value:b,onChange:re}),r.length===0?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Oe,{title:t(`fastmode.cardsRange`),value:y,onChange:ne,subscriptionLevel:h}),(0,T.jsx)(Ee,{title:t(`fastmode.content`),options:N?Se:ve,value:ie,onChange:ae})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(Ee,{title:t(`fastmode.layout`),options:N?Ce:ye,value:oe,onChange:se}),(0,T.jsx)(Ee,{title:t(`fastmode.content`),options:N?we:be,value:ce,onChange:le})]}),(0,T.jsx)(Ee,{title:t(`fastmode.size`),options:N?Te:xe,value:ue,onChange:de})]}),(0,T.jsx)(`div`,{className:S[`toolbar-right`],children:d?(0,T.jsx)(o,{title:t(`fastmode.regenerateOutline`),children:(0,T.jsx)(`button`,{className:S[`send-btn`],onClick:j,children:(0,T.jsx)(me,{size:20})})}):(0,T.jsx)(`button`,{className:S[`send-btn`],onClick:j,children:(0,T.jsx)(c,{size:20})})})]})]}),(0,T.jsx)(ni,{visible:p,onClose:()=>{m(!1)},workspace:n,setFileList:i,getExtractTask:je}),(0,T.jsx)(ti,{showMdModal:pe,setShowMdModal:w,mdContent:E,setMdContent:D,fileList:r,setFileList:i}),A?(0,T.jsx)(ri,{risks:A?.risks||[],initialContent:A?.content||``,onCancel:()=>{i(e=>e.filter(e=>e.id!==A.id)),ke(null)},onSuccess:async e=>{await M(e),i(e=>e.filter(e=>e.id!==A.id)),ke(null)}}):null]})}var ai=(e,t=90)=>{let[n,r]=(0,C.useState)(!0),i=(0,C.useCallback)(()=>{if(!e.current)return;let n=e.current.scrollTop<=t;r(e=>e===n?e:n)},[e,t]);return(0,C.useEffect)(()=>{let t=e.current;if(t)return i(),t.addEventListener(`scroll`,i,{passive:!0}),()=>{t.removeEventListener(`scroll`,i)}},[e,i]),n};export{_e as a,xe as c,we as d,Se as i,Te as l,ii as n,ye as o,ve as r,Ce as s,ai as t,be as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.