markerjs
Version:
Annotate and mark images
16 lines (13 loc) • 42.9 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).markerjs={})}(this,(function(t){"use strict";var e=function(){function t(){}return Object.defineProperty(t,"isLicensed",{get:function(){return!!t.key},enumerable:!0,configurable:!0}),t}(),r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
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
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function i(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function o(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,o,n=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(t){o={error:t}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return a}var a=function(){function t(){}return t.createRect=function(e,r,i){var o=document.createElementNS("http://www.w3.org/2000/svg","rect");return o.setAttribute("width",e.toString()),o.setAttribute("height",r.toString()),i&&t.setAttributes(o,i),o},t.createLine=function(e,r,i,o,n){var a=document.createElementNS("http://www.w3.org/2000/svg","line");return a.setAttribute("x1",e.toString()),a.setAttribute("y1",r.toString()),a.setAttribute("x2",i.toString()),a.setAttribute("y2",o.toString()),n&&t.setAttributes(a,n),a},t.createPolygon=function(e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","polygon");return i.setAttribute("points",e),r&&t.setAttributes(i,r),i},t.createCircle=function(e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","circle");return i.setAttribute("cx",(e/2).toString()),i.setAttribute("cy",(e/2).toString()),i.setAttribute("r",e.toString()),r&&t.setAttributes(i,r),i},t.createEllipse=function(e,r,i){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",(e/2).toString()),o.setAttribute("cy",(r/2).toString()),o.setAttribute("rx",(e/2).toString()),o.setAttribute("ry",(r/2).toString()),i&&t.setAttributes(o,i),o},t.createGroup=function(e){var r=document.createElementNS("http://www.w3.org/2000/svg","g");return e&&t.setAttributes(r,e),r},t.setAttributes=function(t,e){var r,i;try{for(var a=o(e),s=a.next();!s.done;s=a.next()){var l=n(s.value,2),c=l[0],h=l[1];t.setAttribute(c,h)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},t.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},t.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},t.createMarker=function(e,r,i,o,n,a,s){var l=document.createElementNS("http://www.w3.org/2000/svg","marker");return t.setAttributes(l,[["id",e],["orient",r],["markerWidth",i.toString()],["markerHeight",o.toString()],["refX",n.toString()],["refY",a.toString()]]),l.appendChild(s),l},t.createText=function(e){var r=document.createElementNS("http://www.w3.org/2000/svg","text");return r.setAttribute("x","0"),r.setAttribute("y","0"),e&&t.setAttributes(r,e),r},t.createTSpan=function(e,r){var i=document.createElementNS("http://www.w3.org/2000/svg","tspan");return i.textContent=e,r&&t.setAttributes(i,r),i},t}(),s=function(){function t(){}return t.prototype.rasterize=function(t,e,r,i,o,n,a){var s=document.createElement("canvas");!0===i&&(e.width.baseVal.value=t.naturalWidth,e.height.baseVal.value=t.naturalHeight),s.width=e.width.baseVal.value,s.height=e.height.baseVal.value;var l=e.outerHTML,c=s.getContext("2d");!0!==a&&c.drawImage(t,0,0,s.width,s.height);var h=window.URL,u=new Image(s.width,s.height);u.setAttribute("crossOrigin","anonymous");var p=new Blob([l],{type:"image/svg+xml"}),d=h.createObjectURL(p);u.onload=function(){c.drawImage(u,0,0),h.revokeObjectURL(d),r(s.toDataURL(void 0!==o?o:"image/png",n))},u.src=d},t}(),l=function(t,e){var r=this;this.getElement=function(){var t=document.createElement("div");return"separator"!==r.toolbarItem.name?(t.className="markerjs-toolbar-button",r.clickHandler&&t.addEventListener("click",(function(t){r.clickHandler&&r.clickHandler(t,r.toolbarItem)})),r.toolbarItem.icon?(t.title=r.toolbarItem.tooltipText,t.innerHTML=r.toolbarItem.icon):t.innerText=r.toolbarItem.tooltipText):t.className="markerjs-toolbar-separator",t},this.toolbarItem=t,this.clickHandler=e},c=function(t,e){var r=this;this.getUI=function(){var t,e;r.toolbarUI=document.createElement("div"),r.toolbarUI.className="markerjs-toolbar";try{for(var i=o(r.toolbarItems),n=i.next();!n.done;n=i.next()){var a=n.value,s=new l(a,r.clickHandler);r.toolbarUI.appendChild(s.getElement())}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return r.toolbarUI},this.toolbarItems=t,this.clickHandler=e},h=function(){function t(){var t=this;this.markerTypeName="MarkerBase",this.defs=[],this.width=200,this.height=50,this.isActive=!0,this.isResizing=!1,this.previousMouseX=0,this.previousMouseY=0,this.isDragging=!1,this.manipulate=function(e){var r,i=t.visual.closest("div");if(i&&i.style){var o=i.style.transform;o&&o.includes("scale(")&&(r=parseFloat(o.replace("scale(","").replace(")","")))}r||(r=t.visual.getScreenCTM().a||1);var n=(e.screenX-t.previousMouseX)/r,a=(e.screenY-t.previousMouseY)/r;t.isDragging&&t.move(n,a),t.isResizing&&t.resize(n,a)},this.addToVisual=function(e){t.visual.appendChild(e)},this.addToRenderVisual=function(e){t.renderVisual.appendChild(e)},this.mouseDown=function(e){e.stopPropagation(),t.select(),t.isDragging=!0,t.previousMouseX=e.screenX,t.previousMouseY=e.screenY,t.previousState=t.getState()},this.mouseUp=function(e){e.stopPropagation(),t.endManipulation()},this.mouseMove=function(e){e.stopPropagation(),t.manipulate(e)},this.move=function(e,r){var i=t.previousState?t.previousState.translateX:0,o=t.previousState?t.previousState.translateY:0,n=t.visual.transform.baseVal.getItem(0);n.setTranslate(i+e,o+r),t.visual.transform.baseVal.replaceItem(n,0)}}return t.prototype.endManipulation=function(){this.isDragging=!1,this.isResizing=!1},t.prototype.select=function(){this.isActive=!0,this.onSelected&&this.onSelected(this)},t.prototype.deselect=function(){this.isActive=!1,this.endManipulation()},t.prototype.getState=function(){return{markerType:this.markerTypeName,width:this.width,height:this.height,translateX:this.visual.transform.baseVal.getItem(0).matrix.e,translateY:this.visual.transform.baseVal.getItem(0).matrix.f}},t.prototype.restoreState=function(t){this.width=t.width,this.height=t.height,this.resize(t.width,t.height);var e=this.visual.transform.baseVal.getItem(0);e.matrix.e=t.translateX,e.matrix.f=t.translateY,this.visual.transform.baseVal.replaceItem(e,0)},t.prototype.setup=function(){this.visual=a.createGroup(),this.visual.transform.baseVal.appendItem(a.createTransform()),this.visual.addEventListener("mousedown",this.mouseDown),this.visual.addEventListener("mouseup",this.mouseUp),this.visual.addEventListener("mousemove",this.mouseMove),this.visual.addEventListener("touchstart",this.onTouch,{passive:!1}),this.visual.addEventListener("touchend",this.onTouch,{passive:!1}),this.visual.addEventListener("touchmove",this.onTouch,{passive:!1}),this.renderVisual=a.createGroup([["class","render-visual"]]),this.visual.appendChild(this.renderVisual)},t.prototype.resize=function(t,e){},t.prototype.onTouch=function(t){t.preventDefault();var e=document.createEvent("MouseEvents"),r=t.changedTouches[0],i=null;switch(t.type){case"touchstart":i="mousedown";break;case"touchmove":i="mousemove";break;case"touchend":i="mouseup"}e.initMouseEvent(i,!0,!0,window,0,r.screenX,r.screenY,r.clientX,r.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,null),t.target.dispatchEvent(e)},t.createMarker=function(){var e=new t;return e.setup(),e},t}(),u=function(){this.GRIP_SIZE=10,this.visual=a.createCircle(this.GRIP_SIZE,[["class","markerjs-control-grip"]])},p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.MIN_LENGTH=20,e.x1=0,e.y1=0,e.x2=e.width,e.y2=0,e.getLineLength=function(t,e,r,i){var o=Math.abs(t-r),n=Math.abs(e-i);return Math.sqrt(Math.pow(o,2)+Math.pow(n,2))},e.addControlBox=function(){e.controlBox=a.createGroup([["class","markerjs-line-control-box"]]),e.addToVisual(e.controlBox),e.addControlGrips()},e.adjustControlBox=function(){e.positionGrips()},e.addControlGrips=function(){e.controlGrip1=e.createGrip(),e.controlGrip2=e.createGrip(),e.positionGrips()},e.createGrip=function(){var t=new u;return t.visual.transform.baseVal.appendItem(a.createTransform()),e.controlBox.appendChild(t.visual),t.visual.addEventListener("mousedown",e.gripMouseDown),t.visual.addEventListener("mousemove",e.gripMouseMove),t.visual.addEventListener("mouseup",e.gripMouseUp),t.visual.addEventListener("touchstart",e.onTouch,{passive:!1}),t.visual.addEventListener("touchend",e.onTouch,{passive:!1}),t.visual.addEventListener("touchmove",e.onTouch,{passive:!1}),t},e.positionGrips=function(){var t=e.controlGrip1.GRIP_SIZE,r=e.x1-t/2,i=e.y1-t/2,o=e.x2-t/2,n=e.y2-t/2;e.positionGrip(e.controlGrip1.visual,r,i),e.positionGrip(e.controlGrip2.visual,o,n)},e.positionGrip=function(t,e,r){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,r),t.transform.baseVal.replaceItem(i,0)},e.gripMouseDown=function(t){e.isResizing=!0,e.activeGrip=t.target===e.controlGrip1.visual?e.controlGrip1:e.controlGrip2,e.previousMouseX=t.screenX,e.previousMouseY=t.screenY,e.previousState=e.getState(),t.stopPropagation()},e.gripMouseUp=function(t){e.endManipulation(),e.activeGrip=null,t.stopPropagation()},e.gripMouseMove=function(t){e.isResizing&&e.manipulate(t)},e}return i(e,t),e.prototype.endManipulation=function(){t.prototype.endManipulation.call(this),this.isResizing=!1,this.activeGrip=null},e.prototype.select=function(){t.prototype.select.call(this),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){this.x1=e.x1,this.y1=e.y1,this.x2=e.x2,this.y2=e.y2,t.prototype.restoreState.call(this,e),this.adjustLine()},e.prototype.setup=function(){t.prototype.setup.call(this),this.markerBgLine=a.createLine(0,0,this.x2,0,[["stroke","transparent"],["stroke-width","30"]]),this.addToRenderVisual(this.markerBgLine),this.markerLine=a.createLine(0,0,this.x2,0),this.addToRenderVisual(this.markerLine),this.addControlBox()},e.prototype.resize=function(t,e){var r=this.previousState?this.previousState.x1:0,i=this.previousState?this.previousState.y1:0,o=this.previousState?this.previousState.x2:0,n=this.previousState?this.previousState.y2:0;this.activeGrip&&(this.activeGrip===this.controlGrip1&&this.getLineLength(r+t,i+1,o,n)>=this.MIN_LENGTH?(this.x1=r+t,this.y1=i+e):this.activeGrip===this.controlGrip2&&this.getLineLength(r,i,o+t,n+e)>=this.MIN_LENGTH&&(this.x2=o+t,this.y2=n+e)),this.adjustLine(),this.adjustControlBox()},e.prototype.adjustLine=function(){this.markerBgLine.setAttribute("x1",this.x1.toString()),this.markerBgLine.setAttribute("y1",this.y1.toString()),this.markerLine.setAttribute("x1",this.x1.toString()),this.markerLine.setAttribute("y1",this.y1.toString()),this.markerBgLine.setAttribute("x2",this.x2.toString()),this.markerBgLine.setAttribute("y2",this.y2.toString()),this.markerLine.setAttribute("x2",this.x2.toString()),this.markerLine.setAttribute("y2",this.y2.toString())},e.createMarker=function(){var t=new e;return t.setup(),t},e}(h),d=function(t){function e(){var e=t.call(this)||this;return e.ARROW_SIZE=6,e.markerTypeName="ArrowMarker",e}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),a.setAttributes(this.visual,[["class","arrow-marker"]]);var e=a.createPolygon("0,0 "+this.ARROW_SIZE+","+this.ARROW_SIZE/2+" 0,"+this.ARROW_SIZE,[["class","arrow-marker-tip"]]);this.defs.push(a.createMarker("arrow-marker-head","auto",this.ARROW_SIZE,this.ARROW_SIZE,this.ARROW_SIZE-1,this.ARROW_SIZE/2,e)),this.markerLine.setAttribute("marker-end","url(#arrow-marker-head)")},e.createMarker=function(){var t=new e;return t.setup(),t},e}(p),m=function(){this.name="arrow-marker",this.tooltipText="Arrow",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z"/></svg>',this.markerType=d},g=function(){var t=this;this.findGripByVisual=function(e){switch(e){case t.topLeft.visual:return t.topLeft;case t.topCenter.visual:return t.topCenter;case t.topRight.visual:return t.topRight;case t.centerLeft.visual:return t.centerLeft;case t.centerRight.visual:return t.centerRight;case t.bottomLeft.visual:return t.bottomLeft;case t.bottomCenter.visual:return t.bottomCenter;case t.bottomRight.visual:return t.bottomRight}}},v=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.MIN_SIZE=5,e.CB_DISTANCE=10,e.addControlBox=function(){e.controlBox=a.createGroup([["class","markerjs-rect-control-box"]]);var t=a.createTransform();t.setTranslate(-e.CB_DISTANCE/2,-e.CB_DISTANCE/2),e.controlBox.transform.baseVal.appendItem(t),e.addToVisual(e.controlBox),e.controlRect=a.createRect(e.width+e.CB_DISTANCE,e.height+e.CB_DISTANCE,[["class","markerjs-rect-control-rect"]]),e.controlBox.appendChild(e.controlRect),e.controlGrips=new g,e.addControlGrips()},e.adjustControlBox=function(){e.controlRect.setAttribute("width",(e.width+e.CB_DISTANCE).toString()),e.controlRect.setAttribute("height",(e.height+e.CB_DISTANCE).toString()),e.positionGrips()},e.addControlGrips=function(){e.controlGrips.topLeft=e.createGrip(),e.controlGrips.topCenter=e.createGrip(),e.controlGrips.topRight=e.createGrip(),e.controlGrips.centerLeft=e.createGrip(),e.controlGrips.centerRight=e.createGrip(),e.controlGrips.bottomLeft=e.createGrip(),e.controlGrips.bottomCenter=e.createGrip(),e.controlGrips.bottomRight=e.createGrip(),e.positionGrips()},e.createGrip=function(){var t=new u;return t.visual.transform.baseVal.appendItem(a.createTransform()),e.controlBox.appendChild(t.visual),t.visual.addEventListener("mousedown",e.gripMouseDown),t.visual.addEventListener("mousemove",e.gripMouseMove),t.visual.addEventListener("mouseup",e.gripMouseUp),t.visual.addEventListener("touchstart",e.onTouch,{passive:!1}),t.visual.addEventListener("touchend",e.onTouch,{passive:!1}),t.visual.addEventListener("touchmove",e.onTouch,{passive:!1}),t},e.positionGrips=function(){var t=e.controlGrips.topLeft.GRIP_SIZE,r=-t/2,i=r,o=(e.width+e.CB_DISTANCE)/2-t/2,n=(e.height+e.CB_DISTANCE)/2-t/2,a=e.height+e.CB_DISTANCE-t/2,s=e.width+e.CB_DISTANCE-t/2;e.positionGrip(e.controlGrips.topLeft.visual,r,i),e.positionGrip(e.controlGrips.topCenter.visual,o,i),e.positionGrip(e.controlGrips.topRight.visual,s,i),e.positionGrip(e.controlGrips.centerLeft.visual,r,n),e.positionGrip(e.controlGrips.centerRight.visual,s,n),e.positionGrip(e.controlGrips.bottomLeft.visual,r,a),e.positionGrip(e.controlGrips.bottomCenter.visual,o,a),e.positionGrip(e.controlGrips.bottomRight.visual,s,a)},e.positionGrip=function(t,e,r){var i=t.transform.baseVal.getItem(0);i.setTranslate(e,r),t.transform.baseVal.replaceItem(i,0)},e.gripMouseDown=function(t){e.isResizing=!0,e.activeGrip=e.controlGrips.findGripByVisual(t.target),e.previousMouseX=t.screenX,e.previousMouseY=t.screenY,e.previousState=e.getState(),t.stopPropagation()},e.gripMouseUp=function(t){e.endManipulation(),e.activeGrip=null,t.stopPropagation()},e.gripMouseMove=function(t){e.isResizing&&e.manipulate(t)},e}return i(e,t),e.prototype.endManipulation=function(){t.prototype.endManipulation.call(this),this.isResizing=!1,this.activeGrip=null},e.prototype.select=function(){t.prototype.select.call(this),this.controlBox.style.display=""},e.prototype.deselect=function(){t.prototype.deselect.call(this),this.controlBox.style.display="none"},e.prototype.setup=function(){t.prototype.setup.call(this),this.addControlBox()},e.prototype.resize=function(t,e){var r=this.previousState?this.previousState.width:0,i=this.previousState?this.previousState.height:0,o=this.previousState?this.previousState.translateX:0,n=this.previousState?this.previousState.translateY:0,a=o,s=n;switch(this.activeGrip){case this.controlGrips.topLeft:this.width=r-t,this.height=i-e,a+=t,s+=e;break;case this.controlGrips.bottomLeft:this.width=r-t,this.height=i+e,a+=t;break;case this.controlGrips.topRight:this.width=r+t,this.height=i-e,s+=e;break;case this.controlGrips.bottomRight:this.width=r+t,this.height=i+e;break;case this.controlGrips.centerLeft:this.width=r-t,a+=t;break;case this.controlGrips.centerRight:this.width=r+t;break;case this.controlGrips.topCenter:this.height=i-e,s+=e;break;case this.controlGrips.bottomCenter:this.height=i+e}if(this.width<this.MIN_SIZE&&(this.width=this.MIN_SIZE,a=a>o?o+r-this.width:o),this.height<this.MIN_SIZE&&(this.height=this.MIN_SIZE,s=s>n?n+i-this.height:n),0!==a||0!==s){var l=this.visual.transform.baseVal.getItem(0);l.setTranslate(a,s),this.visual.transform.baseVal.replaceItem(l,0)}this.adjustControlBox()},e.prototype.onTouch=function(e){t.prototype.onTouch.call(this,e)},e.createMarker=function(){var t=new e;return t.setup(),t},e}(h),f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),this.markerRect=a.createRect(this.width,this.height),this.addToRenderVisual(this.markerRect)},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.markerRect.setAttribute("width",this.width.toString()),this.markerRect.setAttribute("height",this.height.toString())},e.createMarker=function(){var t=new e;return t.setup(),t},e}(v),k=function(t){function e(){var e=t.call(this)||this;return e.markerTypeName="CoverMarker",e}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),a.setAttributes(this.visual,[["class","cover-marker"]])},e.createMarker=function(){var t=new e;return t.setup(),t},e}(f),w=function(){this.name="cover-marker",this.tooltipText="Cover",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z"/></svg>',this.markerType=k},y=function(t){function e(){var e=t.call(this)||this;return e.markerTypeName="HighlightMarker",e}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),a.setAttributes(this.visual,[["class","highlight-marker"]])},e.createMarker=function(){var t=new e;return t.setup(),t},e}(f),x=function(){this.name="cover-marker",this.tooltipText="Cover",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 544 512"><path d="M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 00-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z"/></svg>',this.markerType=y},b=function(t){function e(){var e=t.call(this)||this;return e.markerTypeName="LineMarker",e}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),a.setAttributes(this.visual,[["class","line-marker"]])},e.createMarker=function(){var t=new e;return t.setup(),t},e}(p),M=function(){this.name="line-marker",this.tooltipText="Line",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path d="M594.53 508.63L6.18 53.9c-6.97-5.42-8.23-15.47-2.81-22.45L23.01 6.18C28.43-.8 38.49-2.06 45.47 3.37L633.82 458.1c6.97 5.42 8.23 15.47 2.81 22.45l-19.64 25.27c-5.42 6.98-15.48 8.23-22.46 2.81z"/></svg>',this.markerType=b},S=function(t){function e(){var e=t.call(this)||this;return e.markerTypeName="RectMarker",e}return i(e,t),e.prototype.setup=function(){t.prototype.setup.call(this),a.setAttributes(this.visual,[["class","rect-marker"]])},e.createMarker=function(){var t=new e;return t.setup(),t},e}(f),I=function(){this.name="rect-marker",this.tooltipText="Rectangle",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z"/></svg>',this.markerType=S},C=function(t){function e(){var e=t.call(this)||this;return e.MIN_SIZE=50,e.DEFAULT_TEXT="Double-click to edit text",e.text=e.DEFAULT_TEXT,e.inDoubleTap=!1,e.renderText=function(){for(var t,r;e.textElement.lastChild;)e.textElement.removeChild(e.textElement.lastChild);var i=e.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);try{for(var n=o(i),s=n.next();!s.done;s=n.next()){var l=s.value;""===l.trim()&&(l=" "),e.textElement.appendChild(a.createTSpan(l,[["x","0"],["dy","1.2em"]]))}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}setTimeout(e.sizeText,10)},e.sizeText=function(){var t=e.textElement.getBBox(),r=0,i=0,o=1;if(t.width>0&&t.height>0){var n=1*e.width/t.width,a=1*e.height/t.height;o=Math.min(n,a),r=(e.width-t.width*o)/2,i=(e.height-t.height*o)/2}e.textElement.transform.baseVal.getItem(0).setTranslate(r,i),e.textElement.transform.baseVal.getItem(1).setScale(o,o)},e.onDblClick=function(t){e.showEditor()},e.onTap=function(t){e.inDoubleTap?(e.inDoubleTap=!1,e.showEditor()):(e.inDoubleTap=!0,setTimeout((function(){e.inDoubleTap=!1}),300))},e.showEditor=function(){e.editor=document.createElement("div"),e.editor.className="markerjs-text-editor",e.editorTextArea=document.createElement("textarea"),e.text!==e.DEFAULT_TEXT&&(e.editorTextArea.value=e.text),e.editorTextArea.addEventListener("keydown",e.onEditorKeyDown),e.editor.appendChild(e.editorTextArea),document.body.appendChild(e.editor);var t=document.createElement("div");t.className="markerjs-text-editor-button-bar",e.editor.appendChild(t);var r=document.createElement("div");r.className="markerjs-text-editor-button",r.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg>',r.addEventListener("click",e.onEditorOkClick),t.appendChild(r);var i=document.createElement("div");i.className="markerjs-text-editor-button",i.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"/></svg>',i.addEventListener("click",e.closeEditor),t.appendChild(i)},e.onEditorOkClick=function(t){e.editorTextArea.value.trim()?e.text=e.editorTextArea.value:e.text=e.DEFAULT_TEXT,e.renderText(),e.closeEditor()},e.closeEditor=function(){document.body.removeChild(e.editor)},e.onEditorKeyDown=function(t){"Enter"===t.key&&t.ctrlKey&&(t.preventDefault(),e.onEditorOkClick(null))},e.markerTypeName="TextMarker",e}return i(e,t),e.prototype.getState=function(){return Object.assign({text:this.text},t.prototype.getState.call(this))},e.prototype.restoreState=function(e){this.text=e.text,t.prototype.restoreState.call(this,e),this.renderText()},e.prototype.setup=function(){t.prototype.setup.call(this),this.textElement=a.createText(),this.addToRenderVisual(this.textElement),a.setAttributes(this.visual,[["class","text-marker"]]),this.textElement.transform.baseVal.appendItem(a.createTransform()),this.textElement.transform.baseVal.appendItem(a.createTransform()),this.renderText(),this.visual.addEventListener("dblclick",this.onDblClick),this.visual.addEventListener("touchstart",this.onTap)},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.sizeText()},e.createMarker=function(){var t=new e;return t.setup(),t},e}(v),T=function(){this.name="text-marker",this.tooltipText="Text",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M152 416h-24.013l26.586-80.782H292.8L319.386 416H296c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16h-26.739L275.495 42.746A16 16 0 00260.382 32h-72.766a16 16 0 00-15.113 10.746L42.739 416H16c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16zm64.353-271.778c4.348-15.216 6.61-28.156 7.586-34.644.839 6.521 2.939 19.476 7.727 34.706l41.335 124.006h-98.619l41.971-124.068z"/></svg>',this.markerType=C},E=function(t){function e(){var e=t.call(this)||this;return e.markerTypeName="EllipseMarker",e}return i(e,t),e.prototype.setup=function(){this.height=this.width,t.prototype.setup.call(this),this.markerEllipse=a.createEllipse(this.width,this.height),this.addToRenderVisual(this.markerEllipse),a.setAttributes(this.visual,[["class","ellipse-marker"]])},e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r),this.markerEllipse.setAttribute("cx",(this.width/2).toString()),this.markerEllipse.setAttribute("cy",(this.height/2).toString()),this.markerEllipse.setAttribute("rx",(this.width/2).toString()),this.markerEllipse.setAttribute("ry",(this.height/2).toString())},e.createMarker=function(){var t=new e;return t.setup(),t},e}(v),L=function(){this.name="ellipse-marker",this.tooltipText="Ellipse",this.icon='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"/></svg>',this.markerType=E},A=function(){function t(t){var e=this;t&&(this.markers=[],t.forEach((function(t){return e.markers.push(t.getState())})))}return t.prototype.getJSON=function(){return JSON.stringify(this)},t}(),G=function(t,r){var i=this;this.toolbars=[{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z"/></svg>',name:"pointer",tooltipText:"Pointer"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 00144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z"/></svg>',name:"delete",tooltipText:"Delete"},{name:"separator",tooltipText:""},new I,new L,new w,new x,new M,new m,new T,{name:"separator",tooltipText:""},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"/></svg>',name:"ok",tooltipText:"OK"},{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 352 512"><path d="M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"/></svg>',name:"close",tooltipText:"Close"}],this.scale=1,this.show=function(t,e){i.completeCallback=t,i.cancelCallback=e,i.open(),i.showUI()},this.open=function(){i.setTargetRect(),i.initMarkerCanvas(),i.attachEvents(),i.setStyles(),i.previousState&&i.restoreState(),e.isLicensed||i.addLogo(),window.addEventListener("resize",i.adjustUI)},this.restoreState=function(){i.previousState&&i.previousState.markers.forEach((function(t){switch(t.markerType){case"RectMarker":i.addMarker(S,t);break;case"EllipseMarker":i.addMarker(E,t);break;case"CoverMarker":i.addMarker(k,t);break;case"HighlightMarker":i.addMarker(y,t);break;case"TextMarker":i.addMarker(C,t);break;case"LineMarker":i.addMarker(b,t);break;case"ArrowMarker":i.addMarker(d,t);break;default:console.log("missing marker type state handler: "+t.markerType)}}))},this.render=function(t,e){i.completeCallback=t,i.cancelCallback=e,i.selectMarker(null),i.startRender(i.renderFinished)},this.close=function(){i.toolbarUI&&i.targetRoot.removeChild(i.toolbarUI),i.markerImage&&i.targetRoot.removeChild(i.markerImageHolder),i.logoUI&&i.targetRoot.removeChild(i.logoUI)},this.addMarker=function(t,e){var r,n,a=t.createMarker();if(a.onSelected=i.selectMarker,a.defs&&a.defs.length>0)try{for(var s=o(a.defs),l=s.next();!l.done;l=s.next()){var c=l.value;c.id&&!i.markerImage.getElementById(c.id)&&i.defs.appendChild(c)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}i.markers.push(a),i.selectMarker(a),i.markerImage.appendChild(a.visual);var h=a.visual.getBBox(),u=i.width/2/i.scale-h.width/2,p=i.height/2/i.scale-h.height/2,d=a.visual.transform.baseVal.getItem(0);d.setMatrix(d.matrix.translate(u,p)),a.visual.transform.baseVal.replaceItem(d,0),e&&a.restoreState(e)},this.deleteActiveMarker=function(){i.activeMarker&&i.deleteMarker(i.activeMarker)},this.getState=function(){return new A(i.markers)},this.setTargetRect=function(){var t=i.target.getBoundingClientRect(),e=i.targetRoot.parentElement.getBoundingClientRect();i.targetRect={left:t.left-e.left,top:t.top-e.top}},this.startRender=function(t){(new s).rasterize(i.target,i.markerImage,t,i.renderAtNaturalSize,i.renderImageType,i.renderImageQuality,i.renderMarkersOnly)},this.attachEvents=function(){i.markerImage.addEventListener("mousedown",i.mouseDown),i.markerImage.addEventListener("mousemove",i.mouseMove),i.markerImage.addEventListener("mouseup",i.mouseUp)},this.mouseDown=function(t){i.activeMarker&&(1&t.buttons)>0&&(i.activeMarker.deselect(),i.activeMarker=null)},this.mouseMove=function(t){i.activeMarker&&(1&t.buttons)>0&&i.activeMarker.manipulate(t)},this.mouseUp=function(t){i.activeMarker&&i.activeMarker.endManipulation()},this.initMarkerCanvas=function(){i.markerImageHolder=document.createElement("div"),i.markerImageHolder.style.setProperty("touch-action","none"),i.markerImageHolder.style.setProperty("-ms-touch-action","none"),i.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.markerImage.setAttribute("width",i.width.toString()),i.markerImage.setAttribute("height",i.height.toString()),i.markerImage.setAttribute("viewBox","0 0 "+i.width.toString()+" "+i.height.toString()),i.markerImageHolder.style.position="absolute",i.markerImageHolder.style.width=i.width+"px",i.markerImageHolder.style.height=i.height+"px",i.markerImageHolder.style.transformOrigin="top left",i.positionMarkerImage(),i.defs=a.createDefs(),i.markerImage.appendChild(i.defs),i.markerImageHolder.appendChild(i.markerImage),i.targetRoot.appendChild(i.markerImageHolder)},this.adjustUI=function(t){i.adjustSize(),i.positionUI()},this.adjustSize=function(){i.width=i.target.clientWidth,i.height=i.target.clientHeight;var t=i.target.clientWidth/i.markerImageHolder.clientWidth;1!==t&&(i.scale*=t,i.markerImageHolder.style.width=i.width+"px",i.markerImageHolder.style.height=i.height+"px",i.markerImageHolder.style.transform="scale("+i.scale+")")},this.positionUI=function(){i.setTargetRect(),i.positionMarkerImage(),i.positionToolbar(),i.logoUI&&i.positionLogo()},this.positionMarkerImage=function(){i.markerImageHolder.style.top=i.targetRect.top+"px",i.markerImageHolder.style.left=i.targetRect.left+"px"},this.positionToolbar=function(){i.toolbarUI&&(i.toolbarUI.style.left=i.targetRect.left+i.target.offsetWidth-i.toolbarUI.clientWidth+"px",i.toolbarUI.style.top=i.targetRect.top-i.toolbarUI.clientHeight+"px")},this.showUI=function(){i.toolbar=new c(i.toolbars,i.toolbarClick),i.toolbarUI=i.toolbar.getUI(),i.targetRoot.appendChild(i.toolbarUI),i.toolbarUI.style.position="absolute",i.positionToolbar()},this.setStyles=function(){var t=document.createElementNS("http://www.w3.org/2000/svg","style");t.innerHTML="\n .rect-marker .render-visual {\n stroke: "+i.markerColors.mainColor+";\n stroke-width: "+i.strokeWidth+";\n fill: transparent;\n }\n .cover-marker .render-visual {\n stroke-width: 0;\n fill: "+i.markerColors.coverColor+";\n }\n .highlight-marker .render-visual {\n stroke: transparent;\n stroke-width: 0;\n fill: "+i.markerColors.highlightColor+";\n fill-opacity: 0.4;\n }\n .line-marker .render-visual {\n stroke: "+i.markerColors.mainColor+";\n stroke-width: "+i.strokeWidth+";\n fill: transparent;\n }\n .arrow-marker .render-visual {\n stroke: "+i.markerColors.mainColor+";\n stroke-width: "+i.strokeWidth+";\n fill: transparent;\n }\n .arrow-marker-tip {\n stroke-width: 0;\n fill: "+i.markerColors.mainColor+";\n }\n .text-marker text {\n fill: "+i.markerColors.mainColor+';\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",\n Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji",\n "Segoe UI Emoji", "Segoe UI Symbol";\n }\n .ellipse-marker .render-visual {\n stroke: '+i.markerColors.mainColor+";\n stroke-width: "+i.strokeWidth+";\n fill: transparent;\n }\n .markerjs-rect-control-box .markerjs-rect-control-rect {\n stroke: black;\n stroke-width: 1;\n stroke-opacity: 0.5;\n stroke-dasharray: 3, 2;\n fill: transparent;\n }\n .markerjs-control-grip {\n fill: #cccccc;\n stroke: #333333;\n stroke-width: 2;\n }\n ",i.markerImage.appendChild(t)},this.toolbarClick=function(t,e){if(e.markerType)i.addMarker(e.markerType);else switch(e.name){case"delete":i.deleteActiveMarker();break;case"pointer":i.activeMarker&&i.selectMarker(null);break;case"close":i.cancel();break;case"ok":i.complete()}},this.selectMarker=function(t){i.activeMarker&&i.activeMarker!==t&&i.activeMarker.deselect(),i.activeMarker=t},this.deleteMarker=function(t){i.markerImage.removeChild(t.visual),i.activeMarker===t&&(i.activeMarker=null),i.markers.splice(i.markers.indexOf(t),1)},this.complete=function(){i.selectMarker(null),i.startRender(i.renderFinishedClose)},this.cancel=function(){i.close(),i.cancelCallback&&i.cancelCallback()},this.renderFinished=function(t){i.completeCallback(t,i.getState())},this.renderFinishedClose=function(t){i.close(),i.completeCallback(t,i.getState())},this.positionLogo=function(){i.logoUI&&(i.logoUI.style.left=i.targetRect.left+10+"px",i.logoUI.style.top=i.targetRect.top+i.target.offsetHeight-i.logoUI.clientHeight-10+"px")},this.addLogo=function(){i.logoUI=document.createElement("div"),i.logoUI.className="markerjs-logo";var t=document.createElement("a");t.href="https://markerjs.com/",t.target="_blank",t.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',t.title="Powered by marker.js",i.logoUI.appendChild(t),i.targetRoot.appendChild(i.logoUI),i.logoUI.style.position="absolute",i.positionLogo()},this.target=t,this.targetRoot=r&&r.targetRoot?r.targetRoot:document.body,this.renderAtNaturalSize=!(!r||void 0===r.renderAtNaturalSize)&&r.renderAtNaturalSize,this.markerColors={mainColor:r&&r.markerColors&&r.markerColors.mainColor?r.markerColors.mainColor:"#ff0000",highlightColor:r&&r.markerColors&&r.markerColors.highlightColor?r.markerColors.highlightColor:"#ffff00",coverColor:r&&r.markerColors&&r.markerColors.coverColor?r.markerColors.coverColor:"#000000"},this.strokeWidth=r&&r.strokeWidth?r.strokeWidth:3,r&&r.renderImageType&&(this.renderImageType=r.renderImageType),r&&r.renderImageQuality&&(this.renderImageQuality=r.renderImageQuality),r&&r.renderMarkersOnly&&(this.renderMarkersOnly=r.renderMarkersOnly),r&&r.previousState&&(this.previousState=r.previousState),this.width=t.clientWidth,this.height=t.clientHeight,this.markers=[],this.activeMarker=null};!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".markerjs-logo {\r\n display: inline-block;\r\n margin: 0px;\r\n padding: 0px;\r\n\r\n fill: #333333;\r\n}\r\n\r\n.markerjs-logo a {\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n padding: 3px;\r\n width: 20px;\r\n height: 20px;\r\n}\r\n\r\n.markerjs-logo a:hover {\r\n fill: #ff8080;\r\n}\r\n\r\n.markerjs-toolbar {\r\n background-color: #cccccc;\r\n padding: 0px 5px;\r\n margin: 0px;\r\n border-top-left-radius: 10px;\r\n border-top-right-radius: 10px;\r\n\r\n display: grid;\r\n grid-template-columns: repeat(20, auto);\r\n}\r\n\r\n\r\n.markerjs-toolbar-button, .markerjs-toolbar-logo a {\r\n display: inline-block;\r\n margin: 2px;\r\n padding: 3px;\r\n cursor: pointer;\r\n width: 20px;\r\n height: 20px;\r\n border-radius: 2px;\r\n border-bottom: transparent solid 1px;\r\n border-right: transparent solid 1px;\r\n\r\n\r\n fill: #333333;\r\n\r\n display: grid;\r\n align-items: center;\r\n justify-items: center;\r\n}\r\n\r\n.markerjs-toolbar-separator {\r\n margin: 5px 5px;\r\n border: 1px solid #dddddd;\r\n}\r\n\r\n.markerjs-toolbar-button:hover, .markerjs-toolbar-logo a:hover {\r\n background-color: #eeeeee;\r\n background: radial-gradient(#eeeeee, #cccccc);\r\n\r\n fill: #ff8080;\r\n}\r\n\r\n.markerjs-toolbar-button svg {\r\n height: 16px;\r\n}\r\n\r\n.markerjs-text-editor {\r\n position: fixed;\r\n z-index: 20000;\r\n left: 0px;\r\n top: 0px;\r\n width: 100vw;\r\n height: 100vh;\r\n background-color: rgba(0,0,0,0.9);\r\n\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n justify-content: center;\r\n}\r\n\r\n.markerjs-text-editor textarea {\r\n width: 50%;\r\n min-width: 50px;\r\n max-width: 500px;\r\n height: 50%;\r\n min-height: 50px;\r\n max-height: 500px;\r\n}\r\n\r\n.markerjs-text-editor .markerjs-text-editor-button-bar {\r\n display: flex;\r\n flex-direction: row;\r\n justify-content: flex-end;\r\n width: 50%;\r\n min-width: 50px;\r\n max-width: 500px;\r\n padding-top: 10px;\r\n}\r\n.markerjs-text-editor .markerjs-text-editor-button {\r\n display: grid;\r\n align-items: center;\r\n padding: 0px;\r\n margin-left: 15px;\r\n width: 20px;\r\n height: 20px;\r\n\r\n cursor: pointer;\r\n\r\n fill: #888888;\r\n}\r\n.markerjs-text-editor .markerjs-text-editor-button:hover {\r\n fill: #ff8080;\r\n}"),t.Activator=e,t.ArrowMarker=d,t.CoverMarker=k,t.EllipseMarker=E,t.HighlightMarker=y,t.LineMarker=b,t.MarkerArea=G,t.RectMarker=S,t.TextMarker=C,Object.defineProperty(t,"__esModule",{value:!0})}));