(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,7,8,10],{"+92d":function(ft,Ge,W){ft.exports=W.p+"static/b1.8d46544a.svg"},"+RDj":function(ft,Ge,W){ft.exports=W.p+"static/dau.0c862b4c.svg"},"3SPk":function(ft,Ge,W){ft.exports=W.p+"static/c.893027ce.svg"},"5A5F":function(ft,Ge,W){ft.exports={flex_box_center:"flex_box_center___3fvo9",flex_space_between:"flex_space_between___2dIWe",flex_box_vertical_center:"flex_box_vertical_center___213Et",flex_box_center_end:"flex_box_center_end___1GXlY",flex_box_column:"flex_box_column___2XTWO",wrap:"wrap___1JbzU",bg:"bg___Dxa5l",btnWrap:"btnWrap___1CEeA",text:"text___ufYpy",btn:"btn___33IXa",content:"content___2Crhb",left:"left___12ObT",filterPoint:"filterPoint___1wSyY",btnWarp:"btnWarp___XLUgV",btnActive:"btnActive___2vIUq",action:"action___m_eZE",btnMask:"btnMask___epWeB",filterOrigin:"filterOrigin___OKol4",line:"line___psQHn",control:"control___1SAJX",table:"table___1Q9AI",tabWarp:"tabWarp___3884f",tabWarp2:"tabWarp2___1f1Zo",customTable:"customTable___6Ubut","btn-style-1":"btn-style-1___m4kGi","btn-style-2":"btn-style-2___2uJ8s","btn-style-3":"btn-style-3___3kuYl",right:"right___Ie2u1",title:"title___1uK2v",sort:"sort___1hyjY",titles:"titles___1i-V6",li:"li___3lR-W",titleWarp:"titleWarp___t0Zdh",hov:"hov___30B5q",hovBtn:"hovBtn___3ciGX",tag:"tag___hllWE",problemsclose:"problemsclose___1X9HB",imgsrc:"imgsrc___3koep"}},"6+eU":function(ft,Ge,W){"use strict";W.d(Ge,"a",function(){return l});var oe=W("wx14"),N=W("rePB"),S=W("VTBJ"),I=W("1OyB"),v=W("vuIU"),x=W("Ji7U"),U=W("LK+K"),M=W("q1tI"),R=W.n(M),w=W("TSYQ"),b=W.n(w),T=function(c){var i,n="".concat(c.rootPrefixCls,"-item"),t=b()(n,"".concat(n,"-").concat(c.page),(i={},Object(N.a)(i,"".concat(n,"-active"),c.active),Object(N.a)(i,c.className,!!c.className),Object(N.a)(i,"".concat(n,"-disabled"),!c.page),i)),e=function(){c.onClick(c.page)},p=function(_){c.onKeyPress(_,c.onClick,c.page)};return R.a.createElement("li",{title:c.showTitle?c.page:null,className:t,onClick:e,onKeyPress:p,tabIndex:"0"},c.itemRender(c.page,"page",R.a.createElement("a",{rel:"nofollow"},c.page)))},O=T,C={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},E=function(m){Object(x.a)(i,m);var c=Object(U.a)(i);function i(){var n;Object(I.a)(this,i);for(var t=arguments.length,e=new Array(t),p=0;p=0||g.relatedTarget.className.indexOf("".concat(F,"-next"))>=0))return;n.setState({goInputText:""}),k(n.getValidValue())},n.go=function(g){var _=n.state.goInputText;if(_==="")return;(g.keyCode===C.ENTER||g.type==="click")&&(n.setState({goInputText:""}),n.props.quickGo(n.getValidValue()))},n}return Object(v.a)(i,[{key:"getValidValue",value:function(){var t=this.state,e=t.goInputText,p=t.current;return!e||isNaN(e)?p:Number(e)}},{key:"getPageSizeOptions",value:function(){var t=this.props,e=t.pageSize,p=t.pageSizeOptions;return p.some(function(g){return g.toString()===e.toString()})?p:p.concat([e.toString()]).sort(function(g,_){var A=isNaN(Number(g))?0:Number(g),k=isNaN(Number(_))?0:Number(_);return A-k})}},{key:"render",value:function(){var t=this,e=this.props,p=e.pageSize,g=e.locale,_=e.rootPrefixCls,A=e.changeSize,k=e.quickGo,F=e.goButton,z=e.selectComponentClass,J=e.buildOptionText,Y=e.selectPrefixCls,$=e.disabled,le=this.state.goInputText,be="".concat(_,"-options"),ve=z,ke=null,Te=null,xe=null;if(!A&&!k)return null;var _e=this.getPageSizeOptions();if(A&&ve){var Oe=_e.map(function(ce,Z){return R.a.createElement(ve.Option,{key:Z,value:ce.toString()},(J||t.buildOptionText)(ce))});ke=R.a.createElement(ve,{disabled:$,prefixCls:Y,showSearch:!1,className:"".concat(be,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(p||_e[0]).toString(),onChange:this.changeSize,getPopupContainer:function(Z){return Z.parentNode}},Oe)}return k&&(F&&(xe=typeof F=="boolean"?R.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:$,className:"".concat(be,"-quick-jumper-button")},g.jump_to_confirm):R.a.createElement("span",{onClick:this.go,onKeyUp:this.go},F)),Te=R.a.createElement("div",{className:"".concat(be,"-quick-jumper")},g.jump_to,R.a.createElement("input",{disabled:$,type:"text",value:le,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,xe)),R.a.createElement("li",{className:"".concat(be)},ke,Te)}}]),i}(R.a.Component);E.defaultProps={pageSizeOptions:["10","20","50","100"]};var y=E,h=W("N2Kk");function r(){}function o(m){return typeof m=="number"&&isFinite(m)&&Math.floor(m)===m}function s(m,c,i){return i}function f(m,c,i){var n=typeof m=="undefined"?c.pageSize:m;return Math.floor((i.total-1)/n)+1}var d=function(m){Object(x.a)(i,m);var c=Object(U.a)(i);function i(n){var t;Object(I.a)(this,i),t=c.call(this,n),t.getJumpPrevPage=function(){return Math.max(1,t.state.current-(t.props.showLessItems?3:5))},t.getJumpNextPage=function(){return Math.min(f(void 0,t.state,t.props),t.state.current+(t.props.showLessItems?3:5))},t.getItemIcon=function(A,k){var F=t.props.prefixCls,z=A||R.a.createElement("button",{type:"button","aria-label":k,className:"".concat(F,"-item-link")});return typeof A=="function"&&(z=R.a.createElement(A,Object(S.a)({},t.props))),z},t.savePaginationNode=function(A){t.paginationNode=A},t.isValid=function(A){return o(A)&&A!==t.state.current},t.shouldDisplayQuickJumper=function(){var A=t.props,k=A.showQuickJumper,F=A.pageSize,z=A.total;return z<=F?!1:k},t.handleKeyDown=function(A){(A.keyCode===C.ARROW_UP||A.keyCode===C.ARROW_DOWN)&&A.preventDefault()},t.handleKeyUp=function(A){var k=t.getValidValue(A),F=t.state.currentInputValue;k!==F&&t.setState({currentInputValue:k}),A.keyCode===C.ENTER?t.handleChange(k):A.keyCode===C.ARROW_UP?t.handleChange(k-1):A.keyCode===C.ARROW_DOWN&&t.handleChange(k+1)},t.changePageSize=function(A){var k=t.state.current,F=f(A,t.state,t.props);k=k>F?F:k,F===0&&(k=t.state.current),typeof A=="number"&&("pageSize"in t.props||t.setState({pageSize:A}),"current"in t.props||t.setState({current:k,currentInputValue:k})),t.props.onShowSizeChange(k,A),"onChange"in t.props&&t.props.onChange&&t.props.onChange(k,A)},t.handleChange=function(A){var k=t.props.disabled,F=A;if(t.isValid(F)&&!k){var z=f(void 0,t.state,t.props);F>z?F=z:F<1&&(F=1),"current"in t.props||t.setState({current:F,currentInputValue:F});var J=t.state.pageSize;return t.props.onChange(F,J),F}return t.state.current},t.prev=function(){t.hasPrev()&&t.handleChange(t.state.current-1)},t.next=function(){t.hasNext()&&t.handleChange(t.state.current+1)},t.jumpPrev=function(){t.handleChange(t.getJumpPrevPage())},t.jumpNext=function(){t.handleChange(t.getJumpNextPage())},t.hasPrev=function(){return t.state.current>1},t.hasNext=function(){return t.state.current2?F-2:0),J=2;J=p?_=p:_=Number(e),_}},{key:"getShowSizeChanger",value:function(){var t=this.props,e=t.showSizeChanger,p=t.total,g=t.totalBoundaryShowSizeChanger;return typeof e!="undefined"?e:p>g}},{key:"renderPrev",value:function(t){var e=this.props,p=e.prevIcon,g=e.itemRender,_=g(t,"prev",this.getItemIcon(p,"prev page")),A=!this.hasPrev();return Object(M.isValidElement)(_)?Object(M.cloneElement)(_,{disabled:A}):_}},{key:"renderNext",value:function(t){var e=this.props,p=e.nextIcon,g=e.itemRender,_=g(t,"next",this.getItemIcon(p,"next page")),A=!this.hasNext();return Object(M.isValidElement)(_)?Object(M.cloneElement)(_,{disabled:A}):_}},{key:"render",value:function(){var t=this,e=this.props,p=e.prefixCls,g=e.className,_=e.style,A=e.disabled,k=e.hideOnSinglePage,F=e.total,z=e.locale,J=e.showQuickJumper,Y=e.showLessItems,$=e.showTitle,le=e.showTotal,be=e.simple,ve=e.itemRender,ke=e.showPrevNextJumpers,Te=e.jumpPrevIcon,xe=e.jumpNextIcon,_e=e.selectComponentClass,Oe=e.selectPrefixCls,ce=e.pageSizeOptions,Z=this.state,je=Z.current,at=Z.pageSize,rt=Z.currentInputValue;if(k===!0&&F<=at)return null;var Ke=f(void 0,this.state,this.props),He=[],we=null,Fe=null,$e=null,Qe=null,Ve=null,Ue=J&&J.goButton,Be=Y?1:2,ct=je-1>0?je-1:0,st=je+1=Be*2&&je!==1+2&&(He[0]=Object(M.cloneElement)(He[0],{className:"".concat(p,"-item-after-jump-prev")}),He.unshift(we)),Ke-je>=Be*2&&je!==Ke-2&&(He[He.length-1]=Object(M.cloneElement)(He[He.length-1],{className:"".concat(p,"-item-before-jump-next")}),He.push(Fe)),Re!==1&&He.unshift($e),Ie!==Ke&&He.push(Qe)}var ae=null;le&&(ae=R.a.createElement("li",{className:"".concat(p,"-total-text")},le(F,[F===0?0:(je-1)*at+1,je*at>F?F:je*at])));var ee=!this.hasPrev()||!Ke,te=!this.hasNext()||!Ke;return R.a.createElement("ul",Object(oe.a)({className:b()(p,g,Object(N.a)({},"".concat(p,"-disabled"),A)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},lt),ae,R.a.createElement("li",{title:$?z.prev_page:null,onClick:this.prev,tabIndex:ee?null:0,onKeyPress:this.runIfEnterPrev,className:b()("".concat(p,"-prev"),Object(N.a)({},"".concat(p,"-disabled"),ee)),"aria-disabled":ee},this.renderPrev(ct)),He,R.a.createElement("li",{title:$?z.next_page:null,onClick:this.next,tabIndex:te?null:0,onKeyPress:this.runIfEnterNext,className:b()("".concat(p,"-next"),Object(N.a)({},"".concat(p,"-disabled"),te)),"aria-disabled":te},this.renderNext(st)),R.a.createElement(y,{disabled:A,locale:z,rootPrefixCls:p,selectComponentClass:_e,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:je,pageSize:at,pageSizeOptions:ce,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Ue}))}}],[{key:"getDerivedStateFromProps",value:function(t,e){var p={};if("current"in t&&(p.current=t.current,t.current!==e.current&&(p.currentInputValue=p.current)),"pageSize"in t&&t.pageSize!==e.pageSize){var g=e.current,_=f(t.pageSize,e,t);g=g>_?_:g,"current"in t||(p.current=g,p.currentInputValue=g),p.pageSize=t.pageSize}return p}}]),i}(R.a.Component);d.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:r,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:r,locale:h.a,style:{},itemRender:s,totalBoundaryShowSizeChanger:50};var l=d},"6RRn":function(ft,Ge,W){"use strict";var oe=W("wCXF"),N=W("n6Qo");W.d(Ge,"b",function(){return N.a});var S=W("IBYe"),I=W("6eGT"),v=W("hW8S");W.d(Ge,"a",function(){return v.a}),Ge.c=oe.b},"6eGT":function(ft,Ge,W){"use strict";function oe(N){return null}Ge.a=oe},"815F":function(ft,Ge,W){"use strict";W.d(Ge,"e",function(){return U}),W.d(Ge,"c",function(){return R}),W.d(Ge,"d",function(){return w}),W.d(Ge,"a",function(){return T}),W.d(Ge,"f",function(){return O}),W.d(Ge,"b",function(){return C});var oe=W("KQm4"),N=W("VTBJ"),S=W("Ff2n"),I=W("Zm9Q"),v=W("Kwbf"),x=W("OZM5");function U(E,y){return E!=null?E:y}function M(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=new Map;function h(r){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(s){var f=s.key,d=s.children;Object(v.a)(f!=null,"Tree node must have a certain key: [".concat(o).concat(f,"]"));var l=String(f);Object(v.a)(!y.has(l)||f===null||f===void 0,"Same 'key' exist in the Tree: ".concat(l)),y.set(l,!0),h(d,"".concat(o).concat(l," > "))})}h(E)}function R(E){function y(h){var r=Object(I.a)(h);return r.map(function(o){if(!Object(x.i)(o))return Object(v.a)(!o,"Tree/TreeNode can only accept TreeNode as children."),null;var s=o.key,f=o.props,d=f.children,l=Object(S.a)(f,["children"]),m=Object(N.a)({key:s},l),c=y(d);return c.length&&(m.children=c),m}).filter(function(o){return o})}return y(E)}function w(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],h=new Set(y===!0?[]:y),r=[];function o(s){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return s.map(function(d,l){var m=Object(x.h)(f?f.pos:"0",l),c=U(d.key,m),i=Object(N.a)(Object(N.a)({},d),{},{parent:f,pos:m,children:null,data:d,isStart:[].concat(Object(oe.a)(f?f.isStart:[]),[l===0]),isEnd:[].concat(Object(oe.a)(f?f.isEnd:[]),[l===s.length-1])});return r.push(i),y===!0||h.has(c)?i.children=o(d.children||[],i):i.children=[],i})}return o(E),r}function b(E,y,h){var r;h?typeof h=="string"?r=function(f){return f[h]}:typeof h=="function"&&(r=function(f){return h(f)}):r=function(f,d){return U(f.key,d)};function o(s,f,d){var l=s?s.children:E,m=s?Object(x.h)(d.pos,f):"0";if(s){var c=r(s,m),i={node:s,index:f,pos:m,key:c,parentPos:d.node?d.pos:null,level:d.level+1};y(i)}l&&l.forEach(function(n,t){o(n,t,{node:s,pos:m,level:d?d.level+1:-1})})}o(null)}function T(E){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=y.initWrapper,r=y.processEntity,o=y.onProcessFinished,s=arguments.length>2?arguments[2]:void 0,f={},d={},l={posEntities:f,keyEntities:d};return h&&(l=h(l)||l),b(E,function(m){var c=m.node,i=m.index,n=m.pos,t=m.key,e=m.parentPos,p=m.level,g={node:c,index:i,key:t,pos:n,level:p},_=U(t,n);f[n]=g,d[_]=g,g.parent=f[e],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),r&&r(g,l)},s),o&&o(l),l}function O(E,y){var h=y.expandedKeys,r=y.selectedKeys,o=y.loadedKeys,s=y.loadingKeys,f=y.checkedKeys,d=y.halfCheckedKeys,l=y.dragOverNodeKey,m=y.dropPosition,c=y.keyEntities,i=c[E],n={eventKey:E,expanded:h.indexOf(E)!==-1,selected:r.indexOf(E)!==-1,loaded:o.indexOf(E)!==-1,loading:s.indexOf(E)!==-1,checked:f.indexOf(E)!==-1,halfChecked:d.indexOf(E)!==-1,pos:String(i?i.pos:""),dragOver:l===E&&m===0,dragOverGapTop:l===E&&m===-1,dragOverGapBottom:l===E&&m===1};return n}function C(E){var y=E.data,h=E.expanded,r=E.selected,o=E.checked,s=E.loaded,f=E.loading,d=E.halfChecked,l=E.dragOver,m=E.dragOverGapTop,c=E.dragOverGapBottom,i=E.pos,n=E.active,t=Object(N.a)(Object(N.a)({},y),{},{expanded:h,selected:r,checked:o,loaded:s,loading:f,halfChecked:d,dragOver:l,dragOverGapTop:m,dragOverGapBottom:c,pos:i,active:n});return"props"in t||Object.defineProperty(t,"props",{get:function(){return Object(v.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),E}}),t}},"8hTe":function(ft,Ge,W){ft.exports={button:"button___1wy9m"}},"9Bee":function(ft,Ge,W){"use strict";var oe=W("DYRE"),N=W("zeV3"),S=W("+L6B"),I=W("2/Rp"),v=W("k1fw"),x=W("9og8"),U=W("tJVT"),M=W("WmNS"),R=W.n(M),w=W("q1tI"),b=W.n(w),T=W("vg9a"),O=W("DlQD"),C=W.n(O),E=W("rUJ1");function y(P,a){var u=P.match(/^(\s+)(?:```)/);if(u===null)return a;var D=u[1];return a.split(`
`).map(function(B){var L=B.match(/^\s+/);if(L===null)return B;var se=Object(U.a)(L,1),Ne=se[0];return Ne.length>=D.length?B.slice(D.length):B}).join(`
`)}var h=[],r=[""],o=new C.a.Renderer,s=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function f(){h.length=0,r=[""]}var d={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function l(P,a,u,D){if(a>=P.length||P[a].level<=u)return a;var B=P[a];D.push(""+B.text+" "),a++;var L=[];return a=l(P,a,B.level,L),L.length>0&&(D.push(""),L.forEach(function(se){D.push(se)}),D.push(" ")),D.push(" "),a=l(P,a,u,D),a}function m(){return l(h,0,0,r),r.push(" "),r.join("")}var c={heading:function(a){var u=s.exec(a);if(u)return{type:"heading",raw:u[0],depth:u[1].length,text:u[2]}},fences:function(a){var u=this.rules.block.fences.exec(a);if(u){var D=u[0],B=y(D,u[3]||""),L=u[2]?u[2].trim():u[2];if(["latex","katex","math"].indexOf(L)>=0){var se=t(),Ne=B;B=se,e[se]={type:"block",expression:Ne}}return{type:"code",raw:D,lang:L,text:B}}}},i=/(?:\${2})([^\n`]+?)(?:\${2})/gi,n=0,t=function(){return"__special_katext_id_".concat(n++,"__")},e={};function p(){return e}function g(){n=0,e={}}function _(P){return P=P.replace(i,function(a,u){var D=t();return e[D]={type:"inline",expression:u},D}),P}var A=o.listitem;o.listitem=function(P){return A(_(P))};var k=o.paragraph;o.paragraph=function(P){return k(_(P))};var F=o.tablecell;o.tablecell=function(P,a){return F(_(P),a)},o.code=function(P,a,u){var D=(a||"").match(/\S*/)[0];return D?["latex","katex","math"].indexOf(D)>=0?"".concat(P,"
"):' ').concat(u?P:Object(E.escape)(P,!0),`
`):''+(u?P:Object(E.escape)(P,!0))+" "},o.heading=function(P,a,u){var D=this.options.headerPrefix+u.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return h.push({anchor:D,level:a,text:P}),"'+P+" "},C.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),C.a.use({tokenizer:c,renderer:o});var z=C.a,J=W("SJMd"),Y=W("ulZh"),$=W.n(Y),le=W("m3rI"),be=W("Oy/b"),ve=W("p5ED"),ke=W("ErOA");/*! *****************************************************************************
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.
***************************************************************************** */var Te=function(P,a){return(Te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,D){u.__proto__=D}||function(u,D){for(var B in D)Object.prototype.hasOwnProperty.call(D,B)&&(u[B]=D[B])})(P,a)};function xe(P,a){function u(){this.constructor=P}Te(P,a),P.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}function _e(P,a,u,D){return new(u||(u=Promise))(function(B,L){function se(pt){try{tt(D.next(pt))}catch(We){L(We)}}function Ne(pt){try{tt(D.throw(pt))}catch(We){L(We)}}function tt(pt){var We;pt.done?B(pt.value):(We=pt.value,We instanceof u?We:new u(function(bt){bt(We)})).then(se,Ne)}tt((D=D.apply(P,a||[])).next())})}function Oe(P,a){var u,D,B,L,se={label:0,sent:function(){if(1&B[0])throw B[1];return B[1]},trys:[],ops:[]};return L={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function Ne(tt){return function(pt){return function(We){if(u)throw new TypeError("Generator is already executing.");for(;se;)try{if(u=1,D&&(B=2&We[0]?D.return:We[0]?D.throw||((B=D.return)&&B.call(D),0):D.next)&&!(B=B.call(D,We[1])).done)return B;switch(D=0,B&&(We=[2&We[0],B.value]),We[0]){case 0:case 1:B=We;break;case 4:return se.label++,{value:We[1],done:!1};case 5:se.label++,D=We[1],We=[0];continue;case 7:We=se.ops.pop(),se.trys.pop();continue;default:if(!(B=se.trys,(B=B.length>0&&B[B.length-1])||We[0]!==6&&We[0]!==2)){se=0;continue}if(We[0]===3&&(!B||We[1]>B[0]&&We[1] ',"select"),this.addActionButton(D,' ',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(D,' ',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(D,' ',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(D,' ',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(D,' ',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(D,' ',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(D,' ',"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(L){var se=document.createElement("div");se.className=""+u.toolbarButtonStyleClass.name,se.setAttribute("data-type-name",L.typeName),se.innerHTML=L.icon,se.addEventListener("click",function(){u.markerToolbarButtonClicked(se,L)}),u.buttons.push(se),u.markerButtons.push(se)}),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 B=document.createElement("div");B.className=this.toolbarBlockStyleClass.name,B.style.whiteSpace="nowrap",B.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(B),this.addActionButton(B,' ',"render"),this.addActionButton(B,' ',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},P.prototype.addButtonClickListener=function(a){this.buttonClickListeners.push(a)},P.prototype.removeButtonClickListener=function(a){this.buttonClickListeners.indexOf(a)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(a),1)},P.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},P.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var a=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var u=0;u0&&this.buttonClickListeners.forEach(function(D){return D("marker",u)}),this.markerButtonOverflowBlock.style.display="none"},P.prototype.actionToolbarButtonClicked=function(a,u){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(D){return D("action",u)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},P.prototype.setActiveButton=function(a){this.resetButtonStyles(),a.className=a.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),a.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},P.prototype.setActiveMarkerButton=function(a){var u=this.markerButtons.find(function(D){return D.getAttribute("data-type-name")===a});u&&this.setActiveButton(u)},P.prototype.setCurrentMarker=function(a){var u=this;this.currentMarker=a,this.buttons.filter(function(D){return/delete|notes/.test(D.getAttribute("data-action"))}).forEach(function(D){u.currentMarker===void 0?(D.style.fillOpacity="0.4",D.style.pointerEvents="none"):(D.style.fillOpacity="1",D.style.pointerEvents="all")})},P}(),$e=function(){function P(a,u,D,B){this.panels=[],this.panelButtons=[],this.markerjsContainer=a,this.displayMode=u,this.uiStyleSettings=D,this.styles=B,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return P.prototype.addStyles=function(){var a;this.toolboxStyleClass=this.styles.addClass(new we("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new we("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var u=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new we("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new we("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new we("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new we("toolbox-panel-row_colors",`
background-color: `+((a=this.uiStyleSettings.toolboxBackgroundColor)!==null&&a!==void 0?a:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new we("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*u)+`px;
padding: `+u+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new we("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new we("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new He("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},P.prototype.show=function(a){var u;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=a,this.uiContainer.className=this.toolboxStyleClass.name+" "+((u=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},P.prototype.setPanelButtons=function(a){var u,D,B=this;this.panels=a,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((u=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&u!==void 0?u:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((D=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&D!==void 0?D:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(L){var se;L.uiStyleSettings=B.uiStyleSettings;var Ne=document.createElement("div");Ne.className=B.toolboxButtonStyleClass.name+" "+((se=B.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&se!==void 0?se:B.toolboxButtonStyleColorsClass.name),Ne.innerHTML=L.icon,Ne.title=L.title,Ne.addEventListener("click",function(){B.panelButtonClick(L)}),B.panelButtons.push(Ne),B.buttonRow.appendChild(Ne)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},P.prototype.panelButtonClick=function(a){var u=this,D=-1;if(a!==this.activePanel){D=this.panels.indexOf(a),this.panelRow.innerHTML="";var B=a.getUi();B.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(B),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=a}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){u.displayMode==="inline"?u.panelRow.style.display="none":u.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(L,se){var Ne,tt;L.className=u.toolboxButtonStyleClass.name+" "+(se===D?""+((Ne=u.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Ne!==void 0?Ne:u.toolboxActiveButtonStyleColorsClass.name):""+((tt=u.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&tt!==void 0?tt:u.toolboxButtonStyleColorsClass.name))})},P}(),Qe=function(P,a){this.title=P,this.icon=a},Ve=function(P){function a(u,D,B,L){var se=P.call(this,u,L||' ')||this;return se.colors=[],se.addTransparent=!1,se.colorBoxes=[],se.colors=D,se.currentColor=B,se.setCurrentColor=se.setCurrentColor.bind(se),se.getColorBox=se.getColorBox.bind(se),se}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.whiteSpace="nowrap",this.colors.forEach(function(B){var L=u.getColorBox(B);D.appendChild(L),u.colorBoxes.push(L)}),D},a.prototype.getColorBox=function(u){var D=this,B=this.uiStyleSettings.toolbarHeight/4,L=this.uiStyleSettings.toolbarHeight-B,se=document.createElement("div");se.style.display="inline-block",se.style.boxSizing="content-box",se.style.width=L-2+"px",se.style.height=L-2+"px",se.style.padding="1px",se.style.marginRight="2px",se.style.marginBottom="2px",se.style.borderWidth="2px",se.style.borderStyle="solid",se.style.borderRadius=(L+2)/2+"px",se.style.borderColor=u===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",se.addEventListener("click",function(){D.setCurrentColor(u,se)});var Ne=document.createElement("div");return Ne.style.display="inline-block",Ne.style.width=L-2+"px",Ne.style.height=L-2+"px",Ne.style.backgroundColor=u,Ne.style.borderRadius=L/2+"px",u==="transparent"&&(Ne.style.fill=this.uiStyleSettings.toolboxAccentColor,Ne.innerHTML=`
`),se.appendChild(Ne),se},a.prototype.setCurrentColor=function(u,D){var B=this;this.currentColor=u,this.colorBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(u)},a}(Qe),Ue=function(){function P(a,u,D){this._state="new",this._isSelected=!1,this._container=a,this._overlayContainer=u,this.globalSettings=D,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(P.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),P.prototype.ownsTarget=function(a){return!1},Object.defineProperty(P.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),P.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},P.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},P.prototype.pointerDown=function(a,u){},P.prototype.dblClick=function(a,u){},P.prototype.manipulate=function(a){},P.prototype.pointerUp=function(a){this.stateChanged()},P.prototype.dispose=function(){},P.prototype.addMarkerVisualToContainer=function(a){this.container.childNodes.length>0?this.container.insertBefore(a,this.container.childNodes[0]):this.container.appendChild(a)},P.prototype.getState=function(){return{typeName:P.typeName,state:this.state,notes:this.notes}},P.prototype.restoreState=function(a){this._state=a.state,this.notes=a.notes},P.prototype.scale=function(a,u){},P.prototype.colorChanged=function(a){this.onColorChanged&&this.onColorChanged(a),this.stateChanged()},P.prototype.fillColorChanged=function(a){this.onFillColorChanged&&this.onFillColorChanged(a),this.stateChanged()},P.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var a=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),a.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(a)&&this.onStateChanged(this)}},P.typeName="MarkerBase",P}(),Be=function(){function P(){this.findGripByVisual=this.findGripByVisual.bind(this)}return P.prototype.findGripByVisual=function(a){return this.topLeft.ownsTarget(a)?this.topLeft:this.topCenter.ownsTarget(a)?this.topCenter:this.topRight.ownsTarget(a)?this.topRight:this.centerLeft.ownsTarget(a)?this.centerLeft:this.centerRight.ownsTarget(a)?this.centerRight:this.bottomLeft.ownsTarget(a)?this.bottomLeft:this.bottomCenter.ownsTarget(a)?this.bottomCenter:this.bottomRight.ownsTarget(a)?this.bottomRight:void 0},P}(),ct=function(){function P(){this.GRIP_SIZE=10,this.visual=Z.createGroup(),this.visual.appendChild(Z.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Z.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return P.prototype.ownsTarget=function(a){return a===this.visual||a===this.visual.childNodes[0]||a===this.visual.childNodes[1]},P}(),st=function(){function P(){}return P.toITransformMatrix=function(a){return{a:a.a,b:a.b,c:a.c,d:a.d,e:a.e,f:a.f}},P.toSVGMatrix=function(a,u){return a.a=u.a,a.b=u.b,a.c=u.c,a.d=u.d,a.e=u.e,a.f=u.f,a},P}(),lt=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.left=0,L.top=0,L.width=0,L.height=0,L.defaultSize={x:50,y:20},L.offsetX=0,L.offsetY=0,L.rotationAngle=0,L.CB_DISTANCE=10,L._suppressMarkerCreateEvent=!1,L.container.transform.baseVal.appendItem(Z.createTransform()),L.setupControlBox(),L}return xe(a,P),Object.defineProperty(a.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(a.prototype,"visual",{get:function(){return this._visual},set:function(u){this._visual=u;var D=Z.createTransform();this._visual.transform.baseVal.appendItem(D)},enumerable:!1,configurable:!0}),a.prototype.ownsTarget=function(u){return!!P.prototype.ownsTarget.call(this,u)||!!(this.controlGrips.findGripByVisual(u)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(u))},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="new"&&(this.left=u.x,this.top=u.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var B=this.unrotatePoint(u);if(this.manipulationStartX=B.x,this.manipulationStartY=B.y,this.offsetX=B.x-this.left,this.offsetY=B.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(D),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(D)){this.activeGrip=this.rotatorGrip;var L=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=L.x-this.width/2,this.top=L.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var se=this.container.transform.baseVal.getItem(0);se.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(se,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},a.prototype.pointerUp=function(u){var D=this.state;P.prototype.pointerUp.call(this,u),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(u),this._state="select",D==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},a.prototype.moveVisual=function(u){this.visual.style.transform="translate("+u.x+"px, "+u.y+"px)"},a.prototype.manipulate=function(u){var D=this.unrotatePoint(u);this.state==="creating"?this.resize(u):this.state==="move"?(this.left=this.manipulationStartLeft+(D.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(D.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(D):this.state==="rotate"&&this.rotate(u)},a.prototype.resize=function(u){var D=this.manipulationStartLeft,B=this.manipulationStartWidth,L=this.manipulationStartTop,se=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:D=this.manipulationStartLeft+u.x-this.manipulationStartX,B=this.manipulationStartWidth+this.manipulationStartLeft-D;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:B=this.manipulationStartWidth+u.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:L=this.manipulationStartTop+u.y-this.manipulationStartY,se=this.manipulationStartHeight+this.manipulationStartTop-L;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:se=this.manipulationStartHeight+u.y-this.manipulationStartY}B>=0?(this.left=D,this.width=B):(this.left=D+B,this.width=-B),se>=0?(this.top=L,this.height=se):(this.top=L+se,this.height=-se),this.setSize()},a.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},a.prototype.rotate=function(u){if(Math.abs(u.x-this.centerX)>.1){var D=Math.sign(u.x-this.centerX);this.rotationAngle=180*Math.atan((u.y-this.centerY)/(u.x-this.centerX))/Math.PI+90*D,this.applyRotation()}},a.prototype.applyRotation=function(){var u=this.container.transform.baseVal.getItem(0);u.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(u,0)},a.prototype.rotatePoint=function(u){if(this.rotationAngle===0)return u;var D=this.container.getCTM(),B=Z.createPoint(u.x,u.y);return{x:(B=B.matrixTransform(D)).x,y:B.y}},a.prototype.unrotatePoint=function(u){if(this.rotationAngle===0)return u;var D=this.container.getCTM();D=D.inverse();var B=Z.createPoint(u.x,u.y);return{x:(B=B.matrixTransform(D)).x,y:B.y}},a.prototype.select=function(){P.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},a.prototype.deselect=function(){P.prototype.deselect.call(this),this.controlBox.style.display="none"},a.prototype.setupControlBox=function(){this.controlBox=Z.createGroup();var u=Z.createTransform();u.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(u),this.container.appendChild(this.controlBox),this.controlRect=Z.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),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=Z.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 Be,this.addControlGrips(),this.controlBox.style.display="none"},a.prototype.adjustControlBox=function(){var u=this.controlBox.transform.baseVal.getItem(0);u.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(u,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(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()},a.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(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},a.prototype.createGrip=function(){var u=new ct;return u.visual.transform.baseVal.appendItem(Z.createTransform()),this.controlBox.appendChild(u.visual),u},a.prototype.positionGrips=function(){var u=this.controlGrips.topLeft.GRIP_SIZE,D=-u/2,B=D,L=(this.width+this.CB_DISTANCE)/2-u/2,se=(this.height+this.CB_DISTANCE)/2-u/2,Ne=this.height+this.CB_DISTANCE-u/2,tt=this.width+this.CB_DISTANCE-u/2;this.positionGrip(this.controlGrips.topLeft.visual,D,B),this.positionGrip(this.controlGrips.topCenter.visual,L,B),this.positionGrip(this.controlGrips.topRight.visual,tt,B),this.positionGrip(this.controlGrips.centerLeft.visual,D,se),this.positionGrip(this.controlGrips.centerRight.visual,tt,se),this.positionGrip(this.controlGrips.bottomLeft.visual,D,Ne),this.positionGrip(this.controlGrips.bottomCenter.visual,L,Ne),this.positionGrip(this.controlGrips.bottomRight.visual,tt,Ne),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,L,B-3*this.CB_DISTANCE)},a.prototype.positionGrip=function(u,D,B){var L=u.transform.baseVal.getItem(0);L.setTranslate(D,B),u.transform.baseVal.replaceItem(L,0)},a.prototype.hideControlBox=function(){this.controlBox.style.display="none"},a.prototype.showControlBox=function(){this.controlBox.style.display=""},a.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:st.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:st.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},P.prototype.getState.call(this))},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u);var D=u;this.left=D.left,this.top=D.top,this.width=D.width,this.height=D.height,this.rotationAngle=D.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,D.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(st.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,D.containerTransformMatrix))},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D);var B=this.rotatePoint({x:this.left,y:this.top}),L=this.unrotatePoint({x:B.x*u,y:B.y*D});this.left=L.x,this.top=L.y,this.width=this.width*u,this.height=this.height*D,this.adjustControlBox()},a}(Ue),nt=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.fillColor="transparent",L.strokeColor="transparent",L.strokeWidth=0,L.strokeDasharray="",L.opacity=1,L.setStrokeColor=L.setStrokeColor.bind(L),L.setFillColor=L.setFillColor.bind(L),L.setStrokeWidth=L.setStrokeWidth.bind(L),L.setStrokeDasharray=L.setStrokeDasharray.bind(L),L.createVisual=L.createVisual.bind(L),L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.visual)},a.prototype.createVisual=function(){this.visual=Z.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)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="new"&&(this.createVisual(),this.moveVisual(u),this._state="creating")},a.prototype.manipulate=function(u){P.prototype.manipulate.call(this,u)},a.prototype.resize=function(u){P.prototype.resize.call(this,u),this.setSize()},a.prototype.setSize=function(){P.prototype.setSize.call(this),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},a.prototype.pointerUp=function(u){P.prototype.pointerUp.call(this,u),this.setSize()},a.prototype.setStrokeColor=function(u){this.strokeColor=u,this.visual&&Z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(u),this.stateChanged()},a.prototype.setFillColor=function(u){this.fillColor=u,this.visual&&Z.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},a.prototype.setStrokeWidth=function(u){this.strokeWidth=u,this.visual&&Z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},a.prototype.setStrokeDasharray=function(u){this.strokeDasharray=u,this.visual&&Z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},a.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},P.prototype.getState.call(this))},a.prototype.restoreState=function(u){var D=u;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),P.prototype.restoreState.call(this,u),this.setSize()},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D),this.setSize()},a.title="Rectangle marker",a}(lt),ht=function(P){function a(u,D,B,L){var se=P.call(this,u,L||' ')||this;return se.widths=[],se.widthBoxes=[],se.widths=D,se.currentWidth=B,se.setCurrentWidth=se.setCurrentWidth.bind(se),se}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.widths.forEach(function(B){var L=document.createElement("div");L.style.display="flex",L.style.flexGrow="2",L.style.alignItems="center",L.style.justifyContent="space-between",L.style.padding="5px",L.style.borderWidth="2px",L.style.borderStyle="solid",L.style.borderColor=B===u.currentWidth?u.uiStyleSettings.toolboxAccentColor:"transparent",L.addEventListener("click",function(){u.setCurrentWidth(B,L)}),D.appendChild(L);var se=document.createElement("div");se.innerText=B.toString(),se.style.marginRight="5px",L.appendChild(se);var Ne=document.createElement("div");Ne.style.minHeight="20px",Ne.style.flexGrow="2",Ne.style.display="flex",Ne.style.alignItems="center";var tt=document.createElement("hr");tt.style.minWidth="20px",tt.style.border="0px",tt.style.borderTop=B+"px solid "+u.uiStyleSettings.toolboxColor,tt.style.flexGrow="2",Ne.appendChild(tt),L.appendChild(Ne),u.widthBoxes.push(L)}),D},a.prototype.setCurrentWidth=function(u,D){var B=this;this.currentWidth=u,this.widthBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},a}(Qe),ut=function(P){function a(u,D,B,L){var se=P.call(this,u,L||' ')||this;return se.styles=[],se.styleBoxes=[],se.styles=D,se.currentStyle=B,se.setCurrentStyle=se.setCurrentStyle.bind(se),se}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",this.styles.forEach(function(B){var L=document.createElement("div");L.style.display="flex",L.style.alignItems="center",L.style.justifyContent="space-between",L.style.padding="5px",L.style.borderWidth="2px",L.style.borderStyle="solid",L.style.overflow="hidden",L.style.maxWidth=100/u.styles.length-5+"%",L.style.borderColor=B===u.currentStyle?u.uiStyleSettings.toolboxAccentColor:"transparent",L.addEventListener("click",function(){u.setCurrentStyle(B,L)}),D.appendChild(L);var se=document.createElement("div");se.style.minHeight="20px",se.style.flexGrow="2",se.style.overflow="hidden";var Ne=`
`;se.innerHTML=Ne,L.appendChild(se),u.styleBoxes.push(L)}),D},a.prototype.setCurrentStyle=function(u,D){var B=this;this.currentStyle=u,this.styleBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},a}(Qe),fe=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.strokeColor=B.defaultColor,L.strokeWidth=B.defaultStrokeWidth,L.strokeDasharray=B.defaultStrokeDasharray,L.strokePanel=new Ve("Line color",B.defaultColorSet,B.defaultColor),L.strokePanel.onColorChanged=L.setStrokeColor,L.strokeWidthPanel=new ht("Line width",B.defaultStrokeWidths,B.defaultStrokeWidth),L.strokeWidthPanel.onWidthChanged=L.setStrokeWidth,L.strokeStylePanel=new ut("Line style",B.defaultStrokeDasharrays,B.defaultStrokeDasharray),L.strokeStylePanel.onStyleChanged=L.setStrokeDasharray,L}return xe(a,P),Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=P.prototype.getState.call(this);return u.typeName=a.typeName,u},a.typeName="FrameMarker",a.title="Frame marker",a.icon=' ',a}(nt),ye=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},Re=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.x1=0,L.y1=0,L.x2=0,L.y2=0,L.defaultLength=50,L.manipulationStartX=0,L.manipulationStartY=0,L.manipulationStartX1=0,L.manipulationStartY1=0,L.manipulationStartX2=0,L.manipulationStartY2=0,L.setupControlBox(),L}return xe(a,P),a.prototype.ownsTarget=function(u){return!!P.prototype.ownsTarget.call(this,u)||!(!this.grip1.ownsTarget(u)&&!this.grip2.ownsTarget(u))},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.manipulationStartX=u.x,this.manipulationStartY=u.y,this.state==="new"&&(this.x1=u.x,this.y1=u.y,this.x2=u.x,this.y2=u.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(D)?this.activeGrip=this.grip1:this.grip2.ownsTarget(D)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},a.prototype.pointerUp=function(u){var D=this.state;P.prototype.pointerUp.call(this,u),this.state==="creating"&&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(u),this._state="select",D==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},a.prototype.adjustVisual=function(){},a.prototype.manipulate=function(u){this.state==="creating"?this.resize(u):this.state==="move"?(this.x1=this.manipulationStartX1+u.x-this.manipulationStartX,this.y1=this.manipulationStartY1+u.y-this.manipulationStartY,this.x2=this.manipulationStartX2+u.x-this.manipulationStartX,this.y2=this.manipulationStartY2+u.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(u)},a.prototype.resize=function(u){switch(this.activeGrip){case this.grip1:this.x1=u.x,this.y1=u.y;break;case this.grip2:case void 0:this.x2=u.x,this.y2=u.y}this.adjustVisual(),this.adjustControlBox()},a.prototype.select=function(){P.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},a.prototype.deselect=function(){P.prototype.deselect.call(this),this.controlBox.style.display="none"},a.prototype.setupControlBox=function(){this.controlBox=Z.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},a.prototype.adjustControlBox=function(){this.positionGrips()},a.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},a.prototype.createGrip=function(){var u=new ct;return u.visual.transform.baseVal.appendItem(Z.createTransform()),this.controlBox.appendChild(u.visual),u},a.prototype.positionGrips=function(){var u=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-u/2,this.y1-u/2),this.positionGrip(this.grip2.visual,this.x2-u/2,this.y2-u/2)},a.prototype.positionGrip=function(u,D,B){var L=u.transform.baseVal.getItem(0);L.setTranslate(D,B),u.transform.baseVal.replaceItem(L,0)},a.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},P.prototype.getState.call(this))},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u);var D=u;this.x1=D.x1,this.y1=D.y1,this.x2=D.x2,this.y2=D.y2},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D),this.x1=this.x1*u,this.y1=this.y1*D,this.x2=this.x2*u,this.y2=this.y2*D,this.adjustVisual(),this.adjustControlBox()},a}(Ue),Ie=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.strokeColor="transparent",L.strokeWidth=0,L.strokeDasharray="",L.setStrokeColor=L.setStrokeColor.bind(L),L.setStrokeWidth=L.setStrokeWidth.bind(L),L.setStrokeDasharray=L.setStrokeDasharray.bind(L),L.strokeColor=B.defaultColor,L.strokeWidth=B.defaultStrokeWidth,L.strokeDasharray=B.defaultStrokeDasharray,L.strokePanel=new Ve("Line color",B.defaultColorSet,B.defaultColor),L.strokePanel.onColorChanged=L.setStrokeColor,L.strokeWidthPanel=new ht("Line width",B.defaultStrokeWidths,B.defaultStrokeWidth),L.strokeWidthPanel.onWidthChanged=L.setStrokeWidth,L.strokeStylePanel=new ut("Line style",B.defaultStrokeDasharrays,B.defaultStrokeDasharray),L.strokeStylePanel.onStyleChanged=L.setStrokeDasharray,L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.visual&&u!==this.selectorLine&&u!==this.visibleLine)},a.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorLine=Z.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=Z.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)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},a.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()),Z.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},a.prototype.setStrokeColor=function(u){this.strokeColor=u,this.adjustVisual(),this.colorChanged(u)},a.prototype.setStrokeWidth=function(u){this.strokeWidth=u,this.adjustVisual()},a.prototype.setStrokeDasharray=function(u){this.strokeDasharray=u,this.adjustVisual(),this.stateChanged()},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u);var D=u;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.createVisual(),this.adjustVisual()},a.typeName="LineMarker",a.title="Line marker",a.icon=' ',a}(Re),Ce=function(P){function a(u,D,B,L){var se=P.call(this,u,L||' ')||this;return se.fonts=[],se.fontBoxes=[],se.fonts=D,se.currentFont=B,se.setCurrentFont=se.setCurrentFont.bind(se),se}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");return D.style.overflow="hidden",D.style.flexGrow="2",this.fonts.forEach(function(B){var L=document.createElement("div");L.style.display="inline-block",L.style.alignItems="center",L.style.justifyContent="space-between",L.style.padding="5px",L.style.borderWidth="2px",L.style.borderStyle="solid",L.style.overflow="hidden",L.style.maxWidth=100/u.fonts.length-5+"%",L.style.borderColor=B===u.currentFont?u.uiStyleSettings.toolboxAccentColor:"transparent",L.addEventListener("click",function(){u.setCurrentFont(B,L)}),D.appendChild(L);var se=document.createElement("div");se.style.display="flex",se.style.minHeight="20px",se.style.flexGrow="2",se.style.fontFamily=B,se.style.overflow="hidden";var Ne=document.createElement("div");Ne.style.whiteSpace="nowrap",Ne.style.overflow="hidden",Ne.style.textOverflow="ellipsis",Ne.innerHTML="The quick brown fox jumps over the lazy dog",se.appendChild(Ne),L.appendChild(se),u.fontBoxes.push(L)}),D},a.prototype.setCurrentFont=function(u,D){var B=this;this.currentFont=u,this.fontBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},a}(Qe),Ae=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.color="transparent",L.padding=5,L.DEFAULT_TEXT="your text here",L.text=L.DEFAULT_TEXT,L.isMoved=!1,L.color=B.defaultColor,L.fontFamily=B.defaultFontFamily,L.defaultSize={x:100,y:30},L.setColor=L.setColor.bind(L),L.setFont=L.setFont.bind(L),L.renderText=L.renderText.bind(L),L.sizeText=L.sizeText.bind(L),L.textEditDivClicked=L.textEditDivClicked.bind(L),L.showTextEditor=L.showTextEditor.bind(L),L.setSize=L.setSize.bind(L),L.positionTextEditor=L.positionTextEditor.bind(L),L.colorPanel=new Ve("Color",B.defaultColorSet,B.defaultColor),L.colorPanel.onColorChanged=L.setColor,L.fontFamilyPanel=new Ce("Font",B.defaultFontFamilies,B.defaultFontFamily),L.fontFamilyPanel.onFontChanged=L.setFont,L}return xe(a,P),a.prototype.ownsTarget=function(u){if(P.prototype.ownsTarget.call(this,u)||u===this.visual||u===this.textElement||u===this.bgRectangle)return!0;var D=!1;return this.textElement.childNodes.forEach(function(B){B===u&&(D=!0)}),D},a.prototype.createVisual=function(){this.visual=Z.createGroup(),this.bgRectangle=Z.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=Z.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.textElement.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.isMoved=!1,this.pointerDownPoint=u,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(u),this._state="creating")},a.prototype.renderText=function(){var u=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(D){u.textElement.appendChild(Z.createTSpan(D.trim()===""?" ":D.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},a.prototype.getTextScale=function(){var u=this.textElement.getBBox(),D=1;if(u.width>0&&u.height>0){var B=(1*this.width-this.width*this.padding*2/100)/u.width,L=(1*this.height-this.height*this.padding*2/100)/u.height;D=Math.min(B,L)}return D},a.prototype.getTextPosition=function(u){var D=this.textElement.getBBox(),B=0,L=0;return D.width>0&&D.height>0&&(B=(this.width-D.width*u)/2,L=this.height/2-D.height*u/2),{x:B,y:L}},a.prototype.sizeText=function(){var u=this.textElement.getBBox(),D=this.getTextScale(),B=this.getTextPosition(D);B.y-=u.y*D,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+B.x+"px, "+B.y+"px) scale("+D+", "+D+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(B.x,B.y),this.textElement.transform.baseVal.getItem(1).setScale(D,D))},a.prototype.manipulate=function(u){P.prototype.manipulate.call(this,u),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(u.x-this.pointerDownPoint.x)>5||Math.abs(u.y-this.pointerDownPoint.y)>5)},a.prototype.resize=function(u){P.prototype.resize.call(this,u),this.isMoved=!0,this.setSize(),this.sizeText()},a.prototype.setSize=function(){P.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},a.prototype.pointerUp=function(u){var D=this.state;D==="creating"&&(this._suppressMarkerCreateEvent=!0),P.prototype.pointerUp.call(this,u),this.setSize(),(D==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},a.prototype.showTextEditor=function(){var u=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(D){D.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var D=Number.parseFloat(u.textEditor.style.fontSize);u.textEditor.clientWidth>=Number.parseInt(u.textEditor.style.maxWidth)&&D>.9;)D-=.1,u.textEditor.style.fontSize=Math.max(D,.9)+"em"}),this.textEditor.addEventListener("keyup",function(D){D.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(D){if(D.clipboardData){var B=D.clipboardData.getData("text"),L=window.getSelection();if(!L.rangeCount)return!1;L.deleteFromDocument(),L.getRangeAt(0).insertNode(document.createTextNode(B)),D.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){u.textEditDivClicked(u.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},a.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var u=this.getTextScale(),D=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),B=this.textElement.getBBox(),L={x:B.width*u,y:B.height*u};D.x-=L.x/2,D.y-=L.y/2,this.textEditor.style.top=D.y+"px",this.textEditor.style.left=D.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-D.x+"px",this.textEditor.style.fontSize=Math.max(16*u,12)+"px",this.textElement.style.display="none"}},a.prototype.textEditDivClicked=function(u){this.text=u.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},a.prototype.select=function(){P.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},a.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),P.prototype.deselect.call(this)},a.prototype.dblClick=function(u,D){P.prototype.dblClick.call(this,u,D),this.showTextEditor()},a.prototype.setColor=function(u){this.textElement&&Z.setAttributes(this.textElement,[["fill",u]]),this.color=u,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(u)},a.prototype.setFont=function(u){this.textElement&&Z.setAttributes(this.textElement,[["font-family",u]]),this.fontFamily=u,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},a.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},a.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){var D=u;this.color=D.color,this.fontFamily=D.fontFamily,this.padding=D.padding,this.text=D.text,this.createVisual(),P.prototype.restoreState.call(this,u),this.setSize()},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D),this.setSize(),this.sizeText(),this.positionTextEditor()},a.typeName="TextMarker",a.title="Text marker",a.icon=' ',a}(lt),ae=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.color="transparent",L.lineWidth=3,L.drawing=!1,L.pixelRatio=1,L.color=B.defaultColor,L.lineWidth=B.defaultStrokeWidth,L.pixelRatio=B.freehandPixelRatio,L.setColor=L.setColor.bind(L),L.addCanvas=L.addCanvas.bind(L),L.finishCreation=L.finishCreation.bind(L),L.setLineWidth=L.setLineWidth.bind(L),L.colorPanel=new Ve("Color",B.defaultColorSet,B.defaultColor),L.colorPanel.onColorChanged=L.setColor,L.lineWidthPanel=new ht("Line width",B.defaultStrokeWidths,B.defaultStrokeWidth),L.lineWidthPanel.onWidthChanged=L.setLineWidth,L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.visual&&u!==this.drawingImage)},a.prototype.createVisual=function(){this.visual=Z.createGroup(),this.drawingImage=Z.createImage(),this.visual.appendChild(this.drawingImage);var u=Z.createTransform();this.visual.transform.baseVal.appendItem(u),this.addMarkerVisualToContainer(this.visual)},a.prototype.pointerDown=function(u,D){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(u.x,u.y),this.drawing=!0):P.prototype.pointerDown.call(this,u,D)},a.prototype.manipulate=function(u){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(u.x,u.y),this.canvasContext.stroke()):P.prototype.manipulate.call(this,u)},a.prototype.resize=function(u){P.prototype.resize.call(this,u),Z.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},a.prototype.pointerUp=function(u){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):P.prototype.pointerUp.call(this,u)},a.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)},a.prototype.select=function(){this.state==="creating"&&this.finishCreation(),P.prototype.select.call(this)},a.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),P.prototype.deselect.call(this)},a.prototype.finishCreation=function(){for(var u=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),D=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],B=D[0],L=D[1],se=D[2],Ne=D[3],tt=!1,pt=0;pt0&&(tt=!0,ptNe&&(Ne=pt),We>se&&(se=We));if(tt){this.left=B/this.pixelRatio,this.top=L/this.pixelRatio,this.width=(se-B)/this.pixelRatio,this.height=(Ne-L)/this.pixelRatio;var bt=document.createElement("canvas");bt.width=se-B,bt.height=Ne-L,bt.getContext("2d").putImageData(this.canvasContext.getImageData(B,L,se-B,Ne-L),0,0),this.drawingImgUrl=bt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},a.prototype.setDrawingImage=function(){Z.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),Z.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},a.prototype.setColor=function(u){this.color=u,this.colorChanged(u)},a.prototype.setLineWidth=function(u){this.lineWidth=u},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({drawingImgUrl:this.drawingImgUrl},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){this.createVisual(),P.prototype.restoreState.call(this,u),this.drawingImgUrl=u.drawingImgUrl,this.setDrawingImage()},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D),this.setDrawingImage()},a.typeName="FreehandMarker",a.title="Freehand marker",a.icon=' ',a}(lt),ee=function(P){function a(u,D,B){var L=P.call(this,u,B||' ')||this;return L.typeBoxes=[],L.currentType=D,L.setCurrentType=L.setCurrentType.bind(L),L}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2";for(var B=function(Ne){var tt="both";switch(Ne){case 0:tt="both";break;case 1:tt="start";break;case 2:tt="end";break;case 3:tt="none"}var pt=document.createElement("div");if(pt.style.display="flex",pt.style.flexGrow="2",pt.style.alignItems="center",pt.style.justifyContent="space-between",pt.style.padding="5px",pt.style.borderWidth="2px",pt.style.borderStyle="solid",pt.style.borderColor=tt===L.currentType?L.uiStyleSettings.toolboxAccentColor:"transparent",pt.addEventListener("click",function(){u.setCurrentType(tt,pt)}),D.appendChild(pt),tt==="both"||tt==="start"){var We=document.createElement("div");We.style.display="flex",We.style.alignItems="center",We.style.minHeight="20px",We.innerHTML=`
`,We.style.marginLeft="5px",pt.appendChild(We)}var bt=document.createElement("div");bt.style.display="flex",bt.style.alignItems="center",bt.style.minHeight="20px",bt.style.flexGrow="2";var Tt=document.createElement("hr");if(Tt.style.minWidth="20px",Tt.style.border="0px",Tt.style.borderTop="3px solid "+(L.uiStyleSettings!==void 0?L.uiStyleSettings.toolboxColor:"#eeeeee"),Tt.style.flexGrow="2",bt.appendChild(Tt),pt.appendChild(bt),tt==="both"||tt==="end"){var Qt=document.createElement("div");Qt.style.display="flex",Qt.style.alignItems="center",Qt.style.minHeight="20px",Qt.innerHTML=`
`,Qt.style.marginRight="5px",pt.appendChild(Qt)}L.typeBoxes.push(pt)},L=this,se=0;se<4;se++)B(se);return D},a.prototype.setCurrentType=function(u,D){var B=this;this.currentType=u,this.typeBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings!==void 0?B.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},a}(Qe),te=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.arrowType="end",L.arrowBaseHeight=10,L.arrowBaseWidth=10,L.getArrowPoints=L.getArrowPoints.bind(L),L.setArrowType=L.setArrowType.bind(L),L.arrowTypePanel=new ee("Arrow type","end"),L.arrowTypePanel.onArrowTypeChanged=L.setArrowType,L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.arrow1&&u!==this.arrow2)},a.prototype.getArrowPoints=function(u,D){var B=this.arrowBaseWidth+2*this.strokeWidth,L=this.arrowBaseHeight+2*this.strokeWidth;return u-B/2+","+(D+L/2)+" "+u+","+(D-L/2)+" "+(u+B/2)+","+(D+L/2)},a.prototype.createTips=function(){this.arrow1=Z.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=Z.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(Z.createTransform()),this.visual.appendChild(this.arrow2)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="creating"&&this.createTips()},a.prototype.adjustVisual=function(){if(P.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",Z.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),Z.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var u=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.arrow1.transform.baseVal.getItem(0);D.setRotate(u,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(D,0);var B=this.arrow2.transform.baseVal.getItem(0);B.setRotate(u+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(B,0)}},a.prototype.setArrowType=function(u){this.arrowType=u,this.adjustVisual(),this.stateChanged()},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({arrowType:this.arrowType},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u);var D=u;this.arrowType=D.arrowType,this.createTips(),this.adjustVisual()},a.typeName="ArrowMarker",a.title="Arrow marker",a.icon=' ',a}(Ie),H=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.fillColor=B.defaultFillColor,L.strokeWidth=0,L.fillPanel=new Ve("Color",B.defaultColorSet,B.defaultFillColor),L.fillPanel.onColorChanged=L.setFillColor,L}return xe(a,P),Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=P.prototype.getState.call(this);return u.typeName=a.typeName,u},a.typeName="CoverMarker",a.title="Cover marker",a.icon=' ',a}(nt),G=function(P){function a(u,D,B,L){var se=P.call(this,u,L||' ')||this;return se.opacities=[],se.opacityBoxes=[],se.opacities=D,se.currentOpacity=B,se.setCurrentOpacity=se.setCurrentOpacity.bind(se),se}return xe(a,P),a.prototype.getUi=function(){var u=this,D=document.createElement("div");return D.style.display="flex",D.style.overflow="hidden",D.style.flexGrow="2",D.style.justifyContent="space-between",this.opacities.forEach(function(B){var L=document.createElement("div");L.style.display="flex",L.style.alignItems="center",L.style.justifyContent="center",L.style.padding="5px",L.style.borderWidth="2px",L.style.borderStyle="solid",L.style.borderColor=B===u.currentOpacity?u.uiStyleSettings.toolboxAccentColor:"transparent",L.addEventListener("click",function(){u.setCurrentOpacity(B,L)}),D.appendChild(L);var se=document.createElement("div");se.innerText=100*B+"%",L.appendChild(se),u.opacityBoxes.push(L)}),D},a.prototype.setCurrentOpacity=function(u,D){var B=this;this.currentOpacity=u,this.opacityBoxes.forEach(function(L){L.style.borderColor=L===D?B.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},a}(Qe),V=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.setOpacity=L.setOpacity.bind(L),L.fillColor=B.defaultHighlightColor,L.strokeWidth=0,L.opacity=B.defaultHighlightOpacity,L.fillPanel=new Ve("Color",B.defaultColorSet,L.fillColor),L.fillPanel.onColorChanged=L.setFillColor,L.opacityPanel=new G("Opacity",B.defaultOpacitySteps,L.opacity),L.opacityPanel.onOpacityChanged=L.setOpacity,L}return xe(a,P),a.prototype.setOpacity=function(u){this.opacity=u,this.visual&&Z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=P.prototype.getState.call(this);return u.typeName=a.typeName,u},a.typeName="HighlightMarker",a.title="Highlight marker",a.icon=' ',a}(H),Q=' ',de=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.bgColor="transparent",L.tipPosition={x:0,y:0},L.tipBase1Position={x:0,y:0},L.tipBase2Position={x:0,y:0},L.tipMoving=!1,L.color=B.defaultStrokeColor,L.bgColor=B.defaultFillColor,L.fontFamily=B.defaultFontFamily,L.defaultSize={x:100,y:30},L.setBgColor=L.setBgColor.bind(L),L.getTipPoints=L.getTipPoints.bind(L),L.positionTip=L.positionTip.bind(L),L.setTipPoints=L.setTipPoints.bind(L),L.colorPanel=new Ve("Text color",B.defaultColorSet,L.color,' '),L.colorPanel.onColorChanged=L.setColor,L.bgColorPanel=new Ve("Fill color",B.defaultColorSet,L.bgColor,Q),L.bgColorPanel.onColorChanged=L.setBgColor,L.fontFamilyPanel=new Ce("Font",B.defaultFontFamilies,B.defaultFontFamily),L.fontFamilyPanel.onFontChanged=L.setFont,L.tipGrip=new ct,L.tipGrip.visual.transform.baseVal.appendItem(Z.createTransform()),L.controlBox.appendChild(L.tipGrip.visual),L}return xe(a,P),a.prototype.ownsTarget=function(u){return P.prototype.ownsTarget.call(this,u)||this.tipGrip.ownsTarget(u)||this.tip===u},a.prototype.createTip=function(){Z.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=Z.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},a.prototype.pointerDown=function(u,D){this.state==="new"&&P.prototype.pointerDown.call(this,u,D),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(D)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):P.prototype.pointerDown.call(this,u,D)},a.prototype.pointerUp=function(u){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,P.prototype.pointerUp.call(this,u);else{var D=this.state==="creating";P.prototype.pointerUp.call(this,u),this.setTipPoints(D),this.positionTip()}},a.prototype.manipulate=function(u){if(this.tipMoving){var D=this.unrotatePoint(u);this.tipPosition={x:D.x-this.manipulationStartLeft,y:D.y-this.manipulationStartTop},this.positionTip()}else P.prototype.manipulate.call(this,u)},a.prototype.setBgColor=function(u){this.bgRectangle&&this.tip&&(Z.setAttributes(this.bgRectangle,[["fill",u]]),Z.setAttributes(this.tip,[["fill",u]])),this.bgColor=u,this.fillColorChanged(u)},a.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},a.prototype.setTipPoints=function(u){u===void 0&&(u=!1);var D=Math.min(this.height/2,15),B=this.height/5;u&&(this.tipPosition={x:D+B/2,y:this.height+20});var L=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?L ',a}(Ae),ge=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.fillColor="transparent",L.strokeColor="transparent",L.strokeWidth=0,L.strokeDasharray="",L.opacity=1,L.strokeColor=B.defaultColor,L.strokeWidth=B.defaultStrokeWidth,L.strokeDasharray=B.defaultStrokeDasharray,L.fillColor=B.defaultFillColor,L.setStrokeColor=L.setStrokeColor.bind(L),L.setFillColor=L.setFillColor.bind(L),L.setStrokeWidth=L.setStrokeWidth.bind(L),L.setStrokeDasharray=L.setStrokeDasharray.bind(L),L.setOpacity=L.setOpacity.bind(L),L.createVisual=L.createVisual.bind(L),L.strokePanel=new Ve("Line color",ce(B.defaultColorSet,["transparent"]),B.defaultColor),L.strokePanel.onColorChanged=L.setStrokeColor,L.fillPanel=new Ve("Fill color",ce(B.defaultColorSet,["transparent"]),L.fillColor,Q),L.fillPanel.onColorChanged=L.setFillColor,L.strokeWidthPanel=new ht("Line width",B.defaultStrokeWidths,B.defaultStrokeWidth),L.strokeWidthPanel.onWidthChanged=L.setStrokeWidth,L.strokeStylePanel=new ut("Line style",B.defaultStrokeDasharrays,B.defaultStrokeDasharray),L.strokeStylePanel.onStyleChanged=L.setStrokeDasharray,L.opacityPanel=new G("Opacity",B.defaultOpacitySteps,L.opacity),L.opacityPanel.onOpacityChanged=L.setOpacity,L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.visual)},a.prototype.createVisual=function(){this.visual=Z.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)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="new"&&(this.createVisual(),this.moveVisual(u),this._state="creating")},a.prototype.manipulate=function(u){P.prototype.manipulate.call(this,u)},a.prototype.resize=function(u){P.prototype.resize.call(this,u),this.setSize()},a.prototype.setSize=function(){P.prototype.setSize.call(this),Z.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},a.prototype.pointerUp=function(u){P.prototype.pointerUp.call(this,u),this.setSize()},a.prototype.setStrokeColor=function(u){this.strokeColor=u,this.visual&&Z.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(u),this.stateChanged()},a.prototype.setFillColor=function(u){this.fillColor=u,this.visual&&Z.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(u),this.stateChanged()},a.prototype.setStrokeWidth=function(u){this.strokeWidth=u,this.visual&&Z.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},a.prototype.setStrokeDasharray=function(u){this.strokeDasharray=u,this.visual&&Z.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},a.prototype.setOpacity=function(u){this.opacity=u,this.visual&&Z.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){var D=u;this.fillColor=D.fillColor,this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.opacity=D.opacity,this.createVisual(),P.prototype.restoreState.call(this,u),this.setSize()},a.prototype.scale=function(u,D){P.prototype.scale.call(this,u,D),this.setSize()},a.typeName="EllipseMarker",a.title="Ellipse marker",a.icon=' ',a}(lt),Me=function(P){function a(u,D,B){return P.call(this,u,D,B)||this}return xe(a,P),Object.defineProperty(a.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.tip1&&u!==this.tip2)},a.prototype.createTips=function(){this.tip1=Z.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(Z.createTransform()),this.visual.appendChild(this.tip1),this.tip2=Z.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(Z.createTransform()),this.visual.appendChild(this.tip2)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.state==="creating"&&this.createTips()},a.prototype.adjustVisual=function(){if(P.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(Z.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()]]),Z.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 u=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),D=this.tip1.transform.baseVal.getItem(0);D.setRotate(u,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(D,0);var B=this.tip2.transform.baseVal.getItem(0);B.setRotate(u+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(B,0)}},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=P.prototype.getState.call(this);return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u),this.createTips(),this.adjustVisual()},a.typeName="MeasurementMarker",a.title="Measurement marker",a.icon=' ',a}(Ie),et=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.strokePanel.colors=B.defaultColorSet,L.fillColor="transparent",L}return xe(a,P),Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=P.prototype.getState.call(this);return u.typeName=a.typeName,u},a.typeName="EllipseFrameMarker",a.title="Ellipse frame marker",a.icon=' ',a}(ge),dt=function(){function P(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(P.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),P.prototype.addUndoStep=function(a){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(a)||(this.undoStack.push(a),JSON.stringify(this.lastRedoStep)!==JSON.stringify(a)&&this.redoStack.splice(0,this.redoStack.length))},P.prototype.replaceLastUndoStep=function(a){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=a)},P.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},P.prototype.undo=function(){if(this.undoStack.length>1){var a=this.undoStack.pop();return a!==void 0&&this.redoStack.push(a),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},P.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},P}(),qe=function(P){function a(u,D,B){var L=P.call(this,u,D,B)||this;return L.strokeColor="transparent",L.strokeWidth=0,L.strokeDasharray="",L.curveX=0,L.curveY=0,L.manipulationStartCurveX=0,L.manipulationStartCurveY=0,L.setStrokeColor=L.setStrokeColor.bind(L),L.setStrokeWidth=L.setStrokeWidth.bind(L),L.setStrokeDasharray=L.setStrokeDasharray.bind(L),L.positionGrips=L.positionGrips.bind(L),L.addControlGrips=L.addControlGrips.bind(L),L.adjustVisual=L.adjustVisual.bind(L),L.setupControlBox=L.setupControlBox.bind(L),L.resize=L.resize.bind(L),L.strokeColor=B.defaultColor,L.strokeWidth=B.defaultStrokeWidth,L.strokeDasharray=B.defaultStrokeDasharray,L.strokePanel=new Ve("Line color",B.defaultColorSet,B.defaultColor),L.strokePanel.onColorChanged=L.setStrokeColor,L.strokeWidthPanel=new ht("Line width",B.defaultStrokeWidths,B.defaultStrokeWidth),L.strokeWidthPanel.onWidthChanged=L.setStrokeWidth,L.strokeStylePanel=new ut("Line style",B.defaultStrokeDasharrays,B.defaultStrokeDasharray),L.strokeStylePanel.onStyleChanged=L.setStrokeDasharray,L}return xe(a,P),a.prototype.ownsTarget=function(u){return!(!P.prototype.ownsTarget.call(this,u)&&u!==this.visual&&u!==this.selectorCurve&&u!==this.visibleCurve&&!this.curveGrip.ownsTarget(u))},a.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},a.prototype.createVisual=function(){this.visual=Z.createGroup(),this.selectorCurve=Z.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=Z.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)},a.prototype.pointerDown=function(u,D){P.prototype.pointerDown.call(this,u,D),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=u.x,this.curveY=u.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(D)&&(this.activeGrip=this.curveGrip,this._state="resize")},a.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),Z.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),Z.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),Z.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},a.prototype.setupControlBox=function(){P.prototype.setupControlBox.call(this),this.curveControlLine1=Z.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=Z.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)},a.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,P.prototype.addControlGrips.call(this)},a.prototype.positionGrips=function(){P.prototype.positionGrips.call(this);var u=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-u/2,this.curveY-u/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()))},a.prototype.manipulate=function(u){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+u.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+u.y-this.manipulationStartY),P.prototype.manipulate.call(this,u)},a.prototype.resize=function(u){this.activeGrip===this.curveGrip&&(this.curveX=u.x,this.curveY=u.y),P.prototype.resize.call(this,u),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},a.prototype.setStrokeColor=function(u){this.strokeColor=u,this.adjustVisual(),this.colorChanged(u)},a.prototype.setStrokeWidth=function(u){this.strokeWidth=u,this.adjustVisual()},a.prototype.setStrokeDasharray=function(u){this.strokeDasharray=u,this.adjustVisual()},a.prototype.scale=function(u,D){this.curveX=this.curveX*u,this.curveY=this.curveY*D,P.prototype.scale.call(this,u,D)},Object.defineProperty(a.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),a.prototype.getState=function(){var u=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},P.prototype.getState.call(this));return u.typeName=a.typeName,u},a.prototype.restoreState=function(u){P.prototype.restoreState.call(this,u);var D=u;this.strokeColor=D.strokeColor,this.strokeWidth=D.strokeWidth,this.strokeDasharray=D.strokeDasharray,this.curveX=D.curveX,this.curveY=D.curveY,this.createVisual(),this.adjustVisual()},a.typeName="CurveMarker",a.title="Curve marker",a.icon=' ',a}(Re),Ct=function(){function P(a,u){u===void 0&&(u=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=a,this.cancelable=u}return Object.defineProperty(P.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),P.prototype.preventDefault=function(){this._defaultPrevented=!0},P}(),_t=function(P){function a(u,D,B){var L=P.call(this,u,!1)||this;return L.dataUrl=D,L.state=B,L}return xe(a,P),a}(Ct),ot=function(P){function a(u,D,B){B===void 0&&(B=!1);var L=P.call(this,u,B)||this;return L.marker=D,L}return xe(a,P),a}(Ct),It=function(){function P(){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 P.prototype.addEventListener=function(a,u){this[a].push(u)},P.prototype.removeEventListener=function(a,u){var D=this[a].indexOf(u);D>-1&&this[a].splice(D,1)},P}(),At=function(){function P(a){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new ye,this._isOpen=!1,this.undoRedoManager=new dt,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 It,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=P.instanceCounter++,this.styles=new Ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=a,this.targetRoot=document.body,this.width=a.clientWidth,this.height=a.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(P.prototype,"ALL_MARKER_TYPES",{get:function(){return[fe,ae,te,Ae,et,ge,V,de,Me,H,Ie,qe]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[fe,ae,te,Ae,ge,V,de]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"BASIC_MARKER_TYPES",{get:function(){return[fe,ae,te,Ae,V]},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(a){var u=this;this._availableMarkerTypes.splice(0),a.forEach(function(D){if(typeof D=="string"){var B=u.ALL_MARKER_TYPES.find(function(L){return L.typeName===D});B!==void 0&&u._availableMarkerTypes.push(B)}else u._availableMarkerTypes.push(D)})},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(a){this._zoomLevel=a,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(P.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),P.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),je.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},P.prototype.show=function(){var a=this;this.styles.styleSheetRoot===void 0&&rt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=rt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(u){return u(new Ct(a))})},P.prototype.render=function(){return _e(this,void 0,void 0,function(){var a;return Oe(this,function(u){switch(u.label){case 0:return this.setCurrentMarker(),(a=new at).naturalSize=this.renderAtNaturalSize,a.imageType=this.renderImageType,a.imageQuality=this.renderImageQuality,a.markersOnly=this.renderMarkersOnly,a.width=this.renderWidth,a.height=this.renderHeight,[4,a.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return u.sent(),[4,a.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,u.sent()]}})})},P.prototype.close=function(a){var u=this;if(a===void 0&&(a=!1),this.isOpen){var D=!1;a||this.eventListeners.beforeclose.forEach(function(B){var L=new Ct(u,!0);B(L),L.defaultPrevented&&(D=!0)}),D||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(B){return B(new Ct(u))}),this.detachEvents(),this._isOpen=!1)}},P.prototype.addMarkersToToolbar=function(){for(var a,u=[],D=0;Dthis.editorCanvas.clientHeight?this.editorCanvas.clientHeight*a:this.editorCanvas.clientWidth,D=u ',a.title="Powered by marker.js",a.style.display="grid",a.style.alignItems="center",a.style.justifyItems="center",a.style.padding="3px",a.style.width="20px",a.style.height="20px",this.logoUI.appendChild(a),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},P.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?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")},P.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"},P.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},P.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&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 a=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=a+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?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=this.uiStyleSettings.zIndex!==void 0?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=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Fe(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",this.settings.displayMode==="popup"&&(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",this.settings.displayMode==="popup"&&(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(a),1),a.dispose()},P.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},P.prototype.toolbarButtonClicked=function(a,u){if(a==="marker"&&u!==void 0)this.createNewMarker(u);else if(a==="action")switch(u){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":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},P.prototype.deleteSelectedMarker=function(){var a=this;if(this._currentMarker!==void 0){var u=!1;if(this.eventListeners.markerbeforedelete.forEach(function(B){var L=new ot(a,a._currentMarker,!0);B(L),L.defaultPrevented&&(u=!0)}),!u){var D=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(B){return B(new ot(a,D))})}}},P.prototype.clear=function(){var a=this,u=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(se){var Ne=new ot(a,void 0,!0);se(Ne),Ne.defaultPrevented&&(u=!0)}),!u)){this.setCurrentMarker();for(var D=function(se){var Ne=B.markers[se];B.setCurrentMarker(B.markers[se]),B._currentMarker.dispose(),B.markerImage.removeChild(B._currentMarker.container),B.markers.splice(B.markers.indexOf(B._currentMarker),1),B.eventListeners.markerdelete.forEach(function(tt){return tt(new ot(a,Ne))})},B=this,L=this.markers.length-1;L>=0;L--)D(L);this.addUndoStep()}},Object.defineProperty(P.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),P.prototype.showNotesEditor=function(){var a;this._currentMarker!==void 0&&(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=(a=this._currentMarker.notes)!==null&&a!==void 0?a:"",this.overlayContainer.appendChild(this.notesArea))},P.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},P.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},P.prototype.addUndoStep=function(){var a=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var u=this.getState(),D=this.undoRedoManager.getLastUndoStep();if(!D||D.width===u.width&&D.height===u.height){var B=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(u),B1&&this.panTo({x:a.clientX,y:a.clientY}))},P.prototype.onPointerUp=function(a){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(a.clientX,a.clientY)),this.isDragging=!1,this.addUndoStep()},P.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},P.prototype.onKeyUp=function(a){this._currentMarker===void 0||this.notesArea!==void 0||a.key!=="Delete"&&a.key!=="Backspace"||this.deleteSelectedMarker()},P.prototype.clientToLocalCoordinates=function(a,u){var D=this.markerImage.getBoundingClientRect();return{x:(a-D.left)/this.zoomLevel,y:(u-D.top)/this.zoomLevel}},P.prototype.onWindowResize=function(){this.positionUI()},P.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var a=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=a+"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()},P.prototype.addLicenseKey=function(a){je.addKey(a)},P.prototype.addEventListener=function(a,u){this.eventListeners.addEventListener(a,u)},P.prototype.removeEventListener=function(a,u){this.eventListeners.removeEventListener(a,u)},P.prototype.renderState=function(a){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(a),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(P.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),P.prototype.focus=function(){var a=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(u){return u(new Ct(a))}))},P.prototype.blur=function(){var a=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(u){return u(new Ct(a))}))},P.instanceCounter=0,P}();/* **********************************
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.
***************************************************************************** */var Ot=function(P,a){return(Ot=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,D){u.__proto__=D}||function(u,D){for(var B in D)Object.prototype.hasOwnProperty.call(D,B)&&(u[B]=D[B])})(P,a)};function Wt(P,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");function u(){this.constructor=P}Ot(P,a),P.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}function gt(P,a,u,D){return new(u||(u=Promise))(function(B,L){function se(pt){try{tt(D.next(pt))}catch(We){L(We)}}function Ne(pt){try{tt(D.throw(pt))}catch(We){L(We)}}function tt(pt){var We;pt.done?B(pt.value):(We=pt.value,We instanceof u?We:new u(function(bt){bt(We)})).then(se,Ne)}tt((D=D.apply(P,a||[])).next())})}function Bt(P,a){var u,D,B,L,se={label:0,sent:function(){if(1&B[0])throw B[1];return B[1]},trys:[],ops:[]};return L={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(L[Symbol.iterator]=function(){return this}),L;function Ne(tt){return function(pt){return function(We){if(u)throw new TypeError("Generator is already executing.");for(;se;)try{if(u=1,D&&(B=2&We[0]?D.return:We[0]?D.throw||((B=D.return)&&B.call(D),0):D.next)&&!(B=B.call(D,We[1])).done)return B;switch(D=0,B&&(We=[2&We[0],B.value]),We[0]){case 0:case 1:B=We;break;case 4:return se.label++,{value:We[1],done:!1};case 5:se.label++,D=We[1],We=[0];continue;case 7:We=se.ops.pop(),se.trys.pop();continue;default:if(!(B=se.trys,(B=B.length>0&&B[B.length-1])||We[0]!==6&&We[0]!==2)){se=0;continue}if(We[0]===3&&(!B||We[1]>B[0]&&We[1]0&&u>0){var D=new Mr(a,u),B=D.ratio>=1?20:D.getHorizontalLength(20),L=D.ratio<1?20:D.getVerticalLength(20),se=document.createElementNS("http://www.w3.org/2000/svg","svg");se.setAttribute("xmlns","http://www.w3.org/2000/svg"),se.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(se);var Ne=Ze.createDefs();se.appendChild(Ne);var tt=Ze.createElement("clipPath",[["id","text-bg-clip"]]);Ne.appendChild(tt);var pt=Ze.createPath(Ze.getHollowRectanglePath((24-B)/2,(24-L)/2,B,L,(24-B)/2+2,(24-L)/2+2,B-4,L-4));se.appendChild(pt);var We=Ze.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);We.appendChild(Ze.createTSpan(a+":"+u)),se.appendChild(We);var bt=We.getBBox();Ze.setAttributes(We,[["x",((24-bt.width)/2).toString()],["y",((24-bt.height)/2-bt.y).toString()]]);var Tt=Ze.createPath(Ze.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(bt.width))/2,(24-Math.ceil(bt.height))/2,Math.ceil(bt.width),Math.ceil(bt.height)));return tt.appendChild(Tt),Ze.setAttributes(pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(se),se.outerHTML}return' '},P}(),Kr=function(P){function a(u,D,B){var L=P.call(this,u,D)||this;return L.isDropdownOpen=!1,L.onClick=L.dropdownButtonClicked,L.dropdownButtons=B,L}return Wt(a,P),a.prototype.setupDropdown=function(){var u=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(D){D.className=u.className,D.colorsClassName=u.colorsClassName,u.dropdownBlock.appendChild(D.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},a.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},a.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},a.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},a.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},a.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},a}(yr),Sr=function(){function P(a,u){this.GRIP_SIZE=10,this.color=a,this.fillColor=u,this.visual=Ze.createGroup(),this.visual.appendChild(Ze.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ze.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return P.prototype.ownsTarget=function(a){return a===this.visual||a===this.visual.childNodes[0]||a===this.visual.childNodes[1]},P.prototype.setCenter=function(a,u){this.visual.childNodes.forEach(function(D){return Ze.setAttributes(D,[["cx",a.toString()],["cy",u.toString()]])})},P}(),_r=function(){function P(a,u,D,B){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=a,this.canvasHeight=u,this.margin=D,this.container=B,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(P.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(a){this._aspectRatio=a,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(a){this._isGridVisible=a,this.gridContainer&&Ze.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(a){this._zoomFactor=a,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),P.prototype.open=function(){var a=this;this.cropShadeElement=Ze.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ze.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var u=0;uthis.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-u.height/2),Ze.setAttributes(this.cropRectElement,[["x",u.x.toString()],["y",u.y.toString()],["width",u.width.toString()],["height",u.height.toString()]]);var D=u.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(L,se){var Ne=u.y+D*(se+1);Ze.setAttributes(L,[["x1",""+u.x],["y1",""+Ne],["x2",""+(u.x+u.width)],["y2",""+Ne]])});var B=u.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(L,se){var Ne=u.x+B*(se+1);Ze.setAttributes(L,[["x1",""+Ne],["y1",""+u.y],["x2",""+Ne],["y2",""+(u.y+u.height)]])}),Ze.setAttributes(this.cropShadeElement,[["d",Ze.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,u.x,u.y,u.width,u.height)]]),this.topLeftGrip.setCenter(u.x,u.y),this.topRightGrip.setCenter(u.x+u.width,u.y),this.bottomLeftGrip.setCenter(u.x,u.y+u.height),this.bottomRightGrip.setCenter(u.x+u.width,u.y+u.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},P.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)},P.prototype.clientToLocalCoordinates=function(a,u){var D=this.container.getBoundingClientRect();return{x:a-D.left+this.margin,y:u-D.top+this.margin}},P.prototype.onPointerDown=function(a){this.container.setPointerCapture(a.pointerId),this.previousPoint=this.clientToLocalCoordinates(a.clientX,a.clientY),this.cropRectElement===a.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(a.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(a.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(a.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(a.target)&&(this.activeGrip=this.bottomRightGrip)},P.prototype.onPointerMove=function(a){if(this.isMoving)this.move(this.clientToLocalCoordinates(a.clientX,a.clientY));else if(this.activeGrip){var u=this.clientToLocalCoordinates(a.clientX,a.clientY);this.resize(u)}a.preventDefault()},P.prototype.onPointerUp=function(a){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(a.pointerId)},P.prototype.move=function(a){var u=a.x-this.previousPoint.x,D=a.y-this.previousPoint.y;this.zoomFactor!==1&&(u=-u/this.zoomFactor,D=-D/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+u),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+D),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=a},P.prototype.resize=function(a){var u=Object.assign({},this.cropRect),D=a.x-this.previousPoint.x,B=a.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:u.x+Dthis.canvasWidth*this.zoomFactor&&(D=this.canvasWidth*this.zoomFactor-u.width),u.width+=D}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(u.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(D),u.height=this.aspectRatio.getVerticalLength(u.width)):(u.y+=B,u.height=this.cropRect.y+this.cropRect.height-u.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?u.height=this.aspectRatio.getVerticalLength(u.width):u.height+=B}u.width<10&&(u.x=this.cropRect.x,u.width=10),u.height<10&&(u.y=this.cropRect.y,u.height=10),this.previousPoint=a,u.x>=this.margin&&u.y>=this.margin&&u.x-this.margin+u.width<=this.canvasWidth&&u.y-this.margin+u.height<=this.canvasHeight&&(this.cropRect=u,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},P.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var a=this.cropRect.x+this.cropRect.width/2,u=this.cropRect.y+this.cropRect.height/2,D=this.aspectRatio.getHorizontalLength(this.cropRect.height),B=this.aspectRatio.getVerticalLength(this.cropRect.width);D/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=a-this.cropRect.width/2,this.cropRect.y=u-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)}},P.prototype.getRescaledRect=function(a,u,D,B,L,se){var Ne=D/a,tt=B/u;return{x:(L.x-se)*Ne+se,y:(L.y-se)*tt+se,width:L.width*Ne,height:L.height*tt}},P.prototype.scaleCanvas=function(a,u){var D=this.getRescaledRect(this.canvasWidth,this.canvasHeight,a,u,this.cropRect,this.margin);this.canvasWidth=a,this.canvasHeight=u,this.onCropChange&&this.onCropChange(D),this.setCropRectangle(D)},P}(),tn=function(){function P(a){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=a,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(P.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),P.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},P.prototype.onPointerDown=function(a){this.controlContainer.setPointerCapture(a.pointerId),this.isDragging=!0,this.previousPoint={x:a.clientX,y:a.clientY}},P.prototype.onPointerMove=function(a){this.isDragging&&(this.onAngleChange&&this.onAngleChange((a.clientX-this.previousPoint.x)/5),this.previousPoint.x=a.clientX)},P.prototype.onPointerUp=function(a){this.isDragging&&this.onAngleChange&&this.onAngleChange((a.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(a.pointerId)},P.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var a=this.angleLabelText.getBBox();Ze.setAttributes(this.angleLabelElement,[["x",((this.width-a.width)/2).toString()],["y",(this.height/2).toString()]])}},P.prototype.positionScaleShape=function(){if(this.scaleShape){var a=this.scaleShape.transform.baseVal.getItem(0);a.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(a,0)}},P.prototype.getVisual=function(){var a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("width",this.width+"px"),a.setAttribute("height",this.height+"px"),a.setAttribute("viewBox","0 0 "+this.width+" "+this.height),a.style.flexShrink="0",document.body.appendChild(a);for(var u="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,D=1;D<=this.width/5+10;D++){var B=D%5==0?this.height/3:this.height/6;u+="h4v"+-B+"h1v"+B}u+="v1H0Z",this.scaleShape=Ze.createPath(u);var L=Ze.createTransform();this.scaleShape.transform.baseVal.appendItem(L),a.appendChild(this.scaleShape),this.angleLabelElement=Ze.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ze.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var se=Ze.createTSpan("");return se.innerHTML="°",this.angleLabelElement.appendChild(se),a.appendChild(this.angleLabelElement),document.body.removeChild(a),a},P}(),Ur=function(){function P(){this.naturalSize=!1,this.imageType="image/png"}return P.prototype.rasterize=function(a,u,D,B,L,se,Ne){var tt=this;return new Promise(function(pt){var We=document.createElement("canvas");We.width=a.width.baseVal.value-2*B,We.height=a.height.baseVal.value-2*B;var bt=1,Tt=1;tt.naturalSize===!0?(bt=u.naturalWidth/(a.width.baseVal.value-2*B)/se,Tt=u.naturalHeight/(a.height.baseVal.value-2*B)/Ne,We.width=u.naturalWidth/se,We.height=u.naturalHeight/Ne):tt.width!==void 0&&tt.height!==void 0&&(bt=tt.width/D.width,Tt=tt.height/D.height,We.width*=bt,We.height*=Tt);var Qt=We.getContext("2d");Qt.translate(We.width/2,We.height/2),Qt.rotate(L*Math.PI/180),Qt.scale(se,Ne),Qt.translate(-We.width/2,-We.height/2),Qt.drawImage(u,0,0,We.width,We.height);var De=document.createElement("canvas");De.width=D.width*bt,De.height=D.height*Tt,De.getContext("2d").putImageData(Qt.getImageData((D.x-B)*bt,(D.y-B)*Tt,D.width*bt,D.height*Tt),0,0),pt(De.toDataURL(tt.imageType,tt.imageQuality))})},P}(),wt=function(){function P(a){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=P.instanceCounter++,this.styles=new Yt(this.instanceNo),this.target=a,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(P.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(a){this._zoomToCropEnabled=a,a?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(a){this._isGridVisible=a,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"gridLines",{get:function(){return this._gridLines},set:function(a){this._gridLines=a,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(a){this._rotationAngle=a,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"aspectRatio",{get:function(){var a;return(a=this._aspectRatio)!==null&&a!==void 0?a:this.aspectRatios[0]},set:function(a){this._aspectRatio=a},enumerable:!1,configurable:!0}),P.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(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},P.prototype.show=function(){this.showUI(),this.open()},P.prototype.close=function(a){a===void 0&&(a=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),a||this.closeEventListeners.forEach(function(u){return u()}),this._isOpen=!1)},P.prototype.addRenderEventListener=function(a){this.renderEventListeners.push(a)},P.prototype.removeRenderEventListener=function(a){this.renderEventListeners.indexOf(a)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(a),1)},P.prototype.addCloseEventListener=function(a){this.closeEventListeners.push(a)},P.prototype.removeCloseEventListener=function(a){this.closeEventListeners.indexOf(a)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(a),1)},P.prototype.setupResizeObserver=function(){var a=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){a.resize(a.target.clientWidth,a.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},P.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var a=1*this.target.clientWidth/this.target.clientHeight,u=this.contentDiv.clientWidth/a>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*a:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,D=u+2*this.CANVAS_MARGINa+this.CANVAS_MARGIN?this.target.offsetTop-(a+this.CANVAS_MARGIN):0;this.coverDiv.style.top=u+"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=this.styles.settings.zIndex!==void 0?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=this.styles.settings.zIndex!==void 0?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=this.displayMode==="popup"?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,this.displayMode==="popup"&&(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",this.displayMode==="popup"&&(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},P.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},P.prototype.addTopToolbar=function(){var a=this;this.topToolbar=new rr,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 u=new Ir;u.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(u);var D=[];this.aspectRatios.forEach(function(Tt){var Qt=new yr(Nr.getIcon(Tt.horizontal,Tt.vertical),Tt.horizontal===0&&Tt.vertical===0?"FREE":Tt.horizontal+":"+Tt.vertical);Qt.onClick=function(){return a.ratioButtonClicked(Tt)},D.push(Qt)}),this.aspectRatioButton=new Kr(Nr.getIcon(0,0),"Aspect ratio",D),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,u.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var B=new yr(' ',"Toggle grid");B.isActive=this.isGridVisible,B.onClick=function(){a.isGridVisible=!a.isGridVisible,B.isActive=a.isGridVisible},u.addButton(B);var L=new yr(' ',"Zoom to selection");if(L.isActive=this.zoomToCropEnabled,L.onClick=function(){a.zoomToCropEnabled=!a.zoomToCropEnabled,L.isActive=a.zoomToCropEnabled},u.addButton(L),!Nt.isLicensed){var se=new pr;this.topToolbar.addElementBlock(se);var Ne=document.createElement("div");Ne.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var tt=document.createElement("a");tt.style.color="currentColor",tt.href="https://markerjs.com/products/cropro",tt.target="_blank",tt.innerHTML=' ',Ne.appendChild(tt),se.addElement(Ne)}var pt=new Ir;pt.minWidth=3*this.toolbarHeight+"px",pt.contentAlign="end",this.topToolbar.addButtonBlock(pt);var We=new yr(' ',"OK");We.onClick=this.startRenderAndClose,pt.addButton(We),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(We.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var bt=new yr(' ',"Close");bt.onClick=this.close,pt.addButton(bt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(bt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},P.prototype.addBottomToolbar=function(){var a=this;this.bottomToolbar=new rr,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 u=new Ir;u.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(u);var D=new yr(' ',"Rotate left");D.onClick=this.rotateLeftButtonClicked,u.addButton(D);var B=new yr(' ',"Rotate right");B.onClick=this.rotateRightButtonClicked,u.addButton(B);var L=new pr;L.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(L),this.straightener=new tn("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(pt){a.rotateBy(pt),a.straightener.angle=a.rotationAngle},L.addElement(this.straightener.getUI());var se=new Ir;se.minWidth=2*this.toolbarHeight+"px",se.contentAlign="end",this.bottomToolbar.addButtonBlock(se);var Ne=new yr(' ',"Flip horizontal");Ne.onClick=this.flipHorizontallyButtonClicked,se.addButton(Ne);var tt=new yr(' ',"Flip vertical");tt.onClick=this.flipVerticallyButtonClicked,se.addButton(tt)},P.prototype.ratioButtonClicked=function(a){this.aspectRatio=a,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},P.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Nr.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},P.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Mr(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},P.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},P.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},P.prototype.restoreState=function(a){if(a){var u=this.cropLayer.getRescaledRect(a.width,a.height,this.imageWidth,this.imageHeight,a.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(u),this.cropRectChanged(u),this.flippedHorizontally=a.flippedHorizontally,this.flippedVertically=a.flippedVertically,this.applyFlip(),this.rotationAngle=a.rotationAngle,this.applyRotation()}},P.prototype.clientToLocalCoordinates=function(a,u){var D=this.cropImage.getBoundingClientRect();return{x:a-D.left,y:u-D.top}},P.prototype.onWindowResize=function(){this.positionUI()},P.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var a=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=a+"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()},P.prototype.rotateLeftButtonClicked=function(){var a=this.rotationAngle-90;this.rotationAngle%90!=0&&(a+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(a)},P.prototype.rotateRightButtonClicked=function(){var a=this.rotationAngle+90;this.rotationAngle%90!=0&&(a-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(a)},P.prototype.rotateTo=function(a){a=(a=a>180?a-360:a)<=-180?a+360:a,this.rotationAngle=a,this.applyRotation()},P.prototype.rotateBy=function(a){this.rotateTo((this.rotationAngle+a)%360)},P.prototype.applyRotation=function(){var a=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var u=this.editingTargetRotationContainer.transform.baseVal.getItem(0);u.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(u,0);var D=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/D.width,this.imageHeight/D.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=a},P.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},P.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},P.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},P.prototype.startRenderAndClose=function(){return gt(this,void 0,void 0,function(){var a,u;return Bt(this,function(D){switch(D.label){case 0:return[4,this.render()];case 1:return a=D.sent(),u=this.getState(),this.renderEventListeners.forEach(function(B){return B(a,u)}),this.close(!0),[2]}})})},P.prototype.render=function(){return gt(this,void 0,void 0,function(){var a;return Bt(this,function(u){switch(u.label){case 0:return(a=new Ur).naturalSize=this.renderAtNaturalSize,a.imageType=this.renderImageType,a.imageQuality=this.renderImageQuality,a.width=this.renderWidth,a.height=this.renderHeight,this.unzoomFromCrop(),Ze.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,a.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 u.sent(),[4,a.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,u.sent()]}})})},P.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Gt("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Gt("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Gt("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var a=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Gt("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*a)+`px;
height: `+(this.toolbarHeight-2*a)+`px;
padding: `+a+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Gt("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new or("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new or("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Gt("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Gt("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Gt("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-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%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Gt("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*a)+`px;
padding: `+a+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Gt("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},P.instanceCounter=0,P}(),Yr=W("8hTe"),kr=W.n(Yr),Hr=/]*>/g;function Br(P){var a=document.createElement("div");return a.innerHTML=P,a.childNodes.length===0?"":a.childNodes[0].nodeValue}var rn=Ge.a=function(P){var a=P.value,u=a===void 0?"":a,D=P.edit,B=D===void 0?!1:D,L=P.className,se=P.showTextOnly,Ne=P.showLines,tt=P.replaces,pt=P.zoomImg,We=P.hasMask,bt=P.style,Tt=bt===void 0?{}:bt,Qt=P.stylesPrev,De=Qt===void 0?{}:Qt,br=String(u),sr=Object(w.useRef)(),Rr=Object(w.useRef)(),Cn=Object(w.useState)(""),nn=Object(U.a)(Cn,2),jr=nn[0],Qr=nn[1],zr=Object(w.useState)("office"),an=Object(U.a)(zr,2),Tn=an[0],hn=an[1],bn=function(){var Lt=new wt(Rr.current);Lt.displayMode="popup",Lt.addRenderEventListener(function(){var lr=Object(x.a)(R.a.mark(function jt(mr){var Zt;return R.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return sr.current.style.display="none",vr.next=3,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mr}});case 3:Zt=vr.sent,Zt!=null&&Zt.id&&tt(Rr.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Zt==null?void 0:Zt.id,"?type=").concat(Zt.content_type));case 5:case"end":return vr.stop()}},jt)}));return function(jt){return lr.apply(this,arguments)}}()),Lt.show()},Mn=function(){var Lt=new At(Rr.current);Lt.settings.displayMode="popup",Lt.addEventListener("render",function(){var lr=Object(x.a)(R.a.mark(function jt(mr){var Zt;return R.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:if(sr.current.style.display="none",!Rr.current){vr.next=6;break}return vr.next=4,Object(ke.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:mr.dataUrl}});case 4:Zt=vr.sent,Zt!=null&&Zt.id&&tt(Rr.current.getAttribute("src").replace(le.a.API_SERVER,""),"/api/attachments/".concat(Zt==null?void 0:Zt.id,"?type=").concat(Zt.content_type));case 6:case"end":return vr.stop()}},jt)}));return function(jt){return lr.apply(this,arguments)}}()),Lt.show(),window.markerArea=Lt},on=Object(w.useMemo)(function(){try{var qt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,Lt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,lr=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;br=br.replace(qt,"("+le.a.API_SERVER+"/api/attachments/").replace(Lt,'"'+le.a.API_SERVER+"/api/attachments/").replace(lr,'"'+le.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,`
`),br=br.replace(new RegExp("(?[TOC]
",m()),f()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(pn,vr){var En=mr[vr],sn=En.type,mn=En.expression;return Object(be.renderToString)(Br(mn)||"",{displayMode:sn==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),g(),se){var Zt=document.createElement("div");return Zt.innerHTML=jt,Zt.innerText}return setTimeout(function(){return Sn()},500),jt},[br]),Er=Object(w.useRef)();d.WebkitLineClamp=Ne,Ne&&(Tt=Object(v.a)(Object(v.a)({},Tt),d));function Jr(qt){var Lt=qt.target;if(Lt.tagName.toUpperCase()==="IMG"){if(pt){var lr=Lt.getAttribute("src");Qr(lr),hn("image")}}else if(Lt.tagName.toUpperCase()==="A"){var jt=Lt.getAttribute("href");if(jt.indexOf("office")>-1)qt.preventDefault(),Qr(jt),hn("office");else if(jt.indexOf("application/pdf")>-1)qt.preventDefault(),Qr(jt),hn("pdf");else if(jt.indexOf("type=text")>-1)qt.preventDefault(),Qr(jt),hn("html");else if(jt.startsWith("#")){qt.preventDefault();var mr=document.getElementById(jt.replace("#",""));mr&&mr.scrollIntoView(!0)}}}var Sn=function(){var Lt,lr=(Lt=Er.current)===null||Lt===void 0?void 0:Lt.querySelectorAll("video");lr==null||lr.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if($.a.isSupported()){var mr=new $.a;mr.loadSource(jt.src),mr.attachMedia(jt)}}})};Object(w.useEffect)(function(){if(Er.current&&on&&(on.match(Hr)&&window.PR.prettyPrint()),Er.current)return Er.current.addEventListener("click",Jr),function(){Er.current.removeEventListener("click",Jr),g(),f()}},[on,Er.current,Jr]);var fn=function(Lt){if(!B)return;Lt.target.nodeName==="IMG"?(sr.current.style.display="flex",sr.current.style.width=Lt.target.clientWidth+"px",sr.current.style.height=Lt.target.clientHeight+"px",sr.current.style.top=Lt.target.offsetTop+"px",sr.current.style.left=Lt.target.offsetLeft+"px",Rr.current.src=Lt.target.getAttribute("src")):sr.current.style.display="none"};return b.a.createElement("div",{style:{position:"relative"}},b.a.createElement("div",{ref:Er,style:Object(v.a)({},Tt),className:"".concat(L||""," markdown-body ").concat(kr.a.mdBody),onMouseOver:fn,dangerouslySetInnerHTML:{__html:on}}),b.a.createElement("div",{ref:sr,className:kr.a.button},b.a.createElement(N.a,null,b.a.createElement(I.a,{onClick:function(){return bn()}},"\u88C1\u526A"),b.a.createElement(I.a,{onClick:function(){return Mn()}},"\u7F16\u8F91"))),b.a.createElement("img",{ref:Rr,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),b.a.createElement(ve.a,{close:!0,data:jr,hasMask:We,type:jr!=null&&jr.length?Tn:"",style:Object(v.a)({},De),onClose:function(){return Qr("")}}))}},BJfS:function(ft,Ge){var W=function(oe){return oe.replace(/[A-Z]/g,function(N){return"-"+N.toLowerCase()}).toLowerCase()};ft.exports=W},BU3w:function(ft,Ge,W){"use strict";W.d(Ge,"a",function(){return x});var oe=W("MNnm"),N="rc-util-key";function S(U){if(U.attachTo)return U.attachTo;var M=document.querySelector("head");return M||document.body}function I(U){var M,R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var w=document.createElement("style");if((M=R.csp)===null||M===void 0?void 0:M.nonce){var b;w.nonce=(b=R.csp)===null||b===void 0?void 0:b.nonce}w.innerHTML=U;var T=S(R),O=T.firstChild;return R.prepend&&T.prepend?T.prepend(w):R.prepend&&O?T.insertBefore(w,O):T.appendChild(w),w}var v=new Map;function x(U,M){var R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=S(R);if(!v.has(w)){var b=I("",R),T=b.parentNode;v.set(w,T),T.removeChild(b)}var O=Array.from(v.get(w).children).find(function(r){return r.tagName==="STYLE"&&r[N]===M});if(O){var C,E;if(((C=R.csp)===null||C===void 0?void 0:C.nonce)&&O.nonce!==((E=R.csp)===null||E===void 0?void 0:E.nonce)){var y;O.nonce=(y=R.csp)===null||y===void 0?void 0:y.nonce}return O.innerHTML!==U&&(O.innerHTML=U),O}var h=I(U,R);return h[N]=M,h}},DlQD:function(ft,Ge,W){(function(oe,N){ft.exports=N()})(this,function(){"use strict";function oe(ae,ee){for(var te=0;teae.length)&&(ee=ae.length);for(var te=0,H=new Array(ee);te=ae.length?{done:!0}:{done:!1,value:ae[H++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return te=ae[Symbol.iterator](),te.next.bind(te)}function x(ae,ee){return ee={exports:{}},ae(ee,ee.exports),ee.exports}var U=x(function(ae){function ee(){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}}function te(H){ae.exports.defaults=H}ae.exports={defaults:ee(),getDefaults:ee,changeDefaults:te}}),M=U.defaults,R=U.getDefaults,w=U.changeDefaults,b=/[&<>"']/,T=/[&<>"']/g,O=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,E={"&":"&","<":"<",">":">",'"':""","'":"'"},y=function(ee){return E[ee]};function h(ae,ee){if(ee){if(b.test(ae))return ae.replace(T,y)}else if(O.test(ae))return ae.replace(C,y);return ae}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function o(ae){return ae.replace(r,function(ee,te){return te=te.toLowerCase(),te==="colon"?":":te.charAt(0)==="#"?te.charAt(1)==="x"?String.fromCharCode(parseInt(te.substring(2),16)):String.fromCharCode(+te.substring(1)):""})}var s=/(^|[^\[])\^/g;function f(ae,ee){ae=ae.source||ae,ee=ee||"";var te={replace:function(G,V){return V=V.source||V,V=V.replace(s,"$1"),ae=ae.replace(G,V),te},getRegex:function(){return new RegExp(ae,ee)}};return te}var d=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(ae,ee,te){if(ae){var H;try{H=decodeURIComponent(o(te)).replace(d,"").toLowerCase()}catch(G){return null}if(H.indexOf("javascript:")===0||H.indexOf("vbscript:")===0||H.indexOf("data:")===0)return null}ee&&!l.test(te)&&(te=e(ee,te));try{te=encodeURI(te).replace(/%25/g,"%")}catch(G){return null}return te}var c={},i=/^[^:]+:\/*[^/]*$/,n=/^([^:]+:)[\s\S]*$/,t=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e(ae,ee){c[" "+ae]||(i.test(ae)?c[" "+ae]=ae+"/":c[" "+ae]=A(ae,"/",!0)),ae=c[" "+ae];var te=ae.indexOf(":")===-1;return ee.substring(0,2)==="//"?te?ee:ae.replace(n,"$1")+ee:ee.charAt(0)==="/"?te?ee:ae.replace(t,"$1")+ee:ae+ee}var p={exec:function(){}};function g(ae){for(var ee=1,te,H;ee=0&&de[Me]==="\\";)ge=!ge;return ge?"|":" |"}),H=te.split(/ \|/),G=0;if(H.length>ee)H.splice(ee);else for(;H.length=H.length?G.slice(H.length):G}).join(`
`)}var Te=function(){function ae(te){this.options=te||J}var ee=ae.prototype;return ee.space=function(H){var G=this.rules.block.newline.exec(H);if(G)return G[0].length>1?{type:"space",raw:G[0]}:{raw:`
`}},ee.code=function(H,G){var V=this.rules.block.code.exec(H);if(V){var Q=G[G.length-1];if(Q&&Q.type==="paragraph")return{raw:V[0],text:V[0].trimRight()};var de=V[0].replace(/^ {4}/gm,"");return{type:"code",raw:V[0],codeBlockStyle:"indented",text:this.options.pedantic?de:Y(de,`
`)}}},ee.fences=function(H){var G=this.rules.block.fences.exec(H);if(G){var V=G[0],Q=ke(V,G[3]||"");return{type:"code",raw:V,lang:G[2]?G[2].trim():G[2],text:Q}}},ee.heading=function(H){var G=this.rules.block.heading.exec(H);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},ee.nptable=function(H){var G=this.rules.block.nptable.exec(H);if(G){var V={type:"table",header:$(G[1].replace(/^ *| *\| *$/g,"")),align:G[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:G[3]?G[3].replace(/\n$/,"").split(`
`):[],raw:G[0]};if(V.header.length===V.align.length){var Q=V.align.length,de;for(de=0;de ?/gm,"");return{type:"blockquote",raw:G[0],text:V}}},ee.list=function(H){var G=this.rules.block.list.exec(H);if(G){for(var V=G[0],Q=G[2],de=Q.length>1,ge=Q[Q.length-1]===")",Me={type:"list",raw:V,ordered:de,start:de?+Q.slice(0,-1):"",loose:!1,items:[]},et=G[0].match(this.rules.block.item),dt=!1,qe,Ct,_t,ot,It,At,Ot,Wt=et.length,gt=0;gt1||this.options.smartLists&&_t!==Q)&&(ot=et.slice(gt+1).join(`
`),Me.raw=Me.raw.substring(0,Me.raw.length-ot.length),gt=Wt-1)),It=dt||/\n\n(?!\s*$)/.test(qe),gt!==Wt-1&&(dt=qe.charAt(qe.length-1)===`
`,It||(It=dt)),It&&(Me.loose=!0),At=/^\[[ xX]\] /.test(qe),Ot=void 0,At&&(Ot=qe[1]!==" ",qe=qe.replace(/^\[[ xX]\] +/,"")),Me.items.push({type:"list_item",raw:V,task:At,checked:Ot,loose:It,text:qe});return Me}},ee.html=function(H){var G=this.rules.block.html.exec(H);if(G)return{type:this.options.sanitize?"paragraph":"html",raw:G[0],pre:!this.options.sanitizer&&(G[1]==="pre"||G[1]==="script"||G[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(G[0]):le(G[0]):G[0]}},ee.def=function(H){var G=this.rules.block.def.exec(H);if(G){G[3]&&(G[3]=G[3].substring(1,G[3].length-1));var V=G[1].toLowerCase().replace(/\s+/g," ");return{tag:V,raw:G[0],href:G[2],title:G[3]}}},ee.table=function(H){var G=this.rules.block.table.exec(H);if(G){var V={type:"table",header:$(G[1].replace(/^ *| *\| *$/g,"")),align:G[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:G[3]?G[3].replace(/\n$/,"").split(`
`):[]};if(V.header.length===V.align.length){V.raw=G[0];var Q=V.align.length,de;for(de=0;de/i.test(Q[0])&&(G=!1),!V&&/^<(pre|code|kbd|script)(\s|>)/i.test(Q[0])?V=!0:V&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(Q[0])&&(V=!1),{type:this.options.sanitize?"text":"html",raw:Q[0],inLink:G,inRawBlock:V,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):le(Q[0]):Q[0]}},ee.link=function(H){var G=this.rules.inline.link.exec(H);if(G){var V=be(G[2],"()");if(V>-1){var Q=G[0].indexOf("!")===0?5:4,de=Q+G[1].length+V;G[2]=G[2].substring(0,V),G[0]=G[0].substring(0,de).trim(),G[3]=""}var ge=G[2],Me="";if(this.options.pedantic){var et=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ge);et?(ge=et[1],Me=et[3]):Me=""}else Me=G[3]?G[3].slice(1,-1):"";ge=ge.trim().replace(/^<([\s\S]*)>$/,"$1");var dt=ve(G,{href:ge&&ge.replace(this.rules.inline._escapes,"$1"),title:Me&&Me.replace(this.rules.inline._escapes,"$1")},G[0]);return dt}},ee.reflink=function(H,G){var V;if((V=this.rules.inline.reflink.exec(H))||(V=this.rules.inline.nolink.exec(H))){var Q=(V[2]||V[1]).replace(/\s+/g," ");if(Q=G[Q.toLowerCase()],!Q||!Q.href){var de=V[0].charAt(0);return{type:"text",raw:de,text:de}}var ge=ve(V,Q,V[0]);return ge}},ee.strong=function(H,G,V){V===void 0&&(V="");var Q=this.rules.inline.strong.start.exec(H);if(Q&&(!Q[1]||Q[1]&&(V===""||this.rules.inline.punctuation.exec(V)))){G=G.slice(-1*H.length);var de=Q[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;de.lastIndex=0;for(var ge;(Q=de.exec(G))!=null;)if(ge=this.rules.inline.strong.middle.exec(G.slice(0,Q.index+3)),ge)return{type:"strong",raw:H.slice(0,ge[0].length),text:H.slice(2,ge[0].length-2)}}},ee.em=function(H,G,V){V===void 0&&(V="");var Q=this.rules.inline.em.start.exec(H);if(Q&&(!Q[1]||Q[1]&&(V===""||this.rules.inline.punctuation.exec(V)))){G=G.slice(-1*H.length);var de=Q[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;de.lastIndex=0;for(var ge;(Q=de.exec(G))!=null;)if(ge=this.rules.inline.em.middle.exec(G.slice(0,Q.index+2)),ge)return{type:"em",raw:H.slice(0,ge[0].length),text:H.slice(1,ge[0].length-1)}}},ee.codespan=function(H){var G=this.rules.inline.code.exec(H);if(G){var V=G[2].replace(/\n/g," "),Q=/[^ ]/.test(V),de=V.startsWith(" ")&&V.endsWith(" ");return Q&&de&&(V=V.substring(1,V.length-1)),V=le(V,!0),{type:"codespan",raw:G[0],text:V}}},ee.br=function(H){var G=this.rules.inline.br.exec(H);if(G)return{type:"br",raw:G[0]}},ee.del=function(H){var G=this.rules.inline.del.exec(H);if(G)return{type:"del",raw:G[0],text:G[1]}},ee.autolink=function(H,G){var V=this.rules.inline.autolink.exec(H);if(V){var Q,de;return V[2]==="@"?(Q=le(this.options.mangle?G(V[1]):V[1]),de="mailto:"+Q):(Q=le(V[1]),de=Q),{type:"link",raw:V[0],text:Q,href:de,tokens:[{type:"text",raw:Q,text:Q}]}}},ee.url=function(H,G){var V;if(V=this.rules.inline.url.exec(H)){var Q,de;if(V[2]==="@")Q=le(this.options.mangle?G(V[0]):V[0]),de="mailto:"+Q;else{var ge;do ge=V[0],V[0]=this.rules.inline._backpedal.exec(V[0])[0];while(ge!==V[0]);Q=le(V[0]),V[1]==="www."?de="http://"+Q:de=Q}return{type:"link",raw:V[0],text:Q,href:de,tokens:[{type:"text",raw:Q,text:Q}]}}},ee.inlineText=function(H,G,V){var Q=this.rules.inline.text.exec(H);if(Q){var de;return G?de=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):le(Q[0]):Q[0]:de=le(this.options.smartypants?V(Q[0]):Q[0]),{type:"text",raw:Q[0],text:de}}},ae}(),xe=z.noopTest,_e=z.edit,Oe=z.merge,ce={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:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ce._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ce._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ce.def=_e(ce.def).replace("label",ce._label).replace("title",ce._title).getRegex(),ce.bullet=/(?:[*+-]|\d{1,9}[.)])/,ce.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ce.item=_e(ce.item,"gm").replace(/bull/g,ce.bullet).getRegex(),ce.list=_e(ce.list).replace(/bull/g,ce.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ce.def.source+")").getRegex(),ce._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",ce._comment=//,ce.html=_e(ce.html,"i").replace("comment",ce._comment).replace("tag",ce._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ce.paragraph=_e(ce._paragraph).replace("hr",ce.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",ce._tag).getRegex(),ce.blockquote=_e(ce.blockquote).replace("paragraph",ce.paragraph).getRegex(),ce.normal=Oe({},ce),ce.gfm=Oe({},ce.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*|$)"}),ce.gfm.nptable=_e(ce.gfm.nptable).replace("hr",ce.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",ce._tag).getRegex(),ce.gfm.table=_e(ce.gfm.table).replace("hr",ce.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",ce._tag).getRegex(),ce.pedantic=Oe({},ce.normal,{html:_e(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)| \\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ce._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:xe,paragraph:_e(ce.normal._paragraph).replace("hr",ce.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ce.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Z={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,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:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",Z.punctuation=_e(Z.punctuation).replace(/punctuation/g,Z._punctuation).getRegex(),Z._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Z._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Z.em.start=_e(Z.em.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.middle=_e(Z.em.middle).replace(/punctuation/g,Z._punctuation).replace(/overlapSkip/g,Z._overlapSkip).getRegex(),Z.em.endAst=_e(Z.em.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.em.endUnd=_e(Z.em.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.start=_e(Z.strong.start).replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.middle=_e(Z.strong.middle).replace(/punctuation/g,Z._punctuation).replace(/blockSkip/g,Z._blockSkip).getRegex(),Z.strong.endAst=_e(Z.strong.endAst,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.strong.endUnd=_e(Z.strong.endUnd,"g").replace(/punctuation/g,Z._punctuation).getRegex(),Z.blockSkip=_e(Z._blockSkip,"g").getRegex(),Z.overlapSkip=_e(Z._overlapSkip,"g").getRegex(),Z._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Z._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Z._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])?)+(?![-_])/,Z.autolink=_e(Z.autolink).replace("scheme",Z._scheme).replace("email",Z._email).getRegex(),Z._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Z.tag=_e(Z.tag).replace("comment",ce._comment).replace("attribute",Z._attribute).getRegex(),Z._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Z._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,Z._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Z.link=_e(Z.link).replace("label",Z._label).replace("href",Z._href).replace("title",Z._title).getRegex(),Z.reflink=_e(Z.reflink).replace("label",Z._label).getRegex(),Z.reflinkSearch=_e(Z.reflinkSearch,"g").replace("reflink",Z.reflink).replace("nolink",Z.nolink).getRegex(),Z.normal=Oe({},Z),Z.pedantic=Oe({},Z.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:_e(/^!?\[(label)\]\((.*?)\)/).replace("label",Z._label).getRegex(),reflink:_e(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Z._label).getRegex()}),Z.gfm=Oe({},Z.normal,{escape:_e(Z.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&&(H="x"+H.toString(16)),ee+=""+H+";";return ee}var Fe=function(){function ae(te){this.tokens=[],this.tokens.links=Object.create(null),this.options=te||at,this.options.tokenizer=this.options.tokenizer||new Te,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var H={block:rt.normal,inline:Ke.normal};this.options.pedantic?(H.block=rt.pedantic,H.inline=Ke.pedantic):this.options.gfm&&(H.block=rt.gfm,this.options.breaks?H.inline=Ke.breaks:H.inline=Ke.gfm),this.tokenizer.rules=H}ae.lex=function(H,G){var V=new ae(G);return V.lex(H)};var ee=ae.prototype;return ee.lex=function(H){return H=H.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(H,this.tokens,!0),this.inline(this.tokens),this.tokens},ee.blockTokens=function(H,G,V){G===void 0&&(G=[]),V===void 0&&(V=!0),H=H.replace(/^ +$/gm,"");for(var Q,de,ge,Me;H;){if(Q=this.tokenizer.space(H)){H=H.substring(Q.raw.length),Q.type&&G.push(Q);continue}if(Q=this.tokenizer.code(H,G)){H=H.substring(Q.raw.length),Q.type?G.push(Q):(Me=G[G.length-1],Me.raw+=`
`+Q.raw,Me.text+=`
`+Q.text);continue}if(Q=this.tokenizer.fences(H)){H=H.substring(Q.raw.length),G.push(Q);continue}if(Q=this.tokenizer.heading(H)){H=H.substring(Q.raw.length),G.push(Q);continue}if(Q=this.tokenizer.nptable(H)){H=H.substring(Q.raw.length),G.push(Q);continue}if(Q=this.tokenizer.hr(H)){H=H.substring(Q.raw.length),G.push(Q);continue}if(Q=this.tokenizer.blockquote(H)){H=H.substring(Q.raw.length),Q.tokens=this.blockTokens(Q.text,[],V),G.push(Q);continue}if(Q=this.tokenizer.list(H)){for(H=H.substring(Q.raw.length),ge=Q.items.length,de=0;de0)for(;(et=this.tokenizer.rules.inline.reflinkSearch.exec(Me))!=null;)dt.includes(et[0].slice(et[0].lastIndexOf("[")+1,-1))&&(Me=Me.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(et=this.tokenizer.rules.inline.blockSkip.exec(Me))!=null;)Me=Me.slice(0,et.index)+"["+"a".repeat(et[0].length-2)+"]"+Me.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;H;){if(ge=this.tokenizer.escape(H)){H=H.substring(ge.raw.length),G.push(ge);continue}if(ge=this.tokenizer.tag(H,V,Q)){H=H.substring(ge.raw.length),V=ge.inLink,Q=ge.inRawBlock,G.push(ge);continue}if(ge=this.tokenizer.link(H)){H=H.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,Q)),G.push(ge);continue}if(ge=this.tokenizer.reflink(H,this.tokens.links)){H=H.substring(ge.raw.length),ge.type==="link"&&(ge.tokens=this.inlineTokens(ge.text,[],!0,Q)),G.push(ge);continue}if(ge=this.tokenizer.strong(H,Me,de)){H=H.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],V,Q),G.push(ge);continue}if(ge=this.tokenizer.em(H,Me,de)){H=H.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],V,Q),G.push(ge);continue}if(ge=this.tokenizer.codespan(H)){H=H.substring(ge.raw.length),G.push(ge);continue}if(ge=this.tokenizer.br(H)){H=H.substring(ge.raw.length),G.push(ge);continue}if(ge=this.tokenizer.del(H)){H=H.substring(ge.raw.length),ge.tokens=this.inlineTokens(ge.text,[],V,Q),G.push(ge);continue}if(ge=this.tokenizer.autolink(H,we)){H=H.substring(ge.raw.length),G.push(ge);continue}if(!V&&(ge=this.tokenizer.url(H,we))){H=H.substring(ge.raw.length),G.push(ge);continue}if(ge=this.tokenizer.inlineText(H,Q,He)){H=H.substring(ge.raw.length),de=ge.raw.slice(-1),G.push(ge);continue}if(H){var qe="Infinite loop on byte: "+H.charCodeAt(0);if(this.options.silent){console.error(qe);break}else throw new Error(qe)}}return G},N(ae,null,[{key:"rules",get:function(){return{block:rt,inline:Ke}}}]),ae}(),$e=U.defaults,Qe=z.cleanUrl,Ve=z.escape,Ue=function(){function ae(te){this.options=te||$e}var ee=ae.prototype;return ee.code=function(H,G,V){var Q=(G||"").match(/\S*/)[0];if(this.options.highlight){var de=this.options.highlight(H,Q);de!=null&&de!==H&&(V=!0,H=de)}return Q?''+(V?H:Ve(H,!0))+`
`:""+(V?H:Ve(H,!0))+`
`},ee.blockquote=function(H){return`
`+H+`
`},ee.html=function(H){return H},ee.heading=function(H,G,V,Q){return this.options.headerIds?"
`:""+H+"
`},ee.hr=function(){return this.options.xhtml?`
`:`
`},ee.list=function(H,G,V){var Q=G?"ol":"ul",de=G&&V!==1?' start="'+V+'"':"";return"<"+Q+de+`>
`+H+""+Q+`>
`},ee.listitem=function(H){return""+H+`
`},ee.checkbox=function(H){return" "},ee.paragraph=function(H){return""+H+`
`},ee.table=function(H,G){return G&&(G=""+G+" "),`
`},ee.tablerow=function(H){return`
`+H+`
`},ee.tablecell=function(H,G){var V=G.header?"th":"td",Q=G.align?"<"+V+' align="'+G.align+'">':"<"+V+">";return Q+H+""+V+`>
`},ee.strong=function(H){return""+H+" "},ee.em=function(H){return""+H+" "},ee.codespan=function(H){return""+H+""},ee.br=function(){return this.options.xhtml?" ":" "},ee.del=function(H){return""+H+""},ee.link=function(H,G,V){if(H=Qe(this.options.sanitize,this.options.baseUrl,H),H===null)return V;var Q='"+V+" ",Q},ee.image=function(H,G,V){if(H=Qe(this.options.sanitize,this.options.baseUrl,H),H===null)return V;var Q=' ":">",Q},ee.text=function(H){return H},ae}(),Be=function(){function ae(){}var ee=ae.prototype;return ee.strong=function(H){return H},ee.em=function(H){return H},ee.codespan=function(H){return H},ee.del=function(H){return H},ee.html=function(H){return H},ee.text=function(H){return H},ee.link=function(H,G,V){return""+V},ee.image=function(H,G,V){return""+V},ee.br=function(){return""},ae}(),ct=function(){function ae(){this.seen={}}var ee=ae.prototype;return ee.slug=function(H){var G=H.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(G)){var V=G;do this.seen[V]++,G=V+"-"+this.seen[V];while(this.seen.hasOwnProperty(G))}return this.seen[G]=0,G},ae}(),st=U.defaults,lt=z.unescape,nt=function(){function ae(te){this.options=te||st,this.options.renderer=this.options.renderer||new Ue,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Be,this.slugger=new ct}ae.parse=function(H,G){var V=new ae(G);return V.parse(H)};var ee=ae.prototype;return ee.parse=function(H,G){G===void 0&&(G=!0);var V="",Q,de,ge,Me,et,dt,qe,Ct,_t,ot,It,At,Ot,Wt,gt,Bt,Nt,Ze,Yt=H.length;for(Q=0;Q0&>.tokens[0].type==="text"?(gt.tokens[0].text=Ze+" "+gt.tokens[0].text,gt.tokens[0].tokens&>.tokens[0].tokens.length>0&>.tokens[0].tokens[0].type==="text"&&(gt.tokens[0].tokens[0].text=Ze+" "+gt.tokens[0].tokens[0].text)):gt.tokens.unshift({type:"text",text:Ze}):Wt+=Ze),Wt+=this.parse(gt.tokens,Ot),_t+=this.renderer.listitem(Wt,Nt,Bt);V+=this.renderer.list(_t,It,At);continue}case"html":{V+=this.renderer.html(ot.text);continue}case"paragraph":{V+=this.renderer.paragraph(this.parseInline(ot.tokens));continue}case"text":{for(_t=ot.tokens?this.parseInline(ot.tokens):ot.text;Q+1An error occurred:"+fe(ge.message+"",!0)+" ";throw ge}}Ce.options=Ce.setOptions=function(ae){return ht(Ce.defaults,ae),Re(Ce.defaults),Ce},Ce.getDefaults=ye,Ce.defaults=Ie,Ce.use=function(ae){var ee=ht({},ae);if(ae.renderer&&function(){var H=Ce.defaults.renderer||new Ue,G=function(de){var ge=H[de];H[de]=function(){for(var Me=arguments.length,et=new Array(Me),dt=0;dt1&&arguments[1]!==void 0?arguments[1]:1,te=Be.length,H=0;H1&&arguments[1]!==void 0?arguments[1]:!1;return Object(m.a)(Y).map(function(le,be){if(!v.isValidElement(le)||!le.type)return null;var ve=le.type.isSelectOptGroup,ke=le.key,Te=le.props,xe=Te.children,_e=Object(U.a)(Te,["children"]);return $||!ve?c(le):Object(l.a)(Object(l.a)({key:"__RC_SELECT_GRP__".concat(ke===null?be:ke,"__"),label:ke},_e),{},{options:i(xe)})}).filter(function(le){return le})}var n=W("2Qr1"),t=W("qNPg"),e=W("U8pU"),p=W("Kwbf"),g=W("WKfj");function _(Y){var $=Y.mode,le=Y.options,be=Y.children,ve=Y.backfill,ke=Y.allowClear,Te=Y.placeholder,xe=Y.getInputElement,_e=Y.showSearch,Oe=Y.onSearch,ce=Y.defaultOpen,Z=Y.autoFocus,je=Y.labelInValue,at=Y.value,rt=Y.inputValue,Ke=Y.optionLabelProp,He=$==="multiple"||$==="tags",we=_e!==void 0?_e:He||$==="combobox",Fe=le||i(be);if(Object(p.a)($!=="tags"||Fe.every(function(Ue){return!Ue.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),$==="tags"||$==="combobox"){var $e=Fe.some(function(Ue){return Ue.options?Ue.options.some(function(Be){return typeof("value"in Be?Be.value:Be.key)=="number"}):typeof("value"in Ue?Ue.value:Ue.key)=="number"});Object(p.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(p.a)($!=="combobox"||!Ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(p.a)($==="combobox"||!ve,"`backfill` only works with `combobox` mode."),Object(p.a)($==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(p.b)($!=="combobox"||!xe||!ke||!Te,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!we&&$!=="combobox"&&$!=="tags"&&Object(p.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(p.b)(!ce||Z,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),at!=null){var Qe=Object(g.d)(at);Object(p.a)(!je||Qe.every(function(Ue){return Object(e.a)(Ue)==="object"&&("key"in Ue||"value"in Ue)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(p.a)(!He||Array.isArray(at),"`value` should be array when `mode` is `multiple` or `tags`")}if(be){var Ve=null;Object(m.a)(be).some(function(Ue){if(!v.isValidElement(Ue)||!Ue.type)return!1;var Be=Ue.type;if(Be.isSelectOption)return!1;if(Be.isSelectOptGroup){var ct=Object(m.a)(Ue.props.children).every(function(st){return!v.isValidElement(st)||!Ue.type||st.type.isSelectOption?!0:(Ve=st.type,!1)});return!ct}return Ve=Be,!0}),Ve&&Object(p.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Ve.displayName||Ve.name||Ve,"`.")),Object(p.a)(rt===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var A=_,k=Object(t.a)({prefixCls:"rc-select",components:{optionList:r},convertChildrenToData:i,flattenOptions:n.d,getLabeledValue:n.e,filterOptions:n.b,isValueDisabled:n.g,findValueOption:n.c,warningProps:A,fillOptionsWithMissingValue:n.a}),F=function(Y){Object(S.a)(le,Y);var $=Object(I.a)(le);function le(){var be;return Object(oe.a)(this,le),be=$.apply(this,arguments),be.selectRef=v.createRef(),be.focus=function(){be.selectRef.current.focus()},be.blur=function(){be.selectRef.current.blur()},be}return Object(N.a)(le,[{key:"render",value:function(){return v.createElement(k,Object.assign({ref:this.selectRef},this.props))}}]),le}(v.Component);F.Option=s,F.OptGroup=d;var z=F,J=Ge.c=z},NvD2:function(ft,Ge,W){"use strict";W.d(Ge,"a",function(){return x});var oe=W("Kwbf");function N(U,M){var R=new Set;return U.forEach(function(w){M.has(w)||R.add(w)}),R}function S(U){var M=U||{},R=M.disabled,w=M.disableCheckbox,b=M.checkable;return!!(R||w)||b===!1}function I(U,M,R,w){for(var b=new Set(U),T=new Set,O=0;O<=R;O+=1){var C=M.get(O)||new Set;C.forEach(function(r){var o=r.key,s=r.node,f=r.children,d=f===void 0?[]:f;b.has(o)&&!w(s)&&d.filter(function(l){return!w(l.node)}).forEach(function(l){b.add(l.key)})})}for(var E=new Set,y=R;y>=0;y-=1){var h=M.get(y)||new Set;h.forEach(function(r){var o=r.parent,s=r.node;if(w(s)||!r.parent||E.has(r.parent.key))return;if(w(r.parent.node)){E.add(o.key);return}var f=!0,d=!1;(o.children||[]).filter(function(l){return!w(l.node)}).forEach(function(l){var m=l.key,c=b.has(m);f&&!c&&(f=!1),!d&&(c||T.has(m))&&(d=!0)}),f&&b.add(o.key),d&&T.add(o.key),E.add(o.key)})}return{checkedKeys:Array.from(b),halfCheckedKeys:Array.from(N(T,b))}}function v(U,M,R,w,b){for(var T=new Set(U),O=new Set(M),C=0;C<=w;C+=1){var E=R.get(C)||new Set;E.forEach(function(o){var s=o.key,f=o.node,d=o.children,l=d===void 0?[]:d;!T.has(s)&&!O.has(s)&&!b(f)&&l.filter(function(m){return!b(m.node)}).forEach(function(m){T.delete(m.key)})})}O=new Set;for(var y=new Set,h=w;h>=0;h-=1){var r=R.get(h)||new Set;r.forEach(function(o){var s=o.parent,f=o.node;if(b(f)||!o.parent||y.has(o.parent.key))return;if(b(o.parent.node)){y.add(s.key);return}var d=!0,l=!1;(s.children||[]).filter(function(m){return!b(m.node)}).forEach(function(m){var c=m.key,i=T.has(c);d&&!i&&(d=!1),!l&&(i||O.has(c))&&(l=!0)}),d||T.delete(s.key),l&&O.add(s.key),y.add(s.key)})}return{checkedKeys:Array.from(T),halfCheckedKeys:Array.from(N(O,T))}}function x(U,M,R,w){var b=[],T;w?T=w:T=S;var O=new Set(U.filter(function(h){var r=!!R[h];return r||b.push(h),r})),C=new Map,E=0;Object.keys(R).forEach(function(h){var r=R[h],o=r.level,s=C.get(o);s||(s=new Set,C.set(o,s)),s.add(r),E=Math.max(E,o)}),Object(oe.a)(!b.length,"Tree missing follow keys: ".concat(b.slice(0,100).map(function(h){return"'".concat(h,"'")}).join(", ")));var y;return M===!0?y=I(O,C,E,T):y=v(O,M.halfCheckedKeys,C,E,T),y}},OZM5:function(ft,Ge,W){"use strict";W.d(Ge,"b",function(){return w}),W.d(Ge,"a",function(){return b}),W.d(Ge,"k",function(){return T}),W.d(Ge,"h",function(){return O}),W.d(Ge,"i",function(){return C}),W.d(Ge,"g",function(){return E}),W.d(Ge,"c",function(){return y}),W.d(Ge,"d",function(){return h}),W.d(Ge,"j",function(){return s}),W.d(Ge,"e",function(){return f}),W.d(Ge,"f",function(){return d});var oe=W("KQm4"),N=W("U8pU"),S=W("Ff2n"),I=W("q1tI"),v=W.n(I),x=W("Kwbf"),U=W("WaYH"),M=.25,R=2;function w(l,m){var c=l.slice(),i=c.indexOf(m);return i>=0&&c.splice(i,1),c}function b(l,m){var c=l.slice();return c.indexOf(m)===-1&&c.push(m),c}function T(l){return l.split("-")}function O(l,m){return"".concat(l,"-").concat(m)}function C(l){return l&&l.type&&l.type.isTreeNode}function E(l,m){var c=[l],i=m[l];function n(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];t.forEach(function(e){var p=e.key,g=e.children;c.push(p),n(g)})}return n(i.children),c}function y(l,m){var c=l.clientY,i=m.selectHandle.getBoundingClientRect(),n=i.top,t=i.bottom,e=i.height,p=Math.max(e*M,R);return c<=n+p?-1:c>=t-p?1:0}function h(l,m){if(!l)return;var c=m.multiple;return c?l.slice():l.length?[l[0]]:l}var r=function(m){return m};function o(l,m){if(!l)return[];var c=m||{},i=c.processProps,n=i===void 0?r:i,t=Array.isArray(l)?l:[l];return t.map(function(e){var p=e.children,g=Object(S.a)(e,["children"]),_=o(p,m);return v.a.createElement(U.a,Object.assign({},n(g)),_)})}function s(l){if(!l)return null;var m;if(Array.isArray(l))m={checkedKeys:l,halfCheckedKeys:void 0};else if(Object(N.a)(l)==="object")m={checkedKeys:l.checked||void 0,halfCheckedKeys:l.halfChecked||void 0};else return Object(x.a)(!1,"`checkedKeys` is not an array or an object"),null;return m}function f(l,m){var c=new Set;function i(n){if(c.has(n))return;var t=m[n];if(!t)return;c.add(n);var e=t.parent,p=t.node;if(p.disabled)return;e&&i(e.key)}return(l||[]).forEach(function(n){i(n)}),Object(oe.a)(c)}function d(l){var m={};return Object.keys(l).forEach(function(c){(c.startsWith("data-")||c.startsWith("aria-"))&&(m[c]=l[c])}),m}},"SA+Z":function(ft,Ge,W){var oe=W("wTVA"),N=W("EbDI"),S=W("ZhPi"),I=W("wkBT");function v(x){return oe(x)||N(x)||S(x)||I()}ft.exports=v,ft.exports.__esModule=!0,ft.exports.default=ft.exports},SJMd:function(ft,Ge){/**
* @license
* Copyright (C) 2006 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/var W,oe,N,S=!1,I,v;window.PR_SHOULD_USE_CONTINUATION=!0;var x,U;(function(){var M=window,R=["break,continue,do,else,for,if,return,while"],w=[R,"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"],b=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],T=[b,"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"],O=[b,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],C=[b,"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"],E="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",y=[b,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],h="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",r=[R,"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"],o=[R,"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"],s=[R,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],f=[T,C,O,y,h,r,o,s],d=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,l="str",m="kwd",c="com",i="typ",n="lit",t="pun",e="pln",p="tag",g="dec",_="src",A="atn",k="atv",F="nocode",z="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function J(we){for(var Fe=0,$e=!1,Qe=!1,Ve=0,Ue=we.length;Ve122||(H<65||te>90||Re.push([Math.max(65,te)|32,Math.min(H,90)|32]),H<97||te>122||Re.push([Math.max(97,te)&~32,Math.min(H,122)&~32]))}}Re.sort(function(de,ge){return de[0]-ge[0]||ge[1]-de[1]});for(var G=[],V=[],Ae=0;AeQ[0]&&(Q[1]+1>Q[0]&&Ce.push("-"),Ce.push(lt(Q[1])))}return Ce.push("]"),Ce.join("")}function ht(fe){for(var ye=fe.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")),Re=ye.length,Ie=[],Ce=0,Ae=0;Ce=2&&te==="["?ye[Ce]=nt(ae):te!=="\\"&&(ye[Ce]=ae.replace(/[a-zA-Z]/g,function(V){var Q=V.charCodeAt(0);return"["+String.fromCharCode(Q&~32,Q|32)+"]"}))}return ye.join("")}for(var ut=[],Ve=0,Ue=we.length;Ve=0;)$e[ut.charAt(fe)]=ht;var ye=ht[1],Re=""+ye;st.hasOwnProperty(Re)||(ct.push(ye),st[Re]=null)}ct.push(/[\0-\uffff]/),Qe=J(ct)})();var Ve=Fe.length,Ue=function(Be){for(var ct=Be.sourceCode,st=Be.basePos,lt=Be.sourceNode,nt=[st,e],ht=0,ut=ct.match(Qe)||[],fe={},ye=0,Re=ut.length;ye=5&&Ce.substring(0,5)==="lang-",ae&&!(Ae&&typeof Ae[1]=="string")&&(ae=!1,Ce=_),ae||(fe[Ie]=Ce)}var H=ht;if(ht+=Ie.length,!ae)nt.push(st+H,Ce);else{var G=Ae[1],V=Ie.indexOf(G),Q=V+G.length;Ae[2]&&(Q=Ie.length-Ae[2].length,V=Q-G.length);var de=Ce.substring(5);$(lt,st+H,Ie.substring(0,V),Ue,nt),$(lt,st+H+V,G,Z(de,G),nt),$(lt,st+H+Q,Ie.substring(Q),Ue,nt)}}Be.decorations=nt};return Ue}function ke(we){var Fe=[],$e=[];we.tripleQuotedStrings?Fe.push([l,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):we.multiLineStrings?Fe.push([l,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Fe.push([l,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),we.verbatimStrings&&$e.push([l,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Qe=we.hashComments;Qe&&(we.cStyleComments?(Qe>1?Fe.push([c,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Fe.push([c,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([l,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Fe.push([c,/^#[^\r\n]*/,null,"#"])),we.cStyleComments&&($e.push([c,/^\/\/[^\r\n]*/,null]),$e.push([c,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Ve=we.regexLiterals;if(Ve){var Ue=Ve>1?"":`
\r`,Be=Ue?".":"[\\S\\s]",ct="/(?=[^/*"+Ue+"])(?:[^/\\x5B\\x5C"+Ue+"]|\\x5C"+Be+"|\\x5B(?:[^\\x5C\\x5D"+Ue+"]|\\x5C"+Be+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+z+"("+ct+")")])}var st=we.types;st&&$e.push([i,st]);var lt=(""+we.keywords).replace(/^ | $/g,"");lt.length&&$e.push([m,new RegExp("^(?:"+lt.replace(/[\s,]+/g,"|")+")\\b"),null]),Fe.push([e,/^\s+/,null,` \r
\xA0`]);var nt="^.[^\\s\\w.$@'\"`/\\\\]*";return we.regexLiterals&&(nt+="(?!s*/)"),$e.push([n,/^@[a-z_$][a-z_$@0-9]*/i,null],[i,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[e,/^[a-z_$][a-z_$@0-9]*/i,null],[n,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[e,/^\\[\s\S]?/,null],[t,new RegExp(nt),null]),ve(Fe,$e)}var Te=ke({keywords:f,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(we,Fe,$e){for(var Qe=/(?:^|\s)nocode(?:\s|$)/,Ve=/\r\n?|\n/,Ue=we.ownerDocument,Be=Ue.createElement("li");we.firstChild;)Be.appendChild(we.firstChild);var ct=[Be];function st(ye){var Re=ye.nodeType;if(Re==1&&!Qe.test(ye.className))if(ye.nodeName==="br")lt(ye),ye.parentNode&&ye.parentNode.removeChild(ye);else for(var Ie=ye.firstChild;Ie;Ie=Ie.nextSibling)st(Ie);else if((Re==3||Re==4)&&$e){var Ce=ye.nodeValue,Ae=Ce.match(Ve);if(Ae){var ae=Ce.substring(0,Ae.index);ye.nodeValue=ae;var ee=Ce.substring(Ae.index+Ae[0].length);if(ee){var te=ye.parentNode;te.insertBefore(Ue.createTextNode(ee),ye.nextSibling)}lt(ye),ae||ye.parentNode.removeChild(ye)}}}function lt(ye){for(;!ye.nextSibling;)if(ye=ye.parentNode,!ye)return;function Re(Ae,ae){var ee=ae?Ae.cloneNode(!1):Ae,te=Ae.parentNode;if(te){var H=Re(te,1),G=Ae.nextSibling;H.appendChild(ee);for(var V=G;V;V=G)G=V.nextSibling,H.appendChild(V)}return ee}for(var Ie=Re(ye.nextSibling,0),Ce;(Ce=Ie.parentNode)&&Ce.nodeType===1;)Ie=Ce;ct.push(Ie)}for(var nt=0;nt=te&&(st+=2),Ue>=H&&(ht+=2)}}finally{Ce&&(Ce.style.display=Ae)}}var Oe={};function ce(we,Fe){for(var $e=Fe.length;--$e>=0;){var Qe=Fe[$e];Oe.hasOwnProperty(Qe)?M.console&&console.warn("cannot override language handler %s",Qe):Oe[Qe]=we}}function Z(we,Fe){return we&&Oe.hasOwnProperty(we)||(we=/^\s*]*(?:>|$)/],[c,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[t,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^