From 6f00ffdd8b6f0f359ddf5c0d4c1b8db7e6ac4160 Mon Sep 17 00:00:00 2001 From: easylogic Date: Tue, 28 Apr 2020 00:25:11 +0900 Subject: [PATCH] Refactoring.... --- docs/index.html | 2 +- ...7aa627.js => main.431e10cf1c22721aadd7.js} | 2 +- docs/service-worker.js | 2 +- src/csseditor/ui/control/Componentitems.js | 11 ++------ src/csseditor/ui/property/SVGItemProperty.js | 28 +------------------ .../ui/view-items/SelectionToolView.js | 2 +- src/csseditor/ui/view/ToolMenu.js | 2 ++ src/editor/parse/PathGenerator.js | 6 ++-- 8 files changed, 13 insertions(+), 42 deletions(-) rename docs/{main.0a372d30dcdf677aa627.js => main.431e10cf1c22721aadd7.js} (56%) diff --git a/docs/index.html b/docs/index.html index c732eb8ab..34ea72640 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ - Fantastic Web Design Tool \ No newline at end of file + Fantastic Web Design Tool \ No newline at end of file diff --git a/docs/main.0a372d30dcdf677aa627.js b/docs/main.431e10cf1c22721aadd7.js similarity index 56% rename from docs/main.0a372d30dcdf677aa627.js rename to docs/main.431e10cf1c22721aadd7.js index 05b7fca38..83fd327c5 100644 --- a/docs/main.0a372d30dcdf677aa627.js +++ b/docs/main.431e10cf1c22721aadd7.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.EasylogicStudio=e():t.EasylogicStudio=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e,n){},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"randomNumber",(function(){return g})),n.d(r,"randomByCount",(function(){return m})),n.d(r,"random",(function(){return w})),n.d(r,"randomRGBA",(function(){return O}));var o={};n.r(o),n.d(o,"debounce",(function(){return E})),n.d(o,"throttle",(function(){return _})),n.d(o,"keyEach",(function(){return C})),n.d(o,"keyMap",(function(){return T})),n.d(o,"keyMapJoin",(function(){return R})),n.d(o,"get",(function(){return D})),n.d(o,"defaultValue",(function(){return V})),n.d(o,"isUndefined",(function(){return A})),n.d(o,"isNotUndefined",(function(){return I})),n.d(o,"isArray",(function(){return L})),n.d(o,"isBoolean",(function(){return M})),n.d(o,"isString",(function(){return B})),n.d(o,"isNotString",(function(){return z})),n.d(o,"isObject",(function(){return F})),n.d(o,"isFunction",(function(){return G})),n.d(o,"isNumber",(function(){return H})),n.d(o,"clone",(function(){return X})),n.d(o,"cleanObject",(function(){return Y})),n.d(o,"combineKeyArray",(function(){return N})),n.d(o,"repeat",(function(){return K})),n.d(o,"randomItem",(function(){return W})),n.d(o,"html",(function(){return Z})),n.d(o,"CSS_TO_STRING",(function(){return q})),n.d(o,"STRING_TO_CSS",(function(){return J})),n.d(o,"OBJECT_TO_PROPERTY",(function(){return Q})),n.d(o,"OBJECT_TO_CLASS",(function(){return tt})),n.d(o,"TAG_TO_STRING",(function(){return et})),n.d(o,"mapjoin",(function(){return nt}));var i={};n.r(i),n.d(i,"format",(function(){return rt})),n.d(i,"hex",(function(){return ot})),n.d(i,"rgb",(function(){return it})),n.d(i,"hsl",(function(){return at}));var a={};n.r(a),n.d(a,"round",(function(){return st})),n.d(a,"degreeToRadian",(function(){return lt})),n.d(a,"div",(function(){return ft})),n.d(a,"radianToDegree",(function(){return pt})),n.d(a,"getXInCircle",(function(){return yt})),n.d(a,"getYInCircle",(function(){return ht})),n.d(a,"getXYInCircle",(function(){return dt})),n.d(a,"getDist",(function(){return vt})),n.d(a,"calculateAngle",(function(){return bt})),n.d(a,"calculateAngleByPoints",(function(){return gt})),n.d(a,"calculateAnglePointDistance",(function(){return mt})),n.d(a,"calculateAngle360",(function(){return wt})),n.d(a,"uuid",(function(){return kt})),n.d(a,"uuidShort",(function(){return jt})),n.d(a,"cubicBezier",(function(){return $t})),n.d(a,"getGradientLine",(function(){return Et})),n.d(a,"CCW",(function(){return _t})),n.d(a,"incircle",(function(){return Ct})),n.d(a,"initPolygon",(function(){return Tt})),n.d(a,"Deluanay",(function(){return Dt})),n.d(a,"generate_sample_points",(function(){return Vt})),n.d(a,"getCenterInTriangle",(function(){return At})),n.d(a,"normalize",(function(){return Lt}));var c={};n.r(c),n.d(c,"ReverseXyz",(function(){return Mt})),n.d(c,"ReverseRGB",(function(){return Bt})),n.d(c,"XYZtoRGB",(function(){return zt})),n.d(c,"LABtoXYZ",(function(){return Ft})),n.d(c,"PivotXyz",(function(){return Gt})),n.d(c,"XYZtoLAB",(function(){return Ht})),n.d(c,"LABtoRGB",(function(){return Xt}));var u={};n.r(u),n.d(u,"RGBtoHSV",(function(){return Yt})),n.d(u,"RGBtoCMYK",(function(){return Nt})),n.d(u,"RGBtoHSL",(function(){return Kt})),n.d(u,"c",(function(){return Wt})),n.d(u,"gray",(function(){return Ut})),n.d(u,"RGBtoSimpleGray",(function(){return Zt})),n.d(u,"RGBtoGray",(function(){return qt})),n.d(u,"brightness",(function(){return Jt})),n.d(u,"RGBtoYCrCb",(function(){return Qt})),n.d(u,"PivotRGB",(function(){return te})),n.d(u,"RGBtoXYZ",(function(){return ee})),n.d(u,"RGBtoLAB",(function(){return ne}));var s={};n.r(s),n.d(s,"CMYKtoRGB",(function(){return re}));var l={};n.r(l),n.d(l,"HSVtoRGB",(function(){return oe})),n.d(l,"HSVtoHSL",(function(){return ie}));var f={};n.r(f),n.d(f,"HUEtoRGB",(function(){return ae})),n.d(f,"HSLtoHSV",(function(){return ce})),n.d(f,"HSLtoRGB",(function(){return ue}));var p={};n.r(p),n.d(p,"YCrCbtoRGB",(function(){return se}));var h={};n.r(h),n.d(h,"getColorIndexString",(function(){return be})),n.d(h,"isColor",(function(){return ge})),n.d(h,"matches",(function(){return me})),n.d(h,"convertMatches",(function(){return we})),n.d(h,"convertMatchesArray",(function(){return Oe})),n.d(h,"reverseMatches",(function(){return ke})),n.d(h,"trim",(function(){return Se})),n.d(h,"parse",(function(){return Pe})),n.d(h,"parseGradient",(function(){return xe}));var d={};n.r(d),n.d(d,"interpolateRGB",(function(){return $e})),n.d(d,"interpolateRGBObject",(function(){return Ee})),n.d(d,"scale",(function(){return _e})),n.d(d,"blend",(function(){return Ce})),n.d(d,"mix",(function(){return Te})),n.d(d,"contrast",(function(){return Re})),n.d(d,"contrastColor",(function(){return De})),n.d(d,"gradient",(function(){return Ve})),n.d(d,"scaleHSV",(function(){return Ae})),n.d(d,"scaleH",(function(){return Ie})),n.d(d,"scaleS",(function(){return Le})),n.d(d,"scaleV",(function(){return Me}));var v={};n.r(v),n.d(v,"start",(function(){return Bl}));var b;n(0);function g(t,e){return Math.floor(Math.random()*(e-t+1))+t}function m(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=[],n=0;n1&&void 0!==arguments[1]?arguments[1]:0;if(0===e)return t;var n=void 0;return function(r,o,i,a,c){n&&clearTimeout(n),n=setTimeout((function(){t(r,o,i,a,c)}),e||300)}}function _(t,e){var n=void 0;return function(r,o,i,a,c){n||(n=setTimeout((function(){t(r,o,i,a,c),n=null}),e||300))}}function C(t,e){Object.keys(t).forEach((function(n,r){e(n,t[n],r)}))}function T(t,e){return Object.keys(t).map((function(n,r){return e(n,t[n],r)}))}function R(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return T(t,e).join(n)}function D(t,e,n){var r=V(t[e],e);return G(n)?n(r):r}function V(t,e){return void 0===t?e:t}function A(t){return null==t}function I(t){return!1===A(t)}function L(t){return Array.isArray(t)}function M(t){return"boolean"==typeof t}function B(t){return"string"==typeof t}function z(t){return!1===B(t)}function F(t){return"object"==$(t)&&!L(t)&&!H(t)&&!B(t)&&null!==t}function G(t){return"function"==typeof t}function H(t){return"number"==typeof t}function X(t){return JSON.parse(JSON.stringify(t))}function Y(t){var e={};return Object.keys(t).filter((function(e){return!!t[e]})).forEach((function(n){e[n]=t[n]})),e}function N(t){return Object.keys(t).forEach((function(e){Array.isArray(t[e])&&(t[e]=t[e].join(", "))})),t}function K(t){return S(Array(t))}function W(){for(var t=arguments.length,e=new Array(t),n=0;n1?e-1:0),r=1;r]*)\/\>/gim,(function(t,e){return U[e.toLowerCase()]?t:t.replace("/>",">"))}))};function q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t;return Object.keys(n).filter((function(t){return n[t]})).map((function(t){return"".concat(t,": ").concat(n[t])})).join(";"+e)}function J(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:";",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:":",r={};return""===(t+="")?r:(t.split(e).forEach((function(t){var e=k(t.split(n).map((function(t){return t.trim()}))),o=e[0],i=e.slice(1);""!=o&&(r[o]=i.join(n))})),r)}function Q(t){return Object.keys(t).map((function(e){return"class"===e&&F(t[e])?"".concat(e,'="').concat(tt(t[e]),'"'):M(t[e])?t[e]?e:"":"".concat(e,'="').concat(t[e],'"')})).join(" ")}function tt(t){return Object.keys(t).filter((function(e){return t[e]})).map((function(t){return t})).join(" ")}function et(t){return t.replace(/\/g,">")}function nt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t.map(e).join(n)}function rt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(0, 0, 0, 0)";return Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),"hex"==e?ot(t):"rgb"==e?it(t,n):"hsl"==e?at(t):t}function ot(t){Array.isArray(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]});var e=t.r.toString(16);t.r<16&&(e="0"+e);var n=t.g.toString(16);t.g<16&&(n="0"+n);var r=t.b.toString(16);return t.b<16&&(r="0"+r),"#".concat(e).concat(n).concat(r)}function it(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(0, 0, 0, 0)";if(L(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),!A(t))return 1==t.a||A(t.a)?isNaN(t.r)?e:"rgb(".concat(t.r,",").concat(t.g,",").concat(t.b,")"):"rgba(".concat(t.r,",").concat(t.g,",").concat(t.b,",").concat(t.a,")")}function at(t){return L(t)&&(t={r:t[0],g:t[1],b:t[2],a:t[3]}),1==t.a||A(t.a)?"hsl(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%)"):"hsla(".concat(t.h,",").concat(t.s,"%,").concat(t.l,"%,").concat(t.a,")")}var ct={create:function(t,e,n){return{x:t||0,y:e||0,z:n||0}},add:function(t,e){return{x:t.x+e.x,y:t.y+e.y,z:t.z+e.z}},sub:function(t,e){return{x:t.x-e.x,y:t.y-e.y,z:t.z-e.z}},mul:function(t,e){return{x:t.x*e.x,y:t.y*e.y,z:t.z*e.z}},div:function(t,e){return{x:t.x/e.x,y:t.y/e.y,z:t.z/e.z}},muls:function(t,e){return{x:t.x*e,y:t.y*e,z:t.z*e}},divs:function(t,e){return{x:t.x/e,y:t.y/e,z:t.z/e}},len:function(t){return Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)},dot:function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},cross2d:function(t,e){return t.x*e.y-t.y*e.x},cross:function(t,e){return{x:t.y*e.z-t.z*e.y,y:t.z*e.x-t.x*e.z,z:t.x*e.y-t.y*e.x}},normalize:function(t){return ct.divs(t,ct.len(t))},ang:function(t,e){return Math.acos(ct.dot(t,e)/(ct.len(t)*ct.len(e)))},copy:function(t){return{x:t.x,y:t.y,z:t.z}},equal:function(t,e){return t.x===e.x&&t.y===e.y&&t.z===e.z},rotate:function(t,e){var n=t.x,r=t.y,o=t.z,i=0!==e.x?e.x/2:0,a=0!==e.y?e.y/2:0,c=0!==e.z?e.z/2:0,u=Math.cos(i),s=Math.cos(a),l=Math.cos(c),f=Math.sin(i),p=Math.sin(a),y=Math.sin(c),h=u*s*l+-f*p*y,d=f*s*l- -u*p*y,v=u*p*l+f*s*-y,b=u*s*y- -f*p*l;return{x:n*(1-2*(v*v+b*b))+r*(2*(d*v-b*h))+o*(2*(d*b+v*h)),y:n*(2*(d*v+b*h))+r*(1-2*(d*d+b*b))+o*(2*(v*b-d*h)),z:n*(2*(d*b-v*h))+r*(2*(b*v+d*h))+o*(1-2*(d*d+v*v))}}},ut={matrix2d:{multiply:function(t){return function(e,n){var r=+e[n],o=+e[n+1];return[t[0][0]*r+t[0][1]*o+t[0][2],t[1][0]*r+t[1][1]*o+t[1][2],1]}},translate:function(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]])},rotate:function(t){return this.multiply([[Math.cos(t),Math.sin(t),0],[-Math.sin(t),Math.cos(t),0],[0,0,1]])},scale:function(t,e){return this.multiply([[t,0,0],[0,e,0],[0,0,1]])},skewX:function(t){return this.multiply([[1,Math.tan(t),0],[0,1,0],[0,0,1]])},skewY:function(t){return this.multiply([[1,0,0],[Math.tan(t),1,0],[0,0,1]])},flip:function(){return this.multiply([[-1,0,0],[0,-1,0],[0,0,1]])},flipX:function(){return this.multiply([[-1,0,0],[0,1,0],[0,0,1]])},flipY:function(){return this.multiply([[1,0,0],[0,-1,0],[0,0,1]])}},Vect3:ct,addVector:function(t,e){return ct.add(t,e)},rotateVector:function(t,e){return ct.rotate(t,e)}};function st(t,e){return e=A(e)?1:e,Math.round(t*e)/e}function lt(t){return t*Math.PI/180}function ft(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return 0===t?0:t/e}function pt(t){var e=180*t/Math.PI;return e<0&&(e=360+e),e}function yt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.cos(lt(t))}function ht(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return n+e*Math.sin(lt(t))}function dt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{x:yt(t,e,n),y:ht(t,e,r)}}function vt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function bt(t,e){return pt(Math.atan2(e,t))}function gt(t,e){return bt(t.x,t.y)-bt(e.x,e.y)}function mt(t,e,n){var r=bt(t.x-e.x,t.y-e.y);return bt(t.x+n.dx-e.x,t.y+n.dy-e.y)-r}function wt(t,e){return(pt(Math.atan2(e,t))+180)%360}var Ot=/[xy]/g;function kt(){var t=(new Date).getTime();return"xxx12-xx-34xx".replace(Ot,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}function jt(){var t=(new Date).getTime();return"idxxxxxxx".replace(Ot,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)}))}var St=function(t){return 3*t*t*(1-t)},Pt=function(t){return 3*t*(1-t)*(1-t)},xt=function(t){return(1-t)*(1-t)*(1-t)};function $t(t,e,n,r){var o=e,i=r;return function(t){return 1-(o*St(t)+i*Pt(t)+xt(t))}}function Et(t,e){var n=Math.abs(e.width*Math.sin(t))+Math.abs(e.height*Math.cos(t)),r={x:e.x+e.width/2,y:e.y+e.height/2},o=Math.sin(t-Math.PI/2)*n/2,i=Math.cos(t-Math.PI/2)*n/2;return{length:n,center:r,start:{x:r.x-i,y:r.y-o},end:{x:r.x+i,y:r.y+o}}}function _t(t,e,n){return A(n)?ct.cross2d(t,e):ct.cross2d(ct.sub(e,t),ct.sub(n,t))}function Ct(t,e,n,r){var o=_t(t,e,n),i=t.x-r.x,a=t.y-r.y,c=e.x-r.x,u=e.y-r.y,s=n.x-r.x,l=n.y-r.y,f=(i*i+a*a)*(c*l-s*u)+(c*c+u*u)*(s*a-i*l)+(s*s+l*l)*(i*u-c*a);return o>0?f>=0:f<=0}function Tt(t,e,n){for(var r=ct.create(Math.min(e,n),Math.max(e,n)),o=-1,i=0,a=t.length;i-1?t.splice(o,1):t.push(r)}function Rt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t.length;t[e]=ct.create(-2e9,-2e9),t[e+1]=ct.create(2e9,-2e9),t[e+2]=ct.create(0,2e9);for(var n=[ct.create(e,e+1,e+2)],r=0;r=e||f.y>=e||f.z>=e)&&(Rt(n,r,n.length-1),n.pop(),r--)}return n.map((function(e){return{a:t[e.x],b:t[e.y],c:t[e.z]}}))}function Vt(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:50,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:100,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){return Math.random()},c=[],u=-n,s=t+n,l=-r,f=e+r,p=u;p.008856?Math.pow(t,3):(t-16/116)/7.787}function Bt(t){return t>.0031308?1.055*Math.pow(t,1/2.4)-.055:12.92*t}function zt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/100,i=e/100,a=n/100,c=3.2406*o+-1.5372*i+-.4986*a,u=-.9689*o+1.8758*i+.0415*a,s=.0557*o+-.204*i+1.057*a;c=Bt(c),u=Bt(u),s=Bt(s);var l=st(255*c),f=st(255*u),p=st(255*s);return{r:l,g:f,b:p}}function Ft(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}var o=(t+16)/116,i=e/500+o,a=o-n/200;o=Mt(o);var c=95.047*(i=Mt(i)),u=100*o,s=108.883*(a=Mt(a));return{x:c,y:u,z:s}}function Gt(t){return t>.008856?Math.pow(t,1/3):(7.787*t+16)/116}function Ht(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.x,e=r.y,n=r.z}var o=t/95.047,i=e/100,a=n/108.883;o=Gt(o);var c=116*(i=Gt(i))-16,u=500*(o-i),s=200*(i-(a=Gt(a)));return{l:c,a:u,b:s}}function Xt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.l,e=r.a,n=r.b}return zt(Ft(t,e,n))}function Yt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,c=Math.max(o,i,a),u=Math.min(o,i,a),s=c-u,l=0;0==s?l=0:c==o?l=(i-a)/s%6*60:c==i?l=60*((a-o)/s+2):c==a&&(l=60*((o-i)/s+4)),l<0&&(l=360+l);return{h:l,s:0==c?0:s/c,v:c}}function Nt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,c=1-Math.max(o,i,a),u=(1-o-c)/(1-c),s=(1-i-c)/(1-c),l=(1-a-c)/(1-c);return{c:u,m:s,y:l,k:c}}function Kt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}t/=255,e/=255,n/=255;var o,i,a=Math.max(t,e,n),c=Math.min(t,e,n),u=(a+c)/2;if(a==c)o=i=0;else{var s=a-c;switch(i=u>.5?s/(2-a-c):s/(a+c),a){case t:o=(e-n)/s+(e90?0:255)}function Ut(t){return{r:t,g:t,b:t}}function Zt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Ut(Math.ceil((t+e+n)/3))}function qt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Ut(Qt(t,e,n).y)}function Jt(t,e,n){return Math.ceil(.2126*t+.7152*e+.0722*n)}function Qt(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=Jt(t,e,n),i=.564*(n-o),a=.713*(t-o);return{y:o,cr:a,cb:i}}function te(t){return 100*(t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92)}function ee(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}var o=t/255,i=e/255,a=n/255,c=.4124*(o=te(o))+.3576*(i=te(i))+.1805*(a=te(a)),u=.2126*o+.7152*i+.0722*a,s=.0193*o+.1192*i+.9505*a;return{x:c,y:u,z:s}}function ne(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.r,e=r.g,n=r.b}return Ht(ee(t,e,n))}function re(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.c,e=o.m,n=o.y,r=o.k}var i=255*(1-t)*(1-r),a=255*(1-e)*(1-r),c=255*(1-n)*(1-r);return{r:i,g:a,b:c}}function oe(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=t,i=e,a=n;o>=360&&(o=0);var c=i*a,u=c*(1-Math.abs(o/60%2-1)),s=a-c,l=[];return 0<=o&&o<60?l=[c,u,0]:60<=o&&o<120?l=[u,c,0]:120<=o&&o<180?l=[0,c,u]:180<=o&&o<240?l=[0,u,c]:240<=o&&o<300?l=[u,0,c]:300<=o&&o<360&&(l=[c,0,u]),{r:st(255*(l[0]+s)),g:st(255*(l[1]+s)),b:st(255*(l[2]+s))}}function ie(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.v}var o=oe(t,e,n);return Kt(o.r,o.g,o.b)}function ae(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ce(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o=ue(t,e,n);return Yt(o.r,o.g,o.b)}function ue(t,e,n){if(1==arguments.length){var r=arguments[0];t=r.h,e=r.s,n=r.l}var o,i,a;if(t/=360,n/=100,0==(e/=100))o=i=a=n;else{var c=n<.5?n*(1+e):n+e-n*e,u=2*n-c;o=ae(u,c,t+1/3),i=ae(u,c,t),a=ae(u,c,t-1/3)}return{r:st(255*o),g:st(255*i),b:st(255*a)}}function se(t,e,n,r){if(1==arguments.length){var o=arguments[0];t=o.y,e=o.cr,n=o.cb;r=(r=o.bit)||0}var i=t+1.402*(e-r),a=t-.344*(n-r)-.714*(e-r),c=t+1.772*(n-r);return{r:Math.ceil(i),g:Math.ceil(a),b:Math.ceil(c)}}var le={aliceblue:"rgb(240, 248, 255)",antiquewhite:"rgb(250, 235, 215)",aqua:"rgb(0, 255, 255)",aquamarine:"rgb(127, 255, 212)",azure:"rgb(240, 255, 255)",beige:"rgb(245, 245, 220)",bisque:"rgb(255, 228, 196)",black:"rgb(0, 0, 0)",blanchedalmond:"rgb(255, 235, 205)",blue:"rgb(0, 0, 255)",blueviolet:"rgb(138, 43, 226)",brown:"rgb(165, 42, 42)",burlywood:"rgb(222, 184, 135)",cadetblue:"rgb(95, 158, 160)",chartreuse:"rgb(127, 255, 0)",chocolate:"rgb(210, 105, 30)",coral:"rgb(255, 127, 80)",cornflowerblue:"rgb(100, 149, 237)",cornsilk:"rgb(255, 248, 220)",crimson:"rgb(237, 20, 61)",cyan:"rgb(0, 255, 255)",darkblue:"rgb(0, 0, 139)",darkcyan:"rgb(0, 139, 139)",darkgoldenrod:"rgb(184, 134, 11)",darkgray:"rgb(169, 169, 169)",darkgrey:"rgb(169, 169, 169)",darkgreen:"rgb(0, 100, 0)",darkkhaki:"rgb(189, 183, 107)",darkmagenta:"rgb(139, 0, 139)",darkolivegreen:"rgb(85, 107, 47)",darkorange:"rgb(255, 140, 0)",darkorchid:"rgb(153, 50, 204)",darkred:"rgb(139, 0, 0)",darksalmon:"rgb(233, 150, 122)",darkseagreen:"rgb(143, 188, 143)",darkslateblue:"rgb(72, 61, 139)",darkslategray:"rgb(47, 79, 79)",darkslategrey:"rgb(47, 79, 79)",darkturquoise:"rgb(0, 206, 209)",darkviolet:"rgb(148, 0, 211)",deeppink:"rgb(255, 20, 147)",deepskyblue:"rgb(0, 191, 255)",dimgray:"rgb(105, 105, 105)",dimgrey:"rgb(105, 105, 105)",dodgerblue:"rgb(30, 144, 255)",firebrick:"rgb(178, 34, 34)",floralwhite:"rgb(255, 250, 240)",forestgreen:"rgb(34, 139, 34)",fuchsia:"rgb(255, 0, 255)",gainsboro:"rgb(220, 220, 220)",ghostwhite:"rgb(248, 248, 255)",gold:"rgb(255, 215, 0)",goldenrod:"rgb(218, 165, 32)",gray:"rgb(128, 128, 128)",grey:"rgb(128, 128, 128)",green:"rgb(0, 128, 0)",greenyellow:"rgb(173, 255, 47)",honeydew:"rgb(240, 255, 240)",hotpink:"rgb(255, 105, 180)",indianred:"rgb(205, 92, 92)",indigo:"rgb(75, 0, 130)",ivory:"rgb(255, 255, 240)",khaki:"rgb(240, 230, 140)",lavender:"rgb(230, 230, 250)",lavenderblush:"rgb(255, 240, 245)",lawngreen:"rgb(124, 252, 0)",lemonchiffon:"rgb(255, 250, 205)",lightblue:"rgb(173, 216, 230)",lightcoral:"rgb(240, 128, 128)",lightcyan:"rgb(224, 255, 255)",lightgoldenrodyellow:"rgb(250, 250, 210)",lightgreen:"rgb(144, 238, 144)",lightgray:"rgb(211, 211, 211)",lightgrey:"rgb(211, 211, 211)",lightpink:"rgb(255, 182, 193)",lightsalmon:"rgb(255, 160, 122)",lightseagreen:"rgb(32, 178, 170)",lightskyblue:"rgb(135, 206, 250)",lightslategray:"rgb(119, 136, 153)",lightslategrey:"rgb(119, 136, 153)",lightsteelblue:"rgb(176, 196, 222)",lightyellow:"rgb(255, 255, 224)",lime:"rgb(0, 255, 0)",limegreen:"rgb(50, 205, 50)",linen:"rgb(250, 240, 230)",magenta:"rgb(255, 0, 255)",maroon:"rgb(128, 0, 0)",mediumaquamarine:"rgb(102, 205, 170)",mediumblue:"rgb(0, 0, 205)",mediumorchid:"rgb(186, 85, 211)",mediumpurple:"rgb(147, 112, 219)",mediumseagreen:"rgb(60, 179, 113)",mediumslateblue:"rgb(123, 104, 238)",mediumspringgreen:"rgb(0, 250, 154)",mediumturquoise:"rgb(72, 209, 204)",mediumvioletred:"rgb(199, 21, 133)",midnightblue:"rgb(25, 25, 112)",mintcream:"rgb(245, 255, 250)",mistyrose:"rgb(255, 228, 225)",moccasin:"rgb(255, 228, 181)",navajowhite:"rgb(255, 222, 173)",navy:"rgb(0, 0, 128)",oldlace:"rgb(253, 245, 230)",olive:"rgb(128, 128, 0)",olivedrab:"rgb(107, 142, 35)",orange:"rgb(255, 165, 0)",orangered:"rgb(255, 69, 0)",orchid:"rgb(218, 112, 214)",palegoldenrod:"rgb(238, 232, 170)",palegreen:"rgb(152, 251, 152)",paleturquoise:"rgb(175, 238, 238)",palevioletred:"rgb(219, 112, 147)",papayawhip:"rgb(255, 239, 213)",peachpuff:"rgb(255, 218, 185)",peru:"rgb(205, 133, 63)",pink:"rgb(255, 192, 203)",plum:"rgb(221, 160, 221)",powderblue:"rgb(176, 224, 230)",purple:"rgb(128, 0, 128)",rebeccapurple:"rgb(102, 51, 153)",red:"rgb(255, 0, 0)",rosybrown:"rgb(188, 143, 143)",royalblue:"rgb(65, 105, 225)",saddlebrown:"rgb(139, 69, 19)",salmon:"rgb(250, 128, 114)",sandybrown:"rgb(244, 164, 96)",seagreen:"rgb(46, 139, 87)",seashell:"rgb(255, 245, 238)",sienna:"rgb(160, 82, 45)",silver:"rgb(192, 192, 192)",skyblue:"rgb(135, 206, 235)",slateblue:"rgb(106, 90, 205)",slategray:"rgb(112, 128, 144)",slategrey:"rgb(112, 128, 144)",snow:"rgb(255, 250, 250)",springgreen:"rgb(0, 255, 127)",steelblue:"rgb(70, 130, 180)",tan:"rgb(210, 180, 140)",teal:"rgb(0, 128, 128)",thistle:"rgb(216, 191, 216)",tomato:"rgb(255, 99, 71)",turquoise:"rgb(64, 224, 208)",violet:"rgb(238, 130, 238)",wheat:"rgb(245, 222, 179)",white:"rgb(255, 255, 255)",whitesmoke:"rgb(245, 245, 245)",yellow:"rgb(255, 255, 0)",yellowgreen:"rgb(154, 205, 50)",transparent:"rgba(0, 0, 0, 0)",currentColor:"currentColor"};var fe={isColorName:function(t){return!!le[t]},getColorByName:function(t){return le[t]}};function pe(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:"@";return"".concat(e).concat(t.startIndex).padEnd(10,"0")}function ge(t){return!!me(t).length}function me(t){var e=t.match(ve),n=[];if(!e)return n;for(var r=0,o=e.length;r-1||e[r].indexOf("rgb")>-1||e[r].indexOf("hsl")>-1)n.push({color:e[r]});else{var i=fe.getColorByName(e[r]);i&&n.push({color:e[r],nameColor:i})}var a={next:0};return n.forEach((function(e){var n=t.indexOf(e.color,a.next);e.startIndex=n,e.endIndex=n+e.color.length,a.next=e.endIndex})),n}function we(t){var e=me(t);return e.forEach((function(e){t=t.replace(e.color,be(e))})),{str:t,matches:e}}function Oe(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",",n=we(t);return n.str.split(e).map((function(t,e){return t=Se(t),n.matches[e]&&(t=t.replace(be(n.matches[e]),n.matches[e].color)),t}))}function ke(t,e){return e.forEach((function(e){t=t.replace(be(e),e.color)})),t}var je=/^\s+|\s+$/g;function Se(t){return t.replace(je,"")}function Pe(t){if(B(t)){if(fe.isColorName(t)&&(t=fe.getColorByName(t)),t.indexOf("rgb(")>-1){for(var e=0,n=(r=t.replace("rgb(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("rgba(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsl(","").replace(")","").split(",")).length;e-1){for(e=0,n=(r=t.replace("hsla(","").replace(")","").split(",")).length;e>16,g:(65280&t)>>8,b:(255&t)>>0,a:1},{},Kt(i));if(0<=t&&t<=4294967295)return i=he({},i={type:"hex",r:(4278190080&t)>>24,g:(16711680&t)>>16,b:(65280&t)>>8,a:(255&t)/255},{},Kt(i))}return t}function xe(t){B(t)&&(t=Oe(t));var e=(t=t.map((function(t){if(B(t)){var e=we(t),n=Se(e.str).split(" ");return n[1]?n[1].indexOf("%")>-1?n[1]=parseFloat(n[1].replace(/%/,""))/100:n[1]=parseFloat(n[1]):n[1]="*",n[0]=ke(n[0],e.matches),n}if(Array.isArray(t))return t[1]?B(t[1])&&(t[1].indexOf("%")>-1?t[1]=parseFloat(t[1].replace(/%/,""))/100:t[1]=+t[1]):t[1]="*",pe(t)}))).filter((function(t){return"*"===t[1]})).length;if(e>0){var n=(1-t.filter((function(t){return"*"!=t[1]&&1!=t[1]})).map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0))/e;t.forEach((function(e,r){"*"==e[1]&&r>0&&(t.length-1==r||(e[1]=n))}))}return t}function $e(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",o=Ee(t,e,n);return rt(o,o.a<1?"rgb":r)}function Ee(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5;return{r:st(t.r+(e.r-t.r)*n),g:st(t.g+(e.g-t.g)*n),b:st(t.b+(e.b-t.b)*n),a:st(t.a+(e.a-t.a)*n,100)}}function _e(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if(!t)return[];B(t)&&(t=Oe(t));for(var n=(t=t||[]).length,r=[],o=0;o2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex",o=Pe(t),i=Pe(e);return $e(o,i,n,r)}function Te(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hex";return Ce(t,e,n,r)}function Re(t){return t=Pe(t),(Math.round(299*t.r)+Math.round(587*t.g)+Math.round(114*t.b))/1e3}function De(t){return Re(t)>=128?"black":"white"}function Ve(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=[],r=e-((t=xe(t)).length-1),o=r,i=1,a=t.length;i1&&void 0!==arguments[1]?arguments[1]:"h",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:9,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"rgb",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:1,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:100,c=Pe(t),u=Yt(c),s=(i-o)*a/n,l=[],f=1;f<=n;f++)u[e]=Math.abs((a-s*f)/a),l.push(rt(oe(u),r));return l}function Ie(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:360;return Ae(t,"h",e,n,r,o,1)}function Le(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return Ae(t,"s",e,n,r,o,100)}function Me(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgb",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return Ae(t,"v",e,n,r,o,100)}function Be(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ze(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}_e.parula=function(t){return _e(["#352a87","#0f5cdd","#00b5a6","#ffc337","#fdff00"],t)},_e.jet=function(t){return _e(["#00008f","#0020ff","#00ffff","#51ff77","#fdff00","#ff0000","#800000"],t)},_e.hsv=function(t){return _e(["#ff0000","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff","#ff0000"],t)},_e.hot=function(t){return _e(["#0b0000","#ff0000","#ffff00","#ffffff"],t)},_e.pink=function(t){return _e(["#1e0000","#bd7b7b","#e7e5b2","#ffffff"],t)},_e.bone=function(t){return _e(["#000000","#4a4a68","#a6c6c6","#ffffff"],t)},_e.copper=function(t){return _e(["#000000","#3d2618","#9d623e","#ffa167","#ffc77f"],t)};var Fe=function(t){for(var e=1;e=t){e=Ge[r-1],n=Ge[r];break}return e&&n?Fe.interpolateRGB(e,n,(t-e.start)/(n.start-e.start)):Ge[0].rgb}};function Xe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ye(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Ye({},e,{},n);Object.keys(r).forEach((function(r){Ke(t,r,e[r],n[r])}))}(e,We(n.attributes),We(e.attributes));var o=Ze(e),i=Ze(n),a=Math.max(o.length,i.length);for(r=0;r0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(Qe(this,t),this.value=e,H(this.value)&&isNaN(this.value))throw new Error("NaN is not able to set");this.unit=n}var e,n,r;return e=t,n=[{key:Symbol.toPrimitive,value:function(t){return"number"==t?this.value:this.toString()}},{key:"toString",value:function(){switch(this.unit){case"string":case"number":return this.value+"";case"var":return"var(--".concat(this.value,")");case"calc":return"calc(".concat(this.value,")");default:return this.value+this.unit}}},{key:"isUnitType",value:function(t){return this.unit===t}},{key:"isCalc",value:function(){return this.isUnitType("calc")}},{key:"isFr",value:function(){return this.isUnitType("fr")}},{key:"isPercent",value:function(){return this.isUnitType("%")}},{key:"isPx",value:function(){return this.isUnitType("px")}},{key:"isEm",value:function(){return this.isUnitType("em")}},{key:"isDeg",value:function(){return this.isUnitType("deg")}},{key:"isRad",value:function(){return this.isUnitType("rad")}},{key:"isTurn",value:function(){return this.isUnitType("turn")}},{key:"isSecond",value:function(){return this.isUnitType("s")}},{key:"isMs",value:function(){return this.isUnitType("ms")}},{key:"isNumber",value:function(){return this.isUnitType("number")}},{key:"isString",value:function(){return this.isUnitType("")}},{key:"isVar",value:function(){return this.isUnitType("--")}},{key:"isNaN",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){return H(this.value)&&isNaN(this.value)}))},{key:"set",value:function(t){return this.value=t,this}},{key:"add",value:function(t){return this.value+=+t,this}},{key:"sub",value:function(t){return this.add(-1*t)}},{key:"mul",value:function(t){return this.value*=+t,this}},{key:"div",value:function(t){return this.value/=+t,this}},{key:"mod",value:function(t){return this.value%=+t,this}},{key:"clone",value:function(){return new t(this.value,this.unit)}},{key:"getUnitName",value:function(){return"%"===this.unit?"percent":this.unit}},{key:"toJSON",value:function(){return this.toString()}},{key:"rate",value:function(t){return t/this.value}},{key:"stringToPercent",value:function(){return I(tn[this.value])?t.percent(tn[this.value]):t.percent(0)}},{key:"stringToEm",value:function(t){return this.stringToPercent().toEm(t)}},{key:"stringToPx",value:function(t){return this.stringToPercent().toPx(t)}},{key:"toPercent",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?this.clone():this.isPx()?t.percent(100*this.value/e):this.isEm()?t.percent(this.value*n*100/e):this.isString()?this.stringToPercent(e):this.isDeg()?t.percent(this.value/360*100):void 0}},{key:"toEm",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;return this.isPercent()?t.em(this.value/100*e/n):this.isPx()?t.em(this.value/n):this.isEm()?this.clone():this.isString()?this.stringToEm(e):void 0}},{key:"toPx",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],this.isPercent()?t.px(this.value/100*e):this.isPx()?this.clone():this.isEm()?t.px(this.value/100*e/16):this.isString()?this.stringToPx(e):void 0}},{key:"toDeg",value:function(){return this.isDeg()?this.clone():this.isTurn()?t.deg(360*this.value):this.isRad()?t.deg(this.value*(180/Math.PI)):void 0}},{key:"toTurn",value:function(){return this.isTurn()?this.clone():this.isDeg()?t.turn(this.value/360):void 0}},{key:"toSecond",value:function(){return this.isSecond()?this:this.isMs()?t.second(this.value/1e3):void 0}},{key:"toMs",value:function(){return this.isSecond()?t.ms(1e3*this.value):this.isMs()?this:void 0}},{key:"to",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16;return"px"===t?this.toPx(e,n):"%"===t||"percent"===t?this.toPercent(e,n):"em"===t?this.toEm(e,n):"deg"===t?this.toDeg():"turn"===t?this.toTurn():void 0}},{key:"toUnit",value:function(e){return new t(this.value,e)}},{key:"calculate",value:function(t,e){var n=this[t];return n?n.call(this,e):this}},{key:"includes",value:function(){for(var t=arguments.length,e=new Array(t),n=0;ne[o].value&&(r=e[o]);return r}},{key:"max",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1)return new t(e.split("calc(")[1].split(")")[0],"calc");var n=e.replace(nn,"$1 $2").split(" ").map((function(t){return t.trim()}));return+n[0]==n[0]?new t(+n[0],n[1]):new t(n[0])}if(e instanceof t)return e;if(e.unit){if("%"==e.unit||"percent"==e.unit){var r=0;return I(e.percent)?r=e.percent:I(e.value)&&(r=e.value),t.percent(r)}if("px"==e.unit)return r=0,I(e.px)?r=e.px:I(e.value)&&(r=e.value),t.px(r);if("em"==e.unit)return r=0,I(e.em)?r=e.em:I(e.value)&&(r=e.value),t.em(r);if("deg"==e.unit)return r=0,I(e.deg)?r=e.deg:I(e.value)&&(r=e.value),t.deg(r);if("turn"==e.unit)return r=0,I(e.deg)?r=e.turn:I(e.value)&&(r=e.value),t.turn(r);if("s"==e.unit)return r=0,I(e.second)?r=e.second:I(e.value)&&(r=e.value),t.second(r);if("ms"==e.unit)return r=0,I(e.ms)?r=e.ms:I(e.value)&&(r=e.value),t.ms(r);if("number"==e.unit)return r=0,I(e.value)&&(r=e.value),t.number(r);if("--"==e.unit)return r=0,I(e.value)&&(r=e.value),t.var(r);if(""===e.unit||"string"===e.unit)return r="",I(e.str)?r=e.str:I(e.value)&&(r=e.value),t.string(r)}return t.string(e)}}],n&&Je(e.prototype,n),r&&Je(e,r),t}();function on(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:"div";qe(this,t.create(n).html(e))}},{key:"updateSVGDiff",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div";qe(this,t.create(n).html("".concat(e,"")).firstChild)}},{key:"find",value:function(t){return this.el.querySelector(t)}},{key:"$",value:function(e){var n=this.find(e);return n?t.create(n):null}},{key:"findAll",value:function(t){return this.el.querySelectorAll(t)}},{key:"$$",value:function(e){return on(this.findAll(e)).map((function(e){return t.create(e)}))}},{key:"empty",value:function(){for(;this.el.firstChild;)this.el.removeChild(this.el.firstChild);return this}},{key:"append",value:function(t){return B(t)?this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t.el||t),this}},{key:"prepend",value:function(t){return B(t)?this.el.prepend(document.createTextNode(t)):this.el.prepend(t.el||t),this}},{key:"appendHTML",value:function(e){var n=t.create("div").html(e);this.append(n.createChildrenFragment())}},{key:"createChildrenFragment",value:function(){var t=this.children(),e=document.createDocumentFragment();return t.forEach((function(t){return e.appendChild(t.el)})),e}},{key:"appendTo",value:function(t){return(t.el?t.el:t).appendChild(this.el),this}},{key:"remove",value:function(){return this.el.parentNode&&this.el.parentNode.removeChild(this.el),this}},{key:"removeChild",value:function(t){return this.el.removeChild(t.el||t),this}},{key:"text",value:function(e){if(A(e))return this.el.textContent;var n=e;return e instanceof t&&(n=e.text()),this.el.textContent=n,this}},{key:"css",value:function(t,e){if(I(t)&&I(e))Object.assign(this.el.style,an({},t,e));else if(I(t)){if(B(t))return getComputedStyle(this.el)[t];Object.assign(this.el.style,t)}return this}},{key:"getComputedStyle",value:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){for(var t=getComputedStyle(this.el),e={},n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:"block";return this.css("display","none"!=t?t:"block")}},{key:"hide",value:function(){return this.css("display","none")}},{key:"isHide",value:function(){return"none"==this.css("display")}},{key:"isShow",value:function(){return!this.isHide()}},{key:"toggle",value:function(t){var e=this.isHide();return 1==arguments.length?t?this.show():this.hide():e?this.show():this.hide()}},{key:"scrollIntoView",value:function(){this.el.scrollIntoView()}},{key:"addScrollLeft",value:function(t){return this.el.scrollLeft+=t,this}},{key:"addScrollTop",value:function(t){return this.el.scrollTop+=t,this}},{key:"setScrollTop",value:function(t){return this.el.scrollTop=t,this}},{key:"setScrollLeft",value:function(t){return this.el.scrollLeft=t,this}},{key:"scrollTop",value:function(){return this.el===document.body?t.getScrollTop():this.el.scrollTop}},{key:"scrollLeft",value:function(){return this.el===document.body?t.getScrollLeft():this.el.scrollLeft}},{key:"scrollHeight",value:function(){return this.el.scrollHeight}},{key:"scrollWidth",value:function(){return this.el.scrollWidth}},{key:"on",value:function(t,e,n,r){return this.el.addEventListener(t,e,n,r),this}},{key:"off",value:function(t,e){return this.el.removeEventListener(t,e),this}},{key:"getElement",value:function(){return this.el}},{key:"createChild",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=t.create(e,n,r);return i.css(o),this.append(i),i}},{key:"children",value:function(){var e=this.el.firstElementChild;if(!e)return[];var n=[];do{n.push(t.create(e)),e=e.nextElementSibling}while(e);return n}},{key:"childLength",value:function(){return this.el.children.length}},{key:"replace",value:function(t){return this.el.parentNode&&this.el.parentNode.replaceChild(t.el||t,this.el),this}},{key:"replaceChild",value:function(t,e){return this.el.replaceChild(e.el||e,t.el||t),this}},{key:"checked",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return 0==arguments.length?!!this.el.checked:(this.el.checked=!!t,this)}},{key:"click",value:function(){return this.el.click(),this}},{key:"focus",value:function(){return this.el.focus(),this}},{key:"select",value:function(){return this.el.select(),this}},{key:"blur",value:function(){return this.el.blur(),this}},{key:"select",value:function(){return this.el.select(),this}},{key:"context",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"2d";return this._initContext||(this._initContext=this.el.getContext(t)),this._initContext}},{key:"resize",value:function(t){var e=t.width,n=t.height;this._initContext=null;var r=this.context(),o=window.devicePixelRatio||1;this.px("width",+e),this.px("height",+n),this.el.width=e*o,this.el.height=n*o,r.scale(o,o)}},{key:"toDataURL",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"image/png",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.el.toDataURL(t,e)}},{key:"clear",value:function(){this.context().clearRect(0,0,this.el.width,this.el.height)}},{key:"update",value:function(t){this.clear(),t.call(this,this)}},{key:"drawImage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.context(),o=window.devicePixelRatio||1;r.drawImage(t,e,n,t.width,t.height,0,0,this.el.width/o,this.el.height/o)}},{key:"drawOption",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.context();Object.assign(e,t)}},{key:"drawLine",value:function(t,e,n,r){var o=this.context();o.beginPath(),o.moveTo(t,e),o.lineTo(n,r),o.stroke(),o.closePath()}},{key:"drawPath",value:function(){var t=this.context();t.beginPath();for(var e=arguments.length,n=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:yn;return" ".concat(e," ").concat(t)},ln=/^dom (.*)/gi,fn=/^load (.*)/gi,pn=/^bind (.*)/gi,yn="|",hn={},dn=function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]?arguments[1]:yn;return sn(t,e)}),Fn=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yn;return sn("after(".concat(t,")"),e)},Gn=zn,Hn=zn,Xn=(zn("ArrowUp"),zn("ArrowDown"),zn("ArrowLeft"),zn("ArrowRight"),zn("Enter")),Yn=(zn("Space"),zn("Escape")),Nn=zn("isAltKey"),Kn=(zn("isShiftKey"),zn("isMetaKey"),zn("isCtrlKey"),zn("self"),zn("fit"),zn("passive"),zn("vdom")),Wn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return zn("debounce(".concat(t,")"))},Un=(Wn(1e3),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return zn("throttle(".concat(t,")"))}),Zn=(zn("capture()"),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"move";return Fn("bodyMouseMove ".concat(t))}),qn=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"end";return Fn("bodyMouseUp ".concat(t))},Jn=Fn("preventDefault"),Qn=Fn("stopPropagation"),tr=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el";return"load "+t},er=function(t){if(""===t)return"";var e=kt();return hn[e]=t,e},nr=function(t){return function(){return this.prevState[t]!=this.state[t]}},rr=function(){return!0},or=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"$el",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"bind "+t+(e?yn+er(e):"")},ir={addEvent:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t&&t.addEventListener(e,n,r)},removeEvent:function(t,e,n){t&&t.removeEventListener(e,n)},pos:function(t){return t.touches&&t.touches[0]?t.touches[0]:t},posXY:function(t){var e=this.pos(t);return{x:e.pageX,y:e.pageY}}};function ar(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cr(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];ar(this,t),this.cachedCallback={},this.callbacks={},this.commandes=[]}var e,n,r;return e=t,(n=[{key:"getCallbacks",value:function(t){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t]}},{key:"setCallbacks",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];this.callbacks[t]=e}},{key:"on",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=r>0?E(e,r):e;this.getCallbacks(t).push({event:t,callback:o,context:n,originalCallback:e})}},{key:"off",value:function(t,e){1==arguments.length?this.setCallbacks(t):2==arguments.length&&this.setCallbacks(t,this.getCallbacks(t).filter((function(t){return t.originalCallback!==e})))}},{key:"offAll",value:function(t){var e=this;Object.keys(this.callbacks).forEach((function(n){e.setCallbacks(n,e.getCallbacks(n).filter((function(e){return e.context!==t})))}))}},{key:"getCachedCallbacks",value:function(t){return this.getCallbacks(t)}},{key:"sendMessage",value:function(t,e,n,r,o,i){var a=this;Promise.resolve().then((function(){var c=a.getCachedCallbacks(e);c&&c.filter((function(e){return e.originalCallback.source!==t})).forEach((function(t){t.callback(n,r,o,i)}))}))}},{key:"triggerMessage",value:function(t,e,n,r,o,i){var a=this;Promise.resolve().then((function(){var c=a.getCachedCallbacks(e);c?c.filter((function(e){return e.originalCallback.source===t})).forEach((function(t){t.callback(n,r,o,i)})):console.warn(e," is not valid event")}))}},{key:"emit",value:function(t,e,n,r,o){this.sendMessage(this.source,t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.triggerMessage(this.source,t,e,n,r,o)}},{key:"execute",value:function(t,e,n,r,o){this.runCommand(this.source,t,e,n,r,o)}}])&&cr(e.prototype,n),r&&cr(e,r),t}();function lr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{};pr(this,t),this.context=e,this.options=n}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){}},{key:"load",value:function(){}},{key:"refresh",value:function(){}},{key:"render",value:function(){}},{key:"getRef",value:function(t){return this.context.getRef(t)}},{key:"splitMethodByKeyword",value:function(t,e){var n=t.filter((function(t){return t.indexOf("".concat(e,"("))>-1})),r=n.map((function(t){var n=fr(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}}));return[n,r]}},{key:"collectProps",value:function(){var t=this.context,e=t.__proto__,n=[];do{if(!1==e instanceof Object)break;var r=Object.getOwnPropertyNames(e).filter((function(e){return t&&G(t[e])&&!dr[e]}));n.push.apply(n,lr(r)),e=e.__proto__}while(e);return n}},{key:"filterProps",value:function(t){return this.collectProps().filter((function(e){return e.match(t)}))}},{key:"run",value:function(){}},{key:"destroy",value:function(){}}])&&yr(e.prototype,n),r&&yr(e,r),t}();function br(t){return(br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e-1||!!t.key&&e.codes.indexOf(t.key.toLowerCase())>-1);var o=!0;return e.checkMethodList.length&&(o=e.checkMethodList.every((function(e){var r=n[e];return G(r)&&r?r.call(n,t):!I(r)||!!r}))),r&&o}},{key:"getDefaultDomElement",value:function(t){var e,n=this.context;return(e=t?n.refs[t]||n[t]||window[t]:n.el||n.$el||n.$root)instanceof un?e.getElement():e}},{key:"getDefaultEventObject",value:function(t,e){var n=this.context,r=e,o=r.filter((function(t){return!!n[t]})),i=wr(this.splitMethodByKeyword(r,"after"),2),a=i[0],c=i[1],u=wr(this.splitMethodByKeyword(r,"before"),2),s=u[0],l=u[1],f=wr(this.splitMethodByKeyword(r,"debounce"),2),p=f[0],y=f[1],h=wr(this.splitMethodByKeyword(r,"throttle"),2),d=h[0],v=h[1],b=wr(this.splitMethodByKeyword(r,"capture"),1)[0],g=[].concat(gr(o),gr(a),gr(s),gr(p),gr(d),gr(b));return{eventName:t,codes:r.filter((function(t){return-1===g.indexOf(t)})).map((function(t){return t.toLowerCase()})),captures:b,afterMethods:c,beforeMethods:l,debounceMethods:y,throttleMethods:v,checkMethodList:o}}},{key:"addEvent",value:function(t,e){t.callback=this.makeCallback(t,e),this.addBinding(t);var n=!!t.captures.length;Er[t.eventName]&&(n={passive:!0,capture:n}),ir.addEvent(t.dom,t.eventName,t.callback,n)}},{key:"bindingEvent",value:function(t,e,n){var r=function(t){return kr(t)||mr(t)||Or()}(t),o=r[0],i=r[1],a=r.slice(2),c=(this.context,this.getDefaultEventObject(o,e));c.dom=this.getDefaultDomElement(i),c.delegate=a.join(" "),c.debounceMethods.length?n=E(n,+c.debounceMethods[0].target):c.throttleMethods.length&&(n=_(n,+c.throttleMethods[0].target)),this.addEvent(c,n)}},{key:"getEventNames",value:function(t){var e=[];return t.split(":").forEach((function(t){var n=t.split(":");e.push.apply(e,gr(n))})),e}},{key:"parseEvent",value:function(t){var e=this,n=this.context,r=t.split(yn).map((function(t){return t.trim()})),o=r.shift().split("dom ")[1].split(" "),i=this.getEventNames(o[0]),a=n[t].bind(n);i.forEach((function(t){o[0]=t,e.bindingEvent(o,r,a)}))}}])&&Sr(n.prototype,r),o&&Sr(n,o),e}(vr);function Cr(t){return(Cr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Tr(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Rr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dr(t,e){for(var n=0;n-1})).forEach((function(e){var r=t.context[e],o=Tr(e.split(yn),2),i=(e=o[0],o[1]),a=t.getRef(i),c=rr;""!=a&&B(a)?c=nr(a):G(a)&&(c=a);var u=e.split("bind ")[1],s=t.context.refs[u],l=G(c)&&c.call(t.context);if(s&&l){var f=r.call.apply(r,[t.context].concat(n));if(!f)return;C(f,(function(t,e){Br(s,t,e)}))}}))}},{key:"destroy",value:function(){this._bindMethods=void 0}}])&&Dr(n.prototype,r),o&&Dr(n,o),e}(vr);function Fr(){var t=Xr(["",""]);return Fr=function(){return t},t}function Gr(t){return qr(t)||Nr(t)||Zr()}function Hr(){var t=Xr(["\n ","\n "]);return Hr=function(){return t},t}function Xr(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}function Yr(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:{};return ro(this,e),(n=io(this,co(e).call(this,t,r))).created(),n.initialize(),n.initializeStoreEvent(),n}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&uo(t,e)}(e,t),n=e,(r=[{key:"initializeProperty",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.opt=t||{},this.parent=this.opt,this.props=e,this.source=kt(),this.sourceName=this.constructor.name,t&&t.$store&&(this.$store=t.$store),t&&t.$editor&&(this.$editor=t.$editor)}},{key:"created",value:function(){}},{key:"getRealEventName",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ME@",n=t.indexOf(e);return t.substr(n<0?0:n+e.length)}},{key:"initializeStoreEvent",value:function(){var t=this;this.filterProps(so).forEach((function(e){var n=t.getRealEventName(e,"ME@"),r=no(function(t,e){var n=t.filter((function(t){return t.indexOf("".concat(e,"("))>-1})),r=n.map((function(t){var n=Ur(t.split("".concat(e,"("))[1].split(")")[0].trim().split(" "),2);return{target:n[0],param:n[1]}}));return[n,r]}(n.split("|"),"debounce"),2),o=r[0],i=r[1],a=0;o.length&&(a=+i[0].target||0),n.split("|").filter((function(t){return-1===o.indexOf(t)})).map((function(t){return t.trim()})).forEach((function(n){var r=t[e].bind(t);r.displayName="".concat(t.sourceName,".").concat(n),r.source=t.source,t.$store.on(n,r,t,a)}))}))}},{key:"destoryStoreEvent",value:function(){this.$store.offAll(this)}},{key:"destroy",value:function(){ao(co(e.prototype),"destroy",this).call(this),this.destoryStoreEvent()}},{key:"rerender",value:function(){ao(co(e.prototype),"rerender",this).call(this),this.initialize(),this.initializeStoreEvent()}},{key:"emit",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.sourceContext=this,this.$store.emit(t,e,n,r,o)}},{key:"trigger",value:function(t,e,n,r,o){this.$store.source=this.source,this.$store.trigger(t,e,n,r,o)}},{key:"on",value:function(t,e){this.$store.on(t,e)}},{key:"off",value:function(t,e){this.$store.off(t,e)}},{key:"$i18n",value:function(t){return this.$editor.i18n(t)}},{key:"$initI18n",value:function(t){return this.$editor.initI18n(t)}},{key:"$theme",value:function(t){return this.$editor.themeValue(t)}},{key:"$config",get:function(){return this.$editor.config}},{key:"$selection",get:function(){return this.$editor.selection}},{key:"$timeline",get:function(){return this.$editor.timeline}}])&&oo(n.prototype,r),o&&oo(n,o),e}(function(){function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.state={},this.prevState={},this.refs={},this.children={},this._bindings=[],this.id=kt(),this.handlers=this.initializeHandler(),this.initializeProperty(e,n),this.initComponents()}var e,n,r;return e=t,(n=[{key:"initComponents",value:function(){var t=this;this.childComponents=this.components(),this.childComponentKeys=Object.keys(this.childComponents),this.childComponentSet=new Map,this.childComponentKeys.forEach((function(e){t.childComponentSet.set(e.toLowerCase(),e)})),this.childComponentKeysString=Yr(this.childComponentSet.keys()).join(",")}},{key:"initializeHandler",value:function(){return[new zr(this),new _r(this)]}},{key:"initState",value:function(){return{}}},{key:"setState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.prevState=this.state,this.state=Object.assign({},this.state,t),e&&this.load()}},{key:"_reload",value:function(t){this.props=t,this.state={},this.setState(this.initState(),!1),this.refresh(!0)}},{key:"render",value:function(t){this.$el=this.parseTemplate(Z(Hr(),this.template())),this.refs.$el=this.$el,t&&t.append(this.$el),this.load(),this.afterRender()}},{key:"initialize",value:function(){this.state=this.initState()}},{key:"afterRender",value:function(){}},{key:"components",value:function(){return{}}},{key:"getRef",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1}},{key:"parseProperty",value:function(t){var e={},n=!0,r=!1,o=void 0;try{for(var i,a=t.el.attributes[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var c=i.value;e[c.nodeName]=c.nodeValue}}catch(t){r=!0,o=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t.$$("property").forEach((function(t){var n=Ur(t.attrs("name","value","type"),3),r=n[0],o=n[1],i=n[2],a=o||t.text();"json"===i&&(a=JSON.parse(a)),e[r]=a})),e}},{key:"parseSourceName",value:function(t){return t.parent?[t.sourceName].concat(Yr(this.parseSourceName(t.parent))):[t.sourceName]}},{key:"parseComponent",value:function(){var t=this,e=this.$el,n=[];this.childComponentKeysString&&(n=e.$$(this.childComponentKeysString)),n.forEach((function(e){var n=e.el.tagName.toLowerCase(),r=t.childComponentSet.get(n),o=t.childComponents[r],i=t.parseProperty(e),a=e.attr("ref"),c=null;t.children[a]?(c=t.children[a])._reload(i):(c=new o(t,i),t.children[a||c.id]=c,c.render(),c.initializeEvent()),e.replace(c.$el)})),C(this.children,(function(e,n){n&&n.clean()&&delete t.children[e]}))}},{key:"clean",value:function(){if(this.$el&&!this.$el.hasParent())return C(this.children,(function(t,e){e.clean()})),this.destroy(),this.$el=null,!0}},{key:"refresh",value:function(){this.load()}},{key:"loadTemplate",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n-1})).forEach((function(e){var r=Gr(e.split("load ")[1].split(yn).map((function(t){return t.trim()}))),o=r[0],i=r.slice(1),a=(i=i.map((function(t){return t.trim()}))).indexOf(Kn.value)>-1;if(t.refs[o]){var c,u=(c=t[e]).call.apply(c,[t].concat(n));L(u)&&(u=u.join(""));var s=t.parseTemplate(Z(Fr(),u),!0);a?t.refs[o].htmlDiff(s):t.refs[o].html(s),t.runHandlers("initialize")}})),this.bindData(),this.parseComponent()}},{key:"runHandlers",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"run",e=arguments.length,n=new Array(e>1?e-1:0),r=1;r"}},{key:"eachChildren",value:function(t){G(t)&&C(this.children,(function(e,n){t(n)}))}},{key:"rerender",value:function(){var t=this.$el.parent();this.destroy(),this.render(t)}},{key:"initializeEvent",value:function(){this.runHandlers("initialize")}},{key:"destroy",value:function(){this.eachChildren((function(t){t.destroy()})),this.runHandlers("destroy"),this.$el.remove(),this.$el=null,this.refs={},this.children={}}},{key:"collectProps",value:function(){var t=this,e=this.__proto__,n=[];do{if(!1==e instanceof Object)break;var r=Object.getOwnPropertyNames(e).filter((function(e){return t&&G(t[e])&&!to[e]}));n.push.apply(n,Yr(r)),e=e.__proto__}while(e);return n}},{key:"filterProps",value:function(t){return this.collectProps().filter((function(e){return e.match(t)}))}},{key:"self",value:function(t){return t&&t.$dt&&t.$dt.is(t.target)}},{key:"isAltKey",value:function(t){return t.altKey}},{key:"isCtrlKey",value:function(t){return t.ctrlKey}},{key:"isShiftKey",value:function(t){return t.shiftKey}},{key:"isMetaKey",value:function(t){return t.metaKey||"Meta"==t.key||t.code.indexOf("Meta")>-1}},{key:"preventDefault",value:function(t){return t.preventDefault(),!0}},{key:"stopPropagation",value:function(t){return t.stopPropagation(),!0}},{key:"bodyMouseMove",value:function(t,e){this[e]&&this.emit("add/body/mousemove",this[e],this,t.xy)}},{key:"bodyMouseUp",value:function(t,e){this[e]&&this.emit("add/body/mouseup",this[e],this,t.xy)}}])&&Kr(e.prototype,n),r&&Kr(e,r),t}()),yo={en_US:{"app.title":"EASYLOGIC","app.sample":function(t,e,n){return"".concat(t,"-").concat(e,"-").concat(n)},"app.lang.en_US":"English","app.lang.ko_KR":"한국어","app.label.lang":"Language","app.theme.dark":"Dark","app.theme.light":"Light","app.theme.gray":"Gray","app.label.theme":"Theme","app.tab.title.projects":"Projects","app.tab.title.layers":"Layers","app.tab.title.libraries":"Library","app.tab.title.components":"Object","app.tab.title.assets":"Assets","app.tab.title.keyMap":"KeyMap","menu.item.download.title":"Download","menu.item.save.title":"Save","menu.item.export.title":"Export","menu.item.codepen.title":"CodePen","menu.item.fullscreen.title":"Screen","menu.item.github.title":"Github","menu.item.learn.title":"Learn","project.property.title":"Project","project.information.property.title":"Project information","project.information.property.name":"Name","project.information.property.description":"Description","artboard.property.title":"ArtBoards","artboard.property.layout.title.flex":"Flex","artboard.property.layout.title.grid":"Grid","layer.tree.property.title":"Layers","layer.tree.property.layout.title.flex":"Flex","layer.tree.property.layout.title.grid":"Grid","alignment.property.title":"Alignment","position.property.title":"Position","position.property.X":"X","position.property.Y":"Y","size.property.title":"Size","size.property.width":"Width","size.property.height":"Height","background.color.property.title":"Appearance","background.color.property.color":"Color","background.color.property.zindex":"z-index","background.color.property.opacity":"Opacity","background.color.property.blend":"Blend","background.color.property.overflow":"Overflow","background.color.property.overflow.visible":"Visible","background.color.property.overflow.hidden":"Hidden","background.color.property.overflow.scroll":"Scroll","background.color.property.overflow.auto":"Auto","blend.normal":"normal","blend.multiply":"multiply","blend.screen":"screen","blend.overlay":"overlay","blend.darken":"darken","blend.lighten":"lighten","blend.color-dodge":"color-dodge","blend.color-burn":"color-burn","blend.hard-light":"hard-light","blend.soft-light":"soft-light","blend.difference":"difference","blend.exclusion":"exclusion","blend.hue":"hue","blend.saturation":"saturation","blend.color":"color","blend.luminosity":"luminosity","background.image.property.title":"Fill","border.property.title":"Border","border.radius.property.title":"Border Radius","boxshadow.property.title":"Box Shadows","filter.property.title":"Filter","filter.property.blur":"Blur","filter.property.grayscale":"GrayScale","filter.property.hue-rotate":"Hue Rotate","filter.property.invert":"Invert","filter.property.brightness":"Brightness","filter.property.contrast":"Contrast","filter.property.drop-shadow":"Drop Shadow","filter.property.opacity":"Opacity","filter.property.saturate":"Saturate","filter.property.sepia":"Sepia","filter.property.svg":"SVG","font.property.title":"Font","font.property.color":"Color","font.property.size":"Size","font.property.stretch":"Stretch","font.property.weight":"Weight","font.property.style":"Style","font.property.family":"Family","font.spacing.property.title":"Font spacing","font.spacing.property.lineHeight":"Line height","font.spacing.property.letterSpacing":"Letter spacing","font.spacing.property.wordSpacing":"Word spacing","font.spacing.property.indent":"Indent","backdrop.filter.property.title":"Backdrop Filter","clippath.property.title":"Clip Path","export.property.title":"Export","export.property.download":"Download","image.property.title":"Image","image.property.origin":"Origin","image.property.size":"Size","image.property.width":"Width","image.property.height":"height","motion.property.title":"Motion","text.property.title":"Text Style","text.property.align":"Align","text.property.transform":"Transform","text.property.decoration":"Decoration","text.clip.property.title":"Text Clip","text.shadow.property.title":"Text Shadows","text.fill.property.title":"Text Fill","text.fill.property.fill":"Fill","text.fill.property.stroke":"Stroke","text.fill.property.strokeWidth":"Width","transform.property.title":"Transform","transform.origin.property.title":"Transform Origin","transition.property.title":"CSS Transition","keyframe.property.title":"CSS Keyframe","selector.property.title":"Selector","selector.property.none":"None selector","path.data.property.title":"Path Information","polygon.data.property.title":"Polygon Information","perspective.property.title":"Perspective","perspective.origin.property.title":"Perspective Origin","svg.item.property.title":"SVG Item","svg.item.property.isMotionPath":"Motion Path","svg.item.property.fill":"Fill","svg.item.property.fillOpacity":"Opacity","svg.item.property.path":"Path","svg.item.property.polygon":"Polygon","svg.item.property.totalLength":"Total Length","svg.item.property.fillRule":"Fill Rule","svg.item.property.stroke":"Stroke","svg.item.property.strokeWidth":"Width","svg.item.property.dashArray":"Dash Array","svg.item.property.dashOffset":"Dash Offset","svg.item.property.lineCap":"Line Cap","svg.item.property.lineJoin":"Line Join","svg.item.property.filter":"Filter","border.editor.all":"All","border.editor.width":"Width","border.editor.style":"Style","border.editor.color":"C","border.editor.top":"Top","border.editor.left":"Left","border.editor.right":"Right","border.editor.bottom":"Bottom","border.radius.editor.topLeft":"Top Left","border.radius.editor.topRight":"Top Right","border.radius.editor.bottomLeft":"Bottom Left","border.radius.editor.bottomRight":"Bottom Right","boxshadow.editor.blur":"Blur","boxshadow.editor.spread":"Spread","css.property.editor.properties":"Properties","offset.path.list.editor.path":"Path","offset.path.list.editor.totalLength":"Total Length","offset.path.list.editor.distance":"Distance","offset.path.list.editor.direction":"Direction","offset.path.list.editor.rotate":"Rotate","svgfilter.select.editor.message.create":"Create new svg filter","svgfilter.select.editor.message.select":"Select a filter","fill.editor.message.click.image":"Click the preview area if you want to select a image","fill.editor.message.drag.position":"Drag if you want to move center position","fill.editor.x1":"Start X","fill.editor.x2":"End X","fill.editor.y1":"Start Y","fill.editor.y2":"End Y","fill.editor.spread":"Spread","fill.editor.offset":"Offset","fill.editor.cx":"Center X","fill.editor.cy":"Center Y","fill.editor.r":"End radius","fill.editor.fx":"Start X","fill.editor.fy":"Start Y","fill.editor.fr":"Start radius","perspective.origin.editor.originX":"Origin X","perspective.origin.editor.originY":"Origin Y","path.manager.msg":"Keydown ESC or Enter key to close editing","path.manager.mode.modify":"Modify","path.manager.mode.path":"Path","path.manager.mode.transform":"Transform","path.manager.mode.flipX":"Flip X","path.manager.mode.flipY":"Flip Y","path.manager.mode.flipOrigin":"Flip Origin","colorpicker.popup.title":"ColorPicker","selector.popup.title":"Selector Property","selector.popup.selector":"Selector","background.image.position.popup.title":"Background Pattern","background.image.position.popup.size":"Size","background.image.position.popup.width":"Width","background.image.position.popup.height":"Height","background.image.position.popup.repeat":"Repeat","background.image.position.popup.blend":"Blend","background.image.position.popup.type.repeat":"repeat","background.image.position.popup.type.no-repeat":"no repeat","background.image.position.popup.type.repeat-x":"repeat-x","background.image.position.popup.type.repeat-y":"repeat-y","background.image.position.popup.type.space":"space","background.image.position.popup.type.round":"round","gradient.picker.popup.title":"Gradient & Image Picker","image.asset.property.title":"Image","color.asset.property.title":"Color","gradient.asset.property.title":"Gradient","pattern.asset.property.title":"Pattern","svgfilter.asset.property.title":"SVG Filter","inspector.tab.title.style":"Style","inspector.tab.title.component":"Component","inspector.tab.title.transition":"Transition & Animation","inspector.tab.title.asset":"Assets","inspector.tab.title.text":"Text","inspector.tab.title.code":"Code","timeline.property.title":"Timeline","timeline.animation.property.title":"Animations","timeline.play.control.play":"Play","timeline.play.control.pause":"Pause","timeline.play.control.first":"First","timeline.play.control.prev":"Previous","timeline.play.control.next":"Next","timeline.play.control.last":"Last","timeline.play.control.direction":"Direction","timeline.play.control.speed":"Speed","timeline.play.control.repeat":"Repeat","timeline.play.control.infinite":"Infinite","timeline.play.control.normal":"normal","timeline.play.control.alternate":"alternate","timeline.play.control.reverse":"reverse","timeline.play.control.alternate.reverse":"alternate reverse","timeline.value.editor.value":"Value","timeline.value.editor.time":"Time","timeline.value.editor.timing":"Timing","svgfilter.popup.title":"SVG Filter","css.item.rotate":"Rotate","css.item.rotateX":"Rotate X","css.item.rotateY":"Rotate Y","css.item.rotateZ":"Rotate Z","css.item.rotate3d":"3D Rotate","css.item.skewX":"Skew X","css.item.skewY":"Skew Y","css.item.translate":"Translate","css.item.translateX":"Translate X","css.item.translateY":"Translate Y","css.item.translateZ":"Translate Z","css.item.translate3d":"3D Translate","css.item.perspective":"Perspective","css.item.scale":"Scale","css.item.scaleX":"Scale X","css.item.scaleY":"Scale Y","css.item.scaleZ":"Scale Z","css.item.scale3d":"3D Scale","css.item.matrix":"Matrix","css.item.matrix3d":"3D Matrix","animation.property.title":"CSS Animation","animation.property.direction":"Direction","animation.property.play.state":"Play State","animation.property.fill.mode":"Fill Mode","animation.property.delay":"Delay","animation.property.duration":"Duration","animation.property.iteration.count":"Iteration Count","animation.property.Select a keyframe":"Select a keyframe","animation.property.popup.title":"Animation","animation.property.popup.timing.function":"Timing Function","animation.property.popup.keyframe":"Keyframe","animation.property.popup.direction":"Direction","animation.property.popup.play.state":"Play State","animation.property.popup.fill.mode":"Fill Mode","animation.property.popup.delay":"Delay","animation.property.popup.duration":"Duration","animation.property.popup.iteration":"Iteration","animation.property.popup.normal":"normal","animation.property.popup.reverse":"reverse","animation.property.popup.alternate":"alternate","animation.property.popup.alternate-reverse":"alternate-reverse","animation.property.popup.none":"none","animation.property.popup.forwards":"forwards","animation.property.popup.backwards":"backwards","animation.property.popup.both":"both","animation.property.popup.Select a keyframe":"Select a keyframe","keyframe.popup.title":"Keyframe","code.view.property.title":"CodeView","svg.filter.editor.tab.filter":"Filter","svg.filter.editor.tab.preset":"Preset","svg.filter.editor.tab.asset":"Assets","svg.filter.editor.GRAPHIC REFERENCES":"GRAPHIC REFERENCES","svg.filter.editor.SOURCES":"SOURCES","svg.filter.editor.MODIFIER":"MODIFIER","svg.filter.editor.LIGHTING":"LIGHTING","svg.filter.editor.COMBINERS":"COMBINERS","svg.filter.editor.Template":"Template","layout.property.title":"Layout","layout.property.flex":"Flex Box","layout.property.grid":"Grid","layout.property.default":"Default","flex.layout.editor.row":"Row","flex.layout.editor.column":"column","flex.layout.editor.row-reverse":"Row Reverse","flex.layout.editor.column-reverse":"Column Reverse","flex.layout.editor.nowrap":"Nowrap","flex.layout.editor.wrap":"Wrap","flex.layout.editor.wrap-reverse":"Wrap Reverse","flex.layout.editor.flex-start":"Start","flex.layout.editor.flex-end":"End","flex.layout.editor.center":"Center","flex.layout.editor.space-between":"Between","flex.layout.editor.space-around":"Around","flex.layout.editor.baseline":"BaseLine","flex.layout.editor.stretch":"Stretch","flex.layout.editor.direction":"Direction","flex.layout.editor.justify-content":"Justify Content","flex.layout.editor.align-items":"Align Items","flex.layout.editor.align-content":"Align Content","flex.layout.item.property.title":"Layout Item Detail","flex.layout.item.property.grow":"Flex Grow","flex.layout.item.property.shrink":"Flex Shrink","flex.layout.item.property.basis":"Flex Basis","flex.layout.item.property.none":"none","flex.layout.item.property.auto":"auto","flex.layout.item.property.value":"value","grid.layout.editor.template.columns":"Columns","grid.layout.editor.column.gap":"Column Gap","grid.layout.editor.template.rows":"Rows","grid.layout.editor.row.gap":"Row Gap","grid.box.editor.box.title":"Box","grid.box.editor.type":"Type","grid.box.editor.repeat":"Repeat","grid.box.editor.length":"Length","grid.box.editor.none":"None","grid.box.editor.auto":"Auto","grid.box.editor.count":"Count","grid.box.editor.value":"Size","grid.layout.item.property.title":"Layout Item Detail","grid.layout.item.property.column":"Column","grid.layout.item.property.row":"Row","grid.layout.item.property.start":"Start","grid.layout.item.property.end":"End","grid.layout.item.property.none":"none","grid.layout.item.property.value":"value","box.model.property.title":"Box Model","box.model.property.margin":"Margin","box.model.property.padding":"Padding","component.items.canvas":"Canvas","component.items.layer":"Layer","component.items.3dlayer":"3D Layer","component.items.drawing":"Drawing","component.items.custom":"Custom Component","svg.text.property.title":"SVG Text Style","svg.text.property.textarea":"Text Area","svg.text.property.size":"Font Size","svg.text.property.weight":"Font Weight","svg.text.property.style":"Font Style","svg.text.property.anchor":"Text Anchor","svg.text.property.family":"Font Family","svg.text.property.length.adjust":"Length Adjust","svg.text.property.text.length":"Text Length","svg.text.property.start.offset":"Start Offset","fill.picker.popup.title":"SVG Fragment picker","gradient.editor.drag.message":"Drag if you want to move center pointer.","draw.manager.tolerance":"Tolerance","pattern.property.title":"Pattern","pattern.info.popup.title":"Pattern Info","pattern.info.popup.width":"Width","pattern.info.popup.height":"Height","pattern.info.popup.lineWidth":"Line Width","pattern.info.popup.lineHeight":"Line Height","pattern.info.popup.rotate":"Rotate","pattern.info.popup.blend":"Blend Mode","pattern.info.popup.foreColor":"Fore","pattern.info.popup.backColor":"Back"},ko_KR:{"app.title":"EASYLOGIC","app.sample":function(t,e,n){return"".concat(t,"-").concat(e,"-").concat(n)},"app.lang.en_US":"English","app.lang.ko_KR":"한국어","app.label.lang":"언어","app.theme.dark":"어두운","app.theme.light":"밝은","app.theme.gray":"회색","app.label.theme":"테마","app.tab.title.projects":"프로젝트","app.tab.title.layers":"레이어","app.tab.title.libraries":"라이브러리","app.tab.title.components":"컴포넌트","app.tab.title.assets":"에셋","app.tab.title.keyMap":"단축키","menu.item.download.title":"다운로드","menu.item.save.title":"저장","menu.item.export.title":"내보내기","menu.item.codepen.title":"CodePen","menu.item.fullscreen.title":"전체화면","menu.item.github.title":"Github","menu.item.learn.title":"배우기","project.property.title":"프로젝트","project.information.property.title":"프로젝트 정보","project.information.property.name":"이름","project.information.property.description":"설명","artboard.property.title":"아트보드","artboard.property.layout.title.flex":"플렉스","artboard.property.layout.title.grid":"그리드","layer.tree.property.title":"레이어","layer.tree.property.layout.title.flex":"플렉스","layer.tree.property.layout.title.grid":"그리드","alignment.property.title":"정렬","position.property.title":"위치","position.property.X":"X","position.property.Y":"Y","size.property.title":"크기","size.property.width":"넓이","size.property.height":"높이","background.color.property.title":"표시","background.color.property.color":"배경색","background.color.property.zindex":"z-index","background.color.property.opacity":"투명도","background.color.property.blend":"블렌드모드","background.color.property.overflow":"오버플로우","background.color.property.overflow.visible":"보이기","background.color.property.overflow.hidden":"숨기기","background.color.property.overflow.scroll":"스크롤","background.color.property.overflow.auto":"자동","blend.normal":"Normal(표준) 혼합모드","blend.multiply":"Multiply(곱하기) 모드","blend.screen":"Screen(스크린) 모드 ","blend.overlay":"Overlay(오버레이) 모드","blend.darken":"Darken(어둡기) 모드","blend.lighten":"Lighten(밝기) 모드 ","blend.color-dodge":"Color Dodge(컬러 닷지) 모드 ","blend.color-burn":"Color Burn(컬러 번) 모드 ","blend.hard-light":"Hard Light(하드 라이트) 모드 ","blend.soft-light":"Soft Light(소프트 라이트) 모드 ","blend.difference":"Difference(차이) 모드","blend.exclusion":"Exclusion(제외) 모드","blend.hue":"Hue(색조) 모드 ","blend.saturation":"Saturation(채도) 모드","blend.color":"Color(색상) 모드","blend.luminosity":"Luminosity(광도) 모드 ","background.image.property.title":"배경(그라디언트)","border.property.title":"외곽선","border.radius.property.title":"둥근 외곽선","boxshadow.property.title":"그림자","filter.property.title":"필터","filter.property.blur":"흐림(Blur)","filter.property.grayscale":"회색(GrayScale)","filter.property.hue-rotate":"색조(HueRotate)","filter.property.invert":"반전(Invert)","filter.property.brightness":"밝기(Brightness)","filter.property.contrast":"대\b조(Contrast)","filter.property.drop-shadow":"그림자(Drop Shadow)","filter.property.opacity":"투명도(Opacity)","filter.property.saturate":"채도(Saturate)","filter.property.sepia":"갈색톤(Sepia)","filter.property.svg":"SVG","font.property.title":"폰트","font.property.color":"색","font.property.size":"크기","font.property.stretch":"뻗기","font.property.weight":"굵기","font.property.style":"스타일","font.property.family":"글꼴","font.spacing.property.title":"폰트 공간","font.spacing.property.lineHeight":"줄 높이","font.spacing.property.letterSpacing":"글자 간격","font.spacing.property.wordSpacing":"단어 간격","font.spacing.property.indent":"들여쓰기","backdrop.filter.property.title":"후면 필터","clippath.property.title":"클립패스","export.property.title":"내보내기","export.property.download":"다운로드","image.property.title":"이미지","image.property.origin":"원본","image.property.size":"크기","image.property.width":"넓이","image.property.height":"높이","motion.property.title":"모션","path.data.property.title":"패스 정보","polygon.data.property.title":"폴리곤 정보","text.property.title":"텍스트 스타일","text.property.align":"정렬","text.property.transform":"변형","text.property.decoration":"장식","text.clip.property.title":"텍스트 클립","text.shadow.property.title":"텍스트 그림자","text.fill.property.title":"텍스트 채우기","text.fill.property.fill":"채우기","text.fill.property.stroke":"윤곽선","text.fill.property.strokeWidth":"윤곽선 굵기","transform.property.title":"변형","transform.origin.property.title":"변형 중심점","transition.property.title":"CSS 트랜지션","keyframe.property.title":"CSS 키프레임","selector.property.title":"CSS 셀렉터","selector.property.none":"선택자 없음","perspective.property.title":"원근","perspective.origin.property.title":"원근 중심점","svg.item.property.title":"SVG 아이템","svg.item.property.isMotionPath":"모션 패스","svg.item.property.fill":"채우기","svg.item.property.fillOpacity":"투명도","svg.item.property.path":"패스","svg.item.property.polygon":"폴리곤","svg.item.property.totalLength":"전체 길이","svg.item.property.fillRule":"채우기 규칙","svg.item.property.stroke":"선","svg.item.property.strokeWidth":"선 굵기","svg.item.property.dashArray":"점선 길이","svg.item.property.dashOffset":"점선 위치","svg.item.property.lineCap":"선 모양","svg.item.property.lineJoin":"겹친 선","svg.item.property.filter":"필터","border.editor.all":"전체","border.editor.width":"크기","border.editor.style":"스타일","border.editor.color":"색","border.editor.top":"위","border.editor.left":"왼쪽","border.editor.right":"오른쪽","border.editor.bottom":"아래","border.radius.editor.topLeft":"왼쪽 위","border.radius.editor.topRight":"오른쪽 위","border.radius.editor.bottomLeft":"왼쪽 아래","border.radius.editor.bottomRight":"오른쪽 아래","boxshadow.editor.blur":"흐림","boxshadow.editor.spread":"길이","css.property.editor.properties":"속성","offset.path.list.editor.path":"패스","offset.path.list.editor.totalLength":"전체 길이","offset.path.list.editor.distance":"거리","offset.path.list.editor.direction":"방향","offset.path.list.editor.rotate":"회전","svgfilter.select.editor.message.create":"새로운 SVG Filter 를 만드세요.","svgfilter.select.editor.message.select":"필터를 선택하세요.","fill.editor.message.click.image":"이미지를 선택하고 싶으면 프리뷰 영역을 클릭하세요.","fill.editor.message.drag.position":"가운데 위치를 드래그 해보세요.","fill.editor.x1":"시작 X","fill.editor.x2":"끝 X","fill.editor.y1":"시작 Y","fill.editor.y2":"끝 Y","fill.editor.spread":"확산","fill.editor.offset":"위치","fill.editor.cx":"중심점 X","fill.editor.cy":"중심점 Y","fill.editor.r":"끝 반지름","fill.editor.fx":"시작 X","fill.editor.fy":"시작 Y","fill.editor.fr":"시작 반지름","perspective.origin.editor.originX":"중심점 X","perspective.origin.editor.originY":"중심점 Y","path.manager.msg":"편집을 종료할 때는 ESC 키나 Enter 키를 누르세요. 또는 화면을 클릭하시면 됩니다.","path.manager.mode.modify":"점 편집","path.manager.mode.path":"점 추가","path.manager.mode.transform":"변형","path.manager.mode.flipX":"X축 회전","path.manager.mode.flipY":"Y축 회전","path.manager.mode.flipOrigin":"전체 회전","colorpicker.popup.title":"색상 선택","selector.popup.title":"선택자 속성","selector.popup.selector":"선택자","background.image.position.popup.title":"배경 패턴","background.image.position.popup.size":"크기","background.image.position.popup.width":"넓이","background.image.position.popup.height":"높이","background.image.position.popup.repeat":"반복","background.image.position.popup.blend":"블렌드","background.image.position.popup.type.repeat":"반복","background.image.position.popup.type.no-repeat":"반복 안함","background.image.position.popup.type.repeat-x":"x축 반복","background.image.position.popup.type.repeat-y":"y축 반복","background.image.position.popup.type.space":"공백유지","background.image.position.popup.type.round":"반올림","gradient.picker.popup.title":"그라디언트와 이미지","image.asset.property.title":"이미지","color.asset.property.title":"색","gradient.asset.property.title":"그라디언트","pattern.asset.property.title":"패턴","svgfilter.asset.property.title":"SVG 필터","inspector.tab.title.style":"스타일 속성","inspector.tab.title.component":"컴포넌트 속성","inspector.tab.title.transition":"트랜지션과 애니메이션 속성","inspector.tab.title.asset":"에셋 관리자","inspector.tab.title.text":"텍스트","inspector.tab.title.code":"코드","timeline.property.title":"타임라인","timeline.animation.property.title":"애니메이션","timeline.play.control.play":"플레이","timeline.play.control.pause":"멈춤","timeline.play.control.first":"처음으로","timeline.play.control.prev":"이전으로","timeline.play.control.next":"다음으로","timeline.play.control.last":"마지막으로","timeline.play.control.direction":"방향","timeline.play.control.speed":"속력","timeline.play.control.repeat":"반복","timeline.play.control.infinite":"무한","timeline.play.control.normal":"normal","timeline.play.control.alternate":"alternate","timeline.play.control.reverse":"reverse","timeline.play.control.alternate.reverse":"alternate reverse","timeline.value.editor.value":"값","timeline.value.editor.time":"시간","timeline.value.editor.timing":"타이밍 함수","svgfilter.popup.title":"SVG 필터","css.item.rotate":"회전","css.item.rotateX":"X축 회전","css.item.rotateY":"Y축 회전","css.item.rotateZ":"Z축 회전","css.item.rotate3d":"3D 회전","css.item.skewX":"X축 늘이기","css.item.skewY":"Y축 늘이기","css.item.translate":"이동","css.item.translateX":"X축 이동","css.item.translateY":"Y축 이동","css.item.translateZ":"Z축 이동","css.item.translate3d":"3D 이동","css.item.perspective":"원근","css.item.scale":"크기변경","css.item.scaleX":"X축 크기변경","css.item.scaleY":"Y축 크기변경","css.item.scaleZ":"Z축 크기변경","css.item.scale3d":"3D 크기변경","css.item.matrix":"변환 행렬","css.item.matrix3d":"3D 변환 행렬","animation.property.title":"CSS 애니메이션","animation.property.direction":"방향","animation.property.play.state":"플레이 상태","animation.property.fill.mode":"채우기 모드","animation.property.delay":"대기시간","animation.property.duration":"시간","animation.property.iteration.count":"반복 횟수","animation.property.select a keyframe":"키프레임을 선택해주세요","animation.property.popup.title":"CSS 애니메이션","animation.property.popup.timing.function":"타이밍 함수","animation.property.popup.keyframe":"키프레임","animation.property.popup.direction":"방향","animation.property.popup.play.state":"플레이 상태","animation.property.popup.fill.mode":"채우기 모드","animation.property.popup.delay":"대기시간","animation.property.popup.duration":"시간","animation.property.popup.iteration":"반복 횟수","animation.property.popup.normal":"시간순","animation.property.popup.reverse":"역시간순","animation.property.popup.alternate":"왕복 시간순","animation.property.popup.alternate-reverse":"왕복 역시간순","animation.property.popup.none":"none","animation.property.popup.forwards":"forwards","animation.property.popup.backwards":"backwards","animation.property.popup.both":"both","animation.property.popup.Select a keyframe":"키프레임을 선택해주세요.","keyframe.popup.title":"키프레임","code.view.property.title":"코드뷰","svg.filter.editor.tab.filter":"필터","svg.filter.editor.tab.preset":"프리셋","svg.filter.editor.tab.asset":"에셋","svg.filter.editor.GRAPHIC REFERENCES":"참조 그래픽","svg.filter.editor.SOURCES":"원본","svg.filter.editor.MODIFIER":"수정","svg.filter.editor.LIGHTING":"빛","svg.filter.editor.COMBINERS":"결합","svg.filter.editor.Template":"템플릿","layout.property.title":"레이아웃","layout.property.flex":"플렉스 박스","layout.property.grid":"그리드","layout.property.default":"기본 좌표","flex.layout.editor.row":"행","flex.layout.editor.column":"열","flex.layout.editor.row-reverse":"역방향 행","flex.layout.editor.column-reverse":"역방향 열","flex.layout.editor.nowrap":"감싸지 않기","flex.layout.editor.wrap":"감싸기","flex.layout.editor.wrap-reverse":"역방향 감싸기","flex.layout.editor.flex-start":"시작","flex.layout.editor.flex-end":"끝","flex.layout.editor.center":"중간","flex.layout.editor.space-between":"공간 중간 채움","flex.layout.editor.space-around":"공간 양끝 채움","flex.layout.editor.baseline":"기본선","flex.layout.editor.stretch":"펼치기","flex.layout.editor.direction":"방향","flex.layout.editor.justify-content":"컨텐츠 조정","flex.layout.editor.align-items":"아이템 정렬","flex.layout.editor.align-content":"컨텐츠 정렬","flex.layout.item.property.title":"플렉스 아이템 설정","flex.layout.item.property.grow":"공간 비율","flex.layout.item.property.shrink":"축소 비율","flex.layout.item.property.basis":"초기 크기","flex.layout.item.property.none":"없음","flex.layout.item.property.auto":"자동","flex.layout.item.property.value":"값","grid.layout.editor.template.columns":"열","grid.layout.editor.column.gap":"열 간격","grid.layout.editor.template.rows":"행","grid.layout.editor.row.gap":"행 간격","grid.box.editor.box.title":"영역","grid.box.editor.type":"타입","grid.box.editor.repeat":"반복","grid.box.editor.length":"길이","grid.box.editor.none":"없음","grid.box.editor.auto":"자동","grid.box.editor.count":"개수","grid.box.editor.value":"크기","grid.layout.item.property.title":"그리드 아이템 설정","grid.layout.item.property.column":"열","grid.layout.item.property.row":"행","grid.layout.item.property.start":"시작","grid.layout.item.property.End":"끝","grid.layout.item.property.none":"없음","grid.layout.item.property.value":"값","box.model.property.title":"박스 모델","box.model.property.margin":"마진","box.model.property.padding":"패딩","component.items.canvas":"캔버스","component.items.layer":"레이어","component.items.3dlayer":"3D 레이어","component.items.drawing":"그리기","component.items.custom":"사용자 정의 컴포넌트","svg.text.property.title":"SVG Text 스타일","svg.text.property.textarea":"텍스트 입력","svg.text.property.size":"폰트 크기","svg.text.property.weight":"폰트 굵기","svg.text.property.style":"폰트 스타일","svg.text.property.anchor":"텍스트 위치","svg.text.property.family":"폰트 글꼴","svg.text.property.length.adjust":"길이 대응","svg.text.property.text.length":"텍스트 길이","svg.text.property.start.offset":"시작 지점","fill.picker.popup.title":"색 채우기","gradient.editor.drag.message":"드래그 하면 중심점을 옮길 수 있습니다.","draw.manager.tolerance":"포인트 허용 오차","pattern.property.title":"패턴","pattern.info.popup.title":"패턴 정보","pattern.info.popup.width":"넓이","pattern.info.popup.height":"높이","pattern.info.popup.lineWidth":"선 넓이","pattern.info.popup.lineHeight":"선 높이","pattern.info.popup.rotate":"회전","pattern.info.popup.blend":"블렌드","pattern.info.popup.foreColor":"패턴색","pattern.info.popup.backColor":"배경색"}},ho={locales:yo,get:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en_US",r=yo[n][t]||yo.en_US[t]||t||void 0;if(G(r))return r(e);var o=r;return t===o?t.split(".").pop():(C(e,(function(t,e){o=o.replace(new RegExp("{".concat(t,"}"),"ig"),e)})),o)},hasKey:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en_US";return!(!yo[e][t]&&!yo.en_US[t])}},vo={dark:{left_size:250,left_max_size:400,timeline_grid_font_color:"#ececec",timeline_line_color:"red",timeline_timeview_bottom_color:"black"},light:{left_size:250,left_max_size:400,timeline_grid_font_color:"black",timeline_line_color:"#4778d4",timeline_timeview_bottom_color:"#ececec"},gray:{left_size:250,left_max_size:400,timeline_grid_font_color:"black",timeline_line_color:"#4778d4",timeline_timeview_bottom_color:"#ececec"}};function bo(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return Po(this,t),this.ref=new Proxy(this,{get:function(t,e){var n=t[e];return G(n)?function(){for(var e=arguments.length,r=new Array(e),o=0;o0&&void 0!==arguments[0]?arguments[0]:"";return this.json.id+t}},{key:"recover",value:function(){}},{key:"setCache",value:function(){}},{key:"is",value:function(){if(!this.json)return!1;for(var t=arguments.length,e=new Array(t),n=0;n-1}},{key:"isNot",value:function(){return!1===this.is.apply(this,arguments)}},{key:"convert",value:function(t){var e=this;return t.layers.forEach((function(t){t.parent=e.ref})),t}},{key:"checkField",value:function(t,e){return!0}},{key:"toCloneObject",value:function(){return{itemType:this.json.itemType,elementType:this.json.elementType,type:this.json.type,visible:this.json.visible,lock:this.json.lock,selected:this.json.selected,layers:this.json.layers.map((function(t){return t.clone()}))}}},{key:"clone",value:function(){var t=new(0,this.constructor)(this.toCloneObject());return t.parent=this.json.parent,t}},{key:"reset",value:function(e){e instanceof t&&(e=e.toJSON()),this.json=this.convert(jo({},this.json,{},e))}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=jt();return jo({id:e,visible:!0,lock:!1,selected:!1,layers:[]},t)}},{key:"add",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"self";if(t.parent&&t.remove(),"self"===n)this.json.layers.push(t),t.parent=this.ref;else if("before"===n){t.parent=this.parent.ref;var r=[];this.parent.layers.forEach((function(n){n===e.ref&&r.push(t),r.push(n)})),this.parent.layers=r}else"after"===n&&(t.parent=this.parent.ref,r=[],this.parent.layers.forEach((function(n){r.push(n),n===e.ref&&r.push(t)})),this.parent.layers=r);return t}},{key:"toggle",value:function(t,e){A(e)?this.json[t]=!this.json[t]:this.json[t]=!!e}},{key:"expectJSON",value:function(t){return"parent"!==t&&""!==this.json[t]}},{key:"toJSON",value:function(){var t=this,e=this.json,n={};return Object.keys(e).filter((function(e){return t.expectJSON(e)})).forEach((function(t){n[t]=e[t]})),n}},{key:"resize",value:function(){}},{key:"copy",value:function(){return this.json.parent.copyItem(this.ref)}},{key:"copyItem",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=t.clone();n.x.add(e),n.y.add(e);for(var r=this.json.layers,o=-1,i=0,a=r.length;i-1&&this.json.layers.splice(o+1,0,n),n}},{key:"remove",value:function(){this.json.parent.removeItem(this.ref)}},{key:"removeItem",value:function(t){for(var e=this.json.layers,n=-1,r=0,o=e.length;r-1&&this.json.layers.splice(n,1)}},{key:"hasParent",value:function(t){var e=this.json.parent.id===t;return e||!1!==this.json.parent.is("project")?e:this.json.parent.hasParent(t)}},{key:"getIndex",value:function(){for(var t=-1,e=0,n=this.json.parent.layers.length;e-1&&this.setOrder(t+1)}},{key:"orderPrev",value:function(){var t=this.getIndex();t>0&&this.setOrder(t-1)}},{key:"orderFirst",value:function(){this.setOrder(0)}},{key:"orderLast",value:function(){this.setOrder(this.json.parent.layers.length-1)}},{key:"searchById",value:function(t){if(this.id===t)return this.ref;for(var e=0,n=this.layers.length;e0&&void 0!==arguments[0]?arguments[0]:{};return To({selected:!1,layers:[]},t)}},{key:"isAttribute",value:function(){return!0}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return q(this.toCSS())}}])&&Vo(n.prototype,r),o&&Vo(n,o),e}(Eo);function Bo(t){return(Bo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zo(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Fo(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:[];return B(n)&&(n=[n]),e.filter(t,(function(t){return!1===n.includes(t.type)}))}},{key:"filter",value:function(t,n){return e.join(e.parseStyle(t).filter((function(t){return n(t)})))}},{key:"replace",value:function(t,n){var r=e.parseStyle(t),o=r.find((function(t){return t.type===n.type}));return o?o.value=n.value:r.push(n),e.join(r)}},{key:"replaceAll",value:function(t,n){for(var r=e.parseStyle(t),o=e.parseStyle(n),i=0,a=o.length;i0&&void 0!==arguments[0]?arguments[0]:{};return Wo(Uo(e.prototype),"getDefaultObject",this).call(this,Ho({itemType:"transform",type:"",value:[]},t))}},{key:"toCloneObject",value:function(){return Ho({},Wo(Uo(e.prototype),"toCloneObject",this).call(this),{value:JSON.parse(JSON.stringify(this.json.value))})}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value.join(", ")||"",")")}},{key:"convert",value:function(t){return(t=Wo(Uo(e.prototype),"convert",this).call(this,t)).type.includes("matrix")||t.type.includes("scale")?t.value=t.value.map((function(t){return rn.number(t)})):t.value=t.value.map((function(t){return rn.parse(t)})),t}},{key:"hasNumberValue",value:function(){var t=this.json.type;return t.includes("matrix")||t.includes("scale")}}])&&No(n.prototype,r),o&&No(n,o),e}(Mo);function Qo(t){return(Qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ti(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ei(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);ethis.screenX2.value||t.y.value>this.screenY2.value)}},{key:"toBoundCSS",value:function(){var t=this.json,e=t.x;return{top:t.y,left:e,width:t.width,height:t.height,transform:t.transform,"transform-origin":t["transform-origin"]}}},{key:"move",value:function(t,e){return this.reset({x:t,y:e}),this}},{key:"moveX",value:function(t){return this.reset({x:t}),this}},{key:"moveY",value:function(t){return this.reset({y:t}),this}},{key:"resize",value:function(t,e){return t.value>=0&&e.value>=0&&this.reset({width:t,height:e}),this}},{key:"resizeWidth",value:function(t){return t.value>=0&&this.reset({width:t}),this}},{key:"resizeHeight",value:function(t){return t.value>=0&&this.reset({height:t}),this}},{key:"getTransform",value:function(t){var e=Jo.parseStyle(un.create(t).css("transform")),n=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];if(!e.length)return{rotate:{x:0,y:0,z:0},translate:{x:0,y:0,z:0}};var r,o,i=(n=e[0].value.map((function(t){return+t})))[0],a=(n[1],n[2]),c=(n[3],n[4]),u=n[5],s=(n[6],n[7],n[8]),l=n[9],f=n[10],p=(n[11],n[12]),y=n[13],h=n[14],d=(n[15],Math.asin(-s));return 0!==Math.cos(d)?(r=Math.atan2(l,f),o=Math.atan2(c,i)):(r=Math.atan2(a,u),o=0),{rotate:{x:r,y:d,z:o},translate:{x:p,y:y,z:h}}}},{key:"verties",value:function(t,e){for(var n=t.offsetRect(),r=n.height,o=n.width/2,i=r/2,a={a:{x:-o,y:-i,z:0},b:{x:o,y:-i,z:0},c:{x:o,y:i,z:0},d:{x:-o,y:i,z:0}},c=this.getTransform(t.el);t.el&&(c=this.getTransform(t.el),a.a=ut.addVector(ut.rotateVector(a.a,c.rotate),c.translate),a.b=ut.addVector(ut.rotateVector(a.b,c.rotate),c.translate),a.c=ut.addVector(ut.rotateVector(a.c,c.rotate),c.translate),a.d=ut.addVector(ut.rotateVector(a.d,c.rotate),c.translate),(t=t.parent()).el!==e););return a}},{key:"checkInAreaForLayers",value:function(t){var e=[];return this.layers.forEach((function(n){e.push.apply(e,ei(n.checkInAreaForLayers(t))),n.checkInArea(t)&&e.push(n)})),e}},{key:"isAbsolute",get:function(){return"absolute"===this.json.position}},{key:"isRelative",get:function(){return"relative"===this.json.position}},{key:"isChild",get:function(){return!(!this.json.parent||!1!==this.json.parent.is("project")||!this.isAbsolute)}},{key:"screenX",get:function(){return this.isChild?rn.px(this.json.parent.screenX.value+this.json.x.value):this.json.x||rn.px(0)}},{key:"screenY",get:function(){return this.isChild?rn.px(this.json.parent.screenY.value+this.json.y.value):this.json.y||rn.px(0)}},{key:"screenX2",get:function(){return rn.px(this.screenX.value+this.json.width.value)}},{key:"screenY2",get:function(){return rn.px(this.screenY.value+this.json.height.value)}},{key:"screenWidth",get:function(){return this.json.width}},{key:"screenHeight",get:function(){return this.json.height}},{key:"screenRect",get:function(){return{left:this.screenX,top:this.screenY,width:this.screenWidth,height:this.screenHeight}}},{key:"centerX",get:function(){var t=0;return 0!=this.json.width.value&&(t=Math.floor(this.json.width.value/2)),rn.px(this.screenX.value+t)}},{key:"centerY",get:function(){var t=0;return 0!=this.json.height.value&&(t=Math.floor(this.json.height.value/2)),rn.px(this.screenY.value+t)}},{key:"transformOrigin",get:function(){var t=ti((this.json["transform-origin"]||"50% 50%").split(" ").map((function(t){return rn.parse(t||"50%")})),2),e=t[0],n=t[1];return{left:e=e.toPx(this.screenWidth.value),top:n=n.toPx(this.screenHeight.value)}}},{key:"screenTransform",get:function(){return Jo.addTransform(this.json.parent.screenTransform,this.json.transform)}}])&&ii(n.prototype,r),o&&ii(n,o),e}(Eo);function fi(t){return(fi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pi(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function yi(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return yi({selected:!1,layers:[]},t)}}])&&vi(n.prototype,r),o&&vi(n,o),e}(li);function Oi(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1;return rn.px(t).round(e)};function Si(t,e){var n=[];return t.layers.length&&t.layers.forEach((function(t){n.push.apply(n,ki(Si(t,e)))})),e.id?n.push(t):e.includes(t.id)&&n.push(t),n}var Pi=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.project=null,this.artboard=null,this.items=[],this.itemKeys={},this.colorsteps=[]}var e,n,r;return e=t,(n=[{key:"initialize",value:function(){this.colorsteps=[],this.items=[],this.itemKeys={}}},{key:"getRootItem",value:function(t){var e=t||this.currentArtboard;return t&&(t.is("artboard")?e=t:t.parent&&(e=t.parent)),e}},{key:"selectColorStep",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:null;return L(t)?Si(this.artboard,t):B(t)||F(t)?Si(this.artboard,[t]):this.items}},{key:"selectById",value:function(t){this.select.apply(this,ki(Si(this.artboard,t)))}},{key:"addById",value:function(t){this.itemKeys[t]||this.select.apply(this,ki(this.items).concat(ki(Si(this.artboard,t))))}},{key:"removeById",value:function(t){this.select.apply(this,ki(this.items.filter((function(e){return e.id!=t}))))}},{key:"toggleById",value:function(t){this.itemKeys[t]?this.removeById(t):this.addById(t)}},{key:"setRectCache",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.cachedItems=this.items.map((function(e){return t&&e.setCache(),e.clone()})),this.setAllRectCache()}},{key:"setAllRectCache",value:function(){var t=Number.MAX_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,r=Number.MIN_SAFE_INTEGER;this.cachedItems.forEach((function(o){t=Math.min(o.screenX.value,t),e=Math.min(o.screenY.value,e),n=Math.max(o.screenX2.value,n),r=Math.max(o.screenY2.value,r)})),t===Number.MAX_SAFE_INTEGER&&(t=0),e===Number.MAX_SAFE_INTEGER&&(e=0),n===Number.MIN_SAFE_INTEGER&&(n=0),r===Number.MIN_SAFE_INTEGER&&(r=0),this.allRect=new wi({x:rn.px(t),y:rn.px(e),width:rn.px(n-t),height:rn.px(r-e)})}},{key:"each",value:function(t){var e=this;G(t)&&this.items.forEach((function(n,r){t(n,e.cachedItems[r])}))}},{key:"reset",value:function(t){this.each((function(e){return e.reset(t)}))}},{key:"resetCallback",value:function(t){this.each((function(e){return e.reset(t(e))}))}},{key:"resize",value:function(){this.each((function(t){return t.resize()}))}},{key:"remove",value:function(){this.each((function(t){return t.remove()})),this.empty()}},{key:"copy",value:function(){this.copyItems=this.items.map((function(t){return t}))}},{key:"paste",value:function(){this.select.apply(this,ki(this.copyItems.map((function(t){return t.copy()})))),this.copy()}},{key:"isInParent",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=t,r=n.parent,o=!n.is("artboard")&&e.includes(r);!o&&!A(r);)n=r,r=r.parent,o=!n.is("artboard")&&e.includes(r);return o}},{key:"move",value:function(t,e){var n=this;this.each((function(r,o){n.isInParent(r,n.items)||r.move(ji(o.x.value+t),ji(o.y.value+e))})),this.reselect()}},{key:"moveRight",value:function(t){this.each((function(e,n){e.resizeWidth(ji(n.width.value+t))}))}},{key:"moveLeft",value:function(t){this.each((function(e,n){n.width.value-t>=0&&(e.moveX(ji(n.x.value+t)),e.resizeWidth(ji(n.width.value-t)))}))}},{key:"moveBottom",value:function(t){this.each((function(e,n){e.resizeHeight(ji(n.height.value+t))}))}},{key:"moveTop",value:function(t){this.each((function(e,n){n.height.value-t>=0&&(e.moveY(ji(n.y.value+t)),e.resizeHeight(ji(n.height.value-t)))}))}},{key:"current",get:function(){return this.items[0]}},{key:"currentProject",get:function(){return this.project}},{key:"currentArtboard",get:function(){return this.artboard}},{key:"isEmpty",get:function(){return!this.length}},{key:"length",get:function(){return this.items.length}},{key:"isRelative",get:function(){return"relative"===(this.items[0]||{}).position}}])&&Oi(e.prototype,n),r&&Oi(e,r),t}();function xi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $i(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];xi(this,t),this.components={}}var e,n,r;return e=t,(n=[{key:"registerComponent",value:function(t,e){this.components[t]=e}},{key:"getComponentClass",value:function(t){return this.components[t]||this.components.rect}},{key:"createComponent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getComponentClass(t);if(!n)throw new Error("".concat(t," type is not valid."));return new n(e)}}])&&$i(e.prototype,n),r&&$i(e,r),t}());function _i(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:"keydown",r=this.checkShortCut(this.makeKeyString(t));if(r){var o=r.filter((function(t){return t.eventType===n})).filter((function(t){return e.checkWhen(t)}));o.length&&t.preventDefault(),o.forEach((function(t){e.$editor.emit(t.command,t.args)}))}}}])&&Di(e.prototype,n),r&&Di(e,r),t}();function Ii(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],r=e.split("data:"),o=zi(r,2),i=(o[0],o[1]),a=i.split(","),c=Bi(a),u=c[0],s=c.slice(1),l=u.split(";"),f=zi(l,2),p=f[0],y=f[1];return s=s.join(","),{mimeType:p,local:n&&t.getLink(p,y,s)}}},{key:"getLink",value:function(t,e,n){if("base64"===e){for(var r=atob(n),o=r.length,i=new Uint8Array(o),a=0;a1&&void 0!==arguments[1]&&arguments[1];t.emit("noneSelectMenu"),e?t.emit("refreshSelectionStyleView"):t.emit("refreshAll"),t.emit("refreshAllElementBoundSize"),t.emit("refreshSelection"),t.emit("refreshSelectionTool")}function Ki(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Wi(t,e){for(var n=0;nc&&(n[a].mark=!0,t.DouglasPeuker(e,n,r,a),t.DouglasPeuker(e,n,a,o))}}},{key:"simply",value:function(e,n){return e.length<=2?e:((e=X(e))[0].mark=!0,e[e.length-1].mark=!0,t.DouglasPeuker(n,e,0,e.length-1),e.filter((function(t){return Boolean(t.mark)})))}},{key:"segmentDistance2",value:function(t,e,n,r){var o=r.x-n.x,i=r.y-n.y,a=o*o+i*i,c=t-n.x,u=e-n.y,s=o*c+i*u;if(0===a)return c*c+u*u;if(s<=0)return c*c+u*u;if(s>=a)return(c=t-r.x)*c+(u=e-r.y)*u;var l=c*i-u*o;return l*l/a}},{key:"isInLine",value:function(t,e,n){return t.x===n.x?e.x===n.x:t.y===n.y?e.y===n.y:(t.x-n.x)*(t.y-n.y)==(n.x-e.x)*(n.y-e.y)}},{key:"isLine",value:function(e){return t.isInLine(e.endPoint,e.startPoint,e,reversePoint)}},{key:"getReversePoint",value:function(t,e){var n=t.x-e.x,r=t.y-e.y;return{x:t.x+n,y:t.y+r}}},{key:"getIndexPoint",value:function(t,e){return t[e]}},{key:"getPoint",value:function(e,n){return e.filter((function(e){return t.isEqual(e.startPoint,n)}))[0]}},{key:"getIndex",value:function(e,n){for(var r=-1,o=0,i=e.length;o0;r--)if("M"===t[r].command){n=r;break}-1===n&&(n=0);var o=t[n];return o&&(o.index=n),o}},{key:"getPrevPoint",value:function(e,n){var r=n-1;if(r<0)return t.getLastPoint(e,n);var o=e[r];return o&&(o.index=r),o}},{key:"getNextPoint",value:function(e,n){var r=e[n],o=e[n+1];return o&&(o.index=n+1),r.connected&&(o=t.getFirstPoint(e,n)),o}},{key:"removePoint",value:function(t,e,n){if("startPoint"===n)return t.filter((function(t,n){return n!==e}))}}],(n=null)&&Wi(e.prototype,n),r&&Wi(e,r),t}();function Zi(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function qi(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:0,r=+e[n],o=+e[n+1];return[t[0][0]*r+t[0][1]*o+t[0][2],t[1][0]*r+t[1][1]*o+t[1][2],1]}},toPercent:function(t,e){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=+n[r],i=+n[r+1];return[o/t,i/e,1]}},toPixel:function(t,e){return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=+n[r],i=+n[r+1];return[o*t,i*e,1]}},translate:function(t,e){return this.multiply([[1,0,t],[0,1,e],[0,0,1]])},rotate:function(t){return this.multiply([[Math.cos(t),-Math.sin(t),0],[Math.sin(t),Math.cos(t),0],[0,0,1]])},rotateCenter:function(t,e,n){return this.multiply([[Math.cos(t),-Math.sin(t),-e*Math.cos(t)+n*Math.sin(t)+e],[Math.sin(t),Math.cos(t),-e*Math.sin(t)-n*Math.cos(t)+n],[0,0,1]])},scale:function(t,e){return this.multiply([[t,0,0],[0,e,0],[0,0,1]])},skewX:function(t){return this.multiply([[1,t,0],[0,1,0],[0,0,1]])},skewY:function(t){return this.multiply([[1,0,0],[t,1,0],[0,0,1]])},reflectionOrigin:function(){return this.multiply([[-1,0,0],[0,-1,0],[0,0,1]])},flipX:function(){return this.multiply([[1,0,0],[0,-1,0],[0,0,1]])},flipY:function(){return this.multiply([[-1,0,0],[0,1,0],[0,0,1]])}},ra=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";Ji(this,t),this.reset(e)}var e,n,r;return e=t,(n=[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.pathString=t,this.parse()}},{key:"resetSegments",value:function(t){this.segments=t||[],this.pathString=this.joinPath()}},{key:"trim",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.match(ea)||[];return e.filter((function(t){return""!=t}))}},{key:"parse",value:function(){var t=this,e=this.pathString.match(ta)||[];this.segments=e.map((function(e){var n=e[0];return{command:n,values:t.trim(e.replace(n,"")).map((function(t){return+t}))}})),this.segments=this.segments.map((function(e,n){switch(e.command){case"c":case"m":case"l":case"q":case"s":case"t":case"v":case"h":for(var r=t.segments[n-1],o=r.values[r.values.length-2],i=r.values[r.values.length-1],a=0,c=e.values.length;a1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map((function(n){return t.call(e,n)}));if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each((function(e){var n=e.values;switch(e.command){case"M":case"L":var r=t(n,0);e.values=[r[0],r[1]];break;case"V":r=t([+n[0],0]),e.values=[r[0]];break;case"H":r=t([0,+n[0]]),e.values=[r[1]];break;case"C":case"S":case"T":case"Q":for(var o=0,i=n.length;o0&&void 0!==arguments[0]?arguments[0]:[],n=new t,r=0,o=e.length;r1&&void 0!==arguments[1]?arguments[1]:[];return this.pathArray.push("".concat(t," ").concat(this.getPointString(e))),this}},{key:"M",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n0&&void 0!==arguments[0]?arguments[0]:"object";return('"))}},{key:"d",get:function(){return this.pathArray.join(" ").trim()}}])&&la(e.prototype,n),r&&la(e,r),t}();function pa(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ya(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:[];t.emit("updateResource",e)}},va={command:"updateImage",execute:function(t,e,n){var r=new FileReader;r.onload=function(r){var o=r.target.result,i=URL.createObjectURL(e);t.emit("addImageAssetItem",{id:jt(),type:e.type,name:e.name,original:o,local:i},n)},r.readAsDataURL(e)}};function ba(t,e){var n=new Image;n.onload=function(){var r={local:t.local,naturalWidth:rn.px(n.naturalWidth),naturalHeight:rn.px(n.naturalHeight),width:rn.px(n.naturalWidth),height:rn.px(n.naturalHeight)};e&&e(r,n)},n.src=t.local}function ga(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ma(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:{},r=t.selection.currentProject;r&&(r.createImage(e),t.emit("addImageAsset"),ba(e,(function(r){t.emit("addImage",ma({src:e.local},r,{},n)),t.changeMode(_l),t.emit("afterChangeMode")})))}};function ka(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ja(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Sa={command:"dropImageUrl",execute:function(t,e){ba({local:e},(function(e){t.emit("addImage",function(t){for(var e=1;e-1){var r=Xi.parse(n,!0);switch(r.mimeType){case"image/png":case"image/gif":case"image/jpg":case"image/jpeg":t.emit("addImageAssetItem",{id:jt(),type:r.mimeType,name:"",original:n,local:r.local})}}else{var o=e.data.split(".").pop(),i=e.data.split("/").pop();switch(o){case"png":case"jpg":case"gif":case"svg":t.emit("addImageAssetItem",{id:jt(),type:"image/"+o,name:i,original:e.data,local:e.data})}}}};function Ea(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"easylogic.json",n=document.createElement("a");n.href=t,n.download=e,n.click()}var _a={command:"downloadJSON",execute:function(t,e){var n=JSON.stringify(t.projects);Ea("data:application/json;base64,"+window.btoa(n),e||"easylogic.json")}};function Ca(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1&&void 0!==arguments[1]?arguments[1]:"anipa";switch(e){case"anipa":return new Ra(t).generateCode()}return""},Va={makeProjectStyle:function(t){var e=t.toKeyframeString(),n=t.toRootVariableCSS();return"\n :root {\n ".concat(q(n),"\n }\n /* keyframe */\n ").concat(e,"\n ")},makeStyle:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t.is("project"))return this.makeProjectStyle(t);var r=t.generateView("[data-id='".concat(t.id,"']"),n);return"\n ".concat(r,"\n ")+t.layers.map((function(t){return e.makeStyle(t)})).join("")},makeSvg:function(t){var e=t.toSVGString?t.toSVGString():"";return"\n ".concat(e?''.concat(e,""):"","\n ")},generate:function(t){var e=t.selection.currentProject,n=t.selection.currentArtboard,r="\n".concat(this.makeStyle(e),"\n").concat(this.makeStyle(n,"\n left: 0px;\n top: 0px;\n")),o="\n".concat(n.html,"\n").concat(this.makeSvg(e),"\n "),i=Da(n,"anipa");return{html:o=t.replaceLocalUrltoRealUrl(o),css:r=t.replaceLocalUrltoRealUrl(r),js:i=t.replaceLocalUrltoRealUrl(i)}},generateSVG:function(t,e){return t.replaceLocalUrltoRealUrl(e.generateSVG(!0))}},Aa={command:"downloadSVG",execute:function(t){var e=t.selection.current||t.$selection.currentArtboard,n=Va.generateSVG(t,e).trim();Ea("data:image/svg+xml;base64,"+window.btoa(n),e.id)}};var Ia={command:"downloadPNG",execute:function(t){var e=t.selection.current||t.selection.currentArtboard,n=Va.generateSVG(t,e).trim(),r="data:image/svg+xml;base64,"+window.btoa(n),o=e.id;ba({local:r},(function(t,e){!function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"image/png",r=un.create("canvas"),o=t.width,i=t.height;r.resize({width:o,height:i}),r.drawImage(t),e&&e(r.toDataURL(n))}(e,(function(t){Ea(t,o)}))}))}},La={command:"load.json",execute:function(t,e){var n=(e=e||t.loadResource("projects",[])).map((function(e){return function t(e,n){return n.layers=n.layers.map((function(n){return t(e,n)})),e.components.createComponent(n.itemType,n)}(t,e)}));if(n.forEach((function(t){t.artboards.forEach((function(t){t.selectTimeline()}))})),n.length){var r=n[0];if(t.selection.selectProject(r),r.artboards.length){var o=r.artboards[0];t.selection.selectArtboard(o),o.layers.length?t.selection.select(o.layers[0]):t.selection.select(o)}t.load(n),Ni(t)}else t.emit("addArtBoard")}};function Ma(t,e){var n=t.selection.currentArtboard;if(n){var r=n.getSelectedTimeline();e&&e(n,r)}}var Ba={command:"addTimelineProperty",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{timing:"linear"};Ma(t,(function(r,o){var i;!1===L(e)&&(e=[e]);var a=[];e.forEach((function(t){var e={layerId:t,property:n.property,value:n.value+"",timing:n.timing,editor:n.editor},o=r.addTimelineKeyframe(e);o&&a.push(o)})),(i=t.timeline).select.apply(i,a),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},za={command:"setTimelineOffset",debounce:100,execute:function(t,e){Ma(t,(function(n,r){n.setTimelineKeyframeOffsetValue(e.layerId,e.property,e.id,e.value,e.timing,e.time),t.emit("refreshTimeline")}))}},Fa={command:"addTimelineCurrentProperty",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Ma(t,(function(n,r){var o,i=[];t.selection.each((function(t){var r={layerId:t.id,property:e.property,value:t[e.property]+"",timing:e.timing,editor:e.editor},o=n.addTimelineKeyframe(r);o&&i.push(o)})),(o=t.timeline).select.apply(o,i),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Ga={command:"removeTimelineProperty",execute:function(t,e,n){Ma(t,(function(r,o){r.removeTimelineProperty(e,n),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Ha={command:"deleteTimelineKeyframe",execute:function(t){Ma(t,(function(e,n){t.timeline.each((function(t){e.deleteTimelineKeyframe(t.layerId,t.property,t.id)})),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Xa={command:"selectTimelineItem",execute:function(t,e){Ma(t,(function(n,r){n.selectTimeline(e),t.emit("refreshTimeline"),t.emit("selectTimeline")}))}},Ya={command:"removeTimeline",execute:function(t,e){Ma(t,(function(n,r){n.removeTimeline(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Na={command:"removeAnimationItem",execute:function(t,e){Ma(t,(function(n,r){n.removeAnimation(e),t.timeline.empty(),t.emit("refreshTimeline"),t.emit("removeAnimation")}))}},Ka={command:"addTimelineKeyframe",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timing:"linear"};Ma(t,(function(n,r){var o=n.searchById(e.layerId),i={layerId:e.layerId,property:e.property,time:e.time,value:o[e.property]+"",timing:e.timing,editor:e.editor},a=n.addTimelineKeyframe(i);t.timeline.select(a),t.emit("refreshTimeline"),t.emit("refreshSelectedOffset")}))}},Wa={command:"copyTimelineProperty",execute:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;Ma(t,(function(o,i){o.copyTimelineKeyframe(e,n,r),t.emit("refreshTimeline")}))}};function Ua(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Za(t,e){if(B(e)){var n=Ua(e.split(":"),4),r=n[0],o=n[1],i=n[2],a=n[3];return 3600*(r=parseInt(r,10))+60*(o=parseInt(o,10))+(i=parseInt(i,10))+(a=parseInt(a,10))*(1/t)}return H(e)?e/t:0}function qa(t,e){var n=Math.floor(e/3600),r=Math.floor(e/60%60),o=Math.floor(e%60),i=Math.round((e-Math.floor(e))*t);return i===t&&(i=0,60===(o+=1)&&60===(r+=1)&&(n+=1)),[n,r,o,i].map((function(t){return(t+"").padStart(2,"0")})).join(":")}function Ja(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return qa(t,Za(t,e)-Za(t,n))}function Qa(t){var e={id:0,start:0,speed:t.speed||1,elapsed:t.elapsed||0,duration:t.duration||0,iterationStartCount:1,iterationCount:t.iterationCount||Number.MAX_SAFE_INTEGER,direction:t.direction||"normal",log:[],logIndex:0,tick:t.tick||function(){},startCallback:t.start||function(){},endCallback:t.end||function(){},firstCallback:t.first||function(){},lastCallback:t.last||function(){}},n=function(t){return"normal"===e.direction||"reverse"!==e.direction&&("alternate"===e.direction?e.iterationStartCount%2==1:"alternate-reverse"===e.direction?e.iterationStartCount%2==0:void 0)?t:1-t},r=function(t){var r=!1;null===e.start&&(e.start=t,r=!0);var a=t-e.start;e.elapsed+=a*e.speed,e.start=t,e.elapsed>e.duration&&(e.elapsed=e.duration);var c=n(e.elapsed/e.duration)*e.duration;r&&e.startCallback(c,e),e.log[e.logIndex++]={elapsed:c,dt:e.lastTime-c},e.lastTime=c,e.tick(c,e),e.elapsed===e.duration?i():o()},o=function(){e.id=requestAnimationFrame(r)},i=function(){e.endCallback(e.elapsed,e),e.iterationStartCount++,e.iterationStartCount>e.iterationCount?(e.lastCallback(e.elapsed,e),cancelAnimationFrame(e.id)):(e.start=null,e.elapsed=0,o())},a=function(t){e.elapsed=t,e.tick(e.elapsed,e)};return{play:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.start=null,e.iterationStartCount=1,e.log=[],e.lastTime=0,e.logIndex=0,H(t.elapsed)&&(e.elapsed=t.elapsed),H(t.speed)&&(e.speed=t.speed),H(t.duration)&&(e.duration=t.duration),H(t.iterationCount)&&(e.iterationCount=t.iterationCount||Number.MAX_SAFE_INTEGER),B(t.direction)&&(e.direction=t.direction),G(t.tick)&&(e.tick=t.tick),G(t.start)&&(e.startCallback=t.start),G(t.end)&&(e.endCallback=t.end),G(t.first)&&(e.firstCallback=t.first),G(t.last)&&(e.lastCallback=t.last),e.firstCallback(e.elapsed,e),o()},stop:function(){cancelAnimationFrame(e.id)},tick:r,first:function(t){a(0)},last:function(t){a(e.duration)},seek:a,timer:e}}var tc={command:"playTimelineItem",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"normal";t.selection.empty(),t.emit("refreshSelection"),t.changeMode("play"),t.emit("afterChangeMode"),Ma(t,(function(o,i){var a=o.getSelectedTimelineLastTime();t.timer?t.timer.stop():t.timer=Qa({elapsed:1e3*i.currentTime,speed:e,duration:1e3*a,iterationCount:n,direction:r}),t.timer.play({duration:1e3*a,elapsed:1e3*i.currentTime,speed:e,iterationCount:n,direction:r,tick:function(e,n){o.seek(qa(i.fps,e/1e3)),t.emit("playTimeline")},last:function(e,n){t.emit("stopTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}})}))}},ec={command:"prevTimelineItem",execute:function(t){Ma(t,(function(e,n){var r=e.getSelectedTimelinePrevTime();e.setTimelineCurrentTime(qa(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},nc={command:"firstTimelineItem",execute:function(t){Ma(t,(function(e,n){var r=e.getSelectedTimelineFirstTime();e.setTimelineCurrentTime(qa(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},rc={command:"nextTimelineItem",execute:function(t){Ma(t,(function(e,n){var r=e.getSelectedTimelineNextTime();e.setTimelineCurrentTime(qa(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},oc={command:"lastTimelineItem",execute:function(t){Ma(t,(function(e,n){var r=e.getSelectedTimelineLastTime();e.setTimelineCurrentTime(qa(n.fps,r)),e.seek(),t.emit("playTimeline"),t.changeMode("SELECTION"),t.emit("afterChangeMode")}))}},ic={command:"addTimelineItem",execute:function(t){Ma(editor,(function(e,n){t?e.addTimelineLayer(t):e.addTimeline(),editor.emit("refreshTimeline"),editor.emit("addTimeline")}))}},ac={command:"drop.asset",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.color?t.emit("setAttribute",{"background-color":e.color},n):e.gradient?t.emit("addBackgroundImageGradient",e.gradient,n):e.imageUrl&&t.emit("addBackgroundImageAsset",e.imageUrl,n),Ni(t,!0)}};function cc(t){return(cc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function uc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sc(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return hc(dc(e.prototype),"getDefaultObject",this).call(this,sc({itemType:"image-resource",type:"image"},t))}},{key:"isGradient",value:function(){return!1}},{key:"isLinear",value:function(){return!1}},{key:"isRadial",value:function(){return!1}},{key:"isConic",value:function(){return!1}},{key:"isStatic",value:function(){return!1}},{key:"isImage",value:function(){return!1}},{key:"hasAngle",value:function(){return!1}},{key:"isUrl",value:function(){return!1}},{key:"isFile",value:function(){return!1}},{key:"isAttribute",value:function(){return!0}},{key:"toString",value:function(){return"none"}}])&&pc(n.prototype,r),o&&pc(n,o),e}(Mo);function gc(t){return(gc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wc(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"%",r=g(2,t),o=e/r,i=K(r).map((function(t,e){return"".concat(Fe.random()," ").concat(e*o).concat(n)})).join(",");return i}},{key:"createRepeatColorStep",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rn.px(1),n=g(2,t),r=K(n).map((function(t,n){return"".concat(Fe.random()," ").concat(rn.parse(e).mul(n+1))})).join(",");return r}}],(r=[{key:"getDefaultObject",value:function(){return Pc(xc(e.prototype),"getDefaultObject",this).call(this,{cut:!1,percent:0,unit:"%",px:0,em:0,color:"rgba(0, 0, 0, 0)",prevColorStep:null})}},{key:"toCloneObject",value:function(){return wc({},Pc(xc(e.prototype),"toCloneObject",this).call(this),{cut:this.json.cut,percent:this.json.percent,unit:this.json.unit,px:this.json.px,em:this.json.em,color:this.json.color})}},{key:"on",value:function(){this.json.cut=!0}},{key:"off",value:function(){this.json.cut=!1}},{key:"toggle",value:function(){this.json.cut=!this.json.cut}},{key:"getUnit",value:function(){return"%"==this.json.unit?"percent":this.json.unit}},{key:"add",value:function(t){var e=this.getUnit();return this.json[e]+=+t,this}},{key:"sub",value:function(t){var e=this.getUnit();return this.json[e]-=+t,this}},{key:"mul",value:function(t){var e=this.getUnit();return this.json[e]*=+t,this}},{key:"div",value:function(t){var e=this.getUnit();return this.json[e]/=+t,this}},{key:"mod",value:function(t){var e=this.getUnit();return this.json[e]%=+t,this}},{key:"toLength",value:function(t){return rn.parse(this.json)}},{key:"getPrevLength",value:function(){return this.json.prevColorStep?this.json.prevColorStep.toLength():""}},{key:"toString",value:function(){var t=this.json.cut?this.getPrevLength():"",e=this.json.color||"transparent";return"".concat(e," ").concat(t," ").concat(this.toLength())}},{key:"reset",value:function(t){Pc(xc(e.prototype),"reset",this).call(this,t),this.parent&&this.parent.sortColorStep()}},{key:"isPx",get:function(){return"px"==this.json.unit}},{key:"isPercent",get:function(){return"%"==this.json.unit||"percent"===this.json.unit}},{key:"isEm",get:function(){return"em"==this.json.unit}}])&&jc(n.prototype,r),o&&jc(n,o),e}(Eo);function _c(t){return(_c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Tc(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return"";var e=t.map((function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e}));return 1===e.length&&e.push(new Ec({color:e[0].color||"transparent",percent:100})),e.map((function(t){return"".concat(t)})).join(",")}}],(r=[{key:"isGradient",value:function(){return!0}},{key:"toString",value:function(){return"none"}},{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ic(Lc(e.prototype),"getDefaultObject",this).call(this,Tc({type:"gradient",colorsteps:[]},t))}},{key:"toCloneObject",value:function(){return Tc({},Ic(Lc(e.prototype),"toCloneObject",this).call(this),{colorsteps:this.json.colorsteps.map((function(t){return t.clone()}))})}},{key:"convert",value:function(t){return t.colorsteps=t.colorsteps.map((function(t){return new Ec(t)})),t}},{key:"calculateAngle",value:function(){var t=this.json.angle;return A(Bc[t])?t:Bc[t]||0}},{key:"addColorStep",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.json.colorsteps.push(t),e&&this.sortColorStep(),t}},{key:"insertColorStep",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rgba(216,216,216,0)",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(216,216,216,1)",r=this.colorsteps;if(r.length){if(te.percent?1:t.percente.index?1:-1:void 0})),t.forEach((function(t,e){t.index=100*e}))}},{key:"addColorStepList",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];e.forEach((function(e){t.addColorStep(e,!1)})),this.sortColorStep()}},{key:"getColorStep",value:function(t){return this.json.colorsteps.filter((function(e){return e.id==t}))[0]}},{key:"clear",value:function(){arguments.length?this.json.colorsteps.splice(+(arguments.length<=0?void 0:arguments[0]),1):this.json.colorsteps=[]}},{key:"removeColorStep",value:function(t){this.json.colorsteps=this.json.colorsteps.filter((function(e){return e.id!=t}))}},{key:"getColorString",value:function(){var t=this.colorsteps;return e.toColorString(t)}},{key:"colorsteps",get:function(){return this.json.colorsteps}}])&&Vc(n.prototype,r),o&&Vc(n,o),e}(bc);function Fc(t){return(Fc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Gc(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Hc(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Xc(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yc(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"transparent";return new e({colorsteps:[new Ec({color:t,percent:0,index:0}),new Ec({color:t,percent:100,index:1})]})}}],(r=[{key:"getDefaultObject",value:function(){return Kc(Wc(e.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new Ec({color:"red",percent:0,index:0}),new Ec({color:"red",percent:100,index:0})]})}},{key:"toCloneObject",value:function(){return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return iu(au(e.prototype),"getDefaultObject",this).call(this,Qc({type:"url",url:"",datauri:""},t))}},{key:"toCloneObject",value:function(){return Qc({},iu(au(e.prototype),"toCloneObject",this).call(this),{url:this.json.url,datauri:this.json.datauri})}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=this.json;return"url(".concat(t.url,")")}}],[{key:"parse",value:function(t){return new e({url:t.split("(")[1].split(")")[0]})}},{key:"isImageFile",value:function(t){return su.includes(t)}}]),e}(bc);function fu(t){return(fu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function pu(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e360?e%360:e,"deg")),"".concat(this.json.type,"(").concat(e,", ").concat(t,")")}}])&&bu(n.prototype,r),o&&bu(n,o),e}(zc);function Pu(t){return(Pu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $u(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Gu(Hu(e.prototype),"getDefaultObject",this).call(this,Mu({type:"radial-gradient",radialType:"ellipse",radialPosition:[en.CENTER,en.CENTER]},t))}},{key:"toCloneObject",value:function(){return Mu({},Gu(Hu(e.prototype),"toCloneObject",this).call(this),{radialType:this.json.radialType,radialPosition:X(this.json.radialPosition)})}},{key:"isRadial",value:function(){return!0}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t,e=this.getColorString(),n=this.json,r=n.radialType,o=n.radialPosition||["center","center"];return t=(o=Nu[o]?o:o.join(" "))?"".concat(r," at ").concat(o):r,"".concat(n.type||"radial-gradient","(").concat(t,", ").concat(e,")")}}])&&zu(n.prototype,r),o&&zu(n,o),e}(zc);function Wu(t){return(Wu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Uu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zu(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return fs(ps(e.prototype),"getDefaultObject",this).call(this,cs({type:"conic-gradient",angle:0,radialPosition:[en.CENTER,en.CENTER]},t))}},{key:"toCloneObject",value:function(){return cs({},fs(ps(e.prototype),"toCloneObject",this).call(this),{angle:this.json.angle,radialPosition:X(this.json.radialPosition)})}},{key:"isConic",value:function(){return!0}},{key:"hasAngle",value:function(){return!0}},{key:"getColorString",value:function(){if(0===this.colorsteps.length)return"";var t=this.colorsteps;return t?(t.sort((function(t,e){return t.percent==e.percent?0:t.percent>e.percent?1:-1})),t.map((function(e,n){return e.prevColorStep=e.cut&&n>0?t[n-1]:null,e})).map((function(t){var e=Math.floor(3.6*t.percent),n="";if(t.cut&&t.prevColorStep){var r=Math.floor(3.6*t.prevColorStep.percent);n="".concat(r,"deg")}return"".concat(t.color," ").concat(n," ").concat(e,"deg")})).join(",")):""}},{key:"toString",value:function(){var t=this.getColorString(),e=[],n=this.json,r=n.angle,o=n.radialPosition||en.CENTER;o=ds[o]?o:o.join(" "),I(r)&&(r=+(vs[r]||r),e.push("from ".concat(r,"deg"))),o&&e.push("at ".concat(o));var i=e.length?e.join(" ")+",":"";return"".concat(n.type,"(").concat(i," ").concat(t,")")}}])&&ss(n.prototype,r),o&&ss(n,o),e}(zc);function gs(t){return(gs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ms(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ws(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){var r=Bs.parseStyle(J(n["background-image"]));r.unshift(new Bs({image:Bs.parseImage(e)})),t.emit("setAttribute",{"background-image":Bs.join(r)},n.id)}))}},Fs={command:"addBackgroundImageAsset",execute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){var r=Bs.parseStyle(J(n["background-image"]));r.unshift(new Bs({image:new lu({url:e})}));var o=q(Bs.toPropertyCSS(r));t.emit("setAttribute",{"background-image":o},n.id)}))}},Gs={command:"item.move.left",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.selection.move(-1*n,0),t.emit("refresh"),Ni(t,!0)}},Hs={command:"item.move.right",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.selection.move(n,0),t.emit("refresh"),Ni(t,!0)}},Xs={command:"item.move.up",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.selection.move(0,-1*n),t.emit("refresh"),Ni(t,!0)}},Ys={command:"item.move.down",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.selection.move(0,n),t.emit("refresh"),Ni(t,!0)}};var Ns={command:"change.mode.view",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"CanvasView";t.changeModeView(e)}},Ks={command:"segment.move.down",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,n)}},Ws={command:"segment.move.up",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dy:1},n=+e.dy;t.emit("moveSegment",0,-1*n)}},Us={command:"segment.move.right",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",n,0)}},Zs={command:"segment.move.left",execute:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{dx:1},n=+e.dx;t.emit("moveSegment",-1*n,0)}},qs={command:"toggle.fullscreen",execute:function(t,e){un.body().fullscreen()}};function Js(t){return(Js="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qs(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return ul(sl(e.prototype),"getDefaultObject",this).call(this,nl({itemType:"pattern"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=kl[t.type];if(e)return new e(t)}},{key:"parseStyle",value:function(t){var n=[];if(!t)return n;var r=we(t);return(r.str.match(pl)||[]).forEach((function(t,o){var i=tl(t.split("("),2),a=i[0],c=i[1],u=tl((c=c.split(")")[0]).split(",").map((function(t){return t.trim()})),6),s=u[0],l=u[1],f=u[2],p=u[3],y=u[4],h=u[5],d=tl(s.split(" "),2),v=d[0],b=d[1],g=tl(l.split(" "),2),m=g[0],w=g[1],O=tl((h||"").split(" "),2),k=O[0],j=O[1];n[o]=e.parse({type:a,x:rn.parse(m),y:rn.parse(w),width:rn.parse(v),height:rn.parse(b),foreColor:ke(f,r.matches),backColor:ke(p,r.matches),blendMode:y||"normal",lineWidth:rn.parse(k||"1px"),lineHeight:rn.parse(j||"1px")})})),n}},{key:"join",value:function(t){return t.map((function(t){return e.parse(t)})).join(" ")}},{key:"toCSS",value:function(t){var n=[];return e.parseStyle(t).forEach((function(t){n.push.apply(n,Qs(Bs.parseStyle(J(t.toCSS()))))})),Bs.joinCSS(n)}}]),e}(Mo),hl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"base",x:rn.px(0),y:rn.px(0),width:rn.px(20),height:rn.px(20),lineWidth:rn.px(1),lineHeight:rn.px(1),foreColor:"black",backColor:"white",blendMode:"normal"})}},{key:"convert",value:function(t){return(t=ul(sl(e.prototype),"convert",this).call(this,t)).width=rn.parse(t.width),t.height=rn.parse(t.height),t.lineWidth=rn.parse(t.lineWidth),t.lineHeight=rn.parse(t.lineHeight),t.x=rn.parse(t.x),t.y=rn.parse(t.y),t}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.width,r=t.height,o=t.x,i=t.y,a=t.foreColor,c=t.backColor,u=t.blendMode,s=t.lineWidth,l=t.lineHeight;return"".concat(e,"(").concat(n," ").concat(r,", ").concat(o," ").concat(i,", ").concat(a,", ").concat(c,", ").concat(u,", ").concat(s," ").concat(l,")")}}]),e}(yl),dl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"check"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent","\n background-image: repeating-linear-gradient(45deg, ".concat(a=a||"black"," 25%, ").concat(i," 25%, ").concat(i," 75%, ").concat(a," 75%, ").concat(a," 100%),repeating-linear-gradient(45deg, ").concat(a," 25%, ").concat(i," 25%, ").concat(i," 75%, ").concat(a," 75%, ").concat(a," 100%);\n background-position: 0px 0px, ").concat(r," ").concat(o,";\n background-size: ").concat(e," ").concat(n,", ").concat(e," ").concat(n,";\n background-blend-mode: ").concat(c,", ").concat(c,";\n ")}}]),e}(hl),vl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"grid"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,o=t.lineHeight,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent","\n background-image: linear-gradient(".concat(a=a||"black"," ").concat(o,", ").concat(i," ").concat(o,"),linear-gradient(to right, ").concat(a," ").concat(r,", ").concat(i," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px, ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(c,", ").concat(c,"; \n ")}}]),e}(hl),bl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.lineWidth,o=(t.lineHeight,t.backColor),i=t.foreColor,a=t.blendMode;return o=o||"transparent","\n background-image: radial-gradient(".concat(i=i||"black"," ").concat(r,", ").concat(o," ").concat(r,");\n background-size: ").concat(e.value/2,"px ").concat(n.value/2,"px; \n background-blend-mode: ").concat(a,"; \n ")}}]),e}(hl),gl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"cross-dot"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=(t.lineHeight,t.backColor),c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: radial-gradient(".concat(c=c||"black"," ").concat(i,", ").concat(a," ").concat(i,"),radial-gradient(").concat(c," ").concat(i,", ").concat(a," ").concat(i,");\n background-size: ").concat(e," ").concat(n,",").concat(e," ").concat(n,";\n background-position: 0px 0px, ").concat(r," ").concat(o,"; \n background-blend-mode: multiply, ").concat(u,";\n ")}}]),e}(hl),ml=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"diagonal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.lineWidth,i=t.backColor,a=t.foreColor,c=t.blendMode;return i=i||"transparent",a=a||"black","\n background-image: repeating-linear-gradient(".concat(r,", ").concat(a," 0, ").concat(a," ").concat(o,", ").concat(i," 0, ").concat(i," 50%);\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(c,";\n ")}}]),e}(hl),wl=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"vertical-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=t.backColor,c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: repeating-linear-gradient(to right, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(i,", ").concat(a," ").concat(i,", ").concat(a," 100%);\n background-size: ").concat(e," ").concat(n,"; \n background-position: ").concat(r," ").concat(o,"; \n background-blend-mode: ").concat(u,";\n ")}}]),e}(hl),Ol=function(t){function e(){return ol(this,e),cl(this,sl(e).apply(this,arguments))}return ll(e,t),al(e,[{key:"getDefaultObject",value:function(){return ul(sl(e.prototype),"getDefaultObject",this).call(this,{type:"horizontal-line"})}},{key:"toCSS",value:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y,i=t.lineWidth,a=t.backColor,c=t.foreColor,u=t.blendMode;return a=a||"transparent","\n background-image: repeating-linear-gradient(0deg, ".concat(c=c||"black"," 0px, ").concat(c," ").concat(i,", ").concat(a," ").concat(i,", ").concat(a," 100%); \n background-position: ").concat(r," ").concat(o,";\n background-size: ").concat(e," ").concat(n,"; \n background-blend-mode: ").concat(u,";\n ")}}]),e}(hl),kl={check:dl,grid:vl,dot:bl,"cross-dot":gl,"diagonal-line":ml,"vertical-line":wl,"horizontal-line":Ol},jl={CheckPattern:dl,GridPattern:vl,DotPattern:bl,CrossDotPattern:gl,DiagonalLinePattern:ml,VerticalLinePattern:wl,HorizontalLinePattern:Ol};function Sl(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.itemsByIds(n);r.forEach((function(n){t.emit("setAttribute",{pattern:yl.join([].concat(Sl(yl.parseStyle(e)),Sl(yl.parseStyle(n.pattern))))},n.id)})),Ni(t,!0)}},toggleFullscreen:qs,segmentDelete:{command:"segment.delete",execute:function(t,e){t.emit("deleteSegment")}},segmentMoveDown:Ks,segmentMoveUp:Ws,segmentMoveRight:Us,segmentMoveLeft:Zs,changeModeView:Ns,addDrawBrush:function(t){t.selection.empty(),t.emit("initSelectionTool"),t.emit("showBrushDrawEditor")},addDrawPath:function(t){t.selection.empty(),t.emit("initSelectionTool"),t.emit("showPathDrawEditor")},itemDelete:{command:"item.delete",execute:function(t){t.selection.remove(),t.emit("refreshAllSelectArtBoard")}},itemMoveRight:Hs,itemMoveUp:Xs,itemMoveDown:Ys,itemMoveLeft:Gs,keymapKeydown:{command:"keymap.keydown",execute:function(t,e){t.shortcuts.execute(e,"keydown")}},keymapKeyup:{command:"keymap.keyup",execute:function(t,e){t.shortcuts.execute(e,"keyup")}},dropAsset:ac,addBackgroundImageAsset:Fs,addBackgroundImageGradient:zs,addTimelineItem:ic,pauseTimelineItem:{command:"pauseTimelineItem",execute:function(t){t.timer&&t.timer.stop()}},lastTimelineItem:oc,nextTimelineItem:rc,firstTimelineItem:nc,prevTimelineItem:ec,playTimelineItem:tc,copyTimelineProperty:Wa,addTimelineKeyframe:Ka,removeAnimationItem:Na,removeTimeline:Ya,selectTimelineItem:Xa,deleteTimelineKeyframe:Ha,removeTimelineProperty:Ga,addTimelineCurrentProperty:Fa,setTimelineOffset:za,refreshSelectedOffset:{command:"refreshSelectedOffset",execute:function(t){var e=t.timeline.items[0];e&&t.emit("refreshOffsetValue",e)}},addTimelineProperty:Ba,setLocale:{command:"setLocale",execute:function(t,e){t.setLocale(e),t.emit("changed.locale")}},loadJSON:La,saveJSON:{command:"saveJSON",execute:function(t){t.saveResource("projects",t.projects)}},downloadPNG:Ia,downloadSVG:Aa,downloadJSON:_a,updateUriList:$a,updateImageAssetItem:xa,addSVGFilterAssetItem:Pa,dropImageUrl:Sa,addImageAssetItem:Oa,updateImage:va,updateResource:{command:"updateResource",execute:function(t,e){e.forEach((function(n){switch(n.type){case"image/svg+xml":case"image/png":case"image/gif":case"image/jpg":case"image/jpeg":t.emit("updateImage",n);break;case"text/plain":case"text/html":e.length&&t.emit("addText",{content:n.data});break;case"text/uri-list":t.emit("updateUriList",n)}}))}},fileDropItems:da,updateScale:{command:"updateScale",execute:function(t,e){t.scale=e,t.emit("changeScale")}},showExportView:{command:"showExportView",execute:function(t){t.emit("showExportWindow")}},switchTheme:{command:"switchTheme",execute:function(t,e){t.changeTheme(e),t.emit("changeTheme")}},clipboardPaste:{command:"clipboard.paste",execute:function(t,e){t.selection.length&&(t.selection.paste(),t.emit("refreshAll"))}},clipboardCopy:{command:"clipboard.copy",title:"Copy",description:"Copy",execute:function(t,e){t.selection.copy()}},addComponentType:function(t,e){t.changeAddType(e),t.emit("afterChangeMode"),t.emit("addStatusBarMessage","Drag if you want to create ".concat(e," layer"))},addArtBoard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.selection.currentProject;n||(n=t.add(t.components.createComponent("project")),t.selection.selectProject(n));var r=n.add(t.components.createComponent("artboard",ia({x:rn.px(300),y:rn.px(200),width:rn.px(375),height:rn.px(667)},e)));t.selection.selectArtboard(r),t.selection.select(r),Ni(t)},addImage:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.emit("newComponent","image",e,e)},addLayer:function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e.selection.current||e.selection.currentArtboard;o?(o.enableHasChildren()||(o=o.parent),o.add(n),r.x&&n.setScreenX(r.x.value),r.y&&n.setScreenY(r.y.value),e.selection.select(n),Ni(e)):(e.emit("addArtBoard"),setTimeout((function(){t(e,n,r)}),50))},addPath:function(t){t.selection.empty(),t.emit("initSelectionTool"),t.emit("showPathEditor","path")},addProject:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.add(t.components.createComponent("project",ua({},e)));t.selection.selectProject(n),Ni(t)},convertPath:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=t.selection.current;if(r){if(r.is("svg-path","svg-brush","svg-textpath")){var o=e;if(n)(i=new ra(e)).scale(r.width.value/n.width,r.height.value/n.height),o=i.d;r.updatePathItem({d:o})}else if(r["clip-path"].includes("path")){var i;o=e;if(n)(i=new ra(e)).scale(r.width.value/n.width,r.height.value/n.height),o=i.d;r.reset({"clip-path":"path(".concat(o,")")})}t.emit("refreshElement",r)}},newComponent:function(t,e,n){e.includes("text")||(n["background-color"]=Fe.random()),"svg-textpath"===e?n=ya({},n,{text:"Insert a newText","font-size":rn.parse(n.height),textLength:"100%",d:fa.makeLine(0,n.height.value,n.width.value,n.height.value)}):"svg-circle"===e?(e="svg-path",n=ya({},n,{"background-color":void 0,d:fa.makeCircle(0,0,n.width.value,n.height.value)})):"svg-rect"===e?(e="svg-path",n=ya({},n,{"background-color":void 0,d:fa.makeRect(0,0,n.width.value,n.height.value)})):"text"===e&&(n=ya({},n,{content:"Insert a text",width:rn.px(300),height:rn.px(50),"font-size":rn.px(30)})),t.emit("addLayer",t.components.createComponent(e,ya({},n)),n),t.changeMode(_l),t.emit("afterChangeMode")},refreshElement:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t.emit("refreshSelectionStyleView",e,n,e&&!1===e.enableHasChildren()),!0===r&&t.emit("refreshElementBoundSize",t.selection.getRootItem(e))},resizeArtBoard:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t.selection.currentArtboard;if(n&&n.is("artboard")){if(!e.trim())return;var r=e.split("x"),o=Ki(r,2),i=o[0],a=o[1];i=rn.px(i),a=rn.px(a),n.reset({width:i,height:a}),t.selection.select(n),Ni(t)}},selectItem:function(t){t.changeMode(_l),t.emit("afterChangeMode")},setAttribute:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];t.selection.itemsByIds(n).forEach((function(n){Object.keys(e).forEach((function(t){var r=e[t];G(r)&&(r=r()),n.reset(Yi({},t,r))})),t.emit("refreshElement",n,r,o)}))}},xl=[{key:"1",command:"addComponentType",args:"rect",description:"Add rect layer",when:"CanvasView"},{key:"2",command:"addComponentType",args:"circle",description:"Add circle layer",when:"CanvasView"},{key:"3",command:"addComponentType",args:"text",description:"Add text layer",when:"CanvasView"},{key:"4",command:"addComponentType",args:"image",description:"Add image layer",when:"CanvasView"},{key:"5",command:"addComponentType",args:"cube",description:"Add cube layer",when:"CanvasView"},{key:"6",command:"addPath",description:"Add svg path",when:"CanvasView"},{key:"ArrowDown",command:"segment.move.down",description:"move 1px to down",args:{dy:1},when:"PathEditorView"},{key:"ArrowUp",command:"segment.move.up",description:"move 1px to up",args:{dy:1},when:"PathEditorView"},{key:"ArrowRight",command:"segment.move.right",description:"move 1px to right",args:{dx:1},when:"PathEditorView"},{key:"ArrowLeft",command:"segment.move.left",description:"move 1px to left",args:{dx:1},when:"PathEditorView"},{key:"Shift+ArrowDown",command:"segment.move.down",description:"move 10px to down",args:{dy:10},when:"PathEditorView"},{key:"Shift+ArrowUp",command:"segment.move.up",description:"move 10px to up",args:{dy:10},when:"PathEditorView"},{key:"Shift+ArrowLeft",command:"segment.move.left",description:"move 10px to left",args:{dx:10},when:"PathEditorView"},{key:"Shift+ArrowRight",command:"segment.move.right",description:"move 10px to right",args:{dx:10},when:"PathEditorView"},{key:"Alt+ArrowDown",command:"segment.move.down",description:"move 5px to down",args:{dy:5},when:"PathEditorView"},{key:"Alt+ArrowUp",command:"segment.move.up",description:"move 5px to up ",args:{dy:5},when:"PathEditorView"},{key:"Alt+ArrowLeft",command:"segment.move.left",description:"move 5px to left",args:{dx:5},when:"PathEditorView"},{key:"Alt+ArrowRight",command:"segment.move.right",description:"move 5px to right",args:{dx:5},when:"PathEditorView"},{key:"Backspace",command:"segment.delete",description:"Delete selected segment",when:"PathEditorView"},{key:"ArrowLeft",command:"item.move.left",description:"move 1px to left",args:{dx:1},when:"CanvasView"},{key:"ArrowRight",command:"item.move.right",description:"move 1px to right",args:{dx:1},when:"CanvasView"},{key:"ArrowDown",command:"item.move.down",description:"move 1px to down",args:{dy:1},when:"CanvasView"},{key:"ArrowUp",command:"item.move.up",description:"move 1px to up",args:{dy:1},when:"CanvasView"},{key:"Shift+ArrowDown",command:"item.move.down",description:"move 10px to down",args:{dy:10},when:"CanvasView"},{key:"Shift+ArrowRight",command:"item.move.right",description:"move 10px to right",args:{dx:10},when:"CanvasView"},{key:"Shift+ArrowUp",command:"item.move.up",description:"move 10px to up",args:{dy:10},when:"CanvasView"},{key:"Shift+ArrowLeft",command:"item.move.left",description:"move 10px to left",args:{dx:10},when:"CanvasView"},{key:"Alt+ArrowLeft",command:"item.move.left",description:"move 5px to left",args:{dx:5},when:"CanvasView"},{key:"Alt+ArrowDown",command:"item.move.down",description:"move 5px to down",args:{dy:5},when:"CanvasView"},{key:"Alt+ArrowRight",command:"item.move.right",description:"move 5px to right",args:{dx:5},when:"CanvasView"},{key:"Alt+ArrowUp",command:"item.move.up",description:"move 5px to up",args:{dy:5},when:"CanvasView"},{key:"Backspace",command:"item.delete",description:"Delete selected items",when:"CanvasView"},{key:"cmd+c",command:"clipboard.copy",description:"Copy objects",when:"CanvasView"},{key:"cmd+v",command:"clipboard.paste",description:"Paste selected objects",when:"CanvasView"}];function $l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function El(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};$l(this,t),this.config=new Mi(this),this.commands=new Ci(this),this.shortcuts=new Ai(this),this.selection=new Pi(this),this.timeline=new Oo(this),this.components=Ei,this.projects=[],this.popupZIndex=1e4,this.scale=1,this.symbols={},this.images={},this.openRightPanel=!0,this.mode=_l,this.modeView="CanvasView",this.addComponentType="",this.locale=this.loadItem("locale")||"en_US",this.$store=e.$store,this.initTheme(),this.loadCommands(),this.loadShortCuts()}var e,n,r;return e=t,(n=[{key:"loadCommands",value:function(){var t=this;Object.keys(Pl).forEach((function(e){G(Pl[e])?t.commands.registerCommand(e,Pl[e]):t.commands.registerCommand(Pl[e])}))}},{key:"loadShortCuts",value:function(){var t=this;xl.forEach((function(e){t.shortcuts.registerShortCut(e)})),this.shortcuts.sort()}},{key:"i18n",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return ho.get(t,e,n||this.locale)}},{key:"hasI18nkey",value:function(t,e){return ho.hasKey(t,e||this.locale)}},{key:"initI18n",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,i="".concat(e,".").concat(n);return t.hasI18nkey(i,o)?t.$i18n("".concat(e,".").concat(n),r,o):t.$i18n("".concat(n),r,o)}}},{key:"setLocale",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en_US";this.locale=t,this.saveItem("locale",this.locale)}},{key:"setUser",value:function(t){this.user=t}},{key:"initTheme",value:function(){var t="dark";window.localStorage&&(t=window.localStorage.getItem("easylogic.studio.theme"),t=["gray","light"].includes(t)?t:"dark"),this.theme=t||"dark",window.localStorage.setItem("easylogic.studio.theme",this.theme)}},{key:"themeValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return vo[this.theme][t]||e}},{key:"changeMode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_l;this.mode=t}},{key:"changeModeView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"CanvasView";this.modeView=t}},{key:"isMode",value:function(t){return this.mode===t}},{key:"isAddMode",value:function(){return this.isMode("ADD")}},{key:"isSelectionMode",value:function(){return this.isMode(_l)}},{key:"changeAddType",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.changeMode("ADD"),this.addComponentType=t,this.isComponent=e}},{key:"changeTheme",value:function(t){t=["light","gray"].includes(t)?t:"dark",this.theme=t,window.localStorage.setItem("easylogic.studio.theme",t)}},{key:"getFile",value:function(t){return this.images[t]||t}},{key:"setStore",value:function(t){this.$store=t}},{key:"send",value:function(){this.emit.apply(this,arguments)}},{key:"emit",value:function(){var t;this.$store&&(this.$store.source="EDITOR_ID",(t=this.$store).emit.apply(t,arguments))}},{key:"load",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.projects=t}},{key:"add",value:function(t){return this.projects.push(t),t}},{key:"remove",value:function(t){this.projects.splice(t,1)}},{key:"clear",value:function(){this.projects=[]}},{key:"get",value:function(t){return this.projects[t]}},{key:"replaceLocalUrltoRealUrl",value:function(t){var e=this.selection.currentProject,n={};return e.images.forEach((function(e){t.indexOf(e.local)>-1&&(n[e.local]=e.original)})),Object.keys(n).forEach((function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))})),t}},{key:"replaceLocalUrltoId",value:function(t){var e=editor.projects,n={};return e.forEach((function(e){e.images.forEach((function(e){t.indexOf(e.local)>-1&&(n[e.local]="#"+e.id)}))})),Object.keys(n).forEach((function(e){t.indexOf(e)>-1&&(t=t.replace(new RegExp(e,"g"),n[e]))})),t}},{key:"makeResource",value:function(t){var e=JSON.stringify(t);return e=this.replaceLocalUrltoId(e)}},{key:"saveResource",value:function(t,e){window.localStorage.setItem("easylogic.studio.".concat(t),this.makeResource(e))}},{key:"saveItem",value:function(t,e){window.localStorage.setItem("easylogic.studio.".concat(t),JSON.stringify(e))}},{key:"revokeResource",value:function(t){var e=this,n=JSON.parse(t||"[]"),r={};return n.forEach((function(t){t.images.forEach((function(t){r["#".concat(t.id)]=t}))})),Object.keys(r).map((function(t){var e=r[t],n=Xi.parse(e.original,!0);e.local=n.local})),n.forEach((function(t){t.layers=e.applyAsset(t.layers,r)})),n}},{key:"applyAsset",value:function(t,e){var n=this;return L(t)?t=t.map((function(t){return n.applyAsset(t,e)})):F(t)?Object.keys(t).forEach((function(r){t[r]=n.applyAsset(t[r],e)})):B(t)&&Object.keys(e).forEach((function(n){var r=e[n];t.indexOf("#".concat(r.id))>-1&&(t=t.replace(new RegExp("#".concat(r.id),"g"),r.local))})),t}},{key:"loadResource",value:function(t){return this.revokeResource(window.localStorage.getItem("easylogic.studio.".concat(t)))}},{key:"loadItem",value:function(t){return JSON.parse(window.localStorage.getItem("easylogic.studio.".concat(t))||JSON.stringify(""))}},{key:"zIndex",get:function(){return this.popupZIndex++}}])&&El(e.prototype,n),r&&El(e,r),t}();function Tl(t){return(Tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Dl(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],this.$store=new sr,this.$editor=new Cl({$store:this.$store}),this.$container=un.create(this.getContainer()),this.$container.addClass(this.getClassName()),this.render(this.$container),this.initializeEvent(),this.initBodyMoves()}},{key:"initBodyMoves",value:function(){this.moves=new Set,this.ends=new Set,this.modifyBodyMoveSecond(0)}},{key:"modifyBodyMoveSecond",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$config.set("body.move.ms",t),this.funcBodyMoves=E(this.loopBodyMoves.bind(this),this.$config.get("body.move.ms"))}},{key:"loopBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent"),n=this.$config.get("lastPos")||Ml;!(n.x===t.x&&n.y===t.y)&&this.moves.size&&(this.moves.forEach((function(n){var r=t.x-n.xy.x,o=t.y-n.xy.y;0==r&&0==o||n.func.call(n.context,r,o,"move",e.pressure)})),this.$config.set("lastPos",t)),requestAnimationFrame(this.funcBodyMoves)}},{key:"removeBodyMoves",value:function(){var t=this.$config.get("pos"),e=this.$config.get("bodyEvent");t&&this.ends.forEach((function(n){n.func.call(n.context,t.x-n.xy.x,t.y-n.xy.y,"end",e.pressure)})),this.moves.clear(),this.ends.clear()}},{key:fo("add/body/mousemove"),value:function(t,e,n){this.moves.add({func:t,context:e,xy:n})}},{key:fo("add/body/mouseup"),value:function(t,e,n){this.ends.add({func:t,context:e,xy:n})}},{key:"getClassName",value:function(){return t.className||"csseditor"}},{key:"getContainer",value:function(){return t.container||document.body}},{key:"template",value:function(){return"
".concat(t.template,"
")}},{key:"components",value:function(){return t.components||{}}},{key:In("document"),value:function(t){if("INPUT"!==t.target.nodeName&&"SELECT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName){var e=t.xy||Ll;this.$config.set("bodyEvent",t),this.$config.set("pos",e),this.requestId||(this.requestId=requestAnimationFrame(this.funcBodyMoves))}}},{key:Ln("document"),value:function(t){"INPUT"!==t.target.nodeName&&"SELECT"!==t.target.nodeName&&"TEXTAREA"!==t.target.nodeName&&(this.$config.set("bodyEvent",t),this.removeBodyMoves(),this.requestId=null)}},{key:"commands",get:function(){return this.$editor.commands}},{key:"shortcuts",get:function(){return this.$editor.shortcuts}}])&&Dl(r.prototype,o),i&&Dl(r,i),n}(po))(t)},zl={App:v,Color:Fe,HueColor:He,ColorNames:fe};function Fl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Gl(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:[];this.state.currentColorSets.colors=t,this.$store.emit("changeCurrentColorSets")}},{key:"removeCurrentColor",value:function(t){this.state.currentColorSets.colors[t]&&(this.state.currentColorSets.colors.splice(t,1),this.$store.emit("changeCurrentColorSets"))}},{key:"removeCurrentColorToTheRight",value:function(t){this.state.currentColorSets.colors[t]&&(this.state.currentColorSets.colors.splice(t,Number.MAX_VALUE),this.$store.emit("changeCurrentColorSets"))}},{key:"clearPalette",value:function(){this.state.currentColorSets.colors&&(this.state.currentColorSets.colors=[],this.$store.emit("changeCurrentColorSets"))}},{key:"getUserList",value:function(){return Array.isArray(this.state.userList)&&this.state.userList.length?this.state.userList:this.state.colorSetsList}},{key:"getCurrentColors",value:function(){return this.getColors(this.state.currentColorSets)}},{key:"getColors",value:function(t){return t.scale?Fe.scale(t.scale,t.count):t.colors||[]}},{key:"getColorSetsList",value:function(){var t=this;return this.getUserList().map((function(e){return{name:e.name,edit:e.edit,colors:t.getColors(e)}}))}},{key:"hsv",get:function(){return this.state.hsv}},{key:"rgb",get:function(){return this.state.rgb}},{key:"hsl",get:function(){return this.state.hsl}},{key:"hex",get:function(){return this.state.hex}},{key:"alpha",get:function(){return this.state.alpha}},{key:"format",get:function(){return this.state.format}}])&&Xl(e.prototype,n),r&&Xl(e,r),t}();function Nl(t){return(Nl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kl(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wl(t,e){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],this.$body=null,this.$root=null,this.$store=new sr,this.callbackChange=function(){t.callbackChangeValue()},this.colorpickerShowCallback=function(){},this.colorpickerHideCallback=function(){},this.$body=un.create(this.getContainer()),this.$root=un.create("div","codemirror-colorpicker"),"inline"==this.opt.position&&this.$body.append(this.$root),this.opt.type&&this.$root.addClass(this.opt.type),this.opt.hideInformation&&this.$root.addClass("hide-information"),this.opt.hideColorsets&&this.$root.addClass("hide-colorsets"),this.opt.width&&this.$root.css("width",this.opt.width),this.$arrow=un.create("div","arrow"),this.$root.append(this.$arrow),this.manager.setUserPalette(this.opt.colorSets),this.render(this.$root),this.initColorWithoutChangeEvent(this.opt.color),this.initializeEvent()}},{key:"initColorWithoutChangeEvent",value:function(t){this.manager.initColor(t),this.emit("initColor")}},{key:"show",value:function(t,e,n,r){this.colorpickerShowCallback=n,this.colorpickerHideCallback=r,this.$root.css(this.getInitalizePosition()).show(),this.definePosition(t),this.isColorPickerShow=!0,this.isShortCut=t.isShortCut||!1,this.outputFormat=t.outputFormat,this.hideDelay=+V(t.hideDelay,2e3),this.hideDelay>0&&this.setHideDelay(this.hideDelay),this.$root.appendTo(this.$body),this.initColorWithoutChangeEvent(e)}},{key:"initColor",value:function(t,e){this.manager.changeColor(t,e),this.emit("changeColor")}},{key:"changeColor",value:function(t,e){this.manager.changeColor(t,e)}},{key:"hide",value:function(){this.isColorPickerShow&&(this.$root.hide(),this.$root.remove(),this.isColorPickerShow=!1,this.callbackHideValue())}},{key:"setColorsInPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.manager.setCurrentColorAll(t)}},{key:"setUserPalette",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.manager.setUserPalette(t)}},{key:"getOption",value:function(t){return this.opt[t]}},{key:"setOption",value:function(t,e){this.opt[t]=e}},{key:"getContainer",value:function(){return this.opt.container||document.body}},{key:"getColor",value:function(t){return this.manager.toColor(t)}},{key:"definePositionForArrow",value:function(t,e,n){}},{key:"definePosition",value:function(t){var e=this.$root.width(),n=this.$root.height(),r=t.left-this.$body.scrollLeft();e+r>window.innerWidth&&(r-=e+r-window.innerWidth),r<0&&(r=0);var o=t.top-this.$body.scrollTop();n+o>window.innerHeight&&(o-=n+o-window.innerHeight),o<0&&(o=0),this.$root.css({left:rn.px(r),top:rn.px(o)})}},{key:"getInitalizePosition",value:function(){return"inline"==this.opt.position?{position:"relative",left:"auto",top:"auto",display:"inline-block"}:{position:"absolute"==this.opt.position?"absolute":"fixed",left:rn.px(-1e4),top:rn.px(-1e4)}}},{key:"setHideDelay",value:function(t){var e=this;t=t||0;var n=this.hide.bind(this);this.$root.off("mouseenter"),this.$root.off("mouseleave"),this.$root.on("mouseenter",(function(){clearTimeout(e.timerCloseColorPicker)})),this.$root.on("mouseleave",(function(){clearTimeout(e.timerCloseColorPicker),e.timerCloseColorPicker=setTimeout(n,t)})),clearTimeout(this.timerCloseColorPicker)}},{key:"callbackChangeValue",value:function(t){t=t||this.getCurrentColor(),G(this.opt.onChange)&&this.opt.onChange.call(this,t),G(this.colorpickerShowCallback)&&this.colorpickerShowCallback(t)}},{key:"callbackHideValue",value:function(t){t=t||this.getCurrentColor(),G(this.opt.onHide)&&this.opt.onHide.call(this,t),G(this.colorpickerHideCallback)&&this.colorpickerHideCallback(t)}},{key:"getCurrentColor",value:function(){return this.manager.toColor(this.outputFormat)}},{key:"checkColorPickerClass",value:function(t){var e=un.create(t),n=e.closest("codemirror-colorview"),r=e.closest("codemirror-colorpicker"),o=e.closest("CodeMirror");return t.nodeName,!!(r||n||o)}},{key:"checkInHtml",value:function(t){return"HTML"==t.nodeName}},{key:"initializeStoreEvent",value:function(){Zl(ql(e.prototype),"initializeStoreEvent",this).call(this),this.$store.on("changeColor",this.callbackChange,this),this.$store.on("changeFormat",this.callbackChange,this)}},{key:"destroy",value:function(){Zl(ql(e.prototype),"destroy",this).call(this),this.$store.off("changeColor",this.callbackChange),this.$store.off("changeFormat",this.callbackChange),this.callbackChange=void 0,this.colorpickerShowCallback=void 0,this.colorpickerHideCallback=void 0}},{key:mn("document"),value:function(t){this.checkInHtml(t.target)||0==this.checkColorPickerClass(t.target)&&this.hide()}},{key:"hsv",get:function(){return this.manager.hsv}},{key:"rgb",get:function(){return this.manager.rgb}},{key:"hsl",get:function(){return this.manager.hsl}},{key:"hex",get:function(){return this.manager.hex}},{key:"alpha",get:function(){return this.manager.alpha}},{key:"format",get:function(){return this.manager.format}}])&&Wl(n.prototype,r),o&&Wl(n,o),e}(po);function tf(t){return(tf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ef(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nf(t,e){for(var n=0;nr?100:(t-n)/(r-n)*100}},{key:"getCalculatedDist",value:function(t){var e=t?this.getMousePosition(t):this.getCurrent(this.getDefaultValue()/this.state.maxValue);return this.getDist(e)}},{key:"getDefaultValue",value:function(){return 0}},{key:"setMousePosition",value:function(t){this.refs.$bar.css({left:rn.px(t)})}},{key:"getMousePosition",value:function(t){return ir.pos(t).pageX}},{key:"refresh",value:function(){this.setColorUI()}},{key:"setColorUI",value:function(t){(t=t||this.getDefaultValue())<=this.state.minValue?this.refs.$bar.addClass("first").removeClass("last"):t>=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first"),this.setMousePosition(this.getMaxDist()*((t||0)/this.state.maxValue))}}])&&sf(n.prototype,r),o&&sf(n,o),e}(function(t){function e(){return ef(this,e),rf(this,of(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&af(t,e)}(e,t),n=e,(r=[{key:"refresh",value:function(){}},{key:"refreshColorUI",value:function(t){}},{key:"changeColor",value:function(t){this.parent.changeColor(t||{}),this.emit("changeColor")}},{key:Ln("document"),value:function(t){this.onDragEnd(t)}},{key:In("document"),value:function(t){this.onDragMove(t)}},{key:An("$bar"),value:function(t){this.isDown=!0}},{key:An("$container"),value:function(t){this.isDown=!0,this.onDragStart(t)}},{key:"onDragStart",value:function(t){this.isDown=!0,this.refreshColorUI(t)}},{key:"onDragMove",value:function(t){this.isDown&&this.refreshColorUI(t)}},{key:"onDragEnd",value:function(t){this.isDown=!1}},{key:fo("changeColor","initColor"),value:function(){this.refresh()}}])&&nf(n.prototype,r),o&&nf(n,o),e}(po));function hf(t){return(hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function df(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function vf(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:or("$container"),value:function(){return{style:{"background-color":this.parent.manager.toString("rgb")}}}},{key:"getDefaultValue",value:function(){return this.parent.hsv.v}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.state.maxValue),this.changeColor({type:"hsv",v:e/100*this.state.maxValue})}}])&&vf(n.prototype,r),o&&vf(n,o),e}(yf);function Of(t){return(Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kf(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function jf(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Sf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pf(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){$f(Ef(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e"}},{key:or("$el"),value:function(){return{style:{"background-color":this.parent.manager.toString("rgb")}}}},{key:fo("changeColor","initColor"),value:function(){this.refresh()}}])&&Df(n.prototype,r),o&&Df(n,o),e}(po);function Mf(t){return(Mf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Bf(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function zf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ff(t,e){for(var n=0;n\n \n
\n
\n \n '}},{key:"refresh",value:function(t){this.setColorUI(t)}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.renderValue(),this.setHueColor(null,t)}},{key:"renderValue",value:function(){var t=1-this.parent.hsv.v;this.refs.$valuewheel.css("background-color","rgba(0, 0, 0, ".concat(t,")"))}},{key:"renderWheel",value:function(t,e){this.width&&!t&&(t=this.width),this.height&&!e&&(e=this.height);var n=un.create("canvas"),r=n.el.getContext("2d");n.el.width=t,n.el.height=e,n.px("width",t),n.px("height",e);for(var o=r.getImageData(0,0,t,e),i=o.data,a=Math.floor(t/2),c=Math.floor(e/2),u=t>e?c:a,s=a,l=c,f=0;f0&&(r.globalCompositeOperation="destination-out",r.fillStyle="black",r.beginPath(),r.arc(s,l,u-this.thinkness,0,2*Math.PI),r.closePath(),r.fill()),n}},{key:"renderCanvas",value:function(){if(!this.parent.createdWheelCanvas){var t=this.refs.$colorwheel,e=t.el.getContext("2d"),n=Bf(t.size(),2),r=n[0],o=n[1];this.width&&!r&&(r=this.width),this.height&&!o&&(o=this.height),t.el.width=r,t.el.height=o,t.px("width",r),t.px("height",o);var i=this.renderWheel(r,o);e.drawImage(i.el,0,0),this.parent.createdWheelCanvas=!0}}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"getDefaultSaturation",value:function(){return this.parent.hsv.s}},{key:"getCurrentXY",value:function(t,e,n,r,o){return t?t.xy:dt(e,n,r,o)}},{key:"getRectangle",value:function(){var t=this.$el.width(),e=this.$el.height(),n=this.refs.$colorwheel.width()/2,r=this.$el.offsetLeft(),o=r+t/2,i=this.$el.offsetTop();return{minX:r,minY:i,width:t,height:e,radius:n,centerX:o,centerY:i+e/2}}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,c=n.centerY,u=this.getCurrentXY(t,this.getDefaultValue(),this.getDefaultSaturation()*i,a,c),s=(h=u.x)-a,l=(d=u.y)-c,f=s*s+l*l,p=bt(s,l);if(f>i*i)var y=this.getCurrentXY(null,p,i,a,c),h=y.x,d=y.y;var v=Math.min(Math.sqrt(f)/i,1);this.refs.$drag_pointer.px("left",h-r),this.refs.$drag_pointer.px("top",d-o),e||this.changeColor({type:"hsv",h:p,s:v})}},{key:"changeColor",value:function(t){this.parent.manager.changeColor(t||{})}},{key:fo("changeColor"),value:function(){this.refresh(!0)}},{key:fo("initColor"),value:function(){this.refresh(!0)}},{key:Ln("document"),value:function(t){this.isDown=!1}},{key:In("document"),value:function(t){this.isDown&&this.setHueColor(t)}},{key:An("$drag_pointer"),value:function(t){this.isDown=!0}},{key:An(),value:function(t){this.isDown=!0,this.setHueColor(t)}}])&&Ff(n.prototype,r),o&&Ff(n,o),e}(po);function Kf(t){return(Kf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Wf(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uf(t,e){for(var n=0;n\n
\n \n
\n
\n
\n \n
HEX
\n
\n
\n
\n
\n \n
R
\n
\n
\n \n
G
\n
\n
\n \n
B
\n
\n
\n \n
A
\n
\n
\n
\n
\n \n
H
\n
\n
\n \n
%
\n
S
\n
\n
\n \n
%
\n
L
\n
\n
\n \n
A
\n
\n
\n \n '}},{key:"setCurrentFormat",value:function(t){this.format=t,this.initFormat()}},{key:"initFormat",value:function(){var t=this,e=this.format||"hex";["hex","rgb","hsl"].filter((function(t){return t!==e})).forEach((function(e){t.$el.removeClass(e)})),this.$el.addClass(e)}},{key:"nextFormat",value:function(){var t=this.format||"hex",e="hex";"hex"==t?e="rgb":"rgb"==t?e="hsl":"hsl"==t&&(e=1==this.parent.alpha?"hex":"rgb"),this.format=e,this.initFormat(),this.parent.manager.changeFormat(this.format)}},{key:"goToFormat",value:function(t){this.format=t,"rgb"!==t&&"hsl"!==t||this.initFormat(),this.parent.manager.changeFormat(this.format)}},{key:"getFormat",value:function(){return this.format||"hex"}},{key:"changeRgbColor",value:function(){this.parent.changeColor({type:"rgb",r:this.refs.$rgb_r.int(),g:this.refs.$rgb_g.int(),b:this.refs.$rgb_b.int(),a:this.refs.$rgb_a.float()})}},{key:"changeHslColor",value:function(){this.parent.changeColor({type:"hsl",h:this.refs.$hsl_h.int(),s:this.refs.$hsl_s.int(),l:this.refs.$hsl_l.int(),a:this.refs.$hsl_a.float()})}},{key:fo("changeColor","initColor"),value:function(){this.refresh()}},{key:En("$rgb_r"),value:function(t){this.changeRgbColor()}},{key:En("$rgb_g"),value:function(t){this.changeRgbColor()}},{key:En("$rgb_b"),value:function(t){this.changeRgbColor()}},{key:En("$rgb_a"),value:function(t){this.changeRgbColor()}},{key:En("$hsl_h"),value:function(t){this.changeHslColor()}},{key:En("$hsl_s"),value:function(t){this.changeHslColor()}},{key:En("$hsl_l"),value:function(t){this.changeHslColor()}},{key:En("$hsl_a"),value:function(t){this.changeHslColor()}},{key:On("$hexCode"),value:function(t){var e=this.refs.$hexCode.val();"#"!=e.charAt(0)||7!=e.length&&9!==e.length||this.parent.initColor(e)}},{key:bn("$formatChangeButton"),value:function(t){this.nextFormat()}},{key:bn("$el .information-item.hex .input-field .title"),value:function(t){this.goToFormat("hex")}},{key:bn("$el .information-item.rgb .input-field .title"),value:function(t){this.goToFormat("hsl")}},{key:bn("$el .information-item.hsl .input-field .title"),value:function(t){this.goToFormat("rgb")}},{key:"setRGBInput",value:function(){this.refs.$rgb_r.val(this.parent.rgb.r),this.refs.$rgb_g.val(this.parent.rgb.g),this.refs.$rgb_b.val(this.parent.rgb.b),this.refs.$rgb_a.val(this.parent.alpha)}},{key:"setHSLInput",value:function(){this.refs.$hsl_h.val(this.parent.hsl.h),this.refs.$hsl_s.val(this.parent.hsl.s),this.refs.$hsl_l.val(this.parent.hsl.l),this.refs.$hsl_a.val(this.parent.alpha)}},{key:"setHexInput",value:function(){this.refs.$hexCode.val(this.parent.manager.toString("hex"))}},{key:"refresh",value:function(){this.setCurrentFormat(this.parent.format),this.setRGBInput(),this.setHSLInput(),this.setHexInput()}}])&&Uf(n.prototype,r),o&&Uf(n,o),e}(po);function tp(t){return(tp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ep(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function np(t,e){for(var n=0;n\n
\n
\n

Color Palettes

\n ×\n
\n
\n
\n '}},{key:fo("changeCurrentColorSets"),value:function(){this.refresh()}},{key:fo("toggleColorChooser"),value:function(){this.toggle()}},{key:tr("$colorsetsList"),value:function(){var t=this.parent.manager.getColorSetsList();return"\n
\n ".concat(t.map((function(t,e){return'\n
\n

').concat(t.name,'

\n
\n
\n ').concat(t.colors.filter((function(t,e){return e<5})).map((function(t){return'
\n
\n
')})).join(""),"\n
\n
\n
")})).join(""),"\n
\n ")}},{key:"show",value:function(){this.$el.addClass("open")}},{key:"hide",value:function(){this.$el.removeClass("open")}},{key:"toggle",value:function(){this.$el.toggleClass("open")}},{key:bn("$toggleButton"),value:function(t){this.toggle()}},{key:bn("$colorsetsList .colorsets-item"),value:function(t,e){if(e){var n=parseInt(e.attr("data-colorsets-index"));this.parent.manager.setCurrentColorSets(n),this.hide()}}},{key:"destroy",value:function(){op(ip(e.prototype),"destroy",this).call(this),this.hide()}}])&&np(n.prototype,r),o&&np(n,o),e}(po);function up(t){return(up="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lp(t,e){for(var n=0;n\n \n
\n \n '}},{key:tr("$colorSetsColorList"),value:function(){var t=this.parent.manager.getCurrentColorSets(),e=this.parent.manager.getCurrentColors();return'
\n '.concat(e.map((function(t,e){return'
\n
\n
\n
')})).join("")," \n ").concat(t.edit?'
+
':""," \n
")}},{key:"addColor",value:function(t){this.parent.manager.addCurrentColor(t),this.refresh()}},{key:fo("changeCurrentColorSets"),value:function(){this.refresh()}},{key:fo("initColor"),value:function(){this.refresh()}},{key:bn("$colorSetsChooseButton"),value:function(t){this.emit("toggleColorChooser")}},{key:xn("$colorSetsColorList"),value:function(t){if(t.preventDefault(),this.parent.manager.getCurrentColorSets().edit){var e=un.create(t.target).closest("color-item");if(e){var n=parseInt(e.attr("data-index"));this.emit("showContextMenu",t,n)}else this.emit("showContextMenu",t)}}},{key:bn("$colorSetsColorList .add-color-item"),value:function(t){this.addColor(this.parent.getColor())}},{key:bn("$colorSetsColorList .color-item"),value:function(t,e){this.parent.initColor(e.attr("data-color"))}}])&&lp(n.prototype,r),o&&lp(n,o),e}(po);function dp(t){return(dp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bp(t,e){for(var n=0;n\n \n \n \n \n '}},{key:"show",value:function(t,e){var n=ir.pos(t);this.$el.px("top",n.clientY-10),this.$el.px("left",n.clientX),this.$el.addClass("show"),this.selectedColorIndex=e,A(this.selectedColorIndex)?this.$el.addClass("small"):this.$el.removeClass("small")}},{key:"hide",value:function(){this.$el.removeClass("show")}},{key:"runCommand",value:function(t){switch(t){case"remove-color":this.parent.manager.removeCurrentColor(this.selectedColorIndex);break;case"remove-all-to-the-right":this.parent.manager.removeCurrentColorToTheRight(this.selectedColorIndex);break;case"clear-palette":this.parent.manager.clearPalette()}}},{key:fo("showContextMenu"),value:function(t,e){this.show(t,e)}},{key:bn("$el .menu-item"),value:function(t,e){t.preventDefault(),this.runCommand(e.attr("data-type")),this.hide()}}])&&bp(n.prototype,r),o&&bp(n,o),e}(po);function kp(t){return(kp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function jp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Sp(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:wf,Opacity:Cf,ColorView:Lf,ColorWheel:Nf,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&Sp(n.prototype,r),o&&Sp(n,o),e}(Ql);function _p(t){return(_p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tp(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.state.maxValue),this.changeColor({h:e/100*this.state.maxValue,type:"hsv"})}}])&&Tp(n.prototype,r),o&&Tp(n,o),e}(yf);function Ip(t){return(Ip="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mp(t,e){for(var n=0;n\n
\n
\n
\n
\n
\n \n '}},{key:"setBackgroundColor",value:function(t){this.$el.css("background-color",t)}},{key:"refresh",value:function(){this.setColorUI()}},{key:"calculateSV",value:function(){var t=this.drag_pointer_pos||{x:0,y:0},e=this.$el.width(),n=this.$el.height(),r=t.x/e,o=(n-t.y)/n;this.parent.initColor({type:"hsv",s:r,v:o})}},{key:"setColorUI",value:function(){var t=this.$el.width()*this.parent.hsv.s,e=this.$el.height()*(1-this.parent.hsv.v);this.refs.$drag_pointer.px("left",t),this.refs.$drag_pointer.px("top",e),this.drag_pointer_pos={x:t,y:e},this.setBackgroundColor(this.parent.manager.getHueColor())}},{key:"setMainColor",value:function(t){var e=this.$el.offset(),n=this.$el.contentWidth(),r=this.$el.contentHeight(),o=ir.pos(t).pageX-e.left,i=ir.pos(t).pageY-e.top;o<0?o=0:o>n&&(o=n),i<0?i=0:i>r&&(i=r),this.refs.$drag_pointer.px("left",o),this.refs.$drag_pointer.px("top",i),this.drag_pointer_pos={x:o,y:i},this.calculateSV()}},{key:fo("changeColor","initColor"),value:function(){this.refresh()}},{key:Ln("document"),value:function(t){this.isDown=!1}},{key:In("document"),value:function(t){this.isDown&&this.setMainColor(t)}},{key:An(),value:function(t){this.isDown=!0,this.setMainColor(t)}},{key:Ln(),value:function(t){this.isDown=!1}}])&&Mp(n.prototype,r),o&&Mp(n,o),e}(po);function Hp(t){return(Hp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yp(t,e){for(var n=0;n\n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Hue:Ap,Opacity:Cf,ColorView:Lf,Palette:Gp,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&Yp(n.prototype,r),o&&Yp(n,o),e}(Ql);function Zp(t){return(Zp="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qp(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jp(t,e){for(var n=0;n\n \n
\n \n \n
\n \n "}},{key:"components",value:function(){return{Hue:Ap,Opacity:Cf,Palette:Gp}}}])&&Jp(n.prototype,r),o&&Jp(n,o),e}(Ql);function ry(t){return(ry="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iy(t,e){for(var n=0;n=this.maxValue?this.refs.$bar.addClass("last").removeClass("first"):this.refs.$bar.removeClass("last").removeClass("first");var e=1-(t||0)/this.state.maxValue;this.setMousePosition(this.getMaxDist()*e)}}])&&iy(n.prototype,r),o&&iy(n,o),e}(yf);function ly(t){return(ly="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function py(t,e){for(var n=0;n\n
\n
\n
\n \n '}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"refreshColorUI",value:function(t){var e=this.getCalculatedDist(t);this.setColorUI(e/100*this.maxValue),this.changeColor({h:e/100*this.maxValue,type:"hsv"})}}])&&py(n.prototype,r),o&&py(n,o),e}(sy);function gy(t){return(gy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function my(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function wy(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Oy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ky(t,e){for(var n=0;n\n
\n
\n
\n
\n \n '}},{key:"refresh",value:function(){Sy(Py(e.prototype),"refresh",this).call(this),this.setOpacityColorBar()}},{key:"setOpacityColorBar",value:function(){var t=function(t){for(var e=1;e\n
\n \n "}},{key:"components",value:function(){return{Hue:by,Opacity:$y,Palette:Gp}}}])&&Cy(n.prototype,r),o&&Cy(n,o),e}(Ql);function Ay(t){return(Ay="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Iy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ly(t,e){for(var n=0;n\n \n
\n '}},{key:"setColorUI",value:function(t){this.renderCanvas(),this.setHueColor(null,t)}},{key:"getDefaultValue",value:function(){return this.parent.hsv.h}},{key:"setHueColor",value:function(t,e){var n=this.getRectangle(),r=n.minX,o=n.minY,i=n.radius,a=n.centerX,c=n.centerY,u=this.getCurrentXY(t,this.getDefaultValue(),i,a,c),s=bt((f=u.x)-a,(p=u.y)-c),l=this.getCurrentXY(null,s,i-this.half_thinkness,a,c),f=l.x,p=l.y;this.refs.$drag_pointer.px("left",f-r),this.refs.$drag_pointer.px("top",p-o),e||(this.changeColor({type:"hsv",h:s}),this.emit("changeColor"))}}])&&Ly(n.prototype,r),o&&Ly(n,o),e}(Nf);function Hy(t){return(Hy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yy(t,e){for(var n=0;n\n \n \n
\n \n \n
\n \n
\n \n \n \n \n \n '}},{key:"components",value:function(){return{Value:wf,Opacity:Cf,ColorView:Lf,ColorRing:Gy,Palette:Gp,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&Yy(n.prototype,r),o&&Yy(n,o),e}(Ql);function Zy(t){return(Zy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function qy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jy(t,e){for(var n=0;n\n \n
\n \n \n
\n \n \n \n \n \n "}},{key:"components",value:function(){return{Hue:by,Opacity:$y,Palette:Gp,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&Jy(n.prototype,r),o&&Jy(n,o),e}(Ql);function rh(t){return(rh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function oh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ih(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n ')}},{key:bn("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Value:wf,Opacity:Cf,ColorView:Lf,ColorRing:Gy,Palette:Gp,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&ih(n.prototype,r),o&&ih(n,o),e}(Ql);function lh(t){return(lh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function fh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ph(t,e){for(var n=0;n\n
\n
\n
".concat(this.opt.tabTitle,' Color
\n
Swatch
\n
Color Set
\n
\n
\n
\n \n
\n \n \n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n\n
\n ')}},{key:bn("$tabHeader .color-tab-item"),value:function(t,e){if(!e.hasClass("active")){var n;(n=this.refs.$tabHeader.$(".active"))&&n.removeClass("active"),e.addClass("active"),(n=this.refs.$tabBody.$(".active"))&&n.removeClass("active");var r=this.refs.$tabBody.$("[item-id='".concat(e.attr("item-id"),"']"));r&&r.addClass("active")}}},{key:"components",value:function(){return{Hue:by,Opacity:$y,Palette:Gp,Information:Qf,CurrentColorSets:hp,ColorSetsChooser:cp,ContextMenu:Op}}}])&&ph(n.prototype,r),o&&ph(n,o),e}(Ql),bh={create:function(t){switch(t.type){case"macos":return new Ep(t);case"xd":return new nh(t);case"xd-tab":return new vh(t);case"ring":return new Uy(t);case"ring-tab":return new sh(t);case"mini":return new ny(t);case"mini-vertical":return new Vy(t);case"sketch":case"palette":default:return new Up(t)}},ColorPicker:Up,ChromeDevToolColorPicker:Up,MacOSColorPicker:Ep,RingColorPicker:Uy,MiniColorPicker:ny,MiniVerticalColorPicker:Vy,XDColorPicker:nh};function gh(t){return(gh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mh(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wh(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return"".concat(t).concat(this.json.selector," {\n ").concat(this.toPropertyString(),"\n}")}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.toCSSText(t)}}])&&qh(n.prototype,r),o&&qh(n,o),e}(Mo);function rd(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),o=ad(r,2);e=o[0],n=o[1]}else n=t.trim();var i=n.split(" "),a=ad(i,2),c=a[0],u=a[1];A(u)&&(u=c),c=rn.parse(c),u=rn.parse(u);var s=e.split(" "),l=ad(s,2),f=l[0],p=l[1];return A(p)&&(p=f),{radiusX:f=rn.parse(f),radiusY:p=rn.parse(p),x:c,y:u}}},{key:"parseStyleForInset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("round"),n=ad(e,2),r=n[0],o=n[1],i=od.parse(r),a=ad(i,5),c=a[0],u=a[1],s=a[2],l=a[3],f=a[4];if(o)var p=od.parse(o),y=ad(p,5),h=y[0],d=y[1],v=y[2],b=y[3],g=y[4];return{isAll:1===c,top:u,right:s,bottom:l,left:f,round:o,isAllRadius:1===h,topRadius:d,rightRadius:v,bottomRadius:b,leftRadius:g}}},{key:"parseStyleForPolygon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter((function(t){return t.trim()})).map((function(t){var e=ad(t.trim().split(" "),2),n=e[0],r=e[1];return{x:rn.parse(n),y:rn.parse(r)}}))}}],(r=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return yd(hd(e.prototype),"getDefaultObject",this).call(this,ud({itemType:"clip-path",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return ud({},yd(hd(e.prototype),"toCloneObject",this).call(this),{value:this.json.value})}},{key:"toString",value:function(){var t=this.json.type,e=this.json.value,n=this.json.box,r="";switch(t){case"circle":case"inset":case"ellipse":case"polygon":case"path":r="".concat(t,"(").concat(e,")");break;case"svg":r="url(#".concat(e,")");break;default:r="none"}return n?"".concat(n," ").concat(r):r}},{key:"toCSS",value:function(){return{"clip-path":this.toString()}}}])&&fd(n.prototype,r),o&&fd(n,o),e}(Mo);function gd(t){return(gd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function md(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function wd(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return $d(Ed(e.prototype),"getDefaultObject",this).call(this,kd({position:"absolute",x:rn.px(0),y:rn.px(0),right:"",bottom:"",width:rn.px(300),height:rn.px(300),rootVariable:"",variable:"",transform:"",filter:"","backdrop-filter":"","background-color":"","background-clip":"","background-image":"",pattern:"",border:"","border-radius":"","box-shadow":"","box-sizing":"border-box","text-shadow":"","text-clip":"","clip-path":"",color:"black","font-size":rn.px(13),"font-stretch":"","line-height":"","text-align":"","text-transform":"","text-decoration":"","letter-spacing":"","word-spacing":"","text-indent":"","perspective-origin":"","transform-origin":"","transform-style":"",perspective:"","mix-blend-mode":"",overflow:"visible",opacity:"",rotate:"","text-fill-color":"","text-stroke-color":"","text-stroke-width":"","offset-path":"","offset-distance":"","z-index":rn.auto,layout:"default","flex-layout":"display:flex;","grid-layout":"display:grid;",outline:{},animations:[],transitions:[],selectors:[],svg:[]},t))}},{key:"toCloneObject",value:function(){var t=this.json;return kd({},$d(Ed(e.prototype),"toCloneObject",this).call(this),{position:t.position,right:t.right+"",bottom:t.bottom+"",rootVariable:t.rootVariable,variable:t.variable,transform:t.transform,filter:t.filter,"backdrop-filter":t["backdrop-filter"],"background-color":t["background-color"],"background-image":t["background-image"],"text-clip":t["text-clip"],"border-radius":t["border-radius"],border:t.border,"box-shadow":t["box-shadow"],"text-shadow":t["text-shadow"],"clip-path":t["clip-path"],color:t.color,"font-size":t["font-size"]+"","font-stretch":t["font-stretch"]+"","line-height":t["line-height"]+"","text-align":t["text-align"]+"","text-transform":t["text-transform"]+"","text-decoration":t["text-decoration"]+"","letter-spacing":t["letter-spacing"]+"","word-spacing":t["word-spacing"]+"","text-indent":t["text-indent"]+"","perspective-origin":t["perspective-origin"],"transform-origin":t["transform-origin"],"transform-style":t["transform-style"],perspective:t.perspective+"","mix-blend-mode":t["mix-blend-mode"],overflow:t.overflow,opacity:t.opacity+"",rotate:t.rotate+"","flex-layout":t["flex-layout"],"grid-layout":t["grid-layout"],outline:X(t.outline),animations:t.animations.map((function(t){return t.clone()})),transitions:t.transitions.map((function(t){return t.clone()})),selectors:t.selectors.map((function(t){return t.clone()})),svg:t.svg.map((function(t){return t.clone()}))})}},{key:"convert",value:function(t){return t=$d(Ed(e.prototype),"convert",this).call(this,t)}},{key:"addAnimation",value:function(t){return this.json.animations.push(t),t}},{key:"addTransition",value:function(t){return this.json.transitions.push(t),t}},{key:"addSelector",value:function(t){return this.json.selectors.push(t),t}},{key:"createAnimation",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addAnimation(new Ah(kd({checked:!0},t)))}},{key:"createSelector",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSelector(new nd(kd({checked:!0},t)))}},{key:"createTransition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addTransition(new Yh(kd({checked:!0},t)))}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeAnimation",value:function(t){this.removePropertyList(this.json.animations,t)}},{key:"removeSelector",value:function(t){this.removePropertyList(this.json.selectors,t)}},{key:"removeTransition",value:function(t){this.removePropertyList(this.json.transitions,t)}},{key:"enableHasChildren",value:function(){return!0}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.animations[+t].reset(e)}},{key:"updateTransition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.transitions[+t].reset(e)}},{key:"updateSelector",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.selectors[+t].reset(e)}},{key:"setSize",value:function(t){this.reset(t)}},{key:"setBorder",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=this.json.border;if("all"===t)n?this.json.border={all:n}:["top","right","bottom","left"].forEach((function(t){delete e.json.border[t]}));else{if(r.all&&A(n)){var o=kd({},r.all);r.top=kd({},o),r.bottom=kd({},o),r.left=kd({},o),r.right=kd({},o)}r.all&&delete r.all,n&&(this.json.border[t]=n)}}},{key:"getBorder",value:function(t){return this.json.border[t]||{}}},{key:"setOutline",value:function(t){this.json.outline=kd({},this.json.outline,{},t)}},{key:"setBorderRadius",value:function(t,e){this.json.borderRadius=e}},{key:"traverse",value:function(t,e,n){var r=this;t.isAttribute()||(n||!t.isLayoutItem()||t.isRootItem())&&(e.push(t),t.children.forEach((function(t){r.traverse(t,e)})))}},{key:"tree",value:function(t){var e=this,n=[];return this.children.forEach((function(r){e.traverse(r,n,t)})),n}},{key:"toPropertyCSS",value:function(t){var e={};return t.forEach((function(t){C(t.toCSS(),(function(t,n){e[t]||(e[t]=[]),e[t].push(n)}))})),N(e)}},{key:"toStringPropertyCSS",value:function(t){return J(this.json[t])}},{key:"toBackgroundImageCSS",value:function(){var t=[];return yl.parseStyle(this.json.pattern).forEach((function(e){t.push.apply(t,wd(Bs.parseStyle(J(e.toCSS()))))})),t.push.apply(t,wd(Bs.parseStyle(J(this.json["background-image"])))),Bs.joinCSS(t)}},{key:"toLayoutCSS",value:function(){var t=this.json.layout;if(this.hasLayout()){if("flex"===t)return this.toFlexLayoutCSS();if("grid"===t)return this.toGridLayoutCSS()}return{}}},{key:"toLayoutItemCSS",value:function(){var t=this.json.parent.layout,e={};return"flex"===t?e={position:"relative",left:"auto !important",top:"auto !important"}:"grid"===t&&(e={position:"relative",left:"auto !important",top:"auto !important",width:"auto !important",height:"auto !important"}),"flex"===t?e=kd({},e,{},J(this.json["flex-layout-item"])):"grid"===t&&(e=kd({},e,{},J(this.json["grid-layout-item"]))),e}},{key:"toFlexLayoutCSS",value:function(){return kd({display:"flex"},this.toStringPropertyCSS("flex-layout"))}},{key:"toGridLayoutCSS",value:function(){return kd({display:"grid"},this.toStringPropertyCSS("grid-layout"))}},{key:"toBorderCSS",value:function(){return this.toStringPropertyCSS("border")}},{key:"toOutlineCSS",value:function(){var t=this.json.outline;return t?0===Object.keys(t).length?{}:{outline:"".concat(t.color," ").concat(t.style," ").concat(t.width)}:{}}},{key:"toKeyCSS",value:function(t){return this.json[t]?jd({},t,this.json[t]):{}}},{key:"toAnimationKeyframes",value:function(t){return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:t}]}},{key:"toAnimationCSS",value:function(){return this.toPropertyCSS(this.json.animations)}},{key:"toTransitionCSS",value:function(){return this.toPropertyCSS(this.json.transitions)}},{key:"toString",value:function(){return q(this.toCSS())}},{key:"toExport",value:function(){return q(this.toCSS(!0))}},{key:"toExportSVGCode",value:function(){return""}},{key:"toBoxModelCSS",value:function(){var t=this.json,e={};return t["margin-top"]&&(e["margin-top"]=t["margin-top"]),t["margin-bottom"]&&(e["margin-bottom"]=t["margin-bottom"]),t["margin-left"]&&(e["margin-left"]=t["margin-left"]),t["margin-right"]&&(e["margin-right"]=t["margin-right"]),t["padding-top"]&&(e["padding-top"]=t["padding-top"]),t["padding-bottom"]&&(e["padding-bottom"]=t["padding-bottom"]),t["padding-left"]&&(e["padding-left"]=t["padding-left"]),t["padding-right"]&&(e["padding-right"]=t["padding-right"]),e}},{key:"toKeyListCSS",value:function(){for(var t=this.json,e={},n=arguments.length,r=new Array(n),o=0;o0&&void 0!==arguments[0]?arguments[0]:"";return this.json.selectors.map((function(e){return e.toString(t)})).join("\n\n")}},{key:"toNestedCSS",value:function(t){return[]}},{key:"toNestedBoundCSS",value:function(t){return[]}},{key:"generateView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="\n".concat(t," { /* ").concat(this.json.itemType," */\n ").concat(q(this.toCSS(),"\n "),"; \n ").concat(e,"\n}\n").concat(this.toNestedCSS().map((function(e){return"".concat(t," ").concat(e.selector," { \n ").concat(e.cssText?e.cssText:q(e.css||{},"\n\t\t"),"; \n }")})).join("\n"),"\n").concat(this.toSelectorString(t),"\n");return n}},{key:"generateDragView",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.generateView(t,e).replace(/background\-/gi,"");return n}},{key:"generateSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(t){var e=this.json.width.value,n=this.json.height.value;return'\n\n ').concat(this.rootSVG,"\n")}return this.svg}},{key:"wrapperRootSVG",value:function(t,e,n,r,o){return'\n \n ').concat(this.toDefString,"\n \n
\n ').concat(o,"\n
\n
\n \n
\n ")}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.layers,i=r.width,a=r.height,c=r.elementType,u=c||"div",s=this.toCSS();return n?(delete s.left,delete s.top,"absolute"===s.position&&delete s.position,this.wrapperRootSVG(t,e,i,a,"\n <".concat(u,' style="').concat(q(s),'" >\n ').concat(o.map((function(t){return t.svg})).join("\n\t")," \n \n "))):"\n ".concat(this.toDefString,"\n <").concat(u,' style="').concat(q(s),'" >\n ').concat(o.map((function(t){return t.svg})).join("\n\t")," \n \n ")}},{key:"toBound",value:function(){var t={x:this.json.x?this.json.x.clone():rn.px(0),y:this.json.y?this.json.y.clone():rn.px(0),width:this.json.width.clone(),height:this.json.height.clone()};return t.x2=rn.px(t.x.value+t.width.value),t.y2=rn.px(t.y.value+t.height.value),t}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=t.$('[data-id="'.concat(this.innerSVGId,'"]'));if(n){var r=n.$("defs");r.html(this.toDefInnerString)}else{var o=un.createByHTML(this.toDefString);o&&t.prepend(o)}}}},{key:"html",get:function(){var t=this.json,e=t.elementType,n=t.id,r=t.name,o=t.layers,i=t.itemType,a=e||"div";return"<".concat(a,' class="').concat(tt(jd({"element-item":!0},i,!0)),'" ').concat(Q({"data-id":n,"data-title":r}),">\n ").concat(this.toDefString,"\n ").concat(o.map((function(t){return t.html})).join("\n\t"),"\n")}},{key:"svg",get:function(){var t=this.json,e=t.x,n=t.y;return e=e.value,n=n.value,this.toSVG(e,n)}},{key:"rootSVG",get:function(){return this.toSVG(0,0,!0)}},{key:"toDefInnerString",get:function(){return"".concat(this.toClipPath)}},{key:"toClipPath",get:function(){var t=bd.parseStyle(this.json["clip-path"]),e=t.value;switch(t.type){case"path":return'');case"svg":return'').concat(e,"")}return""}},{key:"innerSVGId",get:function(){return this.json.id+"inner-svg"}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return t&&"\n \n \n ').concat(t,"\n \n \n ")}},{key:"clipPathId",get:function(){return this.json.id+"clip-path"}}])&&Pd(n.prototype,r),o&&Pd(n,o),e}(Ph),Td='';function Rd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Dd(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vd=function(t){for(var e=1;e',keyboard:'',local_movie:'',same_height:'\n\n \n\n',same_width:'\n\n \n\n',middle:'\n\n \n\n',bottom:'\n\n \n\n',top:'\n\n \n\n',right:'\n\n \n\n',center:'\n\n \n\n',left:'\n\n \n\n',flag:'',lens:'',local_library:'',italic:'',strikethrough:'',underline:'',cylinder:'\n\n\n\n\n\n',text_rotate:'',device_hub:'',control_point:'',flip_camera:'\n\n \n \n \n\n',flipY:'',flip:'',account_tree:'',format_shapes:'',merge:'',texture:'',settings_input_component:'',view_comfy:'',camera_roll:'',broken_image:'',shadow:'',opacity:'',looks:'',vintage:'',waves:'',blur_linear:'',blur:'',landscape:'',palette:'',diffuse:'',specular:'',photo:'',near_me:'',view_list:'',flash_on:'',doc:'',storage:'',archive:'',file_copy:'',gps_fixed:'',refresh:'',cat:'\n\n\n\n\n',shuffle:'',replay:'',speed:'',alternate_reverse:'',alternate:'',note:'',rect:'',circle:'',color_lens:'',cube:'',polygon:'',star:'',dahaze:'',brush:'',expand:'',list:'',grid:'',align_center:'',align_justify:'',align_left:'',align_right:'',color:'',size:'',edit:'',outline_image:'',ballot:'',shape:'',scatter:'',transform:'',gradient:'',close:'',build:'',code:'',autorenew:'',play:'',pause:'',skip_next:'',skip_prev:'',fast_forward:'',fast_rewind:'',filter:'',input:'',timer:'',title:'',paint:'',border_all:'',border_inner:Td,check:'',arrowRight:'',screen:'',repeat:'',remove2:'',setting:'',image:'\n',artboard:'',folder:'',publish:'',add_note:'',add:'',save:'\n',export:'',redo:'',undo:'',lock:'',lock_open:'',remove:'',copy:'\n',visible:'\n',add_box:'',add_circle:'',create_folder:'\n \n',chevron_right:'\n \n',chevron_left:''});function Ad(t){return(Ad="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Id(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ld(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return Gd(Hd(e.prototype),"getDefaultObject",this).call(this,Ld({itemType:"layer",name:"New Layer",tagName:"div"},t))}},{key:"getDefaultTitle",value:function(){return"Layer"}},{key:"getIcon",value:function(){return Vd.rect}},{key:"toCloneObject",value:function(){return Ld({},Gd(Hd(e.prototype),"toCloneObject",this).call(this),{tagName:this.json.tagName})}},{key:"screenX",get:function(){return this.json.parent?rn.px(this.json.parent.screenX.value+(this.json.x||zero).value):this.json.x||rn.px(0)}},{key:"screenY",get:function(){return this.json.parent?rn.px(this.json.parent.screenY.value+(this.json.y||zero).value):this.json.y||rn.px(0)}}])&&zd(n.prototype,r),o&&zd(n,o),e}(Cd);function Nd(t){return(Nd="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Kd(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Wd(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},n=jt();return Qd(tv(e.prototype),"getDefaultObject",this).call(this,Wd({itemType:"svgfilter",id:n,in:[],bound:{x:100,y:100,targetX:0,targetY:0},connected:[]},t))}},{key:"getInCount",value:function(){return 0}},{key:"setIn",value:function(t,e){this.json.in[t]={id:e.id,type:e.type}}},{key:"setConnected",value:function(t){0===this.json.connected.filter((function(e){return e.id===t.id})).length&&this.json.connected.push({id:t.id})}},{key:"convert",value:function(t){return B(t.in)&&(t.in=JSON.parse(t.in)),B(t.bound)&&(t.bound=JSON.parse(t.bound)),B(t.connected)&&(t.connected=JSON.parse(t.connected)),t}},{key:"toCloneObject",value:function(){return Wd({},Qd(tv(e.prototype),"toCloneObject",this).call(this),{id:this.json.id,in:X(this.json.in),bound:X(this.json.bound),connected:X(this.json.connected)})}},{key:"getDefaultAttribute",value:function(){var t=this,e=[];return this.json.connected.length&&e.push('result="'.concat(this.json.id,'result"')),Object.keys(rv).filter((function(e){return!!t.json[e]})).forEach((function(n){e.push("".concat(n,'="').concat(t.json[n],'"'))})),e.join(" ")+" "+this.getSourceInAttribute()}},{key:"hasInIndex",value:function(){return!1}},{key:"getSourceInAttribute",value:function(t){var e=this;return(t||this.json.in).map((function(t,n){if(!t)return"";var r=0===n?"":n+1+"";return e.hasInIndex()||(r=""),nv.includes(t.type)?"in".concat(r,'="').concat(t.type,'"'):"in".concat(r,'="').concat(t.id,'result"')})).join(" ")}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.value;return"")}}])&&qd(n.prototype,r),o&&qd(n,o),e}(Mo);function iv(t){return(iv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function av(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cv(t,e){for(var n=0;n\n \n '))}}])&&cv(n.prototype,r),o&&cv(n,o),e}(ov);function yv(t){return(yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function dv(t,e){for(var n=0;n\n ").concat(e.map((function(e){return"")})).join(""),"\n ")}}])&&dv(n.prototype,r),o&&dv(n,o),e}(ov);function Ov(t){return(Ov="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function kv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function jv(t,e){for(var n=0;n")}},{key:"hasInIndex",value:function(){return!0}}])&&jv(n.prototype,r),o&&jv(n,o),e}(ov);function _v(t){return(_v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Cv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tv(t,e){for(var n=0;n")}}])&&Tv(n.prototype,r),o&&Tv(n,o),e}(ov);function Lv(t){return(Lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bv(t,e){for(var n=0;n"))}}])&&Bv(n.prototype,r),o&&Bv(n,o),e}(ov);function Yv(t){return(Yv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Nv(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kv(t,e){for(var n=0;n")}},{key:"hasInIndex",value:function(){return!0}}])&&Kv(n.prototype,r),o&&Kv(n,o),e}(ov);function Qv(t){return(Qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function eb(t,e){for(var n=0;n")}}])&&eb(n.prototype,r),o&&eb(n,o),e}(ov);function cb(t){return(cb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ub(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function sb(t,e){for(var n=0;n")}}])&&sb(n.prototype,r),o&&sb(n,o),e}(ov);function db(t){return(db="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bb(t,e){for(var n=0;n")}}])&&bb(n.prototype,r),o&&bb(n,o),e}(ov);function jb(t){return(jb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pb(t,e){for(var n=0;n")}}])&&Pb(n.prototype,r),o&&Pb(n,o),e}(ov);function Tb(t){return(Tb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rb(t,e){return Ab(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||Vb()}function Db(t){return Ab(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||Vb()}function Vb(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function Ab(t){if(Array.isArray(t))return t}function Ib(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lb(t,e){for(var n=0;n\n ").concat(e&&""),"\n ").concat(n&&""),"\n ").concat(r&&""),"\n ").concat(o&&""),"\n ")}}])&&Lb(n.prototype,r),o&&Lb(n,o),e}(ov);function Hb(t){return(Hb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Xb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Yb(t,e){for(var n=0;n"))}}])&&Yb(n.prototype,r),o&&Yb(n,o),e}(ov);function qb(t){return(qb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Jb(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qb(t,e){for(var n=0;n"))}}])&&Qb(n.prototype,r),o&&Qb(n,o),e}(ov);function ig(t){return(ig="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ag(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cg(t,e){for(var n=0;n"))}}])&&cg(n.prototype,r),o&&cg(n,o),e}(ov);function yg(t){return(yg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function hg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function dg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bg(t,e){for(var n=0;n\n ").concat(this.json.lightInfo,"\n "))}}])&&bg(n.prototype,r),o&&bg(n,o),e}(ov);function jg(t){return(jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Sg(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pg(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $g(t,e){for(var n=0;n\n ").concat(this.json.lightInfo,"\n "))}},{key:"getSourceInAttribute",value:function(){return""}}])&&$g(n.prototype,r),o&&$g(n,o),e}(ov);function Dg(t){return(Dg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Vg(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ag(t,e){for(var n=0;n"))}}])&&Ag(n.prototype,r),o&&Ag(n,o),e}(ov);function Fg(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e"))}},{key:"hasInIndex",value:function(){return!0}}])&&em(n.prototype,r),o&&em(n,o),e}(ov);function cm(t){return(cm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function um(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function sm(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return hm(dm(e.prototype),"getDefaultObject",this).call(this,sm({type:"Source"},t))}},{key:"isSource",value:function(){return!0}},{key:"toString",value:function(){return""}}])&&pm(n.prototype,r),o&&pm(n,o),e}(ov);function gm(t){return(gm="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function mm(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wm(t,e){for(var n=0;n"))}}])&&hw(n.prototype,r),o&&hw(n,o),e}(ov);function ww(t){return(ww="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ow(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kw(t,e){for(var n=0;n"))}}])&&kw(n.prototype,r),o&&kw(n,o),e}(ov);function Ew(t){return(Ew="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _w(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cw(t,e){for(var n=0;n"))}}])&&Cw(n.prototype,r),o&&Cw(n,o),e}(ov);function Iw(t){return(Iw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Lw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mw(t,e){for(var n=0;n")}}])&&Mw(n.prototype,r),o&&Mw(n,o),e}(ov);function Xw(t){return(Xw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Nw(t,e){for(var n=0;n")}}])&&Nw(n.prototype,r),o&&Nw(n,o),e}(ov);function Jw(t){return(Jw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Qw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function tO(t,e){for(var n=0;n")}}])&&tO(n.prototype,r),o&&tO(n,o),e}(ov);function aO(t){return(aO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function cO(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function uO(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return yO(hO(e.prototype),"getDefaultObject",this).call(this,uO({itemType:"svgfilter",result:""},t))}},{key:"getDefaultAttribute",value:function(){var t=this;return vO.map((function(e){return"".concat(e,'="').concat(t.json[e],'"')})).join(" ")}},{key:"toString",value:function(){var t=this.json,e=t.type,n=t.value;return"")}}])&&fO(n.prototype,r),o&&fO(n,o),e}(Mo),gO={Image:iO,Tile:qw,Saturate:$w,HueRotate:Aw,LuminanceAlpha:Hw,DropShadow:mw,SourceGraphic:Pm,SourceAlpha:Dm,BackgroundImage:Fm,BackgroundAlpha:Um,FillPaint:rw,StrokePaint:fw,ComponentTransfer:Gb,DistantLight:Zb,PointLight:og,SpotLight:pg,DiffuseLighting:kg,SpecularLighting:Rg,Blend:am,Offset:zg,RotaMatrix:pv,GaussianBlur:kb,Flood:Cb,Merge:wv,Composite:Ev,Morphology:Iv,Turbulence:Xv,DisplacementMap:Jv,ColorMatrix:ab,ConvolveMatrix:hb},mO={Image:iO.spec,Tile:qw.spec,DropShadow:mw.spec,Saturate:$w.spec,HueRotate:Aw.spec,LuminanceAlpha:Hw.spec,Offset:zg.spec,ComponentTransfer:Gb.spec,SpecularLighting:Rg.spec,SpotLight:pg.spec,PointLight:og.spec,DistantLight:Zb.spec,DiffuseLighting:kg.spec,Blend:am.spec,RotaMatrix:pv.spec,Merge:wv.spec,GaussianBlur:kb.spec,Flood:Cb.spec,Morphology:Iv.spec,Composite:Ev.spec,Turbulence:Xv.spec,DisplacementMap:Jv.spec,ColorMatrix:ab.spec,ConvolveMatrix:hb.spec};function wO(t){return(wO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function OO(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return this.addProperty(jO({checked:!0,value:rn.px(0)},t))}},{key:"addProperty",value:function(t){this.json.properties.push(t)}},{key:"removeProperty",value:function(t){this.json.properties.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};Object.assign(this.json.properties[+t],jO({},e))}},{key:"updatePropertyByKey",value:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.json.properties,r=-1,o=0,i=n.length;oe.offset.value?1:-1})),e.map((function(e){return 0===e.properties.length?"":t.toOffsetString(e)})).join("\n")}},{key:"toCSSText",value:function(){return this.json.offsets.map((function(t){return t})).sort((function(t,e){return t.offset.value>e.offset.value?1:-1})),"\n@keyframes ".concat(this.json.name," {\n\n ").concat(this.toOffsetText(),"\n\n}\n")}},{key:"createOffset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addOffset(new TO(LO({checked:!0},t)))}},{key:"addOffset",value:function(t){this.json.offsets.push(t)}},{key:"removeOffset",value:function(t){this.json.offsets.splice(t,1)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.offsets[+t].reset(e)}},{key:"toCSS",value:function(){return{}}},{key:"toString",value:function(){return this.toCSSText()}}])&&zO(n.prototype,r),o&&zO(n,o),e}(Mo);function NO(t){return(NO="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function KO(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return fk(pk(e.prototype),"getDefaultObject",this).call(this,ik({itemType:"project",name:"new Project",description:"",rootVariable:""},t))}},{key:"toCloneObject",value:function(){var t=this.json,n=t.name,r=t.description,o=t.rootVariable;return ik({},fk(pk(e.prototype),"toCloneObject",this).call(this),{name:n,description:r,rootVariable:o})}},{key:"isAbsolute",get:function(){return!1}},{key:"artboards",get:function(){return this.json.layers||[]}},{key:"html",get:function(){return this.artboards.map((function(t){return t.html})).join("\n\n")}}])&&sk(n.prototype,r),o&&sk(n,o),e}(function(t){function e(){return qO(this,e),QO(this,ek(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&nk(t,e)}(e,t),n=e,(r=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return tk(ek(e.prototype),"getDefaultObject",this).call(this,UO({colors:[],gradients:[],svgfilters:[],svgimages:[],keyframes:[],images:[]},t))}},{key:"addKeyframe",value:function(t){return this.json.keyframes.push(t),t}},{key:"createKeyframe",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addKeyframe(new YO(UO({checked:!0},t)))}},{key:"removeKeyframe",value:function(t){this.removePropertyList(this.json.keyframes,t)}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1]?arguments[1]:{};this.json.keyframes[+t].reset(e)}},{key:"toKeyframeString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.json.keyframes.map((function(e){return e.toString(t)})).join("\n\n")}},{key:"copyPropertyList",value:function(t,e){var n=UO({},t[e]);t.splice(e,0,n)}},{key:"toSVGString",value:function(){return this.json.svgfilters.map((function(t){var e=t.filters.map((function(t){return bO.parse(t)}));return("\n ").concat(e.join("\n"),"\n\n"))})).join("\n\n")}},{key:"toCloneObject",value:function(){var t=this.json;return UO({},tk(ek(e.prototype),"toCloneObject",this).call(this),{colors:X(t.colors),gradients:X(t.gradients),svgfilters:X(t.svgfilters),svgimages:X(t.svgimages),images:X(t.images),keyframes:t.keyframes.map((function(t){return t.clone()}))})}},{key:"removePropertyList",value:function(t,e){t.splice(e,1)}},{key:"removeColor",value:function(t){this.removePropertyList(this.json.colors,t)}},{key:"copyColor",value:function(t){this.copyPropertyList(this.json.colors,t)}},{key:"sortColor",value:function(t,e){this.sortItem(this.json.colors,t,e)}},{key:"setColorValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.colors[t]=UO({},this.json.colors[t],{},e)}},{key:"getColorIndex",value:function(t){return this.json.colors[t]}},{key:"getColor",value:function(t){return this.json.colors.filter((function(e){return e.name===t}))[0]}},{key:"addColor",value:function(t){return this.json.colors.push(t),t}},{key:"createColor",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addColor(t)}},{key:"removeImage",value:function(t){this.removePropertyList(this.json.images,t)}},{key:"copyImage",value:function(t){this.copyPropertyList(this.json.images,t)}},{key:"sortImage",value:function(t,e){this.sortItem(this.json.images,t,e)}},{key:"setImageValue",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.json.images[t]=UO({},this.json.images[t],{},e)}},{key:"addImage",value:function(t){return this.json.images.push(t),t}},{key:"createImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addImage(t)}},{key:"removeGradient",value:function(t){this.removePropertyList(this.json.gradients,t)}},{key:"copyGradient",value:function(t){this.copyPropertyList(this.json.gradients,t)}},{key:"sortGradient",value:function(t,e){this.sortItem(this.json.gradients,t,e)}},{key:"setGradientValue",value:function(t,e){this.json.gradients[t]=UO({},this.json.gradients[t],{},e)}},{key:"getGradientIndex",value:function(t){return this.json.gradients[t]}},{key:"getGradient",value:function(t){return this.json.gradients.filter((function(e){return e.name===t}))[0]}},{key:"addGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.json.gradients.push(t),t}},{key:"createGradient",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addGradient(t)}},{key:"getSVGFilterIndex",value:function(t){var e=this.json.svgfilters.map((function(t,e){return{id:t.id,index:e}})).filter((function(e){return e.id===t}))[0];return e?e.index:-1}},{key:"removeSVGFilter",value:function(t){this.removePropertyList(this.json.svgfilters,t)}},{key:"copySVGFilter",value:function(t){this.copyPropertyList(this.json.svgfilters,t)}},{key:"sortSVGFilter",value:function(t,e){this.sortItem(this.json.svgfilters,t,e)}},{key:"setSVGFilterValue",value:function(t,e){this.json.svgfilters[t]=UO({},this.json.svgfilters[t],{},e)}},{key:"addSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgfilters.push(t);var e=this.json.svgfilters.length-1;return e}},{key:"createSVGFilter",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGFilter(t)}},{key:"getSVGImageIndex",value:function(t){var e=this.json.svgimages.map((function(t,e){return{id:t.id,index:e}})).filter((function(e){return e.id===t}))[0];return e?e.index:-1}},{key:"removeSVGImage",value:function(t){this.removePropertyList(this.json.svgimages,t)}},{key:"copySVGImage",value:function(t){this.copyPropertyList(this.json.svgimages,t)}},{key:"sortSVGImage",value:function(t,e){this.sortItem(this.json.svgimages,t,e)}},{key:"setSVGImageValue",value:function(t,e){this.json.svgimages[t]=UO({},this.json.svgimages[t],{},e)}},{key:"addSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.json.svgimages.push(t);var e=this.json.svgimages.length-1;return e}},{key:"createSVGImage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.addSVGImage(t)}}])&&JO(n.prototype,r),o&&JO(n,o),e}(Eo));function dk(t){return(dk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vk(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bk(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};return Tk(Rk(e.prototype),"getDefaultObject",this).call(this,xk({itemType:"cube",name:"New Cube","transform-style":"preserve-3d","backface-visibility":"visible",rate:rn.number(1),transform:"rotateX(10deg) rotateY(30deg)",border:"border:1px solid black"},t))}},{key:"getProps",value:function(){return[{key:"rate",editor:"NumberRangeEditor",editorOptions:{label:"radius",min:0,max:10,step:.1},refresh:!0,defaultValue:this.json.rate.value},{key:"backface-visibility",editor:"SelectIconEditor",editorOptions:{label:"visibility",options:"visible,hidden"},refresh:!0,defaultValue:this.json["backface-visibility"]},"Color"].concat(Sk(Vk.map((function(t){return{key:"".concat(t,".color"),editor:"ColorViewEditor",editorOptions:{label:t,params:"".concat(t,".color")},defaultValue:"rgba(0, 0, 0, 1)"}}))),["Background"],Sk(Vk.map((function(t){return{key:"".concat(t,".background"),editor:"BackgroundImageEditor",editorOptions:{title:t},defaultValue:""}}))))}},{key:"setCustomKeyframes",value:function(t,e){e.property.includes(".color")&&t.push({selector:'[data-id="'.concat(this.json.id,'"] ').concat(Ak[e.property]),properties:[xk({},e,{property:"background-color"})]}),e.property.includes(".background")&&t.push({selector:'[data-id="'.concat(this.json.id,'"] ').concat(Ak[e.property]),properties:[xk({},e,{property:"background-image"})]})}},{key:"toAnimationKeyframes",value:function(t){var e=this,n=[],r=[],o=[];t.forEach((function(t){t.property.includes(".color")||t.property.includes(".background")?n.push(t):Ik[t.property]?r.push(t):Lk[t.property]&&o.push(t)}));var i=[];return r.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"]'),properties:r}),o.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"] div'),properties:o}),n.length&&n.forEach((function(t){e.setCustomKeyframes(i,t)})),i}},{key:"convert",value:function(t){return(t=Tk(Rk(e.prototype),"convert",this).call(this,t)).rate=rn.parse(t.rate),t}},{key:"toCloneObject",value:function(){var t=this,n={};return Vk.forEach((function(e){n["".concat(e,".color")]=t.json["".concat(e,".color")],n["".concat(e,".background")]=t.json["".concat(e,".background")]})),xk({},Tk(Rk(e.prototype),"toCloneObject",this).call(this),{rate:this.json.rate.clone()},n)}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Cube"}},{key:"getIcon",value:function(){return Vd.cube}},{key:"toDefaultCSS",value:function(){var t={};return this.json.x&&(t.left=this.json.x),this.json.y&&(t.top=this.json.y),t.visibility=this.json.visible?"visible":"hidden",xk({},t,{},this.toKeyListCSS("position","right","bottom","width","height","transform-origin","transform","transform-style","perspective","perspective-origin"))}},{key:"toCSS",value:function(){return xk({},this.toVariableCSS(),{},this.toDefaultCSS(),{},this.toWebkitCSS(),{},this.toBoxModelCSS(),{},this.toAnimationCSS(),{},this.toTransitionCSS(),{},this.toLayoutItemCSS())}},{key:"toNestedCSS",value:function(){var t=this.json,e=t.rate.value,n=t.width,r=t.height,o=n.value/2,i=r.value/2,a=t["backface-visibility"],c=xk({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","background-color","opacity","color"),{},this.toClipPathCSS(),{},this.toBackgroundImageCSS(),{},this.toBorderCSS());return[{selector:"div",cssText:"\n position: absolute;\n left: 0px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n opacity: 1;\n pointer-events: none;\n ".concat(q(c),"\n ").trim()},{selector:".front",cssText:"\n transform:rotateY(0deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["front.color"]?"background-color: ".concat(t["front.color"],";"):"","\n ").concat(t["front.background"]?"".concat(t["front.background"],";"):"","\n\n ").trim()},{selector:".back",cssText:"\n transform: rotateY(180deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["back.color"]?"background-color: ".concat(t["back.color"],";"):""," \n ").concat(t["back.background"]?"".concat(t["back.background"],";"):"","\n ").trim()},{selector:".left",cssText:"\n transform: rotateY(-90deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["left.color"]?"background-color: ".concat(t["left.color"],";"):""," \n ").concat(t["left.background"]?"".concat(t["left.background"],";"):"","\n ").trim()},{selector:".right",cssText:"\n transform: rotateY(90deg) translateZ(".concat(o*e,"px);\n width: ").concat(n,";\n height: ").concat(r,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["right.color"]?"background-color: ".concat(t["right.color"],";"):""," \n ").concat(t["right.background"]?"".concat(t["right.background"],";"):""," \n ").trim()},{selector:".top",cssText:"\n transform: rotateX(90deg) translateZ(".concat(i*e,"px);\n top: ").concat(i-o,"px;\n width: ").concat(n,";\n height: ").concat(n,";\n backface-visibility: ").concat(a,"; \n ").concat(t["top.color"]?"background-color: ".concat(t["top.color"],";"):""," \n ").concat(t["top.background"]?"".concat(t["top.background"],";"):""," \n ").trim()},{selector:".bottom",cssText:"\n transform: rotateX(-90deg) translateZ(".concat(i*e,"px);\n top: ").concat(i-o,"px; \n width: ").concat(n,";\n height: ").concat(n,"; \n backface-visibility: ").concat(a,"; \n ").concat(t["bottom.color"]?"background-color: ".concat(t["bottom.color"],";"):"","\n ").concat(t["bottom.background"]?"".concat(t["bottom.background"],";"):""," \n ").trim()}]}},{key:"toSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.width,i=r.height,a=this.toCSS(),c=this.toNestedCSS(),u={},s=c.find((function(t){return"div"===t.selector}))||{cssText:""};return s=s.cssText.replace(/\n/g,""),Vk.forEach((function(t){u[t]=c.find((function(e){return e.selector==="."+t}))||{cssText:""},u[t]=u[t].cssText.replace(/\n/g,"")})),n?(delete a.left,delete a.top,"absolute"===a.position&&delete a.position,this.wrapperRootSVG(t,e,o,i,'\n
\n ').concat(Vk.map((function(t){return'
')})).join("")," \n
\n "))):"\n ".concat(this.toDefString,'\n
\n ').concat(Vk.map((function(t){return'
')})).join("")," \n
\n ")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType;return("\n
\n ').concat(this.toDefString,"\n ").concat(Vk.map((function(t){return"
")})).join(""),"\n
"))}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&_k(n.prototype,r),o&&_k(n,o),e}(kk);function Bk(t){return(Bk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function zk(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Fk(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return Wk(Uk(e.prototype),"getDefaultObject",this).call(this,Hk({itemType:"cylinder",name:"New Cylinder","transform-style":"preserve-3d","backface-visibility":"visible",transform:"rotateX(10deg) rotateY(30deg)",count:rn.number(40),rate:rn.number(1),border:"border-top: 1px solid black;border-bottom: 1px solid black;"},t))}},{key:"getProps",value:function(){var t=this.json.count.value;return["Side",{key:"count",editor:"NumberRangeEditor",editorOptions:{label:"Count",min:3,max:100,step:1},refresh:!0,defaultValue:t},{key:"rate",editor:"NumberRangeEditor",editorOptions:{label:"radius",min:0,max:10,step:.1},refresh:!0,defaultValue:this.json.rate.value},{key:"backface-visibility",editor:"SelectIconEditor",editorOptions:{label:"visibility",options:"visible,hidden"},refresh:!0,defaultValue:this.json["backface-visibility"]},"Color"].concat(Fk(K(t).map((function(t,e){return{key:"face.".concat(e,".color"),editor:"ColorViewEditor",editorOptions:{label:"face ".concat(e),params:"face.".concat(e,".color")},defaultValue:"rgba(0, 0, 0, 1)"}}))),["Background"],Fk(K(t).map((function(t,e){return{key:"face.".concat(e,".background"),editor:"BackgroundImageEditor",editorOptions:{title:"face ".concat(e)},defaultValue:""}}))))}},{key:"setCustomKeyframes",value:function(t,e){var n=this;if("rate"===e.property){var r=this.json.width,o=this.json.count.value,i=r.value/2,a=360/o,c=K(o).map((function(t,r){var o=r*a;return{selector:'[data-id="'.concat(n.json.id,'"] .face[data-index="').concat(r,'"]'),properties:[{keyframes:e.keyframes.map((function(t){var e=t.time,n=t.value,r=t.timing;return{time:e,value:"rotateY(".concat(o,"deg) translateZ(").concat(i*n,"px)"),timing:r}})),property:"transform"}]}}));t.push.apply(t,Fk(c))}if(e.property.includes(".color")){var u=zk(e.property.split("."),3),s=(u[0],u[1]);u[2],t.push({selector:'[data-id="'.concat(this.json.id,'"] .face[data-index="').concat(s,'"]'),properties:[Hk({},e,{property:"background-color"})]})}if(e.property.includes(".background")){var l=zk(e.property.split("."),3);l[0],s=l[1],l[2],t.push({selector:'[data-id="'.concat(this.json.id,'"] .face[data-index="').concat(s,'"]'),properties:[Hk({},e,{property:"background-image"})]})}}},{key:"toAnimationKeyframes",value:function(t){var e=this,n=[],r=[],o=[];t.forEach((function(t){t.property.includes("face")||qk[t.property]?n.push(t):Jk[t.property]?r.push(t):Qk[t.property]&&o.push(t)}));var i=[];return r.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"]'),properties:r}),o.length&&i.push({selector:'[data-id="'.concat(this.json.id,'"] div'),properties:o}),n.length&&n.forEach((function(t){e.setCustomKeyframes(i,t)})),i}},{key:"convert",value:function(t){return(t=Wk(Uk(e.prototype),"convert",this).call(this,t)).count=rn.parse(t.count),t.rate=rn.parse(t.rate),t}},{key:"toCloneObject",value:function(){var t=this,n={};return K(this.json.count.value).forEach((function(e,r){n["face.".concat(r,".color")]=t.json["face.".concat(r,".color")],n["face.".concat(r,".background")]=t.json["face.".concat(r,".background")]})),Hk({},Wk(Uk(e.prototype),"toCloneObject",this).call(this),{count:this.json.count.clone(),rate:this.json.rate.clone()},n)}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Cylinder"}},{key:"getIcon",value:function(){return Vd.cylinder}},{key:"toDefaultCSS",value:function(){var t={};return this.json.x&&(t.left=this.json.x),this.json.y&&(t.top=this.json.y),Hk({},t,{},this.toKeyListCSS("position","right","bottom","width","height","transform-origin","transform","transform-style","perspective","perspective-origin"))}},{key:"toCSS",value:function(){return Hk({},this.toVariableCSS(),{},this.toDefaultCSS(),{},this.toWebkitCSS(),{},this.toBoxModelCSS(),{},this.toAnimationCSS(),{},this.toTransitionCSS())}},{key:"toNestedCSS",value:function(){var t=this.json,e=t.count.value,n=t.width,r=t["backface-visibility"],o=t.rate.value,i=this.cylinderInfo,a=i.angle,c=i.r,u=i.faceWidth,s=Hk({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","opacity","background-color"),{},this.toBackgroundImageCSS(),{},this.toBorderCSS(),{},this.toClipPathCSS()),l=K(e).map((function(e,n){var r=n*a,i="face.".concat(n,".color"),u="face.".concat(n,".background");return{selector:'.face[data-index="'.concat(n,'"]'),cssText:"\n transform:rotateY(".concat(r,"deg) translateZ(").concat(c*o,"px);\n ").concat(t[i]?"background-color: ".concat(t[i],";"):"","\n ").concat(t[u]?"".concat(t[u],";"):"","\n ").trim()}}));return[{selector:".face",cssText:"\n position: absolute;\n left: ".concat(n.value/2-u/2,"px;\n top: 0px;\n bottom: 0px;\n right: 0px;\n width: ").concat(u,"px;\n backface-visibility: ").concat(r,";\n opacity: 1;\n pointer-events: none;\n ").concat(q(s),"\n ").trim()}].concat(Fk(l))}},{key:"updateFunction",value:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Wk(Uk(e.prototype),"updateFunction",this).call(this,t,n),n){var r=+t.attr("data-count");if(r!==this.json.count.value){t.$$(".face").forEach((function(t){return t.remove()}));var o=K(this.json.count.value).map((function(t,e){return"
')})).join("");t.appendHTML(o),t.attr("data-count",this.json.count)}}}},{key:"cylinderInfo",get:function(){var t=this.json.width.value,e={x:a=t/2,y:t/2},n=[],r=this.json.count.value;r<3&&(r=3);for(var o=360/r,i=0;i<360;i+=o)n.push(dt(i,a,e.x,e.y));var a,c=vt(n[0].x,n[0].y,n[1].x,n[1].y),u={x:(n[0].x+n[1].x)/2,y:(n[0].y+n[1].y)/2};return{polygon:n,faceWidth:c,angle:o,r:a=vt(u.x,u.y,e.x,e.y)}}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=this.json.count.value;return"\n
\n ').concat(this.toDefString,"\n ").concat(K(r).map((function(t,e){return"
')})).join(""),"\n
")}},{key:"svg",get:function(){var t=this.json,e=t.width,n=t.height,r=t.x,o=t.y;r=r.value,o=o.value;var i=this.toCSS(),a=this.toNestedCSS(),c=this.json.count.value,u=a.find((function(t){return".face"===t.selector}))||{cssText:""};u=u.cssText.replace(/\n/g,"");var s=K(c).map((function(t,e){return a[e+1].cssText.replace(/\n/g,"")}));return delete i.left,delete i.top,"absolute"===i.position&&delete i.position,'\n \n ').concat(this.toDefString,"\n \n
\n
\n ').concat(K(c).map((function(t,e){return"
")})).join(""),"\n
\n
\n
\n
\n")}}])&&Nk(n.prototype,r),o&&Nk(n,o),e}(kk);function ej(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e8&&void 0!==arguments[8]?arguments[8]:1e3,s=uj({x:t,y:e},{x:n,y:r},{x:o,y:i},{x:a,y:c}),l=0,f=s(0),p=0;p<=u;p++){var y=p/u,h=s(y);l+=vt(f.x,f.y,h.x,h.y),f=h}return l},yj=function(t,e,n,r,o,i){for(var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:1e3,c=sj({x:t,y:e},{x:n,y:r},{x:o,y:i}),u=0,s=c(0),l=0;l<=a;l++){var f=l/a,p=c(f);u+=vt(s.x,s.y,p.x,p.y),s=p}return u},hj=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n={minDist:1/0,minT:0};return function(r,o){for(var i=0;i<=e;i++)fj(n,t,i/e,r,o);var a=1/(2*e),c=n.minT;for(i=0;i4&&void 0!==arguments[4]?arguments[4]:100;return hj(uj(t,e,n,r),o)},vj=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;return hj(sj(t,e,n),r)},bj=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100;return hj(lj(t,e),n)},gj=function(t){if("linear"===t)return lj(n={x:0,y:0},r={x:1,y:1});var e=cj(t),n={x:0,y:0},r={x:e[0],y:e[1]},o={x:e[2],y:e[3]};return uj(n,r,o,{x:1,y:1})},mj=function(t,e,n){return{x:t.x+(e.x-t.x)*n,y:t.y+(e.y-t.y)*n}},wj=function(t,e){var n=mj(t[0],t[1],e),r=mj(t[1],t[2],e),o=mj(t[2],t[3],e),i=mj(n,r,e),a=mj(r,o,e);return mj(i,a,e)},Oj=function(t,e){var n=mj(t[0],t[1],e),r=mj(t[1],t[2],e);return mj(n,r,e)},kj=function(t,e){return mj(t[0],t[1],e)},jj=function(t,e){var n=mj(t[0],t[1],e),r=mj(t[1],t[2],e),o=mj(t[2],t[3],e),i=mj(n,r,e),a=mj(r,o,e),c=mj(i,a,e);return{first:[t[0],n,i,c],second:[c,a,o,t[3]]}},Sj=function(t,e){var n=mj(t[0],t[1],e),r=mj(t[1],t[2],e),o=mj(n,r,e);return{first:[t[0],n,o],second:[o,r,t[2]]}},Pj=function(t,e){var n=mj(t[0],t[1],e);return{first:[t[0],n],second:[n,t[1]]}};function xj(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;return function(t,e){var i=0;return i=0===e?n:1===e?r:n+(r-n)*t,o?i+o:i}}function $j(t,e,n){return function(t,e){return n}}function Ej(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"width",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"parent",i=null;return"parent"===o?i=t[o][r]:"self"===o&&(i=t[r]),i?n.toPx(i.value):n}function _j(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",a=null;return"parent"===i?a=t[i][o]:"self"===i&&(a=t[o]),a?n.to(r,a.value):n}function Cj(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"width",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"parent",a=rn.parse(n),c=rn.parse(r);return a.unit===c.unit?xj(t,e,a.value,c.value,a.unit):a.equals(c)?$j(0,0,a):function(n,r){var u=Ej(t,e,a,o,i),s=Ej(t,e,c,o,i);return 0===r?u:1===r?s:_j(t,e,rn.px(u.value+(s.value-u.value)*n),a.unit,o,i)}}function Tj(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return t=+t,function(n){var r=1/t;return"start"==e?r*Math.ceil(n/r):"end"==e?r*Math.floor(n/r):void 0}};function Zj(){return Uj(1,"start")}function qj(){return Uj(1,"end")}var Jj=function(){return function(t){return Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1}},Qj={step:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"end";return Uj(t,e)},"step-start":Zj,"step-end":qj,stepStart:Zj,stepEnd:qj,"ease-out-elastic":Jj,easeOutElastic:Jj};function tS(t,e,n){return n.toDeg()}function eS(t,e,n,r){var o=rn.parse(n),i=rn.parse(r);return function(t,e){var n=tS(0,0,o),r=tS(0,0,i);return 0===e?n:1===e?r:rn.deg(n.value+(r.value-n.value)*t).to(o.unit)}}function nS(t){return(nS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rS(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function oS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function iS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function aS(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=Math.max(n.length,r.length),i=[],a=0;a0&&void 0!==arguments[0]?arguments[0]:{};return RS(DS(e.prototype),"getDefaultObject",this).call(this,xS({itemType:"filter"},t))}},{key:"toString",value:function(){return"".concat(this.json.type,"(").concat(this.json.value||"",")")}}],[{key:"parse",value:function(t){var e=US[t.type];return e?new e(t):new BS({value:t.type})}},{key:"parseStyle",value:function(t){var n=[];if(!t)return n;var r=we(t);return(r.str.match(IS)||[]).forEach((function(t,o){var i=SS(t.split("("),2),a=i[0],c=i[1];if(c=c.split(")")[0],"drop-shadow"===a){var u=c.split(" "),s=u.filter((function(t){return t.includes("@")})).map((function(t){return r.matches[+t.replace("@","")].color})),l=u.filter((function(t){return!t.includes("@")}));n[o]=e.parse({type:a,offsetX:rn.parse(l[0]),offsetY:rn.parse(l[1]),blurRadius:rn.parse(l[2]),color:s[0]||"rgba(0, 0, 0, 1)"})}else n[o]=e.parse({type:a,value:rn.parse(c)})})),n}},{key:"join",value:function(t){return t.map((function(t){return e.parse(t)})).join(" ")}}]),e}(Mo),MS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"blur",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return xS({},RS(DS(e.prototype),"toCloneObject",this).call(this),{value:rn.parse(this.json.value)})}}]),e}(LS);MS.spec={inputType:"range",min:0,max:100,step:1,unit:"px",units:["px","em"],defaultValue:rn.px(0)};var BS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"svg",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return xS({},RS(DS(e.prototype),"toCloneObject",this).call(this),{value:rn.parse(this.json.value)})}},{key:"toString",value:function(){return"url(#".concat(this.json.value||"",")")}}]),e}(LS);BS.spec={inputType:"select",defaultValue:""};var zS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"grayscale",value:e.spec.defaultValue})}},{key:"toCloneObject",value:function(){return xS({},RS(DS(e.prototype),"toCloneObject",this).call(this),{value:rn.parse(this.json.value)})}}]),e}(LS);zS.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:rn.percent(0)};var FS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"hue-rotate",value:e.spec.defaultValue})}}]),e}(LS);FS.spec={inputType:"range",min:0,max:360,step:1,unit:"deg",units:["deg"],defaultValue:rn.deg(0)};var GS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"invert",value:e.spec.defaultValue})}}]),e}(LS);GS.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:rn.percent(0)};var HS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"brightness",value:e.spec.defaultValue})}}]),e}(LS);HS.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:rn.percent(100)};var XS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"contrast",value:e.spec.defaultValue})}}]),e}(LS);XS.spec={inputType:"range",min:0,max:200,step:1,unit:"%",units:["%"],defaultValue:rn.percent(100)};var YS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"opacity",value:e.spec.defaultValue})}}]),e}(LS);YS.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:rn.percent(100)};var NS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"saturate",value:e.spec.defaultValue})}}]),e}(LS);NS.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:rn.percent(100)};var KS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"sepia",value:e.spec.defaultValue})}}]),e}(LS);KS.spec={inputType:"range",min:0,max:100,step:1,unit:"%",units:["%"],defaultValue:rn.percent(0)};var WS=function(t){function e(){return ES(this,e),TS(this,DS(e).apply(this,arguments))}return VS(e,t),CS(e,[{key:"getDefaultObject",value:function(){return RS(DS(e.prototype),"getDefaultObject",this).call(this,{type:"drop-shadow",multi:!0,offsetX:e.spec.offsetX.defaultValue,offsetY:e.spec.offsetY.defaultValue,blurRadius:e.spec.blurRadius.defaultValue,color:e.spec.color.defaultValue})}},{key:"toString",value:function(){var t=this.json;return"drop-shadow(".concat(t.offsetX," ").concat(t.offsetY," ").concat(t.blurRadius," ").concat(t.color,")")}}]),e}(LS);WS.spec={offsetX:{title:"Offset X",inputType:"range",min:-100,max:100,step:1,defaultValue:rn.px(0),unit:"px",units:["px","em"]},offsetY:{title:"Offset Y",inputType:"range",min:-100,max:100,step:1,defaultValue:rn.px(0),unit:"px",units:["px","em"]},blurRadius:{title:"Blur Radius",inputType:"range",min:0,max:100,step:1,defaultValue:rn.px(0),unit:"px",units:["px","em","%"]},color:{title:"Color",inputType:"color",defaultValue:"rgba(0, 0, 0, 1)",unit:"color"}};var US={blur:MS,grayscale:zS,"hue-rotate":FS,invert:GS,brightness:HS,contrast:XS,opacity:YS,saturate:NS,sepia:KS,"drop-shadow":WS,svg:BS},ZS={BlurFilter:MS,GrayscaleFilter:zS,HueRotateFilter:FS,InvertFilter:GS,BrightnessFilter:HS,ContrastFilter:XS,OpacityFilter:YS,SaturateFilter:NS,SepiaFilter:KS,DropshadowFilter:WS,URLSvgFilter:BS};function qS(t,e,n,r){var o={type:Wj(0,0,n.type,r.type),value:Yj(0,0,n.value,r.value)};switch(n.type){case"blur":o.value=Cj(t,e,n.value,r.value);break;case"grayscale":case"invert":case"brightness":case"contrast":case"opacity":case"saturate":case"sepia":case"hue-rotate":o.value=xj(t,e,n.value.value,r.value.value,n.value.unit);break;case"drop-shadow":o.offsetX=Cj(t,e,n.offsetX,r.offsetX,"width","self"),o.offsetY=Cj(t,e,n.offsetY,r.offsetY,"height","self"),o.blurRadius=Cj(t,e,n.blurRadius,r.blurRadius,"width","self"),o.spreadRadius=Cj(t,e,n.spreadRadius,r.spreadRadius,"width","self"),o.color=Nj(0,0,n.color,r.color)}return function(t,e){return"drop-shadow"===o.type(t,e)?{type:o.type(t,e),offsetX:o.offsetX(t,e),offsetY:o.offsetY(t,e),blurRadius:o.blurRadius(t,e),spreadRadius:o.spreadRadius(t,e),color:o.color(t,e)}:{type:o.type(t,e),value:o.value(t,e)}}}function JS(t,e,n,r){for(var o=LS.parseStyle(n),i=LS.parseStyle(r),a=Math.max(o.length,i.length),c=[],u=0,s=a;u0&&void 0!==arguments[0]?arguments[0]:"";return sP(this,e),fP(this,pP(e).call(this,t))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&yP(t,e)}(e,t),n=e,(r=[{key:"reset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.segments=[],this.points=t,this.parse()}},{key:"resetSegments",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.segments=t,this.points=this.joinPoints()}},{key:"parse",value:function(){var t=this.points;L(t)&&(t=t.join(" "));for(var e=t.trim().split(hP).filter((function(t){return t})),n=[],r=0,o=e.length;r1&&void 0!==arguments[1]&&arguments[1],r=this.segments.map((function(n){return t.call(e,n)}));if(n)return r;this.segments=r}},{key:"_loop",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.each((function(e){var n=uP(t([e.x,e.y],0),2),r=n[0],o=n[1];return e.x=r,e.y=o,e}),e)}},{key:"clone",value:function(){return new e(this.joinPoints())}},{key:"toString",value:function(){return this.joinPoints()}}])&&lP(n.prototype,r),o&&lP(n,o),e}(ra);function vP(t,e,n,r){for(var o=Math.max(n.length,r.length),i=[],a=n[n.length-1],c=r[r.length-1],u=0;u1&&(e-=1);var c=i[0];0===e?c=i[0]:1===e&&(c=i[i.length-1]);var u=i.find((function(t){return t.startT<=e&&e4&&void 0!==arguments[4]&&arguments[4];var o=r.length-1,i=0;return function(t,e){return 0===e?"":1===e?r:r.substring(i,Math.floor((o-i)*e))}}function _P(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:"linear",e=t.split("(").map((function(t){return t.trim()})),n=CP(e,2),r=n[0],o=n[1];o=(o||"").split(")")[0].trim();var i=Qj[r];if(i){var a=t.split("(")[1].split(")")[0].split(",").map((function(t){return t.trim()}));return i.apply(void 0,_P(a))}return AP(t)}function AP(t){var e=gj(t);return function(t){return e(t).y}}function IP(t){return(IP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function LP(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return tx(ex(e.prototype),"getDefaultObject",this).call(this,UP({itemType:"artboard",name:"New ArtBoard",width:rn.px(1e3),height:rn.px(1e3),"background-color":"white"},t))}},{key:"isLeaf",value:function(){return!1}},{key:"toCloneObject",value:function(){return UP({},tx(ex(e.prototype),"toCloneObject",this).call(this),{name:this.json.name})}},{key:"getDefaultTitle",value:function(){return"ArtBoard"}},{key:"getIcon",value:function(){return Vd.artboard}},{key:"toDefaultCSS",value:function(){return UP({},tx(ex(e.prototype),"toDefaultCSS",this).call(this))}}])&&JP(n.prototype,r),o&&JP(n,o),e}(function(t){function e(){return FP(this,e),HP(this,YP(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&NP(t,e)}(e,t),n=e,(r=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return XP(YP(e.prototype),"getDefaultObject",this).call(this,BP({timeline:[],compiledTimeline:{}},t))}},{key:"expectJSON",value:function(t){return"compiledTimeline"!==t&&XP(YP(e.prototype),"expectJSON",this).call(this,t)}},{key:"setTimelineInfo",value:function(t){var e=this.getSelectedTimeline();e&&["speed","iterationCount","direction"].forEach((function(n){I(t[n])&&(e[n]=t[n])}))}},{key:"compileAll",value:function(){var t=this,e=this.getSelectedTimeline();this.json.compiledTimeline={},e&&e.animations.forEach((function(e){e.properties.forEach((function(n){t.compiledTimingFunction(e.id,n.property)}))}))}},{key:"searchTimelineOffset",value:function(t){var e=this,n=this.getSelectedTimeline(),r=[];return n&&n.animations.forEach((function(n){n.properties.forEach((function(o){var i=e.getCompiledTimingFunction(n.id,o.property);r.push(i.find((function(e){return!!(e.isOnlyTime&&e.startTime<=t)||e.startTime<=t&&t1&&void 0!==arguments[1]?arguments[1]:function(t){return t},n=this.getSelectedTimeline();if(n){I(t)&&this.setTimelineCurrentTime(t);var r=n.currentTime;this.searchTimelineOffset(r).filter(e).forEach((function(t){"offset-path"===t.property?t.func(r):t.layer.reset(zP({},t.property,t.func(r)))}))}}},{key:"getSelectedTimeline",value:function(){var t=this.json.timeline,e=t.filter((function(t){return t.selected}));return(e.length?e[0]:t[0])||null}},{key:"getKeyframeListReturnArray",value:function(){var t=this.getSelectedTimeline(),e=[];return t&&t.animations.forEach((function(t){t.properties.forEach((function(t){e.push.apply(e,LP(t.keyframes))}))})),e}},{key:"getKeyframeList",value:function(t){var e=this.getSelectedTimeline();e&&e.animations.forEach((function(n){n.properties.forEach((function(n){n.keyframes.forEach((function(n){t&&t(e,n)}))}))}))}},{key:"getSelectedTimelineLastTime",value:function(){var t=0;return this.getKeyframeList((function(e,n){t=Math.max(n.time,t)})),t}},{key:"getSelectedTimelineFirstTime",value:function(){var t=Number.MAX_SAFE_INTEGER;return this.getKeyframeList((function(e,n){t=Math.min(n.time,t)})),t}},{key:"getSelectedTimelinePrevTime",value:function(){var t=this.getSelectedTimelineFirstTime();return this.getKeyframeList((function(e,n){qa(e.fps,n.time)e.currentTimecode&&(t=Math.min(n.time,t))})),t}},{key:"setTimelineTitle",value:function(t,e){var n=this.json.timeline.find((function(e){return e.id===t}));n&&(n.title=e)}},{key:"selectTimeline",value:function(t){t?this.json.timeline.forEach((function(e){e.selected=e.id===t})):this.json.timeline.filter((function(t){return t.selected})).length||this.json.timeline.length&&(this.json.timeline.selected=!0),this.compileAll()}},{key:"removeAnimation",value:function(t){this.json.timeline=this.json.timeline.filter((function(e){return e.id!==t})),this.json.timeline.length&&(this.json.timeline[0].selected=!0),this.compileAll()}},{key:"addTimeline",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00",n=jt(),r=BP({id:n,title:"sample"},this.getTimelineLayerInfo(t,e),{animations:[]});return this.json.timeline.push(r),this.selectTimeline(n),r}},{key:"addTimelineLayer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"00:00:10:00",r=this.getSelectedTimeline();if(r||(r=this.addTimeline(e,n)),r.selected=!0,t){var o=r.animations.filter((function(e){return e.id===t}));o[0]||r.animations.push({id:t,properties:[]})}}},{key:"getTimelineLayerInfo",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:60,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"00:00:10:00",n=Za(t,e);return{fps:t,speed:1,direction:"normal",iterationCount:1,currentTimecode:qa(t,0),totalTimecode:qa(t,n),currentTime:0,totalTime:n,displayStartTime:0,displayEndTime:n}}},{key:"setTimelineCurrentTime",value:function(t){var e=this.getSelectedTimeline(),n=e.fps,r=e.totalTimecode;if(e){var o=t,i=t;+o+""===o&&(i=Ja(n,o=+o)),i>r&&(i=r);var a=Za(n,i);e.currentTime=a,e.currentTimecode=qa(n,a)}}},{key:"setDisplayTimeDxRate",value:function(t,e,n){var r=this.getSelectedTimeline();if(r){var o=t*r.totalTime,i=e+o,a=n+o;i=Math.max(i,0),0===(i=Math.min(i,a))&&(a=n-e),a=Math.max(a,i),(a=Math.min(a,r.totalTime))===r.totalTime&&(i=r.totalTime-(n-e)),r.displayStartTime=i,r.displayEndTime=a}}},{key:"setDisplayStartTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayStartTime=t*e.totalTime)}},{key:"setDisplayEndTimeRate",value:function(t){var e=this.getSelectedTimeline();e&&(e.displayEndTime=t*e.totalTime)}},{key:"setTimelineCurrentTimeRate",value:function(t){var e=this.getSelectedTimeline();if(e){var n=e.displayStartTime,r=e.displayEndTime,o=e.fps,i=n+(r-n)*t;this.setTimelineCurrentTime(qa(o,i))}}},{key:"setTimelineTotalTime",value:function(t){var e=this.getSelectedTimeline();if(e){var n=t,r=t;+n+""===n&&(n=+n,r=Ja(e.fps,n)),Za(e.fps,r)3&&void 0!==arguments[3]?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:void 0,a=this.getTimelineKeyframeById(t,e,n);a&&(I(i)&&(a.time=i),I(r)&&(a.value=r),I(o)&&(a.timing=o),this.compiledTimingFunction(t,e))}},{key:"addTimelineKeyframe",value:function(t){var e=t.layerId,n=t.property,r=t.value,o=t.timing,i=t.time,a=t.editor;this.addTimelineProperty(e,n);var c=this.getSelectedTimeline(),u=this.getTimelineProperty(e,n);if(u){var s=i||c.currentTime;if(!u.keyframes.filter((function(t){return t.time===s})).length){r=A(r)||""===r?this.getDefaultPropertyValue(n):r;var l={id:jt(),layerId:e,property:n,time:s,value:r,timing:o||"linear",editor:a};return u.keyframes.push(l),u.keyframes.sort((function(t,e){return t.time>e.time?1:-1})),this.compiledTimingFunction(e,n),l}}}},{key:"getDefaultPropertyValue",value:function(t){switch(t){case"mix-blend-mode":return"normal";case"rotate":return"0deg";case"box-shadow":return"0px 0px 0px 0px rgba(0, 0, 0, 1)";case"text-shadow":return"0px 0px 0px rgba(0, 0, 0, 1)";case"opacity":return 1;default:return""}}},{key:"copyTimelineKeyframe",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=this.getTimelineProperty(t,e);if(r){var o=this.getSelectedTimeline(),i=n||o.currentTime,a=r.keyframes.filter((function(t){return t.timee.time?-1:1})),c=a[0].value+"",u=a[0].timing+"",editor=a[0].editor),this.addTimelineKeyframe({layerId:t,property:e,value:c,timing:u,editor:editor})}}},{key:"getTimelineKeyframe",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find((function(t){return t.time===n}))}},{key:"getTimelineKeyframeById",value:function(t,e,n){var r=this.getTimelineProperty(t,e);if(r)return r.keyframes.find((function(t){return t.id===n}))}},{key:"sortTimelineKeyframe",value:function(t,e){var n=this.getTimelineProperty(t,e);n&&(n.keyframes.sort((function(t,e){return t.time>e.time?1:-1})),this.compiledTimingFunction(t,e))}},{key:"setFps",value:function(t){var e=this.getSelectedTimeline();e&&(e.fps=t,e.currentTimecode=qa(t,e.currentTime),e.totalTimecode=qa(t,e.totalTime))}},{key:"toCloneObject",value:function(){return BP({},XP(YP(e.prototype),"toCloneObject",this).call(this),{timeline:X(this.json.timeline)})}}])&&GP(n.prototype,r),o&&GP(n,o),e}(Cd));function ox(t){return(ox="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ix(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ax(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return fx(px(e.prototype),"getDefaultObject",this).call(this,ax({itemType:"image",name:"New Image",elementType:"image",src:""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Image"}},{key:"getIcon",value:function(){return Vd.image}},{key:"toCloneObject",value:function(){return ax({},fx(px(e.prototype),"toCloneObject",this).call(this),{src:this.json.src+""})}},{key:"resize",value:function(){this.reset({width:this.json.naturalWidth.clone(),height:this.json.naturalHeight.clone()})}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.json.src;if(e){t.$("img").attr("src",n);var r=t;if(r){var o=r.$("defs");o&&o.html(this.toDefInnerString)}else{var i=this.toDefString;if(i){var a=un.createByHTML(i);t.prepend(a)}}}}},{key:"toNestedCSS",value:function(){return this.json,ax({},this.toKeyListCSS("filter","mix-blend-mode","border-radius","background-color","opacity"),{},this.toClipPathCSS(),{},this.toBackgroundImageCSS(),{},this.toBorderCSS()),[{selector:"img",cssText:"\n width: 100%;\n height: 100%;\n pointer-events: none;\n ".trim()}]}},{key:"toSVG",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.json,o=r.width,i=r.height,a=r.src,c=this.toCSS();return n?(delete c.left,delete c.top,"absolute"===c.position&&delete c.position,this.wrapperRootSVG(t,e,o,i,'\n \n '))):"\n ".concat(this.toDefString,' \n \n ')}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=t.src;return("\n
\n ').concat(this.toDefString,"\n \n
"))}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&sx(n.prototype,r),o&&sx(n,o),e}(Yd);function dx(t){return(dx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bx(t,e){for(var n=0;n\n ").concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n\n "))}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&_x(n.prototype,r),o&&_x(n,o),e}(Ox);function Ax(t){return(Ax="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ix(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function Lx(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e0&&void 0!==arguments[0]?arguments[0]:{};return Xx(Yx(e.prototype),"getDefaultObject",this).call(this,Bx({type:"radial-gradient",cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",fr:"0%",spreadMethod:"pad"},t))}},{key:"toCloneObject",value:function(){var t=this.json,n=t.cx,r=t.cy,o=t.r,i=t.fx,a=t.fy,c=t.fr,u=t.spreadMethod;return Bx({},Xx(Yx(e.prototype),"toCloneObject",this).call(this),{cx:n,cy:r,r:o,fx:i,fy:a,fr:c,spreadMethod:u})}},{key:"toString",value:function(){if(0===this.colorsteps.length)return"";var t=this.getColorString(),e=this.json,n=[e.cx,e.cy,e.r,e.fx,e.fy,e.fr,e.spreadMethod].join(" ");return"".concat(this.json.type,"(").concat(n,", ").concat(t,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.cx,r=e.cy,o=e.r,i=e.fx,a=e.fy,c=e.fr,u=e.spreadMethod;return("\n\n ").concat(this.colorsteps.map((function(t){return'')})).join("\n"),"\n\n"))}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&Gx(n.prototype,r),o&&Gx(n,o),e}(Ox);function Wx(t){return(Wx="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Ux(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Zx(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Jx(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"transparent";return new e({colorsteps:[new Ec({color:t,percent:0,index:0}),new Ec({color:t,percent:100,index:0})]})}}],(r=[{key:"getDefaultObject",value:function(){return t$(e$(e.prototype),"getDefaultObject",this).call(this,{type:"static-gradient",static:!0,colorsteps:[new Ec({color:"red",percent:0,index:0}),new Ec({color:"red",percent:100,index:1})]})}},{key:"toCloneObject",value:function(){return function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return p$(y$(e.prototype),"getDefaultObject",this).call(this,c$({type:"url",url:"",datauri:"",patternUnits:"userSpaceOnUse",patternWidth:"100%",patternHeight:"100%",imageX:"0%",imageY:"0%",imageWidth:"100%",imageHeight:"100%"},t))}},{key:"toCloneObject",value:function(){return c$({},p$(y$(e.prototype),"toCloneObject",this).call(this),{url:this.json.url,datauri:this.json.datauri,patternUnits:this.json.patternUnits,patternWidth:this.json.patternWidth,patternHeight:this.json.patternHeight,imageX:this.json.imageX,imageY:this.json.imageY,imageWidth:this.json.imageWidth,imageHeight:this.json.imageHeight})}},{key:"isUrl",value:function(){return!0}},{key:"toString",value:function(){var t=this.json,e=t.patternUnits,n=t.patternWidth,r=t.patternHeight,o=t.imageX,i=t.imageY,a=t.imageWidth,c=t.imageHeight,u=t.url,s=[e,n,r,o,i,a,c].join(",").trim();return"url(".concat(u,"#").concat(s,")")}},{key:"toSVGString",value:function(t){var e=this.json,n=e.patternUnits,r=e.patternWidth,o=e.patternHeight,i=e.imageX,a=e.imageY,c=e.imageWidth,u=e.imageHeight;return("\n \n \n \n "))}},{key:"toFillValue",value:function(t){return"url(#".concat(t,")")}}])&&l$(n.prototype,r),o&&l$(n,o),e}(bc);function b$(t){return(b$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function m$(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return A$(I$(e.prototype),"getDefaultObject",this).call(this,C$({itemType:"svg",name:"New SVG",elementType:"svg",overflow:"visible",stroke:"black","stroke-width":1,svgfilter:"",fill:"transparent","fill-rule":"","fill-opacity":"","stroke-linecap":"","stroke-linejoin":"","stroke-dashoffset":"","stroke-dasharray":" ","text-anchor":"start","motion-based":!1},t))}},{key:"toCloneObject",value:function(){var t=this.json;return C$({},A$(I$(e.prototype),"toCloneObject",this).call(this),{overflow:t.overflow,stroke:t.stroke,"stroke-width":t["stroke-width"],svgfilter:t.svgfilter,fill:t.fill,"fill-rule":t["fill-rule"],"fill-opacity":t["fill-opacity"],"stroke-linecap":t["stroke-linecap"],"stroke-linejoin":t["stroke-linejoin"],"stroke-dashoffset":t["stroke-dashoffset"],"stroke-dasharray":t["stroke-dasharray"],"text-anchor":t["text-anchor"],"motion-based":t["motion-based"]})}},{key:"toDefaultCSS",value:function(){return C$({},A$(I$(e.prototype),"toDefaultCSS",this).call(this),{},this.toKeyListCSS("stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","fill-opacity","fill-rule","text-anchor"))}},{key:"toSVGAttribute",value:function(){return C$({},this.toDefaultSVGCSS(),{},this.toKeyListCSS("stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","fill-opacity","fill-rule","text-anchor"))}},{key:"toLayoutCSS",value:function(){return{}}},{key:"getDefaultTitle",value:function(){return"SVG"}},{key:"updateDefString",value:function(t){var e=t.$("defs");if(e)e.html(this.toDefInnerString);else{var n=this.toDefString.trim();t.prepend(un.createByHTML(n))}}},{key:"toExportSVGCode",value:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return("\n \n ".concat(t,"\n \n "))}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillSVG",get:function(){return $$.parseImage(this.json.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return $$.parseImage(this.json.stroke||"black").toSVGString(this.strokeId)}},{key:"toFillValue",get:function(){return $$.parseImage(this.json.fill||"transparent").toFillValue(this.fillId)}},{key:"toFillOpacityValue",get:function(){return Fe.parse(this.json.fill||"transparent").a}},{key:"toStrokeValue",get:function(){return $$.parseImage(this.json.stroke||"black").toFillValue(this.strokeId)}},{key:"toFilterValue",get:function(){return this.json.svgfilter?"url(#".concat(this.json.svgfilter,")"):""}}])&&D$(n.prototype,r),o&&D$(n,o),e}(Yd);function B$(t){return(B$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function z$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function F$(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return N$(K$(e.prototype),"getDefaultObject",this).call(this,F$({itemType:"svg-path",name:"New Path","stroke-width":3,d:"",segments:[],totalLength:0},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new ra(t.d),t.segments&&this.json.path.resetSegment(t.segments),t.rect&&(this.json.width=rn.px(t.rect.width),this.json.height=rn.px(t.rect.height),this.setScreenX(rn.px(t.rect.x)),this.setScreenY(rn.px(t.rect.y)))}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.rect.width.value;0===t&&(t=1);var e=this.rect.height.value;0===e&&(e=1);var n=this.json.width.value/t,r=this.json.height.value/e;this.scale(n,r)}},{key:"scale",value:function(t,e){this.json.d=this.cachePath.clone().scaleTo(t,e),this.json.path.reset(this.json.d)}},{key:"convert",value:function(t){return(t=N$(K$(e.prototype),"convert",this).call(this,t)).d&&(t.path=new ra(t.d)),t}},{key:"toCloneObject",value:function(){var t=this.json;return F$({},N$(K$(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,d:t.d,segments:X(this.json.segments)})}},{key:"getDefaultTitle",value:function(){return"Path"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return Zg(t.property)&&qg(t.property)})),n=t.filter((function(t){return Jg(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:n},{selector:'[data-id="'.concat(this.json.id,'"] path'),properties:e}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.$("path");r.attr("d",this.json.d),e&&(r.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue}),this.updateDefString(t)),n&&(this.json.totalLength=r.totalLength)}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return'\n \n ').concat(this.toDefString,"\n \n \n ")}},{key:"html",get:function(){var t=this.json.id,e={"motion-based":this.json["motion-based"]};return"\n \n ').concat(this.toDefString,"\n \n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&X$(n.prototype,r),o&&X$(n,o),e}(M$);function Z$(t){return(Z$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function q$(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function J$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Q$(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:"50% 50%",e="50% 50%",n="";if((t=t||"50%").includes("at")){var r=t.split("at").map((function(t){return t.trim()})),o=q$(r,2);e=o[0],n=o[1]}else n=t.trim();var i=n.split(" "),a=q$(i,2),c=a[0],u=a[1];A(u)&&(u=c),c=rn.parse(c),u=rn.parse(u);var s=e.split(" "),l=q$(s,2),f=l[0],p=l[1];return A(p)&&(p=f),{radiusX:f=rn.parse(f),radiusY:p=rn.parse(p),x:c,y:u}}},{key:"parseStyleForInset",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=t.split("round"),n=q$(e,2),r=n[0],o=n[1],i=od.parse(r),a=q$(i,5),c=a[0],u=a[1],s=a[2],l=a[3],f=a[4];if(o)var p=od.parse(o),y=q$(p,5),h=y[0],d=y[1],v=y[2],b=y[3],g=y[4];return{isAll:1===c,top:u,right:s,bottom:l,left:f,round:o,isAllRadius:1===h,topRadius:d,rightRadius:v,bottomRadius:b,leftRadius:g}}},{key:"parseStyleForPolygon",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(",").filter((function(t){return t.trim()})).map((function(t){var e=q$(t.trim().split(" "),2),n=e[0],r=e[1];return{x:rn.parse(n),y:rn.parse(r)}}))}}],(r=[{key:"getDefaultObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return oE(iE(e.prototype),"getDefaultObject",this).call(this,Q$({itemType:"shape",type:"none",value:""},t))}},{key:"toCloneObject",value:function(){return Q$({},oE(iE(e.prototype),"toCloneObject",this).call(this),{value:this.json.value})}},{key:"toString",value:function(){var t=this.json.type,e=this.json.value,n=this.json.box,r="";switch(t){case"circle":case"inset":case"ellipse":case"polygon":case"path":r="".concat(t,"(").concat(e,")");break;case"svg":r="url(#".concat(e,")");break;default:r="none"}return n?"".concat(n," ").concat(r):r}},{key:"toCSS",value:function(){return{"clip-path":this.toString()}}}])&&nE(n.prototype,r),o&&nE(n,o),e}(Mo);function sE(t){return(sE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function lE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function fE(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return vE(bE(e.prototype),"getDefaultObject",this).call(this,fE({itemType:"svg-text",name:"New Text",totalLength:0,fill:"rgba(0, 0, 0, 1)",text:"Insert a text","font-weight":rn.number(100),textLength:rn.em(0),lengthAdjust:"spacingAndGlyphs","shape-inside":"","shape-subtract":"","shape-margin":"","shape-padding":""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"toShapeInsideCSS",value:function(){var t=this.json["shape-inside"];switch(uE.parseStyle(t).type){case"path":case"svg":t="url(#".concat(this.shapeInsideId,")")}return{"shape-inside":t,"inline-size":this.json.width}}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new ra(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{key:"setCache",value:function(){this.rect=this.clone()}},{key:"convert",value:function(t){return(t=vE(bE(e.prototype),"convert",this).call(this,t)).textLength=rn.parse(t.textLength),t}},{key:"toCloneObject",value:function(){var t=this.json;return fE({},vE(bE(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,text:t.text,textLength:"".concat(t.textLength),lengthAdjust:t.lengthAdjust,"shape-inside":t["shape-inside"]})}},{key:"getDefaultTitle",value:function(){return"Text"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return Zg(t.property)})),n=t.filter((function(t){return Jg(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:n},{selector:'[data-id="'.concat(this.json.id,'"] text'),properties:e}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e){var n=t.$("text");n.text(this.json.text),n.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue,y:this.json["font-size"]||"13px",textLength:this.json.textLength,lengthAdjust:this.json.lengthAdjust}),this.updateDefString(t)}}},{key:"toNestedCSS",value:function(){return[{selector:"> text",css:fE({},this.toShapeInsideCSS())}]}},{key:"toSVGCSS",value:function(){return fE({},vE(bE(e.prototype),"toSVGCSS",this).call(this),{},this.toShapeInsideCSS())}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.json,r=n.textLength,o=n.lengthAdjust;return'\n \n ').concat(this.toDefString,"\n ").concat(this.json.text,"\n ")}},{key:"toShapeInside",get:function(){var t=uE.parseStyle(this.json["shape-inside"]),e=t.value;switch(t.type){case"path":return'')}return""}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ").concat(this.toShapeInside,"\n ")}},{key:"shapeInsideId",get:function(){return this.getInnerId("shape-inside")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.textLength,r=t.lengthAdjust;return("\n \n ').concat(this.toDefString,"\n ").concat(this.json.text,"\n "))}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&hE(n.prototype,r),o&&hE(n,o),e}(M$);function wE(t){return(wE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function OE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function kE(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return $E(EE(e.prototype),"getDefaultObject",this).call(this,kE({itemType:"svg-textpath",name:"New TextPath",d:"",totalLength:0,fill:"rgba(0, 0, 0, 1)",text:"Insert a text",textLength:rn.em(0),lengthAdjust:"spacingAndGlyphs",startOffset:rn.em(0)},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new ra(t.d),t.segments&&this.json.path.resetSegment(t.segments)}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.json.width.value/this.rect.width.value,e=this.json.height.value/this.rect.height.value;this.scale(t,e)}},{key:"scale",value:function(t,e){this.json.d=this.cachePath.clone().scaleTo(t,e),this.json.path.reset(this.json.d)}},{key:"convert",value:function(t){return(t=$E(EE(e.prototype),"convert",this).call(this,t)).path=new ra(t.d),t.textLength=rn.parse(t.textLength),t.startOffset=rn.parse(t.startOffset),t}},{key:"toCloneObject",value:function(){var t=this.json;return kE({},$E(EE(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,d:t.d,text:t.text,textLength:"".concat(t.textLength),lengthAdjust:t.lengthAdjust,startOffset:"".concat(t.startOffset)})}},{key:"getDefaultTitle",value:function(){return"TextPath"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return Zg(t.property)})),n=t.filter((function(t){return qg(t.property)})),r=t.filter((function(t){return Jg(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:r},{selector:'[data-id="'.concat(this.json.id,'"] textPath'),properties:e},{selector:'[data-id="'.concat(this.json.id,'"] path'),properties:n}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=t.$("path");if(n.attr("d",this.json.d),e){var r=t.$("textPath");r.text(this.json.text),r.setAttr({filter:this.toFilterValue,fill:this.toFillValue,stroke:this.toStrokeValue,textLength:this.json.textLength,lengthAdjust:this.json.lengthAdjust,startOffset:this.json.startOffset}),this.updateDefString(t)}this.json.totalLength=n.totalLength}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.json,r=n.textLength,o=n.lengthAdjust,i=n.startOffset;return'\n \n ').concat(this.toDefString,"\n \n ").concat(this.json.text,"\n \n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toPathSVG,"\n ").concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toPathId",get:function(){return this.getInnerId("path")}},{key:"toPathSVG",get:function(){return"\n \n ")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.textLength,r=t.lengthAdjust,o=t.startOffset;return("\n \n ').concat(this.toDefString,"\n \n ").concat(this.json.text,"\n \n "))}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&PE(n.prototype,r),o&&PE(n,o),e}(M$);function TE(t){return(TE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function RE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function DE(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return ME(BE(e.prototype),"getDefaultObject",this).call(this,DE({itemType:"text",name:"New Text",elementType:"p",content:""},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"getDefaultTitle",value:function(){return"Text"}},{key:"toCloneObject",value:function(){return DE({},ME(BE(e.prototype),"toCloneObject",this).call(this),{content:this.json.content})}},{key:"updateFunction",value:function(t){var e=this.json.content;t.updateDiff(e)}},{key:"toCSS",value:function(){var t=ME(BE(e.prototype),"toCSS",this).call(this);return t.margin=t.margin||"0px",t}},{key:"toNestedCSS",value:function(){return[{selector:"> *",cssText:"\n pointer-events: none;\n "}]}},{key:"toSVG",value:function(t,e){var n=this.json,r=n.width,o=n.height,i=n.content,a=this.toCSS();return delete a.left,delete a.top,"absolute"===a.position&&delete a.position,'\n \n ').concat(this.toDefString,"\n \n
\n

').concat(i,"

\n
\n
\n
\n")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.itemType,r=t.content;return("

').concat(r,"

"))}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&IE(n.prototype,r),o&&IE(n,o),e}(Yd);function GE(t){return(GE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function HE(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function XE(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return UE(ZE(e.prototype),"getDefaultObject",this).call(this,XE({itemType:"rect",name:"New Rect"},t))}},{key:"getDefaultTitle",value:function(){return"Rect"}}])&&KE(n.prototype,r),o&&KE(n,o),e}(Yd);function QE(t){return(QE="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function t_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function e_(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return a_(c_(e.prototype),"getDefaultObject",this).call(this,e_({itemType:"circle",name:"New Circle","border-radius":"100%"},t))}},{key:"getDefaultTitle",value:function(){return"Circle"}}])&&o_(n.prototype,r),o&&o_(n,o),e}(Yd);function l_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f_(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function p_(t){var e=VP("linear"),n=jP(t.segments),r=n.totalLength,o=n.interpolateList;return{totalLength:r,xy:function(t){t>1&&(t-=1);var n=o[0];if(0===t)n=o[0];else if(1===t)n=o[o.length-1];else{var r=o.find((function(e){return e.startT<=t&&t0&&void 0!==arguments[0]?arguments[0]:{};return w_(O_(e.prototype),"getDefaultObject",this).call(this,d_({itemType:"svg-brush",name:"New Brush",d:"",segments:[],totalLength:0,distance:0},t))}},{key:"enableHasChildren",value:function(){return!1}},{key:"updatePathItem",value:function(t){this.json.d=t.d,this.json.totalLength=t.totalLength,this.json.path=new ra(t.d),t.segments&&this.json.path.resetSegment(t.segments),t.rect&&(this.json.width=rn.px(t.rect.width),this.json.height=rn.px(t.rect.height),this.setScreenX(rn.px(t.rect.x)),this.setScreenY(rn.px(t.rect.y)))}},{key:"setCache",value:function(){this.rect=this.clone(),this.cachePath=this.json.path.clone()}},{key:"recover",value:function(){var t=this.rect.width.value;0===t&&(t=1);var e=this.rect.height.value;0===e&&(e=1);var n=this.json.width.value/t,r=this.json.height.value/e;this.scale(n,r)}},{key:"scale",value:function(t,e){this.json.d=this.cachePath.clone().scaleTo(t,e),this.json.path.reset(this.json.d)}},{key:"convert",value:function(t){return(t=w_(O_(e.prototype),"convert",this).call(this,t)).d&&(t.path=new ra(t.d)),t}},{key:"toCloneObject",value:function(){var t=this.json;return d_({},w_(O_(e.prototype),"toCloneObject",this).call(this),{totalLength:t.totalLength,d:t.d,segments:X(this.json.segments)})}},{key:"getDefaultTitle",value:function(){return"Brush"}},{key:"toAnimationKeyframes",value:function(t){var e=t.filter((function(t){return Zg(t.property)&&qg(t.property)})),n=t.filter((function(t){return Jg(t.property)}));return[{selector:'[data-id="'.concat(this.json.id,'"]'),properties:n},{selector:'[data-id="'.concat(this.json.id,'"] path'),properties:e}]}},{key:"updateFunction",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=t.$("path.svg-brush-item");if(r.attr("d",this.json.d),e){this.updateDefString(t);var o=t.$(".svg-brush-items");o.attr("filter",this.toFilterValue),o.attr("fill",this.toFillValue),o.attr("fill-opacity",this.toFillOpacityValue),o.updateSVGDiff(this.makeBrushItem(this.json["stroke-width"]))}n&&(this.json.totalLength=r.totalLength)}},{key:"makeBrushShape",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return arguments.length>3&&void 0!==arguments[3]&&arguments[3],"\n \n ")}},{key:"makeBrushItem",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.makeBrushItemRate().map((function(n){return t.makeBrushShape(n.x,n.y,e*n.scale,n.t)})).join("")}},{key:"makeBrushItemRate",value:function(){var t=this.json,e=t.d,n=t.totalLength,r=t.distance;return function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=p_(t),o=r.totalLength,i=r.xy,a=o/e,c=n/o,u=a/o+c,s=[],l=1,f=0;fl)break;s.push(i(p))}return s}(new ra(e),n,r).map((function(t){return d_({},t,{scale:(t.t>.5?1-t.t:t.t)/.4*1.3})}))}},{key:"toSVG",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return'\n \n ').concat(this.toDefString,"\n \n \n ")}},{key:"toDefInnerString",get:function(){return"\n ".concat(w_(O_(e.prototype),"toDefInnerString",this),"\n ")}},{key:"brushId",get:function(){return this.getInnerId("brush")}},{key:"html",get:function(){var t=this.json,e=t.id,n=t.d,r=this.makeBrushItem(this.json["stroke-width"]);return"\n \n ').concat(this.toDefString,"\n \n \n ').concat(r,"\n \n ")}},{key:"svg",get:function(){var t=this.json.x.value,e=this.json.y.value;return this.toSVG(t,e)}}])&&g_(n.prototype,r),o&&g_(n,o),e}(M$);Ei.registerComponent("svg-brush",j_);var S_,P_,x_,$_,E_,__;function C_(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1;return rn.px(t).round(e)},H_=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.$editor=e}var e,n,r;return e=t,(n=[{key:"makeGuideCache",value:function(){var t=this,e=this.$selection.currentArtboard;return this.cachedExtraItems=[],e&&(this.$selection.isArtBoard()?this.cachedExtraItems=[]:this.cachedExtraItems=e.allLayers.filter((function(e){return!t.$selection.check(e)||e.is("artboard")&&t.$selection.currentArtboard!=e})),this.rect=this.$selection.allRect?this.$selection.allRect.clone():null),this.cachedPosition={},this.$selection.items.map((function(e){t.cachedPosition[e.id]={x:t.setupX(e),y:t.setupY(e)}})),this.rect}},{key:"move",value:function(t,e,n){var r=this.$selection.allRect;this.pointerType=t,"move"===t?this.rect.move(G_(r.x.value+e),G_(r.y.value+n)):(B_.isRight(t)?this.rect.resizeWidth(G_(r.width.value+e)):B_.isLeft(t)&&r.width.value-e>=0&&(this.rect.moveX(G_(r.x.value+e)),this.rect.resizeWidth(G_(r.width.value-e))),B_.isBottom(t)?this.rect.resizeHeight(G_(r.height.value+n)):B_.isTop(t)&&r.height.value-n>=0&&(this.rect.moveY(G_(r.y.value+n)),this.rect.resizeHeight(G_(r.height.value-n))))}},{key:"recover",value:function(t){if(this.rect){var e=this.cachedPosition[t.id].x,n=e.xDistRate,r=e.x2DistRate,o=this.cachedPosition[t.id].y,i=o.yDistRate,a=o.y2DistRate,c=this.rect.screenX.value,u=this.rect.screenX2.value,s=this.rect.screenY.value,l=this.rect.screenY2.value,f=u-c,p=f*n,y=f*r,h=l-s,d=h*i,v=h*a;this.setX(t,c,u,p,y),this.setY(t,s,l,d,v)}}},{key:"setY",value:function(t,e,n,r,o){var i=Math.round(r),a=Math.round(o)-i;t.setScreenY(i+e),t.height.set(a)}},{key:"setX",value:function(t,e,n,r,o){var i=Math.round(r),a=Math.round(o)-i;t.setScreenX(i+e),t.width.set(a)}},{key:"setupX",value:function(t){var e=this.$selection.allRect,n=e.screenX.value,r=e.screenX2.value-n;return 0===r?{xDistRate:0,x2DistRate:1}:{xDistRate:(t.screenX.value-n)/r,x2DistRate:(t.screenX2.value-n)/r}}},{key:"setupY",value:function(t){var e=this.$selection.allRect,n=e.screenY.value,r=e.screenY2.value-n;return 0===r?{yDistRate:0,y2DistRate:1}:{yDistRate:(t.screenY.value-n)/r,y2DistRate:(t.screenY2.value-n)/r}}},{key:"compareX",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=[t.screenX.value,t.centerX.value,t.screenX2.value],o=[e.screenX.value,e.centerX.value,e.screenX2.value],i=[];if(r.forEach((function(r,a){o.forEach((function(o,c){Math.abs(r-o)<=n&&i.push({A:t,B:e,source:a,target:c,ax:o,bx:o})}))})),i.length){var a=B_.getXDirection(this.pointerType),c=i.filter((function(t){return t.source==a}));return c.length?c:[i[0]]}return i}},{key:"compareY",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=[t.screenY.value,t.centerY.value,t.screenY2.value],o=[e.screenY.value,e.centerY.value,e.screenY2.value],i=[];if(r.forEach((function(r,a){o.forEach((function(o,c){Math.abs(r-o)<=n&&i.push({A:t,B:e,source:a,target:c,ay:o,by:o})}))})),i.length){var a=B_.getYDirection(this.pointerType),c=i.filter((function(t){return t.source==a}));return c.length?c:[i[0]]}return i}},{key:"compare",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,r=this.compareX(t,e,n),o=this.compareY(t,e,n);return{x:r,y:o}}},{key:"getLayers",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,n=this.cachedExtraItems,r=[],o=[];return n.forEach((function(n){var i=t.compare(t.rect,n,e);r.push.apply(r,z_(i.x)),o.push.apply(o,z_(i.y))})),[r[0],o[0]].filter((function(t){return I(t)}))}},{key:"calculate",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,n=this.getLayers(e);return B_.isMove(this.pointerType)?n.forEach((function(e){return t.moveSnap(e)})):n.forEach((function(e){return t.sizeSnap(e)})),n}},{key:"sizeSnap",value:function(t){var e,n,r,o;if(I(t.ax))switch(t.source){case 2:e=this.rect.screenX.value,n=t.bx-e,this.rect.width.set(n);break;case 0:e=t.bx,n=this.rect.screenX2.value-e,this.rect.x.set(e),this.rect.width.set(n)}else switch(t.source){case 2:r=this.rect.screenY.value,o=t.by-r,this.rect.y.set(r),this.rect.height.set(o);break;case 0:r=t.by,o=this.rect.screenY2.value-r,this.rect.y.set(r),this.rect.height.set(o)}}},{key:"moveSnap",value:function(t){if(I(t.ax)){var e=Math.round(this.rect.width.value/2*t.source),n=t.bx-e;this.rect.x.set(n)}else if(I(t.ay)){var r=Math.round(this.rect.height.value/2*t.source),o=t.by-r;this.rect.y.set(o)}}},{key:"recoverAll",value:function(){var t=this;B_.isMove(this.pointerType)?this.$selection.each((function(e){t.$selection.isInParent(e,t.$selection.items)||(t.recover(e),e.recover())})):this.$selection.each((function(e){t.recover(e),e.recover()}))}},{key:"$selection",get:function(){return this.$editor.selection}}])&&F_(e.prototype,n),r&&F_(e,r),t}();function X_(t){return(X_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Y_(t,e,n){return(Y_="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=q_(t)););return t}(t,e);if(r){var o=Object.getOwnPropertyDescriptor(r,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}function N_(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n
\n ".concat(Vd.flag,"\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n ")}},{key:bn('$selectionTool .selection-tool-item[data-position="path"]'),value:function(t){this.trigger("openPathEditor")}},{key:"toggleEditingPath",value:function(t){}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:An("$selectionView .selection-tool-item")+Gn("checkEditMode")+Zn()+qn(),value:function(t){var e;this.initMoveType(t.$dt),(e=this.parent).selectCurrent.apply(e,N_(this.$selection.items)),this.$selection.setRectCache("move"!==this.pointerType),this.initSelectionTool()}},{key:"initMoveType",value:function(t){this.$target=t||this.refs.$selectionTool.$('.selection-tool-item[data-position="move"]'),this.$target&&(this.pointerType=this.$target.attr("data-position"),this.refs.$selectionTool.attr("data-selected-position",this.pointerType),this.refs.$selectionTool.attr("data-selected-movetype",tC[this.pointerType]))}},{key:"move",value:function(t,e){this.$config.get("bodyEvent").altKey&&(e=t),this.refreshSelectionToolView(t,e),this.parent.updateRealPosition(),this.emit("refreshSelectionDragStyleView",null,!0)}},{key:fo("moveByKey"),value:function(t,e){var n;if(0!==t||0!==e){this.pointerType="move",this.$selection.move(t,e),(n=this.parent).selectCurrent.apply(n,N_(this.$selection.items)),this.refs.$selectionTool.attr("data-selected-position",""),this.refs.$selectionTool.attr("data-selected-movetype",""),this.guideView.move(this.pointerType,t,e);var r=this.guideView.calculate();this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(r)),this.makeSelectionTool()}}},{key:"end",value:function(){this.refs.$selectionTool.attr("data-selected-position",""),this.refs.$selectionTool.attr("data-selected-movetype",""),this.$selection.setRectCache(),this.emit("refreshAllElementBoundSize"),this.emit("removeGuideLine")}},{key:"refreshSelectionToolView",value:function(t,e,n){if(0===t&&0===e);else{this.guideView.move(n||this.pointerType,t/this.$editor.scale,e/this.$editor.scale);var r=this.guideView.calculate();this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(r))}this.makeSelectionTool()}},{key:"getOriginalRect",value:function(){return this.originalRect||(this.originalRect=this.parent.$el.rect()),this.originalRect}},{key:"getOriginalArtboardRect",value:function(){return this.originalArtboardRect||(this.originalArtboardRect=this.parent.refs.$view.rect()),this.originalArtboardRect}},{key:"removeOriginalRect",value:function(){this.originalArtboardRect=null,this.originalRect=null}},{key:"initSelectionTool",value:function(){this.removeOriginalRect(),this.guideView.makeGuideCache();var t=this.$selection.current;if(t){var e=t.is("svg-path","svg-brush","svg-textpath");this.refs.$selectionTool.toggleClass("path",e)}this.$editor.isSelectionMode()&&this.$el.isHide()&&this.$el.show(),this.bindData("$selectionTool"),this.makeSelectionTool()}},{key:"makeSelectionTool",value:function(){this.guideView.recoverAll();var t=rn.px(0),e=rn.px(0),n=rn.px(0),r=rn.px(0);if(this.guideView.rect){var o=this.calculateWorldPosition(this.guideView.rect);t=o.x,e=o.y,n=o.width,r=o.height}t.is(0)&&e.is(0)&&n.is(0)&&r.is(0)?(t.add(-1e4),e.add(-1e4)):this.$selection.currentArtboard||(t.add(-1e4),e.add(-1e4));var i=t,a=e;this.refs.$selectionTool.css({left:i,top:a,width:n,height:r}),this.refreshPositionText(t,e,n,r)}},{key:"refreshPositionText",value:function(t,e,n,r){if(this.$selection.currentArtboard){var o=rn.px(t.value-this.$selection.currentArtboard.x.value/this.$editor.scale).round(1),i=rn.px(e.value-this.$selection.currentArtboard.y.value/this.$editor.scale).round(1),a=rn.px(n.value/this.$editor.scale).round(1),c=rn.px(r.value/this.$editor.scale).round(1),u="";switch(this.pointerType){case"move":u="X: ".concat(o,", Y: ").concat(i);break;case"to top":case"to bottom":u="Y: ".concat(i,", H: ").concat(c);break;case"to left":case"to right":u="X: ".concat(o,", W: ").concat(a);break;case"to top right":case"to top left":u="X: ".concat(o,", Y: ").concat(i,", W: ").concat(a,", H: ").concat(c);break;case"to bottom right":u="W: ".concat(a,", H: ").concat(c);break;case"to bottom left":u="X: ".concat(o,", Y: ").concat(i,", W: ").concat(a,", H: ").concat(c)}this.setPositionText(u);var s=this.$selection.length,l="";if(1===s){var f=this.$selection.current;l=f.title||f.getDefaultTitle(),this.refs.$selectionIcon.html(f.getIcon())}else s>=2&&(l="multi : ".concat(s),this.refs.$selectionIcon.html(Vd.flag));this.refs.$selectionTitle.text(l),this.refs.$selectionMove.attr("title",l)}}},{key:"setPositionText",value:function(t){this.$target&&(this.$selection.current&&this.$selection.current.is("artboard")&&(t=t.split(",").filter((function(t){return!t.includes("X:")&&!t.includes("Y:")})).join(",")),this.$target.attr("data-position-text",t))}},{key:"calculateWorldPositionForGuideLine",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map((function(e){var n,r,o,i,a=new wi(t.calculateWorldPosition(e.A)),c=new wi(t.calculateWorldPosition(e.B));return I(e.ax)&&(n=e.ax*t.$editor.scale),I(e.bx)&&(r=e.bx*t.$editor.scale),I(e.ay)&&(o=e.ay*t.$editor.scale),I(e.by)&&(i=e.by*t.$editor.scale),{A:a,B:c,ax:n,bx:r,ay:o,by:i}}))}},{key:"calculateWorldPosition",value:function(t){return{x:rn.px(t.screenX.value*this.$editor.scale),y:rn.px(t.screenY.value*this.$editor.scale),width:rn.px(t.width.value*this.$editor.scale),height:rn.px(t.height.value*this.$editor.scale),transform:t.transform}}}]),e}(function(t){function e(){return K_(this,e),Z_(this,q_(e).apply(this,arguments))}return J_(e,t),U_(e,[{key:or("$selectionTool"),value:function(){var t=this.$selection.current;return{"data-is-layout-item":t&&t.isLayoutItem(),"data-is-layout-container":t&&t.hasLayout(),"data-layout-container":t&&(t.layout||t.parent.layout),"data-selection-length":this.$selection.length}}}]),e}(function(t){function e(){return K_(this,e),Z_(this,q_(e).apply(this,arguments))}return J_(e,t),U_(e,[{key:fo("hideSelectionToolView"),value:function(){this.refs.$selectionTool.css({left:"-10000px",top:"-10000px"})}},{key:fo("hideSubEditor"),value:function(t){this.toggleEditingPath(!1)}},{key:fo("openPathEditor"),value:function(){var t=this.$selection.current;t&&t.is("svg-path","svg-brush","svg-textpath")&&(this.toggleEditingPath(!0),this.emit("showPathEditor","modify",{changeEvent:"updatePathItem",current:t,d:t.d,box:t.is("svg-textpath")?"box":"canvas",screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}))}},{key:fo("finishPathEdit"),value:function(){this.toggleEditingPath(!1)}},{key:fo("updatePathItem"),value:function(t){var e,n=this.$selection.current;n&&(n.updatePathItem&&(n.updatePathItem(t),(e=this.parent).selectCurrent.apply(e,N_(this.$selection.items)),this.$selection.setRectCache(),this.emit("refreshSelectionStyleView",n,!0,!0)))}},{key:fo("refreshSelectionTool","initSelectionTool"),value:function(){this.initSelectionTool()}},{key:fo("makeSelectionTool"),value:function(t){t&&this.removeOriginalRect();var e=this.guideView.calculate();this.makeSelectionTool(),0===this.$selection.length&&(e=[]),this.emit("refreshGuideLine",this.calculateWorldPositionForGuideLine(e))}}]),e}(po)));function nC(t){return(nC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function rC(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function oC(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"base-line";return'").concat(n,"")},sC=function(t,e,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"base-line";return(""))},lC=function(t,e){(function(t,e){return t.includes(e)})(t,e)||t.push(e)},fC=function(t,e,n,r){if(0!==Math.abs(n-r)){e=Math.floor(e),lC(t,sC(e-2,n,e+2,n)),lC(t,sC(e,n,e,r)),lC(t,sC(e-2,r,e+2,r));var o=(r+n)/2,i=Math.floor(Math.abs(r-n));lC(t,uC(e+2,o,i))}},pC=function(t,e,n,r){if(0!==Math.abs(n-r)){e=Math.floor(e),lC(t,sC(n,e-2,n,e+2)),lC(t,sC(n,e,r,e)),lC(t,sC(r,e-2,r,e+2));var o=(r+n)/2,i=Math.floor(Math.abs(r-n));lC(t,uC(o,e-2,i,"text-center"))}},yC=function(t){function e(){return rC(this,e),iC(this,aC(e).apply(this,arguments))}var n,r,o;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&cC(t,e)}(e,t),n=e,(r=[{key:"template",value:function(){return''}},{key:"initState",value:function(){return{list:[]}}},{key:or("$el"),value:function(){return{html:this.createGuideLine(this.state.list)}}},{key:"createGuideLine",value:function(t){var e=[];return(t=t.filter((function(t,e){return 0===e}))).forEach((function(t){var n=t.B;if(I(t.ax)){var r=rn.min(n.screenY,t.A.screenY),o=rn.max(n.screenY2,t.A.screenY2),i=t.bx;if(t.A.screenY.value>t.B.screenY2.value?fC(e,i,t.B.screenY2.value,t.A.screenY.value):fC(e,i,r.value,t.A.screenY.value),t.A.screenX.value-n.screenX.value>0&&t.A.screenY.value<=n.screenY2.value&&t.A.screenY.value>=n.screenY.value){var a=(t.A.screenY.value+t.A.screenY2.value)/2;pC(e,a,n.screenX.value,t.A.screenX.value)}n.screenX2.value-t.A.screenX2.value>0&&t.A.screenY.value<=t.B.screenY2.value&&t.A.screenY.value>=t.B.screenY.value&&(a=(t.A.screenY.value+t.A.screenY2.value)/2,pC(e,a,t.A.screenX2.value,n.screenX2.value)),t.A.screenY2.valuet.B.screenX2.value?pC(e,u,t.B.screenX2.value,t.A.screenX.value):pC(e,u,t.A.screenX.value,t.B.screenX.value),t.A.screenY.value-n.screenY.value>0&&t.A.screenX.value<=t.B.screenX2.value&&t.A.screenX.value>=t.B.screenX.value){var s=(t.A.screenX.value+t.A.screenX2.value)/2;fC(e,s,t.B.screenY.value,t.A.screenY.value)}n.screenY2.value-t.A.screenY2.value>0&&t.A.screenX.value<=t.B.screenX2.value&&t.A.screenX.value>=t.B.screenX.value&&(s=(t.A.screenX.value+t.A.screenX2.value)/2,fC(e,s,t.A.screenY2.value,t.B.screenY2.value)),t.A.screenX2.value4&&void 0!==arguments[4]&&arguments[4];return this.segmentList.push(dC({},t,{cx:e.x,cy:e.y,selected:o,index:n,segment:r,isFirst:e.isFirst,isLast:e.isLast,isSecond:e.isSecond})),this}},{key:"addStartPoint",value:function(t,e){return this.segmentList.push(dC({},t,{cx:e.x,cy:e.y,start:!0})),this}},{key:"addCurvePoint",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return this.segmentList.push({curve:!0,cx:t.x,cy:t.y,index:e,selected:r,segment:n,isFirst:t.isFirst,isLast:t.isLast,isSecond:t.isSecond}),this}},{key:"addText",value:function(t,e){return this.segmentList.push({type:"text",cx:t.x,cy:t.y,text:e+""}),this}},{key:"toString",value:function(){return this.segmentList.sort((function(t,e){return t.line&&!e.line?-1:!t.line&&e.line?1:0})),this.segmentList.map((function(t){return t.angle?"\n '):t.line?'\n "):t.text?'\n ').concat(t.text,"\n "):t.curve?"\n '):t.start?"\n '):"\n ')})).join("")}}])&&bC(e.prototype,n),r&&bC(e,r),t}();function mC(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);ee.dist?-1:1}));var a=null;return i.length&&(r+=(a=i[0].point)[e]-n),{point:a,distanceValue:r}}function EC(t,e,n,r){var o=[],i=xC;return t.filter((function(t){return t})).forEach((function(t){i.filter((function(e){return t[e]})).forEach((function(i){var a=t[i],c=Math.abs(a[e]-n);c<=r&&o.push({dist:c,point:a})}))})),o.sort((function(t,e){return t.dist>e.dist?1:-1})),o.length?o[0].point:null}function _C(t,e,n){for(var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=[],i=0,a=t.length;i3&&void 0!==arguments[3]?arguments[3]:1,o=n.command,i=n.values;switch(o){case"Z":return"Z";default:var a=i.map((function(n){var o=n.x-t==0?0:(n.x-t)/r,i=n.y-e==0?0:(n.y-e)/r;return"".concat(o," ").concat(i)})).join(" ");return"".concat(o," ").concat(a)}}var TC=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.pathEditor=e,this.pathStringManager=new fa,this.guideLineManager=new fa,this.segmentManager=new gC,this.initialize(),this.initializeSelect()}return kC(t,null,[{key:"generatorPathString",value:function(t,e,n,r){return _C(t,e,n,r).d}}]),kC(t,[{key:"initialize",value:function(){this.splitLines=[],this.guideLineManager.reset(),this.segmentManager.reset(),this.pathStringManager.reset()}},{key:"initializeSelect",value:function(){this.selectedPointKeys={},this.selectedPointList=[]}},{key:"selectInBox",value:function(t){var e=[],n=["startPoint","endPoint","reversePoint"];this.state.points.forEach((function(r,o){n.forEach((function(n){var i=r[n];(function(t,e){return!(t.x2.valuee.x)&&!(t.y.value>e.y)))})(t,i)&&e.push({x:i.x,y:i.y,key:n,index:o})}))})),this.select.apply(this,e)}},{key:"select",value:function(){var t=this;this.selectedPointKeys={};for(var e=arguments.length,n=new Array(e),r=0;r1?r-1:0),i=1;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.transformRect,o=r.x,i=r.y,a=r.width,c=r.height,u=a/2,s=c/2;switch(t){case"flipX":this.applyTransform(ut.matrix2d.translate(-e,0),ut.matrix2d.flipX());break;case"flipY":this.applyTransform(ut.matrix2d.translate(0,-n),ut.matrix2d.flipY());break;case"flip":this.applyTransform(ut.matrix2d.translate(-e,-n),ut.matrix2d.flip());break;case"to move":this.applyTransform(ut.matrix2d.translate(e,n));break;case"to rotate":var l=mt({x:o+u,y:i},{x:o+u,y:i+s},{dx:e,dy:n});this.applyTransform(ut.matrix2d.translate(-u,-s),ut.matrix2d.rotate(lt(-l)),ut.matrix2d.translate(u,s));break;case"to skewX":l=gt({x:u,y:s},{x:u+e,y:s});this.applyTransform(ut.matrix2d.skewX(lt(l)));break;case"to skewY":l=gt({x:u,y:s},{x:u,y:s+n});this.applyTransform(ut.matrix2d.skewY(lt(l)));break;case"to bottom right":var f=ft(a+e,a),p=ft(c+n,c);this.applyTransform(ut.matrix2d.scale(f,p));break;case"to right":f=ft(a+e,a);this.applyTransform(ut.matrix2d.scale(f,1));break;case"to bottom":p=ft(c+n,c);this.applyTransform(ut.matrix2d.scale(1,p));break;case"to top right":f=ft(a+e,a),p=ft(c-n,c);this.applyTransform(ut.matrix2d.scale(f,p),ut.matrix2d.translate(0,n));break;case"to top left":f=ft(a-e,a),p=ft(c-n,c);this.applyTransform(ut.matrix2d.scale(f,p),ut.matrix2d.translate(e,n));break;case"to left":f=ft(a-e,a);this.applyTransform(ut.matrix2d.scale(f,1),ut.matrix2d.translate(e,0));break;case"to top":p=ft(c-n,c);this.applyTransform(ut.matrix2d.scale(1,p),ut.matrix2d.translate(0,n));break;case"to bottom left":f=ft(a-e,a),p=ft(c+n,c);this.applyTransform(ut.matrix2d.scale(f,p),ut.matrix2d.translate(e,0))}}},{key:"initTransform",value:function(t){this.transformRect=X(t),this.transformPoints=this.clonePoints.map((function(t){return{startPoint:X(t.startPoint),endPoint:X(t.endPoint),reversePoint:X(t.reversePoint)}}))}},{key:"setConnectedPoint",value:function(t,e){var n=this.state,r=n.dragXY.x+t,o=n.dragXY.y+e,i={x:r,y:o},a={x:r,y:o};n.dragPoints&&(n.reversePoint=Ui.getReversePoint(n.startPoint,i));var c={startPoint:n.startPoint,endPoint:i,curve:!!n.dragPoints,reversePoint:a,connected:!0,close:!0};n.points.push(c)}},{key:"setCachePoint",value:function(t,e){var n=this.state,r=n.points;if(this.snapPointList=[],n.selectedIndex=t,n.connectedPoint=Ui.getPrevPoint(r,t),n.connectedPoint&&!n.connectedPoint.connected&&(n.connectedPoint=null),n.segment=Ui.getIndexPoint(r,t),n.segment.connected&&(n.connectedPoint=Ui.getNextPoint(r,t)),Ui.isFirst(n.segment)){var o=Ui.getLastPoint(r,t);o.connected&&(n.connectedPoint=o)}n.segmentKey=e,n.isCurveSegment=n.segment.curve&&"startPoint"!=n.segmentKey,n.originalSegment=X(n.segment),n.connectedPoint&&(n.originalConnectedPoint=X(n.connectedPoint)),n.cachedPoints=[],r.filter((function(t){return t&&t!=n.segment})).forEach((function(t){n.cachedPoints.push(t.startPoint,t.reversePoint,t.endPoint)}))}},{key:"moveSegment",value:function(t,e,n){var r=this.state,o=r.originalSegment[t],i=r.segment[t];o&&(i.x=o.x+e,i.y=o.y+n)}},{key:"calculateToCurve",value:function(t,e,n){var r=(e.startPoint.x+n.startPoint.x)/2,o=(e.startPoint.y+n.startPoint.y)/2,i=(e.startPoint.x-r)/2,a=(e.startPoint.y-o)/2;return t.endPoint={x:t.startPoint.x+i,y:t.startPoint.y+a},t.reversePoint={x:t.startPoint.x-i,y:t.startPoint.y-a},{dx:i,dy:a}}},{key:"convertToCurve",value:function(t){var e=this.state.points,n=e[t];if(n.curve)if(n.curve=!1,n.reversePoint=X(n.startPoint),n.endPoint=X(n.startPoint),"M"===n.command){var r=Ui.getPrevPoint(e,n.index);r.connected&&(r.curve=!1,r.reversePoint=X(r.startPoint),r.endPoint=X(r.startPoint))}else{if((o=Ui.getNextPoint(e,t))&&"M"===o.command)(a=o).curve=!1,a.reversePoint=X(a.startPoint),a.endPoint=X(a.startPoint)}else{n.curve=!0;var o,i=Ui.getPrevPoint(e,t);if((o=Ui.getNextPoint(e,t))&&o.indext&&"M"!==o.command)this.calculateToCurve(n,o,i);else if(!o&&i){var c=(n.startPoint.x-i.startPoint.x)/3,u=(n.startPoint.y-i.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+u},n.reversePoint=Ui.getReversePoint(n.startPoint,n.endPoint)}else if(!i&&o){c=(n.startPoint.x-o.startPoint.x)/3,u=(n.startPoint.y-o.startPoint.y)/3;n.endPoint={x:n.startPoint.x+c,y:n.startPoint.y+u},n.reverse=Ui.getReversePoint(n.startPoint,n.endPoint)}}}},{key:"moveCurveSegment",value:function(t,e,n){var r=this.state;this.moveSegment(t,e,n);var o="endPoint"===t?"reversePoint":"endPoint";r.segment[o]=Ui.getReversePoint(r.segment.startPoint,r.segment[t])}},{key:"rotateSegmentTarget",value:function(t,e){var n=this.state;if(n.originalSegment&&n.segment){var r=n.originalSegment.startPoint,o=r.x,i=r.y,a=n.segment[t],c=a.x,u=a.y,s=n.originalSegment[e],l=s.x,f=s.y,p=dt(wt(c-o,u-i),vt(l,f,o,i),o,i),y=p.x,h=p.y;n.segment[e]={x:y,y:h}}}},{key:"rotateSegment",value:function(t){this.rotateSegmentTarget(t,"endPoint"===t?"reversePoint":"endPoint")}},{key:"calculateSnap",value:function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=this.state,i=o.cachedPoints,a=o.originalSegment[t];if(!t)return{dx:e,dy:n,snapPointList:[]};var c=a.x+e,u=a.y+n,s=$C(i,"x",c,e,r),l=s.point,f=(e=s.distanceValue,$C(i,"y",u,n,r)),p=f.point,y=(n=f.distanceValue,{x:a.x+e,y:a.y+n}),h=[];return l&&h.push({startPoint:l,endPoint:y}),p&&h.push({startPoint:p,endPoint:y}),{dx:e,dy:n,snapPointList:h}}},{key:"copySegment",value:function(t,e){e.startPoint=X(t.startPoint),e.endPoint=X(t.endPoint),e.reversePoint=X(t.reversePoint)}},{key:"moveSelectedSegment",value:function(t,e){var n=this;this.selectedPointList.forEach((function(r){var o=n.state.points[r.index][r.key];o.x=r.x+t,o.y=r.y+e}))}},{key:"removeSelectedSegment",value:function(){var t=this;this.selectedPointList.forEach((function(e){t.state.points[e.index][e.key].removed=!0}));var e=[];this.state.points.forEach((function(t,n){t.startPoint.removed||(t.endPoint.removed&&(t.endPoint=X(t.startPoint)),t.reversePoint.removed&&(t.reversePoint=X(t.startPoint)),Ui.isEqual(t.endPoint,t.startPoint,t.reversePoint)&&(t.command="L",t.curve=!1),e.push(t))})),e.forEach((function(t,e){0==e&&(t.command="M"),t.index=e})),this.state.points=e,this.select()}},{key:"move",value:function(t,e,n){var r=this.state,o=r.isCurveSegment,i=r.segmentKey,a=r.connectedPoint,c=this.calculateSnap(i,t,e,2),u=(t=c.dx,e=c.dy,c.snapPointList);if(this.snapPointList=u||[],this.selectedPointList.length>1)this.moveSelectedSegment(t,e);else if(o)if(n.shiftKey){this.moveSegment(i,t,e);var s="endPoint"===i?"reversePoint":"endPoint";r.segment[s]=Ui.getReversePoint(r.segment.startPoint,r.segment[i])}else n.altKey?this.moveSegment(i,t,e):(this.moveSegment(i,t,e),this.rotateSegment(i));else this.moveSegment("startPoint",t,e),this.moveSegment("endPoint",t,e),this.moveSegment("reversePoint",t,e);a&&this.copySegment(r.segment,r.connectedPoint)}},{key:"moveEnd",value:function(t,e){var n=this.state,r=n.points,o=n.dragXY.x+t,i=n.dragXY.y+e,a={x:o,y:i},c={x:o,y:i};n.dragPoints&&(c=Ui.getReversePoint(n.startPoint,a)),r.push({command:0===n.clickCount?"M":"",startPoint:n.startPoint,endPoint:a,curve:!!n.dragPoints,reversePoint:c}),n.startPoint=null,n.dragPoints=!1,n.moveXY=null}},{key:"setPoint",value:function(t){var e=t.first[0],n=t.second[t.second.length-1],r=this.clonePoints,o=Ui.getPoint(r,e),i=Ui.getPoint(r,n),a=[SC({},o,{endPoint:t.first[1]}),{startPoint:t.first[3],reversePoint:t.first[2],curve:!0,endPoint:t.second[1]},SC({},i,{reversePoint:t.second[2]})],c=Ui.getIndex(r,e);r.splice.apply(r,[c,2].concat(a)),this.state.points=r}},{key:"setPointQuard",value:function(t){var e=t.first[0],n=(t.second[t.second.length-1],this.clonePoints),r=Ui.getPoint(n,e),o=[SC({},r,{endPoint:{x:r.startPoint.x+(r.endPoint.x-r.startPoint.x)/3,y:r.startPoint.y+(r.endPoint.y-r.startPoint.y)/3}}),{startPoint:t.first[2],reversePoint:t.first[1],curve:!0,endPoint:t.second[1]}],i=Ui.getIndex(n,e);n.splice.apply(n,[i,1].concat(o)),this.state.points=n}},{key:"setPointLine",value:function(t){var e=t.first[0],n=this.clonePoints,r=[{command:"L",startPoint:t.first[1],curve:!1,endPoint:t.first[1],reversePoint:t.first[1]}],o=Ui.getIndex(n,e);n.splice.apply(n,[o+1,0].concat(r)),this.state.points=n}},{key:"toPath",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return _C(this.clonePoints,t,e,n)}},{key:"changeScale",value:function(){this.pathEditor.scale}},{key:"makeSVGPath",value:function(){return this.initialize(),this.makePointGuide(this.clonePoints),this.makeMovePositionGuide(),this.toSVGString()}},{key:"makeTriangleDistancePointGuide",value:function(t,e){var n=Math.min(t.startPoint.x,e.startPoint.x),r=Math.max(t.startPoint.x,e.startPoint.x),o=Math.min(t.startPoint.y,e.startPoint.y),i=Math.max(t.startPoint.y,e.startPoint.y);if(t.startPoint.xe.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:i},{x:r,y:i}).addDistanceLine({x:r,y:o},{x:r,y:i}):t.startPoint.x>e.startPoint.x&&t.startPoint.y>e.startPoint.y?this.segmentManager.addDistanceLine({x:n,y:o},{x:n,y:i}).addDistanceLine({x:n,y:i},{x:r,y:i}):t.startPoint.x>e.startPoint.x&&t.startPoint.y2&&void 0!==arguments[2]?arguments[2]:1,r=EC(t,"x",e.x,n),o=EC(t,"y",e.y,n),i=SC({},e);r&&(i.x=r.x),o&&(i.y=o.y);var a=[];return r&&a.push({startPoint:r,endPoint:i}),o&&a.push({startPoint:o,endPoint:i}),{snapPointList:a,moveXY:i}}(e,r,2),u=c.snapPointList,s=c.moveXY;(a=i).push.apply(a,mC(u)),t.moveXY=s,r=s,this.snapPointList=i;var l=e[e.length-1];if(o)if(l){if(l.curve){var f=Ui.getReversePoint(n,r);h=f.x,d=f.y;this.guideLineManager.M(l.startPoint).C(l.endPoint,{x:h,y:d},n),this.segmentManager.addGuideLine(l.startPoint,l.endPoint).addGuideLine(n,{x:h,y:d}).addGuideLine(n,r).addCurvePoint(l.endPoint).addCurvePoint({x:h,y:d}).addCurvePoint(r).addPoint(!1,n)}else if(!1===l.curve){var p=Ui.getReversePoint(n,r);h=p.x,d=p.y;this.guideLineManager.M(l.startPoint).Q({x:h,y:d},n),this.segmentManager.addGuideLine(r,{x:h,y:d}).addPoint(!1,n).addCurvePoint({x:h,y:d}).addCurvePoint(r)}}else{var y=Ui.getReversePoint(n,r),h=y.x,d=y.y;this.guideLineManager.M(r).L(n).L({x:h,y:d}),this.segmentManager.addCurvePoint(n).addCurvePoint(r).addCurvePoint({x:h,y:d})}else l&&(l.curve?(this.guideLineManager.M(l.startPoint).Q(l.endPoint,r),this.segmentManager.addGuideLine(l.endPoint,l.startPoint).addCurvePoint(l.endPoint)):l.close||(this.guideLineManager.M(l.startPoint).L(r),this.segmentManager.addPoint(!1,l.startPoint)))}}},{key:"makeSnapLines",value:function(){var t=[];if(this.snapPointList){var e=new fa;t=this.snapPointList.map((function(t){return e.reset(),e.M(t.startPoint).L(t.endPoint).toString("snap-path")}))}return t.join("")}},{key:"makeSelectedSVGZone",value:function(){var t=this.state,e=t.screenX,n=t.screenY,r=t.screenWidth,o=t.screenHeight,i=this.pathEditor.scale,a=e.value*i,c=n.value*i,u=r.value*i,s=o.value*i;return"")}},{key:"toSVGString",value:function(){return'\n \n '.concat(this.makeSelectedSVGZone(),"\n ").concat(this.guideLineManager.toString("guide",this.state.isPolygon),"\n ").concat(this.pathStringManager.toString("object",this.state.isPolygon),"\n ").concat(this.splitLines.join(""),"\n ").concat(this.makeSnapLines(),"\n ").concat(this.segmentManager.toString(),"\n \n ")}},{key:"state",get:function(){return this.pathEditor.state}},{key:"clonePoints",get:function(){return mC(this.state.points)}},{key:"selectedLength",get:function(){return this.selectedPointList.length}}]),t}();function RC(t){return(RC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function DC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function VC(t){for(var e=1;e\n
\n
\n \n \n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n "}},{key:or("$tool"),value:function(){this.resetTransformZone();var t=this.state.transformZoneRect;return{"data-show":"transform"===this.state.mode,"data-position":this.transformMoveType,style:{left:rn.px(t.x),top:rn.px(t.y),width:rn.px(t.width),height:rn.px(t.height)}}}},{key:"renderTransformTool",value:function(){this.bindData("$tool")}},{key:"isShow",value:function(){return this.state.isShow}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:On("document")+Gn("isShow")+Yn+Xn+Jn+Qn,value:function(){this.state.current?this.refreshPathLayer():this.addPathLayer(),this.trigger("hidePathEditor")}},{key:"makePathLayer",value:function(t){var e,n=this,r=this.pathGenerator.toPath(t.x,t.y,this.scale).d,o=this.$selection.currentArtboard;if(o){var i=t.x/this.scale,a=t.y/this.scale,c=t.width/this.scale,u=t.height/this.scale;e=o.add(new U$({width:rn.px(c),height:rn.px(u),d:r,totalLength:this.totalPathLength})),KC.forEach((function(t){n.state[t]&&e.reset(AC({},t,n.state[t]))})),e.setScreenX(i),e.setScreenY(a)}return e}},{key:"updatePathLayer",value:function(){var t=this.getPathRect(),e=t.x,n=t.y,r=this.state.current;if(r&&this.isBoxMode)e=r.screenX.value/this.scale,n=r.screenY.value/this.scale;var o=this.pathGenerator.toPath(e,n,this.scale).d,i=new ra(o);this.emit(this.state.changeEvent,{d:i.toString(),totalLength:this.totalPathLength,rect:{x:0===t.x?0:t.x/this.scale,y:0===t.y?0:t.y/this.scale,width:0===t.width?0:t.width/this.scale,height:0===t.height?0:t.height/this.scale}}),this.emit("refreshPathLayer")}},{key:"addPathLayer",value:function(){var t=this.getPathRect();if(this.changeMode("modify"),0!==t.width&&0!==t.height){var e=this.makePathLayer(t);e&&(this.$selection.select(e),this.emit("refreshAll"),this.emit("refreshSelection"))}}},{key:"changeMode",value:function(t,e){this.setState(VC({mode:t,clickCount:0,moveXY:null},e),!1),this.emit("changePathManager",this.state.mode)}},{key:fo("changePathManager"),value:function(t){this.setState(VC({},t,{clickCount:0}),!1),this.renderPath()}},{key:"isMode",value:function(t){return this.state.mode===t}},{key:fo("changeScale"),value:function(){this.refresh()}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:"refresh",value:function(t){if((t=t||this.getCurrentObject())&&t.d){this.pathParser.reset(t.d),this.pathParser.scale(this.scale,this.scale);var e=t.screenX.value*this.scale,n=t.screenY.value*this.scale;this.pathParser.translate(e,n),this.state.points=this.pathParser.convertGenerator(),this.state.hasTransform=!!t.current.transform}else this.state.hasTransform=!1;this.pathGenerator.initializeSelect(),this.renderPath()}},{key:fo("showPathEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"path",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"move"===t?(e.current=null,e.points=[]):e.current||(e.current=null),e.box=e.box||"canvas",this.changeMode(t,e),this.refresh(e),this.state.isShow=!0,this.$el.show(),this.$el.focus(),this.emit("showPathManager",{mode:this.state.mode})}},{key:fo("hidePathEditor"),value:function(){this.pathParser.reset(""),this.setState(this.initState(),!1),this.refs.$view.empty(),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hidePathManager")}},{key:or("$view"),value:function(){return{class:{path:"path"===this.state.mode,modify:"modify"===this.state.mode,transform:"transform"===this.state.mode,box:"box"===this.state.box,"has-transform":!!this.state.hasTransform,"segment-move":"segment-move"===this.state.mode},innerHTML:this.pathGenerator.makeSVGPath()}}},{key:or("$splitCircle"),value:function(){return this.state.splitXY?{cx:this.state.splitXY.x,cy:this.state.splitXY.y,r:5}:{r:0}}},{key:"refreshPathLayer",value:function(){this.updatePathLayer()}},{key:"renderPath",value:function(){this.bindData("$view"),this.renderTransformTool()}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:rn.px(0),y:rn.px(0),width:rn.px(0),height:rn.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:"resetTransformZone",value:function(){var t=this.getPathRect();this.state.transformZoneRect=t}},{key:In("$view"),value:function(t){if(this.initRect(),this.isMode("path")&&this.state.rect)this.state.moveXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.altKey=t.altKey,this.renderPath();else{var e=un.create(t.target),n=e.hasClass("split-path");this.state.splitXY=n?this.calculatePointOnLine(e.attr("d"),{x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y}):null,this.bindData("$splitCircle"),this.state.altKey=!1}}},{key:An("$view :not(.split-path)")+Zn()+qn(),value:function(t){this.initRect(),this.state.altKey=!1;var e=this.isMode("path");this.state.dragXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.isOnCanvas=!1;var n=un.create(t.target);if(n.hasClass("svg-editor-canvas")&&!e?this.state.isOnCanvas=!0:(this.pathGenerator.reselect(),this.state.isSegment="true"===n.attr("data-segment"),this.state.isFirstSegment=this.state.isSegment&&"true"===n.attr("data-is-first")),e){if(this.state.isFirstSegment){var r=+n.attr("data-index");this.state.startPoint=this.state.points[r].startPoint}else this.state.startPoint=this.state.dragXY;this.state.dragPoints=!1,this.state.endPoint=null}else if(this.isOnCanvas)this.renderSelectBox(this.state.dragXY);else if(this.state.isSegment){this.changeMode("segment-move");var o=YC(n.attrs("data-index","data-segment-point"),2),i=(r=o[0],o[1]);this.pathGenerator.setCachePoint(+r,i),this.pathGenerator.selectKeyIndex(i,r)}}},{key:"hideSelectBox",value:function(){this.refs.$segmentBox.css({left:rn.px(-1e5)})}},{key:"renderSelectBox",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r={left:rn.px(t.x+(e<0?e:0)),top:rn.px(t.y+(n<0?n:0)),width:rn.px(Math.abs(e)),height:rn.px(Math.abs(n))};this.refs.$segmentBox.css(r)}},{key:"getSelectBox",value:function(){var t=YC(this.refs.$segmentBox.styles("left","top","width","height").map((function(t){return rn.parse(t)})),4),e={x:t[0],y:t[1],width:t[2],height:t[3]};return e.x2=rn.px(e.x.value+e.width.value),e.y2=rn.px(e.y.value+e.height.value),e}},{key:"move",value:function(t,e){if(this.state.isOnCanvas)this.renderSelectBox(this.state.dragXY,t,e);else if(this.isMode("segment-move")){var n=this.$config.get("bodyEvent");this.pathGenerator.move(t,e,n),this.renderPath(),this.updatePathLayer()}else if(this.isMode("path")){n=this.$config.get("bodyEvent");this.state.dragPoints=!n.altKey}}},{key:"renderSegment",value:function(t){this.pathGenerator.selectedLength&&(this.pathGenerator.reselect(),G(t)&&t(),this.renderPath(),this.updatePathLayer())}},{key:fo("deleteSegment"),value:function(){var t=this;this.renderSegment((function(){t.pathGenerator.removeSelectedSegment()}))}},{key:fo("moveSegment"),value:function(t,e){var n=this;this.renderSegment((function(){n.pathGenerator.moveSelectedSegment(t,e)}))}},{key:"end",value:function(t,e){this.state.isOnCanvas?0===t&&0===e?(this.changeMode("modify"),this.trigger("hidePathEditor")):(this.changeMode("segment-move"),this.pathGenerator.selectInBox(this.getSelectBox()),this.renderPath(),this.hideSelectBox()):this.isMode("modify")||(this.isMode("segment-move")?this.changeMode("modify"):this.isMode("path")&&(this.state.isFirstSegment?(this.changeMode("modify"),this.pathGenerator.setConnectedPoint(t,e),this.renderPath(),this.state.current?this.refreshPathLayer():(this.addPathLayer(),this.trigger("hidePathEditor"))):(this.pathGenerator.moveEnd(t,e),this.state.clickCount++,this.renderPath())))}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"isBoxMode",get:function(){return"box"===this.state.box}}]),e}(function(t){function e(){return MC(this,e),FC(this,GC(e).apply(this,arguments))}return HC(e,t),zC(e,[{key:fo("changePathTransform"),value:function(t){this.resetTransformZone();var e=this.state.transformZoneRect,n=e.width,r=e.height;switch(this.pathGenerator.initTransform(this.state.transformZoneRect),t){case"flipX":this.pathGenerator.transform("flipX",n,0);break;case"flipY":this.pathGenerator.transform("flipY",0,r);break;case"flip":this.pathGenerator.transform("flip",n,r)}this.renderPath(),this.refreshPathLayer()}},{key:An("$tool .transform-tool-item")+Zn("moveTransformTool")+qn("moveEndTransformTool"),value:function(t){this.transformMoveType=t.$dt.attr("data-position"),this.resetTransformZone(),this.pathGenerator.initTransform(this.state.transformZoneRect),this.startXY=t.xy}},{key:"moveTransformTool",value:function(t,e){this.pathGenerator.transform(this.transformMoveType,t,e),this.renderPath(),this.refreshPathLayer()}},{key:"moveEndTransformTool",value:function(t,e){this.transformMoveType="none",this.renderTransformTool()}}]),e}(function(t){function e(){return MC(this,e),FC(this,GC(e).apply(this,arguments))}return HC(e,t),zC(e,[{key:"calculatePointOnLine",value:function(t,e){var n=new ra(t);if("C"===n.segments[1].command){var r=[NC(n.segments[0].values),NC(n.segments[1].values.slice(0,2)),NC(n.segments[1].values.slice(2,4)),NC(n.segments[1].values.slice(4,6))],o=dj.apply(void 0,LC(r).concat([200]))(e.x,e.y);return jj(r,o).first[3]}if("Q"===n.segments[1].command){r=[NC(n.segments[0].values),NC(n.segments[1].values.slice(0,2)),NC(n.segments[1].values.slice(2,4))],o=vj.apply(void 0,LC(r).concat([200]))(e.x,e.y);return Sj(r,o).first[2]}if("L"===n.segments[1].command){r=[NC(n.segments[0].values),NC(n.segments[1].values.slice(0,2))],o=bj.apply(void 0,LC(r).concat([200]))(e.x,e.y);return Pj(r,o).first[1]}return e}},{key:bn("$view .split-path"),value:function(t){this.initRect();var e=new ra(t.$dt.attr("d")),n={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y};if("C"===e.segments[1].command){var r=[NC(e.segments[0].values),NC(e.segments[1].values.slice(0,2)),NC(e.segments[1].values.slice(2,4)),NC(e.segments[1].values.slice(4,6))],o=dj.apply(void 0,LC(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPoint(jj(r,o))}else if("Q"===e.segments[1].command){r=[NC(e.segments[0].values),NC(e.segments[1].values.slice(0,2)),NC(e.segments[1].values.slice(2,4))],o=vj.apply(void 0,LC(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointQuard(Sj(r,o))}else if("L"===e.segments[1].command){r=[NC(e.segments[0].values),NC(e.segments[1].values.slice(0,2))],o=bj.apply(void 0,LC(r).concat([200]))(n.x,n.y);this.changeMode("modify"),this.pathGenerator.setPointLine(Pj(r,o))}this.renderPath(),this.refreshPathLayer()}}]),e}(function(t){function e(){return MC(this,e),FC(this,GC(e).apply(this,arguments))}return HC(e,t),zC(e,[{key:gn("$view [data-segment]"),value:function(t){var e=+t.$dt.attr("data-index");this.pathGenerator.convertToCurve(e),this.renderPath(),this.refreshPathLayer()}}]),e}(po))));function UC(t){return(UC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ZC(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function qC(t){for(var e=1;e"}},{key:tr("$el"),value:function(){if(1!==this.$selection.length)return"
";var t=this.$selection.current;if(t.isInGrid()){var e=t.parent,n=e.screenX,r=e.screenY,o=e.width,i=e.height,a=e.toGridLayoutCSS();return"
\n ").concat(e.layers.map((function(t){var e=t.toLayoutItemCSS();return("
"))})).join(""),"\n
")}return("
")}},{key:fo("refreshGridLayoutLine","refreshSelectionTool","refreshSelection"),value:function(){this.refresh()}}])&&tT(n.prototype,r),o&&tT(n,o),e}(po);function iT(t){return(iT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function aT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function cT(t){for(var e=1;e\n
\n "}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:On("document")+Gn("isShow")+Yn+Xn+Jn+Qn,value:function(){this.trigger("hidePathDrawEditor")}},{key:"makePathLayer",value:function(t){var e,n=this,r=this.$selection.currentArtboard;if(r){var o=t.x/this.scale,i=t.y/this.scale,a=t.width/this.scale,c=t.height/this.scale,u=Ui.simply(this.state.points,this.state.tolerance),s=new ra(fa.makePathByPoints(u)),l=TC.generatorPathString(s.convertGenerator(),o,i,this.scale);e=r.add(new U$({width:rn.px(a),height:rn.px(c),d:l,totalLength:this.totalPathLength})),dT.forEach((function(t){n.state[t]&&e.reset(uT({},t,n.state[t]))})),e.setScreenX(o),e.setScreenY(i)}return e}},{key:"addPathLayer",value:function(){var t=this.getPathRect();0!==t.width&&0!==t.height&&this.makePathLayer(t)&&this.emit("refreshAll")}},{key:"changeMode",value:function(t){this.setState(cT({},this.initState(),{},t),!1)}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:fo("showPathDrawEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.changeMode(t),this.$el.show(),this.$el.focus(),this.emit("showDrawManager",{instance:this,fill:this.state.fill,stroke:this.state.stroke,"fill-opacity":this.state["fill-opacity"],"stroke-width":this.state["stroke-width"],"stroke-linecap":this.state["stroke-linecap"],"stroke-linejoin":this.state["stroke-linejoin"]}),this.emit("change.mode.view","PathDrawView")}},{key:fo("initPathDrawEditor"),value:function(){this.pathParser.reset(""),this.refs.$view.empty()}},{key:fo("hidePathDrawEditor"),value:function(){this.trigger("initPathDrawEditor"),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hideDrawManager"),this.emit("change.mode.view")}},{key:"getInnerId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"draw-manager-"+t}},{key:or("$view"),value:function(){return{innerHTML:'\n \n '.concat(this.toDefString,"\n \n \n ')}}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:fo("resizeEditor"),value:function(){this.initRect(!0)}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:rn.px(0),y:rn.px(0),width:rn.px(0),height:rn.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:An("$view")+Zn()+qn(),value:function(t){this.initRect(),this.state.altKey=!1,this.state.startXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.points=[this.state.startXY]}},{key:"move",value:function(t,e,n,r){this.state.points.push({x:this.state.startXY.x+t,y:this.state.startXY.y+e,pressure:r}),this.renderPath()}},{key:"end",value:function(t,e){this.addPathLayer(),this.trigger("initPathDrawEditor")}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"toFillSVG",get:function(){return $$.parseImage(this.state.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return $$.parseImage(this.state.stroke||"black").toSVGString(this.strokeId)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return("\n \n ".concat(t,"\n \n "))}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillValue",get:function(){return $$.parseImage(this.state.fill||"transparent").toFillValue(this.fillId)}},{key:"toStrokeValue",get:function(){return $$.parseImage(this.state.stroke||"black").toFillValue(this.strokeId)}}])&&lT(n.prototype,r),o&&lT(n,o),e}(po);function bT(t){return(bT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function gT(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function mT(t){for(var e=1;e\n
\n "}},{key:"initRect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.state.rect&&!t||(this.state.rect=this.parent.refs.$body.rect())}},{key:On("document")+Gn("isShow")+Yn+Xn+Jn+Qn,value:function(){this.trigger("hideBrushDrawEditor")}},{key:"makeBrushLayer",value:function(t){var e,n=this,r=this.$selection.currentArtboard;if(r){var o=t.x/this.scale,i=t.y/this.scale,a=t.width/this.scale,c=t.height/this.scale,u=Ui.simply(this.state.points,this.state.tolerance),s=new ra(fa.makePathByPoints(u)),l=TC.generatorPathString(s.convertGenerator(),o,i,this.scale);e=r.add(new j_({width:rn.px(a),height:rn.px(c),d:l,totalLength:this.totalPathLength})),$T.forEach((function(t){n.state[t]&&e.reset(wT({},t,n.state[t]))})),e.setScreenX(o),e.setScreenY(i)}return e}},{key:"addBrushLayer",value:function(){var t=this.getPathRect();if(0!==t.width&&0!==t.height){var e=this.makeBrushLayer(t);e&&(this.$selection.select(e),this.emit("refreshAll"),this.emit("refreshSelection"))}}},{key:"changeMode",value:function(t){this.setState(mT({},this.initState(),{},t),!1),this.emit("change.mode.view","PathDrawView")}},{key:"getCurrentObject",value:function(){var t=this.state.current;return t?{current:t,d:t.d,screenX:t.screenX,screenY:t.screenY,screenWidth:t.screenWidth,screenHeight:t.screenHeight}:null}},{key:fo("showBrushDrawEditor"),value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.changeMode(t),this.$el.show(),this.$el.focus(),this.emit("showDrawManager",{fill:this.state.fill,stroke:this.state.stroke,"fill-opacity":this.state["fill-opacity"],"stroke-width":this.state["stroke-width"],"stroke-linecap":this.state["stroke-linecap"],"stroke-linejoin":this.state["stroke-linejoin"]})}},{key:fo("initBrushDrawEditor"),value:function(){this.pathParser.reset(""),this.refs.$view.empty()}},{key:fo("hideBrushDrawEditor"),value:function(){this.trigger("initBrushDrawEditor"),this.$el.hide(),this.emit("finishPathEdit"),this.emit("hideDrawManager"),this.emit("change.mode.view")}},{key:"getInnerId",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"draw-manager-"+t}},{key:or("$view"),value:function(){return{innerHTML:'\n \n '.concat(this.toDefString,"\n \n \n ')}}},{key:"renderPath",value:function(){this.bindData("$view")}},{key:"getPathRect",value:function(){this.initRect(!0);var t=this.refs.$view.$("path.object"),e={x:rn.px(0),y:rn.px(0),width:rn.px(0),height:rn.px(0)};return t&&((e=t.rect()).x-=this.state.rect.x,e.y-=this.state.rect.y),e}},{key:An("$view")+Zn()+qn(),value:function(t){this.initRect(),this.state.altKey=!1,this.state.startXY={x:t.xy.x-this.state.rect.x,y:t.xy.y-this.state.rect.y},this.state.points=[this.state.startXY]}},{key:"move",value:function(t,e,n,r){this.state.points.push({x:this.state.startXY.x+t,y:this.state.startXY.y+e,pressure:r}),this.renderPath()}},{key:"end",value:function(t,e){this.addBrushLayer(),this.trigger("initBrushDrawEditor")}},{key:"scale",get:function(){return this.$editor.scale}},{key:"totalPathLength",get:function(){if(!this.refs.$view)return 0;var t=this.refs.$view.$("path.object");return t?t.totalLength:0}},{key:"toFillSVG",get:function(){return $$.parseImage(this.state.fill||"transparent").toSVGString(this.fillId)}},{key:"toStrokeSVG",get:function(){return $$.parseImage(this.state.stroke||"black").toSVGString(this.strokeId)}},{key:"toDefInnerString",get:function(){return"\n ".concat(this.toFillSVG,"\n ").concat(this.toStrokeSVG,"\n ")}},{key:"toDefString",get:function(){var t=this.toDefInnerString.trim();return("\n \n ".concat(t,"\n \n "))}},{key:"fillId",get:function(){return this.getInnerId("fill")}},{key:"strokeId",get:function(){return this.getInnerId("stroke")}},{key:"toFillValue",get:function(){return $$.parseImage(this.state.fill||"transparent").toFillValue(this.fillId)}},{key:"toStrokeValue",get:function(){return $$.parseImage(this.state.stroke||"black").toFillValue(this.strokeId)}}])&&kT(n.prototype,r),o&&kT(n,o),e}(po);function _T(t){return(_T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function CT(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function TT(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n
\n \n \n \n \n \n \n \n "}},{key:"getScrollXY",value:function(){return{width:this.refs.$body.scrollWidth(),height:this.refs.$body.scrollHeight(),left:this.refs.$body.scrollLeft(),top:this.refs.$body.scrollTop()}}},{key:fo("afterChangeMode"),value:function(){this.$el.attr("data-mode",this.$editor.mode)}},{key:"getElement",value:function(t){return this.refs.$view.$('[data-id="'.concat(t,'"]'))}},{key:"checkEmptyElement",value:function(t){var e=un.create(t.target);return!!this.$editor.isAddMode()||"selection"===this.state.mode&&!1===e.hasClass("element-item")&&!1===e.hasClass("selection-tool-item")&&!1===e.hasClass("point")&&!1===e.hasClass("handle")&&!1===e.hasClass("perspective-handle")&&!1===e.hasClass("transform-tool-item")&&!1===e.hasClass("transform-tool")&&!1===e.isTag("svg")&&!1===e.isTag("path")&&!1===e.isTag("textPath")&&!1===e.isTag("polygon")&&!1===e.isTag("text")&&!1===e.isTag("img")&&"true"!==e.attr("data-segment")}},{key:An("$view")+Gn("checkEmptyElement")+Zn("movePointer")+qn("moveEndPointer"),value:function(t){if(this.$target=un.create(t.target),this.dragXY={x:t.xy.x,y:t.xy.y},this.rect=this.refs.$body.rect(),this.canvasOffset=this.refs.$view.rect(),this.canvasPosition={x:this.canvasOffset.left-this.rect.x,y:this.canvasOffset.top-this.rect.y},this.dragXY.x-=this.rect.x,this.dragXY.y-=this.rect.y,this.$editor.isSelectionMode()){var e={left:rn.px(this.dragXY.x),top:rn.px(this.dragXY.y),width:rn.px(0),height:rn.px(0)};this.refs.$dragAreaRect.css(e),this.state.cachedCurrentElement={},this.$el.$$(".selected").forEach((function(t){return t.removeClass("selected")}))}}},{key:"movePointer",value:function(t,e){var n=this,r={left:rn.px(this.dragXY.x+(t<0?t:0)),top:rn.px(this.dragXY.y+(e<0?e:0)),width:rn.px(Math.abs(t)),height:rn.px(Math.abs(e))};if(this.refs.$dragAreaRect.css(r),this.$editor.isSelectionMode()){var o,i=r.left,a=r.top,c=r.width,u=r.height,s={x:rn.px(i.value-this.canvasPosition.x),y:rn.px(a.value-this.canvasPosition.y),width:c,height:u};s.x2=rn.px(s.x.value+s.width.value),s.y2=rn.px(s.y.value+s.height.value);var l,f=this.$selection.currentArtboard,p=this.$selection.items;if(f)Object.keys(s).forEach((function(t){s[t].div(n.$editor.scale)})),p=f.checkInAreaForLayers(s),0===s.width.value&&0===s.height.value&&(p=[]),(l=this.$selection).select.apply(l,TT(p))&&this.selectCurrentForBackgroundView.apply(this,TT(p));(o=this.$selection).select.apply(o,TT(p))&&this.emit("refreshSelection")}}},{key:"moveEndPointer",value:function(t,e){var n=this,r=CT(this.refs.$dragAreaRect.styles("left","top","width","height").map((function(t){return rn.parse(t)})),4),o=r[0],i=r[1],a=r[2],c=r[3],u={x:rn.px(o.value-this.canvasPosition.x),y:rn.px(i.value-this.canvasPosition.y),width:a,height:c};if(u.x2=rn.px(u.x.value+u.width.value),u.y2=rn.px(u.y.value+u.height.value),this.refs.$dragAreaRect.css({left:rn.px(-1e4),top:rn.px(0),width:rn.px(0),height:rn.px(0)}),this.$editor.isSelectionMode()){var s,l=this.$selection.currentArtboard,f=[];l?(Object.keys(u).forEach((function(t){u[t].div(n.$editor.scale)})),f=l.checkInAreaForLayers(u),0===u.width.value&&0===u.height.value&&(f=[]),0===f.length&&l.checkInArea(u)&&(f=[l]),(s=this.$selection).select.apply(s,TT(f))&&this.selectCurrentForBackgroundView.apply(this,TT(f)),f.length?this.emit("refreshSelection"):(this.$selection.select(),this.emit("emptySelection"))):(this.$selection.select(),this.emit("emptySelection"))}else{var p={x:rn.px(u.x.value/this.$editor.scale),y:rn.px(u.y.value/this.$editor.scale),width:rn.px(u.width.value/this.$editor.scale),height:rn.px(u.height.value/this.$editor.scale)};"image"===this.$editor.addComponentType?this.emit("openImage",p):this.emit("newComponent",this.$editor.addComponentType,p)}this.sendHelpMessage(),this.emit("removeGuideLine")}},{key:"sendHelpMessage",value:function(){1===this.$selection.length&&this.$selection.current.is("svg-path","svg-brush","svg-polygon","svg-textpath")&&this.emit("addStatusBarMessage","Please click if you want to edit to path ")}},{key:On("$view .element-item.text"),value:function(t){var e=t.$dt.html(),n=t.$dt.text().trim(),r=t.$dt.attr("data-id"),o=[];this.$selection.items.filter((function(t){return t.id===r})).forEach((function(t){t.reset({content:e,text:n}),o.push({id:t.id,content:e,text:n})})),this.emit("refreshContent",o)}},{key:"checkEditMode",value:function(){return this.$editor.isSelectionMode()}},{key:An("$view .element-item")+Gn("checkEditMode")+Zn("calculateMovedElement")+qn("calculateEndedElement"),value:function(t){if(this.startXY=t.xy,this.$element=t.$dt,this.$element.hasClass("text")&&this.$element.hasClass("selected"))return!1;var e=this.$element.attr("data-id");this.hasSVG=!1,t.shiftKey?this.$selection.toggleById(e):this.$selection.check({id:e})?this.$selection.current.is("svg-path","svg-brush","svg-textpath","svg-polygon")&&(this.hasSVG=!0):this.$selection.selectById(e),this.selectCurrent.apply(this,TT(this.$selection.items)),this.$selection.setRectCache(),this.emit("refreshSelection"),this.children.$selectionTool.initMoveType()}},{key:"calculateMovedElement",value:function(t,e){this.children.$selectionTool.refreshSelectionToolView(t,e,"move"),this.updateRealPosition()}},{key:"updateRealPositionByItem",value:function(t){var e=t.toBound(),n=e.x,r=e.y,o=e.width,i=e.height,a=this.state.cachedCurrentElement[t.id];a||(this.state.cachedCurrentElement[t.id]=this.getElement(t.id),a=this.state.cachedCurrentElement[t.id]),a&&a.cssText("left: ".concat(n,";top:").concat(r,";width:").concat(o,";height:").concat(i,"; transform: ").concat(t.transform,";"))}},{key:"updateRealPosition",value:function(){var t=this;this.$selection.each((function(e){t.updateRealPositionByItem(e)})),this.emit("refreshRect")}},{key:fo("refreshArtBoardName"),value:function(t,e){this.$el.$("[data-id='".concat(t,"']")).attr("data-title",e)}},{key:"calculateEndedElement",value:function(t,e){if(0===t&&0===e){if(this.hasSVG)return void this.emit("openPathEditor")}else this.$selection.setRectCache(),this.emit("removeGuideLine")}},{key:or("$body"),value:function(){var t=rn.px(1e4),e=rn.px(1e4);return{"data-mode":this.$editor.mode,style:{position:"relative",width:t,height:e}}}},{key:or("$view"),value:function(){return{style:{transform:"scale(".concat(this.$editor.scale,")")},innerHTML:this.state.html}}},{key:fo("addElement"),value:function(){var t=(this.$selection.currentArtboard||{html:""}).html;this.setState({html:t},!1),this.refs.$view.updateDiff(t),this.emit("refreshSelectionTool")}},{key:"selectCurrent",value:function(){var t=this;this.state.cachedCurrentElement={};var e=this.$el.$$(".selected");e&&e.forEach((function(t){return t.removeClass("selected")}));for(var n=arguments.length,r=new Array(n),o=0;o1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=t?[t]:this.$selection.items;o.forEach((function(t){e.updateElement(t,n,r)}))}},{key:"updateElement",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t.updateFunction(this.getElement(t.id),e,n),this.updateRealPositionByItem(t)}},{key:fo("playTimeline","moveTimeline"),value:function(){var t=this,e=this.$selection.currentArtboard;e&&e.getSelectedTimeline().animations.map((function(t){return e.searchById(t.id)})).forEach((function(e){t.updateElement(e)}))}},{key:fo("refreshAllCanvas"),value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.$selection.currentArtboard||{html:""},n=e.html;this.setState({html:n},!1),this.refs.$view.updateDiff(n),t&&this.emit("refreshSelectionTool")}},{key:"refresh",value:function(){this.state.html!=this.prevState.html&&this.load()}},{key:fo("refreshAllElementBoundSize"),value:function(){var t=this,e=this.$selection.items.map((function(t){return t.is("artboard")?t:t.parent}));TT(new Set(e)).forEach((function(e){t.trigger("refreshElementBoundSize",e)})),this.$selection.setRectCache()}},{key:fo("refreshElementBoundSize"),value:function(t){var e=this;t&&t.layers.forEach((function(t){if(t.isLayoutItem()){var n=e.getElement(t.id);if(n){var r=n.offsetRect(),o=r.x,i=r.y,a=r.width,c=r.height;t.reset({x:rn.px(o),y:rn.px(i),width:rn.px(a),height:rn.px(c)}),t.is("component")&&e.emit("refreshStyleView",t,!0),e.trigger("refreshSelectionStyleView",t,!0)}}e.trigger("refreshElementBoundSize",t)}))}},{key:Sn("view")+Jn,value:function(){}},{key:jn("$view")+Jn,value:function(t){var e=un.create(t.target).attr("data-id");if(e)this.$selection.length?this.emit("drop.asset",{gradient:t.dataTransfer.getData("text/gradient"),color:t.dataTransfer.getData("text/color"),imageUrl:t.dataTransfer.getData("image/info")}):this.emit("drop.asset",{gradient:t.dataTransfer.getData("text/gradient"),color:t.dataTransfer.getData("text/color"),imageUrl:t.dataTransfer.getData("image/info")},e);else{var n=t.dataTransfer.getData("image/info");this.emit("dropImageUrl",n)}}}])&&DT(n.prototype,r),o&&DT(n,o),e}(po);function MT(t){return(MT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function BT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zT(t,e){for(var n=0;n"}},{key:tr("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.type,a=t.layout,c=+this.state.value.value.toString();isNaN(c)&&(c=0);var u=o?"has-label":"",s=a,l=(+c).toString();return"\n
\n ").concat(o?""):"","\n
\n
\n \n
\n
\n
\n ')}},{key:"getValue",value:function(){return this.state.value||0}},{key:"setValue",value:function(t){this.setState({value:rn.parse(t)})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}},{key:En("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.updateData({value:this.state.value.set(e)})}}])&&zT(n.prototype,r),o&&zT(n,o),e}(po);function YT(t){return(YT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function NT(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function KT(t,e){for(var n=0;n\n \n
\n \n
\n \n \n \n\n ")}},{key:fo("changeScaleValue"),value:function(t){t=st(100*t,100),this.children.$scale.setValue(t),this.emit("updateScale",t/100)}},{key:fo("changeRangeEditor")+Wn(1e3),value:function(t,e){this.trigger("changeScaleValue",Math.floor(e/100))}},{key:bn("$plus")+Jn+Qn,value:function(){this.trigger("changeScaleValue",this.$editor.scale+.1)}},{key:bn("$minus")+Jn+Qn,value:function(){this.trigger("changeScaleValue",this.$editor.scale-.1)}}])&&KT(n.prototype,r),o&&KT(n,o),e}(po);function JT(t){return(JT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function QT(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e\n
\n \n
\n \n
\n
\n
\n \n "))}},{key:"templateForBlendMode",value:function(t,e){return"\n \n ')}},{key:tr("$fillList"),value:function(){var t=this,e=this.$selection.current||{color:"black"};return this.state.images.map((function(n,r){var o=n.image,i=aR[o.type],a=iR[o.type],c=n.selected?"selected":"";return n.selected&&(t.selectedIndex=r),"\n
\n \n \n
\n
\n
').concat(a,"
\n
\n ").concat(t.templateForBlendMode(r,n.blendMode),"\n
\n
\n \n
\n
\n
\n
\n ")}))}},{key:"modifyBackgroundImage",value:function(){var t=q(Bs.toPropertyCSS(this.state.images));this.parent.trigger(this.props.onchange,this.props.key,t)}},{key:fo("add"),value:function(){this.state.images.push(new Bs({image:new Su({angle:90,colorsteps:[new Ec({percent:0,color:"white",index:0}),new Ec({percent:100,color:"black",index:1})]})})),this.refresh(),this.modifyBackgroundImage()}},{key:bn("$add"),value:function(){this.trigger("add")}},{key:kn("$fillList .fill-item"),value:function(t){this.startIndex=+t.$dt.attr("data-index")}},{key:Sn("$fillList .fill-item")+Jn,value:function(t){}},{key:"sortItem",value:function(t,e,n){t.splice.apply(t,[n+(e1&&void 0!==arguments[1])||arguments[1];e?this.refs["fillIndex".concat(t)].addClass("selected"):this.refs["fillIndex".concat(t)].removeClass("selected"),this.state.images.forEach((function(e,n){e.selected=n===t}))}},{key:fo("selectFillPopupTab"),value:function(t,e){var n=aR[t];this.refs["fillIndex".concat(this.selectedIndex)].attr("data-fill-type",n)}},{key:fo("changeRangeEditor"),value:function(t,e,n){this.trigger("changePattern",t,function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,e),n)}},{key:fo("changePattern"),value:function(t,e,n){var r=+n;this.state.images[r].reset(e),this.modifyBackgroundImage(),this.refresh()}}])&&eR(n.prototype,r),o&&eR(n,o),e}(po);function uR(t){return(uR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function sR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lR(t,e){for(var n=0;n\n
\n \n
\n ").concat(this.props.title?"":"Add","\n
\n
\n
\n \n "))}},{key:tr("$shadowList"),value:function(){var t=this.state.boxShadows.map((function(t,e){return'\n
\n
\n
\n
\n
\n
').concat(Vd.check,'
\n
').concat(t.offsetX,'
\n
').concat(t.offsetY,'
\n
').concat(t.blurRadius,'
\n
').concat(t.spreadRadius,'
\n
\n \n
\n
\n ")}));return t.length&&t.push('\n
\n
\n
Inset
\n\n
X
\n
Y
\n
'.concat(this.$i18n("boxshadow.editor.blur"),'
\n
').concat(this.$i18n("boxshadow.editor.spread"),'
\n
\n
\n
\n ')),t.join("")}},{key:fo("refreshSelection"),value:function(){this.refresh()}},{key:"modifyBoxShadow",value:function(){var t=this.state.boxShadows.join(", ");this.parent.trigger(this.props.onchange,t)}},{key:fo("add"),value:function(){this.state.boxShadows.push(new Xj),this.refresh(),this.modifyBoxShadow()}},{key:bn("$add"),value:function(){this.trigger("add")}},{key:bn("$shadowList .remove"),value:function(t){var e=+t.$dt.attr("data-index");this.state.boxShadows.splice(e,1),this.refresh(),this.modifyBoxShadow(),this.emit("hideBoxShadowPropertyPopup")}},{key:bn("$shadowList .shadow-item.real > div:not(.tools)"),value:function(t){var e=+t.$dt.closest("shadow-item").attr("data-index"),n=this.state.boxShadows[e];this.viewShadowPopup(n,e)}},{key:"viewShadowPopup",value:function(t,e){this.selectedIndex=e,this.viewBoxShadowPropertyPopup(t)}},{key:"viewBoxShadowPropertyPopup",value:function(t){this.emit("showBoxShadowPropertyPopup",{changeEvent:"changeBoxShadowEditorPopup",color:t.color,inset:t.inset,offsetX:t.offsetX,offsetY:t.offsetY,blurRadius:t.blurRadius,spreadRadius:t.spreadRadius},{id:this.id})}},{key:fo("changeBoxShadowEditorColor"),value:function(t){this.trigger("changeBoxShadowEditorPopup",{color:t})}},{key:fo("changeBoxShadowEditorPopup"),value:function(t,e){if(e.id===this.id){var n=this.state.boxShadows[this.selectedIndex];n&&(n.reset(t),this.refresh(),this.modifyBoxShadow())}}}])&&lR(n.prototype,r),o&&lR(n,o),e}(po);function dR(t){return(dR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function vR(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if(!(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function bR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gR(t,e){for(var n=0;n\n ").concat(e?""):"","\n \n \n ")}},{key:"getValue",value:function(){return this.refs.$options.value}},{key:"setValue",value:function(t){this.state.value=t+"",this.refs.$options.val(this.state.value),this.refresh()}},{key:"refresh",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],this.load()}},{key:or("$options"),value:function(){return{"data-count":this.state.options.length.toString()}}},{key:tr("$options"),value:function(){var t=this;return this.state.options.map((function(e){var n=e;if((o=e).includes(t.state.keyValueChar)){var r=vR(o.split(t.state.keyValueChar),2),o=r[0];n=r[1]}""===n?n=t.props["none-value"]?t.props["none-value"]:"":"-"===n&&(n="----------",o="");var i=o===t.state.value?"selected":"";return"")}))}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.setState({options:t.split(this.state.splitChar).map((function(t){return t.trim()}))})}},{key:$n("$options"),value:function(){this.updateData({value:this.refs.$options.value})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}}])&&gR(n.prototype,r),o&&gR(n,o),e}(po);function jR(t){return(jR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function SR(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function PR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xR(t,e){for(var n=0;n"}},{key:"refresh",value:function(){this.load()}},{key:tr("$body"),value:function(){var t=this.state,e=t.min,n=t.max,r=t.step,o=t.label,i=t.removable,a=t.layout,c=+this.state.value.value.toString();isNaN(c)&&(c=0);var u=a,s=(+c).toString(),l=this.state.units.split(",").map((function(t){var e=t;return"number"===e&&(e=""),"".concat(t,":").concat(e)})).join(",");return"\n
\n ").concat(o?""):"","\n
\n \n
\n \n \n
\n
\n \n
\n ")}},{key:"getValue",value:function(){return this.state.value.clone()}},{key:"setValue",value:function(t){this.setState({value:rn.parse(t)})}},{key:_n("$propertyNumber"),value:function(t){this.refs.$rangeArea.addClass("focused")}},{key:Tn("$propertyNumber"),value:function(t){this.refs.$rangeArea.removeClass("focused")}},{key:bn("$remove"),value:function(t){this.updateData({value:""})}},{key:"updateData",value:function(t){this.setState(t,!1),this.parent.trigger(this.props.onchange,this.props.key,this.state.value,this.props.params)}},{key:"initValue",value:function(){""==this.state.value&&(this.state.value=new rn(0,this.children.$unit.getValue()))}},{key:En("$propertyNumber"),value:function(t){var e=+this.getRef("$propertyNumber").value;this.getRef("$property").val(e),this.initValue(),this.updateData({value:new rn(e,this.children.$unit.getValue())})}},{key:En("$property"),value:function(t){var e=+this.getRef("$property").value;this.refs.$propertyNumber.val(e),this.initValue(),this.updateData({value:new rn(e,this.children.$unit.getValue())})}},{key:fo("changeUnit"),value:function(t,e){this.initValue(),this.updateData({value:this.state.value.toUnit(e)})}}])&&xR(n.prototype,r),o&&xR(n,o),e}(po);function TR(t){return(TR="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function RR(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DR(t,e){for(var n=0;n"}},{key:fo("changeBorderRadius"),value:function(t,e){var n=this;"border-radius"===t&&MR.forEach((function(t){n.children["$".concat(t)].setValue(e.clone())})),this.setBorderRadius()}},{key:tr("$body"),value:function(){var t=this,e=this.state.isAll?"all":"partitial",n=this.state["border-radius"];return'\n
\n
\n \n \n
\n
\n \n
\n
\n