(window.webpackJsonp=window.webpackJsonp||[]).push([[154,6,7,17],{"+NIl":
/*!***************************************************!*\
!*** ./node_modules/codemirror/mode/stex/stex.js ***!
\***************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){!function(t){"use strict";t.defineMode("stex",(function(t,e){function i(t,e){t.cmdState.push(e)}function n(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function r(t,e,i){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=i,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var o={};function s(t,e){t.f=e}function a(t,e){var r;if(t.match(/^\\[a-zA-Z@]+/)){var a=t.current().slice(1);return i(e,r=new(r=o.hasOwnProperty(a)?o[a]:o.DEFAULT)),s(e,c),r.style}if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return s(e,(function(t,e){return l(t,e,"\\]")})),"keyword";if(t.match("\\("))return s(e,(function(t,e){return l(t,e,"\\)")})),"keyword";if(t.match("$$"))return s(e,(function(t,e){return l(t,e,"$$")})),"keyword";if(t.match("$"))return s(e,(function(t,e){return l(t,e,"$")})),"keyword";var h=t.next();return"%"==h?(t.skipToEnd(),"comment"):"}"==h||"]"==h?(r=n(e))?(r.closeBracket(h),s(e,c),"bracket"):"error":"{"==h||"["==h?(i(e,r=new(r=o.DEFAULT)),"bracket"):/\d/.test(h)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),"begin"==(r=function(t){for(var e=t.cmdState,i=e.length-1;i>=0;i--){var n=e[i];if("DEFAULT"!=n.name)return n}return{styleIdentifier:function(){return null}}}(e)).name&&(r.argument=t.current()),r.styleIdentifier())}function l(t,e,i){if(t.eatSpace())return null;if(i&&t.match(i))return s(e,a),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variable-2";if(t.match(/^\\[$&%#{}_]/))return"tag";if(t.match(/^\\[,;!\/]/))return"tag";if(t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var n=t.next();return"{"==n||"}"==n||"["==n||"]"==n||"("==n||")"==n?"bracket":"%"==n?(t.skipToEnd(),"comment"):"error"}function c(t,e){var i=t.peek();return"{"==i||"["==i?(n(e).openBracket(i),t.eat(i),s(e,a),"bracket"):/[ \t\r]/.test(i)?(t.eat(i),null):(s(e,a),function(t){var e=t.cmdState.pop();e&&e.closeBracket()}(e),a(t,e))}return o.importmodule=r("importmodule","tag",["string","builtin"]),o.documentclass=r("documentclass","tag",["","atom"]),o.usepackage=r("usepackage","tag",["atom"]),o.begin=r("begin","tag",["atom"]),o.end=r("end","tag",["atom"]),o.label=r("label","tag",["atom"]),o.ref=r("ref","tag",["atom"]),o.eqref=r("eqref","tag",["atom"]),o.cite=r("cite","tag",["atom"]),o.bibitem=r("bibitem","tag",["atom"]),o.Bibitem=r("Bibitem","tag",["atom"]),o.RBibitem=r("RBibitem","tag",["atom"]),o.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}},{startState:function(){return{cmdState:[],f:e.inMathMode?function(t,e){return l(t,e)}:a}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=a,t.cmdState.length=0},lineComment:"%"}})),t.defineMIME("text/x-stex","stex"),t.defineMIME("text/x-latex","stex")}(i(/*! ../../lib/codemirror */"VrN/"))},"19Vz":
/*!**************************************************************!*\
!*** ./node_modules/codemirror/addon/display/placeholder.js ***!
\**************************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){!function(t){function e(t){t.state.placeholder&&(t.state.placeholder.parentNode.removeChild(t.state.placeholder),t.state.placeholder=null)}function i(t){e(t);var i=t.state.placeholder=document.createElement("pre");i.style.cssText="height: 0; overflow: visible",i.style.direction=t.getOption("direction"),i.className="CodeMirror-placeholder CodeMirror-line-like";var n=t.getOption("placeholder");"string"==typeof n&&(n=document.createTextNode(n)),i.appendChild(n),t.display.lineSpace.insertBefore(i,t.display.lineSpace.firstChild)}function n(t){o(t)&&i(t)}function r(t){var n=t.getWrapperElement(),r=o(t);n.className=n.className.replace(" CodeMirror-empty","")+(r?" CodeMirror-empty":""),r?i(t):e(t)}function o(t){return 1===t.lineCount()&&""===t.getLine(0)}t.defineOption("placeholder","",(function(o,s,a){var l=a&&a!=t.Init;if(s&&!l)o.on("blur",n),o.on("change",r),o.on("swapDoc",r),t.on(o.getInputField(),"compositionupdate",o.state.placeholderCompose=function(){!function(t){setTimeout((function(){var n=!1,r=t.getInputField();"TEXTAREA"==r.nodeName?n=!r.value:1==t.lineCount()&&(n=!/[^\u200b]/.test(r.querySelector(".CodeMirror-line").textContent)),n?i(t):e(t)}),20)}(o)}),r(o);else if(!s&&l){o.off("blur",n),o.off("change",r),o.off("swapDoc",r),t.off(o.getInputField(),"compositionupdate",o.state.placeholderCompose),e(o);var c=o.getWrapperElement();c.className=c.className.replace(" CodeMirror-empty","")}s&&!o.hasFocus()&&n(o)}))}(i(/*! ../../lib/codemirror */"VrN/"))},"1eCo":
/*!*************************************************!*\
!*** ./node_modules/codemirror/mode/xml/xml.js ***!
\*************************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){!function(t){"use strict";var e={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};t.defineMode("xml",(function(n,r){var o,s,a=n.indentUnit,l={},c=r.htmlMode?e:i;for(var h in c)l[h]=c[h];for(var h in r)l[h]=r[h];function u(t,e){function i(i){return e.tokenize=i,i(t,e)}var n=t.next();return"<"==n?t.eat("!")?t.eat("[")?t.match("CDATA[")?i(d("atom","]]>")):null:t.match("--")?i(d("comment","--\x3e")):t.match("DOCTYPE",!0,!0)?(t.eatWhile(/[\w\._\-]/),i(function t(e){return function(i,n){for(var r;null!=(r=i.next());){if("<"==r)return n.tokenize=t(e+1),n.tokenize(i,n);if(">"==r){if(1==e){n.tokenize=u;break}return n.tokenize=t(e-1),n.tokenize(i,n)}}return"meta"}}(1))):null:t.eat("?")?(t.eatWhile(/[\w\._\-]/),e.tokenize=d("meta","?>"),"meta"):(o=t.eat("/")?"closeTag":"openTag",e.tokenize=p,"tag bracket"):"&"==n?(t.eat("#")?t.eat("x")?t.eatWhile(/[a-fA-F\d]/)&&t.eat(";"):t.eatWhile(/[\d]/)&&t.eat(";"):t.eatWhile(/[\w\.\-:]/)&&t.eat(";"))?"atom":"error":(t.eatWhile(/[^&<]/),null)}function p(t,e){var i,n,r=t.next();if(">"==r||"/"==r&&t.eat(">"))return e.tokenize=u,o=">"==r?"endTag":"selfcloseTag","tag bracket";if("="==r)return o="equals",null;if("<"==r){e.tokenize=u,e.state=v,e.tagName=e.tagStart=null;var s=e.tokenize(t,e);return s?s+" tag error":"tag error"}return/[\'\"]/.test(r)?(e.tokenize=(i=r,(n=function(t,e){for(;!t.eol();)if(t.next()==i){e.tokenize=p;break}return"string"}).isInAttribute=!0,n),e.stringStartCol=t.column(),e.tokenize(t,e)):(t.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function d(t,e){return function(i,n){for(;!i.eol();){if(i.match(e)){n.tokenize=u;break}i.next()}return t}}function f(t,e,i){this.prev=t.context,this.tagName=e,this.indent=t.indented,this.startOfLine=i,(l.doNotIndent.hasOwnProperty(e)||t.context&&t.context.noIndent)&&(this.noIndent=!0)}function g(t){t.context&&(t.context=t.context.prev)}function m(t,e){for(var i;;){if(!t.context)return;if(i=t.context.tagName,!l.contextGrabbers.hasOwnProperty(i)||!l.contextGrabbers[i].hasOwnProperty(e))return;g(t)}}function v(t,e,i){return"openTag"==t?(i.tagStart=e.column(),y):"closeTag"==t?b:v}function y(t,e,i){return"word"==t?(i.tagName=e.current(),s="tag",w):l.allowMissingTagName&&"endTag"==t?(s="tag bracket",w(t,0,i)):(s="error",y)}function b(t,e,i){if("word"==t){var n=e.current();return i.context&&i.context.tagName!=n&&l.implicitlyClosed.hasOwnProperty(i.context.tagName)&&g(i),i.context&&i.context.tagName==n||!1===l.matchClosing?(s="tag",x):(s="tag error",C)}return l.allowMissingTagName&&"endTag"==t?(s="tag bracket",x(t,0,i)):(s="error",C)}function x(t,e,i){return"endTag"!=t?(s="error",x):(g(i),v)}function C(t,e,i){return s="error",x(t,0,i)}function w(t,e,i){if("word"==t)return s="attribute",k;if("endTag"==t||"selfcloseTag"==t){var n=i.tagName,r=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==t||l.autoSelfClosers.hasOwnProperty(n)?m(i,n):(m(i,n),i.context=new f(i,n,r==i.indented)),v}return s="error",w}function k(t,e,i){return"equals"==t?S:(l.allowMissing||(s="error"),w(t,0,i))}function S(t,e,i){return"string"==t?E:"word"==t&&l.allowUnquoted?(s="string",w):(s="error",w(t,0,i))}function E(t,e,i){return"string"==t?E:w(t,0,i)}return u.isInText=!0,{startState:function(t){var e={tokenize:u,state:v,indented:t||0,tagName:null,tagStart:null,context:null};return null!=t&&(e.baseIndent=t),e},token:function(t,e){if(!e.tagName&&t.sol()&&(e.indented=t.indentation()),t.eatSpace())return null;o=null;var i=e.tokenize(t,e);return(i||o)&&"comment"!=i&&(s=null,e.state=e.state(o||i,t,e),s&&(i="error"==s?i+" error":s)),i},indent:function(e,i,n){var r=e.context;if(e.tokenize.isInAttribute)return e.tagStart==e.indented?e.stringStartCol+1:e.indented+a;if(r&&r.noIndent)return t.Pass;if(e.tokenize!=p&&e.tokenize!=u)return n?n.match(/^(\s*)/)[0].length:0;if(e.tagName)return!1!==l.multilineTagIndentPastTag?e.tagStart+e.tagName.length+2:e.tagStart+a*(l.multilineTagIndentFactor||1);if(l.alignCDATA&&/$/,blockCommentStart:"\x3c!--",blockCommentEnd:"--\x3e",configuration:l.htmlMode?"html":"xml",helperType:l.htmlMode?"html":"xml",skipAttribute:function(t){t.state==S&&(t.state=w)},xmlCurrentTag:function(t){return t.tagName?{name:t.tagName,close:"closeTag"==t.type}:null},xmlCurrentContext:function(t){for(var e=[],i=t.context;i;i=i.prev)i.tagName&&e.push(i.tagName);return e.reverse()}}})),t.defineMIME("text/xml","xml"),t.defineMIME("application/xml","xml"),t.mimeModes.hasOwnProperty("text/html")||t.defineMIME("text/html",{name:"xml",htmlMode:!0})}(i(/*! ../../lib/codemirror */"VrN/"))},"7Cbv":
/*!**************************************************************!*\
!*** ./node_modules/uuid/dist/esm-browser/v4.js + 4 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,i){"use strict";var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),r=new Uint8Array(16);function o(){if(!n)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)}var s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var a=function(t){return"string"==typeof t&&s.test(t)},l=[],c=0;c<256;++c)l.push((c+256).toString(16).substr(1));var h=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(l[t[e+0]]+l[t[e+1]]+l[t[e+2]]+l[t[e+3]]+"-"+l[t[e+4]]+l[t[e+5]]+"-"+l[t[e+6]]+l[t[e+7]]+"-"+l[t[e+8]]+l[t[e+9]]+"-"+l[t[e+10]]+l[t[e+11]]+l[t[e+12]]+l[t[e+13]]+l[t[e+14]]+l[t[e+15]]).toLowerCase();if(!a(i))throw TypeError("Stringified UUID is invalid");return i};e.a=function(t,e,i){var n=(t=t||{}).random||(t.rng||o)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var r=0;r<16;++r)e[i+r]=n[r];return e}return h(n)}},"7ahc":
/*!*************************************************************!*\
!*** ./src/components/markdown-editor/code-block/index.tsx ***!
\*************************************************************/
/*! exports provided: default, MyCodeMirror */
/*! exports used: MyCodeMirror, default */function(t,e,i){"use strict";i.d(e,"a",(function(){return m}));var n=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2 */"k1fw"),r=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends */"0Owb"),o=(i(/*! antd/es/button/style */"+L6B"),i(/*! antd/es/button */"2/Rp")),s=(i(/*! antd/es/form/style */"y8nQ"),i(/*! antd/es/form */"Vl3Y")),a=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray */"tJVT"),l=(i(/*! antd/es/select/style */"OaEy"),i(/*! antd/es/select */"2fM7")),c=i(/*! react */"q1tI"),h=i.n(c),u=i(/*! codemirror */"VrN/"),p=i.n(u),d=(i(/*! codemirror/lib/codemirror.css */"p77/"),i(/*! codemirror/theme/blackboard.css */"c5Ni"),l.a.Option),f={labelCol:{span:4},wrapperCol:{span:20}},g={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};function m(t){var e=t.value,i=t.onChange,r=t.mode,o=t.options,s=void 0===o?{}:o,l=Object(c.useRef)(),u=Object(c.useState)(),d=Object(a.a)(u,2),f=d[0],g=d[1];return Object(c.useEffect)((function(){if(f){function t(t){var e=t.getValue();i&&i(e)}return f.on("change",t),function(){f.off("change",t)}}}),[f,i]),Object(c.useEffect)((function(){f&&f.setOption("mode",r)}),[f,r]),Object(c.useEffect)((function(){f&&(e===f.getValue()&&""!==e||setTimeout((function(){f.setValue(e||" ")}),300))}),[f,e]),Object(c.useEffect)((function(){if(l.current&&!f){var t=p.a.fromTextArea(l.current,Object(n.a)({mode:r,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},s));g(t)}}),[l.current,f]),h.a.createElement("div",{className:"my-codemirror-container"},h.a.createElement("textarea",{ref:l}))}e.b=function(t){var e=t.callback,i=t.onCancel,n=Object(c.useState)("python"),u=Object(a.a)(n,2),p=u[0],v=u[1];return h.a.createElement(s.a,Object(r.a)({},f,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:function(t){e(t)}}),h.a.createElement(s.a.Item,{label:"代码语言",name:"language"},h.a.createElement(l.a,{onChange:function(t){v(g[t][1])}},Object.keys(g).map((function(t){return h.a.createElement(d,{key:t,value:t},g[t][0])})))),h.a.createElement(s.a.Item,{label:"代码内容",name:"content",rules:[{required:!0,message:"请输入代码内容"}]},h.a.createElement(m,{mode:p})),h.a.createElement("div",{className:"flex-container flex-end"},h.a.createElement(o.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),h.a.createElement(o.a,{type:"ghost",onClick:i},"取消")))}},"7ixt":
/*!**************************************************!*\
!*** ./node_modules/rc-tooltip/es/placements.js ***!
\**************************************************/
/*! exports provided: placements, default */
/*! exports used: placements */function(t,e,i){"use strict";i.d(e,"a",(function(){return o}));var n={adjustX:1,adjustY:1},r=[0,0],o={left:{points:["cr","cl"],overflow:n,offset:[-4,0],targetOffset:r},right:{points:["cl","cr"],overflow:n,offset:[4,0],targetOffset:r},top:{points:["bc","tc"],overflow:n,offset:[0,-4],targetOffset:r},bottom:{points:["tc","bc"],overflow:n,offset:[0,4],targetOffset:r},topLeft:{points:["bl","tl"],overflow:n,offset:[0,-4],targetOffset:r},leftTop:{points:["tr","tl"],overflow:n,offset:[-4,0],targetOffset:r},topRight:{points:["br","tr"],overflow:n,offset:[0,-4],targetOffset:r},rightTop:{points:["tl","tr"],overflow:n,offset:[4,0],targetOffset:r},bottomRight:{points:["tr","br"],overflow:n,offset:[0,4],targetOffset:r},rightBottom:{points:["bl","br"],overflow:n,offset:[4,0],targetOffset:r},bottomLeft:{points:["tl","bl"],overflow:n,offset:[0,4],targetOffset:r},leftBottom:{points:["br","bl"],overflow:n,offset:[-4,0],targetOffset:r}}},"8EBN":
/*!**********************************************!*\
!*** ./node_modules/codemirror/mode/meta.js ***!
\**********************************************/
/*! no static exports found */
/*! all exports used */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){!function(t){"use strict";t.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var e=0;e-1&&e.substring(r+1,e.length);if(o)return t.findModeByExtension(o)},t.findModeByName=function(e){e=e.toLowerCase();for(var i=0;i"],v=new d.a.Renderer,y=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function b(){g.length=0,m=[""]}var x={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function C(){return function t(e,i,n,r){if(i>=e.length||e[i].level<=n)return i;var o=e[i];r.push("- "+o.text+"");var s=[];return i=t(e,++i,o.level,s),s.length>0&&(r.push("
"),s.forEach((function(t){r.push(t)})),r.push("
")),r.push(" "),i=t(e,i,n,r)}(g,0,0,m),m.push("
"),m.join("")}var w={heading:function(t){var e=y.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},fences:function(t){var e=this.rules.block.fences.exec(t);if(e){var i=e[0],n=function(t,e){var i=t.match(/^(\s+)(?:```)/);if(null===i)return e;var n=i[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:Object(a.a)(e,1)[0].length>=n.length?t.slice(n.length):t})).join("\n")}(i,e[3]||""),r=e[2]?e[2].trim():e[2];if(["latex","katex","math"].indexOf(r)>=0){var o=E(),s=n;n=o,L[o]={type:"block",expression:s}}return{type:"code",raw:i,lang:r,text:n}}}},k=/(?:\${2})([^\n`]+?)(?:\${2})/gi,S=0,E=function(){return"__special_katext_id_".concat(S++,"__")},L={};function T(){S=0,L={}}function A(t){return t=t.replace(k,(function(t,e){var i=E();return L[i]={type:"inline",expression:e},i}))}var M=v.listitem;v.listitem=function(t){return M(A(t))};var O=v.paragraph;v.paragraph=function(t){return O(A(t))};var N=v.tablecell;v.tablecell=function(t,e){return N(A(t),e)},v.code=function(t,e,i){var n=(e||"").match(/\S*/)[0];return n?["latex","katex","math"].indexOf(n)>=0?"".concat(t,"
"):'').concat(i?t:Object(f.escape)(t,!0),"
\n"):''+(i?t:Object(f.escape)(t,!0))+"
"},v.heading=function(t,e,i){var n=this.options.headerPrefix+i.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return g.push({anchor:n,level:e,text:t}),"'+t+""},d.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),d.a.use({tokenizer:w,renderer:v});var P=d.a,D=(i("SJMd"),i("ulZh")),R=i.n(D),_=i("m3rI"),B=i("Oy/b"),I=i("p5ED"),j=i("ErOA"),z=function(t,e){return(z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function F(t,e){function i(){this.constructor=t}z(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function H(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))}function W(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]',"select"),this.addActionButton(i,'',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(i,'',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(i,'',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(i,'',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(i,'',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(i,'',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(i,'',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach((function(t){var i=document.createElement("div");i.className=""+e.toolbarButtonStyleClass.name,i.setAttribute("data-type-name",t.typeName),i.innerHTML=t.icon,i.addEventListener("click",(function(){e.markerToolbarButtonClicked(i,t)})),e.buttons.push(i),e.markerButtons.push(i)})),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var n=document.createElement("div");n.className=this.toolbarBlockStyleClass.name,n.style.whiteSpace="nowrap",n.style.display=!1!==this.uiStyleSettings.resultButtonBlockVisible?"":"none",this.uiContainer.appendChild(n),this.addActionButton(n,'',"render"),this.addActionButton(n,'',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},t.prototype.addButtonClickListener=function(t){this.buttonClickListeners.push(t)},t.prototype.removeButtonClickListener=function(t){this.buttonClickListeners.indexOf(t)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(t),1)},t.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},t.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var t=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var e=0;e0&&this.buttonClickListeners.forEach((function(t){return t("marker",e)})),this.markerButtonOverflowBlock.style.display="none"},t.prototype.actionToolbarButtonClicked=function(t,e){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach((function(t){return t("action",e)})),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},t.prototype.setActiveButton=function(t){this.resetButtonStyles(),t.className=t.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),t.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},t.prototype.setActiveMarkerButton=function(t){var e=this.markerButtons.find((function(e){return e.getAttribute("data-type-name")===t}));e&&this.setActiveButton(e)},t.prototype.setCurrentMarker=function(t){var e=this;this.currentMarker=t,this.buttons.filter((function(t){return/delete|notes/.test(t.getAttribute("data-action"))})).forEach((function(t){void 0===e.currentMarker?(t.style.fillOpacity="0.4",t.style.pointerEvents="none"):(t.style.fillOpacity="1",t.style.pointerEvents="all")}))},t}(),J=function(){function t(t,e,i,n){this.panels=[],this.panelButtons=[],this.markerjsContainer=t,this.displayMode=e,this.uiStyleSettings=i,this.styles=n,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return t.prototype.addStyles=function(){var t;this.toolboxStyleClass=this.styles.addClass(new Y("toolbox","\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n "+("popup"===this.displayMode?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+"\n box-sizing: content-box;\n "+("popup"===this.displayMode?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+"\n "+("inline"===this.displayMode?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n "+("inline"===this.displayMode?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+"\n overflow: hidden;\n ")),this.toolboxStyleColorsClass=this.styles.addClass(new Y("toolbox_colors","\n color: "+this.uiStyleSettings.toolboxColor+";\n "));var e=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Y("toolbox-button-row","\n display: flex;\n cursor: default;\n box-sizing: content-box;\n ")),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Y("toolbox-button-row_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundColor+";\n ")),this.toolboxPanelRowStyleClass=this.styles.addClass(new Y("toolbox-panel-row","\n display: flex;\n "+("inline"===this.displayMode?"position: absolute;":"")+"\n "+("inline"===this.displayMode?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+"\n cursor: default;\n height: "+1.5*this.uiStyleSettings.toolbarHeight+"px;\n "+("inline"===this.displayMode?"width: 100%;":"")+"\n box-sizing: content-box;\n ")),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Y("toolbox-panel-row_colors","\n background-color: "+(null!==(t=this.uiStyleSettings.toolboxBackgroundColor)&&void 0!==t?t:this.uiStyleSettings.toolbarBackgroundHoverColor)+";\n ")),this.toolboxButtonStyleClass=this.styles.addClass(new Y("toolbox_button","\n display: inline-block;\n width: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n height: "+(this.uiStyleSettings.toolbarHeight-2*e)+"px;\n padding: "+e+"px;\n box-sizing: content-box;\n ")),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-button_colors","\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Y("toolbox-active-button_colors","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+";\n fill: "+this.uiStyleSettings.toolbarColor+";\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleColorsClass.name+":hover","\n background-color: "+this.uiStyleSettings.toolbarBackgroundHoverColor+"\n ")),this.styles.addRule(new X("."+this.toolboxButtonStyleClass.name+" svg","\n height: "+this.uiStyleSettings.toolbarHeight/2+"px;\n "))},t.prototype.show=function(t){var e;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=t,this.uiContainer.className=this.toolboxStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxStyleColorsClassName)&&void 0!==e?e:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},t.prototype.setPanelButtons=function(t){var e,i,n=this;this.panels=t,void 0!==this.uiContainer&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+(null!==(e=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)&&void 0!==e?e:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+(null!==(i=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)&&void 0!==i?i:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach((function(t){var e;t.uiStyleSettings=n.uiStyleSettings;var i=document.createElement("div");i.className=n.toolboxButtonStyleClass.name+" "+(null!==(e=n.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==e?e:n.toolboxButtonStyleColorsClass.name),i.innerHTML=t.icon,i.title=t.title,i.addEventListener("click",(function(){n.panelButtonClick(t)})),n.panelButtons.push(i),n.buttonRow.appendChild(i)})),"inline"===this.displayMode?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},t.prototype.panelButtonClick=function(t){var e=this,i=-1;if(t!==this.activePanel){i=this.panels.indexOf(t),this.panelRow.innerHTML="";var n=t.getUi();n.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(n),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=t}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout((function(){"inline"===e.displayMode?e.panelRow.style.display="none":e.panelRow.style.visibility="hidden"}),200);this.panelButtons.forEach((function(t,n){var r,o;t.className=e.toolboxButtonStyleClass.name+" "+(n===i?""+(null!==(r=e.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)&&void 0!==r?r:e.toolboxActiveButtonStyleColorsClass.name):""+(null!==(o=e.uiStyleSettings.toolboxButtonStyleColorsClassName)&&void 0!==o?o:e.toolboxButtonStyleColorsClass.name))}))},t}(),Q=function(t,e){this.title=t,this.icon=e},tt=function(t){function e(e,i,n,r){var o=t.call(this,e,r||'')||this;return o.colors=[],o.addTransparent=!1,o.colorBoxes=[],o.colors=i,o.currentColor=n,o.setCurrentColor=o.setCurrentColor.bind(o),o.getColorBox=o.getColorBox.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.whiteSpace="nowrap",this.colors.forEach((function(i){var n=t.getColorBox(i);e.appendChild(n),t.colorBoxes.push(n)})),e},e.prototype.getColorBox=function(t){var e=this,i=this.uiStyleSettings.toolbarHeight/4,n=this.uiStyleSettings.toolbarHeight-i,r=document.createElement("div");r.style.display="inline-block",r.style.boxSizing="content-box",r.style.width=n-2+"px",r.style.height=n-2+"px",r.style.padding="1px",r.style.marginRight="2px",r.style.marginBottom="2px",r.style.borderWidth="2px",r.style.borderStyle="solid",r.style.borderRadius=(n+2)/2+"px",r.style.borderColor=t===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",r.addEventListener("click",(function(){e.setCurrentColor(t,r)}));var o=document.createElement("div");return o.style.display="inline-block",o.style.width=n-2+"px",o.style.height=n-2+"px",o.style.backgroundColor=t,o.style.borderRadius=n/2+"px","transparent"===t&&(o.style.fill=this.uiStyleSettings.toolboxAccentColor,o.innerHTML=''),r.appendChild(o),r},e.prototype.setCurrentColor=function(t,e){var i=this;this.currentColor=t,this.colorBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onColorChanged&&this.onColorChanged(t)},e}(Q),et=function(){function t(t,e,i){this._state="new",this._isSelected=!1,this._container=t,this._overlayContainer=e,this.globalSettings=i,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(t.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),t.prototype.ownsTarget=function(t){return!1},Object.defineProperty(t.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),t.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},t.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},t.prototype.pointerDown=function(t,e){},t.prototype.dblClick=function(t,e){},t.prototype.manipulate=function(t){},t.prototype.pointerUp=function(t){this.stateChanged()},t.prototype.dispose=function(){},t.prototype.addMarkerVisualToContainer=function(t){this.container.childNodes.length>0?this.container.insertBefore(t,this.container.childNodes[0]):this.container.appendChild(t)},t.prototype.getState=function(){return{typeName:t.typeName,state:this.state,notes:this.notes}},t.prototype.restoreState=function(t){this._state=t.state,this.notes=t.notes},t.prototype.scale=function(t,e){},t.prototype.colorChanged=function(t){this.onColorChanged&&this.onColorChanged(t),this.stateChanged()},t.prototype.fillColorChanged=function(t){this.onFillColorChanged&&this.onFillColorChanged(t),this.stateChanged()},t.prototype.stateChanged=function(){if(this.onStateChanged&&"creating"!==this.state&&"new"!==this.state){var t=this.getState();void 0!==this.manipulationStartState&&(this.manipulationStartState.state="select"),t.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(t)&&this.onStateChanged(this)}},t.typeName="MarkerBase",t}(),it=function(){function t(){this.findGripByVisual=this.findGripByVisual.bind(this)}return t.prototype.findGripByVisual=function(t){return this.topLeft.ownsTarget(t)?this.topLeft:this.topCenter.ownsTarget(t)?this.topCenter:this.topRight.ownsTarget(t)?this.topRight:this.centerLeft.ownsTarget(t)?this.centerLeft:this.centerRight.ownsTarget(t)?this.centerRight:this.bottomLeft.ownsTarget(t)?this.bottomLeft:this.bottomCenter.ownsTarget(t)?this.bottomCenter:this.bottomRight.ownsTarget(t)?this.bottomRight:void 0},t}(),nt=function(){function t(){this.GRIP_SIZE=10,this.visual=G.createGroup(),this.visual.appendChild(G.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(G.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t}(),rt=function(){function t(){}return t.toITransformMatrix=function(t){return{a:t.a,b:t.b,c:t.c,d:t.d,e:t.e,f:t.f}},t.toSVGMatrix=function(t,e){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f,t},t}(),ot=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.left=0,r.top=0,r.width=0,r.height=0,r.defaultSize={x:50,y:20},r.offsetX=0,r.offsetY=0,r.rotationAngle=0,r.CB_DISTANCE=10,r._suppressMarkerCreateEvent=!1,r.container.transform.baseVal.appendItem(G.createTransform()),r.setupControlBox(),r}return F(e,t),Object.defineProperty(e.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"visual",{get:function(){return this._visual},set:function(t){this._visual=t;var e=G.createTransform();this._visual.transform.baseVal.appendItem(e)},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!!(void 0!==this.controlGrips.findGripByVisual(e)||void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(e))},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.left=e.x,this.top=e.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var n=this.unrotatePoint(e);if(this.manipulationStartX=n.x,this.manipulationStartY=n.y,this.offsetX=n.x-this.left,this.offsetY=n.y-this.top,"new"!==this.state)if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(i),void 0!==this.activeGrip)this._state="resize";else if(void 0!==this.rotatorGrip&&this.rotatorGrip.ownsTarget(i)){this.activeGrip=this.rotatorGrip;var r=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=r.x-this.width/2,this.top=r.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var o=this.container.transform.baseVal.getItem(0);o.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(o,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},e.prototype.pointerUp=function(e){var i=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(e),this._state="select","creating"===i&&this.onMarkerCreated&&!1===this._suppressMarkerCreateEvent&&this.onMarkerCreated(this)},e.prototype.moveVisual=function(t){this.visual.style.transform="translate("+t.x+"px, "+t.y+"px)"},e.prototype.manipulate=function(t){var e=this.unrotatePoint(t);"creating"===this.state?this.resize(t):"move"===this.state?(this.left=this.manipulationStartLeft+(e.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(e.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):"resize"===this.state?this.resize(e):"rotate"===this.state&&this.rotate(t)},e.prototype.resize=function(t){var e=this.manipulationStartLeft,i=this.manipulationStartWidth,n=this.manipulationStartTop,r=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:e=this.manipulationStartLeft+t.x-this.manipulationStartX,i=this.manipulationStartWidth+this.manipulationStartLeft-e;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:i=this.manipulationStartWidth+t.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:n=this.manipulationStartTop+t.y-this.manipulationStartY,r=this.manipulationStartHeight+this.manipulationStartTop-n;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:r=this.manipulationStartHeight+t.y-this.manipulationStartY}i>=0?(this.left=e,this.width=i):(this.left=e+i,this.width=-i),r>=0?(this.top=n,this.height=r):(this.top=n+r,this.height=-r),this.setSize()},e.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},e.prototype.rotate=function(t){if(Math.abs(t.x-this.centerX)>.1){var e=Math.sign(t.x-this.centerX);this.rotationAngle=180*Math.atan((t.y-this.centerY)/(t.x-this.centerX))/Math.PI+90*e,this.applyRotation()}},e.prototype.applyRotation=function(){var t=this.container.transform.baseVal.getItem(0);t.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(t,0)},e.prototype.rotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM(),i=G.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.y}},e.prototype.unrotatePoint=function(t){if(0===this.rotationAngle)return t;var e=this.container.getCTM();e=e.inverse();var i=G.createPoint(t.x,t.y);return{x:(i=i.matrixTransform(e)).x,y:i.y}},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=G.createGroup();var t=G.createTransform();t.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(t),this.container.appendChild(this.controlBox),this.controlRect=G.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),!0!==this.globalSettings.disableRotation&&(this.rotatorGripLine=G.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new it,this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){var t=this.controlBox.transform.baseVal.getItem(0);t.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(t,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),void 0!==this.rotatorGripLine&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},e.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),!0!==this.globalSettings.disableRotation&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},e.prototype.createGrip=function(){var t=new nt;return t.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.controlGrips.topLeft.GRIP_SIZE,e=-t/2,i=e,n=(this.width+this.CB_DISTANCE)/2-t/2,r=(this.height+this.CB_DISTANCE)/2-t/2,o=this.height+this.CB_DISTANCE-t/2,s=this.width+this.CB_DISTANCE-t/2;this.positionGrip(this.controlGrips.topLeft.visual,e,i),this.positionGrip(this.controlGrips.topCenter.visual,n,i),this.positionGrip(this.controlGrips.topRight.visual,s,i),this.positionGrip(this.controlGrips.centerLeft.visual,e,r),this.positionGrip(this.controlGrips.centerRight.visual,s,r),this.positionGrip(this.controlGrips.bottomLeft.visual,e,o),this.positionGrip(this.controlGrips.bottomCenter.visual,n,o),this.positionGrip(this.controlGrips.bottomRight.visual,s,o),void 0!==this.rotatorGrip&&this.positionGrip(this.rotatorGrip.visual,n,i-3*this.CB_DISTANCE)},e.prototype.positionGrip=function(t,e,i){var n=t.transform.baseVal.getItem(0);n.setTranslate(e,i),t.transform.baseVal.replaceItem(n,0)},e.prototype.hideControlBox=function(){this.controlBox.style.display="none"},e.prototype.showControlBox=function(){this.controlBox.style.display=""},e.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:rt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:rt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.left=i.left,this.top=i.top,this.width=i.width,this.height=i.height,this.rotationAngle=i.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,i.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(rt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,i.containerTransformMatrix))},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i);var n=this.rotatePoint({x:this.left,y:this.top}),r=this.unrotatePoint({x:n.x*e,y:n.y*i});this.left=r.x,this.top=r.y,this.width=this.width*e,this.height=this.height*i,this.adjustControlBox()},e}(et),st=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.createVisual=r.createVisual.bind(r),r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=G.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){var i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.title="Rectangle marker",e}(ot),at=function(t){function e(e,i,n,r){var o=t.call(this,e,r||'')||this;return o.widths=[],o.widthBoxes=[],o.widths=i,o.currentWidth=n,o.setCurrentWidth=o.setCurrentWidth.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.widths.forEach((function(i){var n=document.createElement("div");n.style.display="flex",n.style.flexGrow="2",n.style.alignItems="center",n.style.justifyContent="space-between",n.style.padding="5px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.borderColor=i===t.currentWidth?t.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){t.setCurrentWidth(i,n)})),e.appendChild(n);var r=document.createElement("div");r.innerText=i.toString(),r.style.marginRight="5px",n.appendChild(r);var o=document.createElement("div");o.style.minHeight="20px",o.style.flexGrow="2",o.style.display="flex",o.style.alignItems="center";var s=document.createElement("hr");s.style.minWidth="20px",s.style.border="0px",s.style.borderTop=i+"px solid "+t.uiStyleSettings.toolboxColor,s.style.flexGrow="2",o.appendChild(s),n.appendChild(o),t.widthBoxes.push(n)})),e},e.prototype.setCurrentWidth=function(t,e){var i=this;this.currentWidth=t,this.widthBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},e}(Q),lt=function(t){function e(e,i,n,r){var o=t.call(this,e,r||'')||this;return o.styles=[],o.styleBoxes=[],o.styles=i,o.currentStyle=n,o.setCurrentStyle=o.setCurrentStyle.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",this.styles.forEach((function(i){var n=document.createElement("div");n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="space-between",n.style.padding="5px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.overflow="hidden",n.style.maxWidth=100/t.styles.length-5+"%",n.style.borderColor=i===t.currentStyle?t.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){t.setCurrentStyle(i,n)})),e.appendChild(n);var r=document.createElement("div");r.style.minHeight="20px",r.style.flexGrow="2",r.style.overflow="hidden";var o='";r.innerHTML=o,n.appendChild(r),t.styleBoxes.push(n)})),e},e.prototype.setCurrentStyle=function(t,e){var i=this;this.currentStyle=t,this.styleBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},e}(Q),ct=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.strokeColor=n.defaultColor,r.strokeWidth=n.defaultStrokeWidth,r.strokeDasharray=n.defaultStrokeDasharray,r.strokePanel=new tt("Line color",n.defaultColorSet,n.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",n.defaultStrokeWidths,n.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",n.defaultStrokeDasharrays,n.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="FrameMarker",e.title="Frame marker",e.icon='',e}(st),ht=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},ut=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.x1=0,r.y1=0,r.x2=0,r.y2=0,r.defaultLength=50,r.manipulationStartX=0,r.manipulationStartY=0,r.manipulationStartX1=0,r.manipulationStartY1=0,r.manipulationStartX2=0,r.manipulationStartY2=0,r.setupControlBox(),r}return F(e,t),e.prototype.ownsTarget=function(e){return!!t.prototype.ownsTarget.call(this,e)||!(!this.grip1.ownsTarget(e)&&!this.grip2.ownsTarget(e))},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.manipulationStartX=e.x,this.manipulationStartY=e.y,"new"===this.state&&(this.x1=e.x,this.y1=e.y,this.x2=e.x,this.y2=e.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,"new"!==this.state&&(this.select(),this.grip1.ownsTarget(i)?this.activeGrip=this.grip1:this.grip2.ownsTarget(i)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},e.prototype.pointerUp=function(e){var i=this.state;t.prototype.pointerUp.call(this,e),"creating"===this.state&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(e),this._state="select","creating"===i&&this.onMarkerCreated&&this.onMarkerCreated(this)},e.prototype.adjustVisual=function(){},e.prototype.manipulate=function(t){"creating"===this.state?this.resize(t):"move"===this.state?(this.x1=this.manipulationStartX1+t.x-this.manipulationStartX,this.y1=this.manipulationStartY1+t.y-this.manipulationStartY,this.x2=this.manipulationStartX2+t.x-this.manipulationStartX,this.y2=this.manipulationStartY2+t.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):"resize"===this.state&&this.resize(t)},e.prototype.resize=function(t){switch(this.activeGrip){case this.grip1:this.x1=t.x,this.y1=t.y;break;case this.grip2:case void 0:this.x2=t.x,this.y2=t.y}this.adjustVisual(),this.adjustControlBox()},e.prototype.select=function(){t.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setupControlBox=function(){this.controlBox=G.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},e.prototype.adjustControlBox=function(){this.positionGrips()},e.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},e.prototype.createGrip=function(){var t=new nt;return t.visual.transform.baseVal.appendItem(G.createTransform()),this.controlBox.appendChild(t.visual),t},e.prototype.positionGrips=function(){var t=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-t/2,this.y1-t/2),this.positionGrip(this.grip2.visual,this.x2-t/2,this.y2-t/2)},e.prototype.positionGrip=function(t,e,i){var n=t.transform.baseVal.getItem(0);n.setTranslate(e,i),t.transform.baseVal.replaceItem(n,0)},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.x1=i.x1,this.y1=i.y1,this.x2=i.x2,this.y2=i.y2},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.x1=this.x1*e,this.y1=this.y1*i,this.x2=this.x2*e,this.y2=this.y2*i,this.adjustVisual(),this.adjustControlBox()},e}(et),pt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.strokeColor=n.defaultColor,r.strokeWidth=n.defaultStrokeWidth,r.strokeDasharray=n.defaultStrokeDasharray,r.strokePanel=new tt("Line color",n.defaultColorSet,n.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",n.defaultStrokeWidths,n.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",n.defaultStrokeDasharrays,n.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorLine&&e!==this.visibleLine)},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=G.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.adjustVisual(),this._state="creating")},e.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),G.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.createVisual(),this.adjustVisual()},e.typeName="LineMarker",e.title="Line marker",e.icon='',e}(ut),dt=function(t){function e(e,i,n,r){var o=t.call(this,e,r||'')||this;return o.fonts=[],o.fontBoxes=[],o.fonts=i,o.currentFont=n,o.setCurrentFont=o.setCurrentFont.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.overflow="hidden",e.style.flexGrow="2",this.fonts.forEach((function(i){var n=document.createElement("div");n.style.display="inline-block",n.style.alignItems="center",n.style.justifyContent="space-between",n.style.padding="5px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.overflow="hidden",n.style.maxWidth=100/t.fonts.length-5+"%",n.style.borderColor=i===t.currentFont?t.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){t.setCurrentFont(i,n)})),e.appendChild(n);var r=document.createElement("div");r.style.display="flex",r.style.minHeight="20px",r.style.flexGrow="2",r.style.fontFamily=i,r.style.overflow="hidden";var o=document.createElement("div");o.style.whiteSpace="nowrap",o.style.overflow="hidden",o.style.textOverflow="ellipsis",o.innerHTML="The quick brown fox jumps over the lazy dog",r.appendChild(o),n.appendChild(r),t.fontBoxes.push(n)})),e},e.prototype.setCurrentFont=function(t,e){var i=this;this.currentFont=t,this.fontBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onFontChanged&&this.onFontChanged(this.currentFont)},e}(Q),ft=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.color="transparent",r.padding=5,r.DEFAULT_TEXT="your text here",r.text=r.DEFAULT_TEXT,r.isMoved=!1,r.color=n.defaultColor,r.fontFamily=n.defaultFontFamily,r.defaultSize={x:100,y:30},r.setColor=r.setColor.bind(r),r.setFont=r.setFont.bind(r),r.renderText=r.renderText.bind(r),r.sizeText=r.sizeText.bind(r),r.textEditDivClicked=r.textEditDivClicked.bind(r),r.showTextEditor=r.showTextEditor.bind(r),r.setSize=r.setSize.bind(r),r.positionTextEditor=r.positionTextEditor.bind(r),r.colorPanel=new tt("Color",n.defaultColorSet,n.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.fontFamilyPanel=new dt("Font",n.defaultFontFamilies,n.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r}return F(e,t),e.prototype.ownsTarget=function(e){if(t.prototype.ownsTarget.call(this,e)||e===this.visual||e===this.textElement||e===this.bgRectangle)return!0;var i=!1;return this.textElement.childNodes.forEach((function(t){t===e&&(i=!0)})),i},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.bgRectangle=G.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=G.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.textElement.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.isMoved=!1,this.pointerDownPoint=e,this.pointerDownTimestamp=Date.now(),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.renderText=function(){var t=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach((function(e){t.textElement.appendChild(G.createTSpan(""===e.trim()?" ":e.trim(),[["x","0"],["dy","1.2em"]]))})),setTimeout(this.sizeText,10)}},e.prototype.getTextScale=function(){var t=this.textElement.getBBox(),e=1;if(t.width>0&&t.height>0){var i=(1*this.width-this.width*this.padding*2/100)/t.width,n=(1*this.height-this.height*this.padding*2/100)/t.height;e=Math.min(i,n)}return e},e.prototype.getTextPosition=function(t){var e=this.textElement.getBBox(),i=0,n=0;return e.width>0&&e.height>0&&(i=(this.width-e.width*t)/2,n=this.height/2-e.height*t/2),{x:i,y:n}},e.prototype.sizeText=function(){var t=this.textElement.getBBox(),e=this.getTextScale(),i=this.getTextPosition(e);i.y-=t.y*e,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+i.x+"px, "+i.y+"px) scale("+e+", "+e+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(i.x,i.y),this.textElement.transform.baseVal.getItem(1).setScale(e,e))},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e),void 0!==this.pointerDownPoint&&(this.isMoved=Math.abs(e.x-this.pointerDownPoint.x)>5||Math.abs(e.y-this.pointerDownPoint.y)>5)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.isMoved=!0,this.setSize(),this.sizeText()},e.prototype.setSize=function(){t.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},e.prototype.pointerUp=function(e){var i=this.state;"creating"===i&&(this._suppressMarkerCreateEvent=!0),t.prototype.pointerUp.call(this,e),this.setSize(),("creating"===i||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},e.prototype.showTextEditor=function(){var t=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",(function(t){t.stopPropagation()})),this.textEditor.addEventListener("input",(function(){for(var e=Number.parseFloat(t.textEditor.style.fontSize);t.textEditor.clientWidth>=Number.parseInt(t.textEditor.style.maxWidth)&&e>.9;)e-=.1,t.textEditor.style.fontSize=Math.max(e,.9)+"em"})),this.textEditor.addEventListener("keyup",(function(t){t.cancelBubble=!0})),this.textEditor.addEventListener("paste",(function(t){if(t.clipboardData){var e=t.clipboardData.getData("text"),i=window.getSelection();if(!i.rangeCount)return!1;i.deleteFromDocument(),i.getRangeAt(0).insertNode(document.createTextNode(e)),t.preventDefault()}})),this.textEditDiv.addEventListener("pointerup",(function(){t.textEditDivClicked(t.textEditor.innerText)})),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},e.prototype.positionTextEditor=function(){if("edit"===this.state)if(void 0===this.textEditor)this.showTextEditor();else{this.textElement.style.display="";var t=this.getTextScale(),e=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),i=this.textElement.getBBox(),n={x:i.width*t,y:i.height*t};e.x-=n.x/2,e.y-=n.y/2,this.textEditor.style.top=e.y+"px",this.textEditor.style.left=e.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-e.x+"px",this.textEditor.style.fontSize=Math.max(16*t,12)+"px",this.textElement.style.display="none"}},e.prototype.textEditDivClicked=function(t){this.text=t.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},e.prototype.select=function(){t.prototype.select.call(this),"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText)},e.prototype.deselect=function(){"edit"===this.state&&this.textEditDivClicked(this.textEditor.innerText),t.prototype.deselect.call(this)},e.prototype.dblClick=function(e,i){t.prototype.dblClick.call(this,e,i),this.showTextEditor()},e.prototype.setColor=function(t){this.textElement&&G.setAttributes(this.textElement,[["fill",t]]),this.color=t,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(t)},e.prototype.setFont=function(t){this.textElement&&G.setAttributes(this.textElement,[["font-family",t]]),this.fontFamily=t,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},e.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},e.prototype.showVisual=function(){"edit"===this.state&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.color=i.color,this.fontFamily=i.fontFamily,this.padding=i.padding,this.text=i.text,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize(),this.sizeText(),this.positionTextEditor()},e.typeName="TextMarker",e.title="Text marker",e.icon='',e}(ot),gt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.color="transparent",r.lineWidth=3,r.drawing=!1,r.pixelRatio=1,r.color=n.defaultColor,r.lineWidth=n.defaultStrokeWidth,r.pixelRatio=n.freehandPixelRatio,r.setColor=r.setColor.bind(r),r.addCanvas=r.addCanvas.bind(r),r.finishCreation=r.finishCreation.bind(r),r.setLineWidth=r.setLineWidth.bind(r),r.colorPanel=new tt("Color",n.defaultColorSet,n.defaultColor),r.colorPanel.onColorChanged=r.setColor,r.lineWidthPanel=new at("Line width",n.defaultStrokeWidths,n.defaultStrokeWidth),r.lineWidthPanel.onWidthChanged=r.setLineWidth,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.drawingImage)},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.drawingImage=G.createImage(),this.visual.appendChild(this.drawingImage);var t=G.createTransform();this.visual.transform.baseVal.appendItem(t),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){"new"===this.state&&(this.addCanvas(),this.createVisual(),this._state="creating"),"creating"===this.state?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(e.x,e.y),this.drawing=!0):t.prototype.pointerDown.call(this,e,i)},e.prototype.manipulate=function(e){"creating"===this.state?this.drawing&&(this.canvasContext.lineTo(e.x,e.y),this.canvasContext.stroke()):t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),G.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},e.prototype.pointerUp=function(e){"creating"===this._state?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):t.prototype.pointerUp.call(this,e)},e.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},e.prototype.select=function(){"creating"===this.state&&this.finishCreation(),t.prototype.select.call(this)},e.prototype.deselect=function(){"creating"===this.state&&this.finishCreation(),t.prototype.deselect.call(this)},e.prototype.finishCreation=function(){for(var t=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),e=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],i=e[0],n=e[1],r=e[2],o=e[3],s=!1,a=0;a0&&(s=!0,ao&&(o=a),l>r&&(r=l));if(s){this.left=i/this.pixelRatio,this.top=n/this.pixelRatio,this.width=(r-i)/this.pixelRatio,this.height=(o-n)/this.pixelRatio;var c=document.createElement("canvas");c.width=r-i,c.height=o-n,c.getContext("2d").putImageData(this.canvasContext.getImageData(i,n,r-i,o-n),0,0),this.drawingImgUrl=c.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},e.prototype.setDrawingImage=function(){G.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),G.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},e.prototype.setColor=function(t){this.color=t,this.colorChanged(t)},e.prototype.setLineWidth=function(t){this.lineWidth=t},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return"new"===this.state||"creating"===this.state?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({drawingImgUrl:this.drawingImgUrl},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){this.createVisual(),t.prototype.restoreState.call(this,e),this.drawingImgUrl=e.drawingImgUrl,this.setDrawingImage()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setDrawingImage()},e.typeName="FreehandMarker",e.title="Freehand marker",e.icon='',e}(ot),mt=function(t){function e(e,i,n){var r=t.call(this,e,n||'')||this;return r.typeBoxes=[],r.currentType=i,r.setCurrentType=r.setCurrentType.bind(r),r}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2";for(var i=function(i){var r="both";switch(i){case 0:r="both";break;case 1:r="start";break;case 2:r="end";break;case 3:r="none"}var o=document.createElement("div");if(o.style.display="flex",o.style.flexGrow="2",o.style.alignItems="center",o.style.justifyContent="space-between",o.style.padding="5px",o.style.borderWidth="2px",o.style.borderStyle="solid",o.style.borderColor=r===n.currentType?n.uiStyleSettings.toolboxAccentColor:"transparent",o.addEventListener("click",(function(){t.setCurrentType(r,o)})),e.appendChild(o),"both"===r||"start"===r){var s=document.createElement("div");s.style.display="flex",s.style.alignItems="center",s.style.minHeight="20px",s.innerHTML='',s.style.marginLeft="5px",o.appendChild(s)}var a=document.createElement("div");a.style.display="flex",a.style.alignItems="center",a.style.minHeight="20px",a.style.flexGrow="2";var l=document.createElement("hr");if(l.style.minWidth="20px",l.style.border="0px",l.style.borderTop="3px solid "+(void 0!==n.uiStyleSettings?n.uiStyleSettings.toolboxColor:"#eeeeee"),l.style.flexGrow="2",a.appendChild(l),o.appendChild(a),"both"===r||"end"===r){var c=document.createElement("div");c.style.display="flex",c.style.alignItems="center",c.style.minHeight="20px",c.innerHTML='',c.style.marginRight="5px",o.appendChild(c)}n.typeBoxes.push(o)},n=this,r=0;r<4;r++)i(r);return e},e.prototype.setCurrentType=function(t,e){var i=this;this.currentType=t,this.typeBoxes.forEach((function(t){t.style.borderColor=t===e?void 0!==i.uiStyleSettings?i.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"})),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},e}(Q),vt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.arrowType="end",r.arrowBaseHeight=10,r.arrowBaseWidth=10,r.getArrowPoints=r.getArrowPoints.bind(r),r.setArrowType=r.setArrowType.bind(r),r.arrowTypePanel=new mt("Arrow type","end"),r.arrowTypePanel.onArrowTypeChanged=r.setArrowType,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.arrow1&&e!==this.arrow2)},e.prototype.getArrowPoints=function(t,e){var i=this.arrowBaseWidth+2*this.strokeWidth,n=this.arrowBaseHeight+2*this.strokeWidth;return t-i/2+","+(e+n/2)+" "+t+","+(e-n/2)+" "+(t+i/2)+","+(e+n/2)},e.prototype.createTips=function(){this.arrow1=G.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=G.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.arrow2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display="both"===this.arrowType||"start"===this.arrowType?"":"none",this.arrow2.style.display="both"===this.arrowType||"end"===this.arrowType?"":"none",G.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),G.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.arrow1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(i,0);var n=this.arrow2.transform.baseVal.getItem(0);n.setRotate(e+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(n,0)}},e.prototype.setArrowType=function(t){this.arrowType=t,this.adjustVisual(),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({arrowType:this.arrowType},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.arrowType=i.arrowType,this.createTips(),this.adjustVisual()},e.typeName="ArrowMarker",e.title="Arrow marker",e.icon='',e}(pt),yt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.fillColor=n.defaultFillColor,r.strokeWidth=0,r.fillPanel=new tt("Color",n.defaultColorSet,n.defaultFillColor),r.fillPanel.onColorChanged=r.setFillColor,r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="CoverMarker",e.title="Cover marker",e.icon='',e}(st),bt=function(t){function e(e,i,n,r){var o=t.call(this,e,r||'')||this;return o.opacities=[],o.opacityBoxes=[],o.opacities=i,o.currentOpacity=n,o.setCurrentOpacity=o.setCurrentOpacity.bind(o),o}return F(e,t),e.prototype.getUi=function(){var t=this,e=document.createElement("div");return e.style.display="flex",e.style.overflow="hidden",e.style.flexGrow="2",e.style.justifyContent="space-between",this.opacities.forEach((function(i){var n=document.createElement("div");n.style.display="flex",n.style.alignItems="center",n.style.justifyContent="center",n.style.padding="5px",n.style.borderWidth="2px",n.style.borderStyle="solid",n.style.borderColor=i===t.currentOpacity?t.uiStyleSettings.toolboxAccentColor:"transparent",n.addEventListener("click",(function(){t.setCurrentOpacity(i,n)})),e.appendChild(n);var r=document.createElement("div");r.innerText=100*i+"%",n.appendChild(r),t.opacityBoxes.push(n)})),e},e.prototype.setCurrentOpacity=function(t,e){var i=this;this.currentOpacity=t,this.opacityBoxes.forEach((function(t){t.style.borderColor=t===e?i.uiStyleSettings.toolboxAccentColor:"transparent"})),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},e}(Q),xt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.setOpacity=r.setOpacity.bind(r),r.fillColor=n.defaultHighlightColor,r.strokeWidth=0,r.opacity=n.defaultHighlightOpacity,r.fillPanel=new tt("Color",n.defaultColorSet,r.fillColor),r.fillPanel.onColorChanged=r.setFillColor,r.opacityPanel=new bt("Opacity",n.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(e,t),e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="HighlightMarker",e.title="Highlight marker",e.icon='',e}(yt),Ct='',wt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.bgColor="transparent",r.tipPosition={x:0,y:0},r.tipBase1Position={x:0,y:0},r.tipBase2Position={x:0,y:0},r.tipMoving=!1,r.color=n.defaultStrokeColor,r.bgColor=n.defaultFillColor,r.fontFamily=n.defaultFontFamily,r.defaultSize={x:100,y:30},r.setBgColor=r.setBgColor.bind(r),r.getTipPoints=r.getTipPoints.bind(r),r.positionTip=r.positionTip.bind(r),r.setTipPoints=r.setTipPoints.bind(r),r.colorPanel=new tt("Text color",n.defaultColorSet,r.color,''),r.colorPanel.onColorChanged=r.setColor,r.bgColorPanel=new tt("Fill color",n.defaultColorSet,r.bgColor,Ct),r.bgColorPanel.onColorChanged=r.setBgColor,r.fontFamilyPanel=new dt("Font",n.defaultFontFamilies,n.defaultFontFamily),r.fontFamilyPanel.onFontChanged=r.setFont,r.tipGrip=new nt,r.tipGrip.visual.transform.baseVal.appendItem(G.createTransform()),r.controlBox.appendChild(r.tipGrip.visual),r}return F(e,t),e.prototype.ownsTarget=function(e){return t.prototype.ownsTarget.call(this,e)||this.tipGrip.ownsTarget(e)||this.tip===e},e.prototype.createTip=function(){G.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=G.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},e.prototype.pointerDown=function(e,i){"new"===this.state&&t.prototype.pointerDown.call(this,e,i),"creating"===this.state?this.createTip():this.tipGrip.ownsTarget(i)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):t.prototype.pointerDown.call(this,e,i)},e.prototype.pointerUp=function(e){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,t.prototype.pointerUp.call(this,e);else{var i="creating"===this.state;t.prototype.pointerUp.call(this,e),this.setTipPoints(i),this.positionTip()}},e.prototype.manipulate=function(e){if(this.tipMoving){var i=this.unrotatePoint(e);this.tipPosition={x:i.x-this.manipulationStartLeft,y:i.y-this.manipulationStartTop},this.positionTip()}else t.prototype.manipulate.call(this,e)},e.prototype.setBgColor=function(t){this.bgRectangle&&this.tip&&(G.setAttributes(this.bgRectangle,[["fill",t]]),G.setAttributes(this.tip,[["fill",t]])),this.bgColor=t,this.fillColorChanged(t)},e.prototype.getTipPoints=function(){return this.setTipPoints("creating"===this.state),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},e.prototype.setTipPoints=function(t){void 0===t&&(t=!1);var e=Math.min(this.height/2,15),i=this.height/5;t&&(this.tipPosition={x:e+i/2,y:this.height+20});var n=Math.atan(this.height/2/(this.width/2));this.tipPosition.x=this.width/2&&this.tipPosition.y=this.width/2&&this.tipPosition.y>=this.height/2?n',e}(ft),kt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.fillColor="transparent",r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.opacity=1,r.strokeColor=n.defaultColor,r.strokeWidth=n.defaultStrokeWidth,r.strokeDasharray=n.defaultStrokeDasharray,r.fillColor=n.defaultFillColor,r.setStrokeColor=r.setStrokeColor.bind(r),r.setFillColor=r.setFillColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.setOpacity=r.setOpacity.bind(r),r.createVisual=r.createVisual.bind(r),r.strokePanel=new tt("Line color",V(n.defaultColorSet,["transparent"]),n.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.fillPanel=new tt("Fill color",V(n.defaultColorSet,["transparent"]),r.fillColor,Ct),r.fillPanel.onColorChanged=r.setFillColor,r.strokeWidthPanel=new at("Line width",n.defaultStrokeWidths,n.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",n.defaultStrokeDasharrays,n.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r.opacityPanel=new bt("Opacity",n.defaultOpacitySteps,r.opacity),r.opacityPanel.onOpacityChanged=r.setOpacity,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual)},e.prototype.createVisual=function(){this.visual=G.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"new"===this.state&&(this.createVisual(),this.moveVisual(e),this._state="creating")},e.prototype.manipulate=function(e){t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){t.prototype.resize.call(this,e),this.setSize()},e.prototype.setSize=function(){t.prototype.setSize.call(this),G.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},e.prototype.pointerUp=function(e){t.prototype.pointerUp.call(this,e),this.setSize()},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.visual&&G.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(t),this.stateChanged()},e.prototype.setFillColor=function(t){this.fillColor=t,this.visual&&G.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(t),this.stateChanged()},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.visual&&G.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.visual&&G.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},e.prototype.setOpacity=function(t){this.opacity=t,this.visual&&G.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){var i=e;this.fillColor=i.fillColor,this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.opacity=i.opacity,this.createVisual(),t.prototype.restoreState.call(this,e),this.setSize()},e.prototype.scale=function(e,i){t.prototype.scale.call(this,e,i),this.setSize()},e.typeName="EllipseMarker",e.title="Ellipse marker",e.icon='',e}(ot),St=function(t){function e(e,i,n){return t.call(this,e,i,n)||this}return F(e,t),Object.defineProperty(e.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.tip1&&e!==this.tip2)},e.prototype.createTips=function(){this.tip1=G.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.tip1),this.tip2=G.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(G.createTransform()),this.visual.appendChild(this.tip2)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),"creating"===this.state&&this.createTips()},e.prototype.adjustVisual=function(){if(t.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(G.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var e=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),i=this.tip1.transform.baseVal.getItem(0);i.setRotate(e,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(i,0);var n=this.tip2.transform.baseVal.getItem(0);n.setRotate(e+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(n,0)}},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e),this.createTips(),this.adjustVisual()},e.typeName="MeasurementMarker",e.title="Measurement marker",e.icon='',e}(pt),Et=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.strokePanel.colors=n.defaultColorSet,r.fillColor="transparent",r}return F(e,t),Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=t.prototype.getState.call(this);return i.typeName=e.typeName,i},e.typeName="EllipseFrameMarker",e.title="Ellipse frame marker",e.icon='',e}(kt),Lt=function(){function t(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),t.prototype.addUndoStep=function(t){0!==this.undoStack.length&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(t)||(this.undoStack.push(t),JSON.stringify(this.lastRedoStep)!==JSON.stringify(t)&&this.redoStack.splice(0,this.redoStack.length))},t.prototype.replaceLastUndoStep=function(t){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=t)},t.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},t.prototype.undo=function(){if(this.undoStack.length>1){var t=this.undoStack.pop();return void 0!==t&&this.redoStack.push(t),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},t.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},t}(),Tt=function(t){function e(e,i,n){var r=t.call(this,e,i,n)||this;return r.strokeColor="transparent",r.strokeWidth=0,r.strokeDasharray="",r.curveX=0,r.curveY=0,r.manipulationStartCurveX=0,r.manipulationStartCurveY=0,r.setStrokeColor=r.setStrokeColor.bind(r),r.setStrokeWidth=r.setStrokeWidth.bind(r),r.setStrokeDasharray=r.setStrokeDasharray.bind(r),r.positionGrips=r.positionGrips.bind(r),r.addControlGrips=r.addControlGrips.bind(r),r.adjustVisual=r.adjustVisual.bind(r),r.setupControlBox=r.setupControlBox.bind(r),r.resize=r.resize.bind(r),r.strokeColor=n.defaultColor,r.strokeWidth=n.defaultStrokeWidth,r.strokeDasharray=n.defaultStrokeDasharray,r.strokePanel=new tt("Line color",n.defaultColorSet,n.defaultColor),r.strokePanel.onColorChanged=r.setStrokeColor,r.strokeWidthPanel=new at("Line width",n.defaultStrokeWidths,n.defaultStrokeWidth),r.strokeWidthPanel.onWidthChanged=r.setStrokeWidth,r.strokeStylePanel=new lt("Line style",n.defaultStrokeDasharrays,n.defaultStrokeDasharray),r.strokeStylePanel.onStyleChanged=r.setStrokeDasharray,r}return F(e,t),e.prototype.ownsTarget=function(e){return!(!t.prototype.ownsTarget.call(this,e)&&e!==this.visual&&e!==this.selectorCurve&&e!==this.visibleCurve&&!this.curveGrip.ownsTarget(e))},e.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},e.prototype.createVisual=function(){this.visual=G.createGroup(),this.selectorCurve=G.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=G.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},e.prototype.pointerDown=function(e,i){t.prototype.pointerDown.call(this,e,i),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,"new"===this.state&&(this.curveX=e.x,this.curveY=e.y),"new"===this.state?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(i)&&(this.activeGrip=this.curveGrip,this._state="resize")},e.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),G.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),G.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),G.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},e.prototype.setupControlBox=function(){t.prototype.setupControlBox.call(this),this.curveControlLine1=G.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=G.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},e.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,t.prototype.addControlGrips.call(this)},e.prototype.positionGrips=function(){t.prototype.positionGrips.call(this);var e=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-e/2,this.curveY-e/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},e.prototype.manipulate=function(e){"move"===this.state&&(this.curveX=this.manipulationStartCurveX+e.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+e.y-this.manipulationStartY),t.prototype.manipulate.call(this,e)},e.prototype.resize=function(e){this.activeGrip===this.curveGrip&&(this.curveX=e.x,this.curveY=e.y),t.prototype.resize.call(this,e),"creating"===this.state&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},e.prototype.setStrokeColor=function(t){this.strokeColor=t,this.adjustVisual(),this.colorChanged(t)},e.prototype.setStrokeWidth=function(t){this.strokeWidth=t,this.adjustVisual()},e.prototype.setStrokeDasharray=function(t){this.strokeDasharray=t,this.adjustVisual()},e.prototype.scale=function(e,i){this.curveX=this.curveX*e,this.curveY=this.curveY*i,t.prototype.scale.call(this,e,i)},Object.defineProperty(e.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),e.prototype.getState=function(){var i=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},t.prototype.getState.call(this));return i.typeName=e.typeName,i},e.prototype.restoreState=function(e){t.prototype.restoreState.call(this,e);var i=e;this.strokeColor=i.strokeColor,this.strokeWidth=i.strokeWidth,this.strokeDasharray=i.strokeDasharray,this.curveX=i.curveX,this.curveY=i.curveY,this.createVisual(),this.adjustVisual()},e.typeName="CurveMarker",e.title="Curve marker",e.icon='',e}(ut),At=function(){function t(t,e){void 0===e&&(e=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=t,this.cancelable=e}return Object.defineProperty(t.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),t.prototype.preventDefault=function(){this._defaultPrevented=!0},t}(),Mt=function(t){function e(e,i,n){var r=t.call(this,e,!1)||this;return r.dataUrl=i,r.state=n,r}return F(e,t),e}(At),Ot=function(t){function e(e,i,n){void 0===n&&(n=!1);var r=t.call(this,e,n)||this;return r.marker=i,r}return F(e,t),e}(At),Nt=function(){function t(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return t.prototype.addEventListener=function(t,e){this[t].push(e)},t.prototype.removeEventListener=function(t,e){var i=this[t].indexOf(e);i>-1&&this[t].splice(i,1)},t}(),Pt=function(){function t(e){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ht,this._isOpen=!1,this.undoRedoManager=new Lt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Nt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=t.instanceCounter++,this.styles=new K(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=e,this.targetRoot=document.body,this.width=e.clientWidth,this.height=e.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(t.prototype,"ALL_MARKER_TYPES",{get:function(){return[ct,gt,vt,ft,Et,kt,xt,wt,St,yt,pt,Tt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ct,gt,vt,ft,kt,xt,wt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ct,gt,vt,ft,xt]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(t){var e=this;this._availableMarkerTypes.splice(0),t.forEach((function(t){if("string"==typeof t){var i=e.ALL_MARKER_TYPES.find((function(e){return e.typeName===t}));void 0!==i&&e._availableMarkerTypes.push(i)}else e._availableMarkerTypes.push(t)}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(t){this._zoomLevel=t,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),"popup"===this.settings.displayMode&&this.onPopupTargetResize(),U.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},t.prototype.show=function(){var t=this;void 0===this.styles.styleSheetRoot&&void 0!==$.styleSheetRoot&&(this.styles.styleSheetRoot=$.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach((function(e){return e(new At(t))}))},t.prototype.render=function(){return H(this,void 0,void 0,(function(){var t;return W(this,(function(e){switch(e.label){case 0:return this.setCurrentMarker(),(t=new q).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.markersOnly=this.renderMarkersOnly,t.width=this.renderWidth,t.height=this.renderHeight,[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return e.sent(),[4,t.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,e.sent()]}}))}))},t.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isOpen){var i=!1;t||this.eventListeners.beforeclose.forEach((function(t){var n=new At(e,!0);t(n),n.defaultPrevented&&(i=!0)})),i||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.settings.displayMode&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach((function(t){return t(new At(e))})),this.detachEvents(),this._isOpen=!1)}},t.prototype.addMarkersToToolbar=function(){for(var t,e=[],i=0;ithis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*t:this.editorCanvas.clientWidth,i=e',t.title="Powered by marker.js",t.style.display="grid",t.style.alignItems="center",t.style.justifyItems="center",t.style.padding="3px",t.style.width="20px",t.style.height="20px",this.logoUI.appendChild(t),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},t.prototype.positionLogo=function(){this.logoUI&&("right"!==this.uiStyleSettings.logoPosition?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},t.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},t.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},t.prototype.showUI=function(){switch("popup"===this.settings.displayMode&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=void 0!==this.uiStyleSettings.zIndex?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin="popup"===this.settings.displayMode?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Z(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1","popup"===this.settings.displayMode&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex","popup"===this.settings.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y-1&&this.markers.splice(this.markers.indexOf(t),1),t.dispose()},t.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),void 0!==this._currentMarker&&("new"!==this._currentMarker.state?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},t.prototype.toolbarButtonClicked=function(t,e){if("marker"===t&&void 0!==e)this.createNewMarker(e);else if("action"===t)switch(e){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":void 0===this.notesArea?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},t.prototype.deleteSelectedMarker=function(){var t=this;if(void 0!==this._currentMarker){var e=!1;if(this.eventListeners.markerbeforedelete.forEach((function(i){var n=new Ot(t,t._currentMarker,!0);i(n),n.defaultPrevented&&(e=!0)})),!e){var i=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach((function(e){return e(new Ot(t,i))}))}}},t.prototype.clear=function(){var t=this,e=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach((function(i){var n=new Ot(t,void 0,!0);i(n),n.defaultPrevented&&(e=!0)})),!e)){this.setCurrentMarker();for(var i=function(e){var i=n.markers[e];n.setCurrentMarker(n.markers[e]),n._currentMarker.dispose(),n.markerImage.removeChild(n._currentMarker.container),n.markers.splice(n.markers.indexOf(n._currentMarker),1),n.eventListeners.markerdelete.forEach((function(e){return e(new Ot(t,i))}))},n=this,r=this.markers.length-1;r>=0;r--)i(r);this.addUndoStep()}},Object.defineProperty(t.prototype,"isNotesAreaOpen",{get:function(){return void 0!==this.notesArea},enumerable:!1,configurable:!0}),t.prototype.showNotesEditor=function(){var t;void 0!==this._currentMarker&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=null!==(t=this._currentMarker.notes)&&void 0!==t?t:"",this.overlayContainer.appendChild(this.notesArea))},t.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(void 0!==this._currentMarker&&(this._currentMarker.notes=""!==this.notesArea.value.trim()?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},t.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},t.prototype.addUndoStep=function(){var t=this;if(void 0===this._currentMarker||"edit"!==this._currentMarker.state){var e=this.getState(),i=this.undoRedoManager.getLastUndoStep();if(!i||i.width===e.width&&i.height===e.height){var n=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(e),n1&&this.panTo({x:t.clientX,y:t.clientY}))},t.prototype.onPointerUp=function(t){this.touchPoints>0&&this.touchPoints--,0===this.touchPoints&&this.isDragging&&void 0!==this._currentMarker&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(t.clientX,t.clientY)),this.isDragging=!1,this.addUndoStep()},t.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},t.prototype.onKeyUp=function(t){void 0===this._currentMarker||void 0!==this.notesArea||"Delete"!==t.key&&"Backspace"!==t.key||this.deleteSelectedMarker()},t.prototype.clientToLocalCoordinates=function(t,e){var i=this.markerImage.getBoundingClientRect();return{x:(t-i.left)/this.zoomLevel,y:(e-i.top)/this.zoomLevel}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var t=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},t.prototype.addLicenseKey=function(t){U.addKey(t)},t.prototype.addEventListener=function(t,e){this.eventListeners.addEventListener(t,e)},t.prototype.removeEventListener=function(t,e){this.eventListeners.removeEventListener(t,e)},t.prototype.renderState=function(t){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(t),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(t.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),t.prototype.focus=function(){var t=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,void 0!==this._previousCurrentMarker&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach((function(e){return e(new At(t))})))},t.prototype.blur=function(){var t=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach((function(e){return e(new At(t))})))},t.instanceCounter=0,t}(),Dt=function(t,e){return(Dt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};
/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** */
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Rt(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Dt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function _t(t,e,i,n){return new(i||(i=Promise))((function(r,o){function s(t){try{l(n.next(t))}catch(t){o(t)}}function a(t){try{l(n.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(s,a)}l((n=n.apply(t,e||[])).next())}))}function Bt(t,e){var i,n,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]0&&e>0){var i=new $t(t,e),n=i.ratio>=1?20:i.getHorizontalLength(20),r=i.ratio<1?20:i.getVerticalLength(20),o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(o);var s=jt.createDefs();o.appendChild(s);var a=jt.createElement("clipPath",[["id","text-bg-clip"]]);s.appendChild(a);var l=jt.createPath(jt.getHollowRectanglePath((24-n)/2,(24-r)/2,n,r,(24-n)/2+2,(24-r)/2+2,n-4,r-4));o.appendChild(l);var c=jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);c.appendChild(jt.createTSpan(t+":"+e)),o.appendChild(c);var h=c.getBBox();jt.setAttributes(c,[["x",((24-h.width)/2).toString()],["y",((24-h.height)/2-h.y).toString()]]);var u=jt.createPath(jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(h.width))/2,(24-Math.ceil(h.height))/2,Math.ceil(h.width),Math.ceil(h.height)));return a.appendChild(u),jt.setAttributes(l,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(o),o.outerHTML}return''},t}(),Xt=function(t){function e(e,i,n){var r=t.call(this,e,i)||this;return r.isDropdownOpen=!1,r.onClick=r.dropdownButtonClicked,r.dropdownButtons=n,r}return Rt(e,t),e.prototype.setupDropdown=function(){var t=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach((function(e){e.className=t.className,e.colorsClassName=t.colorsClassName,t.dropdownBlock.appendChild(e.getUI())})),this.uiContainer.appendChild(this.dropdownBlock)},e.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},e.prototype.dropdownButtonClicked=function(){void 0===this.dropdownBlock&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},e.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},e.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},e.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},e}(Ut),Yt=function(){function t(t,e){this.GRIP_SIZE=10,this.color=t,this.fillColor=e,this.visual=jt.createGroup(),this.visual.appendChild(jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return t.prototype.ownsTarget=function(t){return t===this.visual||t===this.visual.childNodes[0]||t===this.visual.childNodes[1]},t.prototype.setCenter=function(t,e){this.visual.childNodes.forEach((function(i){return jt.setAttributes(i,[["cx",t.toString()],["cy",e.toString()]])}))},t}(),Zt=function(){function t(t,e,i,n){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=t,this.canvasHeight=e,this.margin=i,this.container=n,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(t.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(t){this._aspectRatio=t,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.gridContainer&&jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(t){this._zoomFactor=t,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),t.prototype.open=function(){var t=this;this.cropShadeElement=jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var e=0;ethis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-e.height/2),jt.setAttributes(this.cropRectElement,[["x",e.x.toString()],["y",e.y.toString()],["width",e.width.toString()],["height",e.height.toString()]]);var i=e.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach((function(t,n){var r=e.y+i*(n+1);jt.setAttributes(t,[["x1",""+e.x],["y1",""+r],["x2",""+(e.x+e.width)],["y2",""+r]])}));var n=e.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach((function(t,i){var r=e.x+n*(i+1);jt.setAttributes(t,[["x1",""+r],["y1",""+e.y],["x2",""+r],["y2",""+(e.y+e.height)]])})),jt.setAttributes(this.cropShadeElement,[["d",jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,e.x,e.y,e.width,e.height)]]),this.topLeftGrip.setCenter(e.x,e.y),this.topRightGrip.setCenter(e.x+e.width,e.y),this.bottomLeftGrip.setCenter(e.x,e.y+e.height),this.bottomRightGrip.setCenter(e.x+e.width,e.y+e.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},t.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},t.prototype.clientToLocalCoordinates=function(t,e){var i=this.container.getBoundingClientRect();return{x:t-i.left+this.margin,y:e-i.top+this.margin}},t.prototype.onPointerDown=function(t){this.container.setPointerCapture(t.pointerId),this.previousPoint=this.clientToLocalCoordinates(t.clientX,t.clientY),this.cropRectElement===t.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(t.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(t.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(t.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(t.target)&&(this.activeGrip=this.bottomRightGrip)},t.prototype.onPointerMove=function(t){if(this.isMoving)this.move(this.clientToLocalCoordinates(t.clientX,t.clientY));else if(this.activeGrip){var e=this.clientToLocalCoordinates(t.clientX,t.clientY);this.resize(e)}t.preventDefault()},t.prototype.onPointerUp=function(t){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(t.pointerId)},t.prototype.move=function(t){var e=t.x-this.previousPoint.x,i=t.y-this.previousPoint.y;1!==this.zoomFactor&&(e=-e/this.zoomFactor,i=-i/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+e),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+i),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=t},t.prototype.resize=function(t){var e=Object.assign({},this.cropRect),i=t.x-this.previousPoint.x,n=t.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:e.x+ithis.canvasWidth*this.zoomFactor&&(i=this.canvasWidth*this.zoomFactor-e.width),e.width+=i}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(e.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(i),e.height=this.aspectRatio.getVerticalLength(e.width)):(e.y+=n,e.height=this.cropRect.y+this.cropRect.height-e.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?e.height=this.aspectRatio.getVerticalLength(e.width):e.height+=n}e.width<10&&(e.x=this.cropRect.x,e.width=10),e.height<10&&(e.y=this.cropRect.y,e.height=10),this.previousPoint=t,e.x>=this.margin&&e.y>=this.margin&&e.x-this.margin+e.width<=this.canvasWidth&&e.y-this.margin+e.height<=this.canvasHeight&&(this.cropRect=e,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},t.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var t=this.cropRect.x+this.cropRect.width/2,e=this.cropRect.y+this.cropRect.height/2,i=this.aspectRatio.getHorizontalLength(this.cropRect.height),n=this.aspectRatio.getVerticalLength(this.cropRect.width);i/this.canvasWidththis.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=t-this.cropRect.width/2,this.cropRect.y=e-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},t.prototype.getRescaledRect=function(t,e,i,n,r,o){var s=i/t,a=n/e;return{x:(r.x-o)*s+o,y:(r.y-o)*a+o,width:r.width*s,height:r.height*a}},t.prototype.scaleCanvas=function(t,e){var i=this.getRescaledRect(this.canvasWidth,this.canvasHeight,t,e,this.cropRect,this.margin);this.canvasWidth=t,this.canvasHeight=e,this.onCropChange&&this.onCropChange(i),this.setCropRectangle(i)},t}(),Jt=function(){function t(t){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=t,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(t.prototype,"angle",{get:function(){return this._angle},set:function(t){this._angle=t,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),t.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},t.prototype.onPointerDown=function(t){this.controlContainer.setPointerCapture(t.pointerId),this.isDragging=!0,this.previousPoint={x:t.clientX,y:t.clientY}},t.prototype.onPointerMove=function(t){this.isDragging&&(this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.previousPoint.x=t.clientX)},t.prototype.onPointerUp=function(t){this.isDragging&&this.onAngleChange&&this.onAngleChange((t.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(t.pointerId)},t.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var t=this.angleLabelText.getBBox();jt.setAttributes(this.angleLabelElement,[["x",((this.width-t.width)/2).toString()],["y",(this.height/2).toString()]])}},t.prototype.positionScaleShape=function(){if(this.scaleShape){var t=this.scaleShape.transform.baseVal.getItem(0);t.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(t,0)}},t.prototype.getVisual=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("xmlns","http://www.w3.org/2000/svg"),t.setAttribute("width",this.width+"px"),t.setAttribute("height",this.height+"px"),t.setAttribute("viewBox","0 0 "+this.width+" "+this.height),t.style.flexShrink="0",document.body.appendChild(t);for(var e="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,i=1;i<=this.width/5+10;i++){var n=i%5==0?this.height/3:this.height/6;e+="h4v"+-n+"h1v"+n}e+="v1H0Z",this.scaleShape=jt.createPath(e);var r=jt.createTransform();this.scaleShape.transform.baseVal.appendItem(r),t.appendChild(this.scaleShape),this.angleLabelElement=jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var o=jt.createTSpan("");return o.innerHTML="°",this.angleLabelElement.appendChild(o),t.appendChild(this.angleLabelElement),document.body.removeChild(t),t},t}(),Qt=function(){function t(){this.naturalSize=!1,this.imageType="image/png"}return t.prototype.rasterize=function(t,e,i,n,r,o,s){var a=this;return new Promise((function(l){var c=document.createElement("canvas");c.width=t.width.baseVal.value-2*n,c.height=t.height.baseVal.value-2*n;var h=1,u=1;!0===a.naturalSize?(h=e.naturalWidth/(t.width.baseVal.value-2*n)/o,u=e.naturalHeight/(t.height.baseVal.value-2*n)/s,c.width=e.naturalWidth/o,c.height=e.naturalHeight/s):void 0!==a.width&&void 0!==a.height&&(h=a.width/i.width,u=a.height/i.height,c.width*=h,c.height*=u);var p=c.getContext("2d");p.translate(c.width/2,c.height/2),p.rotate(r*Math.PI/180),p.scale(o,s),p.translate(-c.width/2,-c.height/2),p.drawImage(e,0,0,c.width,c.height);var d=document.createElement("canvas");d.width=i.width*h,d.height=i.height*u,d.getContext("2d").putImageData(p.getImageData((i.x-n)*h,(i.y-n)*u,i.width*h,i.height*u),0,0),l(d.toDataURL(a.imageType,a.imageQuality))}))},t}(),te=function(){function t(e){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=t.instanceCounter++,this.styles=new zt(this.instanceNo),this.target=e,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(t.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(t){this._zoomToCropEnabled=t,t?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(t){this._isGridVisible=t,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"gridLines",{get:function(){return this._gridLines},set:function(t){this._gridLines=t,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(t){this._rotationAngle=t,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"aspectRatio",{get:function(){var t;return null!==(t=this._aspectRatio)&&void 0!==t?t:this.aspectRatios[0]},set:function(t){this._aspectRatio=t},enumerable:!1,configurable:!0}),t.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),"popup"===this.displayMode&&this.onPopupResize(),this._isOpen=!0},t.prototype.show=function(){this.showUI(),this.open()},t.prototype.close=function(t){void 0===t&&(t=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),"popup"===this.displayMode&&window.removeEventListener("resize",this.setWindowHeight),t||this.closeEventListeners.forEach((function(t){return t()})),this._isOpen=!1)},t.prototype.addRenderEventListener=function(t){this.renderEventListeners.push(t)},t.prototype.removeRenderEventListener=function(t){this.renderEventListeners.indexOf(t)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(t),1)},t.prototype.addCloseEventListener=function(t){this.closeEventListeners.push(t)},t.prototype.removeCloseEventListener=function(t){this.closeEventListeners.indexOf(t)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(t),1)},t.prototype.setupResizeObserver=function(){var t=this;"inline"===this.displayMode?window.ResizeObserver&&(this.targetObserver=new ResizeObserver((function(){t.resize(t.target.clientWidth,t.target.clientHeight)})),this.targetObserver.observe(this.target)):"popup"===this.displayMode&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},t.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var t=1*this.target.clientWidth/this.target.clientHeight,e=this.contentDiv.clientWidth/t>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*t:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,i=e+2*this.CANVAS_MARGINt+this.CANVAS_MARGIN?this.target.offsetTop-(t+this.CANVAS_MARGIN):0;this.coverDiv.style.top=e+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=void 0!==this.styles.settings.zIndex?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=void 0!==this.styles.settings.zIndex?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin="popup"===this.displayMode?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,"popup"===this.displayMode&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex","popup"===this.displayMode&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},t.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},t.prototype.addTopToolbar=function(){var t=this;this.topToolbar=new Wt,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var e=new Gt;e.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(e);var i=[];this.aspectRatios.forEach((function(e){var n=new Ut(Kt.getIcon(e.horizontal,e.vertical),0===e.horizontal&&0===e.vertical?"FREE":e.horizontal+":"+e.vertical);n.onClick=function(){return t.ratioButtonClicked(e)},i.push(n)})),this.aspectRatioButton=new Xt(Kt.getIcon(0,0),"Aspect ratio",i),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,e.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var n=new Ut('',"Toggle grid");n.isActive=this.isGridVisible,n.onClick=function(){t.isGridVisible=!t.isGridVisible,n.isActive=t.isGridVisible},e.addButton(n);var r=new Ut('',"Zoom to selection");if(r.isActive=this.zoomToCropEnabled,r.onClick=function(){t.zoomToCropEnabled=!t.zoomToCropEnabled,r.isActive=t.zoomToCropEnabled},e.addButton(r),!It.isLicensed){var o=new qt;this.topToolbar.addElementBlock(o);var s=document.createElement("div");s.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var a=document.createElement("a");a.style.color="currentColor",a.href="https://markerjs.com/products/cropro",a.target="_blank",a.innerHTML='',s.appendChild(a),o.addElement(s)}var l=new Gt;l.minWidth=3*this.toolbarHeight+"px",l.contentAlign="end",this.topToolbar.addButtonBlock(l);var c=new Ut('',"OK");c.onClick=this.startRenderAndClose,l.addButton(c),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(c.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var h=new Ut('',"Close");h.onClick=this.close,l.addButton(h),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(h.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},t.prototype.addBottomToolbar=function(){var t=this;this.bottomToolbar=new Wt,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var e=new Gt;e.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(e);var i=new Ut('',"Rotate left");i.onClick=this.rotateLeftButtonClicked,e.addButton(i);var n=new Ut('',"Rotate right");n.onClick=this.rotateRightButtonClicked,e.addButton(n);var r=new qt;r.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(r),this.straightener=new Jt("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(e){t.rotateBy(e),t.straightener.angle=t.rotationAngle},r.addElement(this.straightener.getUI());var o=new Gt;o.minWidth=2*this.toolbarHeight+"px",o.contentAlign="end",this.bottomToolbar.addButtonBlock(o);var s=new Ut('',"Flip horizontal");s.onClick=this.flipHorizontallyButtonClicked,o.addButton(s);var a=new Ut('',"Flip vertical");a.onClick=this.flipVerticallyButtonClicked,o.addButton(a)},t.prototype.ratioButtonClicked=function(t){this.aspectRatio=t,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},t.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Kt.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},t.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&0!==this.aspectRatio.horizontal&&0!==this.aspectRatio.vertical?this.cropLayer.aspectRatio=new $t(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},t.prototype.closeUI=function(){"popup"===this.displayMode&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},t.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},t.prototype.restoreState=function(t){if(t){var e=this.cropLayer.getRescaledRect(t.width,t.height,this.imageWidth,this.imageHeight,t.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(e),this.cropRectChanged(e),this.flippedHorizontally=t.flippedHorizontally,this.flippedVertically=t.flippedVertically,this.applyFlip(),this.rotationAngle=t.rotationAngle,this.applyRotation()}},t.prototype.clientToLocalCoordinates=function(t,e){var i=this.cropImage.getBoundingClientRect();return{x:t-i.left,y:e-i.top}},t.prototype.onWindowResize=function(){this.positionUI()},t.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var t=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=t+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},t.prototype.rotateLeftButtonClicked=function(){var t=this.rotationAngle-90;this.rotationAngle%90!=0&&(t+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateRightButtonClicked=function(){var t=this.rotationAngle+90;this.rotationAngle%90!=0&&(t-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(t)},t.prototype.rotateTo=function(t){t=(t=t>180?t-360:t)<=-180?t+360:t,this.rotationAngle=t,this.applyRotation()},t.prototype.rotateBy=function(t){this.rotateTo((this.rotationAngle+t)%360)},t.prototype.applyRotation=function(){var t=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var e=this.editingTargetRotationContainer.transform.baseVal.getItem(0);e.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(e,0);var i=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/i.width,this.imageHeight/i.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=t},t.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},t.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},t.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},t.prototype.startRenderAndClose=function(){return _t(this,void 0,void 0,(function(){var t,e;return Bt(this,(function(i){switch(i.label){case 0:return[4,this.render()];case 1:return t=i.sent(),e=this.getState(),this.renderEventListeners.forEach((function(i){return i(t,e)})),this.close(!0),[2]}}))}))},t.prototype.render=function(){return _t(this,void 0,void 0,(function(){var t;return Bt(this,(function(e){switch(e.label){case 0:return(t=new Qt).naturalSize=this.renderAtNaturalSize,t.imageType=this.renderImageType,t.imageQuality=this.renderImageQuality,t.width=this.renderWidth,t.height=this.renderHeight,this.unzoomFromCrop(),jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,t.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return e.sent(),[4,t.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,e.sent()]}}))}))},t.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ht("toolbar","\n width: "+("inline"===this.displayMode?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+";\n flex-shrink: 0;\n display: flex;\n flex-direction: row;\n justify-content: space-between; \n height: "+this.toolbarHeight+"px;\n box-sizing: content-box;\n overflow: hidden;\n line-height: 0px;\n ")),this.toolbarStyleColorsClass=this.styles.addClass(new Ht("toolbar_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarBlockStyleClass=this.styles.addClass(new Ht("toolbar-block","\n display: flex;\n align-items: center;\n box-sizing: content-box;\n "));var t=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ht("toolbar_button","\n display: inline-block;\n width: "+(this.toolbarHeight-2*t)+"px;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_button_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n ")),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ht("toolbar_active_button","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n background-color: "+this.styles.settings.toolbarBackgroundActiveColor+"\n ")),this.styles.addRule(new Ft("."+this.toolbarButtonStyleClass.name+" svg","\n height: "+this.toolbarHeight/2+"px;\n ")),this.styles.addRule(new Ft("."+this.toolbarButtonStyleColorsClass.name+":hover","\n background-color: "+this.styles.settings.toolbarBackgroundHoverColor+"\n ")),this.toolbarDropdownStyleClass=this.styles.addClass(new Ht("toolbar_dropdown","\n position: absolute;\n max-width: "+4*this.toolbarHeight+"px;\n z-index: 20;\n white-space: normal;\n box-sizing: content-box;\n box-shadow: 3px 3px rgba(33, 33, 33, 0.1);\n margin: "+("inline"===this.displayMode?"0":this.popupMargin)+"px;\n line-height: 0px;\n ")),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Ht("toolbar_dropdown_colors","\n background-color: "+this.styles.settings.toolbarBackgroundColor+";\n ")),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ht("toolbar_straightener_block","\n display: flex;\n overflow: hidden;\n justify-content: center;\n -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);\n ")),this.toolbarStraightenerStyleClass=this.styles.addClass(new Ht("toolbar_straightener","\n display: flex;\n overflow: hidden;\n justify-content: center;\n height: "+(this.toolbarHeight-2*t)+"px;\n padding: "+t+"px;\n cursor: default;\n user-select: none;\n box-sizing: content-box;\n ")),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ht("toolbar_straightener_colors","\n color: "+this.styles.settings.toolbarColor+";\n fill: currentColor;\n "))},t.instanceCounter=0,t}(),ee=i("8hTe"),ie=i.n(ee),ne=/]*>/g;e.a=function(t){var e=t.value,i=void 0===e?"":e,l=t.edit,p=void 0!==l&&l,d=t.className,f=t.showTextOnly,g=t.showLines,m=t.replaces,v=t.zoomImg,y=t.hasMask,w=t.style,k=void 0===w?{}:w,S=t.stylesPrev,E=void 0===S?{}:S,A=String(i),M=Object(h.useRef)(),O=Object(h.useRef)(),N=Object(h.useState)(""),D=Object(a.a)(N,2),z=D[0],F=D[1],H=Object(h.useState)("office"),W=Object(a.a)(H,2),V=W[0],G=W[1],U=Object(h.useMemo)((function(){try{A=(A=A.replace(/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,"("+_.a.API_SERVER+"/api/attachments/").replace(/\"\/api\/attachments\/|\"\/attachments\/download\//g,'"'+_.a.API_SERVER+"/api/attachments/").replace(/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,'"'+_.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,"\n")).replace(new RegExp("(?[TOC]
",C()),b()),t=(t=t.replace(/(__special_katext_id_\d+__)/g,(function(t,i){var n=e[i],r=n.type,o=n.expression;return Object(B.renderToString)(function(t){var e=document.createElement("div");return e.innerHTML=t,0===e.childNodes.length?"":e.childNodes[0].nodeValue}(o)||"",{displayMode:"block"===r,throwOnError:!1,output:"html"})}))).replace(/▁/g,"▁▁▁"),T(),f){var i=document.createElement("div");return i.innerHTML=t,i.innerText}return setTimeout((function(){return K()}),500),t}),[A]),q=Object(h.useRef)();function $(t){var e=t.target;if("IMG"===e.tagName.toUpperCase()){if(v){var i=e.getAttribute("src");F(i),G("image")}}else if("A"===e.tagName.toUpperCase()){var n=e.getAttribute("href");if(n.indexOf("office")>-1)t.preventDefault(),F(n),G("office");else if(n.indexOf("application/pdf")>-1)t.preventDefault(),F(n),G("pdf");else if(n.indexOf("type=text")>-1)t.preventDefault(),F(n),G("html");else if(n.startsWith("#")){t.preventDefault();var r=document.getElementById(n.replace("#",""));r&&r.scrollIntoView(!0)}}}x.WebkitLineClamp=g,g&&(k=Object(o.a)(Object(o.a)({},k),x));var K=function(){var t,e=null===(t=q.current)||void 0===t?void 0:t.querySelectorAll("video");null==e||e.forEach((function(t){if(t.oncontextmenu=function(){return!1},t.src.indexOf(".m3u8")>-1)if(t.canPlayType("application/vnd.apple.mpegurl"));else if(R.a.isSupported()){var e=new R.a;e.loadSource(t.src),e.attachMedia(t)}}))};Object(h.useEffect)((function(){if(q.current&&U&&U.match(ne)&&window.PR.prettyPrint(),q.current)return q.current.addEventListener("click",$),function(){q.current.removeEventListener("click",$),T(),b()}}),[U,q.current,$]);return u.a.createElement("div",{style:{position:"relative"}},u.a.createElement("div",{ref:q,style:Object(o.a)({},k),className:"".concat(d||""," markdown-body ").concat(ie.a.mdBody),onMouseOver:function(t){p&&("IMG"===t.target.nodeName?(M.current.style.display="flex",M.current.style.width=t.target.clientWidth+"px",M.current.style.height=t.target.clientHeight+"px",M.current.style.top=t.target.offsetTop+"px",M.current.style.left=t.target.offsetLeft+"px",O.current.src=t.target.getAttribute("src")):M.current.style.display="none")},dangerouslySetInnerHTML:{__html:U}}),u.a.createElement("div",{ref:M,className:ie.a.button},u.a.createElement(n.a,null,u.a.createElement(r.a,{onClick:function(){return(t=new te(O.current)).displayMode="popup",t.addRenderEventListener(function(){var t=Object(s.a)(c.a.mark((function t(e){var i;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return M.current.style.display="none",t.next=3,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e}});case 3:null!=(i=t.sent)&&i.id&&m(O.current.getAttribute("src").replace(_.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.content_type));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),void t.show();var t}},"裁剪"),u.a.createElement(r.a,{onClick:function(){return(t=new Pt(O.current)).settings.displayMode="popup",t.addEventListener("render",function(){var t=Object(s.a)(c.a.mark((function t(e){var i;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(M.current.style.display="none",!O.current){t.next=6;break}return t.next=4,Object(j.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:e.dataUrl}});case 4:null!=(i=t.sent)&&i.id&&m(O.current.getAttribute("src").replace(_.a.API_SERVER,""),"/api/attachments/".concat(null==i?void 0:i.id,"?type=").concat(i.content_type));case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),t.show(),void(window.markerArea=t);var t}},"编辑"))),u.a.createElement("img",{ref:O,src:"https://ali-cdn.educoder.net/images/avatars/PortalImage/170?t=1659681136",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),u.a.createElement(I.a,{close:!0,data:z,hasMask:y,type:null!=z&&z.length?V:"",style:Object(o.a)({},E),onClose:function(){return F("")}}))}},"9VGf":
/*!****************************************!*\
!*** ./src/components/useInterval.tsx ***!
\****************************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var n=i(/*! react */"q1tI");function r(t,e){var i=Object(n.useRef)();Object(n.useEffect)((function(){i.current=t})),Object(n.useEffect)((function(){if(null!==e){var t=setInterval((function(){i.current()}),e);return function(){return clearInterval(t)}}}),[e])}},"9ivq":
/*!********************************************!*\
!*** ./src/pages/HttpStatus/hpccourse.css ***!
\********************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){},Bd2K:
/*!********************************************************!*\
!*** ./node_modules/codemirror/addon/edit/closetag.js ***!
\********************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e,i){!function(t){t.defineOption("autoCloseTags",!1,(function(s,a,l){if(l!=t.Init&&l&&s.removeKeyMap("autoCloseTags"),a){var c={name:"autoCloseTags"};"object"==typeof a&&!1===a.whenClosing||(c["'/'"]=function(e){return function(e){return e.getOption("disableInput")?t.Pass:n(e,!0)}(e)}),"object"==typeof a&&!1===a.whenOpening||(c["'>'"]=function(n){return function(n){if(n.getOption("disableInput"))return t.Pass;for(var s=n.listSelections(),a=[],l=n.getOption("autoCloseTags"),c=0;ch.ch&&(g=g.slice(0,g.length-u.end+h.ch));var b=g.toLowerCase();if(!g||"string"==u.type&&(u.end!=h.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&f.close||u.string.indexOf("/")==h.ch-u.start-1||v&&r(v,b)>-1||o(n,p.mode.xmlCurrentContext&&p.mode.xmlCurrentContext(d)||[],g,h,!0))return t.Pass;var x="object"==typeof l&&l.emptyTags;if(x&&r(x,g)>-1)a[c]={text:"/>",newPos:t.Pos(h.line,h.ch+2)};else{var C=y&&r(y,b)>-1;a[c]={indent:C,text:">"+(C?"\n\n":"")+""+g+">",newPos:C?t.Pos(h.line+1,0):t.Pos(h.line,h.ch+1)}}}var w="object"==typeof l&&l.dontIndentOnAutoClose;for(c=s.length-1;c>=0;c--){var k=a[c];n.replaceRange(k.text,s[c].head,s[c].anchor,"+insert");var S=n.listSelections().slice(0);S[c]={head:k.newPos,anchor:k.newPos},n.setSelections(S),!w&&k.indent&&(n.indentLine(k.newPos.line,null,!0),n.indentLine(k.newPos.line+1,null,!0))}}(n)}),s.addKeyMap(c)}}));var e=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],i=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function n(e,i){for(var n=e.listSelections(),r=[],s=i?"/":"",a=e.getOption("autoCloseTags"),l="object"==typeof a&&a.dontIndentOnSlash,c=0;c"!=e.getLine(h.line).charAt(u.end)&&(f+=">"),r[c]=f}if(e.replaceSelections(r),n=e.listSelections(),!l)for(c=0;c=0&&i[c]==n;c--)++l;for(r=a.to,c=1;c0){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"",i=[],n=0;n=0||(r[i]=t[i]);return r}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(r[i]=t[i])}return r}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function c(t,e){for(var i=0;i>6),e+=String.fromCharCode(128|63&n)):n<55296||n>=57344?(e+=String.fromCharCode(224|n>>12),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|63&n)):(i++,n=65536+((1023&n)<<10|1023&t.charCodeAt(i)),e+=String.fromCharCode(240|n>>18),e+=String.fromCharCode(128|n>>12&63),e+=String.fromCharCode(128|n>>6&63),e+=String.fromCharCode(128|63&n))}return e}var C={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1};function w(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=[];return t.forEach((function(t,n){var r=null;t.forEach((function(o,s){if(!o&&null!==r)return i.push("M".concat(r+e," ").concat(n+e,"h").concat(s-r,"v1H").concat(r+e,"z")),void(r=null);if(s!==t.length-1)o&&null===r&&(r=s);else{if(!o)return;null===r?i.push("M".concat(s+e,",").concat(n+e," h1v1H").concat(s+e,"z")):i.push("M".concat(r+e,",").concat(n+e," h").concat(s+1-r,"v1H").concat(r+e,"z"))}}))})),i.join("")}function k(t,e){return t.slice().map((function(t,i){return i=e.y+e.h?t:t.map((function(t,i){return(i=e.x+e.w)&&t}))}))}function S(t,e){var i=t.imageSettings,n=t.size,r=t.includeMargin;if(null==i)return null;var o=r?4:0,s=e.length+2*o,a=Math.floor(.1*n),l=s/n,c=(i.width||a)*l,h=(i.height||a)*l,u=null==i.x?e.length/2-c/2:i.x*l,p=null==i.y?e.length/2-h/2:i.y*l,d=null;if(i.excavate){var f=Math.floor(u),g=Math.floor(p);d={x:f,y:g,w:Math.ceil(c+u-f),h:Math.ceil(h+p-g)}}return{x:u,y:p,h:h,w:c,excavation:d}}var E=function(){try{(new Path2D).addPath(new Path2D)}catch(t){return!1}return!0}(),L=function(t){function e(){var t,i;l(this,e);for(var n=arguments.length,r=new Array(n),o=0;ot.length)&&(e=t.length);for(var i=0,n=new Array(e);i=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=t[Symbol.iterator]()).next.bind(n)}var n=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){function e(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}t.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:e,changeDefaults:function(e){t.exports.defaults=e}}})),r=(n.defaults,n.getDefaults,n.changeDefaults,/[&<>"']/),o=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(t){return l[t]},h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function u(t){return t.replace(h,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var p=/(^|[^\[])\^/g,d=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,g={},m=/^[^:]+:\/*[^/]*$/,v=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function b(t,e){g[" "+t]||(m.test(t)?g[" "+t]=t+"/":g[" "+t]=x(t,"/",!0));var i=-1===(t=g[" "+t]).indexOf(":");return"//"===e.substring(0,2)?i?e:t.replace(v,"$1")+e:"/"===e.charAt(0)?i?e:t.replace(y,"$1")+e:t+e}function x(t,e,i){var n=t.length;if(0===n)return"";for(var r=0;r=0&&"\\"===i[r];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i.length>e)i.splice(e);else for(;i.length1?{type:"space",raw:e[0]}:{raw:"\n"}},e.code=function(t,e){var i=this.rules.block.code.exec(t);if(i){var n=e[e.length-1];if(n&&"paragraph"===n.type)return{raw:i[0],text:i[0].trimRight()};var r=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:P(r,"\n")}}},e.fences=function(t){var e=this.rules.block.fences.exec(t);if(e){var i=e[0],n=function(t,e){var i=t.match(/^(\s+)(?:```)/);if(null===i)return e;var n=i[1];return e.split("\n").map((function(t){var e=t.match(/^\s+/);return null===e?t:e[0].length>=n.length?t.slice(n.length):t})).join("\n")}(i,e[3]||"");return{type:"code",raw:i,lang:e[2]?e[2].trim():e[2],text:n}}},e.heading=function(t){var e=this.rules.block.heading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[1].length,text:e[2]}},e.nptable=function(t){var e=this.rules.block.nptable.exec(t);if(e){var i={type:"table",header:D(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(i.header.length===i.align.length){var n,r=i.align.length;for(n=0;n ?/gm,"");return{type:"blockquote",raw:e[0],text:i}}},e.list=function(t){var e=this.rules.block.list.exec(t);if(e){for(var i,n,r,o,s,a,l,c=e[0],h=e[2],u=h.length>1,p=")"===h[h.length-1],d={type:"list",raw:c,ordered:u,start:u?+h.slice(0,-1):"",loose:!1,items:[]},f=e[0].match(this.rules.block.item),g=!1,m=f.length,v=0;v1||this.options.smartLists&&r!==h)&&(o=f.slice(v+1).join("\n"),d.raw=d.raw.substring(0,d.raw.length-o.length),v=m-1)),s=g||/\n\n(?!\s*$)/.test(i),v!==m-1&&(g="\n"===i.charAt(i.length-1),s||(s=g)),s&&(d.loose=!0),l=void 0,(a=/^\[[ xX]\] /.test(i))&&(l=" "!==i[1],i=i.replace(/^\[[ xX]\] +/,"")),d.items.push({type:"list_item",raw:c,task:a,checked:l,loose:s,text:i});return d}},e.html=function(t){var e=this.rules.block.html.exec(t);if(e)return{type:this.options.sanitize?"paragraph":"html",raw:e[0],pre:!this.options.sanitizer&&("pre"===e[1]||"script"===e[1]||"style"===e[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):R(e[0]):e[0]}},e.def=function(t){var e=this.rules.block.def.exec(t);if(e)return e[3]&&(e[3]=e[3].substring(1,e[3].length-1)),{tag:e[1].toLowerCase().replace(/\s+/g," "),raw:e[0],href:e[2],title:e[3]}},e.table=function(t){var e=this.rules.block.table.exec(t);if(e){var i={type:"table",header:D(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=e[0];var n,r=i.align.length;for(n=0;n/i.test(n[0])&&(e=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:e,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):R(n[0]):n[0]}},e.link=function(t){var e=this.rules.inline.link.exec(t);if(e){var i=_(e[2],"()");if(i>-1){var n=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,n).trim(),e[3]=""}var r=e[2],o="";if(this.options.pedantic){var s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s?(r=s[1],o=s[3]):o=""}else o=e[3]?e[3].slice(1,-1):"";return B(e,{href:(r=r.trim().replace(/^<([\s\S]*)>$/,"$1"))?r.replace(this.rules.inline._escapes,"$1"):r,title:o?o.replace(this.rules.inline._escapes,"$1"):o},e[0])}},e.reflink=function(t,e){var i;if((i=this.rules.inline.reflink.exec(t))||(i=this.rules.inline.nolink.exec(t))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=e[n.toLowerCase()])||!n.href){var r=i[0].charAt(0);return{type:"text",raw:r,text:r}}return B(i,n,i[0])}},e.strong=function(t,e,i){void 0===i&&(i="");var n=this.rules.inline.strong.start.exec(t);if(n&&(!n[1]||n[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var r,o="**"===n[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(o.lastIndex=0;null!=(n=o.exec(e));)if(r=this.rules.inline.strong.middle.exec(e.slice(0,n.index+3)))return{type:"strong",raw:t.slice(0,r[0].length),text:t.slice(2,r[0].length-2)}}},e.em=function(t,e,i){void 0===i&&(i="");var n=this.rules.inline.em.start.exec(t);if(n&&(!n[1]||n[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){e=e.slice(-1*t.length);var r,o="*"===n[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(o.lastIndex=0;null!=(n=o.exec(e));)if(r=this.rules.inline.em.middle.exec(e.slice(0,n.index+2)))return{type:"em",raw:t.slice(0,r[0].length),text:t.slice(1,r[0].length-1)}}},e.codespan=function(t){var e=this.rules.inline.code.exec(t);if(e){var i=e[2].replace(/\n/g," "),n=/[^ ]/.test(i),r=i.startsWith(" ")&&i.endsWith(" ");return n&&r&&(i=i.substring(1,i.length-1)),i=R(i,!0),{type:"codespan",raw:e[0],text:i}}},e.br=function(t){var e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}},e.del=function(t){var e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[1]}},e.autolink=function(t,e){var i,n,r=this.rules.inline.autolink.exec(t);if(r)return n="@"===r[2]?"mailto:"+(i=R(this.options.mangle?e(r[1]):r[1])):i=R(r[1]),{type:"link",raw:r[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},e.url=function(t,e){var i;if(i=this.rules.inline.url.exec(t)){var n,r;if("@"===i[2])r="mailto:"+(n=R(this.options.mangle?e(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=R(i[0]),r="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}},e.inlineText=function(t,e,i){var n,r=this.rules.inline.text.exec(t);if(r)return n=e?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):R(r[0]):r[0]:R(this.options.smartypants?i(r[0]):r[0]),{type:"text",raw:r[0],text:n}},t}(),j=E,z=k,F=L,H={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:j,table:j,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};H.def=z(H.def).replace("label",H._label).replace("title",H._title).getRegex(),H.bullet=/(?:[*+-]|\d{1,9}[.)])/,H.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,H.item=z(H.item,"gm").replace(/bull/g,H.bullet).getRegex(),H.list=z(H.list).replace(/bull/g,H.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+H.def.source+")").getRegex(),H._tag="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",H._comment=//,H.html=z(H.html,"i").replace("comment",H._comment).replace("tag",H._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),H.paragraph=z(H._paragraph).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.blockquote=z(H.blockquote).replace("paragraph",H.paragraph).getRegex(),H.normal=F({},H),H.gfm=F({},H.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),H.gfm.nptable=z(H.gfm.nptable).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.gfm.table=z(H.gfm.table).replace("hr",H.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",H._tag).getRegex(),H.pedantic=F({},H.normal,{html:z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",H._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:j,paragraph:z(H.normal._paragraph).replace("hr",H.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",H.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var W={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};W.punctuation=z(W.punctuation).replace(/punctuation/g,W._punctuation).getRegex(),W._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",W._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",W.em.start=z(W.em.start).replace(/punctuation/g,W._punctuation).getRegex(),W.em.middle=z(W.em.middle).replace(/punctuation/g,W._punctuation).replace(/overlapSkip/g,W._overlapSkip).getRegex(),W.em.endAst=z(W.em.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.em.endUnd=z(W.em.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.start=z(W.strong.start).replace(/punctuation/g,W._punctuation).getRegex(),W.strong.middle=z(W.strong.middle).replace(/punctuation/g,W._punctuation).replace(/blockSkip/g,W._blockSkip).getRegex(),W.strong.endAst=z(W.strong.endAst,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.strong.endUnd=z(W.strong.endUnd,"g").replace(/punctuation/g,W._punctuation).getRegex(),W.blockSkip=z(W._blockSkip,"g").getRegex(),W.overlapSkip=z(W._overlapSkip,"g").getRegex(),W._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,W._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,W._email=/[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])?)+(?![-_])/,W.autolink=z(W.autolink).replace("scheme",W._scheme).replace("email",W._email).getRegex(),W._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,W.tag=z(W.tag).replace("comment",H._comment).replace("attribute",W._attribute).getRegex(),W._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,W._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,W._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,W.link=z(W.link).replace("label",W._label).replace("href",W._href).replace("title",W._title).getRegex(),W.reflink=z(W.reflink).replace("label",W._label).getRegex(),W.reflinkSearch=z(W.reflinkSearch,"g").replace("reflink",W.reflink).replace("nolink",W.nolink).getRegex(),W.normal=F({},W),W.pedantic=F({},W.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:z(/^!?\[(label)\]\((.*?)\)/).replace("label",W._label).getRegex(),reflink:z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W._label).getRegex()}),W.gfm=F({},W.normal,{escape:z(W.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+=""+i+";";return n}var X=function(){function e(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||G,this.options.tokenizer=this.options.tokenizer||new I,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var e={block:U.normal,inline:q.normal};this.options.pedantic?(e.block=U.pedantic,e.inline=q.pedantic):this.options.gfm&&(e.block=U.gfm,this.options.breaks?e.inline=q.breaks:e.inline=q.gfm),this.tokenizer.rules=e}e.lex=function(t,i){return new e(i).lex(t)};var i,n,r,o=e.prototype;return o.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(t,this.tokens,!0),this.inline(this.tokens),this.tokens},o.blockTokens=function(t,e,i){var n,r,o,s;for(void 0===e&&(e=[]),void 0===i&&(i=!0),t=t.replace(/^ +$/gm,"");t;)if(n=this.tokenizer.space(t))t=t.substring(n.raw.length),n.type&&e.push(n);else if(n=this.tokenizer.code(t,e))t=t.substring(n.raw.length),n.type?e.push(n):((s=e[e.length-1]).raw+="\n"+n.raw,s.text+="\n"+n.text);else if(n=this.tokenizer.fences(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.heading(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.nptable(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.hr(t))t=t.substring(n.raw.length),e.push(n);else if(n=this.tokenizer.blockquote(t))t=t.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),e.push(n);else if(n=this.tokenizer.list(t)){for(t=t.substring(n.raw.length),o=n.items.length,r=0;r0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(a));)l.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;t;)if(o=this.tokenizer.escape(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.tag(t,i,n))t=t.substring(o.raw.length),i=o.inLink,n=o.inRawBlock,e.push(o);else if(o=this.tokenizer.link(t))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,n)),e.push(o);else if(o=this.tokenizer.reflink(t,this.tokens.links))t=t.substring(o.raw.length),"link"===o.type&&(o.tokens=this.inlineTokens(o.text,[],!0,n)),e.push(o);else if(o=this.tokenizer.strong(t,a,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),e.push(o);else if(o=this.tokenizer.em(t,a,r))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),e.push(o);else if(o=this.tokenizer.codespan(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.br(t))t=t.substring(o.raw.length),e.push(o);else if(o=this.tokenizer.del(t))t=t.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),e.push(o);else if(o=this.tokenizer.autolink(t,K))t=t.substring(o.raw.length),e.push(o);else if(i||!(o=this.tokenizer.url(t,K))){if(o=this.tokenizer.inlineText(t,n,$))t=t.substring(o.raw.length),r=o.raw.slice(-1),e.push(o);else if(t){var c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else t=t.substring(o.raw.length),e.push(o);return e},i=e,r=[{key:"rules",get:function(){return{block:U,inline:q}}}],(n=null)&&t(i.prototype,n),r&&t(i,r),e}(),Y=n.defaults,Z=S,J=C,Q=function(){function t(t){this.options=t||Y}var e=t.prototype;return e.code=function(t,e,i){var n=(e||"").match(/\S*/)[0];if(this.options.highlight){var r=this.options.highlight(t,n);null!=r&&r!==t&&(i=!0,t=r)}return n?''+(i?t:J(t,!0))+"
\n":""+(i?t:J(t,!0))+"
\n"},e.blockquote=function(t){return"\n"+t+"
\n"},e.html=function(t){return t},e.heading=function(t,e,i,n){return this.options.headerIds?"\n":""+t+"\n"},e.hr=function(){return this.options.xhtml?"
\n":"
\n"},e.list=function(t,e,i){var n=e?"ol":"ul";return"<"+n+(e&&1!==i?' start="'+i+'"':"")+">\n"+t+""+n+">\n"},e.listitem=function(t){return""+t+"\n"},e.checkbox=function(t){return" "},e.paragraph=function(t){return""+t+"
\n"},e.table=function(t,e){return e&&(e=""+e+""),"\n"},e.tablerow=function(t){return"\n"+t+"
\n"},e.tablecell=function(t,e){var i=e.header?"th":"td";return(e.align?"<"+i+' align="'+e.align+'">':"<"+i+">")+t+""+i+">\n"},e.strong=function(t){return""+t+""},e.em=function(t){return""+t+""},e.codespan=function(t){return""+t+""},e.br=function(){return this.options.xhtml?"
":"
"},e.del=function(t){return""+t+""},e.link=function(t,e,i){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return i;var n='"+i+""},e.image=function(t,e,i){if(null===(t=Z(this.options.sanitize,this.options.baseUrl,t)))return i;var n='
":">"},e.text=function(t){return t},t}(),tt=function(){function t(){}var e=t.prototype;return e.strong=function(t){return t},e.em=function(t){return t},e.codespan=function(t){return t},e.del=function(t){return t},e.html=function(t){return t},e.text=function(t){return t},e.link=function(t,e,i){return""+i},e.image=function(t,e,i){return""+i},e.br=function(){return""},t}(),et=function(){function t(){this.seen={}}return t.prototype.slug=function(t){var e=t.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(e)){var i=e;do{this.seen[i]++,e=i+"-"+this.seen[i]}while(this.seen.hasOwnProperty(e))}return this.seen[e]=0,e},t}(),it=n.defaults,nt=w,rt=function(){function t(t){this.options=t||it,this.options.renderer=this.options.renderer||new Q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new tt,this.slugger=new et}t.parse=function(e,i){return new t(i).parse(e)};var e=t.prototype;return e.parse=function(t,e){void 0===e&&(e=!0);var i,n,r,o,s,a,l,c,h,u,p,d,f,g,m,v,y,b,x="",C=t.length;for(i=0;i0&&"text"===m.tokens[0].type?(m.tokens[0].text=b+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=b+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:b}):g+=b),g+=this.parse(m.tokens,f),h+=this.renderer.listitem(g,y,v);x+=this.renderer.list(h,p,d);continue;case"html":x+=this.renderer.html(u.text);continue;case"paragraph":x+=this.renderer.paragraph(this.parseInline(u.tokens));continue;case"text":for(h=u.tokens?this.parseInline(u.tokens):u.text;i+1An error occurred:"+at(t.message+"",!0)+"
";throw t}}return ut.options=ut.setOptions=function(t){return ot(ut.defaults,t),ct(ut.defaults),ut},ut.getDefaults=lt,ut.defaults=ht,ut.use=function(t){var e=ot({},t);if(t.renderer&&function(){var i=ut.defaults.renderer||new Q,n=function(e){var n=i[e];i[e]=function(){for(var r=arguments.length,o=new Array(r),s=0;s",triples:"",explode:"[]{}"},i=t.Pos;function n(t,i){return"pairs"==i&&"string"==typeof t?t:"object"==typeof t&&null!=t[i]?t[i]:e[i]}t.defineOption("autoCloseBrackets",!1,(function(e,i,s){s&&s!=t.Init&&(e.removeKeyMap(r),e.state.closeBrackets=null),i&&(o(n(i,"pairs")),e.state.closeBrackets=i,e.addKeyMap(r))}));var r={Backspace:function(e){var r=a(e);if(!r||e.getOption("disableInput"))return t.Pass;for(var o=n(r,"pairs"),s=e.listSelections(),c=0;c=0;c--){var u=s[c].head;e.replaceRange("",i(u.line,u.ch-1),i(u.line,u.ch+1),"+delete")}},Enter:function(e){var i=a(e),r=i&&n(i,"explode");if(!r||e.getOption("disableInput"))return t.Pass;for(var o=e.listSelections(),s=0;s1&&p.indexOf(r)>=0&&e.getRange(i(b.line,b.ch-2),b)==r+r){if(b.ch>2&&/\bstring/.test(e.getTokenTypeAt(i(b.line,b.ch-2))))return t.Pass;v="addFour"}else if(d){var C=0==b.ch?" ":e.getRange(i(b.line,b.ch-1),b);if(t.isWordChar(x)||C==r||t.isWordChar(C))return t.Pass;v="both"}else{if(!g||!(0===x.length||/\s/.test(x)||u.indexOf(x)>-1))return t.Pass;v="both"}else v=d&&c(e,b)?"both":p.indexOf(r)>=0&&e.getRange(b,i(b.line,b.ch+3))==r+r+r?"skipThree":"skip";if(h){if(h!=v)return t.Pass}else h=v}var w=l%2?s.charAt(l-1):r,k=l%2?r:s.charAt(l+1);e.operation((function(){if("skip"==h)e.execCommand("goCharRight");else if("skipThree"==h)for(var n=0;n<3;n++)e.execCommand("goCharRight");else if("surround"==h){var r=e.getSelections();for(n=0;n0,{anchor:new i(o.anchor.line,o.anchor.ch+(s?-1:1)),head:new i(o.head.line,o.head.ch+(s?1:-1))});e.setSelections(r)}else"both"==h?(e.replaceSelection(w+k,null),e.triggerElectric(w+k),e.execCommand("goCharLeft")):"addFour"==h&&(e.replaceSelection(w+w+w+w,"before"),e.execCommand("goCharRight"));var o,s}))}(r,e)}}function a(t){var e=t.state.closeBrackets;return!e||e.override?e:t.getModeAt(t.getCursor()).closeBrackets||e}function l(t,e){var n=t.getRange(i(e.line,e.ch-1),i(e.line,e.ch+1));return 2==n.length?n:null}function c(t,e){var n=t.getTokenAt(i(e.line,e.ch+1));return/\bstring/.test(n.type)&&n.start==e.ch&&(0==e.ch||!/\bstring/.test(t.getTokenTypeAt(e)))}o(e.pairs+"`")}(i(/*! ../../lib/codemirror */"VrN/"))},GfqC:
/*!********************************************************!*\
!*** ./node_modules/rc-upload/es/index.js + 6 modules ***!
\********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/classnames/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,i){"use strict";var n=i("q1tI"),r=i.n(n),o=i("TSYQ"),s=i.n(o);function a(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(t){return e}}function l(t){var e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),t.onProgress(e)});var i=new FormData;t.data&&Object.keys(t.data).forEach((function(e){var n=t.data[e];Array.isArray(n)?n.forEach((function(t){i.append(e+"[]",t)})):i.append(e,t.data[e])})),t.file instanceof Blob?i.append(t.filename,t.file,t.file.name):i.append(t.filename,t.file),e.onerror=function(e){t.onError(e)},e.onload=function(){return e.status<200||e.status>=300?t.onError(function(t,e){var i="cannot "+t.method+" "+t.action+" "+e.status+"'",n=new Error(i);return n.status=e.status,n.method=t.method,n.url=t.action,n}(t,e),a(e)):t.onSuccess(a(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var n=t.headers||{};return null!==n["X-Requested-With"]&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach((function(t){null!==n[t]&&e.setRequestHeader(t,n[t])})),e.send(i),{abort:function(){e.abort()}}}var c=+new Date,h=0;function u(){return"rc-upload-"+c+"-"+ ++h}var p=function(t,e){if(t&&e){var i=Array.isArray(e)?e:e.split(","),n=t.name||"",r=t.type||"",o=r.replace(/\/.*$/,"");return i.some((function(t){var e,i,s=t.trim();return"."===s.charAt(0)?(e=n.toLowerCase(),i=s.toLowerCase(),-1!==e.indexOf(i,e.length-i.length)):/\/\*$/.test(s)?o===s.replace(/\/.*$/,""):r===s}))}return!0};var d=function(t,e,i){var n=function t(n,r){r=r||"",n.isFile?n.file((function(t){i(t)&&(n.fullPath&&!t.webkitRelativePath&&(Object.defineProperties(t,{webkitRelativePath:{writable:!0}}),t.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(t,{webkitRelativePath:{writable:!1}})),e([t]))})):n.isDirectory&&function(t,e){var i=t.createReader(),n=[];!function t(){i.readEntries((function(i){var r=Array.prototype.slice.apply(i);n=n.concat(r),!r.length?e(n):t()}))}()}(n,(function(e){e.forEach((function(e){t(e,""+r+n.name+"/")}))}))};t.forEach((function(t){n(t.webkitGetAsEntry())}))},f=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i}(i,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),C=s()((v(t={},o,!0),v(t,o+"-disabled",l),v(t,a,a),t)),w=l?{}:{onClick:m?this.onClick:function(){},onKeyDown:m?this.onKeyDown:function(){},onMouseEnter:y,onMouseLeave:b,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return r.a.createElement(n,f({},w,{className:C,role:"button",style:h}),r.a.createElement("input",f({},(e=x,Object.keys(e).reduce((function(t,i){return"data-"!==i.substr(0,5)&&"aria-"!==i.substr(0,5)&&"role"!==i||(t[i]=e[i]),t}),{})),{id:c,type:"file",ref:this.saveFileInput,onClick:function(t){return t.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:p,directory:g?"directory":null,webkitdirectory:g?"webkitdirectory":null,multiple:u,onChange:this.onChange})),d)}}]),e}(n.Component),C=Object.assign||function(t){for(var e=1;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=l.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},c.setupPositionProbePattern=function(t,e){for(var i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+i][e+n]=0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4)},c.getBestMaskPattern=function(){for(var t=0,e=0,i=0;i<8;i++){this.makeImpl(!0,i);var n=s.getLostPoint(this);(0==i||t>n)&&(t=n,e=i)}return e},c.createMovieClip=function(t,e,i){var n=t.createEmptyMovieClip(e,i);this.make();for(var r=0;r>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(i=0;i<18;i++){n=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}},c.setupTypeInfo=function(t,e){for(var i=this.errorCorrectLevel<<3|e,n=s.getBCHTypeInfo(i),r=0;r<15;r++){var o=!t&&1==(n>>r&1);r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(r=0;r<15;r++){o=!t&&1==(n>>r&1);r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t},c.mapData=function(t,e){for(var i=-1,n=this.moduleCount-1,r=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var l=0;l<2;l++)if(null==this.modules[n][a-l]){var c=!1;o>>r&1)),s.getMask(e,n,a-l)&&(c=!c),this.modules[n][a-l]=c,-1==--r&&(o++,r=7)}if((n+=i)<0||this.moduleCount<=n){n-=i,i=-i;break}}},l.PAD0=236,l.PAD1=17,l.createData=function(t,e,i){for(var n=r.getRSBlocks(t,e),a=new o,c=0;c8*u)throw new Error("code length overflow. ("+a.getLengthInBits()+">"+8*u+")");for(a.getLengthInBits()+4<=8*u&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(!1);for(;!(a.getLengthInBits()>=8*u||(a.put(l.PAD0,8),a.getLengthInBits()>=8*u));)a.put(l.PAD1,8);return l.createBytes(a,n)},l.createBytes=function(t,e){for(var i=0,n=0,r=0,o=new Array(e.length),l=new Array(e.length),c=0;c=0?f.get(g):0}}var m=0;for(p=0;p=0;)e^=f.G15<=0;)e^=f.G18<>>=1;return e},getPatternPosition:function(t){return f.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,i){switch(t){case s:return(e+i)%2==0;case a:return e%2==0;case l:return i%3==0;case c:return(e+i)%3==0;case h:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case u:return e*i%2+e*i%3==0;case p:return(e*i%2+e*i%3)%2==0;case d:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new r([1],0),i=0;i5&&(i+=3+o-5)}for(n=0;n1&&void 0!==arguments[1]?arguments[1]:1,i=P.length,n=0;n1&&void 0!==arguments[1]&&arguments[1];return Object(E.a)(t).map((function(t,i){if(!a.isValidElement(t)||!t.type)return null;var n=t.type.isSelectOptGroup,r=t.key,o=t.props,s=o.children,l=Object(c.a)(o,["children"]);return e||!n?L(t):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(null===r?i:r,"__"),label:r},l),{},{options:T(s)})})).filter((function(t){return t}))}var A=i("2Qr1"),M=i("qNPg"),O=i("U8pU"),N=i("Kwbf"),P=i("WKfj");var D=function(t){var e=t.mode,i=t.options,n=t.children,r=t.backfill,o=t.allowClear,s=t.placeholder,l=t.getInputElement,c=t.showSearch,h=t.onSearch,u=t.defaultOpen,p=t.autoFocus,d=t.labelInValue,f=t.value,g=t.inputValue,m=t.optionLabelProp,v="multiple"===e||"tags"===e,y=void 0!==c?c:v||"combobox"===e,b=i||T(n);if(Object(N.a)("tags"!==e||b.every((function(t){return!t.disabled})),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),"tags"===e||"combobox"===e){var x=b.some((function(t){return t.options?t.options.some((function(t){return"number"==typeof("value"in t?t.value:t.key)})):"number"==typeof("value"in t?t.value:t.key)}));Object(N.a)(!x,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(N.a)("combobox"!==e||!m,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(N.a)("combobox"===e||!r,"`backfill` only works with `combobox` mode."),Object(N.a)("combobox"===e||!l,"`getInputElement` only work with `combobox` mode."),Object(N.b)("combobox"!==e||!l||!o||!s,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),h&&!y&&"combobox"!==e&&"tags"!==e&&Object(N.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(N.b)(!u||p,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),null!=f){var C=Object(P.d)(f);Object(N.a)(!d||C.every((function(t){return"object"===Object(O.a)(t)&&("key"in t||"value"in t)})),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(N.a)(!v||Array.isArray(f),"`value` should be array when `mode` is `multiple` or `tags`")}if(n){var w=null;Object(E.a)(n).some((function(t){if(!a.isValidElement(t)||!t.type)return!1;var e=t.type;return!e.isSelectOption&&(e.isSelectOptGroup?!Object(E.a)(t.props.children).every((function(e){return!(a.isValidElement(e)&&t.type&&!e.type.isSelectOption)||(w=e.type,!1)})):(w=e,!0))})),w&&Object(N.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(w.displayName||w.name||w,"`.")),Object(N.a)(void 0===g,"`inputValue` is deprecated, please use `searchValue` instead.")}},R=Object(M.a)({prefixCls:"rc-select",components:{optionList:b},convertChildrenToData:T,flattenOptions:A.d,getLabeledValue:A.e,filterOptions:A.b,isValueDisabled:A.g,findValueOption:A.c,warningProps:D,fillOptionsWithMissingValue:A.a}),_=function(t){Object(o.a)(i,t);var e=Object(s.a)(i);function i(){var t;return Object(n.a)(this,i),(t=e.apply(this,arguments)).selectRef=a.createRef(),t.focus=function(){t.selectRef.current.focus()},t.blur=function(){t.selectRef.current.blur()},t}return Object(r.a)(i,[{key:"render",value:function(){return a.createElement(R,Object.assign({ref:this.selectRef},this.props))}}]),i}(a.Component);_.Option=C,_.OptGroup=k;var B=_;e.c=B},M8RZ:
/*!**********************************!*\
!*** ./src/components/modal.tsx ***!
\**********************************/
/*! exports provided: default */
/*! exports used: default */function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var n=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/classCallCheck */"fWQN"),r=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createClass */"mtLc"),o=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/inherits */"yKVA"),s=i(/*! ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createSuper */"879j"),a=i(/*! react */"q1tI"),l=i.n(a),c=i(/*! react-dom */"i8i4"),h=function(t){Object(o.a)(i,t);var e=Object(s.a)(i);function i(t){var r;Object(n.a)(this,i),r=e.call(this,t);var o=window.document;return r.node=o.createElement("div"),o.body.appendChild(r.node),r}return Object(r.a)(i,[{key:"render",value:function(){var t=this.props.children;return Object(c.createPortal)(t,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),i}(l.a.Component)},OLES:
/*!*********************************************************!*\
!*** ./node_modules/rc-tooltip/es/index.js + 2 modules ***!
\*********************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@babel/runtime/helpers/esm/typeof.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-tooltip/es/placements.js because of ./node_modules/antd/es/tooltip/placements.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/rc-trigger/es/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */function(t,e,i){"use strict";var n=i("U8pU"),r=i("VTBJ"),o=i("Ff2n"),s=i("q1tI"),a=i("uciX"),l=i("7ixt"),c=function(t){var e=t.overlay,i=t.prefixCls,n=t.id,r=t.overlayInnerStyle;return s.createElement("div",{className:"".concat(i,"-inner"),id:n,role:"tooltip",style:r},"function"==typeof e?e():e)},h=Object(s.forwardRef)((function(t,e){var i=t.overlayClassName,h=t.trigger,u=void 0===h?["hover"]:h,p=t.mouseEnterDelay,d=void 0===p?0:p,f=t.mouseLeaveDelay,g=void 0===f?.1:f,m=t.overlayStyle,v=t.prefixCls,y=void 0===v?"rc-tooltip":v,b=t.children,x=t.onVisibleChange,C=t.afterVisibleChange,w=t.transitionName,k=t.animation,S=t.placement,E=void 0===S?"right":S,L=t.align,T=void 0===L?{}:L,A=t.destroyTooltipOnHide,M=void 0!==A&&A,O=t.defaultVisible,N=t.getTooltipContainer,P=t.overlayInnerStyle,D=Object(o.a)(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle"]),R=Object(s.useRef)(null);Object(s.useImperativeHandle)(e,(function(){return R.current}));var _=Object(r.a)({},D);"visible"in t&&(_.popupVisible=t.visible);var B=!1,I=!1;if("boolean"==typeof M)B=M;else if(M&&"object"===Object(n.a)(M)){var j=M.keepParent;B=!0===j,I=!1===j}return s.createElement(a.a,Object.assign({popupClassName:i,prefixCls:y,popup:function(){var e=t.arrowContent,i=void 0===e?null:e,n=t.overlay,r=t.id;return[s.createElement("div",{className:"".concat(y,"-arrow"),key:"arrow"},i),s.createElement(c,{key:"content",prefixCls:y,id:r,overlay:n,overlayInnerStyle:P})]},action:u,builtinPlacements:l.a,popupPlacement:E,ref:R,popupAlign:T,getPopupContainer:N,onPopupVisibleChange:x,afterPopupVisibleChange:C,popupTransitionName:w,popupAnimation:k,defaultPopupVisible:O,destroyPopupOnHide:B,autoDestroy:I,mouseLeaveDelay:g,popupStyle:m,mouseEnterDelay:d},_),b)}));e.a=h},Ot1p:
/*!**************************************************************!*\
!*** ./src/components/markdown-editor/index.tsx + 6 modules ***!
\**************************************************************/
/*! exports provided: default */
/*! exports used: default */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/createForOfIteratorHelper.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/defineProperty.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/extends.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/objectSpread2.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/helpers/esm/slicedToArray.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/@umijs/babel-preset-umi/node_modules/@babel/runtime/regenerator/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/RenderHtml/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/markdown-editor/code-block/index.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/modal.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/components/useInterval.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/pages/tasks/util.js because of ./src/pages/tasks/index.jsx */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/env.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/fetch.ts */
/*! ModuleConcatenation bailout: Cannot concat with ./src/utils/util.tsx */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/button/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/form/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input-number/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/input/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/message/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/modal/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/popover/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/antd/es/radio/style/index.js */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/codemirror/lib/codemirror.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/qrcode.react/lib/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/react/index.js (<- Module is not an ECMAScript module) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/resize-observer-polyfill/dist/ResizeObserver.es.js (<- Module uses injected variables (global)) */
/*! ModuleConcatenation bailout: Cannot concat with ./node_modules/uuid/dist/esm-browser/v4.js */function(t,e,i){"use strict";i("2qtc");var n=i("kLXV"),r=i("rAM+"),o=(i("miYZ"),i("tsqr")),s=i("9og8"),a=i("tJVT"),l=i("jrin"),c=i("WmNS"),h=i.n(c),u=i("q1tI"),p=i.n(u),d=i("VrN/"),f=i.n(d),g=i("bdgK"),m=(i("p77/"),i("Bd2K"),i("ELLl"),i("19Vz"),i("lZu9"),i("+NIl"),i("kSUc"),i("9Bee")),v=function(t){var e=t.value,i=void 0===e?"":e,n=(t.className,t.showTextOnly,t.showLines,t.style,Object(u.useMemo)((function(){return""}),[i]));return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:n}}))},y=(i("Q9mQ"),i("diRs")),b=i("0Owb"),x=(i("dejd"),i("C+DQ"),i("D1Df")),C=i.n(x),w=i("1vsH"),k=i("m3rI"),S=[{title:"粗体",icon:"icon-bold",actionName:"bold"},{title:"斜体",icon:"icon-italic",actionName:"italic"},"|",{title:"无序列表",icon:"icon-unorder-list",actionName:"list-ul"},{title:"有序列表",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"行内代码",icon:"icon-code",actionName:"code"},{title:"代码块(多语言风格)",icon:"icon-file-code",actionName:"code-block"},{title:"链接",icon:"icon-link",actionName:"link"},"|",{title:"行内公式",icon:"icon-sum",actionName:"inline-latex"},{title:"多行公式",icon:"icon-formula",actionName:"latex"},"|",{title:"添加图片",icon:"icon-picture",actionName:"upload-image"},{title:"表格",icon:"icon-table",actionName:"add-table"},"|",{title:"换行",icon:"icon-minus",actionName:"line-break"},{title:"清空",icon:"icon-eraser",actionName:"eraser"}];function E(t){var e=t.onActionCallback,i=t.title,n=t.icon,r=t.actionName,o=t.className,s=void 0===o?"":o,a=t.children;return p.a.createElement("a",{title:i,className:s,onClick:function(){e(r)}},p.a.createElement("i",{className:"md-iconfont ".concat(n)}),a)}var L=function(t){var e=t.watch,i=t.showNullButton,n=t.onActionCallback,r=t.fullScreen,o=t.insertTemp,s=t.hidetoolBar,a=t.uuid,l=t.setOpenPhones,c=Object(w.E)("_educoder_session_login"),h=Object(w.E)("_educoder_session"),u=[].concat(S,[{title:"".concat(e?"关闭实时预览":"开启实时预览"),icon:"".concat(e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!s&&u.map((function(t,e){return p.a.createElement("li",{key:e},t.actionName?p.a.createElement(E,Object(b.a)({},t,{onActionCallback:n})):p.a.createElement("span",{className:"v-line"}))})),i?p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"增加填空",actionName:"add-null-ch",onActionCallback:n},p.a.createElement("span",{className:"fill-tip"},"点击插入\b填空项"))):null,o&&p.a.createElement("li",null,p.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"插入模板",actionName:"inster-template-".concat(o),onActionCallback:n},p.a.createElement("span",{className:"fill-tip"},"插入模板"))),p.a.createElement("li",null,p.a.createElement(y.a,{title:"打开手机扫一扫",content:p.a.createElement("div",null,p.a.createElement("span",{style:{display:"none"}},"test----",location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+h+"&key="+a+"&api="+encodeURIComponent(k.a.API_SERVER)),p.a.createElement(C.a,{size:150,fgColor:"#000",value:location.origin+"/upload.html?_educoder_session_login="+c+"&_educoder_session="+h+"&key="+a+"&api="+encodeURIComponent(k.a.API_SERVER)}))},p.a.createElement("span",{className:"fill-tip",onMouseOver:function(){return l(!0)}},"手机上传文件"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(E,{icon:"".concat(r?"icon-shrink":"icon-enlarge"),title:r?"关闭全屏":"开启全屏",actionName:"trigger-full-screen",onActionCallback:n})))},T=i("M8RZ"),A=(i("+L6B"),i("2/Rp")),M=(i("y8nQ"),i("Vl3Y")),O=(i("5NDa"),i("5rEg")),N={labelCol:{span:4},wrapperCol:{span:20}},P=function(t){var e=t.callback,i=t.onCancel;return p.a.createElement(M.a,Object(b.a)({},N,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:function(t){e(t)}}),p.a.createElement(M.a.Item,{label:"链接地址",name:"link",rules:[{required:!0,message:"请输入链接地址"}]},p.a.createElement(O.a,null)),p.a.createElement(M.a.Item,{label:"链接标题",name:"title",rules:[{required:!0,message:"请输入链接标题"}]},p.a.createElement(O.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),p.a.createElement(A.a,{type:"ghost",onClick:i},"取消")))},D=i("7ahc"),R=i("k1fw"),_=(i("HmJG"),i("BjJ7")),B=M.a.useForm,I={width:280,marginRight:10},j={labelCol:{span:5},wrapperCol:{span:19}},z=function(t){var e=t.callback,i=t.onCancel,n=B(),r=Object(a.a)(n,1)[0],o=Object(u.useRef)();function s(t,e){r.setFieldsValue({src:"/api/attachments/".concat(t.id,"?type=").concat(t.content_type),type:e.type})}return p.a.createElement(M.a,Object(b.a)({form:r},j,{className:"upload-image-panel",onFinish:function(t){e(Object(R.a)(Object(R.a)({},t),{},{name:o.current}))}}),p.a.createElement(M.a.Item,{label:"文件地址",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(M.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"请输入文件地址"}]},p.a.createElement(O.a,{style:I})),p.a.createElement(F,{onFileChange:function(t){var e=t.target.files[0];o.current=e.name,H(e,s)}}))),p.a.createElement(M.a.Item,{label:"文件描述",name:"alt"},p.a.createElement(O.a,{style:{width:264}})),p.a.createElement(M.a.Item,{style:{textAlign:"right"}},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),p.a.createElement(A.a,{type:"ghost",onClick:i},"取消")))};function F(t){var e=t.onFileChange;return p.a.createElement("a",{className:"upload-button"},"本地上传",p.a.createElement("input",{type:"file",onChange:e}))}function H(t,e){if(!t)throw new String("没有文件");var i=new FormData;i.append("editormd-image-file",t),i.append("file_param_name","editormd-image-file"),i.append("byxhr","true");var n=new window.XMLHttpRequest;n.withCredentials=!0,n.addEventListener("load",(function(i){e(JSON.parse(i.target.responseText),t)}),!1),n.addEventListener("error",(function(t){console.error(t)}),!1),n.open("POST","".concat(_.a,"/api/attachments.json")),n.send(i)}i("giR+");var W,V,G=i("fyUT"),U=(i("7Kak"),i("9yH6")),q=U.a.Group,$={margin:"0 8px"},K=function(t){var e=t.callback,i=t.onCancel;return p.a.createElement(M.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:function(t){e(t)}},p.a.createElement("div",{className:"flex-container"},p.a.createElement("span",{style:$},"单元格数:"),p.a.createElement("span",{style:$},"行数"),p.a.createElement(M.a.Item,{name:"row",rules:[{required:!0,message:"请输入行数"}]},p.a.createElement(G.a,null)),p.a.createElement("span",{style:$},"列数"),p.a.createElement(M.a.Item,{name:"col",rules:[{required:!0,message:"请输入列数"}]},p.a.createElement(G.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12}},p.a.createElement("span",{style:$},"对齐方式:"),p.a.createElement(M.a.Item,{name:"align"},p.a.createElement(q,null,p.a.createElement(U.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(U.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(U.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(U.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(A.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"确定"),p.a.createElement(A.a,{type:"ghost",onClick:i},"取消")))},X=i("ErOA"),Y=i("7Cbv"),Z="------------",J={default:Z,left:":".concat(Z),center:":".concat(Z,":"),right:"".concat(Z,":")},Q=i("9VGf");function tt(t){return/^\d+$/.test(t)?"".concat(t,"px"):t}var et=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",it=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],nt=(W={},Object(l.a)(W,et+"-B","bold"),Object(l.a)(W,et+"-I","italic"),W),rt=(V={},Object(l.a)(V,"link","添加链接"),Object(l.a)(V,"code-block","添加代码块"),Object(l.a)(V,"upload-image","添加文件"),Object(l.a)(V,"add-table","添加表格"),V);e.a=function(t){var e=t.defaultValue,i=void 0===e?"":e,c=t.onChange,d=t.width,y=void 0===d?"100%":d,b=t.height,x=void 0===b?400:b,C=t.miniToolbar,w=void 0!==C&&C,S=t.isFocus,E=void 0!==S&&S,A=t.watch,M=t.insertTemp,O=t.mode,N=void 0===O?"markdown":O,R=t.id,_=void 0===R?"markdown-editor-id":R,B=t.showResizeBar,I=void 0!==B&&B,j=t.noStorage,F=void 0!==j&&j,W=t.showNullButton,V=void 0!==W&&W,G=t.hidetoolBar,U=void 0!==G&&G,q=t.fullScreen,$=void 0!==q&&q,Z=t.onBlur,et=t.onCMBeforeChange,ot=t.onFullScreen,st=t.className,at=void 0===st?"":st,lt=t.disablePaste,ct=void 0!==lt&<,ht=t.placeholder,ut=void 0===ht?"":ht,pt=t.values,dt=void 0===pt?"":pt,ft=Object(u.useState)(null),gt=Object(a.a)(ft,2),mt=gt[0],vt=gt[1],yt=Object(u.useState)(i),bt=Object(a.a)(yt,2),xt=bt[0],Ct=bt[1],wt=Object(u.useState)(A),kt=Object(a.a)(wt,2),St=kt[0],Et=kt[1],Lt=Object(u.useState)($),Tt=Object(a.a)(Lt,2),At=Tt[0],Mt=Tt[1],Ot=Object(u.useState)(""),Nt=Object(a.a)(Ot,2),Pt=Nt[0],Dt=Nt[1],Rt=Object(u.useState)(0),_t=Object(a.a)(Rt,2),Bt=_t[0],It=_t[1],jt=Object(u.useState)(x),zt=Object(a.a)(jt,2),Ft=zt[0],Ht=zt[1],Wt=Object(u.useState)(!1),Vt=Object(a.a)(Wt,2),Gt=(Vt[0],Vt[1]),Ut=Object(u.useRef)(Object(Y.a)()),qt=Object(u.useRef)(!1),$t=Object(u.useRef)(),Kt=Object(u.useRef)(),Xt=Object(u.useRef)(),Yt=Object(u.useRef)(),Zt=Object(u.useRef)(),Jt=function(){var t=Object(s.a)(h.a.mark((function t(){var e,i;return h.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Object(X.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:Ut.current}});case 2:null!=(i=t.sent)&&null!==(e=i.attachments)&&void 0!==e&&e.length&&(console.log("cm:",mt,Kt),i.attachments.map((function(t){t.content_type.indexOf("image")>-1?mt.replaceSelection(".concat(t.content_type,")")):t.content_type.indexOf("video")>-1?mt.replaceSelection('')):t.content_type.indexOf("pdf")>-1?mt.replaceSelection('').concat(t.name,"")):mt.replaceSelection("[".concat(t.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(t.id,"?type=").concat(t.content_type,")"))})));case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();Object(u.useEffect)((function(){Ct(dt),null==mt||mt.setValue(dt)}),[dt]),Object(u.useEffect)((function(){null==ot||ot(At)}),[At]),Object(u.useEffect)((function(){if(Kt.current){var t=f.a.fromTextArea(Kt.current,{mode:N,lineNumbers:!w,lineWrapping:!0,value:i,autoCloseTags:!0,autoCloseBrackets:!0});function e(e,i){if(!ct){var n=i.clipboardData;if(n){var r=n.types.toString(),s=n.items;if("Files"===r||n.types.indexOf("Files")>-1){if(i.preventDefault(),"stex"==N)return;try{var a,l=s[1];"file"===(null===(a=s[0])||void 0===a?void 0:a.kind)&&(l=s[0]);var c=l.getAsFile(),h=c.name.split(".").pop();H(c,(function(e){var i,n,r;e.id?(null==c||null===(i=c.type)||void 0===i?void 0:i.indexOf("image"))>-1?t.replaceSelection(".concat(e.content_type,")")):(null==c||null===(n=c.type)||void 0===n?void 0:n.indexOf("video"))>-1?t.replaceSelection('')):(null==c||null===(r=c.type)||void 0===r?void 0:r.indexOf("pdf"))>-1?t.replaceSelection('').concat(c.name,"")):it.includes(h)?t.replaceSelection('').concat(c.name,"")):t.replaceSelection("[".concat(c.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))}catch(i){o.b.warn("请使用chrome浏览器粘贴")}return!0}return!0}return!0}i.preventDefault()}return E&&t.focus(),t.on("paste",e),t.on("dragleave",(function(t,e){Xt.current.classList.remove("mouse-hover-md")})),t.on("dragover",(function(t,e){Xt.current.classList.add("mouse-hover-md")})),t.on("drop",(function(e,i){var n;if(Xt.current.classList.add("mouse-hover-md"),(n=i.dataTransfer.files).length>0){i.preventDefault(),i.stopPropagation();for(var r=function(e){var i=n[e],r=i.name.split(".").pop();H(i,(function(e){var n,o,s;e.id?(null==i||null===(n=i.type)||void 0===n?void 0:n.indexOf("image"))>-1?t.replaceSelection(".concat(e.content_type,")")):(null==i||null===(o=i.type)||void 0===o?void 0:o.indexOf("video"))>-1?t.replaceSelection('')):(null==i||null===(s=i.type)||void 0===s?void 0:s.indexOf("pdf"))>-1?t.replaceSelection('').concat(i.name,"")):it.includes(r)?t.replaceSelection('').concat(i.name,"")):t.replaceSelection("[".concat(i.name,"](").concat(k.a.API_SERVER,"/api/attachments/").concat(e.id,"?type=").concat(e.content_type,")")):401===(null==e?void 0:e.status)&&(document.location.href="/user/login")}))},o=0;o0||n.target.offsetWidth>0)&&(Qt(),mt.setSize("100%","100%"),mt.refresh())}}catch(t){i.e(t)}finally{i.f()}}));return t.observe(Kt.current.parentElement),t}();return function(){t.unobserve(Kt.current.parentElement)}}}),[mt,Qt]),Object(u.useEffect)((function(){if(mt){for(var t=[],e=function(){var e=n[i],r=(o=Object(a.a)(e,2))[0],s=o[1],c=Object(l.a)({},r,(function(){te(s)}));t.push(c),mt.addKeyMap(c)},i=0,n=Object.entries(nt);i0){var t=(new Date).getTime(),e=window.sessionStorage.getItem(_);t>=Bt+1e4&&(!e||e!==xt)&&(window.sessionStorage.setItem(_,xt),Gt(!0))}}),1e4),Object(u.useEffect)((function(){Et(A)}),[mt,A]),Object(u.useEffect)((function(){mt&&E&&mt.focus()}),[mt,E]),Object(u.useEffect)((function(){if(St&&mt){var t=mt.getScrollerElement();function e(t){var e=t.target;if(Zt.current){var i=e.scrollTop/e.scrollHeight;Zt.current.scrollTop=Zt.current.scrollHeight*i}}return t.addEventListener("scroll",e),function(){t.removeEventListener("scroll",e)}}}),[mt,St]),Object(u.useEffect)((function(){if(mt&&et){function t(t,e){et(t,e)}return mt.on("beforeChange",t),function(){mt.off("beforeChange",t)}}}),[mt,et]),Object(u.useEffect)((function(){if(mt&&Z){function t(){Z(mt.getValue())}return mt.on("blur",t),function(){mt.off("blur",t)}}}),[mt,Z]),Object(u.useEffect)((function(){if(mt){function t(t){var e=t.getValue();Ct(e),It((new Date).getTime()),t.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),c&&c(e)}return mt.on("change",t),function(){mt.off("change",t)}}}),[mt,c]),Object(u.useEffect)((function(){mt&&(null==i?(mt.setValue(""),Ct("")):i!==mt.getValue()&&(mt.setValue(i),Ct(i),mt.setCursor(mt.lineCount(),0)))}),[mt,i]);var te=Object(u.useCallback)((function(t){var e=mt.getCursor(),i=mt.getSelection(),n=i.split("\n");switch(t){case"bold":return mt.replaceSelection("**"+i+"**"),""===i&&mt.setCursor(e.line,e.ch+2),mt.focus();case"italic":return mt.replaceSelection("*"+i+"*"),""===i&&mt.setCursor(e.line,e.ch+1),mt.focus();case"code":return mt.replaceSelection("`"+i+"`"),""===i&&mt.setCursor(e.line,e.ch+1),mt.focus();case"inline-latex":return mt.replaceSelection("`$$"+i+"$$`"),""===i&&mt.setCursor(e.line,e.ch+3),mt.focus();case"latex":return mt.replaceSelection("```latex\n"+i+"\n```"),mt.setCursor(e.line+1,i.length+1),mt.focus();case"line-break":return mt.replaceSelection("
\n"),mt.focus();case"list-ul":return""===i?mt.replaceSelection("- "+i):mt.replaceSelection(n.map((function(t){return""===t?"":"- ".concat(t)})).join("\n")),mt.focus();case"list-ol":return""===i?mt.replaceSelection("1. "+i):mt.replaceSelection(n.map((function(t,e){return""===t?"":"".concat(e+1,". ").concat(t)})).join("\n")),mt.focus();case"add-null-ch":return""===i&&mt.setCursor(e.line,e.ch+1),mt.replaceSelection("▁"),mt.focus();case"inster-template-1":return""===i&&mt.setCursor(e.line,e.ch),mt.replaceSelection("\n**模板标题**\n模板正文内容,可输入文本内容和粘贴图片等操作"),mt.focus();case"eraser":return mt.setValue(""),mt.focus();case"trigger-watch":return Et(!St),mt.focus();case"trigger-full-screen":return Mt(!At),mt.focus();case"link":return void Dt("link");case"code-block":return void Dt("code-block");case"upload-image":return void Dt("upload-image");case"add-table":return void Dt("add-table");default:throw new Error}}),[mt,St,At]),ee=Object(u.useCallback)((function(t){switch(Dt(""),Pt){case"link":var e=t.title,i=t.link;return mt.replaceSelection("[".concat(e,"](").concat(i,")")),mt.focus();case"code-block":var n=t.language,r=t.content;return mt.replaceSelection(["```"+n,r,"```"].join("\n")),mt.focus();case"upload-image":var o=t.src,s=t.alt,a=t.name;return o.indexOf("type=image")>-1?mt.replaceSelection(".concat(o,' "').concat(s||"",'" )')):o.indexOf("type=application/pdf")>-1?mt.replaceSelection('').concat(a,"")):mt.replaceSelection('').concat(a,"")),mt.focus();case"add-table":for(var l=t.row,c=t.col,h=t.align,u="\n",p=0;p300&&(n=300),Ht(x+n+"px")}}return t.addEventListener("mousedown",n),document.addEventListener("mousemove",o),document.addEventListener("mouseup",r),function(){t.removeEventListener("mousedown",n),document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",r)}}}),[mt,Yt]),Object(u.useEffect)((function(){Ht(x)}),[x]);var re={width:tt(y),height:tt(Ft)};Object(u.useMemo)((function(){if(Bt){var t=new Date(Bt),e=t.getHours(),i=t.getMinutes(),n=t.getSeconds();return i=i<10?"0"+i:i,n=n<10?"0"+n:n,"".concat(e=e<10?"0"+e:e,":").concat(i,":").concat(n)}return 0}),[Bt]);return p.a.createElement(u.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:Xt},p.a.createElement("div",{className:"markdown-editor-container ".concat(at," ").concat(St?"on-preview":""," ").concat(w?"mini":""," ").concat(At?"full-screen":""),style:re},p.a.createElement(L,{insertTemp:M,watch:St,fullScreen:At,showNullButton:V,onActionCallback:te,hidetoolBar:U,uuid:Ut.current,setOpenPhones:function(){qt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:Kt,placeholder:ut})),St?p.a.createElement("div",{ref:Zt,className:"preview-container"},"stex"===N&&p.a.createElement(v,{value:xt}),"stex"!==N&&p.a.createElement(m.a,{edit:!0,value:xt,replaces:function(t,e){var i=mt.getValue();i=i.replace(t,e),Ct(i),null==mt||mt.setValue(i)}})):null))),I?p.a.createElement("a",{ref:Yt,className:"editor-resize"}):null,p.a.createElement(T.a,null,rt[Pt]?p.a.createElement(n.a,{centered:!0,title:rt[Pt],visible:!0,onCancel:ne,footer:null},ie):null))}},SJMd:
/*!****************************************************!*\
!*** ./node_modules/code-prettify/src/prettify.js ***!
\****************************************************/
/*! no static exports found */
/*! ModuleConcatenation bailout: Module is not an ECMAScript module */function(t,e){window.PR_SHOULD_USE_CONTINUATION=!0,function(){var t=window,e=["break,continue,do,else,for,if,return,while"],i=[[e,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],n=[i,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],r=[i,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[i,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],s=[i,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],a="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",l=[e,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[e,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],h=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],u=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/;function p(t,e,i,n,r){if(i){var o={sourceNode:t,pre:1,langExtension:null,numberLines:null,sourceCode:i,spans:null,basePos:e,decorations:null};n(o),r.push.apply(r,o.decorations)}}var d=/\S/;function f(t){for(var e=void 0,i=t.firstChild;i;i=i.nextSibling){var n=i.nodeType;e=1===n?e?t:i:3===n&&d.test(i.nodeValue)?t:e}return e===t?void 0:e}function g(t,e){var i,n={};!function(){for(var r=t.concat(e),o=[],s={},a=0,l=r.length;a=0;)n[h.charAt(u)]=c;var p=c[1],d=""+p;s.hasOwnProperty(d)||(o.push(p),s[d]=null)}o.push(/[\0-\uffff]/),i=function(t){for(var e=0,i=!1,n=!1,r=0,o=t.length;r122||(h<65||u>90||i.push([32|Math.max(65,u),32|Math.min(h,90)]),h<97||u>122||i.push([-33&Math.max(97,u),-33&Math.min(h,122)]))}}i.sort((function(t,e){return t[0]-e[0]||e[1]-t[1]}));var p=[],d=[];for(o=0;of[0]&&(f[1]+1>f[0]&&r.push("-"),r.push(l(f[1])))}return r.push("]"),r.join("")}function h(t){for(var n=t.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),r=n.length,o=[],s=0,a=0;s=2&&"["===p?n[s]=c(u):"\\"!==p&&(n[s]=u.replace(/[a-zA-Z]/g,(function(t){var e=t.charCodeAt(0);return"["+String.fromCharCode(-33&e,32|e)+"]"})))}return n.join("")}var u=[];for(r=0,o=t.length;r=5&&"lang-"===y.substring(0,5))||b&&"string"==typeof b[1]||(m=!1,y="src"),m||(d[v]=y)}var k=h;if(h+=v.length,m){var S=b[1],E=v.indexOf(S),L=E+S.length;b[2]&&(E=(L=v.length-b[2].length)-S.length);var T=y.substring(5);p(l,a+k,v.substring(0,E),o,c),p(l,a+k+E,S,C(T,S),c),p(l,a+k+L,v.substring(L),o,c)}else c.push(a+k,y)}t.decorations=c};return o}function m(t){var e=[],i=[];t.tripleQuotedStrings?e.push(["str",/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""]):t.multiLineStrings?e.push(["str",/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):e.push(["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"]),t.verbatimStrings&&i.push(["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var n=t.hashComments;n&&(t.cStyleComments?(n>1?e.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):e.push(["com",/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),i.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):e.push(["com",/^#[^\r\n]*/,null,"#"])),t.cStyleComments&&(i.push(["com",/^\/\/[^\r\n]*/,null]),i.push(["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var r=t.regexLiterals;if(r){var o=r>1?"":"\n\r",s=o?".":"[\\S\\s]",a="/(?=[^/*"+o+"])(?:[^/\\x5B\\x5C"+o+"]|\\x5C"+s+"|\\x5B(?:[^\\x5C\\x5D"+o+"]|\\x5C"+s+")*(?:\\x5D|$))+/";i.push(["lang-regex",RegExp("^(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*("+a+")")])}var l=t.types;l&&i.push(["typ",l]);var c=(""+t.keywords).replace(/^ | $/g,"");c.length&&i.push(["kwd",new RegExp("^(?:"+c.replace(/[\s,]+/g,"|")+")\\b"),null]),e.push(["pln",/^\s+/,null," \r\n\t "]);var h="^.[^\\s\\w.$@'\"`/\\\\]*";return t.regexLiterals&&(h+="(?!s*/)"),i.push(["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],["pln",/^[a-z_$][a-z_$@0-9]*/i,null],["lit",new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],["pln",/^\\[\s\S]?/,null],["pun",new RegExp(h),null]),g(e,i)}var v=m({keywords:[n,o,r,s,a,l,c,h],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function y(t,e,i){for(var n=/(?:^|\s)nocode(?:\s|$)/,r=/\r\n?|\n/,o=t.ownerDocument,s=o.createElement("li");t.firstChild;)s.appendChild(t.firstChild);var a=[s];function l(t){var e=t.nodeType;if(1!=e||n.test(t.className)){if((3==e||4==e)&&i){var s=t.nodeValue,a=s.match(r);if(a){var h=s.substring(0,a.index);t.nodeValue=h;var u=s.substring(a.index+a[0].length);if(u)t.parentNode.insertBefore(o.createTextNode(u),t.nextSibling);c(t),h||t.parentNode.removeChild(t)}}}else if("br"===t.nodeName)c(t),t.parentNode&&t.parentNode.removeChild(t);else for(var p=t.firstChild;p;p=p.nextSibling)l(p)}function c(t){for(;!t.nextSibling;)if(!(t=t.parentNode))return;for(var e,i=function t(e,i){var n=i?e.cloneNode(!1):e,r=e.parentNode;if(r){var o=t(r,1),s=e.nextSibling;o.appendChild(n);for(var a=s;a;a=s)s=a.nextSibling,o.appendChild(a)}return n}(t.nextSibling,0);(e=i.parentNode)&&1===e.nodeType;)i=e;a.push(i)}for(var h=0;h=0;){var r=i[n];b.hasOwnProperty(r)?t.console&&console.warn("cannot override language handler %s",r):b[r]=e}}function C(t,e){return t&&b.hasOwnProperty(t)||(t=/^\s*=x&&(h+=2),a>=C&&(d+=2)}}finally{v&&(v.style.display=y)}}(e)}catch(e){t.console&&console.log(e&&e.stack||e)}}function k(t,e,i){var n=i||!1,r=e||null,o=document.createElement("div");return o.innerHTML=""+t+"
",o=o.firstChild,n&&y(o,n,!0),w({langExtension:r,numberLines:n,sourceNode:o,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null}),o.innerHTML}function S(e,i){var n=i||document.body,r=n.ownerDocument||document;function o(t){return n.getElementsByTagName(t)}for(var s=[o("pre"),o("code"),o("xmp")],a=[],l=0;l]*(?:>|$)/],["com",/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^