13 lines
59 KiB
JavaScript
13 lines
59 KiB
JavaScript
|
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var check=function(t){return t&&t.Math==Math&&t},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(t){var e=o(this,t);return!!e&&e.enumerable}:n},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},a={}.toString,classofRaw=function(t){return a.call(t).slice(8,-1)},c="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?c.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},l={}.hasOwnProperty,has=function(t,e){return l.call(t,e)},s=e.document,f=isObject(s)&&isObject(s.createElement),documentCreateElement=function(t){return f?s.createElement(t):{}},p=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),h=Object.getOwnPropertyDescriptor,d={f:r?h:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),p)try{return h(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!i.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},v=Object.defineProperty,y={f:r?v:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),p)try{return v(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},g=r?function(t,e,r){return y.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,r){try{g(e,t,r)}catch(n){e[t]=r}return r},m=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof m.inspectSource&&(m.inspectSource=function(t){return b.call(t)});var x,w,S,E=m.inspectSource,_=e.WeakMap,k="function"==typeof _&&/native code/.test(E(_)),A=createCommonjsModule((function(t){(t.exports=function(t,e){return m[t]||(m[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),O=0,j=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++O+j).toString(36)},I=A("keys"),sharedKey=function(t){return I[t]||(I[t]=uid(t))},T={},P=e.WeakMap;if(k){var L=new P,M=L.get,N=L.has,R=L.set;x=function(t,e){return R.call(L,t,e),e},w=function(t){return M.call(L,t)||{}},S=function(t){return N.call(L,t)}}else{var C=sharedKey("state");T[C]=!0,x=function(t,e){return g(t,C,e),e},w=function(t){return has(t,C)?t[C]:{}},S=function(t){return has(t,C)}}var G,D={set:x,get:w,has:S,enforce:function(t){return S(t)?w(t):x(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=w(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},U=createCommonjsModule((function(t){var r=D.get,n=D.enforce,
|
||
|
/**
|
||
|
* Localizing script for SVG-edit UI.
|
||
|
* @module locale
|
||
|
* @license MIT
|
||
|
*
|
||
|
* @copyright 2010 Narendra Sisodya
|
||
|
* @copyright 2010 Alexis Deveria
|
||
|
*
|
||
|
*/
|
||
|
jQuery;var ri=function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function _callee2(t,e){var r;return regeneratorRuntime.wrap((function _callee2$(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,import("./extensions/ext-".concat(t,"/locale/").concat(e,".js"));case 3:r=n.sent,n.next=12;break;case 6:return n.prev=6,n.t0=n.catch(0),console.error("Missing translation (".concat(e,") for extension ").concat(t," - using 'en'")),n.next=11,import("./extensions/ext-".concat(t,"/locale/en.js"));case 11:r=n.sent;case 12:return n.abrupt("return",r.default);case 13:case"end":return n.stop()}}),_callee2,null,[[0,6]])})));return function loadExtensionTranslation(e,r){return t.apply(this,arguments)}}(),ni={name:"placemark",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){var r,n,o,i,a,c,u,l,s,f,p,h,d,v,y,g,m,b,x,w,S,E;return regeneratorRuntime.wrap((function _callee$(_){for(;;)switch(_.prev=_.next){case 0:return w=function _addMarkerButtons(t){return Object.keys(s).forEach((function(e){var r=x(String(e));t.push({id:"placemark_marker_"+e,svgicon:e,icon:"markers-"+e+".png",title:r,type:"context",events:{click:b},panel:"placemark_panel",list:"placemark_marker",isDefault:"leftarrow"===e})})),t},x=function _getTitle(t){var e=l.langList.find((function(e){return e.id===t}));return e?e.title:t},b=function _setArrowFromButton(t){var e=this.id.split("_"),r=e[2];e[3]&&(r+="_"+e[3]),i("#placemark_marker").attr("value",r)},m=function _updateReferences(t){var e="placemark_marker_"+t.id,r="marker-start",o=p(t,r);if(o&&o.attributes.class){var c=t.getAttribute(r);if(c){var u=t.id.length,l=c.substr(-u-1,u);if(t.id!==l){var s=i("#placemark_marker").attr("value")||"leftarrow";v(e,s),n.changeSelectedAttribute(r,"url(#"+e+")"),n.call("changed",a)}}}},g=function _colorChanged(t){var e=t.getAttribute("stroke"),r=p(t,"marker-start");if(r&&r.attributes.class){var n=r.lastElementChild;if(n){var o=n.getAttribute("fill"),i=n.getAttribute("stroke");o&&"none"!==o&&n.setAttribute("fill",e),i&&"none"!==i&&n.setAttribute("stroke",e)}}},y=function _setMarker(t,e){var r="marker-start",o=p(t,r);if(o&&i(o).remove(),t.removeAttribute(r),"nomarker"!==e){var a="placemark_marker_"+t.id;v(a,e),t.setAttribute(r,"url(#"+a+")"),n.call("changed",[t])}else n.call("changed",[t])},v=function _addMarker(t,e){var r=n.getElem(t);if(!r&&""!==e&&"nomarker"!==e){var i=n.getColor("stroke"),a=50,c=e;if(s[c]){c.includes("left")&&(a=0),c.includes("right")&&(a=100),r=o({element:"marker",attr:{id:t,markerUnits:"strokeWidth",orient:"auto",style:"pointer-events:none",class:c}});var u=o(s[c]),l="_o"===c.substr(-2)?"none":i;return u.setAttribute("fill",l),u.setAttribute("stroke",i),u.setAttribute("stroke-width",10),r.append(u),r.setAttribute("viewBox","0 0 100 100"),r.setAttribute("markerWidth",10),r.setAttribute("markerHeight",10),r.setAttribute("refX",a),r.setAttribute("refY",50),n.findDefs().append(r),r}}},d=function _updateFont(t){t=t.split(" ");var e=Number.parseInt(t.pop());t=t.join(" "),a.forEach((function(r){r&&r.getAttribute("class").includes("placemark")&&i(r).children().each((function(r,n){"txt"===_slicedToArray(n.id.split("_"),3)[2]&&i(n).attr({"font-family":t,"font-size":e})}))}))},h=function _updateText(t){var e=t.split(";");a.forEach((function(t){t&&t.getAttribute("class").includes("placemark")&&i(t).children().each((function(t,r){var n=_slicedToArray(r.id.split("_"),4),o=n[2],a=n[3];"txt"===o&&i(r).text(e[a])}))}))},p=function _getLinked(t,e){if(!t)return null;var r=t.getAttribute(e);if(!r)return null;var o=r.match(/\(#(.*)\)/);return o&&2===o.length?n.getElem(o[1]):null},f=function _showPanel(t){i("#placemark_panel").toggle(t)},n=(r=e).canvas,o=n.addSVGElementFromJson,i=t.$,_.next=17,ri("placemark",r.curPrefs.lang);case 17:return l=_.sent,s={nomarker:{},forwardslash:{element:"path",attr:{d:"M30,100 L70,0"}},reverseslash:{element:"path",attr:{d:"M30,0 L70,100"}},verticalslash:{element:"path",attr:{d:"M50,0 L50,100"}},xmark:{element:"path",attr:{d:"M20,80 L80,20 M80,80 L20,20"}},leftarrow:{element:"path",attr:{d
|
||
|
//# sourceMappingURL=ext-placemark.js.map
|