This repository has been archived on 2023-05-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ImgAnnotations/vendor/js/picture-annotation.min.js
2022-01-21 16:01:56 +01:00

2 lines
26 KiB
JavaScript

(function(e){function t(t){for(var n,o,r=t[0],_=t[1],l=t[2],d=0,h=[];d<r.length;d++)o=r[d],Object.prototype.hasOwnProperty.call(i,o)&&i[o]&&h.push(i[o][0]),i[o]=0;for(n in _)Object.prototype.hasOwnProperty.call(_,n)&&(e[n]=_[n]);c&&c(t);while(h.length)h.shift()();return s.push.apply(s,l||[]),a()}function a(){for(var e,t=0;t<s.length;t++){for(var a=s[t],n=!0,r=1;r<a.length;r++){var _=a[r];0!==i[_]&&(n=!1)}n&&(s.splice(t--,1),e=o(o.s=a[0]))}return e}var n={},i={app:0},s=[];function o(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.m=e,o.c=n,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/";var r=window["webpackJsonp"]=window["webpackJsonp"]||[],_=r.push.bind(r);r.push=t,r=r.slice();for(var l=0;l<r.length;l++)t(r[l]);var c=_;s.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"3f4a":function(module,__webpack_exports__,__webpack_require__){"use strict";var _var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("53ca"),_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("5530"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("b0c0"),core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(core_js_modules_es_function_name_js__WEBPACK_IMPORTED_MODULE_2__),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("7db0"),core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(core_js_modules_es_array_find_js__WEBPACK_IMPORTED_MODULE_3__),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("a434"),core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_4___default=__webpack_require__.n(core_js_modules_es_array_splice_js__WEBPACK_IMPORTED_MODULE_4__),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("c740"),core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(core_js_modules_es_array_find_index_js__WEBPACK_IMPORTED_MODULE_5__),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("cb29"),core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(core_js_modules_es_array_fill_js__WEBPACK_IMPORTED_MODULE_6__),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("159b"),core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(core_js_modules_web_dom_collections_for_each_js__WEBPACK_IMPORTED_MODULE_7__),vue__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("2b0e"),vue_konva__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("7591"),vue_konva__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(vue_konva__WEBPACK_IMPORTED_MODULE_9__),vue_i18n__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("a925"),_i18n_js__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("9225"),_components_Icon__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("cdae"),_components_Loader__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("555f"),_components_SideBarEntry__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("70dc");vue__WEBPACK_IMPORTED_MODULE_8__["default"].use(vue_konva__WEBPACK_IMPORTED_MODULE_9___default.a),vue__WEBPACK_IMPORTED_MODULE_8__["default"].use(vue_i18n__WEBPACK_IMPORTED_MODULE_10__["a"]),vue__WEBPACK_IMPORTED_MODULE_8__["default"].config.productionTip=!1,__webpack_exports__["a"]={components:{SideBarEntry:_components_SideBarEntry__WEBPACK_IMPORTED_MODULE_14__["a"],Icon:_components_Icon__WEBPACK_IMPORTED_MODULE_12__["a"],Loader:_components_Loader__WEBPACK_IMPORTED_MODULE_13__["a"]},props:["language","containerId","imageSrc","dataCallback","localStorageKey","width","height","editMode","initialData","initialDataId"],i18n:new vue_i18n__WEBPACK_IMPORTED_MODULE_10__["a"](_i18n_js__WEBPACK_IMPORTED_MODULE_11__["a"]),data:function(){return{image:null,stageSize:{width:null,height:null},scale:1,shapes:[],selectedShapeName:"",currentHoverShape:"",isLoading:!0,isShapesVisible:!0,isAddingPolygon:!1,polygonPoints:[],polygonAddShapes:[],callback:void 0,formData:{title:"",text:"",linkTitle:"",link:""}}},computed:{polygonPointsConfig:function(){return Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({points:this.polygonPoints},this.getBaseShapeForPolygon()),{},{closed:!0})}},created:function created(){var _this=this;this.stageSize.width=parseInt(this.width)/3*2-2,this.stageSize.height=parseInt(this.height),this.stageSize.width&&!isNaN(this.stageSize.width)||(this.stageSize.width=window.innerWidth),this.stageSize.height&&!isNaN(this.stageSize.height)||(this.stageSize.height=window.innerHeight);var image=new window.Image;image.src=this.imageSrc,image.onload=function(){_this.image=image,_this.changeScale(-1+Math.min(_this.stageSize.width/image.width,_this.stageSize.height/image.height)),_this.isLoading=!1},this.callback=this.dataCallback&&Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__["a"])(eval(this.dataCallback))&&eval(this.dataCallback)},mounted:function(){document.addEventListener("keydown",this.handleKeyEvent),this.language&&(this.$i18n.locale=this.language),this.load()},beforeDestroy:function(){document.removeEventListener("keydown",this.handleKeyEvent)},methods:{handleStageMouseDown:function(e){if(this.isAddingPolygon)return e.evt.preventDefault(),e.evt.stopPropagation(),e.evt.stopImmediatePropagation(),void(2===e.evt.button?this.removePolygonPoint():1===e.evt.detail&&this.addPolygonPoint());if(!e.evt||0===e.evt.button){if(this.editMode){if(e.target===e.target.getStage())return this.selectedShapeName="",void this.updateTransformer();var t="Transformer"===e.target.getParent().className;if(t)return}var a=e.target.name(),n=this.shapes.find((function(e){return e.name===a}));this.selectedShapeName=n?a:"",this.editMode&&this.updateTransformer()}},updateTransformer:function(){if(this.editMode){var e=this.$refs.transformer.getStage(),t=e.getStage(),a=this.selectedShapeName,n=t.findOne("."+a);n!==e.node()&&(n?e.attachTo(n):e.detach(),e.getLayer().batchDraw())}},cancelEvent:function(e){e.evt.preventDefault()},startPolygonDrawing:function(){this.isAddingPolygon?this.finishPolygon():this.isAddingPolygon=!0},addPolygonPoint:function(){var e=this.$refs.stage.getStage(),t=e.getPointerPosition(),a=(t.x-(e.attrs.x||0))/e.attrs.scaleX,n=(t.y-(e.attrs.y||0))/e.attrs.scaleY;this.polygonPoints.push(a,n),this.polygonAddShapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShapeForPolygon()),{},{x:a-15,y:n-15,width:30,height:30}))},removePolygonPoint:function(){this.polygonPoints.length&&(this.polygonPoints.splice(this.polygonPoints.length-2,2),this.polygonAddShapes.pop())},finishPolygon:function(){var e=this.polygonPoints.splice(0,this.polygonPoints.length);e.length>5&&this.addPolygon(e),this.polygonAddShapes.length&&this.polygonAddShapes.splice(0,this.polygonAddShapes.length),this.isAddingPolygon=!1},addPolygon:function(e){this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("poly")),{},{points:e,closed:!0,x:0,y:0})),this.shapesUpdated()},addRectangle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("rect")),{},{x:80/this.scale,y:50/this.scale,width:200/this.scale,height:200/this.scale})),this.shapesUpdated())},addCircle:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("circle")),{},{x:180/this.scale,y:200/this.scale,radius:100/this.scale})),this.shapesUpdated())},addPerson:function(){this.isAddingPolygon||(this.shapes.push(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])(Object(_var_www_debb1_local_picture_annotation_node_modules_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_1__["a"])({},this.getBaseShape("path")),{},{x:80/this.scale,y:80/this.scale,data:"m 105.61519,0 a 52.807596,52.807596 0 1 1 0,105.61519 52.807596,52.807596 0 0 1 0,-105.61519 m 0,105.61519 c 58.3524,0 105.61522,23.63141 105.61522,52.8076 V 264.038 H 0 V 158.42279 c 0,-29.17619 47.262803,-52.8076 105.61519,-52.8076 z",scale:{x:1/this.scale,y:1/this.scale}})),this.shapesUpdated())},getBaseShape:function(e){return{type:e,name:"shape-"+(new Date).valueOf(),fill:"#b0c4de",opacity:.5,stroke:"#0000ff",draggable:!0,strokeWidth:2,strokeScaleEnabled:!1,annotation:{title:"",text:"",linkTitle:"",link:""}}},getBaseShapeForPolygon:function(e){return{fill:"#a24545",opacity:.5,stroke:"#800000",strokeWidth:2,strokeScaleEnabled:!1}},deleteShape:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(e===this.selectedShapeName&&(this.selectedShapeName="",this.updateTransformer()),this.shapes.splice(t,1),this.shapesUpdated())},handleKeyEvent:function(e){this.editMode&&this.selectedShapeName&&"Delete"===e.key&&this.deleteShape(this.selectedShapeName)},handleScroll:function(e){if(e.evt){var t=e.evt;t.preventDefault();var a=t.deltaY<0?1:-1;this.changeScale(.02*a)}},changeScale:function(e){var t=this.scale+e;t<.1&&(t=.1),t>5&&(t=5),this.scale=t},handleDragEnd:function(e,t){t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleTransform:function(e,t){t.rotation=e.currentTarget.attrs.rotation,t.scaleX=e.currentTarget.attrs.scaleX,t.scaleY=e.currentTarget.attrs.scaleY,t.x=e.currentTarget.attrs.x,t.y=e.currentTarget.attrs.y,this.shapesUpdated()},handleMouseEnter:function(e){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="pointer",this.currentHoverShape=e)},handleMouseLeave:function(){this.isAddingPolygon||(this.$refs.stage.getStage().container().style.cursor="default",this.currentHoverShape="")},handleGlobalMouseEnter:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="crosshair")},handleGlobalMouseLeave:function(){this.isAddingPolygon&&(this.$refs.stage.getStage().container().style.cursor="default")},handleSideBarMouseEnter:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#c00",this.shapes[t].fill="#dec4b0")}},handleSideBarMouseLeave:function(e){if(!this.isAddingPolygon){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de")}},formSubmitted:function(e){var t=this.shapes.findIndex((function(t){return t.name===e}));t>=0&&(this.shapes[t].stroke="#00f",this.shapes[t].fill="#b0c4de"),this.shapesUpdated()},toggleShowShapes:function(){this.$refs.items.getStage().canvas._canvas.style.opacity=this.isShapesVisible?"0":"1",this.isShapesVisible=!this.isShapesVisible},shapesUpdated:function(){this.callback&&"function"===typeof this.callback&&this.callback(JSON.stringify(this.shapes)),this.localStorageKey&&localStorage.setItem(this.localStorageKey,JSON.stringify(this.shapes))},load:function(){if(this.initialDataId){var e=document.getElementById(this.initialDataId);e&&e.innerHTML&&(this.shapes=JSON.parse(e.innerHTML))}else if(this.initialData&&this.initialData.length>0)this.shapes=JSON.parse(this.initialData);else if(this.localStorageKey){var t=localStorage.getItem(this.localStorageKey)||"[]";this.shapes=JSON.parse(t)}this.editMode||this.shapes.forEach((function(e){return e.draggable&&delete e.draggable}))}}}},"555f":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement;e._self._c;return e._m(0)},i=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-loader"},[a("div",{staticClass:"lds-ring"},[a("div"),a("div"),a("div"),a("div")])])}],s=a("2877"),o={},r=Object(s["a"])(o,n,i,!1,null,null,null);t["a"]=r.exports},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d");for(var n=a("2b0e"),i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-container",style:{width:e.width+"px",height:e.height+"px"},attrs:{id:e.containerId}},[a("div",{staticClass:"pa-canvas"},[a("div",{staticClass:"pa-controls"},[a("a",{attrs:{href:"#",title:e.$t("zoom_in")},on:{click:function(t){return t.preventDefault(),e.changeScale(.1)}}},[a("icon",{attrs:{type:"zoom-in"}})],1),a("a",{attrs:{href:"#",title:e.$t("zoom_out")},on:{click:function(t){return t.preventDefault(),e.changeScale(-.1)}}},[a("icon",{attrs:{type:"zoom-out"}})],1),a("hr"),e.editMode?e._e():a("a",{attrs:{href:"#",title:e.$t(e.isShapesVisible?"hide_shapes":"show_shapes")},on:{click:function(t){return t.preventDefault(),e.toggleShowShapes(t)}}},[a("icon",{attrs:{type:e.isShapesVisible?"shapes-off":"shapes-on"}})],1),e.editMode?a("a",{attrs:{href:"#",title:e.$t(e.isAddingPolygon?"accept_polygon":"add_polygon")},on:{click:function(t){return t.preventDefault(),e.startPolygonDrawing(t)}}},[a("icon",{attrs:{type:e.isAddingPolygon?"add-polygon-accept":"add-polygon",fill:e.isAddingPolygon?"green":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_rectangle")},on:{click:function(t){return t.preventDefault(),e.addRectangle(t)}}},[a("icon",{attrs:{type:"add-rectangle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_circle")},on:{click:function(t){return t.preventDefault(),e.addCircle(t)}}},[a("icon",{attrs:{type:"add-circle",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e(),e.editMode?a("a",{attrs:{href:"#",title:e.$t("add_person")},on:{click:function(t){return t.preventDefault(),e.addPerson(t)}}},[a("icon",{attrs:{type:"add-person",fill:e.isAddingPolygon?"gray":"currentColor"}})],1):e._e()]),a("v-stage",{ref:"stage",attrs:{config:{width:e.stageSize.width,height:e.stageSize.height,scaleX:e.scale,scaleY:e.scale,draggable:!0}},on:{mousedown:e.handleStageMouseDown,contextmenu:e.cancelEvent,mouseenter:e.handleGlobalMouseEnter,mouseleave:e.handleGlobalMouseLeave,wheel:e.handleScroll}},[a("v-layer",{ref:"background"},[a("v-image",{attrs:{config:{image:e.image}}})],1),a("v-layer",{ref:"items"},[e._l(e.shapes,(function(t){return["rect"===t.type?a("v-rect",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"circle"===t.type?a("v-circle",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"poly"===t.type?a("v-line",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e(),"path"===t.type?a("v-path",{key:t.name,attrs:{config:t},on:{dragend:function(a){return e.handleDragEnd(a,t)},transformend:function(a){return e.handleTransform(a,t)},mouseenter:function(a){return e.handleMouseEnter(t.name)},mouseleave:e.handleMouseLeave}}):e._e()]})),e.editMode?a("v-transformer",{ref:"transformer"}):e._e()],2),e.editMode&&e.isAddingPolygon?a("v-layer",{ref:"polygon"},[e.polygonPoints.length>2?a("v-line",{attrs:{config:e.polygonPointsConfig}}):e._e(),e._l(e.polygonAddShapes,(function(e,t){return[a("v-rect",{key:t,attrs:{config:e}})]}))],2):e._e()],1),e.isLoading?a("loader"):e._e(),a("div",{directives:[{name:"show",rawName:"v-show",value:e.isAddingPolygon,expression:"isAddingPolygon"}],staticClass:"pa-polygon-hint"},[e._v(e._s(e.$t("polygon_help")))])],1),a("div",{staticClass:"pa-infobar"},e._l(e.shapes,(function(t){return a("side-bar-entry",{key:t.name,attrs:{shape:t,"edit-mode":e.editMode,"selected-shape-name":e.selectedShapeName,"current-hover-shape":e.currentHoverShape},on:{"sidebar-entry-enter":function(t){return e.handleSideBarMouseEnter(t)},"sidebar-entry-leave":function(t){return e.handleSideBarMouseLeave(t)},"sidebar-entry-delete":function(t){return e.deleteShape(t)},"sidebar-entry-save":function(t){return e.formSubmitted(t)}}})})),1)])},s=[],o=a("3f4a"),r=o["a"],_=(a("cf25"),a("2877")),l=Object(_["a"])(r,i,s,!1,null,null,null),c=l.exports,d=document.getElementsByClassName("picture-annotation"),h=[],u=0;u<d.length;u++)h.push(d[u]);for(var p=function(e){var t=h[e],a=t.getElementsByClassName("picture-annotation-data");new n["default"]({render:function(n){return n(c,{props:{containerId:this.$el.attributes.id&&this.$el.attributes.id.value||"picture-annotation-"+e,editMode:this.$el.attributes["data-edit-mode"]&&"1"===this.$el.attributes["data-edit-mode"].value||!1,language:this.$el.attributes["data-language"]&&this.$el.attributes["data-language"].value||"en",imageSrc:this.$el.attributes["data-image-src"]&&this.$el.attributes["data-image-src"].value,localStorageKey:this.$el.attributes["data-local-storage-key"]&&this.$el.attributes["data-local-storage-key"].value,width:this.$el.attributes["data-width"]&&this.$el.attributes["data-width"].value||t.innerWidth,height:this.$el.attributes["data-height"]&&this.$el.attributes["data-height"].value||t.innerHeight,dataCallback:this.$el.attributes["data-callback"]&&this.$el.attributes["data-callback"].value,initialData:a.length&&a[0].innerHTML||"",initialDataId:this.$el.attributes["data-initial-data-id"]&&this.$el.attributes["data-initial-data-id"].value}})}}).$mount(t)},g=0;g<h.length;g++)p(g)},"70dc":function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pa-side-bar-entry",class:{"is-selected-target":e.selectedShapeName===e.shape.name,"is-hover-target":e.currentHoverShape===e.shape.name},on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave}},[a("button",{staticClass:"pa-accordion",class:{"is-active":e.active},attrs:{type:"button"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleContent(t)}}},[a("icon",{attrs:{type:e.shape.type}}),e.shape.annotation.title?a("span",{staticClass:"pa-side-bar-title"},[e._v(e._s(e.shape.annotation.title))]):e._e(),e.editMode&&(e.active||e.selectedShapeName===e.shape.name)?a("span",{staticClass:"pa-side-bar-icons"},[a("a",{attrs:{href:"#",title:e.$t("delete_shape")},on:{click:function(t){return t.preventDefault(),e.deleteShape(t)}}},[a("icon",{attrs:{type:"delete-shape",fill:"red"}})],1)]):e._e()],1),a("div",{ref:"panel",staticClass:"pa-panel"},[e.editMode?[a("form",{staticClass:"pa-annotation-form",on:{submit:function(t){return t.preventDefault(),t.stopPropagation(),e.submitted(t)}}},[a("label",{attrs:{for:e.shape.name+"-title"}},[e._v(e._s(e.$t("annotation_title")))]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.title,expression:"formData.title"}],attrs:{type:"text",name:"title",id:e.shape.name+"-title"},domProps:{value:e.formData.title},on:{input:function(t){t.target.composing||e.$set(e.formData,"title",t.target.value)}}}),a("label",{attrs:{for:e.shape.name+"-text"}},[e._v(e._s(e.$t("annotation_text")))]),a("textarea",{directives:[{name:"model",rawName:"v-model",value:e.formData.text,expression:"formData.text"}],attrs:{name:"text",id:e.shape.name+"-text"},domProps:{value:e.formData.text},on:{input:function(t){t.target.composing||e.$set(e.formData,"text",t.target.value)}}}),e._v(" "),a("label",{attrs:{for:e.shape.name+"-link-title"}},[e._v(e._s(e.$t("annotation_link_title")))]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.linkTitle,expression:"formData.linkTitle"}],attrs:{type:"text",name:"link-title",id:e.shape.name+"-link-title"},domProps:{value:e.formData.linkTitle},on:{input:function(t){t.target.composing||e.$set(e.formData,"linkTitle",t.target.value)}}}),a("label",{attrs:{for:e.shape.name+"-link"}},[e._v(e._s(e.$t("annotation_link")))]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.formData.link,expression:"formData.link"}],attrs:{type:"text",name:"link",id:e.shape.name+"-link"},domProps:{value:e.formData.link},on:{input:function(t){t.target.composing||e.$set(e.formData,"link",t.target.value)}}}),a("button",{attrs:{type:"submit"}},[e._v(e._s(e.$t("submit")))])])]:[e.shape.annotation.text?a("div",{staticClass:"pa-annotation-text"},[a("nl2br",{attrs:{tag:"p",text:e.shape.annotation.text}})],1):e._e(),e.shape.annotation.link?a("a",{staticClass:"pa-annotation-link",attrs:{href:e.shape.annotation.link}},[e._v(e._s(e.shape.annotation.linkTitle||e.$t("more")))]):e._e()]],2)])},i=[],s=(a("9911"),a("b0c0"),a("141d")),o=a.n(s),r=a("cdae"),_={components:{Icon:r["a"],Nl2br:o.a},props:["shape","editMode","selectedShapeName","currentHoverShape"],data:function(){return{active:!1,formData:{title:"",text:"",linkTitle:"",link:""}}},created:function(){this.shape&&(this.formData.title=this.shape.annotation.title,this.formData.text=this.shape.annotation.text,this.formData.linkTitle=this.shape.annotation.linkTitle,this.formData.link=this.shape.annotation.link)},methods:{handleMouseEnter:function(){this.$emit("sidebar-entry-enter",this.shape.name)},handleMouseLeave:function(){this.$emit("sidebar-entry-leave",this.shape.name)},toggleContent:function(){this.$refs.panel.style.maxHeight=this.active?null:this.$refs.panel.scrollHeight+"px",this.active=!this.active},deleteShape:function(){this.$emit("sidebar-entry-delete",this.shape.name)},submitted:function(){this.shape.annotation.title=this.formData.title,this.shape.annotation.text=this.formData.text,this.shape.annotation.linkTitle=this.formData.linkTitle,this.shape.annotation.link=this.formData.link,this.toggleContent(),this.$emit("sidebar-entry-save",this.shape.name)}},watch:{selectedShapeName:function(e,t){this.shape.name,this.active||e!==this.shape.name?this.active&&e!==this.shape.name&&this.toggleContent():this.toggleContent()}}},l=_,c=a("2877"),d=Object(c["a"])(l,n,i,!1,null,null,null);t["a"]=d.exports},9225:function(e,t,a){"use strict";t["a"]={locale:"en",fallbackLocale:"en",messages:{en:{zoom_in:"Zoom in",zoom_out:"Zoom out",add_polygon:"Add polygon",add_rectangle:"Add rectangle",add_circle:"Add circle",add_person:"Add person shape",delete_shape:"Delete shape",hide_shapes:"Hide shapes",show_shapes:"Show shapes",annotation_title:"Title",annotation_text:"Text",annotation_link_title:"Link title",annotation_link:"Link",submit:"Change",more:"More",accept_polygon:"Accept polyon",polygon_help:"Add points by clicking. Right click removes last point. Accept by clicking on green polygon icon."},de:{zoom_in:"Vergrößern",zoom_out:"Verkleinern",add_polygon:"Polygon hinzufügen",add_rectangle:"Rechteck hinzufügen",add_circle:"Kreis hinzufügen",add_person:"Personenform hinzufügen",delete_shape:"Löschen",hide_shapes:"Annotationen verbergen",show_shapes:"Annotationen zeigen",annotation_title:"Titel",annotation_text:"Text",annotation_link_title:"Link-Titel",annotation_link:"Link",submit:"Ändern",more:"Mehr",accept_polygon:"Polygon annehmen",polygon_help:"Punkte durch Klicks hinzufügen. Rechtsklick entfernt den letzen Punkt. Annehmen durch Klick auf grünes Polygon-Icon."}}}},cdae:function(e,t,a){"use strict";var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("span",{staticClass:"pa-icon"},[a("svg",{attrs:{fill:e.fill,width:e.width,height:e.height,viewBox:e.viewBox,xmlns:e.xmlns}},[e.title?a("title",[e._v(e._s(e.title))]):e._e(),a("path",{attrs:{d:e.shape}})])])},i=[],s=(a("a9e3"),a("94ed")),o={props:{type:{type:String,required:!0},fill:{type:String,default:"currentColor"},width:{type:[Number,String],default:24},height:{type:[Number,String],default:24},viewBox:{type:[String],default:"0 0 24 24"},xmlns:{type:String,default:"http://www.w3.org/2000/svg"},title:{type:String,required:!1}},computed:{shape:function(){switch(this.type){case"zoom-in":return s["g"];case"zoom-out":return s["f"];case"shapes-on":return s["e"];case"shapes-off":return s["d"];case"add-polygon":return s["i"];case"add-polygon-accept":return"M20.29 3.29L15 8.59l-2.29-2.3-1.42 1.42 3.71 3.7 6.71-6.7-1.42-1.42zM7 5l-4 9 7 7 9-4v-4h-2v2.7l-6.6 2.9-5-5L8.3 7H11V5H7z";case"add-rectangle":return s["j"];case"add-circle":return s["h"];case"add-person":return"M9 4a4 4 0 014 4 4 4 0 01-4 4 4 4 0 01-4-4 4 4 0 014-4m0 1.9a2.1 2.1 0 100 4.2A2.1 2.1 0 0011.1 8 2.1 2.1 0 009 5.9M20 7v3h3v2h-3v3h-2v-3h-3v-2h3V7h2M9 13c2.67 0 8 1.33 8 4v3H1v-3c0-2.67 5.33-4 8-4m0 1.9c-2.97 0-6.1 1.46-6.1 2.1v1.1h12.2V17c0-.64-3.1-2.1-6.1-2.1z";case"edit-shape":return s["k"];case"delete-shape":return s["c"];case"circle":return s["b"];case"rect":return s["l"];case"poly":return"M15.96 2.4l5.64 4.44v9.96l-10.8 4.8-8.4-8.4L7.2 2.4m1.56 2.4l-3.48 7.92 6 6 7.92-3.48V8.4l-4.8-3.6z";case"path":return s["a"];default:return"NOT FOUND"}}}},r=o,_=a("2877"),l=Object(_["a"])(r,n,i,!1,null,null,null);t["a"]=l.exports},cf25:function(e,t,a){"use strict";a("fea6")},fea6:function(e,t,a){}});
//# sourceMappingURL=picture-annotation.min.js.map