!function(r){"use strict";var t,e,n;t=[function(r,t,e){e(1),e(53),e(81),e(82),e(93),e(94),e(99),e(100),e(110),e(120),e(122),e(123),e(124),r.exports=e(125)},function(r,t,e){var n=e(2),o=e(4),a=e(48),c=ArrayBuffer.prototype;n&&!("detached"in c)&&o(c,"detached",{configurable:!0,get:function(){return a(this)}})},function(r,t,e){var n=e(3);r.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(r,t,e){r.exports=function(r){try{return!!r()}catch(r){return!0}}},function(r,t,e){var n=e(5),o=e(23);r.exports=function(r,t,e){return e.get&&n(e.get,t,{getter:!0}),e.set&&n(e.set,t,{setter:!0}),o.f(r,t,e)}},function(t,e,n){var o=n(6),a=n(3),c=n(8),i=n(9),u=n(2),s=n(13).CONFIGURABLE,f=n(14),p=n(19),l=p.enforce,y=p.get,v=String,h=Object.defineProperty,g=o("".slice),b=o("".replace),m=o([].join),d=u&&!a((function(){return 8!==h((function(){}),"length",{value:8}).length})),w=String(String).split("String"),E=t.exports=function(t,e,n){"Symbol("===g(v(e),0,7)&&(e="["+b(v(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!i(t,"name")||s&&t.name!==e)&&(u?h(t,"name",{value:e,configurable:!0}):t.name=e),d&&n&&i(n,"arity")&&t.length!==n.arity&&h(t,"length",{value:n.arity});try{n&&i(n,"constructor")&&n.constructor?u&&h(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=r)}catch(r){}var o=l(t);return i(o,"source")||(o.source=m(w,"string"==typeof e?e:"")),t};Function.prototype.toString=E((function(){return c(this)&&y(this).source||f(this)}),"toString")},function(r,t,e){var n=e(7),o=Function.prototype,a=o.call,c=n&&o.bind.bind(a,a);r.exports=n?c:function(r){return function(){return a.apply(r,arguments)}}},function(r,t,e){var n=e(3);r.exports=!n((function(){var r=function(){}.bind();return"function"!=typeof r||r.hasOwnProperty("prototype")}))},function(t,e,n){var o="object"==typeof document&&document.all;t.exports=void 0===o&&o!==r?function(r){return"function"==typeof r||r===o}:function(r){return"function"==typeof r}},function(r,t,e){var n=e(6),o=e(10),a=n({}.hasOwnProperty);r.exports=Object.hasOwn||function(r,t){return a(o(r),t)}},function(r,t,e){var n=e(11),o=Object;r.exports=function(r){return o(n(r))}},function(r,t,e){var n=e(12),o=TypeError;r.exports=function(r){if(n(r))throw new o("Can't call method on "+r);return r}},function(t,e,n){t.exports=function(t){return null===t||t===r}},function(r,t,e){var n=e(2),o=e(9),a=Function.prototype,c=n&&Object.getOwnPropertyDescriptor,i=o(a,"name"),u=i&&"something"===function(){}.name,s=i&&(!n||n&&c(a,"name").configurable);r.exports={EXISTS:i,PROPER:u,CONFIGURABLE:s}},function(r,t,e){var n=e(6),o=e(8),a=e(15),c=n(Function.toString);o(a.inspectSource)||(a.inspectSource=function(r){return c(r)}),r.exports=a.inspectSource},function(r,t,e){var n=e(16),o=e(17),a=e(18),c="__core-js_shared__",i=r.exports=o[c]||a(c,{});(i.versions||(i.versions=[])).push({version:"3.39.0",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"})},function(r,t,e){r.exports=!1},function(r,t,e){var n=function(r){return r&&r.Math===Math&&r};r.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof global&&global)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},function(r,t,e){var n=e(17),o=Object.defineProperty;r.exports=function(r,t){try{o(n,r,{value:t,configurable:!0,writable:!0})}catch(e){n[r]=t}return t}},function(r,t,e){var n,o,a,c=e(20),i=e(17),u=e(21),s=e(22),f=e(9),p=e(15),l=e(46),y=e(47),v="Object already initialized",h=i.TypeError,g=i.WeakMap;if(c||p.state){var b=p.state||(p.state=new g);b.get=b.get,b.has=b.has,b.set=b.set,n=function(r,t){if(b.has(r))throw new h(v);return t.facade=r,b.set(r,t),t},o=function(r){return b.get(r)||{}},a=function(r){return b.has(r)}}else{var m=l("state");y[m]=!0,n=function(r,t){if(f(r,m))throw new h(v);return t.facade=r,s(r,m,t),t},o=function(r){return f(r,m)?r[m]:{}},a=function(r){return f(r,m)}}r.exports={set:n,get:o,has:a,enforce:function(r){return a(r)?o(r):n(r,{})},getterFor:function(r){return function(t){var e;if(!u(t)||(e=o(t)).type!==r)throw new h("Incompatible receiver, "+r+" required");return e}}}},function(r,t,e){var n=e(17),o=e(8),a=n.WeakMap;r.exports=o(a)&&/native code/.test(String(a))},function(r,t,e){var n=e(8);r.exports=function(r){return"object"==typeof r?null!==r:n(r)}},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=n?function(r,t,e){return o.f(r,t,a(1,e))}:function(r,t,e){return r[t]=e,r}},function(r,t,e){var n=e(2),o=e(24),a=e(26),c=e(27),i=e(28),u=TypeError,s=Object.defineProperty,f=Object.getOwnPropertyDescriptor,p="enumerable",l="configurable",y="writable";t.f=n?a?function(r,t,e){if(c(r),t=i(t),c(e),"function"==typeof r&&"prototype"===t&&"value"in e&&y in e&&!e[y]){var n=f(r,t);n&&n[y]&&(r[t]=e.value,e={configurable:l in e?e[l]:n[l],enumerable:p in e?e[p]:n[p],writable:!1})}return s(r,t,e)}:s:function(r,t,e){if(c(r),t=i(t),c(e),o)try{return s(r,t,e)}catch(r){}if("get"in e||"set"in e)throw new u("Accessors not supported");return"value"in e&&(r[t]=e.value),r}},function(r,t,e){var n=e(2),o=e(3),a=e(25);r.exports=!n&&!o((function(){return 7!==Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(r,t,e){var n=e(17),o=e(21),a=n.document,c=o(a)&&o(a.createElement);r.exports=function(r){return c?a.createElement(r):{}}},function(r,t,e){var n=e(2),o=e(3);r.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},function(r,t,e){var n=e(21),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not an object")}},function(r,t,e){var n=e(29),o=e(31);r.exports=function(r){var t=n(r,"string");return o(t)?t:t+""}},function(t,e,n){var o=n(30),a=n(21),c=n(31),i=n(38),u=n(41),s=n(42),f=TypeError,p=s("toPrimitive");t.exports=function(t,e){if(!a(t)||c(t))return t;var n,s=i(t,p);if(s){if(e===r&&(e="default"),n=o(s,t,e),!a(n)||c(n))return n;throw new f("Can't convert object to primitive value")}return e===r&&(e="number"),u(t,e)}},function(r,t,e){var n=e(7),o=Function.prototype.call;r.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},function(r,t,e){var n=e(32),o=e(8),a=e(33),c=e(34),i=Object;r.exports=c?function(r){return"symbol"==typeof r}:function(r){var t=n("Symbol");return o(t)&&a(t.prototype,i(r))}},function(t,e,n){var o=n(17),a=n(8);t.exports=function(t,e){return arguments.length<2?(n=o[t],a(n)?n:r):o[t]&&o[t][e];var n}},function(r,t,e){var n=e(6);r.exports=n({}.isPrototypeOf)},function(r,t,e){var n=e(35);r.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(r,t,e){var n=e(36),o=e(3),a=e(17).String;r.exports=!!Object.getOwnPropertySymbols&&!o((function(){var r=Symbol("symbol detection");return!a(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},function(r,t,e){var n,o,a=e(17),c=e(37),i=a.process,u=a.Deno,s=i&&i.versions||u&&u.version,f=s&&s.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&c&&(!(n=c.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=c.match(/Chrome\/(\d+)/))&&(o=+n[1]),r.exports=o},function(r,t,e){var n=e(17).navigator,o=n&&n.userAgent;r.exports=o?String(o):""},function(t,e,n){var o=n(39),a=n(12);t.exports=function(t,e){var n=t[e];return a(n)?r:o(n)}},function(r,t,e){var n=e(8),o=e(40),a=TypeError;r.exports=function(r){if(n(r))return r;throw new a(o(r)+" is not a function")}},function(r,t,e){var n=String;r.exports=function(r){try{return n(r)}catch(r){return"Object"}}},function(r,t,e){var n=e(30),o=e(8),a=e(21),c=TypeError;r.exports=function(r,t){var e,i;if("string"===t&&o(e=r.toString)&&!a(i=n(e,r)))return i;if(o(e=r.valueOf)&&!a(i=n(e,r)))return i;if("string"!==t&&o(e=r.toString)&&!a(i=n(e,r)))return i;throw new c("Can't convert object to primitive value")}},function(r,t,e){var n=e(17),o=e(43),a=e(9),c=e(44),i=e(35),u=e(34),s=n.Symbol,f=o("wks"),p=u?s.for||s:s&&s.withoutSetter||c;r.exports=function(r){return a(f,r)||(f[r]=i&&a(s,r)?s[r]:p("Symbol."+r)),f[r]}},function(r,t,e){var n=e(15);r.exports=function(r,t){return n[r]||(n[r]=t||{})}},function(t,e,n){var o=n(6),a=0,c=Math.random(),i=o(1..toString);t.exports=function(t){return"Symbol("+(t===r?"":t)+")_"+i(++a+c,36)}},function(r,t,e){r.exports=function(r,t){return{enumerable:!(1&r),configurable:!(2&r),writable:!(4&r),value:t}}},function(r,t,e){var n=e(43),o=e(44),a=n("keys");r.exports=function(r){return a[r]||(a[r]=o(r))}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(17),o=e(49),a=e(51),c=n.ArrayBuffer,i=c&&c.prototype,u=i&&o(i.slice);r.exports=function(r){if(0!==a(r))return!1;if(!u)return!1;try{return u(r,0,0),!1}catch(r){return!0}}},function(r,t,e){var n=e(50),o=e(6);r.exports=function(r){if("Function"===n(r))return o(r)}},function(r,t,e){var n=e(6),o=n({}.toString),a=n("".slice);r.exports=function(r){return a(o(r),8,-1)}},function(r,t,e){var n=e(17),o=e(52),a=e(50),c=n.ArrayBuffer,i=n.TypeError;r.exports=c&&o(c.prototype,"byteLength","get")||function(r){if("ArrayBuffer"!==a(r))throw new i("ArrayBuffer expected");return r.byteLength}},function(r,t,e){var n=e(6),o=e(39);r.exports=function(r,t,e){try{return n(o(Object.getOwnPropertyDescriptor(r,t)[e]))}catch(r){}}},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transfer:function(){return a(this,arguments.length?arguments[0]:r,!0)}})},function(t,e,n){var o=n(17),a=n(55).f,c=n(22),i=n(59),u=n(18),s=n(60),f=n(72);t.exports=function(t,e){var n,p,l,y,v,h=t.target,g=t.global,b=t.stat;if(n=g?o:b?o[h]||u(h,{}):o[h]&&o[h].prototype)for(p in e){if(y=e[p],l=t.dontCallGetSet?(v=a(n,p))&&v.value:n[p],!f(g?p:h+(b?".":"#")+p,t.forced)&&l!==r){if(typeof y==typeof l)continue;s(y,l)}(t.sham||l&&l.sham)&&c(y,"sham",!0),i(n,p,y,t)}}},function(r,t,e){var n=e(2),o=e(30),a=e(56),c=e(45),i=e(57),u=e(28),s=e(9),f=e(24),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(r,t){if(r=i(r),t=u(t),f)try{return p(r,t)}catch(r){}if(s(r,t))return c(!o(a.f,r,t),r[t])}},function(r,t,e){var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!n.call({1:2},1);t.f=a?function(r){var t=o(this,r);return!!t&&t.enumerable}:n},function(r,t,e){var n=e(58),o=e(11);r.exports=function(r){return n(o(r))}},function(r,t,e){var n=e(6),o=e(3),a=e(50),c=Object,i=n("".split);r.exports=o((function(){return!c("z").propertyIsEnumerable(0)}))?function(r){return"String"===a(r)?i(r,""):c(r)}:c},function(t,e,n){var o=n(8),a=n(23),c=n(5),i=n(18);t.exports=function(t,e,n,u){u||(u={});var s=u.enumerable,f=u.name!==r?u.name:e;if(o(n)&&c(n,f,u),u.global)s?t[e]=n:i(e,n);else{try{u.unsafe?t[e]&&(s=!0):delete t[e]}catch(r){}s?t[e]=n:a.f(t,e,{value:n,enumerable:!1,configurable:!u.nonConfigurable,writable:!u.nonWritable})}return t}},function(r,t,e){var n=e(9),o=e(61),a=e(55),c=e(23);r.exports=function(r,t,e){for(var i=o(t),u=c.f,s=a.f,f=0;f<i.length;f++){var p=i[f];n(r,p)||e&&n(e,p)||u(r,p,s(t,p))}}},function(r,t,e){var n=e(32),o=e(6),a=e(62),c=e(71),i=e(27),u=o([].concat);r.exports=n("Reflect","ownKeys")||function(r){var t=a.f(i(r)),e=c.f;return e?u(t,e(r)):t}},function(r,t,e){var n=e(63),o=e(70).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(r){return n(r,o)}},function(r,t,e){var n=e(6),o=e(9),a=e(57),c=e(64).indexOf,i=e(47),u=n([].push);r.exports=function(r,t){var e,n=a(r),s=0,f=[];for(e in n)!o(i,e)&&o(n,e)&&u(f,e);for(;t.length>s;)o(n,e=t[s++])&&(~c(f,e)||u(f,e));return f}},function(r,t,e){var n=e(57),o=e(65),a=e(68),c=function(r){return function(t,e,c){var i=n(t),u=a(i);if(0===u)return!r&&-1;var s,f=o(c,u);if(r&&e!=e){for(;u>f;)if((s=i[f++])!=s)return!0}else for(;u>f;f++)if((r||f in i)&&i[f]===e)return r||f||0;return!r&&-1}};r.exports={includes:c(!0),indexOf:c(!1)}},function(r,t,e){var n=e(66),o=Math.max,a=Math.min;r.exports=function(r,t){var e=n(r);return e<0?o(e+t,0):a(e,t)}},function(r,t,e){var n=e(67);r.exports=function(r){var t=+r;return t!=t||0===t?0:n(t)}},function(r,t,e){var n=Math.ceil,o=Math.floor;r.exports=Math.trunc||function(r){var t=+r;return(t>0?o:n)(t)}},function(r,t,e){var n=e(69);r.exports=function(r){return n(r.length)}},function(r,t,e){var n=e(66),o=Math.min;r.exports=function(r){var t=n(r);return t>0?o(t,9007199254740991):0}},function(r,t,e){r.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(r,t,e){t.f=Object.getOwnPropertySymbols},function(r,t,e){var n=e(3),o=e(8),a=/#|\.prototype\./,c=function(r,t){var e=u[i(r)];return e===f||e!==s&&(o(t)?n(t):!!t)},i=c.normalize=function(r){return String(r).replace(a,".").toLowerCase()},u=c.data={},s=c.NATIVE="N",f=c.POLYFILL="P";r.exports=c},function(t,e,n){var o=n(17),a=n(6),c=n(52),i=n(74),u=n(75),s=n(51),f=n(76),p=n(80),l=o.structuredClone,y=o.ArrayBuffer,v=o.DataView,h=Math.min,g=y.prototype,b=v.prototype,m=a(g.slice),d=c(g,"resizable","get"),w=c(g,"maxByteLength","get"),E=a(b.getInt8),x=a(b.setInt8);t.exports=(p||f)&&function(t,e,n){var o,a=s(t),c=e===r?a:i(e),g=!d||!d(t);if(u(t),p&&(t=l(t,{transfer:[t]}),a===c&&(n||g)))return t;if(a>=c&&(!n||g))o=m(t,0,c);else{var b=n&&!g&&w?{maxByteLength:w(t)}:r;o=new y(c,b);for(var O=new v(t),R=new v(o),S=h(c,a),A=0;A<S;A++)x(R,A,E(O,A))}return p||f(t),o}},function(t,e,n){var o=n(66),a=n(69),c=RangeError;t.exports=function(t){if(t===r)return 0;var e=o(t),n=a(e);if(e!==n)throw new c("Wrong length or index");return n}},function(r,t,e){var n=e(48),o=TypeError;r.exports=function(r){if(n(r))throw new o("ArrayBuffer is detached");return r}},function(r,t,e){var n,o,a,c,i=e(17),u=e(77),s=e(80),f=i.structuredClone,p=i.ArrayBuffer,l=i.MessageChannel,y=!1;if(s)y=function(r){f(r,{transfer:[r]})};else if(p)try{l||(n=u("worker_threads"))&&(l=n.MessageChannel),l&&(o=new l,a=new p(2),c=function(r){o.port1.postMessage(null,[r])},2===a.byteLength&&(c(a),0===a.byteLength&&(y=c)))}catch(r){}r.exports=y},function(r,t,e){var n=e(17),o=e(78);r.exports=function(r){if(o){try{return n.process.getBuiltinModule(r)}catch(r){}try{return Function('return require("'+r+'")')()}catch(r){}}}},function(r,t,e){var n=e(79);r.exports="NODE"===n},function(r,t,e){var n=e(17),o=e(37),a=e(50),c=function(r){return o.slice(0,r.length)===r};r.exports=c("Bun/")?"BUN":c("Cloudflare-Workers")?"CLOUDFLARE":c("Deno/")?"DENO":c("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===a(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},function(r,t,e){var n=e(17),o=e(3),a=e(36),c=e(79),i=n.structuredClone;r.exports=!!i&&!o((function(){if("DENO"===c&&a>92||"NODE"===c&&a>94||"BROWSER"===c&&a>97)return!1;var r=new ArrayBuffer(8),t=i(r,{transfer:[r]});return 0!==r.byteLength||8!==t.byteLength}))},function(t,e,n){var o=n(54),a=n(73);a&&o({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return a(this,arguments.length?arguments[0]:r,!1)}})},function(r,t,e){var n=e(54),o=e(6),a=e(39),c=e(11),i=e(83),u=e(92),s=e(16),f=e(3),p=u.Map,l=u.has,y=u.get,v=u.set,h=o([].push),g=s||f((function(){return 1!==p.groupBy("ab",(function(r){return r})).get("a").length}));n({target:"Map",stat:!0,forced:s||g},{groupBy:function(r,t){c(r),a(t);var e=new p,n=0;return i(r,(function(r){var o=t(r,n++);l(e,o)?h(y(e,o),r):v(e,o,[r])})),e}})},function(r,t,e){var n=e(84),o=e(30),a=e(27),c=e(40),i=e(85),u=e(68),s=e(33),f=e(87),p=e(88),l=e(91),y=TypeError,v=function(r,t){this.stopped=r,this.result=t},h=v.prototype;r.exports=function(r,t,e){var g,b,m,d,w,E,x,O=e&&e.that,R=!(!e||!e.AS_ENTRIES),S=!(!e||!e.IS_RECORD),A=!(!e||!e.IS_ITERATOR),T=!(!e||!e.INTERRUPTED),D=n(t,O),_=function(r){return g&&l(g,"normal",r),new v(!0,r)},I=function(r){return R?(a(r),T?D(r[0],r[1],_):D(r[0],r[1])):T?D(r,_):D(r)};if(S)g=r.iterator;else if(A)g=r;else{if(!(b=p(r)))throw new y(c(r)+" is not iterable");if(i(b)){for(m=0,d=u(r);d>m;m++)if((w=I(r[m]))&&s(h,w))return w;return new v(!1)}g=f(r,b)}for(E=S?r.next:g.next;!(x=o(E,g)).done;){try{w=I(x.value)}catch(r){l(g,"throw",r)}if("object"==typeof w&&w&&s(h,w))return w}return new v(!1)}},function(t,e,n){var o=n(49),a=n(39),c=n(7),i=o(o.bind);t.exports=function(t,e){return a(t),e===r?t:c?i(t,e):function(){return t.apply(e,arguments)}}},function(t,e,n){var o=n(42),a=n(86),c=o("iterator"),i=Array.prototype;t.exports=function(t){return t!==r&&(a.Array===t||i[c]===t)}},function(r,t,e){r.exports={}},function(r,t,e){var n=e(30),o=e(39),a=e(27),c=e(40),i=e(88),u=TypeError;r.exports=function(r,t){var e=arguments.length<2?i(r):t;if(o(e))return a(n(e,r));throw new u(c(r)+" is not iterable")}},function(r,t,e){var n=e(89),o=e(38),a=e(12),c=e(86),i=e(42)("iterator");r.exports=function(r){if(!a(r))return o(r,i)||o(r,"@@iterator")||c[n(r)]}},function(t,e,n){var o=n(90),a=n(8),c=n(50),i=n(42)("toStringTag"),u=Object,s="Arguments"===c(function(){return arguments}());t.exports=o?c:function(t){var e,n,o;return t===r?"Undefined":null===t?"Null":"string"==typeof(n=function(r,t){try{return r[t]}catch(r){}}(e=u(t),i))?n:s?c(e):"Object"===(o=c(e))&&a(e.callee)?"Arguments":o}},function(r,t,e){var n={};n[e(42)("toStringTag")]="z",r.exports="[object z]"===String(n)},function(r,t,e){var n=e(30),o=e(27),a=e(38);r.exports=function(r,t,e){var c,i;o(r);try{if(!(c=a(r,"return"))){if("throw"===t)throw e;return e}c=n(c,r)}catch(r){i=!0,c=r}if("throw"===t)throw e;if(i)throw c;return o(c),e}},function(r,t,e){var n=e(6),o=Map.prototype;r.exports={Map,set:n(o.set),get:n(o.get),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(54),o=e(32),a=e(6),c=e(39),i=e(11),u=e(28),s=e(83),f=e(3),p=Object.groupBy,l=o("Object","create"),y=a([].push);n({target:"Object",stat:!0,forced:!p||f((function(){return 1!==p("ab",(function(r){return r})).a.length}))},{groupBy:function(r,t){i(r),c(t);var e=l(null),n=0;return s(r,(function(r){var o=u(t(r,n++));o in e?y(e[o],r):e[o]=[r]})),e}})},function(t,e,n){var o=n(54),a=n(17),c=n(95),i=n(96),u=n(97),s=n(39),f=n(98),p=a.Promise,l=!1;o({target:"Promise",stat:!0,forced:!p||!p.try||f((function(){p.try((function(r){l=8===r}),8)})).error||!l},{try:function(t){var e=arguments.length>1?i(arguments,1):[],n=u.f(this),o=f((function(){return c(s(t),r,e)}));return(o.error?n.reject:n.resolve)(o.value),n.promise}})},function(r,t,e){var n=e(7),o=Function.prototype,a=o.apply,c=o.call;r.exports="object"==typeof Reflect&&Reflect.apply||(n?c.bind(a):function(){return c.apply(a,arguments)})},function(r,t,e){var n=e(6);r.exports=n([].slice)},function(t,e,n){var o=n(39),a=TypeError,c=function(t){var e,n;this.promise=new t((function(t,o){if(e!==r||n!==r)throw new a("Bad Promise constructor");e=t,n=o})),this.resolve=o(e),this.reject=o(n)};t.exports.f=function(r){return new c(r)}},function(r,t,e){r.exports=function(r){try{return{error:!1,value:r()}}catch(r){return{error:!0,value:r}}}},function(r,t,e){var n=e(54),o=e(97);n({target:"Promise",stat:!0},{withResolvers:function(){var r=o.f(this);return{promise:r.promise,resolve:r.resolve,reject:r.reject}}})},function(t,e,n){var o=n(54),a=n(17),c=n(32),i=n(45),u=n(23).f,s=n(9),f=n(101),p=n(102),l=n(106),y=n(108),v=n(109),h=n(2),g=n(16),b="DOMException",m=c("Error"),d=c(b),w=function(){f(this,E);var t=arguments.length,e=l(t<1?r:arguments[0]),n=l(t<2?r:arguments[1],"Error"),o=new d(e,n),a=new m(e);return a.name=b,u(o,"stack",i(1,v(a.stack,1))),p(o,this,w),o},E=w.prototype=d.prototype,x="stack"in new m(b),O="stack"in new d(1,2),R=d&&h&&Object.getOwnPropertyDescriptor(a,b),S=!(!R||R.writable&&R.configurable),A=x&&!S&&!O;o({global:!0,constructor:!0,forced:g||A},{DOMException:A?w:d});var T=c(b),D=T.prototype;if(D.constructor!==T)for(var _ in g||u(D,"constructor",i(1,T)),y)if(s(y,_)){var I=y[_],j=I.s;s(T,j)||u(T,j,i(6,I.c))}},function(r,t,e){var n=e(33),o=TypeError;r.exports=function(r,t){if(n(t,r))return r;throw new o("Incorrect invocation")}},function(r,t,e){var n=e(8),o=e(21),a=e(103);r.exports=function(r,t,e){var c,i;return a&&n(c=t.constructor)&&c!==e&&o(i=c.prototype)&&i!==e.prototype&&a(r,i),r}},function(t,e,n){var o=n(52),a=n(21),c=n(11),i=n(104);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r,t=!1,e={};try{(r=o(Object.prototype,"__proto__","set"))(e,[]),t=e instanceof Array}catch(r){}return function(e,n){return c(e),i(n),a(e)?(t?r(e,n):e.__proto__=n,e):e}}():r)},function(r,t,e){var n=e(105),o=String,a=TypeError;r.exports=function(r){if(n(r))return r;throw new a("Can't set "+o(r)+" as a prototype")}},function(r,t,e){var n=e(21);r.exports=function(r){return n(r)||null===r}},function(t,e,n){var o=n(107);t.exports=function(t,e){return t===r?arguments.length<2?"":e:o(t)}},function(r,t,e){var n=e(89),o=String;r.exports=function(r){if("Symbol"===n(r))throw new TypeError("Cannot convert a Symbol value to a string");return o(r)}},function(r,t,e){r.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},function(r,t,e){var n=e(6),o=Error,a=n("".replace),c=String(new o("zxcasd").stack),i=/\n\s*at [^:]*:[^\n]*/,u=i.test(c);r.exports=function(r,t){if(u&&"string"==typeof r&&!o.prepareStackTrace)for(;t--;)r=a(r,i,"");return r}},function(t,e,n){var o,a=n(16),c=n(54),i=n(17),u=n(32),s=n(6),f=n(3),p=n(44),l=n(8),y=n(111),v=n(12),h=n(21),g=n(31),b=n(83),m=n(27),d=n(89),w=n(9),E=n(112),x=n(22),O=n(68),R=n(113),S=n(114),A=n(92),T=n(116),D=n(117),_=n(76),I=n(119),j=n(80),M=i.Object,k=i.Array,P=i.Date,C=i.Error,L=i.TypeError,B=i.PerformanceMark,N=u("DOMException"),U=A.Map,F=A.has,z=A.get,W=A.set,V=T.Set,H=T.add,G=T.has,Y=u("Object","keys"),Q=s([].push),q=s((!0).valueOf),X=s(1..valueOf),K=s("".valueOf),Z=s(P.prototype.getTime),$=p("structuredClone"),J="DataCloneError",rr="Transferring",tr=function(r){return!f((function(){var t=new i.Set([7]),e=r(t),n=r(M(7));return e===t||!e.has(7)||!h(n)||7!=+n}))&&r},er=function(r,t){return!f((function(){var e=new t,n=r({a:e,b:e});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===e.stack)}))},nr=i.structuredClone,or=a||!er(nr,C)||!er(nr,N)||(o=nr,!!f((function(){var r=o(new i.AggregateError([1],$,{cause:3}));return"AggregateError"!==r.name||1!==r.errors[0]||r.message!==$||3!==r.cause}))),ar=!nr&&tr((function(r){return new B($,{detail:r}).detail})),cr=tr(nr)||ar,ir=function(r){throw new N("Uncloneable type: "+r,J)},ur=function(r,t){throw new N((t||"Cloning")+" of "+r+" cannot be properly polyfilled in this engine",J)},sr=function(r,t){return cr||ur(t),cr(r)},fr=function(t,e,n){if(F(e,t))return z(e,t);var o,a,c,u,s,f;if("SharedArrayBuffer"===(n||d(t)))o=cr?cr(t):t;else{var p=i.DataView;p||l(t.slice)||ur("ArrayBuffer");try{if(l(t.slice)&&!t.resizable)o=t.slice(0);else{a=t.byteLength,c="maxByteLength"in t?{maxByteLength:t.maxByteLength}:r,o=new ArrayBuffer(a,c),u=new p(t),s=new p(o);for(f=0;f<a;f++)s.setUint8(f,u.getUint8(f))}}catch(r){throw new N("ArrayBuffer is detached",J)}}return W(e,t,o),o},pr=function(t,e){if(g(t)&&ir("Symbol"),!h(t))return t;if(e){if(F(e,t))return z(e,t)}else e=new U;var n,o,a,c,s,f,p,y,v=d(t);switch(v){case"Array":a=k(O(t));break;case"Object":a={};break;case"Map":a=new U;break;case"Set":a=new V;break;case"RegExp":a=new RegExp(t.source,S(t));break;case"Error":switch(o=t.name){case"AggregateError":a=new(u(o))([]);break;case"EvalError":case"RangeError":case"ReferenceError":case"SuppressedError":case"SyntaxError":case"TypeError":case"URIError":a=new(u(o));break;case"CompileError":case"LinkError":case"RuntimeError":a=new(u("WebAssembly",o));break;default:a=new C}break;case"DOMException":a=new N(t.message,t.name);break;case"ArrayBuffer":case"SharedArrayBuffer":a=fr(t,e,v);break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float16Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":f="DataView"===v?t.byteLength:t.length,a=function(r,t,e,n,o){var a=i[t];return h(a)||ur(t),new a(fr(r.buffer,o),e,n)}(t,v,t.byteOffset,f,e);break;case"DOMQuad":try{a=new DOMQuad(pr(t.p1,e),pr(t.p2,e),pr(t.p3,e),pr(t.p4,e))}catch(r){a=sr(t,v)}break;case"File":if(cr)try{a=cr(t),d(a)!==v&&(a=r)}catch(r){}if(!a)try{a=new File([t],t.name,t)}catch(r){}a||ur(v);break;case"FileList":if(c=function(){var r;try{r=new i.DataTransfer}catch(t){try{r=new i.ClipboardEvent("").clipboardData}catch(r){}}return r&&r.items&&r.files?r:null}()){for(s=0,f=O(t);s<f;s++)c.items.add(pr(t[s],e));a=c.files}else a=sr(t,v);break;case"ImageData":try{a=new ImageData(pr(t.data,e),t.width,t.height,{colorSpace:t.colorSpace})}catch(r){a=sr(t,v)}break;default:if(cr)a=cr(t);else switch(v){case"BigInt":a=M(t.valueOf());break;case"Boolean":a=M(q(t));break;case"Number":a=M(X(t));break;case"String":a=M(K(t));break;case"Date":a=new P(Z(t));break;case"Blob":try{a=t.slice(0,t.size,t.type)}catch(r){ur(v)}break;case"DOMPoint":case"DOMPointReadOnly":n=i[v];try{a=n.fromPoint?n.fromPoint(t):new n(t.x,t.y,t.z,t.w)}catch(r){ur(v)}break;case"DOMRect":case"DOMRectReadOnly":n=i[v];try{a=n.fromRect?n.fromRect(t):new n(t.x,t.y,t.width,t.height)}catch(r){ur(v)}break;case"DOMMatrix":case"DOMMatrixReadOnly":n=i[v];try{a=n.fromMatrix?n.fromMatrix(t):new n(t)}catch(r){ur(v)}break;case"AudioData":case"VideoFrame":l(t.clone)||ur(v);try{a=t.clone()}catch(r){ir(v)}break;case"CropTarget":case"CryptoKey":case"FileSystemDirectoryHandle":case"FileSystemFileHandle":case"FileSystemHandle":case"GPUCompilationInfo":case"GPUCompilationMessage":case"ImageBitmap":case"RTCCertificate":case"WebAssembly.Module":ur(v);default:ir(v)}}switch(W(e,t,a),v){case"Array":case"Object":for(p=Y(t),s=0,f=O(p);s<f;s++)y=p[s],E(a,y,pr(t[y],e));break;case"Map":t.forEach((function(r,t){W(a,pr(t,e),pr(r,e))}));break;case"Set":t.forEach((function(r){H(a,pr(r,e))}));break;case"Error":x(a,"message",pr(t.message,e)),w(t,"cause")&&x(a,"cause",pr(t.cause,e)),"AggregateError"===o?a.errors=pr(t.errors,e):"SuppressedError"===o&&(a.error=pr(t.error,e),a.suppressed=pr(t.suppressed,e));case"DOMException":I&&x(a,"stack",pr(t.stack,e))}return a};c({global:!0,enumerable:!0,sham:!j,forced:or},{structuredClone:function(t){var e,n,o=R(arguments.length,1)>1&&!v(arguments[1])?m(arguments[1]):r,a=o?o.transfer:r;a!==r&&(n=function(t,e){if(!h(t))throw new L("Transfer option cannot be converted to a sequence");var n=[];b(t,(function(r){Q(n,m(r))}));for(var o,a,c,u,s,f=0,p=O(n),v=new V;f<p;){if(o=n[f++],"ArrayBuffer"===(a=d(o))?G(v,o):F(e,o))throw new N("Duplicate transferable",J);if("ArrayBuffer"!==a){if(j)u=nr(o,{transfer:[o]});else switch(a){case"ImageBitmap":c=i.OffscreenCanvas,y(c)||ur(a,rr);try{(s=new c(o.width,o.height)).getContext("bitmaprenderer").transferFromImageBitmap(o),u=s.transferToImageBitmap()}catch(r){}break;case"AudioData":case"VideoFrame":l(o.clone)&&l(o.close)||ur(a,rr);try{u=o.clone(),o.close()}catch(r){}break;case"MediaSourceHandle":case"MessagePort":case"MIDIAccess":case"OffscreenCanvas":case"ReadableStream":case"RTCDataChannel":case"TransformStream":case"WebTransportReceiveStream":case"WebTransportSendStream":case"WritableStream":ur(a,rr)}if(u===r)throw new N("This object cannot be transferred: "+a,J);W(e,o,u)}else H(v,o)}return v}(a,e=new U));var c=pr(t,e);return n&&function(r){D(r,(function(r){j?cr(r,{transfer:[r]}):l(r.transfer)?r.transfer():_?_(r):ur("ArrayBuffer",rr)}))}(n),c}})},function(r,t,e){var n=e(6),o=e(3),a=e(8),c=e(89),i=e(32),u=e(14),s=function(){},f=i("Reflect","construct"),p=/^\s*(?:class|function)\b/,l=n(p.exec),y=!p.test(s),v=function(r){if(!a(r))return!1;try{return f(s,[],r),!0}catch(r){return!1}},h=function(r){if(!a(r))return!1;switch(c(r)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return y||!!l(p,u(r))}catch(r){return!0}};h.sham=!0,r.exports=!f||o((function(){var r;return v(v.call)||!v(Object)||!v((function(){r=!0}))||r}))?h:v},function(r,t,e){var n=e(2),o=e(23),a=e(45);r.exports=function(r,t,e){n?o.f(r,t,a(0,e)):r[t]=e}},function(r,t,e){var n=TypeError;r.exports=function(r,t){if(r<t)throw new n("Not enough arguments");return r}},function(t,e,n){var o=n(30),a=n(9),c=n(33),i=n(115),u=RegExp.prototype;t.exports=function(t){var e=t.flags;return e!==r||"flags"in u||a(t,"flags")||!c(u,t)?e:o(i,t)}},function(r,t,e){var n=e(27);r.exports=function(){var r=n(this),t="";return r.hasIndices&&(t+="d"),r.global&&(t+="g"),r.ignoreCase&&(t+="i"),r.multiline&&(t+="m"),r.dotAll&&(t+="s"),r.unicode&&(t+="u"),r.unicodeSets&&(t+="v"),r.sticky&&(t+="y"),t}},function(r,t,e){var n=e(6),o=Set.prototype;r.exports={Set,add:n(o.add),has:n(o.has),remove:n(o.delete),proto:o}},function(r,t,e){var n=e(6),o=e(118),a=e(116),c=a.Set,i=a.proto,u=n(i.forEach),s=n(i.keys),f=s(new c).next;r.exports=function(r,t,e){return e?o({iterator:s(r),next:f},t):u(r,t)}},function(t,e,n){var o=n(30);t.exports=function(t,e,n){for(var a,c,i=n?t:t.iterator,u=t.next;!(a=o(u,i)).done;)if((c=e(a.value))!==r)return c}},function(r,t,e){var n=e(3),o=e(45);r.exports=!n((function(){var r=new Error("a");return!("stack"in r)||(Object.defineProperty(r,"stack",o(1,7)),7!==r.stack)}))},function(t,e,n){var o=n(54),a=n(32),c=n(3),i=n(113),u=n(107),s=n(121),f=a("URL"),p=s&&c((function(){f.canParse()})),l=c((function(){return 1!==f.canParse.length}));o({target:"URL",stat:!0,forced:!p||l},{canParse:function(t){var e=i(arguments.length,1),n=u(t),o=e<2||arguments[1]===r?r:u(arguments[1]);try{return!!new f(n,o)}catch(r){return!1}}})},function(t,e,n){var o=n(3),a=n(42),c=n(2),i=n(16),u=a("iterator");t.exports=!o((function(){var t=new URL("b?a=1&b=2&c=3","https://a"),e=t.searchParams,n=new URLSearchParams("a=1&a=2&b=3"),o="";return t.pathname="c%20d",e.forEach((function(r,t){e.delete("b"),o+=t+r})),n.delete("a",2),n.delete("b",r),i&&(!t.toJSON||!n.has("a",1)||n.has("a",2)||!n.has("a",r)||n.has("b"))||!e.size&&(i||!c)||!e.sort||"https://a/c%20d?a=1&c=3"!==t.href||"3"!==e.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!e[u]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==o||"x"!==new URL("https://x",r).host}))},function(t,e,n){var o=n(54),a=n(32),c=n(113),i=n(107),u=n(121),s=a("URL");o({target:"URL",stat:!0,forced:!u},{parse:function(t){var e=c(arguments.length,1),n=i(t),o=e<2||arguments[1]===r?r:i(arguments[1]);try{return new s(n,o)}catch(r){return null}}})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.append),p=a(s.delete),l=a(s.forEach),y=a([].push),v=new u("a=1&a=2&b=3");v.delete("a",1),v.delete("b",r),v+""!="a=2"&&o(s,"delete",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=[];l(this,(function(r,t){y(o,{key:t,value:r})})),i(e,1);for(var a,u=c(t),s=c(n),v=0,h=0,g=!1,b=o.length;v<b;)a=o[v++],g||a.key===u?(g=!0,p(this,a.key)):h++;for(;h<b;)(a=o[h++]).key===u&&a.value===s||f(this,a.key,a.value)}),{enumerable:!0,unsafe:!0})},function(t,e,n){var o=n(59),a=n(6),c=n(107),i=n(113),u=URLSearchParams,s=u.prototype,f=a(s.getAll),p=a(s.has),l=new u("a=1");!l.has("a",2)&&l.has("a",r)||o(s,"has",(function(t){var e=arguments.length,n=e<2?r:arguments[1];if(e&&n===r)return p(this,t);var o=f(this,t);i(e,1);for(var a=c(n),u=0;u<o.length;)if(o[u++]===a)return!0;return!1}),{enumerable:!0,unsafe:!0})},function(r,t,e){var n=e(2),o=e(6),a=e(4),c=URLSearchParams.prototype,i=o(c.forEach);n&&!("size"in c)&&a(c,"size",{get:function(){var r=0;return i(this,(function(){r++})),r},configurable:!0,enumerable:!0})}],e={},(n=function(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}).m=t,n.c=e,n.d=function(r,t,e){n.o(r,t)||Object.defineProperty(r,t,{enumerable:!0,get:e})},n.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},n.t=function(r,t){if(1&t&&(r=n(r)),8&t)return r;if(4&t&&"object"==typeof r&&r&&r.__esModule)return r;var e=Object.create(null);if(n.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:r}),2&t&&"string"!=typeof r)for(var o in r)n.d(e,o,function(t){return r[t]}.bind(null,o));return e},n.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return n.d(t,"a",t),t},n.o=function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},n.p="",n(n.s=0)}();
document.addEventListener("DOMContentLoaded",(e=>{var t;wpcf7_recaptcha={...null!==(t=wpcf7_recaptcha)&&void 0!==t?t:{}};const c=wpcf7_recaptcha.sitekey,{homepage:n,contactform:a}=wpcf7_recaptcha.actions,o=e=>{const{action:t,func:n,params:a}=e;grecaptcha.execute(c,{action:t}).then((e=>{const c=new CustomEvent("wpcf7grecaptchaexecuted",{detail:{action:t,token:e}});document.dispatchEvent(c)})).then((()=>{"function"==typeof n&&n(...a)})).catch((e=>console.error(e)))};if(grecaptcha.ready((()=>{o({action:n})})),document.addEventListener("change",(e=>{o({action:a})})),"undefined"!=typeof wpcf7&&"function"==typeof wpcf7.submit){const e=wpcf7.submit;wpcf7.submit=(t,c={})=>{o({action:a,func:e,params:[t,c]})}}document.addEventListener("wpcf7grecaptchaexecuted",(e=>{const t=document.querySelectorAll('form.wpcf7-form input[name="_wpcf7_recaptcha_response"]');for(let c=0;c<t.length;c++)t[c].setAttribute("value",e.detail.token)}))}));
!function(){var e={7090:function(e){!function(t,n){var a=function(e,t,n){"use strict";var a,i;if(function(){var t,n={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(t in i=e.lazySizesConfig||e.lazysizesConfig||{},n)t in i||(i[t]=n[t])}(),!t||!t.getElementsByClassName)return{init:function(){},cfg:i,noSupport:!0};var r=t.documentElement,o=e.HTMLPictureElement,s="addEventListener",l="getAttribute",c=e[s].bind(e),d=e.setTimeout,u=e.requestAnimationFrame||d,f=e.requestIdleCallback,m=/^picture$/i,v=["load","error","lazyincluded","_lazyloaded"],y={},h=Array.prototype.forEach,z=function(e,t){return y[t]||(y[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),y[t].test(e[l]("class")||"")&&y[t]},p=function(e,t){z(e,t)||e.setAttribute("class",(e[l]("class")||"").trim()+" "+t)},g=function(e,t){var n;(n=z(e,t))&&e.setAttribute("class",(e[l]("class")||"").replace(n," "))},C=function(e,t,n){var a=n?s:"removeEventListener";n&&C(e,t),v.forEach((function(n){e[a](n,t)}))},b=function(e,n,i,r,o){var s=t.createEvent("Event");return i||(i={}),i.instance=a,s.initEvent(n,!r,!o),s.detail=i,e.dispatchEvent(s),s},A=function(t,n){var a;!o&&(a=e.picturefill||i.pf)?(n&&n.src&&!t[l]("srcset")&&t.setAttribute("srcset",n.src),a({reevaluate:!0,elements:[t]})):n&&n.src&&(t.src=n.src)},E=function(e,t){return(getComputedStyle(e,null)||{})[t]},_=function(e,t,n){for(n=n||e.offsetWidth;n<i.minSize&&t&&!e._lazysizesWidth;)n=t.offsetWidth,t=t.parentNode;return n},w=(pe=[],ge=[],Ce=pe,be=function(){var e=Ce;for(Ce=pe.length?ge:pe,he=!0,ze=!1;e.length;)e.shift()();he=!1},Ae=function(e,n){he&&!n?e.apply(this,arguments):(Ce.push(e),ze||(ze=!0,(t.hidden?d:u)(be)))},Ae._lsFlush=be,Ae),M=function(e,t){return t?function(){w(e)}:function(){var t=this,n=arguments;w((function(){e.apply(t,n)}))}},N=function(e){var t,a=0,r=i.throttleDelay,o=i.ricTimeout,s=function(){t=!1,a=n.now(),e()},l=f&&o>49?function(){f(s,{timeout:o}),o!==i.ricTimeout&&(o=i.ricTimeout)}:M((function(){d(s)}),!0);return function(e){var i;(e=!0===e)&&(o=33),t||(t=!0,(i=r-(n.now()-a))<0&&(i=0),e||i<9?l():d(l,i))}},x=function(e){var t,a,i=99,r=function(){t=null,e()},o=function(){var e=n.now()-a;e<i?d(o,i-e):(f||r)(r)};return function(){a=n.now(),t||(t=d(o,i))}},L=(K=/^img$/i,Q=/^iframe$/i,V="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),X=0,Y=0,Z=0,ee=-1,te=function(e){Z--,(!e||Z<0||!e.target)&&(Z=0)},ne=function(e){return null==J&&(J="hidden"==E(t.body,"visibility")),J||!("hidden"==E(e.parentNode,"visibility")&&"hidden"==E(e,"visibility"))},ae=function(e,n){var a,i=e,o=ne(e);for(I-=n,G+=n,j-=n,U+=n;o&&(i=i.offsetParent)&&i!=t.body&&i!=r;)(o=(E(i,"opacity")||1)>0)&&"visible"!=E(i,"overflow")&&(a=i.getBoundingClientRect(),o=U>a.left&&j<a.right&&G>a.top-1&&I<a.bottom+1);return o},ie=function(){var e,n,o,s,c,d,u,f,m,v,y,h,z=a.elements;if((k=i.loadMode)&&Z<8&&(e=z.length)){for(n=0,ee++;n<e;n++)if(z[n]&&!z[n]._lazyRace)if(!V||a.prematureUnveil&&a.prematureUnveil(z[n]))fe(z[n]);else if((f=z[n][l]("data-expand"))&&(d=1*f)||(d=Y),v||(v=!i.expand||i.expand<1?r.clientHeight>500&&r.clientWidth>500?500:370:i.expand,a._defEx=v,y=v*i.expFactor,h=i.hFac,J=null,Y<y&&Z<1&&ee>2&&k>2&&!t.hidden?(Y=y,ee=0):Y=k>1&&ee>1&&Z<6?v:X),m!==d&&($=innerWidth+d*h,q=innerHeight+d,u=-1*d,m=d),o=z[n].getBoundingClientRect(),(G=o.bottom)>=u&&(I=o.top)<=q&&(U=o.right)>=u*h&&(j=o.left)<=$&&(G||U||j||I)&&(i.loadHidden||ne(z[n]))&&(P&&Z<3&&!f&&(k<3||ee<4)||ae(z[n],d))){if(fe(z[n]),c=!0,Z>9)break}else!c&&P&&!s&&Z<4&&ee<4&&k>2&&(R[0]||i.preloadAfterLoad)&&(R[0]||!f&&(G||U||j||I||"auto"!=z[n][l](i.sizesAttr)))&&(s=R[0]||z[n]);s&&!c&&fe(s)}},re=N(ie),oe=function(e){var t=e.target;t._lazyCache?delete t._lazyCache:(te(e),p(t,i.loadedClass),g(t,i.loadingClass),C(t,le),b(t,"lazyloaded"))},se=M(oe),le=function(e){se({target:e.target})},ce=function(e,t){var n=e.getAttribute("data-load-mode")||i.iframeLoadMode;0==n?e.contentWindow.location.replace(t):1==n&&(e.src=t)},de=function(e){var t,n=e[l](i.srcsetAttr);(t=i.customMedia[e[l]("data-media")||e[l]("media")])&&e.setAttribute("media",t),n&&e.setAttribute("srcset",n)},ue=M((function(e,t,n,a,r){var o,s,c,u,f,v;(f=b(e,"lazybeforeunveil",t)).defaultPrevented||(a&&(n?p(e,i.autosizesClass):e.setAttribute("sizes",a)),s=e[l](i.srcsetAttr),o=e[l](i.srcAttr),r&&(u=(c=e.parentNode)&&m.test(c.nodeName||"")),v=t.firesLoad||"src"in e&&(s||o||u),f={target:e},p(e,i.loadingClass),v&&(clearTimeout(D),D=d(te,2500),C(e,le,!0)),u&&h.call(c.getElementsByTagName("source"),de),s?e.setAttribute("srcset",s):o&&!u&&(Q.test(e.nodeName)?ce(e,o):e.src=o),r&&(s||u)&&A(e,{src:o})),e._lazyRace&&delete e._lazyRace,g(e,i.lazyClass),w((function(){var t=e.complete&&e.naturalWidth>1;v&&!t||(t&&p(e,i.fastLoadedClass),oe(f),e._lazyCache=!0,d((function(){"_lazyCache"in e&&delete e._lazyCache}),9)),"lazy"==e.loading&&Z--}),!0)})),fe=function(e){if(!e._lazyRace){var t,n=K.test(e.nodeName),a=n&&(e[l](i.sizesAttr)||e[l]("sizes")),r="auto"==a;(!r&&P||!n||!e[l]("src")&&!e.srcset||e.complete||z(e,i.errorClass)||!z(e,i.lazyClass))&&(t=b(e,"lazyunveilread").detail,r&&W.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,Z++,ue(e,t,r,a,n))}},me=x((function(){i.loadMode=3,re()})),ve=function(){3==i.loadMode&&(i.loadMode=2),me()},ye=function(){P||(n.now()-H<999?d(ye,999):(P=!0,i.loadMode=3,re(),c("scroll",ve,!0)))},{_:function(){H=n.now(),a.elements=t.getElementsByClassName(i.lazyClass),R=t.getElementsByClassName(i.lazyClass+" "+i.preloadClass),c("scroll",re,!0),c("resize",re,!0),c("pageshow",(function(e){if(e.persisted){var n=t.querySelectorAll("."+i.loadingClass);n.length&&n.forEach&&u((function(){n.forEach((function(e){e.complete&&fe(e)}))}))}})),e.MutationObserver?new MutationObserver(re).observe(r,{childList:!0,subtree:!0,attributes:!0}):(r[s]("DOMNodeInserted",re,!0),r[s]("DOMAttrModified",re,!0),setInterval(re,999)),c("hashchange",re,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach((function(e){t[s](e,re,!0)})),/d$|^c/.test(t.readyState)?ye():(c("load",ye),t[s]("DOMContentLoaded",re),d(ye,2e4)),a.elements.length?(ie(),w._lsFlush()):re()},checkElems:re,unveil:fe,_aLSL:ve}),W=(T=M((function(e,t,n,a){var i,r,o;if(e._lazysizesWidth=a,a+="px",e.setAttribute("sizes",a),m.test(t.nodeName||""))for(r=0,o=(i=t.getElementsByTagName("source")).length;r<o;r++)i[r].setAttribute("sizes",a);n.detail.dataAttr||A(e,n.detail)})),F=function(e,t,n){var a,i=e.parentNode;i&&(n=_(e,i,n),(a=b(e,"lazybeforesizes",{width:n,dataAttr:!!t})).defaultPrevented||(n=a.detail.width)&&n!==e._lazysizesWidth&&T(e,i,a,n))},O=x((function(){var e,t=B.length;if(t)for(e=0;e<t;e++)F(B[e])})),{_:function(){B=t.getElementsByClassName(i.autosizesClass),c("resize",O)},checkElems:O,updateElem:F}),S=function(){!S.i&&t.getElementsByClassName&&(S.i=!0,W._(),L._())};var B,T,F,O;var R,P,D,k,H,$,q,I,j,U,G,J,K,Q,V,X,Y,Z,ee,te,ne,ae,ie,re,oe,se,le,ce,de,ue,fe,me,ve,ye;var he,ze,pe,ge,Ce,be,Ae;return d((function(){i.init&&S()})),a={cfg:i,autoSizer:W,loader:L,init:S,uP:A,aC:p,rC:g,hC:z,fire:b,gW:_,rAF:w}}(t,t.document,Date);t.lazySizes=a,e.exports&&(e.exports=a)}("undefined"!=typeof window?window:{})}},t={};function n(a){var i=t[a];if(void 0!==i)return i.exports;var r=t[a]={exports:{}};return e[a](r,r.exports,n),r.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var a in t)n.o(t,a)&&!n.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=n(7090);n.n(e)().init()}()}();
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=115)}({115:function(e,t,n){"use strict";n.r(t);var r=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)};var o=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)};var i=function(e,t){return function(n,i,a){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,l=e[t];if(o(n)&&r(i))if("function"==typeof a)if("number"==typeof s){var c={callback:a,priority:s,namespace:i};if(l[n]){var u,d=l[n].handlers;for(u=d.length;u>0&&!(s>=d[u-1].priority);u--);u===d.length?d[u]=c:d.splice(u,0,c),l.__current.forEach((function(e){e.name===n&&e.currentIndex>=u&&e.currentIndex++}))}else l[n]={handlers:[c],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,i,a,s)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}};var a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,a){var s=e[t];if(o(i)&&(n||r(a))){if(!s[i])return 0;var l=0;if(n)l=s[i].handlers.length,s[i]={runs:s[i].runs,handlers:[]};else for(var c=s[i].handlers,u=function(e){c[e].namespace===a&&(c.splice(e,1),l++,s.__current.forEach((function(t){t.name===i&&t.currentIndex>=e&&t.currentIndex--})))},d=c.length-1;d>=0;d--)u(d);return"hookRemoved"!==i&&e.doAction("hookRemoved",i,a),l}}};var s=function(e,t){return function(n,r){var o=e[t];return void 0!==r?n in o&&o[n].handlers.some((function(e){return e.namespace===r})):n in o}};var l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var o=e[t];o[r]||(o[r]={handlers:[],runs:0}),o[r].runs++;var i=o[r].handlers;for(var a=arguments.length,s=new Array(a>1?a-1:0),l=1;l<a;l++)s[l-1]=arguments[l];if(!i||!i.length)return n?s[0]:void 0;var c={name:r,currentIndex:0};for(o.__current.push(c);c.currentIndex<i.length;){var u=i[c.currentIndex],d=u.callback.apply(null,s);n&&(s[0]=d),c.currentIndex++}return o.__current.pop(),n?s[0]:void 0}};var c=function(e,t){return function(){var n,r,o=e[t];return null!==(n=null===(r=o.__current[o.__current.length-1])||void 0===r?void 0:r.name)&&void 0!==n?n:null}};var u=function(e,t){return function(n){var r=e[t];return void 0===n?void 0!==r.__current[0]:!!r.__current[0]&&n===r.__current[0].name}};var d=function(e,t){return function(n){var r=e[t];if(o(n))return r[n]&&r[n].runs?r[n].runs:0}},f=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=i(this,"actions"),this.addFilter=i(this,"filters"),this.removeAction=a(this,"actions"),this.removeFilter=a(this,"filters"),this.hasAction=s(this,"actions"),this.hasFilter=s(this,"filters"),this.removeAllActions=a(this,"actions",!0),this.removeAllFilters=a(this,"filters",!0),this.doAction=l(this,"actions"),this.applyFilters=l(this,"filters",!0),this.currentAction=c(this,"actions"),this.currentFilter=c(this,"filters"),this.doingAction=u(this,"actions"),this.doingFilter=u(this,"filters"),this.didAction=d(this,"actions"),this.didFilter=d(this,"filters")};var h=function(){return new f},p=h();p.addAction,p.addFilter,p.removeAction,p.removeFilter,p.hasAction,p.hasFilter,p.removeAllActions,p.removeAllFilters,p.doAction,p.applyFilters,p.currentAction,p.currentFilter,p.doingAction,p.doingFilter,p.didAction,p.didFilter,p.actions,p.filters;function v(e){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){g(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=v(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==v(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}window.isEditMode=!1,window.eael=window.ea={hooks:h(),isEditMode:!1,elementStatusCheck:function(e){return!(!window.eaElementList||!(e in window.eaElementList))||(window.eaElementList=y(y({},window.eaElementList),{},g({},e,!0)),!1)},debounce:function(e,t){var n;return function(){var r=this,o=arguments;clearTimeout(n),n=setTimeout((function(){e.apply(r,o)}),t)}}},eael.hooks.addAction("widgets.reinit","ea",(function(e){var t=jQuery(".eael-filter-gallery-container",e),n=jQuery(".eael-post-grid:not(.eael-post-carousel)",e),r=jQuery(".eael-twitter-feed-masonry",e),o=jQuery(".eael-instafeed",e),i=jQuery(".premium-gallery-container",e),a=jQuery(".eael-event-calendar-cls",e),s=jQuery(".eael-testimonial-slider",e),l=jQuery(".eael-tm-carousel",e),c=jQuery(".eael-post-carousel:not(.eael-post-grid)",e),u=jQuery(".eael-logo-carousel",e),d=jQuery(".eael-twitter-feed-carousel",e);t.length&&t.isotope("layout"),n.length&&n.isotope("layout"),r.length&&r.isotope("layout"),o.length&&o.isotope("layout"),i.length&&i.isotope("layout"),a.length&&eael.hooks.doAction("eventCalendar.reinit"),s.length&&eael.hooks.doAction("testimonialSlider.reinit"),l.length&&eael.hooks.doAction("teamMemberCarousel.reinit"),c.length&&eael.hooks.doAction("postCarousel.reinit"),u.length&&eael.hooks.doAction("logoCarousel.reinit"),d.length&&eael.hooks.doAction("twitterCarousel.reinit")}));var w,b=function(e){void 0===window.eaelPreventResizeOnClick&&window.dispatchEvent(new Event("resize")),(e="object"===v(e)?e:jQuery(e)).find(".swiper-wrapper").each((function(){var e=jQuery(this).css("transform");jQuery(this).css("transform",e)}))};eael.hooks.addAction("ea-advanced-tabs-triggered","ea",b),eael.hooks.addAction("ea-advanced-accordion-triggered","ea",b),jQuery(window).on("elementor/frontend/init",(function(){window.isEditMode=elementorFrontend.isEditMode(),window.eael.isEditMode=elementorFrontend.isEditMode(),eael.hooks.doAction("init"),eael.isEditMode&&eael.hooks.doAction("editMode.init")})),function(e){eael.getToken=function(){localize.nonce&&!eael.noncegenerated&&e.ajax({url:localize.ajaxurl,type:"post",data:{action:"eael_get_token"},success:function(e){e.success&&(localize.nonce=e.data.nonce,eael.noncegenerated=!0)}})},eael.sanitizeURL=function(e){if(e.startsWith("/")||e.startsWith("#"))return e;try{var t=new URL(e);if(!["http:","https:","ftp:","ftps:","mailto:","news:","irc:","irc6:","ircs:","gopher:","nntp:","feed:","telnet:","mms:","rtsp:","sms:","svn:","tel:","fax:","xmpp:","webcal:","urn:"].includes(t.protocol))throw new Error("Invalid protocol");return t.toString()}catch(e){return console.error("Error sanitizing URL:",e.message),"#"}};var t=!0;window.addEventListener("hashchange",(function(){if(t){var n=window.location.hash.substr(1);"undefined"!==(n="safari"===n?"eael-safari":n)&&n&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(n)&&e("#"+n).trigger("click")}})),e("a").on("click",(function(n){var r,o=e(this).attr("href");(r=(o=void 0===o?"":o).startsWith("#"))||(r=(o=o.replace(localize.page_permalink,"")).startsWith("#")),r&&(t=!1,setTimeout((function(){t=!0}),100));try{if(o.startsWith("#!")){var i=o.replace("#!","#");e(i).trigger("click")}else if(r&&(e(o).hasClass("eael-tab-item-trigger")||e(o).hasClass("eael-accordion-header"))&&(e(o).trigger("click"),void 0!==o&&o)){var a=e(o).closest(".eael-advance-tabs");if(a.length>0){var s=a.data("custom-id-offset");s=s?parseFloat(s):0,e("html, body").animate({scrollTop:e(o).offset().top-s},300)}}}catch(e){}})),e(document).on("click",".e-n-tab-title",(function(){setTimeout((function(){window.dispatchEvent(new Event("resize"))}),100)}))}(jQuery),(w=jQuery)(document).on("click",".theme-savoy .eael-product-popup .nm-qty-minus, .theme-savoy .eael-product-popup .nm-qty-plus",(function(e){var t=w(this),n=t.closest(".quantity").find(".qty"),r=parseFloat(n.val()),o=parseFloat(n.attr("max")),i=parseFloat(n.attr("min")),a=n.attr("step");r&&""!==r&&"NaN"!==r||(r=0),""!==o&&"NaN"!==o||(o=""),""!==i&&"NaN"!==i||(i=0),"any"!==a&&""!==a&&void 0!==a&&"NaN"!==parseFloat(a)||(a=1),t.hasClass("nm-qty-plus")?o&&(o==r||r>o)?n.val(o):n.val(r+parseFloat(a)):i&&(i==r||r<i)?n.val(i):r>0&&n.val(r-parseFloat(a))})),function(e){e.fn.isInViewport=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;if(e(this).length<1)return!1;var n=e(this).offset().top,r=n+e(this).outerHeight()/t,o=e(window).scrollTop(),i=o+e(window).height()/t;return r>o&&n<i},e(document).ready((function(){var e=new URLSearchParams(location.search);if(e.has("popup-selector")&&(e.has("eael-lostpassword")||e.has("eael-resetpassword"))){var t=e.get("popup-selector");t.length&&/^[A-Za-z.#][A-Za-z0-9_:.#\s-]*$/.test(t)&&(t=t.replace(/_/g," "),setTimeout((function(){jQuery(t).trigger("click")}),300))}})),e(document).on("click",".eael-onpage-edit-template",(function(){var t=e(this),n=t.data("eael-template-id"),r=t.data("page-id"),o=t.data("mode");"edit"===o?(parent.window.$e.internal("panel/state-loading"),parent.window.$e.run("editor/documents/switch",{id:parseInt(n)}).then((function(){t.data("mode","save"),t.find("span").text("Save & Back"),t.find("i").addClass("eicon-arrow-left").removeClass("eicon-edit"),t.closest(".eael-onpage-edit-template-wrapper").addClass("eael-onpage-edit-activate").parent().addClass("eael-widget-otea-active"),parent.window.$e.internal("panel/state-ready")}))):"save"===o&&(parent.window.$e.internal("panel/state-loading"),parent.window.$e.run("editor/documents/switch",{id:parseInt(r),mode:"save",shouldScroll:!1}).then((function(){parent.window.$e.internal("panel/state-ready"),t.data("mode","edit")})))}))}(jQuery)}});
!function(t){t(document).on("click",".quick_view",function(){!function(a){void 0!==a&&jQuery.ajax({type:"POST",url:ultimate_store_kit_ajax_config.ajaxurl,data:{action:"ultimate_store_kit_wc_product_quick_view_content",product_id:a},success:function(a){setTimeout(function(){t("#quick-view-id").html(a)},1e3)}})}(t(this).data("id"))}),t(document).on("click",".thumbnails a",function(a){var o=t(this).attr("data-href");t(".usk-modal-image-wrapper .images > a").attr("href",o),t(".usk-modal-image-wrapper .images > a > img").attr({src:o,srcset:o})}),t(document).on("click",".usk-modal-page .usk-modal-product .images a",function(a){a.preventDefault();var o=t(this).attr("data-href"),i=t(this).find("img").attr("srcset");t(".woocommerce-main-image").closest("a").attr("href",o),t(".woocommerce-main-image").find("img").attr({src:o,srcset:i}),t("a.zoom").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1}),t("a[data-rel^='prettyPhoto']").prettyPhoto({hook:"data-rel",social_tools:!1,theme:"pp_woocommerce",horizontal_padding:20,opacity:.8,deeplinking:!1})}),t(".elementor-widget-usk-florence-grid").on("click",".usk-pagination a",function(a){a.preventDefault();const o=t(this).prop("href");t.ajax({url:o,success:function(a){var i=t(a).find(".elementor-widget-usk-florence-grid");t(".elementor-widget-usk-florence-grid").html(i),window.history.pushState&&window.history.pushState({},"",o)}})}),t(".ajax_add_to_wishlist:not(.usk-active)").attr("href","javascript:void(0);"),t(".ajax_add_to_wishlist").on("click",function(a){var o=t(this),i=o.data("product_id"),e=o.data("redirect_url"),c=o.data("aria_label");t.ajax({url:ultimate_store_kit_ajax_config.ajaxurl,data:{action:"usk_add_to_wishlist",product_id:i},type:"POST",dataType:"JSON",success:function(a){"added"===a.action&&(o.addClass("usk-active").attr("aria-label",c),t(".usk-wishlist-button").find(".usk-wishlist-count").html(a.count),o.attr({href:e}))},error:function(t){console.log(t)}})}),t(".ajax_remove_from_wishlist").on("click",function(a){a.preventDefault();var o=t(this),i=o.data("product_id");t.ajax({url:ultimate_store_kit_ajax_config.ajaxurl,data:{action:"usk_remove_wishlist",product_id:i},type:"POST",dataType:"JSON",success:function(a){"removed"==a.action&&(o.closest("tr").remove(),t(".usk-wishlist-button").find(".usk-wishlist-count").html(a.count))},error:function(t){console.log(t)}})}),t(".ajax_add_to_compare:not(.usk-active)").attr("href","javascript:void(0);"),t(".ajax_add_to_compare").on("click",function(a){var o=t(this),i=o.data("product_id"),e=o.data("redirect_url"),c=o.data("aria_label");t.ajax({url:ultimate_store_kit_ajax_config.ajaxurl,data:{action:"usk_add_to_compare_products",product_id:i},type:"POST",dataType:"JSON",success:function(a){"added"===a.action&&(o.addClass("usk-active").attr("aria-label",c),t(".usk-compare-button").find(".usk-compare-count").html(a.count),o.attr({href:e}))},error:function(t){console.log(t)}})}),t(".ajax_add_to_cart").on("click",function(a){a.preventDefault(),t(this).attr("aria-label","Added to cart")}),t(document).ready(function(){var a='<div class="usk-bouncing-loader"><div></div><div></div><div></div></div>',o=t(".product-quick-view").data("modal-width"),i=t(".product-quick-view").data("modal-height"),e=t(".product-quick-view").data("animation"),c=t(".product-quick-view").data("close-btn"),r=t(".product-quick-view").data("btn-style"),n=t(".product-quick-view").data("btn-text"),d=t(".product-quick-view").data("modal-bg"),u=t(".product-quick-view").data("modal-overlay");t(".product-quick-view").SlickModals({popup_reopenClass:"quick_view",popup_animation:e,overlay_animation:e,popup_closeButtonEnable:c,popup_closeButtonStyle:r,popup_closeButtonText:n,popup_closeButtonPlace:"inside",popup_css:{width:o?o+"px":"800px",height:i?i+"px":"450px",background:d||"#fff","overflow-y":"auto","animation-duration":"0.7s"},overlay_css:{background:u},mobile_breakpoint:"768px",mobile_position:"center",mobile_css:{width:"300px",padding:"30px",margin:"20px"},callback_afterClose:function(){t("#quick-view-id").html(a)},callback_beforeOpen:function(){t("#quick-view-id").html(a)}})}),jQuery("div.woocommerce").on("change",".qty",function(){jQuery("[name='update_cart']").prop("disabled",!1),jQuery("[name='update_cart']").trigger("click")})}(jQuery,window.elementorFrontend);
!function(t){"use strict";if(!t||void 0===t)return n("[Slick Modals] No jQuery library detected. Load SlickModals after jQuery has been loaded on the page.");var e={restrict_hideOnUrls:[],restrict_cookieSet:!1,restrict_cookieName:"slickModal-1",restrict_cookieScope:"domain",restrict_cookieDays:"30",restrict_cookieSetClass:"setSmCookie-1",restrict_dateRange:!1,restrict_dateRangeStart:"",restrict_dateRangeEnd:"",restrict_dateRangeServerTime:!0,restrict_dateRangeServerTimeFile:"",restrict_dateRangeServerTimeZone:"Europe/London",restrict_showAfterVisits:1,restrict_showAfterVisitsResetWhenShown:!1,popup_type:"none",popup_delayedTime:"1s",popup_scrollDistance:"400px",popup_scrollHideOnUp:!1,popup_exitShowAlways:!1,popup_autoClose:!1,popup_autoCloseAfter:"5s",popup_openWithHash:!1,popup_redirectOnClose:!1,popup_redirectOnCloseUrl:"",popup_redirectOnCloseTarget:"_blank",popup_redirectOnCloseTriggers:"overlay button",popup_position:"center",popup_animation:"fadeIn",popup_closeButtonEnable:!0,popup_closeButtonStyle:"cancel simple",popup_closeButtonAlign:"right",popup_closeButtonPlace:"outside",popup_closeButtonText:"Close",popup_reopenClass:"open-sm",popup_reopenClassTrigger:"click",popup_reopenStickyButtonEnable:!1,popup_reopenStickyButtonText:"Open popup",popup_enableESC:!0,popup_bodyClass:"",popup_wrapperClass:"",popup_draggableEnable:!1,popup_allowMultipleInstances:!1,popup_css:{width:"480px",height:"auto",background:"#fff",margin:"24px",padding:"24px","animation-duration":"0.4s"},overlay_isVisible:!0,overlay_closesPopup:!0,overlay_animation:"fadeIn",overlay_css:{background:"rgba(0, 0, 0, .8)","animation-duration":"0.4s","animation-delay":"0s"},content_loadViaAjax:!1,content_animate:!1,content_animation:"zoomIn",content_css:{"animation-duration":"0.4s","animation-delay":"0.4s"},page_animate:!1,page_animation:"scale",page_animationDuration:".4s",page_blurRadius:"1px",page_scaleValue:".9",page_moveDistance:"30%",mobile_show:!0,mobile_breakpoint:"480px",mobile_position:"bottomCenter",mobile_css:{width:"100%",height:"auto",background:"#fff",margin:"0",padding:"18px","animation-duration":"0.4s"},callback_beforeInit:t.noop,callback_afterInit:t.noop,callback_beforeOpen:t.noop,callback_afterOpen:t.noop,callback_afterVisible:t.noop,callback_beforeClose:t.noop,callback_afterClose:t.noop,callback_afterHidden:t.noop},s="SlickModals",i="sm-",a="[Slick Modals] ",o=" can be passed into this method.";function n(t){console.log(t)}function p(s,i){this.$el=t(s),this.$wrapper="",this.$overlay="",this.$popup="",this.settings=t.extend(!0,{},e,i),this.autoCloseTimer=null,this.ajaxContentLoaded=0,this._build()}p.prototype={constructor:p,_build:function(){if("true"!==this.$el.attr("data-sm-init"))return this.$el.hide(),n(a+'Element is missing data-sm-init="true" attribute.');this.settings.callback_beforeInit(),this._createParent(),this.settings.overlay_isVisible&&this._createOverlay(),this.settings.popup_reopenStickyButtonEnable&&this._createStickyButton(),this._createPopup(),this.settings.content_animate&&this._contentAnimate(),this._createEvents(),this._checkInitRestrictions()},_createParent:function(){this.$el.wrapAll('<div class="sm-wrapper"></div>'),this.$wrapper=this.$el.parent();var t=this.settings.popup_type,e=0;switch(!0){case"delayed"===t:e=this.settings.popup_delayedTime;break;case"scrolled"===t:e=this.settings.popup_scrollDistance}this.$wrapper.attr({"data-sm-type":t,"data-sm-type-val":e}),this.settings.popup_autoClose&&this.$wrapper.attr({"data-sm-autoClose":"enable","data-sm-autoClose-after":this.settings.popup_autoCloseAfter})},_createOverlay:function(){this.$wrapper.prepend('<div class="sm-overlay"></div>'),this.$overlay=this.$wrapper.children(".sm-overlay"),this.$overlay.attr({"data-sm-animated":!0,"data-sm-close":this.settings.overlay_closesPopup,"data-sm-effect":this.settings.overlay_animation}).css(this.settings.overlay_css)},_createStickyButton:function(){if(""===this.settings.popup_reopenClass)return n(a+'Sticky button must have defined "popup_reopenClass" within the plugin settings.');t("body").append('<div class="sm-sticky-button '+this.settings.popup_reopenClass+'">'+this.settings.popup_reopenStickyButtonText+"</div>")},_createPopup:function(){this.$el.attr("data-sm-init","false").wrapAll('<div class="sm-popup"></div>'),this.$popup=this.$wrapper.children(".sm-popup");var e=t(window).width()<=parseInt(this.settings.mobile_breakpoint),s=null;(s=e?this.settings.mobile_css:this.settings.popup_css)["animation-delay"]=(this.settings.overlay_isVisible?parseFloat(this.settings.overlay_css["animation-duration"])/2:0)+"s",this.$popup.attr({"data-sm-animated":!0,"data-sm-position":e?this.settings.mobile_position:this.settings.popup_position,"data-sm-effect":this.settings.popup_animation}).css(s).prepend(this.settings.popup_closeButtonEnable?'<div class="sm-button" data-sm-button-style="'+this.settings.popup_closeButtonStyle+'" data-sm-button-align="'+this.settings.popup_closeButtonAlign+'" data-sm-button-place="'+this.settings.popup_closeButtonPlace+'" data-sm-button-text="'+this.settings.popup_closeButtonText+'" data-sm-close="true"></div>':"",this.settings.popup_draggableEnable?'<div class="sm-draggable"></div>':""),this._popupPositionCorrect()},_contentAnimate:function(){this.$el.attr({"data-sm-animated":!0,"data-sm-effect":this.settings.content_animation}).css(this.settings.content_css)},_checkInitRestrictions:function(){var e,s,o=this;function p(){return!!o.settings.restrict_cookieSet&&document.cookie.indexOf(o.settings.restrict_cookieName)>-1}function r(){if(!o.settings.restrict_hideOnUrls.length)return!1;for(var t=o.settings.restrict_hideOnUrls,e=0;e<t.length;e++){var s=t[e],i=window.location.pathname;if(s instanceof RegExp&&s.test(i)||"string"==typeof s&&i.indexOf(s)>-1)return!0}return!1}function l(){return!o.settings.mobile_show&&(!o.settings.mobile_show&&t(window).width()<=parseInt(o.settings.mobile_breakpoint))}function c(){var t=parseInt(o.settings.restrict_showAfterVisits);if(t<=1)return!1;var e=i+"visits-"+o.$el.attr("class");if(t>1){var s=localStorage.getItem(e);return null!==s?parseInt(s)===t-1?(o.settings.restrict_showAfterVisitsResetWhenShown&&localStorage.removeItem(e),!1):(localStorage.setItem(e,parseInt(s)+1),!0):(localStorage.setItem(e,"1"),!0)}localStorage.removeItem(e)}function u(t){o.settings.callback_afterInit(),t||o.openPopup()}o.settings.restrict_dateRange?(e=function(t){u(!!(p()||r()||l()||o._activeInstanceExist()||c()||t))},s=function(t){function s(t){var e=new Date(t.split(",")[0]+"T"+t.split(",")[1].replace(" ","")).getTime();return isNaN(e)?n(a+"Invalid date format."):e}var i=s(o.settings.restrict_dateRangeStart),p=s(o.settings.restrict_dateRangeEnd);e(!(t>i&&t<p&&i<p))},o.settings.restrict_dateRangeServerTime&&""!==o.settings.restrict_dateRangeServerTimeFile?t.ajax({url:o.settings.restrict_dateRangeServerTimeFile,type:"POST",data:{timezone:o.settings.restrict_dateRangeServerTimeZone},dataType:"json",success:function(t){s(new Date(t).getTime())},error:function(){n(a+"Ajax request error upon retrieving server time.")}}):s((new Date).getTime())):u(!!(p()||r()||l()||o._activeInstanceExist()||c()))},_activeInstanceExist:function(){return!this.settings.popup_allowMultipleInstances&&t(".sm-wrapper.sm-active").length>0&&(n(a+"Another Slick Modal instance is already active."),!0)},_popupPositionCorrect:function(){var t=this.$popup.attr("data-sm-position");switch(!0){case"center"===t:this.$popup.css("margin","auto");break;case"bottomCenter"===t||"topCenter"===t:this.$popup.css({"margin-left":"auto","margin-right":"auto"});break;case"right"===t||"left"===t:this.$popup.css({"margin-top":"auto","margin-bottom":"auto"})}},_popupCalculateHeight:function(){var e=0;this.$popup.children().not(".sm-button").each(function(){e+=t(this).outerHeight(!0)}),this.$popup.height(e)},_createEvents:function(){var e=this;if(e.$wrapper.find('[data-sm-close="true"]').length>0&&e.$wrapper.find('[data-sm-close="true"]').each(function(){var s=t(this);s.on("click",function(){e.closePopup(),e.settings.popup_redirectOnClose&&e.settings.popup_redirectOnCloseTriggers.indexOf(s.attr("class").replace("sm-",""))>-1&&-1===e.settings.popup_redirectOnCloseTriggers.indexOf("close")&&e._redirectOnClose()})}),""!==e.settings.popup_reopenClass&&t("body").on("click"===e.settings.popup_reopenClassTrigger?"click":"mouseover","."+e.settings.popup_reopenClass,function(s){t(s.target).is("a")&&s.preventDefault(),e.openPopup("instant")}),e.settings.popup_enableESC&&t(window).on("keydown",function(t){27===t.keyCode&&e._wrapperActive()&&e.closePopup()}),e.settings.popup_openWithHash){var s=e.settings.popup_openWithHash,i=!1!==s&&""!==s&&"#"===s.charAt(0);i&&t(window).on("load hashchange",function(){i&&s===window.location.hash&&e.openPopup("instant")})}if(this.settings.popup_draggableEnable){var a,o,n,p,r=r||!1,l=e.$popup,c=isNaN(parseInt(l.css("margin-top")))?0:parseInt(l.css("margin-top")),u=isNaN(parseInt(l.css("margin-left")))?0:parseInt(l.css("margin-left")),d="auto"===l.css("margin"),g=function(t){l.css({top:t.clientY-a+n+"px",left:t.clientX-o+p+"px"})};l.children(".sm-draggable").on("mousedown",function(e){r=!0,a=e.clientY+c,o=e.clientX+u,n=l.offset().top,p=l.offset().left,d&&(l.css("margin","0px"),g(e),d=!1),t(window).on("mousemove",function(t){if(r)return g(t),!1}),t(window).on("mouseup",function(){r=!1})})}},_setCookie:function(){var t=parseInt(this.settings.restrict_cookieDays),e=new Date,s="/";"page"===this.settings.restrict_cookieScope&&(s=window.location.href),e.setTime(e.getTime()+24*t*60*60*1e3),document.cookie=this.settings.restrict_cookieName+"=1; path="+s+"; expires="+(t>0?e.toGMTString():0)},_redirectOnClose:function(){var t=this.settings.popup_redirectOnCloseUrl;""!==t&&t.indexOf("http")>-1?window.open(t,this.settings.popup_redirectOnCloseTarget):n(a+"Redirect URL is empty or not valid.")},_loadContentViaAjax:function(){if(!this.ajaxContentLoaded&&""!==this.settings.content_loadViaAjax){var e=this;t.ajax({url:e.settings.content_loadViaAjax,type:"GET",dataType:"html",success:function(t){e.$el.html(t),e._popupCalculateHeight(),e.ajaxContentLoaded=1},error:function(){n(a+"Ajax request error upon retrieving the content.")}})}},_pageAnimation:function(e){var s=this.settings.page_animation,a=t("body").children().not(".sm-wrapper, .sm-sticky-button, script, style");if("enable"===e){switch(!0){case"blur"===s:a.css({filter:"blur("+this.settings.page_blurRadius+")","transition-duration":this.settings.page_animationDuration});break;case"scale"===s:a.css({transform:"scale("+this.settings.page_scaleValue+")","transition-duration":this.settings.page_animationDuration});break;case s.indexOf("move")>-1:var o="",n="";switch(!0){case"moveUp"===s:o="Y",n="-";break;case"moveDown"===s:o="Y",n="";break;case"moveLeft"===s:o="X",n="-";break;case"moveRight"===s:o="X",n=""}a.css({transform:"translate"+o+"("+n+this.settings.page_moveDistance+")","transition-duration":this.settings.page_animationDuration})}t("body").addClass(i+"pageAnimated")}else a.css({transform:"",filter:""}),t("body").removeClass(i+"pageAnimated")},_wrapperActive:function(){return this.$wrapper.hasClass(i+"active")},_prepareClose:function(){var t=this,e=t.$popup.css("animation-duration"),s=t.settings.overlay_isVisible?t.$overlay.css("animation-delay"):0,i=t.$el.css("animation-delay")||0,a=t.$popup.css("animation-delay")||0;t.settings.overlay_isVisible&&t.$overlay.css("animation-delay",e),t.settings.content_animate&&t.$el.css("animation-delay","0s"),t.$popup.css("animation-delay","0s");var o=1e3*((t.settings.overlay_isVisible?parseFloat(t.$overlay.css("animation-duration")):0)+parseFloat(e));t._togglePopup("disable",o,a,s,i)},_togglePopup:function(e,s,a,o,n){var p=this,r="enable"===e;r?(p.settings.callback_beforeOpen(),p.$wrapper.addClass(i+"active"),""!==p.settings.popup_bodyClass&&t("body").addClass(p.settings.popup_bodyClass),""!==p.settings.popup_wrapperClass&&p.$wrapper.addClass(p.settings.popup_wrapperClass),p.settings.content_loadViaAjax&&p._loadContentViaAjax(),setTimeout(function(){p.settings.callback_afterVisible(),"enable"===p.$wrapper.attr("data-sm-autoClose")&&p.autoClose()},1e3*(parseFloat(p.$popup.css("animation-delay"))+parseFloat(p.$popup.css("animation-duration")))+s)):(p.settings.callback_afterClose(),p.$wrapper.removeClass(i+"active"),p.settings.page_animate&&p._pageAnimation("disable")),setTimeout(function(){r?(p.settings.callback_afterOpen(),p.$wrapper.show(),"auto"===p.$popup[0].style.height&&p._popupCalculateHeight(),p.settings.page_animate&&p._pageAnimation("enable")):(p.settings.overlay_isVisible&&p.$overlay.css("animation-delay",o),p.settings.content_animate&&p.$el.css("animation-delay",n),p.$popup.css("animation-delay",a),p.$wrapper.hide(),p.settings.callback_afterHidden(),""!==p.settings.popup_bodyClass&&t("body").removeClass(p.settings.popup_bodyClass),""!==p.settings.popup_wrapperClass&&p.$wrapper.removeClass(p.settings.popup_wrapperClass),"enable"===p.$wrapper.attr("data-sm-autoClose")&&clearTimeout(p.autoCloseTimer))},s)},_typeController:function(e,s){var i=this,a=e||i.$wrapper.attr("data-sm-type"),o=s||parseFloat(i.$wrapper.attr("data-sm-type-val"));switch(!0){case"delayed"===a:i._togglePopup("enable",1e3*("string"==typeof o?parseFloat(o):o));break;case"scrolled"===a:var n=0,p=0;t(document).on("scroll",function(){var e=t(this).scrollTop();e>o&&!n&&(i._togglePopup("enable",0),n=1),i.settings.popup_scrollHideOnUp&&e<o&&n&&!p&&(i.closePopup(),p=1,t(document).unbind("scroll"))});break;case"exit"===a:var r=0;t(document).on("mouseleave",function(){r||(i.settings.popup_exitShowAlways||(r=1,t(document).unbind("mouseleave")),i._togglePopup("enable",0))});break;case"instant"===a:i._togglePopup("enable",0)}},openPopup:function(t,e){if(this._wrapperActive())return n(a+"This popup instance is already active.");this._activeInstanceExist()||this._typeController(t,e)},closePopup:function(){if(!this._wrapperActive())return n(a+"Popup is already closed.");this.settings.callback_beforeClose(),this._prepareClose(),this.settings.restrict_cookieSet&&this._setCookie(),this.settings.popup_redirectOnClose&&this.settings.popup_redirectOnCloseTriggers.indexOf("close")>-1&&this._redirectOnClose()},styleElement:function(t,e){if("object"!=typeof e)return n(a+"Only object with CSS properties"+o);switch(!0){case"overlay"===t&&this.settings.overlay_isVisible:this.$overlay.css(e),this.$popup.length>0&&e["animation-duration"]&&this.$popup.css("animation-delay",parseFloat(e["animation-duration"])/2+"s");break;case"popup"===t:this.$popup.css(e),this._popupPositionCorrect();break;case"content"===t:this.$el.css(e)}},popupPosition:function(t){if("string"!=typeof t)return n(a+"Only string"+o);this.$popup.attr("data-sm-position",t),this._popupPositionCorrect()},setEffect:function(t,e){if("string"!=typeof t||"string"!=typeof e)return n(a+"Only strings"+o);switch(!0){case"overlay"===t&&this.settings.overlay_isVisible:this.$overlay.attr("data-sm-effect",e);break;case"popup"===t:this.$popup.attr("data-sm-effect",e);break;case"content"===t:this.$el.attr("data-sm-effect",e)}},setType:function(t,e){this.$wrapper.attr({"data-sm-type":t,"data-sm-type-val":e})},autoClose:function(t,e){var s=this;s.$wrapper.attr({"data-sm-autoClose":t,"data-sm-autoClose-after":e}),t=t||s.$wrapper.attr("data-sm-autoClose"),e=e||s.$wrapper.attr("data-sm-autoClose-after"),"enable"===t&&(s.autoCloseTimer=setTimeout(function(){s.closePopup()},1e3*parseFloat(e)))},destroy:function(){t("."+this.settings.popup_reopenClass).on("click"===this.settings.popup_reopenClassTrigger?"click":"mouseover",function(){return!1}),this.$el.remove(),this.$wrapper.remove(),this.$overlay.remove(),this.$popup.remove(),delete this.$el,delete this.$wrapper,delete this.$overlay,delete this.$popup}},t.fn[s]=function(e){var i=Array.prototype.slice.call(arguments,1);return this.each(function(){var o=t(this),r=o.data(s);if(r){if("string"==typeof e)try{r[e].apply(r,i)}catch(t){n(a+"Method does not exist in Slick Modals.")}}else o.data(s,new p(this,e))})}}(jQuery);
!function(t,e){"function"==typeof define&&define.amd?define([],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.toolslide=e()}(this,function(){"use strict";var t={position:"left",height:"100%",width:"25%",startOpen:!0,closeable:!0,minClosedSize:0,toggleButton:"",embed:!1,navigationItemWidth:"0px",navigationItemHeight:"0px",autoclose:!1,autocloseDelay:5e3,clickOutsideToClose:!0,animations:{replace:"crossfade 0.5s ease-in-out",toggle:"slide 0.5s ease"}};function e(){this.init.apply(this,arguments)}return e.prototype={init:function(e,i){if(this.config=Object.assign({},t,i),!e)throw new Error("Missing required attribute: target element (css selector or DOM node) must be provided");if(this.__isString(e))this.targetElement=document.querySelector(e);else{if(!this.__isDOMElement(e))throw new Error("Incorrect type: target element must be DOM node or string css selector");this.targetElement=e}this.targetElement.classList.add("toolslide"),this.config.embed&&this.targetElement.parentElement.classList.add("ts-embed-container"),this.containerElement=this.targetElement.querySelector(".ts-container"),this.contentElement=this.targetElement.querySelector(".ts-content-container"),this.navElement=this.targetElement.querySelector(".ts-nav-container"),this.__applyConfig(this.config),this.__attachEventListeners()},setPosition:function(t){this.targetElement.classList.add("ts-"+t)},setHeight:function(t){this.targetElement.style.height=t,"top"!==this.config.position&&"bottom"!==this.config.position||(this.containerElement.style.height="calc(100% - "+this.navElement.clientHeight+"px)")},setWidth:function(t){this.targetElement.style.width=t,"left"!==this.config.position&&"right"!==this.config.position||(this.containerElement.style.width="calc(100% - "+this.navElement.clientWidth+"px)")},setNavigationSize:function(t,e){"left"!==this.config.position&&"right"!==this.config.position||(this.navElement.style.width=t),"top"!==this.config.position&&"bottom"!==this.config.position||(this.navElement.style.height=e);for(var i=this.navElement.querySelectorAll(".ts-nav-item"),n=i.length;n--;)i[n].style.width=t,i[n].style.height=e},setAutoClose:function(t){this.autocloseTimeout&&clearTimeout(this.autocloseTimeout),this.autocloseTimeout=setTimeout(this.close.bind(this),t)},setActiveById:function(t){var e,i=this.targetElement.querySelector(".ts-content-item.active");if(this.__isDOMElement(t))e=t.id;else{if(!this.__isString(t))return;e=t}if(!i||e!==i.id){this.fire("beforeToggle",[i,s]);var n=this.targetElement.querySelector(".ts-nav-item[ts-target='"+e+"']"),s=this.targetElement.querySelector("#"+e);this.__deactivateAll(),s&&s.classList.add("active"),n&&n.classList.add("active"),this.fire("afterToggle",[i,s])}},setActiveByIndex:function(t){var e=this.contentElement&&this.contentElement.children;this.setActiveById(e[t]&&e[t].id)},open:function(){this.fire("beforeOpen",[this.targetElement]),this.targetElement.classList.remove("closed"),this.targetElement.classList.add("open"),this.containerElement.style.left="",this.__updateEmbeding(),this.fire("afterOpen",[this.targetElement])},close:function(){this.fire("beforeClose",[this.targetElement]),this.targetElement.classList.remove("open"),this.targetElement.classList.add("closed"),this.containerElement.style.left=this.config.minClosedSize+"px",this.__updateEmbeding(),this.fire("afterClose",[this.targetElement])},isOpen:function(){return this.targetElement.classList.contains("open")},isActive:function(t){if(this.__isString(t))t=document.getElementById(t);else if(!this.__isDOMElement(t))return!1;return t.classList.contains("active")},__applyConfig:function(t){this.setPosition(t.position),t.startOpen?this.open():this.close(),this.setNavigationSize(t.navigationItemWidth,t.navigationItemHeight),this.setWidth(t.width),this.setHeight(t.height),this.__updateEmbeding(),t.autoclose&&this.setAutoClose(),this.__setAnimations(t.animations),this.setActiveById(this.config.activePanel||this.__getContentPanel(0))},__attachEventListeners:function(){for(var t=this.navElement.children,e=t.length;e--;)t[e].onclick=this.onNavButtonClick.bind(this);this.autocloseTimeout&&(this.containerElement.onmouseover=this.onMouseOver.bind(this),this.containerElement.onmouseout=this.onMouseOut.bind(this)),this.config.clickOutsideToClose&&document.addEventListener("click",this.onDocumentClick.bind(this),!1),this.config.toggleButton&&(this.toggleButtonElement=document.querySelector(this.config.toggleButton),this.toggleButtonElement&&(this.toggleButtonElement.onclick=this.onToggleButtonClick.bind(this)))},__updateEmbeding:function(){this.config.embed&&("left"===this.config.position?this.targetElement.parentElement.style.marginLeft=this.isOpen()?"calc("+this.config.width+" - "+this.config.navigationItemWidth+")":this.config.minClosedSize+"px":"right"===this.config.position?(this.targetElement.parentElement.style.marginRight=this.isOpen()?"calc("+this.config.width+" - "+this.config.navigationItemWidth+")":this.config.minClosedSize+"px",this.targetElement.parentElement.style.marginLeft=this.isOpen()?"calc(-"+this.config.width+" + "+this.config.navigationItemWidth+")":this.config.minClosedSize+"px"):"top"===this.config.position?this.targetElement.parentElement.style.marginTop=this.isOpen()?"calc("+this.config.height+" - "+this.config.navigationItemHeight+")":this.config.minClosedSize+"px":"bottom"===this.config.position&&(this.targetElement.parentElement.style.marginBottom=this.isOpen()?"calc("+this.config.height+" - "+this.config.navigationItemHeight+")":this.config.minClosedSize+"px"))},__setAnimations:function(t){if(t&&Object.keys(t).length){if(t.replace)for(var e=this.__getAnimationFromString(t.replace),i=this.contentElement.children,n=i.length;n--;)this.__setVendorStyleProperty(i[n],"transition",this.__getTransitionFromAnimation(e)),i[n].classList.add(e.type);if(t.toggle){e=this.__getAnimationFromString(t.toggle);this.__setVendorStyleProperty(this.targetElement,"transition",this.__getTransitionFromAnimation(e))}}},onNavButtonClick:function(t){this.isOpen()?this.isActive(t.currentTarget)&&this.config.closeable&&this.close():this.open(),this.setActiveById(t.currentTarget.getAttribute("ts-target"))},onMouseOver:function(t){clearTimeout(this.autocloseTimeout)},onMouseOut:function(t){this.setAutoClose(this.config.autocloseDelay)},onDocumentClick:function(t){this.targetElement.contains(t.target)||this.toggleButtonElement&&this.toggleButtonElement.contains(t.target)||this.close()},onToggleButtonClick:function(t){this.isOpen()?this.close():this.open()},fire:function(t,e){this.config.listeners&&this.config.listeners[t]&&this.config.listeners[t].apply(this,e)},__deactivateAll:function(){for(var t=this.contentElement&&this.contentElement.children,e=this.navElement&&this.navElement.children,i=t.length,n=e.length;i--;)t[i].classList.remove("active");for(;n--;)e[n].classList.remove("active")},__getContentPanel:function(t){return this.contentElement&&this.contentElement.children&&this.contentElement.children[t]},__isDOMElement:function(t){return t&&(t.nodeType===document.ELEMENT_NODE||t.nodeType===document.DOCUMENT_FRAGMENT_NODE)},__isString:function(t){return"string"==typeof t},__getAnimationFromString:function(t){var e=t.split(" ");return{type:e[0],speed:e[1],easing:e[2]}},__getTransitionFromAnimation:function(t){var e="";return"slide"===t.type?e+="transform "+t.speed+" "+t.easing:"crossfade"===t.type?e+="opacity "+t.speed+" "+t.easing:"slidefade"===t.type&&(e+="opacity "+t.speed+" "+t.easing+", ",e+="transform "+t.speed+" "+t.easing),e},__setVendorStyleProperty:function(t,e,i){var n=this.__capitalizeFirstLetter(e);t.style["webkit"+n]=i,t.style["Moz"+n]=i,t.style["ms"+n]=i,t.style["O"+n]=i,t.style[e]=i},__capitalizeFirstLetter:function(t){return t.charAt(0).toUpperCase()+t.slice(1)}},function(t,i){return new e(t,i)}});
!function(){"use strict";var e=function(e,n){var o=e.find(".bdt-prime-slider").find(".bdt-scroll-down"),r=o.data("selector"),t=o.data("settings");o.length&&n(o).on("click",function(e){e.preventDefault(),bdtUIkit.scroll(o,t).scrollTo(n(r))})},n=function(e,n){var o=e.data("id"),r=e.find("[data-reveal-enable]").data("reveal-enable");if(void 0===r||"yes"!==r)return;const t=n(".reveal-active-"+o).find('[data-reveal="reveal-active"]');n(t).css({opacity:"1"});const d=e.find("[data-reveal-settings]").data("reveal-settings");let l=0;n(t).each(function(e,n){l+=80;const o=new RevealFx(n,{revealSettings:{bgColors:[d.bgColors],direction:String(d.direction),duration:Number(d.duration+l),easing:String(d.easing),onHalfway:function(e,n){e.style.opacity=1}}});!function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};o.rootMargin=o.rootMargin||"10% 0px 0px 0px",new IntersectionObserver(function(e,r){e.forEach(function(e){e.isIntersecting&&(n(e),o.loop||r.unobserve(e.target))})},o).observe(e)}(n,function(){o.reveal()},{root:null,rootMargin:"0px",threshold:.8})}),setTimeout(()=>{const e=n(".reveal-active-"+o);var r=n(e).find(".reveal-muted");n(r).each(function(e,o){n(o).addClass("reveal-loaded"),n(o).removeClass("reveal-muted")})},1.3*(d.duration+l))};jQuery(window).on("elementor/frontend/init",function(){elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.slide",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.crelly",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.meteor",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.coral",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.folio",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.zinest",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-isolate.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-isolate.locate",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-isolate.slice",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-dragon.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-flogia.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-mount.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-elysium.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-fiestar.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-sequester.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-mercury.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-pacific.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-paranoia.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-rubix.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-storker.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-tango.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-vertex.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-woocommerce.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-woolamp.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-astoria.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-avatar.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-flexure.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-fluent.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-fortune.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-knily.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-monster.default",n),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.default",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-general.meteor",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.default",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-blog.coral",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-isolate.default",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-isolate.locate",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-woocommerce.default",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-fluent.default",e),elementorFrontend.hooks.addAction("frontend/element_ready/prime-slider-astoria.default",e)})}(jQuery,window.elementorFrontend);
!function(e,n){"use strict";var t=function(e,n){var t=e.find(".elementor-widget");t.length&&void 0!==jQuery(t).data("settings")&&"yes"===jQuery(t).data("settings").upk_link_new_tab&&t.find(".upk-title a, .upk-readmore").attr("target","_blank")};jQuery(window).on("elementor/frontend/init",(function(){elementorFrontend.hooks.addAction("frontend/element_ready/global",t)}))}(jQuery,window.elementorFrontend);
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.cvslide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".pt-cv-carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.4.2",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("pt-cv-slide")?(f.addClass(b),"object"==typeof f&&f.length&&f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};a.fn.cvcarousel=b,a.fn.cvcarousel.Constructor=c;var d=function(c){var d=a(this),e=d.attr("href");e&&(e=e.replace(/.*(?=#[^\s]+$)/,""));var f=d.attr("data-target"),g=a(document).find(f);if(!g.hasClass("pt-cv-carousel"))return void c.preventDefault();var h=a.extend({},g.data(),d.data()),i=d.attr("data-cvslide-to");i&&(h.interval=!1),b.call(g,h),i&&g.data("bs.carousel").to(i),c.preventDefault()};a(document).ready(function(){a(".pt-cv-wrapper").on("click.bs.carousel.data-api","[data-cvslide]",d).on("click.bs.carousel.data-api","[data-cvslide-to]",d)}),a(window).on("load",function(){a('[data-ride="cvcarousel"]',".pt-cv-wrapper").each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="cvcollapse"][href="#'+b.id+'"],[data-toggle="cvcollapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.4.2",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){!window.cv_collapse_ignore_others&&e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="cvcollapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};a.fn.cvcollapse=c,a.fn.cvcollapse.Constructor=d,a(document).ready(function(){a(".pt-cv-wrapper").on("click.bs.collapse.data-api",'[data-toggle="cvcollapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})})}(jQuery),+function(a){function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d="#"!==c?a(document).find(c):null;return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(d).remove(),a(e).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",f)))))}))}var d=".dropdown-backdrop",e='[data-toggle="dropdown"]',f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.VERSION="3.4.2",f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger(a.Event("shown.bs.dropdown",h))}return!1}},f.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var f=b(d),g=f.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&f.find(e).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=f.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};a(document).ready(function(){a(".pt-cv-wrapper").on("click.bs.dropdown.data-api",c).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",e,f.prototype.toggle).on("keydown.bs.dropdown.data-api",e,f.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",f.prototype.keydown)})}(jQuery),+function(a){function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.4.2",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(document).find(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).ready(function(){a(".pt-cv-wrapper").on("click.bs.tab.data-api",'[data-toggle="tab"]',d).on("click.bs.tab.data-api",'[data-toggle="pill"]',d)})}(jQuery),
function(a){var b=function(a,b){this.init(a,b)},c=null;b.prototype={init:function(b,c){this.$element=a(b);{var d=c&&c.bootstrapMajorVersion?c.bootstrapMajorVersion:a.fn.bootstrapPaginator.defaults.bootstrapMajorVersion;this.$element.attr("id")}if(2===d&&!this.$element.is("div"))throw"in Bootstrap version 2 the pagination must be a div element. Or if you are using Bootstrap pagination 3. Please specify it in bootstrapMajorVersion in the option";if(d>2&&!this.$element.is("ul"))throw"in Bootstrap version 3 the pagination root item must be an ul element.";this.currentPage=1,this.lastPage=1,this.setOptions(c),this.initialized=!0},setOptions:function(b){this.options=a.extend({},this.options||a.fn.bootstrapPaginator.defaults,b),this.totalPages=parseInt(this.options.totalPages,10),this.numberOfPages=parseInt(this.options.numberOfPages,10),b&&"undefined"!=typeof b.currentPage&&this.setCurrentPage(b.currentPage),this.listen(),this.render(),this.initialized||this.lastPage===this.currentPage||this.$element.trigger("page-changed",[this.lastPage,this.currentPage])},listen:function(){this.$element.off("page-clicked"),this.$element.off("page-changed"),"function"==typeof this.options.onPageClicked&&this.$element.on("page-clicked",this.options.onPageClicked),"function"==typeof this.options.onPageChanged&&this.$element.on("page-changed",this.options.onPageChanged),this.$element.on("page-clicked",this.onPageClicked)},destroy:function(){this.$element.off("page-clicked"),this.$element.off("page-changed"),this.$element.removeData("bootstrapPaginator"),this.$element.empty()},show:function(a){this.setCurrentPage(a),this.render(),this.lastPage!==this.currentPage&&this.$element.trigger("page-changed",[this.lastPage,this.currentPage])},showNext:function(){var a=this.getPages();a.next&&this.show(a.next)},showPrevious:function(){var a=this.getPages();a.prev&&this.show(a.prev)},showFirst:function(){var a=this.getPages();a.first&&this.show(a.first)},showLast:function(){var a=this.getPages();a.last&&this.show(a.last)},onPageItemClicked:function(a){var b=a.data.type,c=a.data.page;this.$element.trigger("page-clicked",[a,b,c])},onPageClicked:function(b,c,d,e){var f=a(b.currentTarget);switch(d){case"first":f.bootstrapPaginator("showFirst");break;case"prev":f.bootstrapPaginator("showPrevious");break;case"next":f.bootstrapPaginator("showNext");break;case"last":f.bootstrapPaginator("showLast");break;case"page":f.bootstrapPaginator("show",e)}},render:function(){var b=this.getValueFromOption(this.options.containerClass,this.$element),c=this.options.size||"normal",d=this.options.alignment||"left",e=this.getPages(),f=2===this.options.bootstrapMajorVersion?a("<ul></ul>"):this.$element,g=2===this.options.bootstrapMajorVersion?this.getValueFromOption(this.options.listContainerClass,f):null,h=null,i=null,j=null,k=null,l=null,m=0;switch(c.toLowerCase()){case"large":case"small":case"mini":this.$element.addClass(a.fn.bootstrapPaginator.sizeArray[this.options.bootstrapMajorVersion][c.toLowerCase()])}if(2===this.options.bootstrapMajorVersion)switch(d.toLowerCase()){case"center":this.$element.addClass("pagination-centered");break;case"right":this.$element.addClass("pagination-right")}for(this.$element.addClass(b),this.$element.empty(),2===this.options.bootstrapMajorVersion&&(this.$element.append(f),f.addClass(g)),this.pageRef=[],e.first&&(h=this.buildPageItem("first",e.first),h&&f.append(h)),e.prev&&(i=this.buildPageItem("prev",e.prev),i&&f.append(i)),m=0;m<e.length;m+=1)l=this.buildPageItem("page",e[m]),l&&f.append(l);e.next&&(j=this.buildPageItem("next",e.next),j&&f.append(j)),e.last&&(k=this.buildPageItem("last",e.last),k&&f.append(k))},buildPageItem:function(b,c){var d=a("<li></li>"),e=a("<a></a>"),f="",g="",h=this.options.itemContainerClass(b,c,this.currentPage),i=this.getValueFromOption(this.options.itemContentClass,b,c,this.currentPage),j=null;switch(b){case"first":if(!this.getValueFromOption(this.options.shouldShowPage,b,c,this.currentPage))return;f=this.options.itemTexts(b,c,this.currentPage),g=this.options.tooltipTitles(b,c,this.currentPage);break;case"last":if(!this.getValueFromOption(this.options.shouldShowPage,b,c,this.currentPage))return;f=this.options.itemTexts(b,c,this.currentPage),g=this.options.tooltipTitles(b,c,this.currentPage);break;case"prev":if(!this.getValueFromOption(this.options.shouldShowPage,b,c,this.currentPage))return;f=this.options.itemTexts(b,c,this.currentPage),g=this.options.tooltipTitles(b,c,this.currentPage);break;case"next":if(!this.getValueFromOption(this.options.shouldShowPage,b,c,this.currentPage))return;f=this.options.itemTexts(b,c,this.currentPage),g=this.options.tooltipTitles(b,c,this.currentPage);break;case"page":if(!this.getValueFromOption(this.options.shouldShowPage,b,c,this.currentPage))return;f=this.options.itemTexts(b,c,this.currentPage),g=this.options.tooltipTitles(b,c,this.currentPage)}return d.addClass(h).append(e),e.addClass(i).html(f).on("click",null,{type:b,page:c},a.proxy(this.onPageItemClicked,this)),this.options.pageUrl&&e.attr("href",this.getValueFromOption(this.options.pageUrl,b,c,this.currentPage)),this.options.useBootstrapTooltip?(j=a.extend({},this.options.bootstrapTooltipOptions,{title:g}),e.tooltip(j)):e.attr("title",g),d},setCurrentPage:function(a){(a>this.totalPages||1>a)&&(a=this.totalPages),this.lastPage=this.currentPage,this.currentPage=parseInt(a,10)},getPages:function(){var a=this.totalPages,b=this.currentPage-parseInt(this.numberOfPages/2),b=b+this.numberOfPages>a?a-this.numberOfPages+1:b,c=[],d=0,e=0;for(b=1>b?1:b,d=b,e=0;e<this.numberOfPages&&a>=d;d+=1,e+=1)c.push(d);return c.first=1,c.prev=this.currentPage>1?this.currentPage-1:1,c.next=this.currentPage<a?this.currentPage+1:a,c.last=a,c.current=this.currentPage,c.total=a,c.numberOfPages=this.options.numberOfPages,c},getValueFromOption:function(a){var b=null,c=Array.prototype.slice.call(arguments,1);return b="function"==typeof a?a.apply(this,c):a}},c=a.fn.bootstrapPaginator,a.fn.bootstrapPaginator=function(c){var d=arguments,e=null;return a(this).each(function(f,g){var h=a(g),i=h.data("bootstrapPaginator"),j="object"!=typeof c?null:c;if(!i)return i=new b(this,j),h=a(i.$element),void h.data("bootstrapPaginator",i);if("string"==typeof c){if(!i[c])throw"Method "+c+" does not exist";e=i[c].apply(i,Array.prototype.slice.call(d,1))}else e=i.setOptions(c)}),e},a.fn.bootstrapPaginator.sizeArray={2:{large:"pagination-large",small:"pagination-small",mini:"pagination-mini"},3:{large:"pagination-lg",small:"pagination-sm",mini:""}},a.fn.bootstrapPaginator.defaults={containerClass:"",size:"normal",alignment:"left",bootstrapMajorVersion:2,listContainerClass:"",itemContainerClass:function(a,b,c){return b===c?"active":""},itemContentClass:function(){return""},currentPage:1,numberOfPages:5,totalPages:1,pageUrl:function(){return null},onPageClicked:null,onPageChanged:null,useBootstrapTooltip:!1,shouldShowPage:function(a,b,c){var d=!0;switch(a){case"first":d=1!==c;break;case"prev":d=1!==c;break;case"next":d=c!==this.totalPages;break;case"last":d=c!==this.totalPages;break;case"page":d=!0}return d},itemTexts:function(a,b){switch(a){case"first":return PT_CV_PAGINATION.first;case"prev":return PT_CV_PAGINATION.prev;case"next":return PT_CV_PAGINATION.next;case"last":return PT_CV_PAGINATION.last;case"page":return b}},tooltipTitles:function(a,b,c){switch(a){case"first":return PT_CV_PAGINATION.goto_first;case"prev":return PT_CV_PAGINATION.goto_prev;case"next":return PT_CV_PAGINATION.goto_next;case"last":return PT_CV_PAGINATION.goto_last;case"page":return b===c?PT_CV_PAGINATION.current_page+" "+b:PT_CV_PAGINATION.goto_page+" "+b}},bootstrapTooltipOptions:{animation:!0,html:!0,placement:"top",selector:!1,title:"",container:!1}},a.fn.bootstrapPaginator.Constructor=b}(window.jQuery),
function(a){"use strict";a.PT_CV_Public=a.PT_CV_Public||{},PT_CV_PUBLIC=PT_CV_PUBLIC||{};var b=PT_CV_PUBLIC._prefix;a.PT_CV_Public=function(b){this.options=a.extend({},b),"undefined"==typeof this.options.skip&&(this.pagination(),this.some_fixes())},a.PT_CV_Public.prototype={pagination:function(){var c=this;a("."+b+"pagination."+b+"ajax").each(function(){var b=a(this),d=a(this).attr("data-totalpages"),e=a(this).attr("data-currentpage");a(this).bootstrapPaginator({bootstrapMajorVersion:3,currentPage:e?parseInt(e):1,totalPages:d?parseInt(d):1,numberOfPages:PT_CV_PUBLIC.page_to_show,shouldShowPage:function(a,b,c){var d=null;if("undefined"!=typeof this&&"function"==typeof this.getPages){var e=this.getPages(),f=Array.isArray(e)?e.slice(0,parseInt(this.numberOfPages)):[];f.includes(e.first)&&"first"===a&&(d=!1),f.includes(e.last)&&"last"===a&&(d=!1)}if(null!==d)return d;var g=!0;switch(a){case"first":g=1!==c;break;case"prev":g=1!==c;break;case"next":g=c!==this.totalPages;break;case"last":g=c!==this.totalPages;break;case"page":g=!0}return g},itemContainerClass:function(a,b,c){var d="cv-pageitem-"+("page"===a?"number":a);return d+" "+(b===c?"active":"")},onPageClicked:function(a,d,e,f){c._setup_pagination(b,f,function(){PT_CV_PUBLIC.paging=0})}})})},_setup_pagination:function(a,c,d){var e=this;if(PT_CV_PUBLIC.paging=PT_CV_PUBLIC.paging||0,!PT_CV_PUBLIC.paging&&!a.data("disabled")){PT_CV_PUBLIC.paging=1;var f=a.next("."+b+"spinner"),g=a;a.parent("."+b+"pagination-wrapper").length&&(g=a.parent("."+b+"pagination-wrapper"));var h=g.closest("."+b+"wrapper").children("."+b+"view");if(h.hasClass(b+"timeline")&&(h=h.children(".tl-items").first()),g.find("."+b+"more").length>0){var i=h.children("."+b+"page").first();i.length>0&&(h=i)}e._get_page(a,c,f,h,d)}},_get_page:function(c,d,e,f,g){var h=this;d=parseInt(d);var i=h._active_page(d,f,g);if(i)return g&&"function"==typeof g&&g(),void a("body").trigger(b+"pagination-finished-simple");a("body").trigger(b+"before-pagination");var j={action:"pagination_request",sid:c.attr("data-sid"),unid:c.attr("data-unid"),iselementor:c.attr("data-iselementor"),isblock:c.attr("data-isblock"),postid:c.attr("data-postid"),page:d,lang:PT_CV_PUBLIC.lang,ajax_nonce:PT_CV_PUBLIC._nonce,custom_data:window.cvdata};a.ajax({type:"POST",url:PT_CV_PUBLIC.ajaxurl,data:j,beforeSend:function(){e.addClass("active")}}).done(function(c){e.removeClass("active"),c.indexOf(b+"no-post")<0&&f.append(c),h._active_page(d,f,g),g&&"function"==typeof g&&g(),a("body").trigger(b+"pagination-finished",[f,a(c)])})},_active_page:function(c,d){var e=!1,f='[data-id="'+b+"page-"+c+'"]';return d.children(f).length&&(e=!0,d.children().hide(),d.children(f).show(),this._update_url(c),window.cvp_pagination_no_scroll||d.hasClass("paging-noscroll")||a("html, body").animate({scrollTop:d.children(f).offset().top-160},1e3)),e},_get_paginated_url:function(a){return PT_CV_PAGINATION.links&&PT_CV_PAGINATION.links.page_n&&PT_CV_PAGINATION.links.page_n.replace("_CVNUMBER_",parseInt(a))},_update_url:function(a){var b=this;if(!PT_CV_PUBLIC.is_admin&&!window.cv_pagination_no_update_url){var c=!1;c=a>1?b._get_paginated_url(a):PT_CV_PAGINATION.links&&PT_CV_PAGINATION.links.page_1,c&&history.replaceState(null,null,c)}},some_fixes:function(){"function"==typeof a.CVP_LazyLoad&&"function"==typeof cvp_imagesLoaded&&a(window).cvp_imagesLoaded(function(){a(window).trigger("load")})}},a(function(){new a.PT_CV_Public})}(jQuery);
(()=>{var i={106:()=>{var n,s;fabric.Canvas.prototype.historyProcessing=!0,fabric.Canvas.prototype.initialize=(n=fabric.Canvas.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.call(this,...e),this._historyInit(),this}),fabric.Canvas.prototype.dispose=(s=fabric.Canvas.prototype.dispose,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return s.call(this,...e),this._historyDispose(),this}),fabric.Canvas.prototype._historyNext=function(){var t={version:fabric.version,objects:this.getElementsJSON(!1,!1)};return t.objects.forEach(t=>{t.curved&&delete t.path}),JSON.stringify(t)},fabric.Canvas.prototype._historyEvents=function(){return{elementAdd:this.historySaveAction,elementRemove:this.historySaveAction,"object:modified":this.historySaveAction}},fabric.Canvas.prototype._historyInit=function(){this.historyUndo=[],this.historyRedo=[],this.historyNextState=this._historyNext(),this.on(this._historyEvents())},fabric.Canvas.prototype._historyDispose=function(){this.off(this._historyEvents())},fabric.Canvas.prototype.historySaveAction=function(){var t;this.historyProcessing||(t=this.historyNextState,this.isCustomized=this.initialElementsLoaded,this.historyUndo.push(t),this.historyNextState=this._historyNext(),this.fire("history:append",{json:t}))},fabric.Canvas.prototype.undo=function(t){this.historyProcessing=!0,this.deselectElement();var e=this.historyUndo.pop();e?(this.historyRedo.push(this._historyNext()),this.historyNextState=e,this._loadHistory(e,"history:undo",t)):this.historyProcessing=!1},fabric.Canvas.prototype.redo=function(t){this.historyProcessing=!0,this.deselectElement();var e=this.historyRedo.pop();e?(this.historyUndo.push(this._historyNext()),this.historyNextState=e,this._loadHistory(e,"history:redo",t)):this.historyProcessing=!1},fabric.Canvas.prototype._loadHistory=function(t,e,i){"string"==typeof t&&(t=JSON.parse(t)),this.clear(),this.addElements(t.objects,()=>{this.fire(e),this.historyProcessing=!1,i&&"function"==typeof i&&i()})},fabric.Canvas.prototype.clearHistory=function(){this.historyUndo=[],this.historyRedo=[],this.fire("history:clear")},fabric.Canvas.prototype.onHistory=function(){this.historyProcessing=!1,this.historySaveAction()},fabric.Canvas.prototype.offHistory=function(){this.historyProcessing=!0}},653:()=>{function t(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function e(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function n(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var i=new WeakSet,s=new WeakSet;class r extends HTMLElement{constructor(){super(),t(this,s),t(this,i),e(this,"min",0),e(this,"max",10),e(this,"value",0),e(this,"step",1),e(this,"inputElem",null)}connectedCallback(){this.inputElem=document.createElement("input"),this.inputElem.type="range",this.inputElem.value=this.getAttribute("value"),this.inputElem.min=this.getAttribute("min"),this.inputElem.max=this.getAttribute("max"),this.inputElem.step=this.getAttribute("step"),this.append(this.inputElem),this.inputElem.addEventListener("input",n(this,i,a).bind(this)),n(this,s,o).call(this)}static get observedAttributes(){return["value","step","min","max"]}attributeChangedCallback(t,e,i){this.inputElem&&(this.inputElem[t]=i,n(this,s,o).call(this))}}function a(t){n(this,s,o).call(this),this.onInput&&this.onInput(t);t=new CustomEvent("onInput",{detail:Number(this.inputElem.value)});this.dispatchEvent(t)}function o(){this.inputElem.style.setProperty("--value",this.inputElem.value),this.inputElem.style.setProperty("--min",this.inputElem.min),this.inputElem.style.setProperty("--max",this.inputElem.max)}customElements.define("fpd-range-slider",r)},148:function(t){!function(){"use strict";function rt(t,e){return t<0?-1:0<t?1:e||0}function y(t){return"function"==typeof t}function x(t){return"[object String]"===e.call(t)}function l(){var t=!1,e={};try{Object.defineProperty(e,"passive",{get:function(){return!(t=!0)}}),window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}function w(t,e,i,n){null==o&&(o=l()),t.attachEvent?t.attachEvent("on"+e,i):t.addEventListener(e,i,o?n:"object"==typeof n?!!n.capture:!!n)}function a(t,e,i,n){null==o&&(o=l()),t.detachEvent?t.detachEvent("on"+e,i):t.removeEventListener(e,i,o?n:"object"==typeof n?!!n.capture:!!n)}function C(t,e){return t.classList?t.classList.contains(e):-1!==(" "+t.className+" ").indexOf(" "+e+" ")}function at(t,e){t.classList?t.classList.add(e):C(t,e)||(t.className=""===t.className?e:t.className+" "+e)}function ot(t,e){t.classList?t.classList.remove(e):t.className=c((" "+t.className+" ").replace(" "+e+" "," "))}function E(t,e){return 0!==t[e]||(t[e]=1)===t[e]&&(t[e]=0,1)}function T(t){return(y(window.getComputedStyle)?window.getComputedStyle(t,null):t.currentStyle)||{}}function lt(t,e,i){return t.elementsFromPoint(e,i)}function Pt(i,t){return t.reduce(function(t,e){return t[e]=i[pt].getPropertyValue(e),t},{})}function _t(e,t,i){i=i||e[ht][pt],t.forEach(function(t){r.call(i,t)&&""!==i[t]?e[pt][t]=i[t]:e[pt].removeProperty(t)})}function Dt(e,t,i){var n,s,r,a;0<t&&(e[ht]&&e[ht].animation&&e[ht].animation.stop(),n="transform "+Mt(t)+"ms",s="translate3d(0,0,0)",r=null,a=function t(){r&&clearTimeout(r),r=null,e[ht]&&e[ht].animation&&t===e[ht].animation.stop&&(e[ht].animation=null),e[pt].transform===s&&e[pt].transition===n&&(e[pt].transition="none",e[pt].transform="none")},e[pt].transition="none",e[pt].transform="translate3d("+Mt(-(i[mt]||0))+"px,"+Mt(-(i[yt]||0))+"px,0)",e.offsetWidth,e[pt].transform=s,e[pt].transition=n,r=setTimeout(a,t),e[ht].animation={stop:a})}function ct(t,e,i,n,s){t=t[ht].r,e=e[ht][dt];return kt.max(0,kt.min(1,kt.max(0,kt.min(t[n]+t[s],e[n]-i[n]+e[s])-kt.max(t[n],e[n]-i[n]))/kt.min(t[s],e[s])))}function Lt(t,e,i,n,s){var t=t[ht].r,e=e[ht][dt],r=kt.max(0,kt.min(t[mt]+t[bt],e[mt]-i[mt]+e[bt])-kt.max(t[mt],e[mt]-i[mt])),i=kt.max(0,kt.min(t[yt]+t[wt],e[yt]-i[yt]+e[wt])-kt.max(t[yt],e[yt]-i[yt]));return kt.max(0,kt.min(1,r*i/(kt.min(t[bt],e[bt])*kt.min(t[wt],e[wt]))))}function n(A,I){function M(t,e,i){i<0?(_===e&&(_=t),D===t&&(D=P[St]),j.insertBefore(t,e)):0<i&&(_===t&&(_=t[Ct]),e[Ct]?j.insertBefore(t,e[Ct]):(j.appendChild(t),D=t)),t[ht].index=e[ht].index,j.insertBefore(P,t),y(A.options.onChange)&&A.options.onChange(t)}function t(t){if(u&&!m&&A.options.container&&(!Bt.test(t.type)||0===t.button))if(b(),!((h=t.target)&&C(h,A.options.handle||"dnd-sortable-handle")&&(O=function(t,e){if(t.closest)return t.closest("."+e);for(;t;){if(C(t,e))return t;t=t.parentNode}}(h,A.options.item||"dnd-sortable-item")))||!(j=O.parentNode)||x(A.options.container)&&j.id!==A.options.container||!x(A.options.container)&&j!==A.options.container||(y(A.options.onStart)&&A.options.onStart(O),y(A.options.itemFilter)&&!(O=A.options.itemFilter(O))))b();else{m=!0,Z=O.ownerDocument||document,t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),p=t.touches&&t.touches.length;var e,s=0,r=0,a=mt,o=bt,l=vt,i=(j.tagName||"").toLowerCase();if(B=(e=Z).scrollingElement||e.documentElement||e.body,F=null,A.options.autoscroll)for(F=j;F&&!(B===F||It!==I&&F.scrollHeight>F.clientHeight&&E(F,Et)||At!==I&&F.scrollWidth>F.clientWidth&&E(F,Tt));)F=F.parentNode;j[ht]={rect:j.getBoundingClientRect(),scroll:{top:j[Et]||0,left:j[Tt]||0,width:j.scrollWidth,height:j.scrollHeight,top0:j[Et]||0,left0:j[Tt]||0},$:T(j),style:Pt(j,["width","height","max-width","max-height","box-sizing","padding-left","padding-top","padding-right","padding-bottom"])},j[ht][gt]={left:S(j[ht].$.paddingLeft)||0,right:S(j[ht].$.paddingRight)||0},F&&F!==j&&(F[ht]={rect:F.getBoundingClientRect(),scroll:{top:F[Et]||0,left:F[Tt]||0,width:F.scrollWidth,height:F.scrollHeight,top0:F[Et]||0,left0:F[Tt]||0}}),(d=[].map.call(j.children,function(t,e){var i=t.getBoundingClientRect(),n=T(t);return t[ht]={index:e,line:0,prev:{},rect:{top:i[yt],left:i[mt],width:i[bt],height:i[wt]},r:{top:i[yt],left:i[mt],width:i[bt],height:i[wt]},margin:{top:S(n.marginTop)||0,right:S(n.marginRight)||0,bottom:S(n.marginBottom)||0,left:S(n.marginLeft)||0},$:n,style:Pt(t,["position","box-sizing","overflow","top","left","width","height","transform","transition"]),animation:null},e=t[ht][ft][a]+t[ht][dt][o]+t[ht][ft][l],0<r&&j[ht][gt][a]+r+e+j[ht][gt][l]>j[ht][dt][o]&&(s++,r=0),t[ht].line=s,r+=e,t})).length&&(_=d[0],D=d[d.length-1]),a=yt,o=wt,l=xt,L=new Array(d.length),d.forEach(function(t){var e=t[ht].line,t=t[ht][dt][a]-t[ht][ft][a]-j[ht][dt][a]+j[ht][ut][a];L[e]=null==L[e]?t:kt.min(t,L[e])}),at(j,A.options.activeArea||"dnd-sortable-area"),j[pt].boxSizing="border-box",j[pt][bt]=Mt(j[ht][dt][bt])+"px",j[pt][wt]=Mt(j[ht][dt][wt])+"px",j[pt].maxWidth=Mt(j[ht][dt][bt])+"px",j[pt].maxHeight=Mt(j[ht][dt][wt])+"px",O.draggable=!1,at(O,A.options.activeItem||"dnd-sortable-dragged"),it=!0,d.forEach(function(t){var e=d[0];t[pt].position="absolute",t[pt].boxSizing="border-box",t[pt].overflow="hidden",t[pt][yt]=Mt(t[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt]-t[ht][ft][yt])+"px",t[pt][mt]=Mt(t[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt]-t[ht][ft][mt])+"px",t[pt][bt]=Mt(t[ht][dt][bt])+"px",t[pt][wt]=Mt(t[ht][dt][wt])+"px",t[ht][dt][bt]===e[ht][dt][bt]&&t[ht][dt][wt]===e[ht][dt][wt]&&t[ht][ft][yt]===e[ht][ft][yt]&&t[ht][ft][xt]===e[ht][ft][xt]&&t[ht][ft][mt]===e[ht][ft][mt]&&t[ht][ft][vt]===e[ht][ft][vt]||(it=!1)}),at(P=Z.createElement("ul"===i||"ol"===i?"li":"tr"===i?"td":"tbody"===i||"thead"===i||"tfoot"===i||"table"===i?"tr":"span"),A.options.placeholder||"dnd-sortable-placeholder"),P[pt].position="absolute",P[pt].display="block",P[pt].boxSizing="border-box",P[pt].margin="0",j===F&&(j[pt].paddingLeft=Mt(j[ht][ut][bt]-j[ht][dt][bt])+"px",j[pt].paddingTop=Mt(j[ht][ut][wt]-j[ht][dt][wt])+"px",j[pt].paddingRight="0px",j[pt].paddingBottom="0px",j[Tt]=j[ht][ut][mt],j[Et]=j[ht][ut][yt]),p?(w(Z,"touchmove",n,!1),w(Z,"touchend",c,!1),w(Z,"touchcancel",c,!1)):(w(Z,"mousemove",n,!1),w(Z,"mouseup",c,!1)),v=setInterval(g,60),$=H=(p?t.touches[0]:t).clientX,tt=z=(p?t.touches[0]:t).clientY,R=H,N=z,Y=U=V=W=0,j.insertBefore(P,O),P[pt][bt]=Mt(O[ht][dt][bt])+"px",P[pt][wt]=Mt(O[ht][dt][wt])+"px",P[pt][yt]=Mt(O[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt])+"px",P[pt][mt]=Mt(O[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt])+"px",It!==I&&(O[pt][yt]=Mt(z-N+O[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt]-O[ht][ft][yt])+"px"),At!==I&&(O[pt][mt]=Mt(H-R+O[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt]-O[ht][ft][mt])+"px")}}function n(){s||(i.apply(this,arguments),s=!0,setTimeout(function(){s=!1},60))}function g(){var t,e,i,n,s,r,a,o,l,c,h,d,u,p,f,g,m,v=0,b=yt,y=wt,x=mt,w=bt,C=0,S=0,E=!1,T=!1;At===I&&(x=yt,w=wt),i=(e=$)-H,n=(t=tt)-z,W=0===W?i:W,V=0===V?n:V,U=0!=i?rt(i):0!==W?rt(W):U,Y=0!=n?rt(n):0!==V?rt(V):Y,H=e,z=t,q=(m=F)?{top:m[Et]-m[ht][ut].top0||0,left:m[Tt]-m[ht][ut].left0||0}:{top:0,left:0},It!==I&&(O[ht].r[yt]=z-N+O[ht][dt][yt],O[pt][yt]=Mt(O[ht].r[yt]-j[ht][dt][yt]+j[ht][ut][yt]-O[ht][ft][yt]+q[yt])+"px",T=n*V<0),At!==I&&(O[ht].r[mt]=H-R+O[ht][dt][mt],O[pt][mt]=Mt(O[ht].r[mt]-j[ht][dt][mt]+j[ht][ut][mt]-O[ht][ft][mt]+q[mt])+"px",E=i*W<0),A.options.autoscroll&&F&&(!J||E||T)&&(J&&(clearInterval(J),J=null),m=B===F?(s=F[ht][dt][bt],a=F[ht][dt][wt],o=r=0,l=1.5):(s=F[ht][dt][vt],r=F[ht][dt][mt],a=F[ht][dt][xt],o=F[ht][dt][yt],l=1.2),At!==I&&(0<U&&F[Tt]+F[ht][dt][bt]<F[ht][ut][bt]&&O[ht].r[mt]+O[ht].r[bt]>=s||U<0&&0<F[Tt]&&O[ht].r[mt]<=r)&&(C=kt.round(U*l*O[ht].r[bt])),It!==I&&(0<Y&&F[Et]+F[ht][dt][wt]<F[ht][ut][wt]&&O[ht].r[yt]+O[ht].r[wt]>=a||Y<0&&0<F[Et]&&O[ht].r[yt]<=o)&&(S=kt.round(Y*m*O[ht].r[wt])),C||S)&&(E=kt.abs(C)>kt.abs(S)?C:0,T=kt.abs(S)>=kt.abs(C)?S:0,c=A.options.scrollAnimationMs||0,h=16.666666666666668,d=F[Et]||0,u=F[Tt]||0,p=0,f=E/(c||h),g=T/(c||h),J=setInterval(function(){p+=h,d+=g*h,u+=f*h,F[Et]=kt.min(kt.max(0,d),F[ht][ut][wt]-F[ht][dt][wt]),F[Tt]=kt.min(kt.max(0,u),F[ht][ut][bt]-F[ht][dt][bt]),J&&c<=p&&(clearInterval(J),J=null)},h)),W=i,V=n,s=O[ht].r[mt]+O[ht].r[bt]/2,r=O[ht].r[yt]+O[ht].r[wt]/2,l=O[ht].r[x],a=function(t){for(var e=1,i=arguments,n=i.length;e<n;++e)t.push.apply(t,i[e]);return t}(lt(Z,e,t),At===I?[]:lt(Z,O[ht].r[mt]+2,r),At===I?[]:lt(Z,O[ht].r[mt]+O[ht].r[bt]-2,r),It===I?[]:lt(Z,s,O[ht].r[yt]+2),It===I?[]:lt(Z,s,O[ht].r[yt]+O[ht].r[wt]-2)).reduce(function(t,e){var i;return e!==O&&e!==P&&e.parentNode===j&&(i=st(O,e,q,K,Q),v<i)&&(v=i,t=e),t},null),o=Ot===I?(a=!(a=!a&&O!==_&&0<=_[ht][dt][x]-q[x]-(l+O[ht][dt][w])&&_[ht][dt][x]-q[x]-(l+O[ht][dt][w])<25&&.7<(v=ct(O,_,q,b,y))?_:a)&&O!==D&&0<=l-(D[ht][dt][x]-q[x]+D[ht][dt][w])&&l-(D[ht][dt][x]-q[x]+D[ht][dt][w])<25&&.7<(v=ct(O,D,q,b,y))?D:a)?a[ht].index-O[ht].index:kt.abs(Y)>=kt.abs(U)?Y:U:(!(a=!a&&O!==_&&_[ht][dt][x]-q[x]>l+O[ht][dt][w]?_:a)&&O!==D&&l>D[ht][dt][x]-q[x]+D[ht][dt][w]&&(a=D),It===I?U:Y),k&&(G<0&&0<o&&X<.5||0<G&&o<0&&X<.5||a&&k!==a&&X<v||!st(O,k,q,K,Q))&&(ot(k,A.options.closestItem||"dnd-sortable-closest"),X=0,k=null),!k&&a&&v&&(k=a,G=0<o?1:-1,X=v,et=!1),k&&((v=v||st(O,k,q,K,Q))?.2<(X=v)?(at(k,A.options.closestItem||"dnd-sortable-closest"),.5<v&&!et&&(R-=O[ht][dt][mt],N-=O[ht][dt][yt],et=!0,nt(O,k,G,A.options.animationMs||0),R+=O[ht][dt][mt],N+=O[ht][dt][yt])):ot(k,A.options.closestItem||"dnd-sortable-closest"):(ot(k,A.options.closestItem||"dnd-sortable-closest"),X=0,k=null))}function c(t){var e=O;r(),b(),y(A.options.onEnd)&&A.options.onEnd(e)}var P,O,h,k,_,D,d,L,B,F,j,R,N,H,z,W,V,U,Y,$,tt,q,G,X,et,Z,i,s,e=!1,u=!1,m=!1,p=!1,v=null,J=null,it=!1,Q=It===I?bt:wt,K=It===I?mt:yt,f=mt===K?vt:xt,b=function(){Z=L=d=j=F=B=D=_=k=h=O=P=null,et=!1,X=0},r=function(){m&&(J&&(clearInterval(J),J=null),p?(a(Z,"touchmove",n,!1),a(Z,"touchend",c,!1),a(Z,"touchcancel",c,!1)):(a(Z,"mousemove",n,!1),a(Z,"mouseup",c,!1)),v&&(clearInterval(v),v=null),P&&P.parentNode&&(P.parentNode.removeChild(P),P[ht]=null),ot(j,A.options.activeArea||"dnd-sortable-area"),_t(j,["width","height","max-width","max-height","box-sizing","padding-left","padding-top","padding-right","padding-bottom"],j[ht].style),k&&ot(k,A.options.closestItem||"dnd-sortable-closest"),ot(O,A.options.activeItem||"dnd-sortable-dragged"),d.forEach(function(t){_t(t,["position","box-sizing","overflow","top","left","width","height","transform","transition"]),t[ht]=null}),j[ht]=null,F&&(F[ht]=null),m=!1)},nt=Ot===I?function(t,e,i,n){var s,r,a=e;if(it){if(i<0){for(r=t[Ct],M(t,e,i),t[ht].prev.line=t[ht].line,t[ht].prev[yt]=t[ht][dt][yt],t[ht].prev[mt]=t[ht][dt][mt],t[ht].line=e[ht].line,t[ht][dt][yt]=e[ht][dt][yt],t[ht][dt][mt]=e[ht][dt][mt],P[pt][yt]=Mt(t[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt])+"px",P[pt][mt]=Mt(t[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt])+"px";(s=e[Ct])&&s!==r;)e[ht].animation&&e[ht].animation.stop(),e[ht].index++,e[ht].prev.line=e[ht].line,e[ht].prev[yt]=e[ht][dt][yt],e[ht].prev[mt]=e[ht][dt][mt],e[ht].line=s[ht].line,e[ht][dt][yt]=s[ht][dt][yt],e[ht][dt][mt]=s[ht][dt][mt],e[pt][yt]=Mt(e[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt]-e[ht][ft][yt])+"px",e[pt][mt]=Mt(e[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt]-e[ht][ft][mt])+"px",e=s;e[ht].animation&&e[ht].animation.stop(),e[ht].index++,e[ht].prev.line=e[ht].line,e[ht].prev[yt]=e[ht][dt][yt],e[ht].prev[mt]=e[ht][dt][mt],e[ht].line=t[ht].prev.line,e[ht][dt][yt]=t[ht].prev[yt],e[ht][dt][mt]=t[ht].prev[mt],e[pt][yt]=Mt(e[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt]-e[ht][ft][yt])+"px",e[pt][mt]=Mt(e[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt]-e[ht][ft][mt])+"px"}else if(0<i){for(r=t[Ct],M(t,e,i),e=r,(s=t)[ht].prev.line=s[ht].line,s[ht].prev[yt]=s[ht][dt][yt],s[ht].prev[mt]=s[ht][dt][mt];e[ht].animation&&e[ht].animation.stop(),e[ht].index--,e[ht].prev.line=e[ht].line,e[ht].prev[yt]=e[ht][dt][yt],e[ht].prev[mt]=e[ht][dt][mt],e[ht].line=s[ht].prev.line,e[ht][dt][yt]=s[ht].prev[yt],e[ht][dt][mt]=s[ht].prev[mt],e[pt][yt]=Mt(e[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt]-e[ht][ft][yt])+"px",e[pt][mt]=Mt(e[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt]-e[ht][ft][mt])+"px",(e=(s=e)[Ct])&&e!==P;);t[ht].line=s[ht].prev.line,t[ht][dt][yt]=s[ht].prev[yt],t[ht][dt][mt]=s[ht].prev[mt],P[pt][yt]=Mt(t[ht][dt][yt]-j[ht][dt][yt]+j[ht][ut][yt])+"px",P[pt][mt]=Mt(t[ht][dt][mt]-j[ht][dt][mt]+j[ht][ut][mt])+"px"}}else{i<0?(s=P[St],r=e[St]||e,M(t,e,i)):0<i&&(s=t[Ct],r=P[St]||t[Ct],M(t,e,i)),function(t,e,i,n){for(t=t[i<0?Ct:St];t;){if(t!==n&&(t[ht].index+=i<0?1:-1),t===e)return;t=t[i<0?Ct:St]}}(t,s,i,P);for(var o,l=r=function(t,e){for(var i;(i=t[St])&&i[ht]&&i[ht].line>=e;)t=i;return t}(r,i=r[ht].line),c=i,h=j,d=t,u=P,p=mt,f=bt,g=vt,m=0;l;)l!==u&&(l[ht]&&l[ht].animation&&l[ht].animation.stop(),o=l[ht][ft][p]+l[ht][dt][f]+l[ht][ft][g],0<m&&h[ht][gt][p]+m+o+h[ht][gt][g]>h[ht][dt][f]&&(c++,m=0),l[ht].line=c,l[ht].prev[p]=l[ht][dt][p],l[ht][dt][p]=h[ht][dt][p]-h[ht][ut][p]+h[ht][gt][p]+m+l[ht][ft][p],(l===d?u:l)[pt][p]=Mt(l[ht][dt][p]-h[ht][dt][p]+h[ht][ut][p]-(l===d?0:l[ht][ft][p]))+"px",m+=o),l=l[Ct];for(var v,b,y,x=r,w=L,C=j,S=t,E=P,T=yt,A=wt,I=xt,i=x,O=x[ht].line,k=0;x;)x!==E&&(v=x[ht].line,y=x[ht][ft][T]+x[ht][dt][A]+x[ht][ft][I],k=v===O?kt.max(k,y):(w[v]=w[O]+k,O=v,y)),x=x[Ct];for(0<k&&(w[O+1]=w[O]+k),x=i;x;)x!==E&&(b=w[v=x[ht].line],x[ht].prev[T]=x[ht][dt][T],"bottom"===x[ht].$.verticalAlign?x[ht][dt][T]=C[ht][dt][T]-C[ht][ut][T]+w[v+1]-x[ht][dt][A]-x[ht][ft][I]:x[ht][dt][T]=C[ht][dt][T]-C[ht][ut][T]+b+x[ht][ft][T],(x===S?E:x)[pt][T]=Mt(x[ht][dt][T]-(x===S?0:x[ht][ft][T])-C[ht][dt][T]+C[ht][ut][T])+"px"),x=x[Ct]}Dt(a,n,{top:a[ht][dt][yt]-a[ht].prev[yt],left:a[ht][dt][mt]-a[ht].prev[mt]})}:function(t,e,i,n){var s,r,a=e,o=0,l=0;if(i<0){for(r=t[Ct],M(t,e,i),t[ht].prev[K]=t[ht][dt][K],l=t[ht][ft][K]-e[ht][ft][K],t[ht][dt][K]=e[ht][dt][K]+l,P[pt][K]=Mt(t[ht][dt][K]-j[ht][dt][K]+j[ht][ut][K])+"px",o=t[ht][dt][Q]-e[ht][dt][Q],l+=t[ht][ft][f]-e[ht][ft][f];(s=e[Ct])&&s!==r;)e[ht].animation&&e[ht].animation.stop(),e[ht].index++,e[ht].prev[K]=e[ht][dt][K],l+=e[ht][ft][K]-s[ht][ft][K],e[ht][dt][K]=s[ht][dt][K]+o+l,l+=e[ht][ft][f]-s[ht][ft][f],e[pt][K]=Mt(e[ht][dt][K]-j[ht][dt][K]+j[ht][ut][K]-e[ht][ft][K])+"px",o+=e[ht][dt][Q]-s[ht][dt][Q],e=s;e[ht].animation&&e[ht].animation.stop(),e[ht].index++,e[ht].prev[K]=e[ht][dt][K],e[ht][dt][K]=t[ht].prev[K]+o+l-t[ht][ft][K]+e[ht][ft][K],e[pt][K]=Mt(e[ht][dt][K]-j[ht][dt][K]+j[ht][ut][K]-e[ht][ft][K])+"px"}else if(0<i){for(r=t[Ct],M(t,e,i),e=r,o=l=0,(s=t)[ht].prev[K]=s[ht][dt][K];e[ht].animation&&e[ht].animation.stop(),e[ht].index--,e[ht].prev[K]=e[ht][dt][K],l+=e[ht][ft][K]-s[ht][ft][K],e[ht][dt][K]=s[ht].prev[K]+o+l,e[pt][K]=Mt(e[ht][dt][K]-j[ht][dt][K]+j[ht][ut][K]-e[ht][ft][K])+"px",o+=-(s[ht][dt][Q]-e[ht][dt][Q]),l+=e[ht][ft][f]-s[ht][ft][f],(e=(s=e)[Ct])&&e!==P;);t[ht][dt][K]=s[ht].prev[K]+o+l-s[ht][ft][K]+t[ht][ft][K],P[pt][K]=Mt(t[ht][dt][K]-j[ht][dt][K]+j[ht][ut][K])+"px"}(i={})[K]=a[ht][dt][K]-a[ht].prev[K],Dt(a,n,i)},st=Ot===I?Lt:ct;i=function(t){$=(p?t.touches[0]:t).clientX,tt=(p?t.touches[0]:t).clientY},s=!60;A.start=A.options.callable?function(){u||(u=!(e=!1),A.handle=t)}:function(){u||(u=!0,e)||(e=!0,w(document,"touchstart",t,{capture:!0,passive:!1}),w(document,"mousedown",t,{capture:!0,passive:!1}))},A.stop=function(){A.handle=null,u=!1,e&&(a(document,"touchstart",t,{capture:!0,passive:!1}),a(document,"mousedown",t,{capture:!0,passive:!1}),e=!1),r(),b()}}function s(t,e){var i=this;if(!(i instanceof s))return new s(t,e);switch(i.options=e||{},(t=Mt(t)).toLowerCase()){case"unrestricted":n(i,Ot);break;case"horizontal":n(i,It);break;case"vertical":n(i,At);break;default:throw new TypeError("AreaSortable invalid sort mode:"+t)}i.start()}var ht,dt,ut,pt,ft,gt,mt,vt,bt,yt,xt,wt,Ct,St,Et,Tt,At,It,Ot,kt,Mt,S,r,e,i,Bt,c,o;t.exports=(ht="$areaSortable",dt="rect",ut="scroll",pt="style",ft="margin",gt="padding",mt="left",vt="right",bt="width",yt="top",xt="bottom",wt="height",Ct="nextElementSibling",St="previousElementSibling",Et="scrollTop",Tt="scrollLeft",Ot=(At=1)+(It=2),kt=Math,Mt=String,S=parseInt,r=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=/^\s+|\s+$/g,Bt=/mousedown|pointerdown/,c=Mt.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(i,"")},o=null,window.Element&&!r.call(window.Element.prototype,ht)&&(window.Element.prototype[ht]=null),s.VERSION="1.2.2",s.prototype={constructor:s,options:null,start:null,handle:null,stop:null,dispose:function(){var t=this;return t.stop&&t.stop(),t.options=null,t.start=null,t.handle=null,t.stop=null,t}},s)}()},729:function(t,e){var i;void 0!==(e="function"==typeof(i=function(){return function e(t,i,n){function s(t){return String(t)}var r,a=window,o="application/octet-stream",l=n||o,c=t,t=!i&&!n&&c,h=document.createElement("a"),d=a.Blob||a.MozBlob||a.WebKitBlob||s,u=i||"download",d=d.call?d.bind(a):Blob;if("true"===String(this)&&(l=(c=[c,l])[0],c=c[1]),t&&t.length<2048&&(u=t.split("/").pop().split("?")[0],h.href=t,-1!==h.href.indexOf(t)))return(r=new XMLHttpRequest).open("GET",t,!0),r.responseType="blob",r.onload=function(t){e(t.target.response,u,o)},setTimeout(function(){r.send()},0),r;if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(2096103.424<c.length&&d!==s))return navigator.msSaveBlob?navigator.msSaveBlob(m(c),u):v(c);l=(c=m(c)).type||o}else if(/([\x80-\xff])/.test(c)){for(var p=0,f=new Uint8Array(c.length),g=f.length;p<g;++p)f[p]=c.charCodeAt(p);c=new d([f],{type:l})}function m(t){for(var t=t.split(/[:;,]/),e=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),n=i.length,s=0,r=new Uint8Array(n);s<n;++s)r[s]=i.charCodeAt(s);return new d([r],{type:e})}function v(t,e){var i;return"download"in h?(h.href=t,h.setAttribute("download",u),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout(function(){h.click(),document.body.removeChild(h),!0===e&&setTimeout(function(){a.URL.revokeObjectURL(h.href)},250)},66),!0):/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent)?(/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,o)),window.open(t)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=t),!0):(i=document.createElement("iframe"),document.body.appendChild(i),!e&&/^data:/.test(t)&&(t="data:"+t.replace(/^data:([\w\/\-\+]+)/,o)),i.src=t,void setTimeout(function(){document.body.removeChild(i)},333))}if(n=c instanceof d?c:new d([c],{type:l}),navigator.msSaveBlob)return navigator.msSaveBlob(n,u);if(a.URL)v(a.URL.createObjectURL(n),!0);else{if("string"==typeof n||n.constructor===s)try{return v("data:"+l+";base64,"+a.btoa(n))}catch(e){return v("data:"+l+","+encodeURIComponent(n))}(i=new FileReader).onload=function(t){v(this.result)},i.readAsDataURL(n)}return!0}})?i.apply(e,[]):i)&&(t.exports=e)},777:(B,i,t)=>{var F,j,r,a,o,n,s,R,l,c,u,N,h,d,H,p,f,z,e,g,m,W,v,b,y,U,Y,x,w,C,q,S,E,T,A,I,G,X,Z,J,Q,K,$,tt,et,it,nt,V=V||{version:"5.3.0"};function st(t,e){var t=t.canvas,e=e.targetCanvas,i=e.getContext("2d"),n=(i.translate(0,e.height),i.scale(1,-1),t.height-e.height);i.drawImage(t,0,n,e.width,e.height,0,0,e.width,e.height)}function rt(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,e=e.destinationHeight,s=n*e*4,r=new Uint8Array(this.imageBuffer,0,s),s=new Uint8ClampedArray(this.imageBuffer,0,s),t=(t.readPixels(0,0,n,e,t.RGBA,t.UNSIGNED_BYTE,r),new ImageData(s,n,e));i.putImageData(t,0,0)}i.fabric=V,"undefined"!=typeof document&&"undefined"!=typeof window?(document instanceof("undefined"!=typeof HTMLDocument?HTMLDocument:Document)?V.document=document:V.document=document.implementation.createHTMLDocument(""),V.window=window):(k=new(t(960).JSDOM)(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]},resources:"usable"}).window,V.document=k.document,V.jsdomImplForWrapper=t(759).implForWrapper,V.nodeCanvas=t(272).Canvas,V.window=k,DOMParser=V.window.DOMParser),V.isTouchSupported="ontouchstart"in V.window||"ontouchstart"in V.document||V.window&&V.window.navigator&&0<V.window.navigator.maxTouchPoints,V.isLikelyNode="undefined"!=typeof Buffer&&"undefined"==typeof window,V.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-dashoffset","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","vector-effect","instantiated_by_use","clip-path"],V.DPI=96,V.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:[eE][-+]?\\d+)?)",V.commaWsp="(?:\\s+,?\\s*|,\\s*)",V.rePathCommand=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,V.reNonWord=/[ \n\.,;!\?\-]/,V.fontPaths={},V.iMatrix=[1,0,0,1,0,0],V.svgNS="http://www.w3.org/2000/svg",V.perfLimitSizeTotal=2097152,V.maxCacheSideLimit=4096,V.minCacheSideLimit=256,V.charWidthsCache={},V.textureSize=2048,V.disableStyleCopyPaste=!1,V.enableGLFiltering=!0,V.devicePixelRatio=V.window.devicePixelRatio||V.window.webkitDevicePixelRatio||V.window.mozDevicePixelRatio||1,V.browserShadowBlurConstant=1,V.arcToSegmentsCache={},V.boundsOfCurveCache={},V.cachesBoundsOfCurve=!0,V.forceGLPutImageData=!1,V.initFilterBackend=function(){return V.enableGLFiltering&&V.isWebglSupported&&V.isWebglSupported(V.textureSize)?(console.log("max texture size: "+V.maxTextureSize),new V.WebglFilterBackend({tileSize:V.textureSize})):V.Canvas2dFilterBackend?new V.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=V),V.Observable={fire:function(t,e){if(this.__eventListeners){var i=this.__eventListeners[t];if(i){for(var n=0,s=i.length;n<s;n++)i[n]&&i[n].call(this,e||{});this.__eventListeners[t]=i.filter(function(t){return!1!==t})}}return this},on:function(t,e){if(this.__eventListeners||(this.__eventListeners={}),1===arguments.length)for(var i in t)this.on(i,t[i]);else this.__eventListeners[t]||(this.__eventListeners[t]=[]),this.__eventListeners[t].push(e);return this},once:function(t,e){if(1===arguments.length)for(var i in t)Lt.call(this,i,t[i]);else Lt.call(this,t,e);return this},off:function(t,e){if(this.__eventListeners)if(0===arguments.length)for(t in this.__eventListeners)Dt.call(this,t);else if(1===arguments.length&&"object"==typeof arguments[0])for(var i in t)Dt.call(this,i,t[i]);else Dt.call(this,t,e);return this}},V.Collection={_objects:[],add:function(){if(this._objects.push.apply(this._objects,arguments),this._onObjectAdded)for(var t=0,e=arguments.length;t<e;t++)this._onObjectAdded(arguments[t]);return this.renderOnAddRemove&&this.requestRenderAll(),this},insertAt:function(t,e,i){var n=this._objects;return i?n[e]=t:n.splice(e,0,t),this._onObjectAdded&&this._onObjectAdded(t),this.renderOnAddRemove&&this.requestRenderAll(),this},remove:function(){for(var t,e=this._objects,i=!1,n=0,s=arguments.length;n<s;n++)-1!==(t=e.indexOf(arguments[n]))&&(i=!0,e.splice(t,1),this._onObjectRemoved)&&this._onObjectRemoved(arguments[n]);return this.renderOnAddRemove&&i&&this.requestRenderAll(),this},forEachObject:function(t,e){for(var i=this.getObjects(),n=0,s=i.length;n<s;n++)t.call(e,i[n],n,i);return this},getObjects:function(e){return void 0===e?this._objects.concat():this._objects.filter(function(t){return t.type===e})},item:function(t){return this._objects[t]},isEmpty:function(){return 0===this._objects.length},size:function(){return this._objects.length},contains:function(e,t){return-1<this._objects.indexOf(e)||!!t&&this._objects.some(function(t){return"function"==typeof t.contains&&t.contains(e,!0)})},complexity:function(){return this._objects.reduce(function(t,e){return t+(e.complexity?e.complexity():0)},0)}},V.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof V.Gradient||this.set(e,new V.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof V.Pattern?i&&i():this.set(e,new V.Pattern(t,i))},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):this._set(t,e),this},_set:function(t,e){this[t]=e},toggle:function(t){var e=this.get(t);return"boolean"==typeof e&&this.set(t,!e),this},get:function(t){return this[t]}},F=i,j=Math.sqrt,r=Math.atan2,a=Math.pow,o=Math.PI/180,n=Math.PI/2,V.util={cos:function(t){if(0===t)return 1;switch((t=t<0?-t:t)/n){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=t<0?-1:1;switch(t/n){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){e=t.indexOf(e);return-1!==e&&t.splice(e,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*o},radiansToDegrees:function(t){return t/o},rotatePoint:function(t,e,i){t=new V.Point(t.x-e.x,t.y-e.y),t=V.util.rotateVector(t,i);return new V.Point(t.x,t.y).addEquals(e)},rotateVector:function(t,e){var i=V.util.sin(e),e=V.util.cos(e);return{x:t.x*e-t.y*i,y:t.x*i+t.y*e}},createVector:function(t,e){return new V.Point(e.x-t.x,e.y-t.y)},calcAngleBetweenVectors:function(t,e){return Math.acos((t.x*e.x+t.y*e.y)/(Math.hypot(t.x,t.y)*Math.hypot(e.x,e.y)))},getHatVector:function(t){return new V.Point(t.x,t.y).multiply(1/Math.hypot(t.x,t.y))},getBisector:function(t,e,i){e=V.util.createVector(t,e),t=V.util.createVector(t,i),i=V.util.calcAngleBetweenVectors(e,t),t=i*(0===V.util.calcAngleBetweenVectors(V.util.rotateVector(e,i),t)?1:-1)/2;return{vector:V.util.getHatVector(V.util.rotateVector(e,t)),angle:i}},projectStrokeOnPoints:function(a,o,l){function c(t){var e=d/Math.hypot(t.x,t.y);return new V.Point(t.x*e*u.x,t.y*e*u.y)}var h=[],d=o.strokeWidth/2,u=o.strokeUniform?new V.Point(1/o.scaleX,1/o.scaleY):new V.Point(1,1);return a.length<=1||a.forEach(function(t,e){t=new V.Point(t.x,t.y);0===e?(r=a[e+1],s=l?c(V.util.createVector(r,t)).addEquals(t):a[a.length-1]):r=e===a.length-1?(s=a[e-1],l?c(V.util.createVector(s,t)).addEquals(t):a[0]):(s=a[e-1],a[e+1]);var i,n,e=V.util.getBisector(t,s,r),s=e.vector,r=e.angle;"miter"===o.strokeLineJoin&&(i=-d/Math.sin(r/2),n=new V.Point(s.x*i*u.x,s.y*i*u.y),Math.hypot(n.x,n.y)/d<=o.strokeMiterLimit)||(i=-d*Math.SQRT2,n=new V.Point(s.x*i*u.x,s.y*i*u.y)),h.push(t.add(n)),h.push(t.subtract(n))}),h},transformPoint:function(t,e,i){return i?new V.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new V.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t,e){if(e)for(var i=0;i<t.length;i++)t[i]=V.util.transformPoint(t[i],e);var n=[t[0].x,t[1].x,t[2].x,t[3].x],s=V.util.array.min(n),n=V.util.array.max(n)-s,r=[t[0].y,t[1].y,t[2].y,t[3].y],a=V.util.array.min(r);return{left:s,top:a,width:n,height:V.util.array.max(r)-a}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),e=[e*t[3],-e*t[1],-e*t[2],e*t[0]],t=V.util.transformPoint({x:t[4],y:t[5]},e,!0);return e[4]=-t.x,e[5]=-t.y,e},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),n=parseFloat(t);switch(e=e||V.Text.DEFAULT_SVG_FONT_SIZE,i[0]){case"mm":return n*V.DPI/25.4;case"cm":return n*V.DPI/2.54;case"in":return n*V.DPI;case"pt":return n*V.DPI/72;case"pc":return n*V.DPI/72*12;case"em":return n*e;default:return n}},falseFunction:function(){return!1},getKlass:function(t,e){return t=V.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),V.util.resolveNamespace(e)[t]},getSvgAttributes:function(t){var e=["instantiated_by_use","style","id","class"];switch(t){case"linearGradient":e=e.concat(["x1","y1","x2","y2","gradientUnits","gradientTransform"]);break;case"radialGradient":e=e.concat(["gradientUnits","gradientTransform","cx","cy","r","fx","fy","fr"]);break;case"stop":e=e.concat(["offset","stop-color","stop-opacity"])}return e},resolveNamespace:function(t){if(!t)return V;for(var e=t.split("."),i=e.length,n=F||V.window,s=0;s<i;++s)n=n[e[s]];return n},loadImage:function(t,e,i,n){var s,r;t?((s=V.util.createImage()).onload=r=function(){e&&e.call(i,s,!1),s=s.onload=s.onerror=null},s.onerror=function(){V.log("Error loading "+s.src),e&&e.call(i,null,!0),s=s.onload=s.onerror=null},0!==t.indexOf("data")&&null!=n&&(s.crossOrigin=n),"data:image/svg"===t.substring(0,14)&&(s.onload=null,V.util.loadImageInDom(s,r)),s.src=t):e&&e.call(i,t)},loadImageInDom:function(t,e){var i=V.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),V.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,s,r){var a=[],i=0,n=(t=t||[]).length;function o(){++i===n&&e&&e(a.filter(function(t){return t}))}n?t.forEach(function(i,n){i&&i.type?V.util.getKlass(i.type,s).fromObject(i,function(t,e){e||(a[n]=t),r&&r(i,t,e),o()}):o()}):e&&e(a)},enlivenObjectEnlivables:function(e,s,t){var r=V.Object.ENLIVEN_PROPS.filter(function(t){return!!e[t]});V.util.enlivenObjects(r.map(function(t){return e[t]}),function(i){var n={};r.forEach(function(t,e){n[t]=i[e],s&&(s[t]=i[e])}),t&&t(n)})},enlivenPatterns:function(t,e){function i(){++s===r&&e&&e(n)}var n=[],s=0,r=(t=t||[]).length;r?t.forEach(function(t,e){t&&t.source?new V.Pattern(t,function(t){n[e]=t,i()}):(n[e]=t,i())}):e&&e(n)},groupSVGElements:function(t,e,i){return t&&1===t.length?(void 0!==i&&(t[0].sourcePath=i),t[0]):(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),t=new V.Group(t,e),void 0!==i&&(t.sourcePath=i),t)},populateWithProperties:function(t,e,i){if(i&&Array.isArray(i))for(var n=0,s=i.length;n<s;n++)i[n]in t&&(e[i[n]]=t[i[n]])},createCanvasElement:function(){return V.document.createElement("canvas")},copyCanvasElement:function(t){var e=V.util.createCanvasElement();return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e},toDataURL:function(t,e,i){return t.toDataURL("image/"+e,i)},createImage:function(){return V.document.createElement("img")},multiplyTransformMatrices:function(t,e,i){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],i?0:t[0]*e[4]+t[2]*e[5]+t[4],i?0:t[1]*e[4]+t[3]*e[5]+t[5]]},qrDecompose:function(t){var e=r(t[1],t[0]),i=a(t[0],2)+a(t[1],2),n=j(i),s=(t[0]*t[3]-t[2]*t[1])/n,i=r(t[0]*t[2]+t[1]*t[3],i);return{angle:e/o,scaleX:n,scaleY:s,skewX:i/o,skewY:0,translateX:t[4],translateY:t[5]}},calcRotateMatrix:function(t){var e;return t.angle?(t=V.util.degreesToRadians(t.angle),[e=V.util.cos(t),t=V.util.sin(t),-t,e,0,0]):V.iMatrix.concat()},calcDimensionsMatrix:function(t){var e=void 0===t.scaleX?1:t.scaleX,i=void 0===t.scaleY?1:t.scaleY,e=[t.flipX?-e:e,0,0,t.flipY?-i:i,0,0],i=V.util.multiplyTransformMatrices,n=V.util.degreesToRadians;return t.skewX&&(e=i(e,[1,0,Math.tan(n(t.skewX)),1],!0)),e=t.skewY?i(e,[1,Math.tan(n(t.skewY)),0,1],!0):e},composeMatrix:function(t){var e=[1,0,0,1,t.translateX||0,t.translateY||0],i=V.util.multiplyTransformMatrices;return t.angle&&(e=i(e,V.util.calcRotateMatrix(t))),e=1!==t.scaleX||1!==t.scaleY||t.skewX||t.skewY||t.flipX||t.flipY?i(e,V.util.calcDimensionsMatrix(t)):e},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},saveObjectTransform:function(t){return{scaleX:t.scaleX,scaleY:t.scaleY,skewX:t.skewX,skewY:t.skewY,angle:t.angle,left:t.left,flipX:t.flipX,flipY:t.flipY,top:t.top}},isTransparent:function(t,e,i,n){0<n&&(n<e?e-=n:e=0,n<i?i-=n:i=0);for(var s=!0,r=t.getImageData(e,i,2*n||1,2*n||1),a=r.data.length,o=3;o<a&&0!=(s=r.data[o]<=0);o+=4);return r=null,s},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",t=t.split(" ");return t&&t.length&&("meet"!==(i=t.pop())&&"slice"!==i?(e=i,i="meet"):t.length&&(e=t.pop())),{meetOrSlice:i,alignX:"none"!==e?e.slice(1,4):"none",alignY:"none"!==e?e.slice(5,8):"none"}},clearFabricFontCache:function(t){(t=(t||"").toLowerCase())?V.charWidthsCache[t]&&delete V.charWidthsCache[t]:V.charWidthsCache={}},limitDimsByArea:function(t,e){t=Math.sqrt(e*t),e=Math.floor(e/t);return{x:Math.floor(t),y:e}},capValue:function(t,e,i){return Math.max(t,Math.min(e,i))},findScaleToFit:function(t,e){return Math.min(e.width/t.width,e.height/t.height)},findScaleToCover:function(t,e){return Math.max(e.width/t.width,e.height/t.height)},matrixToSVG:function(t){return"matrix("+t.map(function(t){return V.util.toFixed(t,V.Object.NUM_FRACTION_DIGITS)}).join(" ")+")"},removeTransformFromObject:function(t,e){e=V.util.invertTransform(e),e=V.util.multiplyTransformMatrices(e,t.calcOwnMatrix());V.util.applyTransformToObject(t,e)},addTransformToObject:function(t,e){V.util.applyTransformToObject(t,V.util.multiplyTransformMatrices(e,t.calcOwnMatrix()))},applyTransformToObject:function(t,e){var e=V.util.qrDecompose(e),i=new V.Point(e.translateX,e.translateY);t.flipX=!1,t.flipY=!1,t.set("scaleX",e.scaleX),t.set("scaleY",e.scaleY),t.skewX=e.skewX,t.skewY=e.skewY,t.angle=e.angle,t.setPositionByOrigin(i,"center","center")},sizeAfterTransform:function(t,e,i){t/=2,e/=2,t=[{x:-t,y:-e},{x:t,y:-e},{x:-t,y:e},{x:t,y:e}],e=V.util.calcDimensionsMatrix(i),i=V.util.makeBoundingBoxFromPoints(t,e);return{x:i.width,y:i.height}},mergeClipPaths:function(t,e){var i=t,n=e,e=(i.inverted&&!n.inverted&&(i=e,n=t),V.util.applyTransformToObject(n,V.util.multiplyTransformMatrices(V.util.invertTransform(i.calcTransformMatrix()),n.calcTransformMatrix())),i.inverted&&n.inverted);return e&&(i.inverted=n.inverted=!1),new V.Group([i],{clipPath:n,inverted:e})},hasStyleChanged:function(t,e,i){return i=i||!1,t.fill!==e.fill||t.stroke!==e.stroke||t.strokeWidth!==e.strokeWidth||t.fontSize!==e.fontSize||t.fontFamily!==e.fontFamily||t.fontWeight!==e.fontWeight||t.fontStyle!==e.fontStyle||t.textBackgroundColor!==e.textBackgroundColor||t.deltaY!==e.deltaY||i&&(t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough)},stylesToArray:function(t,e){t=V.util.object.clone(t,!0);for(var i=e.split("\n"),n=-1,s={},r=[],a=0;a<i.length;a++)if(t[a])for(var o=0;o<i[a].length;o++){n++;var l=t[a][o];l&&0<Object.keys(l).length&&(V.util.hasStyleChanged(s,l,!0)?r.push({start:n,end:n+1,style:l}):r[r.length-1].end++),s=l||{}}else n+=i[a].length;return r},stylesFromArray:function(t,e){if(!Array.isArray(t))return t;for(var i=e.split("\n"),n=-1,s=0,r={},a=0;a<i.length;a++)for(var o=0;o<i[a].length;o++)n++,t[s]&&t[s].start<=n&&n<t[s].end&&(r[a]=r[a]||{},r[a][o]=Object.assign({},t[s].style),n===t[s].end-1)&&s++;return r}},et=Array.prototype.join,it={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},nt={m:"l",M:"L"},V.util.joinPath=function(t){return t.map(function(t){return t.join(" ")}).join(" ")},V.util.parsePath=function(t){var e,i,n,s,r=[],a=[],o=V.rePathCommand,l="[-+]?(?:\\d*\\.\\d+|\\d+\\.?)(?:[eE][-+]?\\d+)?\\s*",c="("+l+")"+V.commaWsp,h="([01])"+V.commaWsp+"?",d=new RegExp(c+"?"+c+"?"+c+h+h+c+"?("+l+")","g");if(t&&t.match)for(var u=0,p=(s=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi)).length;u<p;u++){var f,g=(e=s[u]).slice(1).trim(),m=e.charAt(a.length=0),v=[m];if("a"===m.toLowerCase())for(;f=d.exec(g);)for(var b=1;b<f.length;b++)a.push(f[b]);else for(;n=o.exec(g);)a.push(n[0]);for(var b=0,y=a.length;b<y;b++)i=parseFloat(a[b]),isNaN(i)||v.push(i);var x=it[m.toLowerCase()],w=nt[m]||m;if(x<v.length-1)for(var C=1,S=v.length;C<S;C+=x)r.push([m].concat(v.slice(C,C+x))),m=w;else r.push(v)}return r},V.util.makePathSimpler=function(t){for(var e,i,n,s,r,a=0,o=0,l=t.length,c=0,h=0,d=[],u=0;u<l;++u){switch(i=!1,(e=t[u].slice(0))[0]){case"l":e[0]="L",e[1]+=a,e[2]+=o;case"L":a=e[1],o=e[2];break;case"h":e[1]+=a;case"H":e[0]="L",e[2]=o,a=e[1];break;case"v":e[1]+=o;case"V":e[0]="L",o=e[1],e[1]=a,e[2]=o;break;case"m":e[0]="M",e[1]+=a,e[2]+=o;case"M":a=e[1],o=e[2],c=e[1],h=e[2];break;case"c":e[0]="C",e[1]+=a,e[2]+=o,e[3]+=a,e[4]+=o,e[5]+=a,e[6]+=o;case"C":s=e[3],r=e[4],a=e[5],o=e[6];break;case"s":e[0]="S",e[1]+=a,e[2]+=o,e[3]+=a,e[4]+=o;case"S":r="C"===n?(s=2*a-s,2*o-r):(s=a,o),a=e[3],o=e[4],e[0]="C",e[5]=e[3],e[6]=e[4],e[3]=e[1],e[4]=e[2],e[1]=s,e[2]=r,s=e[3],r=e[4];break;case"q":e[0]="Q",e[1]+=a,e[2]+=o,e[3]+=a,e[4]+=o;case"Q":s=e[1],r=e[2],a=e[3],o=e[4];break;case"t":e[0]="T",e[1]+=a,e[2]+=o;case"T":r="Q"===n?(s=2*a-s,2*o-r):(s=a,o),e[0]="Q",a=e[1],o=e[2],e[1]=s,e[2]=r,e[3]=a,e[4]=o;break;case"a":e[0]="A",e[6]+=a,e[7]+=o;case"A":i=!0,d=d.concat(Mt(a,o,e)),a=e[6],o=e[7];break;case"z":case"Z":a=c,o=h}i||d.push(e),n=e[0]}return d},V.util.getSmoothPathFromPoints=function(t,e){var i,n,s=[],r=new V.Point(t[0].x,t[0].y),a=new V.Point(t[1].x,t[1].y),o=t.length,l=1,c=0,h=2<o;for(h&&(l=t[2].x<a.x?-1:t[2].x===a.x?0:1,c=t[2].y<a.y?-1:t[2].y===a.y?0:1),s.push(["M",r.x-l*(e=e||0),r.y-c*e]),i=1;i<o;i++)r.eq(a)||(n=r.midPointFrom(a),s.push(["Q",r.x,r.y,n.x,n.y])),r=t[i],i+1<t.length&&(a=t[i+1]);return h&&(l=r.x>t[i-2].x?1:r.x===t[i-2].x?0:-1,c=r.y>t[i-2].y?1:r.y===t[i-2].y?0:-1),s.push(["L",r.x+l*e,r.y+c*e]),s},V.util.getPathSegmentsInfo=_t,V.util.getBoundsOfCurve=function(t,e,i,n,s,r,a,o){var l;if(V.cachesBoundsOfCurve&&(l=et.call(arguments),V.boundsOfCurveCache[l]))return V.boundsOfCurveCache[l];for(var c,h,d,u=Math.sqrt,p=Math.min,f=Math.max,g=Math.abs,m=[],v=[[],[]],b=6*t-12*i+6*s,y=-3*t+9*i-9*s+3*a,x=3*i-3*t,w=0;w<2;++w)if(0<w&&(b=6*e-12*n+6*r,y=-3*e+9*n-9*r+3*o,x=3*n-3*e),g(y)<1e-12){if(g(b)<1e-12)continue;0<(c=-x/b)&&c<1&&m.push(c)}else(d=b*b-4*x*y)<0||(0<(h=(-b+(d=u(d)))/(2*y))&&h<1&&m.push(h),0<(h=(-b-d)/(2*y))&&h<1&&m.push(h));for(var C,S,E=m.length,T=E;E--;)C=(S=1-(c=m[E]))*S*S*t+3*S*S*c*i+3*S*c*c*s+c*c*c*a,v[0][E]=C,v[1][E]=S*S*S*e+3*S*S*c*n+3*S*c*c*r+c*c*c*o;v[0][T]=t,v[1][T]=e,v[0][T+1]=a,v[1][T+1]=o;T=[{x:p.apply(null,v[0]),y:p.apply(null,v[1])},{x:f.apply(null,v[0]),y:f.apply(null,v[1])}];return V.cachesBoundsOfCurve&&(V.boundsOfCurveCache[l]=T),T},V.util.getPointOnPath=function(t,e,i){i=i||_t(t);for(var n=0;0<e-i[n].length&&n<i.length-2;)e-=i[n].length,n++;var s=i[n],r=e/s.length,a=s.command,o=t[n];switch(a){case"M":return{x:s.x,y:s.y,angle:0};case"Z":case"z":return(v=new V.Point(s.x,s.y).lerp(new V.Point(s.destX,s.destY),r)).angle=Math.atan2(s.destY-s.y,s.destX-s.x),v;case"L":return(v=new V.Point(s.x,s.y).lerp(new V.Point(o[1],o[2]),r)).angle=Math.atan2(o[2]-s.y,o[1]-s.x),v;case"C":case"Q":for(var l,c,h,d=e,u=0,p=0,f=s.iterator,g={x:s.x,y:s.y},m=.01,v=s.angleFinder;p<d&&1e-4<m;)l=f(u),h=u,(c=L(g.x,g.y,l.x,l.y))+p>d?(u-=m,m/=2):(g=l,u+=m,p+=c);return l.angle=v(h),l}},V.util.transformPath=function(t,s,e){return e&&(s=V.util.multiplyTransformMatrices(s,[1,0,0,1,-e.x,-e.y])),t.map(function(t){for(var e=t.slice(0),i={},n=1;n<t.length-1;n+=2)i.x=t[n],i.y=t[n+1],i=V.util.transformPoint(i,s),e[n]=i.x,e[n+1]=i.y;return e})},tt=Array.prototype.slice,V.util.array={fill:function(t,e){for(var i=t.length;i--;)t[i]=e;return t},invoke:function(t,e){for(var i=tt.call(arguments,2),n=[],s=0,r=t.length;s<r;s++)n[s]=i.length?t[s][e].apply(t[s],i):t[s][e].call(t[s]);return n},min:function(t,e){return Ot(t,e,function(t,e){return t<e})},max:function(t,e){return Ot(t,e,function(t,e){return e<=t})}},V.util.object={extend:D,clone:function(t,e){return D({},t,e)}},V.util.object.extend(V.util,V.Observable),V.util.string={camelize:function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},capitalize:function(t,e){return t.charAt(0).toUpperCase()+(e?t.slice(1):t.slice(1).toLowerCase())},escapeXml:function(t){return t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},graphemeSplit:function(t){for(var e,i=0,n=[],i=0;i<t.length;i++)!1!==(e=function(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||57343<i)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";i=t.charCodeAt(e+1);if(i<56320||57343<i)throw"High surrogate without following low surrogate";return t.charAt(e)+t.charAt(e+1)}if(0===e)throw"Low surrogate without preceding high surrogate";if((i=t.charCodeAt(e-1))<55296||56319<i)throw"Low surrogate without preceding high surrogate";return!1}(t,i))&&n.push(e);return n}},K=Array.prototype.slice,$=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),V.util.createClass=function(){var t=null,e=K.call(arguments,0);function i(){this.initialize.apply(this,arguments)}"function"==typeof e[0]&&(t=e.shift()),i.superclass=t,i.subclasses=[],t&&(At.prototype=t.prototype,i.prototype=new At,t.subclasses.push(i));for(var n=0,s=e.length;n<s;n++)!function(t,n,s){for(var e in n)e in t.prototype&&"function"==typeof t.prototype[e]&&-1<(n[e]+"").indexOf("callSuper")?t.prototype[e]=function(i){return function(){var t=this.constructor.superclass,e=(this.constructor.superclass=s,n[i].apply(this,arguments));if(this.constructor.superclass=t,"initialize"!==i)return e}}(e):t.prototype[e]=n[e],$&&(n.toString!==Object.prototype.toString&&(t.prototype.toString=n.toString),n.valueOf!==Object.prototype.valueOf)&&(t.prototype.valueOf=n.valueOf)}(i,e[n],t);return i.prototype.initialize||(i.prototype.initialize=Tt),(i.prototype.constructor=i).prototype.callSuper=It,i},s=!!V.document.createElement("div").attachEvent,R=["touchstart","touchmove","touchend"],V.util.addListener=function(t,e,i,n){t&&t.addEventListener(e,i,!s&&n)},V.util.removeListener=function(t,e,i,n){t&&t.removeEventListener(e,i,!s&&n)},V.util.getPointer=function(t){var e=t.target,e=V.util.getScrollLeftTop(e),i=(i=t.changedTouches)&&i[0]?i[0]:t;return{x:i.clientX+e.left,y:i.clientY+e.top}},V.util.isTouchEvent=function(t){return-1<R.indexOf(t.type)||"touch"===t.pointerType},k="string"==typeof(t=V.document.createElement("div")).style.opacity,t="string"==typeof t.style.filter,l=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,c=function(t){return t},k?c=function(t,e){return t.style.opacity=e,t}:t&&(c=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),l.test(i.filter)?i.filter=i.filter.replace(l,e=.9999<=e?"":"alpha(opacity="+100*e+")"):i.filter+=" alpha(opacity="+100*e+")",t}),V.util.setStyle=function(t,e){var i,n=t.style;if(n){if("string"==typeof e)return t.style.cssText+=";"+e,-1<e.indexOf("opacity")?c(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var s in e)"opacity"===s?c(t,e[s]):(i="float"===s||"cssFloat"===s?void 0===n.styleFloat?"cssFloat":"styleFloat":s,n.setProperty(i,e[s]))}return t};var at,ot,O,lt=Array.prototype.slice,k=function(t){return lt.call(t,0)};try{at=k(V.document.childNodes)instanceof Array}catch(at){}function ct(t,e){var i,n=V.document.createElement(t);for(i in e)"class"===i?n.className=e[i]:"for"===i?n.htmlFor=e[i]:n.setAttribute(i,e[i]);return n}function ht(t){for(var e=0,i=0,n=V.document.documentElement,s=V.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===V.document?(e=s.scrollLeft||n.scrollLeft||0,i=s.scrollTop||n.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}at||(k=function(t){for(var e=new Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),ot=V.document.defaultView&&V.document.defaultView.getComputedStyle?function(t,e){t=V.document.defaultView.getComputedStyle(t,null);return t?t[e]:void 0}:function(t,e){var i=t.style[e];return i=!i&&t.currentStyle?t.currentStyle[e]:i},t=V.document.documentElement.style,O="userSelect"in t?"userSelect":"MozUserSelect"in t?"MozUserSelect":"WebkitUserSelect"in t?"WebkitUserSelect":"KhtmlUserSelect"in t?"KhtmlUserSelect":"",V.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=V.util.falseFunction),O?t.style[O]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},V.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),O?t.style[O]="":"string"==typeof t.unselectable&&(t.unselectable=""),t},V.util.setImageSmoothing=function(t,e){t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=e},V.util.getById=function(t){return"string"==typeof t?V.document.getElementById(t):t},V.util.toArray=k,V.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},V.util.makeElement=ct,V.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=ct(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},V.util.getScrollLeftTop=ht,V.util.getElementOffset=function(t){var e,i,n=t&&t.ownerDocument,s={left:0,top:0},r={left:0,top:0},a={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!n)return r;for(i in a)r[a[i]]+=parseInt(ot(t,i),10)||0;return n=n.documentElement,void 0!==t.getBoundingClientRect&&(s=t.getBoundingClientRect()),e=ht(t),{left:s.left+e.left-(n.clientLeft||0)+r.left,top:s.top+e.top-(n.clientTop||0)+r.top}},V.util.getNodeCanvas=function(t){t=V.jsdomImplForWrapper(t);return t._canvas||t._image},V.util.cleanUpJsdomNode=function(t){V.isLikelyNode&&(t=V.jsdomImplForWrapper(t))&&(t._image=null,t._canvas=null,t._currentSrc=null,t._attributes=null,t._classList=null)},V.util.request=function(t,e){var i,n=(e=e||{}).method?e.method.toUpperCase():"GET",s=e.onComplete||function(){},r=new V.window.XMLHttpRequest,a=e.body||e.parameters;return r.onreadystatechange=function(){4===r.readyState&&(s(r),r.onreadystatechange=Et)},"GET"===n&&(a=null,"string"==typeof e.parameters)&&(i=t,e=e.parameters,t=i+(/\?/.test(i)?"&":"?")+e),r.open(n,t,!0),"POST"!==n&&"PUT"!==n||r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.send(a),r},V.log=console.log,V.warn=console.warn,X=V.util.object.extend,Z=V.util.object.clone,t=[],V.util.object.extend(t,{cancelAll:function(){var t=this.splice(0);return t.forEach(function(t){t.cancel()}),t},cancelByCanvas:function(e){var t;return e?((t=this.filter(function(t){return"object"==typeof t.target&&t.target.canvas===e})).forEach(function(t){t.cancel()}),t):[]},cancelByTarget:function(t){t=this.findAnimationsByTarget(t);return t.forEach(function(t){t.cancel()}),t},findAnimationIndex:function(t){return this.indexOf(this.findAnimation(t))},findAnimation:function(e){return this.find(function(t){return t.cancel===e})},findAnimationsByTarget:function(e){return e?this.filter(function(t){return t.target===e}):[]}}),J=V.window.requestAnimationFrame||V.window.webkitRequestAnimationFrame||V.window.mozRequestAnimationFrame||V.window.oRequestAnimationFrame||V.window.msRequestAnimationFrame||function(t){return V.window.setTimeout(t,1e3/60)},Q=V.window.cancelAnimationFrame||V.window.clearTimeout,V.util.animate=function(e){function v(){var t=V.runningAnimations.indexOf(y);return-1<t&&V.runningAnimations.splice(t,1)[0]}var b=!1,y=X(Z(e=e||{}),{cancel:function(){return b=!0,v()},currentValue:"startValue"in e?e.startValue:0,completionRate:0,durationRate:0});return V.runningAnimations.push(y),St(function(t){var r,a=t||+new Date,o=e.duration||500,l=a+o,c=e.onChange||wt,h=e.abort||wt,d=e.onComplete||wt,u=e.easing||Ct,p="startValue"in e&&0<e.startValue.length,f="startValue"in e?e.startValue:0,g="endValue"in e?e.endValue:100,m=e.byValue||(p?f.map(function(t,e){return g[e]-f[e]}):g-f);e.onStart&&e.onStart(),function t(e){var i=(r=e||+new Date)>l?o:r-a,e=i/o,n=p?f.map(function(t,e){return u(i,f[e],m[e],o)}):u(i,f,m,o),s=p?Math.abs((n[0]-f[0])/m[0]):Math.abs((n-f)/m);if(y.currentValue=p?n.slice():n,y.completionRate=s,y.durationRate=e,!b){if(!h(n,s,e))return l<r?(y.currentValue=p?g.slice():g,y.completionRate=1,y.durationRate=1,c(p?g.slice():g,1,1),d(g,1,1),void v()):(c(n,s,e),void St(t));v()}}(a)}),y.cancel},V.util.requestAnimFrame=St,V.util.cancelAnimFrame=function(){return Q.apply(V.window,arguments)},V.runningAnimations=t,V.util.animateColor=function(t,e,i,s){var t=new V.Color(t).getSource(),n=new V.Color(e).getSource(),r=s.onComplete,a=s.onChange;return s=s||{},V.util.animate(V.util.object.extend(s,{duration:i||500,startValue:t,endValue:n,byValue:n,easing:function(t,e,i,n){return xt(e,i,s.colorEasing?s.colorEasing(t,n):1-Math.cos(t/n*(Math.PI/2)))},onComplete:function(t,e,i){if(r)return r(xt(n,n,0),e,i)},onChange:function(t,e,i){if(a){if(Array.isArray(t))return a(xt(t,t,0),e,i);a(t,e,i)}}}))},V.util.ease={easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:function(t,e,i,n){return i*((t=t/n-1)*t*t+1)+e},easeInOutCubic:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,i,n){return-i*((t=t/n-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,i,n){return i*((t=t/n-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,i,n){return 0===t?e:i*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,i,n){return t===n?e+i:i*(1-Math.pow(2,-10*t/n))+e},easeInOutExpo:function(t,e,i,n){return 0===t?e:t===n?e+i:(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,i,n){return-i*(Math.sqrt(1-(t/=n)*t)-1)+e},easeOutCirc:function(t,e,i,n){return i*Math.sqrt(1-(t=t/n-1)*t)+e},easeInOutCirc:function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,i,n){var s=0;return 0===t?e:1==(t/=n)?e+i:-vt(mt(i,i,s=s||.3*n,1.70158),t,n)+e},easeOutElastic:function(t,e,i,n){var s=0;return 0===t?e:1==(t/=n)?e+i:(i=mt(i,i,s=s||.3*n,1.70158)).a*Math.pow(2,-10*t)*Math.sin((t*n-i.s)*(2*Math.PI)/i.p)+i.c+e},easeInOutElastic:function(t,e,i,n){var s=0;return 0===t?e:2==(t/=n/2)?e+i:(i=mt(i,i,s=s||n*(.3*1.5),1.70158),t<1?-.5*vt(i,t,n)+e:i.a*Math.pow(2,-10*--t)*Math.sin((t*n-i.s)*(2*Math.PI)/i.p)*.5+i.c+e)},easeInBack:function(t,e,i,n,s){return i*(t/=n)*t*(((s=void 0===s?1.70158:s)+1)*t-s)+e},easeOutBack:function(t,e,i,n,s){return i*((t=t/n-1)*t*(((s=void 0===s?1.70158:s)+1)*t+s)+1)+e},easeInOutBack:function(t,e,i,n,s){return void 0===s&&(s=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(s*=1.525))*t-s))+e:i/2*((t-=2)*t*((1+(s*=1.525))*t+s)+2)+e},easeInBounce:bt,easeOutBounce:yt,easeInOutBounce:function(t,e,i,n){return t<n/2?.5*bt(2*t,0,i,n)+e:.5*yt(2*t-n,0,i,n)+.5*i+e}},function(t){"use strict";var d,e,u,i,n,y=t.fabric||(t.fabric={}),f=y.util.object.extend,p=y.util.object.clone,g=y.util.toFixed,x=y.util.parseUnit,m=y.util.multiplyTransformMatrices,v={cx:"left",x:"left",r:"radius",cy:"top",y:"top",display:"visible",visibility:"visible",transform:"transformMatrix","fill-opacity":"fillOpacity","fill-rule":"fillRule","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","letter-spacing":"charSpacing","paint-order":"paintFirst","stroke-dasharray":"strokeDashArray","stroke-dashoffset":"strokeDashOffset","stroke-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity","clip-path":"clipPath","clip-rule":"clipRule","vector-effect":"strokeUniform","image-rendering":"imageSmoothing"},b={stroke:"strokeOpacity",fill:"fillOpacity"},w="font-size",C="clip-path";function s(t){return new RegExp("^("+t.join("|")+")\\b","i")}function S(t,e){for(var i,n=[],s=0,r=e.length;s<r;s++)i=e[s],i=t.getElementsByTagName(i),n=n.concat(Array.prototype.slice.call(i));return n}function E(t,e){var i,n=t.nodeName,s=t.getAttribute("class"),t=t.getAttribute("id"),r=new RegExp("^"+n,"i");if(e=e.replace(r,""),t&&e.length&&(r=new RegExp("#"+t+"(?![a-zA-Z\\-]+)","i"),e=e.replace(r,"")),s&&e.length)for(i=(s=s.split(" ")).length;i--;)r=new RegExp("\\."+s[i]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(r,"");return 0===e.length}function T(t,e){var i;if(i=t.getElementById?t.getElementById(e):i)return i;for(var n,s=t.getElementsByTagName("*"),r=0,a=s.length;r<a;r++)if(e===(n=s[r]).getAttribute("id"))return n}function A(t,e,i){t[i]=Math.tan(y.util.degreesToRadians(e[0]))}y.svgValidTagNamesRegEx=s(["path","circle","polygon","polyline","ellipse","rect","line","image","text"]),y.svgViewBoxElementsRegEx=s(["symbol","image","marker","pattern","view","svg"]),y.svgInvalidAncestorsRegEx=s(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),y.svgValidParentsRegEx=s(["symbol","g","a","svg","clipPath","defs"]),y.cssRules={},y.gradientDefs={},y.clipPaths={},y.parseTransformAttribute=(d=y.iMatrix,t=y.reNum,e=y.commaWsp,u="(?:(?:(matrix)\\s*\\(\\s*("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")"+e+"("+t+")\\s*\\))|(?:(translate)\\s*\\(\\s*("+t+")(?:"+e+"("+t+"))?\\s*\\))|(?:(scale)\\s*\\(\\s*("+t+")(?:"+e+"("+t+"))?\\s*\\))|(?:(rotate)\\s*\\(\\s*("+t+")(?:"+e+"("+t+")"+e+"("+t+"))?\\s*\\))|(?:(skewX)\\s*\\(\\s*("+t+")\\s*\\))|(?:(skewY)\\s*\\(\\s*("+t+")\\s*\\)))",i=new RegExp("^\\s*(?:(?:"+u+"(?:"+e+"*"+u+")*)?)\\s*$"),n=new RegExp(u,"g"),function(t){var c=d.concat(),h=[];if(!t||!i.test(t))return c;t.replace(n,function(t){var e,i,n,s,r,a,t=new RegExp(u).exec(t).filter(function(t){return!!t}),o=t[1],l=t.slice(2).map(parseFloat);switch(o){case"translate":a=l,(r=c)[4]=a[0],2===a.length&&(r[5]=a[1]);break;case"rotate":l[0]=y.util.degreesToRadians(l[0]),r=c,a=l,e=y.util.cos(a[0]),i=y.util.sin(a[0]),s=n=0,3===a.length&&(n=a[1],s=a[2]),r[0]=e,r[1]=i,r[2]=-i,r[3]=e,r[4]=n-(e*n-i*s),r[5]=s-(i*n+e*s);break;case"scale":i=c,n=l[0],e=2===l.length?l[1]:l[0],i[0]=n,i[3]=e;break;case"skewX":A(c,l,2);break;case"skewY":A(c,l,1);break;case"matrix":c=l}h.push(c.concat()),c=d.concat()});for(var e=h[0];1<h.length;)h.shift(),e=y.util.multiplyTransformMatrices(e,h[0]);return e});var I=new RegExp("^\\s*("+y.reNum+"+)\\s*,?\\s*("+y.reNum+"+)\\s*,?\\s*("+y.reNum+"+)\\s*,?\\s*("+y.reNum+"+)\\s*$");function O(t){if(!y.svgViewBoxElementsRegEx.test(t.nodeName))return{};var e,i,n,s=t.getAttribute("viewBox"),r=1,a=1,o=t.getAttribute("width"),l=t.getAttribute("height"),c=t.getAttribute("x")||0,h=t.getAttribute("y")||0,d=t.getAttribute("preserveAspectRatio")||"",u=!s||!(s=s.match(I)),p=!o||!l||"100%"===o||"100%"===l,f=u&&p,g={},m="",v=0,b=0;if(g.width=0,g.height=0,g.toBeParsed=f,u&&(c||h)&&t.parentNode&&"#document"!==t.parentNode.nodeName&&(m=" translate("+x(c)+" "+x(h)+") ",i=(t.getAttribute("transform")||"")+m,t.setAttribute("transform",i),t.removeAttribute("x"),t.removeAttribute("y")),!f)if(u)g.width=x(o),g.height=x(l);else if(f=-parseFloat(s[1]),u=-parseFloat(s[2]),e=parseFloat(s[3]),s=parseFloat(s[4]),g.minX=f,g.minY=u,g.viewBoxWidth=e,g.viewBoxHeight=s,p?(g.width=e,g.height=s):(g.width=x(o),g.height=x(l),r=g.width/e,a=g.height/s),"none"!==(d=y.util.parsePreserveAspectRatioAttribute(d)).alignX&&("meet"===d.meetOrSlice&&(a=r=a<r?a:r),"slice"===d.meetOrSlice&&(a=r=a<r?r:a),v=g.width-e*r,b=g.height-s*r,"Mid"===d.alignX&&(v/=2),"Mid"===d.alignY&&(b/=2),"Min"===d.alignX&&(v=0),"Min"===d.alignY)&&(b=0),1!==r||1!==a||0!=f||0!=u||0!==c||0!==h){if(i=(m=(c||h)&&"#document"!==t.parentNode.nodeName?" translate("+x(c)+" "+x(h)+") ":m)+" matrix("+r+" 0 0 "+a+" "+(f*r+v)+" "+(u*a+b)+") ","svg"===t.nodeName){for(n=t.ownerDocument.createElementNS(y.svgNS,"g");t.firstChild;)n.appendChild(t.firstChild);t.appendChild(n)}else(n=t).removeAttribute("x"),n.removeAttribute("y"),i=n.getAttribute("transform")+i;n.setAttribute("transform",i)}return g}y.parseSVGDocument=function(t,i,e,n){if(t){!function(t){for(var e=S(t,["use","svg:use"]),i=0;e.length&&i<e.length;){var n=e[i],s=n.getAttribute("xlink:href")||n.getAttribute("href");if(null===s)return;var r,a,s=s.slice(1),o=n.getAttribute("x")||0,l=n.getAttribute("y")||0,c=T(t,s).cloneNode(!0),h=(c.getAttribute("transform")||"")+" translate("+o+", "+l+")",s=e.length,d=y.svgNS;if(O(c),/^svg$/i.test(c.nodeName)){for(var u=c.ownerDocument.createElementNS(d,"g"),p=0,f=(a=c.attributes).length;p<f;p++)r=a.item(p),u.setAttributeNS(d,r.nodeName,r.nodeValue);for(;c.firstChild;)u.appendChild(c.firstChild);c=u}for(p=0,f=(a=n.attributes).length;p<f;p++)"x"!==(r=a.item(p)).nodeName&&"y"!==r.nodeName&&"xlink:href"!==r.nodeName&&"href"!==r.nodeName&&("transform"===r.nodeName?h=r.nodeValue+" "+h:c.setAttribute(r.nodeName,r.nodeValue));c.setAttribute("transform",h),c.setAttribute("instantiated_by_use","1"),c.removeAttribute("id"),n.parentNode.replaceChild(c,n),e.length===s&&i++}}(t);var s=y.Object.__uid++,r=O(t),a=y.util.toArray(t.getElementsByTagName("*"));if(r.crossOrigin=n&&n.crossOrigin,r.svgUid=s,0===a.length&&y.isLikelyNode){for(var o=[],l=0,c=(a=t.selectNodes('//*[name(.)!="svg"]')).length;l<c;l++)o[l]=a[l];a=o}var h,d=a.filter(function(t){return O(t),y.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))&&!function(t,e){for(;t=t&&t.parentNode;)if(t.nodeName&&e.test(t.nodeName.replace("svg:",""))&&!t.getAttribute("instantiated_by_use"))return 1}(t,y.svgInvalidAncestorsRegEx)});d&&d.length?(h={},a.filter(function(t){return"clipPath"===t.nodeName.replace("svg:","")}).forEach(function(t){var e=t.getAttribute("id");h[e]=y.util.toArray(t.getElementsByTagName("*")).filter(function(t){return y.svgValidTagNamesRegEx.test(t.nodeName.replace("svg:",""))})}),y.gradientDefs[s]=y.getGradientDefs(t),y.cssRules[s]=y.getCSSRules(t),y.clipPaths[s]=h,y.parseElements(d,function(t,e){i&&(i(t,r,e,a),delete y.gradientDefs[s],delete y.cssRules[s],delete y.clipPaths[s])},p(r),e,n)):i&&i([],{})}};var a=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+y.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+y.reNum+"))?\\s+(.*)");f(y,{parseFontDeclaration:function(t,e){var i,n,s,r,t=t.match(a);t&&(i=t[1],n=t[3],s=t[4],r=t[5],t=t[6],i&&(e.fontStyle=i),n&&(e.fontWeight=isNaN(parseFloat(n))?n:parseFloat(n)),s&&(e.fontSize=x(s)),t&&(e.fontFamily=t),r)&&(e.lineHeight="normal"===r?1:r)},getGradientDefs:function(t){for(var e,i=S(t,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),n=0,s={},n=i.length;n--;)(e=i[n]).getAttribute("xlink:href")&&function t(e,i){var n="xlink:href",s=T(e,i.getAttribute(n).slice(1));if(s&&s.getAttribute(n)&&t(e,s),["gradientTransform","x1","x2","y1","y2","gradientUnits","cx","cy","r","fx","fy"].forEach(function(t){s&&!i.hasAttribute(t)&&s.hasAttribute(t)&&i.setAttribute(t,s.getAttribute(t))}),!i.children.length)for(var r=s.cloneNode(!0);r.firstChild;)i.appendChild(r.firstChild);i.removeAttribute(n)}(t,e),s[e.getAttribute("id")]=e;return s},parseAttributes:function(i,t,e){if(i){var n,s,r={},a=(void 0===e&&(e=i.getAttribute("svgUid")),i.parentNode&&y.svgValidParentsRegEx.test(i.parentNode.nodeName)&&(r=y.parseAttributes(i.parentNode,t,e)),t.reduce(function(t,e){return(n=i.getAttribute(e))&&(t[e]=n),t},{})),t=f(function(t,e){var i,n,s,r,a,o={};for(i in y.cssRules[e])if(n=t,s=i.split(" "),r=void 0,void 0,a=!0,(r=E(n,s.pop()))&&s.length&&(a=function(t,e){for(var i,n=!0;t.parentNode&&1===t.parentNode.nodeType&&e.length;)n&&(i=e.pop()),n=E(t=t.parentNode,i);return 0===e.length}(n,s)),r&&a&&0===s.length)for(var l in y.cssRules[e][i])o[l]=y.cssRules[e][i][l];return o}(i,e),y.parseStyleAttribute(i)),a=f(a,t);t[C]&&i.setAttribute(C,t[C]),s=e=r.fontSize||y.Text.DEFAULT_SVG_FONT_SIZE,a[w]&&(a[w]=s=x(a[w],e));var o,l,c={};for(l in a)o=function(t,e,i,n){var s,r=Array.isArray(e);if("fill"!==t&&"stroke"!==t||"none"!==e){if("strokeUniform"===t)return"non-scaling-stroke"===e;if("strokeDashArray"===t)e="none"===e?null:e.replace(/,/g," ").split(/\s+/).map(parseFloat);else if("transformMatrix"===t)e=i&&i.transformMatrix?m(i.transformMatrix,y.parseTransformAttribute(e)):y.parseTransformAttribute(e);else if("visible"===t)e="none"!==e&&"hidden"!==e,i&&!1===i.visible&&(e=!1);else if("opacity"===t)e=parseFloat(e),i&&void 0!==i.opacity&&(e*=i.opacity);else if("textAnchor"===t)e="start"===e?"left":"end"===e?"right":"center";else if("charSpacing"===t)s=x(e,n)/n*1e3;else if("paintFirst"===t){var i=e.indexOf("fill"),a=e.indexOf("stroke");e=-1<i&&-1<a&&a<i||-1===i&&-1<a?"stroke":"fill"}else{if("href"===t||"xlink:href"===t||"font"===t)return e;if("imageSmoothing"===t)return"optimizeQuality"===e;s=r?e.map(x):x(e,n)}}else e="";return!r&&isNaN(s)?e:s}((p=l,p=p in v?v[p]:p),a[l],r,s),c[p]=o;c&&c.font&&y.parseFontDeclaration(c.font,c);var h,t=f(r,c);if(y.svgValidParentsRegEx.test(i.nodeName))return t;var d,u=t;for(d in b)if(void 0!==u[b[d]]&&""!==u[d]){if(void 0===u[d]){if(!y.Object.prototype[d])continue;u[d]=y.Object.prototype[d]}0!==u[d].indexOf("url(")&&(h=new y.Color(u[d]),u[d]=h.setAlpha(g(h.getAlpha()*u[b[d]],2)).toRgba())}return u}var p},parseElements:function(t,e,i,n,s){new y.ElementsParser(t,e,i,n,s).parse()},parseStyleAttribute:function(t){var e,i,n,s,r,a,o={},t=t.getAttribute("style");if(t)if("string"==typeof t)s=o,t.replace(/;\s*$/,"").split(";").forEach(function(t){t=t.split(":");r=t[0].trim().toLowerCase(),a=t[1].trim(),s[r]=a});else{var l=t,c=o;for(n in l)void 0!==l[n]&&(e=n.toLowerCase(),i=l[n],c[e]=i)}return o},parsePointsAttribute:function(t){if(!t)return null;for(var e=[],i=0,n=(t=(t=t.replace(/,/g," ").trim()).split(/\s+/)).length;i<n;i+=2)e.push({x:parseFloat(t[i]),y:parseFloat(t[i+1])});return e},getCSSRules:function(t){for(var e=t.getElementsByTagName("style"),a={},o=0,l=e.length;o<l;o++){var i=e[o].textContent;""!==(i=i.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&i.split("}").filter(function(t){return t.trim()}).forEach(function(t){var e=t.split("{"),i={},n=e[1].trim().split(";").filter(function(t){return t.trim()});for(o=0,l=n.length;o<l;o++){var s=n[o].split(":"),r=s[0].trim(),s=s[1].trim();i[r]=s}(t=e[0].trim()).split(",").forEach(function(t){""!==(t=t.replace(/^svg/i,"").trim())&&(a[t]?y.util.object.extend(a[t],i):a[t]=y.util.object.clone(i))})})}return a},loadSVGFromURL:function(t,s,e,i){t=t.replace(/^\n\s*/,"").trim(),new y.util.request(t,{method:"get",onComplete:function(t){t=t.responseXML;if(!t||!t.documentElement)return s&&s(null),!1;y.parseSVGDocument(t.documentElement,function(t,e,i,n){s&&s(t,e,i,n)},e,i)}})},loadSVGFromString:function(t,s,e,i){t=(new y.window.DOMParser).parseFromString(t.trim(),"text/xml");y.parseSVGDocument(t.documentElement,function(t,e,i,n){s(t,e,i,n)},e,i)}})}(i),V.ElementsParser=function(t,e,i,n,s,r){this.elements=t,this.callback=e,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=s,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g,this.doc=r},(t=V.ElementsParser.prototype).parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},t.createObjects=function(){var i=this;this.elements.forEach(function(t,e){t.setAttribute("svgUid",i.svgUid),i.createObject(t,e)})},t.findTag=function(t){return V[V.util.string.capitalize(t.tagName.replace("svg:",""))]},t.createObject=function(t,e){var i=this.findTag(t);if(i&&i.fromElement)try{i.fromElement(t,this.createCallback(e,t),this.options)}catch(t){V.log(t)}else this.checkIfDone()},t.createCallback=function(i,n){var s=this;return function(t){var e;s.resolveGradient(t,n,"fill"),s.resolveGradient(t,n,"stroke"),t instanceof V.Image&&t._originalElement&&(e=t.parsePreserveAspectRatioAttribute(n)),t._removeTransformMatrix(e),s.resolveClipPath(t,n),s.reviver&&s.reviver(n,t),s.instances[i]=t,s.checkIfDone()}},t.extractPropertyDefinition=function(t,e,i){var t=t[e],e=this.regexUrl;if(e.test(t))return e.lastIndex=0,t=e.exec(t)[1],e.lastIndex=0,V[i][this.svgUid][t]},t.resolveGradient=function(t,e,i){var n=this.extractPropertyDefinition(t,i,"gradientDefs");n&&(e=e.getAttribute(i+"-opacity"),n=V.Gradient.fromElement(n,t,e,this.options),t.set(i,n))},t.createClipPathCallback=function(t,e){return function(t){t._removeTransformMatrix(),t.fillRule=t.clipRule,e.push(t)}},t.resolveClipPath=function(t,e){var i,n=this.extractPropertyDefinition(t,"clipPath","clipPaths");if(n){for(var s=[],r=V.util.invertTransform(t.calcTransformMatrix()),a=n[0].parentNode,o=e;o.parentNode&&o.getAttribute("clip-path")!==t.clipPath;)o=o.parentNode;o.parentNode.appendChild(a);for(var l=0;l<n.length;l++)i=n[l],this.findTag(i).fromElement(i,this.createClipPathCallback(t,s),this.options);n=1===s.length?s[0]:new V.Group(s),e=V.util.multiplyTransformMatrices(r,n.calcTransformMatrix()),n.clipPath&&this.resolveClipPath(n,o);a=V.util.qrDecompose(e);n.flipX=!1,n.flipY=!1,n.set("scaleX",a.scaleX),n.set("scaleY",a.scaleY),n.angle=a.angle,n.skewX=a.skewX,n.skewY=0,n.setPositionByOrigin({x:a.translateX,y:a.translateY},"center","center"),t.clipPath=n}else delete t.clipPath},t.checkIfDone=function(){0==--this.numElements&&(this.instances=this.instances.filter(function(t){return null!=t}),this.callback(this.instances,this.elements))},function(t){"use strict";t=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}t.Point?t.warn("fabric.Point is already defined"):(t.Point=i).prototype={type:"point",constructor:i,add:function(t){return new i(this.x+t.x,this.y+t.y)},addEquals:function(t){return this.x+=t.x,this.y+=t.y,this},scalarAdd:function(t){return new i(this.x+t,this.y+t)},scalarAddEquals:function(t){return this.x+=t,this.y+=t,this},subtract:function(t){return new i(this.x-t.x,this.y-t.y)},subtractEquals:function(t){return this.x-=t.x,this.y-=t.y,this},scalarSubtract:function(t){return new i(this.x-t,this.y-t)},scalarSubtractEquals:function(t){return this.x-=t,this.y-=t,this},multiply:function(t){return new i(this.x*t,this.y*t)},multiplyEquals:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return new i(this.x/t,this.y/t)},divideEquals:function(t){return this.x/=t,this.y/=t,this},eq:function(t){return this.x===t.x&&this.y===t.y},lt:function(t){return this.x<t.x&&this.y<t.y},lte:function(t){return this.x<=t.x&&this.y<=t.y},gt:function(t){return this.x>t.x&&this.y>t.y},gte:function(t){return this.x>=t.x&&this.y>=t.y},lerp:function(t,e){return void 0===e&&(e=.5),e=Math.max(Math.min(1,e),0),new i(this.x+(t.x-this.x)*e,this.y+(t.y-this.y)*e)},distanceFrom:function(t){var e=this.x-t.x,t=this.y-t.y;return Math.sqrt(e*e+t*t)},midPointFrom:function(t){return this.lerp(t)},min:function(t){return new i(Math.min(this.x,t.x),Math.min(this.y,t.y))},max:function(t){return new i(Math.max(this.x,t.x),Math.max(this.y,t.y))},toString:function(){return this.x+","+this.y},setXY:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setFromPoint:function(t){return this.x=t.x,this.y=t.y,this},swap:function(t){var e=this.x,i=this.y;this.x=t.x,this.y=t.y,t.x=e,t.y=i},clone:function(){return new i(this.x,this.y)}}}(i),function(t){"use strict";var o=t.fabric||(t.fabric={});function l(t){this.status=t,this.points=[]}o.Intersection?o.warn("fabric.Intersection is already defined"):(o.Intersection=l,o.Intersection.prototype={constructor:l,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},o.Intersection.intersectLineLine=function(t,e,i,n){var s,r=(n.x-i.x)*(t.y-i.y)-(n.y-i.y)*(t.x-i.x),a=(e.x-t.x)*(t.y-i.y)-(e.y-t.y)*(t.x-i.x),n=(n.y-i.y)*(e.x-t.x)-(n.x-i.x)*(e.y-t.y);return 0!=n?(i=a/n,0<=(n=r/n)&&n<=1&&0<=i&&i<=1?(s=new l("Intersection")).appendPoint(new o.Point(t.x+n*(e.x-t.x),t.y+n*(e.y-t.y))):s=new l):s=new l(0==r||0==a?"Coincident":"Parallel"),s},o.Intersection.intersectLinePolygon=function(t,e,i){for(var n,s,r=new l,a=i.length,o=0;o<a;o++)s=i[o],n=i[(o+1)%a],s=l.intersectLineLine(t,e,s,n),r.appendPoints(s.points);return 0<r.points.length&&(r.status="Intersection"),r},o.Intersection.intersectPolygonPolygon=function(t,e){for(var i=new l,n=t.length,s=0;s<n;s++){var r=t[s],a=t[(s+1)%n],r=l.intersectLinePolygon(r,a,e);i.appendPoints(r.points)}return 0<i.points.length&&(i.status="Intersection"),i},o.Intersection.intersectPolygonRectangle=function(t,e,i){var n=e.min(i),e=e.max(i),i=new o.Point(e.x,n.y),s=new o.Point(n.x,e.y),r=l.intersectLinePolygon(n,i,t),i=l.intersectLinePolygon(i,e,t),e=l.intersectLinePolygon(e,s,t),s=l.intersectLinePolygon(s,n,t),n=new l;return n.appendPoints(r.points),n.appendPoints(i.points),n.appendPoints(e.points),n.appendPoints(s.points),0<n.points.length&&(n.status="Intersection"),n})}(i),function(t){"use strict";var c=t.fabric||(t.fabric={});function o(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function l(t,e,i){return i<0&&(i+=1),1<i&&--i,i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}c.Color?c.warn("fabric.Color is already defined."):(c.Color=o,c.Color.prototype={_tryParsingColor:function(t){var e;(e=(e=(e=(e=(e="transparent"===(t=t in o.colorNameMap?o.colorNameMap[t]:t)?[255,255,255,0]:e)||o.sourceFromHex(t))||o.sourceFromRgb(t))||o.sourceFromHsl(t))||[0,0,0,1])&&this.setSource(e)},_rgbToHsl:function(t,e,i){var n,s=c.util.array.max([t/=255,e/=255,i/=255]),r=c.util.array.min([t,e,i]),a=(s+r)/2;if(s===r)n=l=0;else{var o=s-r,l=.5<a?o/(2-s-r):o/(s+r);switch(s){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}return[Math.round(360*n),Math.round(100*l),Math.round(100*a)]},getSource:function(){return this._source},setSource:function(t){this._source=t},toRgb:function(){var t=this.getSource();return"rgb("+t[0]+","+t[1]+","+t[2]+")"},toRgba:function(){var t=this.getSource();return"rgba("+t[0]+","+t[1]+","+t[2]+","+t[3]+")"},toHsl:function(){var t=this.getSource(),t=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+t[0]+","+t[1]+"%,"+t[2]+"%)"},toHsla:function(){var t=this.getSource(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsla("+e[0]+","+e[1]+"%,"+e[2]+"%,"+t[3]+")"},toHex:function(){var t=this.getSource(),e=1===(e=t[0].toString(16)).length?"0"+e:e,i=1===(i=t[1].toString(16)).length?"0"+i:i,t=1===(t=t[2].toString(16)).length?"0"+t:t;return e.toUpperCase()+i.toUpperCase()+t.toUpperCase()},toHexa:function(){var t=this.getSource(),t=1===(t=(t=Math.round(255*t[3])).toString(16)).length?"0"+t:t;return this.toHex()+t.toUpperCase()},getAlpha:function(){return this.getSource()[3]},setAlpha:function(t){var e=this.getSource();return e[3]=t,this.setSource(e),this},toGrayscale:function(){var t=this.getSource(),e=parseInt((.3*t[0]+.59*t[1]+.11*t[2]).toFixed(0),10),t=t[3];return this.setSource([e,e,e,t]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),e=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,e]),this},overlayWith:function(t){t instanceof o||(t=new o(t));for(var e=[],i=this.getAlpha(),n=this.getSource(),s=t.getSource(),r=0;r<3;r++)e.push(Math.round(.5*n[r]+.5*s[r]));return e[3]=i,this.setSource(e),this}},c.Color.reRGBa=/^rgba?\(\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*,\s*(\d{1,3}(?:\.\d+)?\%?)\s*(?:\s*,\s*((?:\d*\.?\d+)?)\s*)?\)$/i,c.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,c.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,c.Color.colorNameMap={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#00FFFF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blue:"#0000FF",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#FF00FF",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#00FF00",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#FF0000",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFFFFF",whitesmoke:"#F5F5F5",yellow:"#FFFF00",yellowgreen:"#9ACD32"},c.Color.fromRgb=function(t){return o.fromSource(o.sourceFromRgb(t))},c.Color.sourceFromRgb=function(t){var e,i,n,t=t.match(o.reRGBa);if(t)return e=parseInt(t[1],10)/(/%$/.test(t[1])?100:1)*(/%$/.test(t[1])?255:1),i=parseInt(t[2],10)/(/%$/.test(t[2])?100:1)*(/%$/.test(t[2])?255:1),n=parseInt(t[3],10)/(/%$/.test(t[3])?100:1)*(/%$/.test(t[3])?255:1),[parseInt(e,10),parseInt(i,10),parseInt(n,10),t[4]?parseFloat(t[4]):1]},c.Color.fromRgba=o.fromRgb,c.Color.fromHsl=function(t){return o.fromSource(o.sourceFromHsl(t))},c.Color.sourceFromHsl=function(t){var e,i,n,s,r,a,t=t.match(o.reHSLa);if(t)return e=(parseFloat(t[1])%360+360)%360/360,n=parseFloat(t[2])/(/%$/.test(t[2])?100:1),i=parseFloat(t[3])/(/%$/.test(t[3])?100:1),0==n?s=r=a=i:(s=l(n=2*i-(i=i<=.5?i*(1+n):i+n-i*n),i,e+1/3),r=l(n,i,e),a=l(n,i,e-1/3)),[Math.round(255*s),Math.round(255*r),Math.round(255*a),t[4]?parseFloat(t[4]):1]},c.Color.fromHsla=o.fromHsl,c.Color.fromHex=function(t){return o.fromSource(o.sourceFromHex(t))},c.Color.sourceFromHex=function(t){var e,i,n,s,r;if(t.match(o.reHex))return e=3===(t=t.slice(t.indexOf("#")+1)).length||4===t.length,r=8===t.length||4===t.length,i=e?t.charAt(0)+t.charAt(0):t.substring(0,2),n=e?t.charAt(1)+t.charAt(1):t.substring(2,4),s=e?t.charAt(2)+t.charAt(2):t.substring(4,6),r=r?e?t.charAt(3)+t.charAt(3):t.substring(6,8):"FF",[parseInt(i,16),parseInt(n,16),parseInt(s,16),parseFloat((parseInt(r,16)/255).toFixed(2))]},c.Color.fromSource=function(t){var e=new o;return e.setSource(t),e})}(i),function(t){"use strict";var o=t.fabric||(t.fabric={}),s=["e","se","s","sw","w","nw","n","ne","e"],r=["ns","nesw","ew","nwse"],a={},l="left",c="top",h="right",d="bottom",u="center",p={top:d,bottom:c,left:h,right:l,center:u},f=o.util.radiansToDegrees,g=Math.sign||function(t){return(0<t)-(t<0)||+t};function m(t,e){t=t.angle+f(Math.atan2(e.y,e.x))+360;return Math.round(t%360/45)}function v(t,e){var i=e.transform.target,n=i.canvas,s=o.util.object.clone(e);s.target=i,n&&n.fire("object:"+t,s),i.fire(t,e)}function b(t,e){e=e.canvas,t=t[e.uniScaleKey];return e.uniformScaling&&!t||!e.uniformScaling&&t}function y(t){return t.originX===u&&t.originY===u}function x(t,e,i){var n=t.lockScalingX,t=t.lockScalingY;return!((!n||!t)&&(e||!n&&!t||!i)&&(!n||"x"!==e)&&(!t||"y"!==e))}function w(t,e,i,n){return{e:t,transform:e,pointer:{x:i,y:n}}}function C(a){return function(t,e,i,n){var s=e.target,r=s.getCenterPoint(),r=s.translateToOriginPoint(r,e.originX,e.originY),t=a(t,e,i,n);return s.setPositionByOrigin(r,e.originX,e.originY),t}}function S(r,a){return function(t,e,i,n){var s=a(t,e,i,n);return s&&v(r,w(t,e,i,n)),s}}function E(t,e,i,n,s){var r=t.target,t=r.controls[t.corner],a=r.canvas.getZoom(),a=r.padding/a,r=r.toLocalPoint(new o.Point(n,s),e,i);return r.x>=a&&(r.x-=a),r.x<=-a&&(r.x+=a),r.y>=a&&(r.y-=a),r.y<=a&&(r.y+=a),r.x-=t.offsetX,r.y-=t.offsetY,r}function T(t){return t.flipX!==t.flipY}function A(t,e,i,n,s){0!==t[e]&&(e=s/t._getTransformedDimensions()[n]*t[i],t.set(i,e))}function I(t,e,i,n){var s,r=e.target,a=r._getTransformedDimensions(0,r.skewY),i=E(e,e.originX,e.originY,i,n),n=Math.abs(2*i.x)-a.x,i=r.skewX,n=(n<2?s=0:(s=f(Math.atan2(n/r.scaleX,a.y/r.scaleY)),e.originX===l&&e.originY===d&&(s=-s),e.originX===h&&e.originY===c&&(s=-s),T(r)&&(s=-s)),i!==s);return n&&(a=r._getTransformedDimensions().y,r.set("skewX",s),A(r,"skewY","scaleY","y",a)),n}function O(t,e,i,n){var s,r=e.target,a=r._getTransformedDimensions(r.skewX,0),i=E(e,e.originX,e.originY,i,n),n=Math.abs(2*i.y)-a.y,i=r.skewY,n=(n<2?s=0:(s=f(Math.atan2(n/r.scaleY,a.x/r.scaleX)),e.originX===l&&e.originY===d&&(s=-s),e.originX===h&&e.originY===c&&(s=-s),T(r)&&(s=-s)),i!==s);return n&&(a=r._getTransformedDimensions().x,r.set("skewY",s),A(r,"skewX","scaleX","x",a)),n}function k(t,e,i,n,s){var r=e.target,a=r.lockScalingX,o=r.lockScalingY,s=(s=s||{}).by,t=b(t,r),l=x(r,s,t),c=e.gestureScale;if(l)return!1;if(c)h=e.scaleX*c,d=e.scaleY*c;else{if(l=E(e,e.originX,e.originY,i,n),c="y"!==s?g(l.x):1,i="x"!==s?g(l.y):1,e.signX||(e.signX=c),e.signY||(e.signY=i),r.lockScalingFlip&&(e.signX!==c||e.signY!==i))return!1;var h,d,n=r._getTransformedDimensions();d=t&&!s?(t=Math.abs(l.x)+Math.abs(l.y),u=e.original,t=t/(Math.abs(n.x*u.scaleX/r.scaleX)+Math.abs(n.y*u.scaleY/r.scaleY)),h=u.scaleX*t,u.scaleY*t):(h=Math.abs(l.x*r.scaleX/n.x),Math.abs(l.y*r.scaleY/n.y)),y(e)&&(h*=2,d*=2),e.signX!==c&&"y"!==s&&(e.originX=p[e.originX],h*=-1,e.signX=c),e.signY!==i&&"x"!==s&&(e.originY=p[e.originY],d*=-1,e.signY=i)}var u=r.scaleX,t=r.scaleY;return s?("x"===s&&r.set("scaleX",h),"y"===s&&r.set("scaleY",d)):(a||r.set("scaleX",h),o||r.set("scaleY",d)),u!==r.scaleX||t!==r.scaleY}a.scaleCursorStyleHandler=function(t,e,i){var t=b(t,i),n="";return 0!==e.x&&0===e.y?n="x":0===e.x&&0!==e.y&&(n="y"),x(i,n,t)?"not-allowed":(n=m(i,e),s[n]+"-resize")},a.skewCursorStyleHandler=function(t,e,i){var n="not-allowed";return 0!==e.x&&i.lockSkewingY||0!==e.y&&i.lockSkewingX?n:(n=m(i,e)%4,r[n]+"-resize")},a.scaleSkewCursorStyleHandler=function(t,e,i){return t[i.canvas.altActionKey]?a.skewCursorStyleHandler(t,e,i):a.scaleCursorStyleHandler(t,e,i)},a.rotationWithSnapping=S("rotating",C(function(t,e,i,n){var s,r=e.target,a=r.translateToOriginPoint(r.getCenterPoint(),e.originX,e.originY);return!r.lockRotation&&(s=Math.atan2(e.ey-a.y,e.ex-a.x),n=Math.atan2(n-a.y,i-a.x),i=f(n-s+e.theta),0<r.snapAngle&&(a=r.snapAngle,n=r.snapThreshold||a,s=Math.ceil(i/a)*a,e=Math.floor(i/a)*a,Math.abs(i-e)<n?i=e:Math.abs(i-s)<n&&(i=s)),i<0&&(i=360+i),a=r.angle!==(i%=360),r.angle=i,a)})),a.scalingEqually=S("scaling",C(function(t,e,i,n){return k(t,e,i,n)})),a.scalingX=S("scaling",C(function(t,e,i,n){return k(t,e,i,n,{by:"x"})})),a.scalingY=S("scaling",C(function(t,e,i,n){return k(t,e,i,n,{by:"y"})})),a.scalingYOrSkewingX=function(t,e,i,n){return t[e.target.canvas.altActionKey]?a.skewHandlerX(t,e,i,n):a.scalingY(t,e,i,n)},a.scalingXOrSkewingY=function(t,e,i,n){return t[e.target.canvas.altActionKey]?a.skewHandlerY(t,e,i,n):a.scalingX(t,e,i,n)},a.changeWidth=S("resizing",C(function(t,e,i,n){var s=e.target,i=E(e,e.originX,e.originY,i,n),n=s.strokeWidth/(s.strokeUniform?s.scaleX:1),e=y(e)?2:1,r=s.width,i=Math.abs(i.x*e/s.scaleX)-n;return s.set("width",Math.max(i,0)),r!==i})),a.skewHandlerX=function(t,e,i,n){var s,r=e.target,a=r.skewX,o=e.originY;return!r.lockSkewingX&&(0===a?s=0<E(e,u,u,i,n).x?l:h:(0<a&&(s=o===c?l:h),a<0&&(s=o===c?h:l),T(r)&&(s=s===l?h:l)),e.originX=s,S("skewing",C(I))(t,e,i,n))},a.skewHandlerY=function(t,e,i,n){var s,r=e.target,a=r.skewY,o=e.originX;return!r.lockSkewingY&&(0===a?s=0<E(e,u,u,i,n).y?c:d:(0<a&&(s=o===l?c:d),a<0&&(s=o===l?d:c),T(r)&&(s=s===c?d:c)),e.originY=s,S("skewing",C(O))(t,e,i,n))},a.dragHandler=function(t,e,i,n){var s=e.target,r=i-e.offsetX,a=n-e.offsetY,o=!s.get("lockMovementX")&&s.left!==r,l=!s.get("lockMovementY")&&s.top!==a;return o&&s.set("left",r),l&&s.set("top",a),(o||l)&&v("moving",w(t,e,i,n)),o||l},a.scaleOrSkewActionName=function(t,e,i){t=t[i.canvas.altActionKey];return 0===e.x?t?"skewX":"scaleY":0===e.y?t?"skewY":"scaleX":void 0},a.rotationStyleHandler=function(t,e,i){return i.lockRotation?"not-allowed":e.cursorStyle},a.fireEvent=v,a.wrapWithFixedAnchor=C,a.wrapWithFireEvent=S,a.getLocalPoint=E,o.controlsUtils=a}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),d=t.util.degreesToRadians,t=t.controlsUtils;t.renderCircleControl=function(t,e,i,n,s){n=n||{};var r,a=this.sizeX||n.cornerSize||s.cornerSize,o=this.sizeY||n.cornerSize||s.cornerSize,l=(void 0!==n.transparentCorners?n:s).transparentCorners,c=l?"stroke":"fill",l=!l&&(n.cornerStrokeColor||s.cornerStrokeColor),h=e,d=i;t.save(),t.fillStyle=n.cornerColor||s.cornerColor,t.strokeStyle=n.cornerStrokeColor||s.cornerStrokeColor,o<a?(t.scale(1,o/(r=a)),d=i*a/o):a<o?(t.scale(a/(r=o),1),h=e*o/a):r=a,t.lineWidth=1,t.beginPath(),t.arc(h,d,r/2,0,2*Math.PI,!1),t[c](),l&&t.stroke(),t.restore()},t.renderSquareControl=function(t,e,i,n,s){n=n||{};var r=this.sizeX||n.cornerSize||s.cornerSize,a=this.sizeY||n.cornerSize||s.cornerSize,o=(void 0!==n.transparentCorners?n:s).transparentCorners,l=o?"stroke":"fill",o=!o&&(n.cornerStrokeColor||s.cornerStrokeColor),c=r/2,h=a/2;t.save(),t.fillStyle=n.cornerColor||s.cornerColor,t.strokeStyle=n.cornerStrokeColor||s.cornerStrokeColor,t.lineWidth=1,t.translate(e,i),t.rotate(d(s.angle)),t[l+"Rect"](-c,-h,r,a),o&&t.strokeRect(-c,-h,r,a),t.restore()}}(i),function(t){"use strict";var u=t.fabric||(t.fabric={});u.Control=function(t){for(var e in t)this[e]=t[e]},u.Control.prototype={visible:!0,actionName:"scale",angle:0,x:0,y:0,offsetX:0,offsetY:0,sizeX:null,sizeY:null,touchSizeX:null,touchSizeY:null,cursorStyle:"crosshair",withConnection:!1,actionHandler:function(){},mouseDownHandler:function(){},mouseUpHandler:function(){},getActionHandler:function(){return this.actionHandler},getMouseDownHandler:function(){return this.mouseDownHandler},getMouseUpHandler:function(){return this.mouseUpHandler},cursorStyleHandler:function(t,e){return e.cursorStyle},getActionName:function(t,e){return e.actionName},getVisibility:function(t,e){t=t._controlsVisibility;return t&&void 0!==t[e]?t[e]:this.visible},setVisibility:function(t){this.visible=t},positionHandler:function(t,e){return u.util.transformPoint({x:this.x*t.x+this.offsetX,y:this.y*t.y+this.offsetY},e)},calcCornerCoords:function(t,e,i,n,s){var r,a,o,l,c,h,d=s?this.touchSizeX:this.sizeX,s=s?this.touchSizeY:this.sizeY;return d&&s&&d!==s?(h=Math.atan2(s,d),r=Math.sqrt(d*d+s*s)/2,a=h-u.util.degreesToRadians(t),h=Math.PI/2-h-u.util.degreesToRadians(t),o=r*u.util.cos(a),l=r*u.util.sin(a),c=r*u.util.cos(h),h=r*u.util.sin(h)):(r=.7071067812*(d&&s?d:e),a=u.util.degreesToRadians(45-t),o=c=r*u.util.cos(a),l=h=r*u.util.sin(a)),{tl:{x:i-h,y:n-c},tr:{x:i+o,y:n-l},bl:{x:i-o,y:n+l},br:{x:i+h,y:n+c}}},render:function(t,e,i,n,s){("circle"===((n=n||{}).cornerStyle||s.cornerStyle)?u.controlsUtils.renderCircleControl:u.controlsUtils.renderSquareControl).call(this,t,e,i,n,s)}}}(i),G=V.util.object.clone,V.Gradient=V.util.createClass({offsetX:0,offsetY:0,gradientTransform:null,gradientUnits:"pixels",type:"linear",initialize:function(e){(e=e||{}).coords||(e.coords={});var t,i=this;Object.keys(e).forEach(function(t){i[t]=e[t]}),this.id?this.id+="_"+V.Object.__uid++:this.id=V.Object.__uid++,t={x1:e.coords.x1||0,y1:e.coords.y1||0,x2:e.coords.x2||0,y2:e.coords.y2||0},"radial"===this.type&&(t.r1=e.coords.r1||0,t.r2=e.coords.r2||0),this.coords=t,this.colorStops=e.colorStops.slice()},addColorStop:function(t){for(var e in t){var i=new V.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this},toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientUnits:this.gradientUnits,gradientTransform:this.gradientTransform&&this.gradientTransform.concat()};return V.util.populateWithProperties(this,e,t),e},toSVG:function(t,e){var i,n=G(this.coords,!0),s=(e=e||{},G(this.colorStops,!0)),r=n.r1>n.r2,a=(this.gradientTransform||V.iMatrix).concat(),o=-this.offsetX,l=-this.offsetY,c=!!e.additionalTransform,h="pixels"===this.gradientUnits?"userSpaceOnUse":"objectBoundingBox";if(s.sort(function(t,e){return t.offset-e.offset}),"objectBoundingBox"==h?(o/=t.width,l/=t.height):(o+=t.width/2,l+=t.height/2),"path"===t.type&&"percentage"!==this.gradientUnits&&(o-=t.pathOffset.x,l-=t.pathOffset.y),a[4]-=o,a[5]-=l,t='id="SVGID_'+this.id+'" gradientUnits="'+h+'"',t+=' gradientTransform="'+(c?e.additionalTransform+" ":"")+V.util.matrixToSVG(a)+'" ',"linear"===this.type?i=["<linearGradient ",t,' x1="',n.x1,'" y1="',n.y1,'" x2="',n.x2,'" y2="',n.y2,'">\n']:"radial"===this.type&&(i=["<radialGradient ",t,' cx="',r?n.x1:n.x2,'" cy="',r?n.y1:n.y2,'" r="',r?n.r1:n.r2,'" fx="',r?n.x2:n.x1,'" fy="',r?n.y2:n.y1,'">\n']),"radial"===this.type){if(r)for((s=s.concat()).reverse(),u=0,p=s.length;u<p;u++)s[u].offset=1-s[u].offset;o=Math.min(n.r1,n.r2);if(0<o)for(var d=o/Math.max(n.r1,n.r2),u=0,p=s.length;u<p;u++)s[u].offset+=d*(1-s[u].offset)}for(u=0,p=s.length;u<p;u++){var f=s[u];i.push("<stop ",'offset="',100*f.offset+"%",'" style="stop-color:',f.color,void 0!==f.opacity?";stop-opacity: "+f.opacity:";",'"/>\n')}return i.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),i.join("")},toLive:function(t){var e,i,n,s=V.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(s.x1,s.y1,s.x2,s.y2):"radial"===this.type&&(e=t.createRadialGradient(s.x1,s.y1,s.r1,s.x2,s.y2,s.r2)),i=0,n=this.colorStops.length;i<n;i++){var r=this.colorStops[i].color,a=this.colorStops[i].opacity,o=this.colorStops[i].offset;void 0!==a&&(r=new V.Color(r).setAlpha(a).toRgba()),e.addColorStop(o,r)}return e}}}),V.util.object.extend(V.Gradient,{fromElement:function(t,e,i,n){var s=(s=parseFloat(i)/(/%$/.test(i)?100:1))<0?0:1<s?1:s;isNaN(s)&&(s=1);for(var r,a,o,l,c,h,d,u=t.getElementsByTagName("stop"),i="userSpaceOnUse"===t.getAttribute("gradientUnits")?"pixels":"percentage",p=t.getAttribute("gradientTransform")||"",f=[],g=0,m=0,v="linearGradient"===t.nodeName||"LINEARGRADIENT"===t.nodeName?(r="linear",{x1:(a=t).getAttribute("x1")||0,y1:a.getAttribute("y1")||0,x2:a.getAttribute("x2")||"100%",y2:a.getAttribute("y2")||0}):(r="radial",{x1:(a=t).getAttribute("fx")||a.getAttribute("cx")||"50%",y1:a.getAttribute("fy")||a.getAttribute("cy")||"50%",r1:0,x2:a.getAttribute("cx")||"50%",y2:a.getAttribute("cy")||"50%",r2:a.getAttribute("r")||"50%"}),b=u.length;b--;)f.push(function(t,e){var i,n,s,r=t.getAttribute("style"),a=t.getAttribute("offset")||0,a=(a=parseFloat(a)/(/%$/.test(a)?100:1))<0?0:1<a?1:a;if(r){var o=r.split(/\s*;\s*/);for(""===o[o.length-1]&&o.pop(),s=o.length;s--;){var l=o[s].split(/\s*:\s*/),c=l[0].trim(),l=l[1].trim();"stop-color"===c?i=l:"stop-opacity"===c&&(n=l)}}return i=i||t.getAttribute("stop-color")||"rgb(0,0,0)",n=n||t.getAttribute("stop-opacity"),r=(i=new V.Color(i)).getAlpha(),n=isNaN(parseFloat(n))?1:parseFloat(n),n*=r*e,{offset:a,color:i.toRgb(),opacity:n}}(u[b],s));return p=V.parseTransformAttribute(p),o=v,l=n,c=i,Object.keys(o).forEach(function(t){"Infinity"===(h=o[t])?d=1:"-Infinity"===h?d=0:(d=parseFloat(o[t],10),"string"==typeof h&&/^(\d+\.\d+)%|(\d+)%$/.test(h)&&(d*=.01,"pixels"==c)&&("x1"!==t&&"x2"!==t&&"r2"!==t||(d*=l.viewBoxWidth||l.width),"y1"!==t&&"y2"!==t||(d*=l.viewBoxHeight||l.height))),o[t]=d}),"pixels"==i&&(g=-e.left,m=-e.top),new V.Gradient({id:t.getAttribute("id"),type:r,coords:v,colorStops:f,gradientUnits:i,gradientTransform:p,offsetX:g,offsetY:m})}}),function(){"use strict";var n=V.util.toFixed;V.Pattern=V.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,i){var n;t=t||{},this.id=V.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source?i&&i(this):((n=this).source=V.util.createImage(),V.util.loadImage(t.source,function(t,e){n.source=t,i&&i(n,e)},null,this.crossOrigin))},toObject:function(t){var e,i=V.Object.NUM_FRACTION_DIGITS;return"string"==typeof this.source.src?e=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(e=this.source.toDataURL()),e={type:"pattern",source:e,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:n(this.offsetX,i),offsetY:n(this.offsetY,i),patternTransform:this.patternTransform?this.patternTransform.concat():null},V.util.populateWithProperties(this,e,t),e},toSVG:function(t){var e="function"==typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,s=this.offsetX/t.width,t=this.offsetY/t.height,r="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1,t&&(n+=Math.abs(t))),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1,s&&(i+=Math.abs(s))),e.src?r=e.src:e.toDataURL&&(r=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+s+'" y="'+t+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+r+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e=this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var a=t.fabric||(t.fabric={}),o=a.util.toFixed;a.Shadow?a.warn("fabric.Shadow is already defined."):(a.Shadow=a.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,nonScaling:!1,initialize:function(t){for(var e in t="string"==typeof t?this._parseShadow(t):t)this[e]=t[e];this.id=a.Object.__uid++},_parseShadow:function(t){var t=t.trim(),e=a.Shadow.reOffsetsAndBlur.exec(t)||[];return{color:(t.replace(a.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseFloat(e[1],10)||0,offsetY:parseFloat(e[2],10)||0,blur:parseFloat(e[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var e=40,i=40,n=a.Object.NUM_FRACTION_DIGITS,s=a.util.rotateVector({x:this.offsetX,y:this.offsetY},a.util.degreesToRadians(-t.angle)),r=new a.Color(this.color);return t.width&&t.height&&(e=100*o((Math.abs(s.x)+this.blur)/t.width,n)+20,i=100*o((Math.abs(s.y)+this.blur)/t.height,n)+20),t.flipX&&(s.x*=-1),t.flipY&&(s.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+i+'%" height="'+(100+2*i)+'%" x="-'+e+'%" width="'+(100+2*e)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+o(this.blur?this.blur/2:0,n)+'"></feGaussianBlur>\n\t<feOffset dx="'+o(s.x,n)+'" dy="'+o(s.y,n)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+r.toRgb()+'" flood-opacity="'+r.getAlpha()+'"/>\n\t<feComposite in2="oBlur" operator="in" />\n\t<feMerge>\n\t\t<feMergeNode></feMergeNode>\n\t\t<feMergeNode in="SourceGraphic"></feMergeNode>\n\t</feMerge>\n</filter>\n'},toObject:function(){var e,i;return this.includeDefaultValues?{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke,nonScaling:this.nonScaling}:(e={},i=a.Shadow.prototype,["color","blur","offsetX","offsetY","affectStroke","nonScaling"].forEach(function(t){this[t]!==i[t]&&(e[t]=this[t])},this),e)}}),a.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(-?\d+(?:\.\d*)?(?:px)?(?:\s?|$))?(\d+(?:\.\d*)?(?:px)?)?(?:\s?|$)(?:$|\s)/)}(i),function(){"use strict";var s,t,c,o,r,a,i,n,e;V.StaticCanvas?V.warn("fabric.StaticCanvas is already defined."):(s=V.util.object.extend,t=V.util.getElementOffset,c=V.util.removeFromArray,o=V.util.toFixed,r=V.util.transformPoint,a=V.util.invertTransform,i=V.util.getNodeCanvas,n=V.util.createCanvasElement,e=new Error("Could not initialize `canvas` element"),V.StaticCanvas=V.util.createClass(V.CommonMethods,{initialize:function(t,e){e=e||{},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e)},backgroundColor:"",backgroundImage:null,overlayColor:"",overlayImage:null,includeDefaultValues:!0,stateful:!1,renderOnAddRemove:!0,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:V.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,clipPath:void 0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this.interactive||this._initRetinaScaling(),e.overlayImage&&this.setOverlayImage(e.overlayImage,i),e.backgroundImage&&this.setBackgroundImage(e.backgroundImage,i),e.backgroundColor&&this.setBackgroundColor(e.backgroundColor,i),e.overlayColor&&this.setOverlayColor(e.overlayColor,i),this.calcOffset()},_isRetinaScaling:function(){return 1<V.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?Math.max(1,V.devicePixelRatio):1},_initRetinaScaling:function(){var t;this._isRetinaScaling()&&(t=V.devicePixelRatio,this.__initRetinaScaling(t,this.lowerCanvasEl,this.contextContainer),this.upperCanvasEl)&&this.__initRetinaScaling(t,this.upperCanvasEl,this.contextTop)},__initRetinaScaling:function(t,e,i){e.setAttribute("width",this.width*t),e.setAttribute("height",this.height*t),i.scale(t,t)},calcOffset:function(){return this._offset=t(this.lowerCanvasEl),this},setOverlayImage:function(t,e,i){return this.__setBgOverlayImage("overlayImage",t,e,i)},setBackgroundImage:function(t,e,i){return this.__setBgOverlayImage("backgroundImage",t,e,i)},setOverlayColor:function(t,e){return this.__setBgOverlayColor("overlayColor",t,e)},setBackgroundColor:function(t,e){return this.__setBgOverlayColor("backgroundColor",t,e)},__setBgOverlayImage:function(n,t,s,r){return"string"==typeof t?V.util.loadImage(t,function(t,e){var i;t&&(i=new V.Image(t,r),(this[n]=i).canvas=this),s&&s(t,e)},this,r&&r.crossOrigin):(r&&t.setOptions(r),(this[n]=t)&&(t.canvas=this),s&&s(t,!1)),this},__setBgOverlayColor:function(t,e,i){return this[t]=e,this._initGradient(e,t),this._initPattern(e,t,i),this},_createCanvasElement:function(){var t=n();if(!t)throw e;if(t.style||(t.style={}),void 0===t.getContext)throw e;return t},_initOptions:function(t){var e=this.lowerCanvasEl;this._setOptions(t),this.width=this.width||parseInt(e.width,10)||0,this.height=this.height||parseInt(e.height,10)||0,this.lowerCanvasEl.style&&(e.width=this.width,e.height=this.height,e.style.width=this.width+"px",e.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=V.util.getById(t)||this._createCanvasElement(),V.util.addClass(this.lowerCanvasEl,"lower-canvas"),this._originalCanvasStyle=this.lowerCanvasEl.style,this.interactive&&this._applyCanvasStyle(this.lowerCanvasEl),this.contextContainer=this.lowerCanvasEl.getContext("2d")},getWidth:function(){return this.width},getHeight:function(){return this.height},setWidth:function(t,e){return this.setDimensions({width:t},e)},setHeight:function(t,e){return this.setDimensions({height:t},e)},setDimensions:function(t,e){var i,n;for(n in e=e||{},t)i=t[n],e.cssOnly||(this._setBackstoreDimension(n,t[n]),i+="px",this.hasLostContext=!0),e.backstoreOnly||this._setCssDimension(n,i);return this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._setBrushStyles(this.contextTop),this._initRetinaScaling(),this.calcOffset(),e.cssOnly||this.requestRenderAll(),this},_setBackstoreDimension:function(t,e){return this.lowerCanvasEl[t]=e,this.upperCanvasEl&&(this.upperCanvasEl[t]=e),this.cacheCanvasEl&&(this.cacheCanvasEl[t]=e),this[t]=e,this},_setCssDimension:function(t,e){return this.lowerCanvasEl.style[t]=e,this.upperCanvasEl&&(this.upperCanvasEl.style[t]=e),this.wrapperEl&&(this.wrapperEl.style[t]=e),this},getZoom:function(){return this.viewportTransform[0]},setViewportTransform:function(t){var e,i,n,s=this._activeObject,r=this.backgroundImage,a=this.overlayImage;for(this.viewportTransform=t,i=0,n=this._objects.length;i<n;i++)(e=this._objects[i]).group||e.setCoords(!0);return s&&s.setCoords(),r&&r.setCoords(!0),a&&a.setCoords(!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,n=this.viewportTransform.slice(0),e=(t=r(t,a(this.viewportTransform)),n[0]=e,n[3]=e,r(t,n));return n[4]+=i.x-e.x,n[5]+=i.y-e.y,this.setViewportTransform(n)},setZoom:function(t){return this.zoomToPoint(new V.Point(0,0),t),this},absolutePan:function(t){var e=this.viewportTransform.slice(0);return e[4]=-t.x,e[5]=-t.y,this.setViewportTransform(e)},relativePan:function(t){return this.absolutePan(new V.Point(-t.x-this.viewportTransform[4],-t.y-this.viewportTransform[5]))},getElement:function(){return this.lowerCanvasEl},_onObjectAdded:function(t){this.stateful&&t.setupState(),t._set("canvas",this),t.setCoords(),this.fire("object:added",{target:t}),t.fire("added")},_onObjectRemoved:function(t){this.fire("object:removed",{target:t}),t.fire("removed"),delete t.canvas},clearContext:function(t){return t.clearRect(0,0,this.width,this.height),this},getContext:function(){return this.contextContainer},clear:function(){return this.remove.apply(this,this.getObjects()),this.backgroundImage=null,this.overlayImage=null,this.backgroundColor="",this.overlayColor="",this._hasITextHandlers&&(this.off("mouse:up",this._mouseUpITextHandler),this._iTextInstances=null,this._hasITextHandlers=!1),this.clearContext(this.contextContainer),this.fire("canvas:cleared"),this.renderOnAddRemove&&this.requestRenderAll(),this},renderAll:function(){var t=this.contextContainer;return this.renderCanvas(t,this._objects),this},renderAndReset:function(){this.isRendering=0,this.renderAll()},requestRenderAll:function(){return this.isRendering||(this.isRendering=V.util.requestAnimFrame(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,n=a(this.viewportTransform);return t.tl=r({x:0,y:0},n),t.br=r({x:e,y:i},n),t.tr=new V.Point(t.br.x,t.tl.y),t.bl=new V.Point(t.tl.x,t.br.y),this.vptCoords=t},cancelRequestedRender:function(){this.isRendering&&(V.util.cancelAnimFrame(this.isRendering),this.isRendering=0)},renderCanvas:function(t,e){var i=this.viewportTransform,n=this.clipPath;this.cancelRequestedRender(),this.calcViewportBoundaries(),this.clearContext(t),V.util.setImageSmoothing(t,this.imageSmoothingEnabled),this.fire("before:render",{ctx:t}),this._renderBackground(t),t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this._renderObjects(t,e),t.restore(),!this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),n&&(n.canvas=this,n.shouldCache(),n._transformDone=!0,n.renderCache({forClipping:!0}),this.drawClipPathOnCanvas(t)),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render",{ctx:t})},drawClipPathOnCanvas:function(t){var e=this.viewportTransform,i=this.clipPath;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t.globalCompositeOperation="destination-in",i.transform(t),t.scale(1/i.zoomX,1/i.zoomY),t.drawImage(i._cacheCanvas,-i.cacheTranslationX,-i.cacheTranslationY),t.restore()},_renderObjects:function(t,e){for(var i=0,n=e.length;i<n;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i=this[e+"Color"],n=this[e+"Image"],s=this.viewportTransform,e=this[e+"Vpt"];(i||n)&&(i&&(t.save(),t.beginPath(),t.moveTo(0,0),t.lineTo(this.width,0),t.lineTo(this.width,this.height),t.lineTo(0,this.height),t.closePath(),t.fillStyle=i.toLive?i.toLive(t,this):i,e&&t.transform(s[0],s[1],s[2],s[3],s[4],s[5]),t.transform(1,0,0,1,i.offsetX||0,i.offsetY||0),(i=i.gradientTransform||i.patternTransform)&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),t.fill(),t.restore()),n)&&(t.save(),e&&t.transform(s[0],s[1],s[2],s[3],s[4],s[5]),n.render(t),t.restore())},_renderBackground:function(t){this._renderBackgroundOrOverlay(t,"background")},_renderOverlay:function(t){this._renderBackgroundOrOverlay(t,"overlay")},getCenter:function(){return{top:this.height/2,left:this.width/2}},getCenterPoint:function(){return new V.Point(this.width/2,this.height/2)},centerObjectH:function(t){return this._centerObject(t,new V.Point(this.getCenterPoint().x,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new V.Point(t.getCenterPoint().x,this.getCenterPoint().y))},centerObject:function(t){var e=this.getCenterPoint();return this._centerObject(t,e)},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new V.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new V.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenterPoint(),e=a(this.viewportTransform);return r(t,e)},_centerObject:function(t,e){return t.setPositionByOrigin(e,"center","center"),t.setCoords(),this.renderOnAddRemove&&this.requestRenderAll(),this},toDatalessJSON:function(t){return this.toDatalessObject(t)},toObject:function(t){return this._toObjectMethod("toObject",t)},toDatalessObject:function(t){return this._toObjectMethod("toDatalessObject",t)},_toObjectMethod:function(t,e){var i=this.clipPath,n={version:V.version,objects:this._toObjects(t,e)};return i&&!i.excludeFromExport&&(n.clipPath=this._toObject(this.clipPath,t,e)),s(n,this.__serializeBgOverlay(t,e)),V.util.populateWithProperties(this,n,e),n},_toObjects:function(e,i){return this._objects.filter(function(t){return!t.excludeFromExport}).map(function(t){return this._toObject(t,e,i)},this)},_toObject:function(t,e,i){this.includeDefaultValues||(n=t.includeDefaultValues,t.includeDefaultValues=!1);var n,e=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=n),e},__serializeBgOverlay:function(t,e){var i={},n=this.backgroundImage,s=this.overlayImage,r=this.backgroundColor,a=this.overlayColor;return r&&r.toObject?r.excludeFromExport||(i.background=r.toObject(e)):r&&(i.background=r),a&&a.toObject?a.excludeFromExport||(i.overlay=a.toObject(e)):a&&(i.overlay=a),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,t,e)),s&&!s.excludeFromExport&&(i.overlayImage=this._toObject(s,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){(t=t||{}).reviver=e;var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this.clipPath&&i.push('<g clip-path="url(#'+this.clipPath.clipPathId+')" >\n'),this._setSVGBgOverlayColor(i,"background"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this.clipPath&&i.push("</g>\n"),this._setSVGBgOverlayColor(i,"overlay"),this._setSVGBgOverlayImage(i,"overlayImage",e),i.push("</svg>"),i.join("")},_setSVGPreamble:function(t,e){e.suppressPreamble||t.push('<?xml version="1.0" encoding="',e.encoding||"UTF-8",'" standalone="no" ?>\n','<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ','"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n')},_setSVGHeader:function(t,e){var i,n=e.width||this.width,s=e.height||this.height,r='viewBox="0 0 '+this.width+" "+this.height+'" ',a=V.Object.NUM_FRACTION_DIGITS;e.viewBox?r='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,r='viewBox="'+o(-i[4]/i[0],a)+" "+o(-i[5]/i[3],a)+" "+o(this.width/i[0],a)+" "+o(this.height/i[3],a)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',n,'" ','height="',s,'" ',r,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",V.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),this.createSVGClipPathMarkup(e),"</defs>\n")},createSVGClipPathMarkup:function(t){var e=this.clipPath;return e?(e.clipPathId="CLIPPATH_"+V.Object.__uid++,'<clipPath id="'+e.clipPathId+'" >\n'+this.clipPath.toClipPathSVG(t.reviver)+"</clipPath>\n"):""},createSVGRefElementsMarkup:function(){var s=this;return["background","overlay"].map(function(t){var e,i,n=s[t+"Color"];if(n&&n.toLive)return t=s[t+"Vpt"],e=s.viewportTransform,i={width:s.width/(t?e[0]:1),height:s.height/(t?e[3]:1)},n.toSVG(i,{additionalTransform:t?V.util.matrixToSVG(e):""})}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,n,s,r,a,o,l,c="",h={},d=V.fontPaths,u=[];for(this._objects.forEach(function t(e){u.push(e),e._objects&&e._objects.forEach(t)}),a=0,o=u.length;a<o;a++)if(e=(t=u[a]).fontFamily,-1!==t.type.indexOf("text")&&!h[e]&&d[e]&&(h[e]=!0,t.styles))for(s in i=t.styles)for(r in n=i[s])!h[e=n[r].fontFamily]&&d[e]&&(h[e]=!0);for(l in h)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",l,"';\n","\t\t\tsrc: url('",d[l],"');\n","\t\t}\n"].join("");return c=c&&['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")},_setSVGObjects:function(t,e){for(var i,n=this._objects,s=0,r=n.length;s<r;s++)(i=n[s]).excludeFromExport||this._setSVGObject(t,i,e)},_setSVGObject:function(t,e,i){t.push(e.toSVG(i))},_setSVGBgOverlayImage:function(t,e,i){this[e]&&!this[e].excludeFromExport&&this[e].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i,n=this[e+"Color"],s=this.viewportTransform,r=this.width,a=this.height;n&&(n.toLive?(i=n.repeat,s=V.util.invertTransform(s),e=this[e+"Vpt"]?V.util.matrixToSVG(s):"",t.push('<rect transform="'+e+" translate(",r/2,",",a/2,')"',' x="',n.offsetX-r/2,'" y="',n.offsetY-a/2,'" ','width="',"repeat-y"===i||"no-repeat"===i?n.source.width:r,'" height="',"repeat-x"===i||"no-repeat"===i?n.source.height:a,'" fill="url(#SVGID_'+n.id+')"',"></rect>\n")):t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',n,'"',"></rect>\n"))},sendToBack:function(t){if(t){var e,i,n,s=this._activeObject;if(t===s&&"activeSelection"===t.type)for(e=(n=s._objects).length;e--;)i=n[e],c(this._objects,i),this._objects.unshift(i);else c(this._objects,t),this._objects.unshift(t);this.renderOnAddRemove&&this.requestRenderAll()}return this},bringToFront:function(t){if(t){var e,i,n,s=this._activeObject;if(t===s&&"activeSelection"===t.type)for(n=s._objects,e=0;e<n.length;e++)i=n[e],c(this._objects,i),this._objects.push(i);else c(this._objects,t),this._objects.push(t);this.renderOnAddRemove&&this.requestRenderAll()}return this},sendBackwards:function(t,e){if(t){var i,n,s,r,a,o=this._activeObject,l=0;if(t===o&&"activeSelection"===t.type)for(a=o._objects,i=0;i<a.length;i++)n=a[i],(s=this._objects.indexOf(n))>0+l&&(r=s-1,c(this._objects,n),this._objects.splice(r,0,n)),l++;else 0!==(s=this._objects.indexOf(t))&&(r=this._findNewLowerIndex(t,s,e),c(this._objects,t),this._objects.splice(r,0,t));this.renderOnAddRemove&&this.requestRenderAll()}return this},_findNewLowerIndex:function(t,e,i){var n,s;if(i){for(s=(n=e)-1;0<=s;--s)if(t.intersectsWithObject(this._objects[s])||t.isContainedWithinObject(this._objects[s])||this._objects[s].isContainedWithinObject(t)){n=s;break}}else n=e-1;return n},bringForward:function(t,e){if(t){var i,n,s,r,a,o=this._activeObject,l=0;if(t===o&&"activeSelection"===t.type)for(i=(a=o._objects).length;i--;)n=a[i],(s=this._objects.indexOf(n))<this._objects.length-1-l&&(r=s+1,c(this._objects,n),this._objects.splice(r,0,n)),l++;else(s=this._objects.indexOf(t))!==this._objects.length-1&&(r=this._findNewUpperIndex(t,s,e),c(this._objects,t),this._objects.splice(r,0,t));this.renderOnAddRemove&&this.requestRenderAll()}return this},_findNewUpperIndex:function(t,e,i){var n,s,r;if(i){for(s=(n=e)+1,r=this._objects.length;s<r;++s)if(t.intersectsWithObject(this._objects[s])||t.isContainedWithinObject(this._objects[s])||this._objects[s].isContainedWithinObject(t)){n=s;break}}else n=e+1;return n},moveTo:function(t,e){return c(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(V.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[],this.backgroundImage&&this.backgroundImage.dispose&&this.backgroundImage.dispose(),this.backgroundImage=null,this.overlayImage&&this.overlayImage.dispose&&this.overlayImage.dispose(),this.overlayImage=null,this._iTextInstances=null,this.contextContainer=null,this.lowerCanvasEl.classList.remove("lower-canvas"),V.util.setStyle(this.lowerCanvasEl,this._originalCanvasStyle),delete this._originalCanvasStyle,this.lowerCanvasEl.setAttribute("width",this.width),this.lowerCanvasEl.setAttribute("height",this.height),V.util.cleanUpJsdomNode(this.lowerCanvasEl),this.lowerCanvasEl=void 0,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this._objects.length+" }>"}}),s(V.StaticCanvas.prototype,V.Observable),s(V.StaticCanvas.prototype,V.Collection),s(V.StaticCanvas.prototype,V.DataURLExporter),s(V.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=n();return e&&e.getContext&&(e=e.getContext("2d"))&&"setLineDash"===t?void 0!==e.setLineDash:null}}),V.StaticCanvas.prototype.toJSON=V.StaticCanvas.prototype.toObject,V.isLikelyNode&&(V.StaticCanvas.prototype.createPNGStream=function(){var t=i(this.lowerCanvasEl);return t&&t.createPNGStream()},V.StaticCanvas.prototype.createJPEGStream=function(t){var e=i(this.lowerCanvasEl);return e&&e.createJPEGStream(t)}))}(),V.BaseBrush=V.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,limitedToCanvasSize:!1,_setBrushStyles:function(t){t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,t.setLineDash(this.strokeDashArray||[])},_saveAndTransform:function(t){var e=this.canvas.viewportTransform;t.save(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},_setShadow:function(){var t,e,i,n;this.shadow&&(t=this.canvas,e=this.shadow,i=t.contextTop,n=t.getZoom(),t&&t._isRetinaScaling()&&(n*=V.devicePixelRatio),i.shadowColor=e.color,i.shadowBlur=e.blur*n,i.shadowOffsetX=e.offsetX*n,i.shadowOffsetY=e.offsetY*n)},needsFullRender:function(){return new V.Color(this.color).getAlpha()<1||!!this.shadow},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0},_isOutSideCanvas:function(t){return t.x<0||t.x>this.canvas.getWidth()||t.y<0||t.y>this.canvas.getHeight()}}),V.PencilBrush=V.util.createClass(V.BaseBrush,{decimate:.4,drawStraightLine:!1,straightLineKey:"shiftKey",initialize:function(t){this.canvas=t,this._points=[]},needsFullRender:function(){return this.callSuper("needsFullRender")||this._hasStraightLine},_drawSegment:function(t,e,i){i=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,i.x,i.y),i},onMouseDown:function(t,e){this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],this._prepareForDrawing(t),this._captureDrawingPath(t),this._render())},onMouseMove:function(t,e){var i;this.canvas._isMainEvent(e.e)&&(this.drawStraightLine=e.e[this.straightLineKey],!0!==this.limitedToCanvasSize||!this._isOutSideCanvas(t))&&this._captureDrawingPath(t)&&1<this._points.length&&(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this._render()):(t=(e=this._points).length,i=this.canvas.contextTop,this._saveAndTransform(i),this.oldEnd&&(i.beginPath(),i.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(i,e[t-2],e[t-1],!0),i.stroke(),i.restore()))},onMouseUp:function(t){return!this.canvas._isMainEvent(t.e)||(this.drawStraightLine=!1,this.oldEnd=void 0,this._finalizeAndAddPath(),!1)},_prepareForDrawing:function(t){t=new V.Point(t.x,t.y);this._reset(),this._addPoint(t),this.canvas.contextTop.moveTo(t.x,t.y)},_addPoint:function(t){return!(1<this._points.length&&t.eq(this._points[this._points.length-1])||(this.drawStraightLine&&1<this._points.length&&(this._hasStraightLine=!0,this._points.pop()),this._points.push(t),0))},_reset:function(){this._points=[],this._setBrushStyles(this.canvas.contextTop),this._setShadow(),this._hasStraightLine=!1},_captureDrawingPath:function(t){t=new V.Point(t.x,t.y);return this._addPoint(t)},_render:function(t){var e,i,n,s=this._points[0],r=this._points[1];for(t=t||this.canvas.contextTop,this._saveAndTransform(t),t.beginPath(),2===this._points.length&&s.x===r.x&&s.y===r.y&&(n=this.width/1e3,s=new V.Point(s.x,s.y),r=new V.Point(r.x,r.y),s.x-=n,r.x+=n),t.moveTo(s.x,s.y),e=1,i=this._points.length;e<i;e++)this._drawSegment(t,s,r),s=this._points[e],r=this._points[e+1];t.lineTo(s.x,s.y),t.stroke(),t.restore()},convertPointsToSVGPath:function(t){var e=this.width/1e3;return V.util.getSmoothPathFromPoints(t,e)},_isEmptySVGPath:function(t){return"M 0 0 Q 0 0 0 0 L 0 0"===V.util.joinPath(t)},createPath:function(t){t=new V.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray});return this.shadow&&(this.shadow.affectStroke=!0,t.shadow=new V.Shadow(this.shadow)),t},decimatePoints:function(t,e){if(t.length<=2)return t;for(var i=this.canvas.getZoom(),n=Math.pow(e/i,2),s=t.length-1,r=t[0],a=[r],o=1;o<s-1;o++)Math.pow(r.x-t[o].x,2)+Math.pow(r.y-t[o].y,2)>=n&&(r=t[o],a.push(r));return a.push(t[s]),a},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath(),this.decimate&&(this._points=this.decimatePoints(this._points,this.decimate));var t=this.convertPointsToSVGPath(this._points);this._isEmptySVGPath(t)?this.canvas.requestRenderAll():(t=this.createPath(t),this.canvas.clearContext(this.canvas.contextTop),this.canvas.fire("before:path:created",{path:t}),this.canvas.add(t),this.canvas.requestRenderAll(),t.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:t}))}}),V.CircleBrush=V.util.createClass(V.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var t=this.addPoint(t),e=this.canvas.contextTop;this._saveAndTransform(e),this.dot(e,t),e.restore()},dot:function(t,e){t.fillStyle=e.fill,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),t.closePath(),t.fill()},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i=this.canvas.contextTop,n=this.points;for(this._saveAndTransform(i),t=0,e=n.length;t<e;t++)this.dot(i,n[t]);i.restore()},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.needsFullRender()?(this.canvas.clearContext(this.canvas.contextTop),this.addPoint(t),this._render()):this.drawDot(t))},onMouseUp:function(){for(var t=this.canvas.renderOnAddRemove,e=(this.canvas.renderOnAddRemove=!1,[]),i=0,n=this.points.length;i<n;i++){var s=this.points[i],s=new V.Circle({radius:s.radius,left:s.x,top:s.y,originX:"center",originY:"center",fill:s.fill});this.shadow&&(s.shadow=new V.Shadow(this.shadow)),e.push(s)}var r=new V.Group(e);r.canvas=this.canvas,this.canvas.fire("before:path:created",{path:r}),this.canvas.add(r),this.canvas.fire("path:created",{path:r}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},addPoint:function(t){var t=new V.Point(t.x,t.y),e=V.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,i=new V.Color(this.color).setAlpha(V.util.getRandomInt(0,100)/100).toRgba();return t.radius=e,t.fill=i,this.points.push(t),t}}),V.SprayBrush=V.util.createClass(V.BaseBrush,{width:10,density:20,dotWidth:1,dotWidthVariance:1,randomOpacity:!1,optimizeOverlapping:!0,initialize:function(t){this.canvas=t,this.sprayChunks=[]},onMouseDown:function(t){this.sprayChunks.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseMove:function(t){!0===this.limitedToCanvasSize&&this._isOutSideCanvas(t)||(this.addSprayChunk(t),this.render(this.sprayChunkPoints))},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,n=this.sprayChunks.length;i<n;i++)for(var s=this.sprayChunks[i],r=0,a=s.length;r<a;r++){var o=new V.Rect({width:s[r].width,height:s[r].width,left:s[r].x+1,top:s[r].y+1,originX:"center",originY:"center",fill:this.color});e.push(o)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var l=new V.Group(e);this.shadow&&l.set("shadow",new V.Shadow(this.shadow)),this.canvas.fire("before:path:created",{path:l}),this.canvas.add(l),this.canvas.fire("path:created",{path:l}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){for(var e,i={},n=0,s=t.length;n<s;n++)i[e=t[n].left+""+t[n].top]||(i[e]=t[n]);var r=[];for(e in i)r.push(i[e]);return r},render:function(t){var e,i,n=this.canvas.contextTop;for(n.fillStyle=this.color,this._saveAndTransform(n),e=0,i=t.length;e<i;e++){var s=t[e];void 0!==s.opacity&&(n.globalAlpha=s.opacity),n.fillRect(s.x,s.y,s.width,s.width)}n.restore()},_render:function(){var t,e,i=this.canvas.contextTop;for(i.fillStyle=this.color,this._saveAndTransform(i),t=0,e=this.sprayChunks.length;t<e;t++)this.render(this.sprayChunks[t]);i.restore()},addSprayChunk:function(t){this.sprayChunkPoints=[];for(var e=this.width/2,i=0;i<this.density;i++){var n=V.util.getRandomInt(t.x-e,t.x+e),s=V.util.getRandomInt(t.y-e,t.y+e),r=this.dotWidthVariance?V.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth,n=new V.Point(n,s);n.width=r,this.randomOpacity&&(n.opacity=V.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(n)}this.sprayChunks.push(this.sprayChunkPoints)}}),V.PatternBrush=V.util.createClass(V.PencilBrush,{getPatternSrc:function(){var t=V.util.createCanvasElement(),e=t.getContext("2d");return t.width=t.height=25,e.fillStyle=this.color,e.beginPath(),e.arc(10,10,10,0,2*Math.PI,!1),e.closePath(),e.fill(),t},getPatternSrcFunction:function(){return String(this.getPatternSrc).replace("this.color",'"'+this.color+'"')},getPattern:function(t){return t.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(t){this.callSuper("_setBrushStyles",t),t.strokeStyle=this.getPattern(t)},createPath:function(t){var t=this.callSuper("createPath",t),e=t._getLeftTopCoords().scalarAdd(t.strokeWidth/2);return t.stroke=new V.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-e.x,offsetY:-e.y}),t}});var M,dt=V.util.getPointer,ut=V.util.degreesToRadians,pt=V.util.isTouchEvent;for(M in V.Canvas=V.util.createClass(V.StaticCanvas,{initialize:function(t,e){e=e||{},this.renderAndResetBound=this.renderAndReset.bind(this),this.requestRenderAllBound=this.requestRenderAll.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniformScaling:!0,uniScaleKey:"shiftKey",centeredScaling:!1,centeredRotation:!1,centeredKey:"altKey",altActionKey:"shiftKey",interactive:!0,selection:!0,selectionKey:"shiftKey",altSelectionKey:null,selectionColor:"rgba(100, 100, 255, 0.3)",selectionDashArray:[],selectionBorderColor:"rgba(255, 255, 255, 0.3)",selectionLineWidth:1,selectionFullyContained:!1,hoverCursor:"move",moveCursor:"move",defaultCursor:"default",freeDrawingCursor:"crosshair",notAllowedCursor:"not-allowed",containerClass:"canvas-container",perPixelTargetFind:!1,targetFindTolerance:0,skipTargetFind:!1,isDrawingMode:!1,preserveObjectStacking:!1,snapAngle:0,snapThreshold:null,stopContextMenu:!1,fireRightClick:!1,fireMiddleClick:!1,targets:[],enablePointerEvents:!1,_hoveredTarget:null,_hoveredTargets:[],_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=V.PencilBrush&&new V.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e=this.getActiveObjects();if(0<e.length&&!this.preserveObjectStacking){for(var i=[],n=[],s=0,r=this._objects.length;s<r;s++)t=this._objects[s],(-1===e.indexOf(t)?i:n).push(t);1<e.length&&(this._activeObject._objects=n),i.push.apply(i,n)}else i=this._objects;return i},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&(this.renderTopLayer(this.contextTop),this.hasLostContext=!1);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){t.save(),this.isDrawingMode&&this._isCurrentlyDrawing&&(this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.contextTopDirty=!0),this.selection&&this._groupSelector&&(this._drawSelection(t),this.contextTopDirty=!0),t.restore()},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this},_normalizePointer:function(t,e){t=t.calcTransformMatrix(),t=V.util.invertTransform(t),e=this.restorePointerVpt(e);return V.util.transformPoint(e,t)},isTargetTransparent:function(t,e,i){var n,s,r;return t.shouldCache()&&t._cacheCanvas&&t!==this._activeObject?(s=this._normalizePointer(t,{x:e,y:i}),n=Math.max(t.cacheTranslationX+s.x*t.zoomX,0),s=Math.max(t.cacheTranslationY+s.y*t.zoomY,0),V.util.isTransparent(t._cacheContext,Math.round(n),Math.round(s),this.targetFindTolerance)):(n=this.contextCache,s=t.selectionBackgroundColor,r=this.viewportTransform,t.selectionBackgroundColor="",this.clearContext(n),n.save(),n.transform(r[0],r[1],r[2],r[3],r[4],r[5]),t.render(n),n.restore(),t.selectionBackgroundColor=s,V.util.isTransparent(n,e,i,this.targetFindTolerance))},_isSelectionKeyPressed:function(e){return Array.isArray(this.selectionKey)?!!this.selectionKey.find(function(t){return!0===e[t]}):e[this.selectionKey]},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||n&&1<i.length&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t,e,i){var n;if(t)return"scale"===e||"scaleX"===e||"scaleY"===e||"resizing"===e?n=this.centeredScaling||t.centeredScaling:"rotate"===e&&(n=this.centeredRotation||t.centeredRotation),n?!i:i},_getOriginFromCorner:function(t,e){t={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?t.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(t.x="left"),"tl"===e||"mt"===e||"tr"===e?t.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(t.y="top"),t},_getActionFromCorner:function(t,e,i,n){return e&&t?(t=n.controls[e]).getActionName(i,t,n):"drag"},_setupCurrentTransform:function(t,e,i){var n,s,r,a,o;e&&(n=this.getPointer(t),s=e.__corner,o=e.controls[s],o=i&&s?o.getActionHandler(t,e,o):V.controlsUtils.dragHandler,i=this._getActionFromCorner(i,s,t,e),r=this._getOriginFromCorner(e,s),a=t[this.centeredKey],o={target:e,action:i,actionHandler:o,corner:s,scaleX:e.scaleX,scaleY:e.scaleY,skewX:e.skewX,skewY:e.skewY,offsetX:n.x-e.left,offsetY:n.y-e.top,originX:r.x,originY:r.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:ut(e.angle),width:e.width*e.scaleX,shiftKey:t.shiftKey,altKey:a,original:V.util.saveObjectTransform(e)},this._shouldCenterTransform(e,i,a)&&(o.originX="center",o.originY="center"),o.original.originX=r.x,o.original.originY=r.y,this._currentTransform=o,this._beforeTransform(t))},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_drawSelection:function(t){var e=this._groupSelector,i=new V.Point(e.ex,e.ey),i=V.util.transformPoint(i,this.viewportTransform),e=new V.Point(e.ex+e.left,e.ey+e.top),e=V.util.transformPoint(e,this.viewportTransform),n=Math.min(i.x,e.x),s=Math.min(i.y,e.y),r=Math.max(i.x,e.x),i=Math.max(i.y,e.y),e=this.selectionLineWidth/2;this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(n,s,r-n,i-s)),this.selectionLineWidth&&this.selectionBorderColor&&(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,n+=e,s+=e,r-=e,i-=e,V.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(n,s,r-n,i-s))},findTarget:function(t,e){if(!this.skipTargetFind){var i,n,s=this.getPointer(t,!0),r=this._activeObject,a=this.getActiveObjects(),o=pt(t),l=1<a.length&&!e||1===a.length;if(this.targets=[],l&&r._findTargetCorner(s,o))return r;if(1<a.length&&!e&&r===this._searchPossibleTargets([r],s))return r;if(1===a.length&&r===this._searchPossibleTargets([r],s)){if(!this.preserveObjectStacking)return r;i=r,n=this.targets,this.targets=[]}l=this._searchPossibleTargets(this._objects,s);return t[this.altSelectionKey]&&l&&i&&l!==i&&(l=i,this.targets=n),l}},_checkTarget:function(t,e,i){if(e&&e.visible&&e.evented&&e.containsPoint(t))return!((this.perPixelTargetFind||e.perPixelTargetFind)&&!e.isEditing&&this.isTargetTransparent(e,i.x,i.y))||void 0},_searchPossibleTargets:function(t,e){for(var i,n=t.length;n--;){var s=t[n],r=s.group?this._normalizePointer(s.group,e):e;if(this._checkTarget(r,s,e)){(i=t[n]).subTargetCheck&&i instanceof V.Group&&(r=this._searchPossibleTargets(i._objects,e))&&this.targets.push(r);break}}return i},restorePointerVpt:function(t){return V.util.transformPoint(t,V.util.invertTransform(this.viewportTransform))},getPointer:function(t,e){var i,n,s,r;return this._absolutePointer&&!e?this._absolutePointer:this._pointer&&e?this._pointer:(t=dt(t),n=(r=(i=this.upperCanvasEl).getBoundingClientRect()).width||0,s=r.height||0,n&&s||("top"in r&&"bottom"in r&&(s=Math.abs(r.top-r.bottom)),"right"in r&&"left"in r&&(n=Math.abs(r.right-r.left))),this.calcOffset(),t.x=t.x-this._offset.left,t.y=t.y-this._offset.top,e||(t=this.restorePointerVpt(t)),1!==(r=this.getRetinaScaling())&&(t.x/=r,t.y/=r),e=0===n||0===s?{width:1,height:1}:{width:i.width/n,height:i.height/s},{x:t.x*e.width,y:t.y*e.height})},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,""),e=this.lowerCanvasEl,i=this.upperCanvasEl;i?i.className="":(i=this._createCanvasElement(),this.upperCanvasEl=i),V.util.addClass(i,"upper-canvas "+t),this.wrapperEl.appendChild(i),this._copyCanvasStyle(e,i),this._applyCanvasStyle(i),this.contextTop=i.getContext("2d")},getTopContext:function(){return this.contextTop},_createCacheCanvas:function(){this.cacheCanvasEl=this._createCanvasElement(),this.cacheCanvasEl.setAttribute("width",this.width),this.cacheCanvasEl.setAttribute("height",this.height),this.contextCache=this.cacheCanvasEl.getContext("2d")},_initWrapperElement:function(){this.wrapperEl=V.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),V.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),V.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;V.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none","-ms-touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,V.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop},getSelectionElement:function(){return this.upperCanvasEl},getActiveObject:function(){return this._activeObject},getActiveObjects:function(){var t=this._activeObject;return t?"activeSelection"===t.type&&t._objects?t._objects.slice(0):[t]:[]},_onObjectRemoved:function(t){t===this._activeObject&&(this.fire("before:selection:cleared",{target:t}),this._discardActiveObject(),this.fire("selection:cleared",{target:t}),t.fire("deselected")),t===this._hoveredTarget&&(this._hoveredTarget=null,this._hoveredTargets=[]),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(e,i){var n=!1,s=this.getActiveObjects(),r=[],a=[];e.forEach(function(t){-1===s.indexOf(t)&&(n=!0,t.fire("deselected",{e:i,target:t}),a.push(t))}),s.forEach(function(t){-1===e.indexOf(t)&&(n=!0,t.fire("selected",{e:i,target:t}),r.push(t))}),0<e.length&&0<s.length?n&&this.fire("selection:updated",{e:i,selected:r,deselected:a}):0<s.length?this.fire("selection:created",{e:i,selected:r}):0<e.length&&this.fire("selection:cleared",{e:i,deselected:a})},setActiveObject:function(t,e){var i=this.getActiveObjects();return this._setActiveObject(t,e),this._fireSelectionEvents(i,e),this},_setActiveObject:function(t,e){return this._activeObject!==t&&!!this._discardActiveObject(e,t)&&!t.onSelect({e:e})&&(this._activeObject=t,!0)},_discardActiveObject:function(t,e){var i=this._activeObject;if(i){if(i.onDeselect({e:t,object:e}))return!1;this._activeObject=null}return!0},discardActiveObject:function(t){var e=this.getActiveObjects(),i=this.getActiveObject();return e.length&&this.fire("before:selection:cleared",{target:i,e:t}),this._discardActiveObject(t),this._fireSelectionEvents(e,t),this},dispose:function(){var t=this.wrapperEl;return this.removeListeners(),t.removeChild(this.upperCanvasEl),t.removeChild(this.lowerCanvasEl),this.contextCache=null,this.contextTop=null,["upperCanvasEl","cacheCanvasEl"].forEach(function(t){V.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this)),t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,V.StaticCanvas.prototype.dispose.call(this),this},clear:function(){return this.discardActiveObject(),this.clearContext(this.contextTop),this.callSuper("clear")},drawControls:function(t){var e=this._activeObject;e&&e._renderControls(t)},_toObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(t),e=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),e},_realizeGroupTransformOnObject:function(e){var i;return e.group&&"activeSelection"===e.group.type&&this._activeObject===e.group?(i={},["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(t){i[t]=e[t]}),V.util.addTransformToObject(e,this._activeObject.calcOwnMatrix()),i):null},_unwindGroupTransformOnObject:function(t,e){e&&t.set(e)},_setSVGObject:function(t,e,i){var n=this._realizeGroupTransformOnObject(e);this.callSuper("_setSVGObject",t,e,i),this._unwindGroupTransformOnObject(e,n)},setViewportTransform:function(t){this.renderOnAddRemove&&this._activeObject&&this._activeObject.isEditing&&this._activeObject.clearContextTop(),V.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),V.StaticCanvas)"prototype"!==M&&(V.Canvas[M]=V.StaticCanvas[M]);function ft(t){t.textDecoration&&(-1<t.textDecoration.indexOf("underline")&&(t.underline=!0),-1<t.textDecoration.indexOf("line-through")&&(t.linethrough=!0),-1<t.textDecoration.indexOf("overline")&&(t.overline=!0),delete t.textDecoration)}function gt(e,t,i){var n={};i.forEach(function(t){n[t]=e[t]}),Y(e[t],n,!0)}function P(t,e){var i;return e?e.toLive?t+": url(#SVGID_"+e.id+"); ":(i=t+": "+(e=new V.Color(e)).toRgb()+"; ",1!==(e=e.getAlpha())&&(i+=t+"-opacity: "+e.toString()+"; "),i):t+": none; "}function _(t,e){return t.button&&t.button===e-1}function mt(t,e,i,n){return n=t<Math.abs(e)?(t=e,i/4):0===e&&0===t?i/(2*Math.PI)*Math.asin(1):i/(2*Math.PI)*Math.asin(e/t),{a:t,c:e,p:i,s:n}}function vt(t,e,i){return t.a*Math.pow(2,10*--e)*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function bt(t,e,i,n){return i-yt(n-t,0,i,n)+e}function yt(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e}function xt(t,e,i){return"rgba("+parseInt(t[0]+i*(e[0]-t[0]),10)+","+parseInt(t[1]+i*(e[1]-t[1]),10)+","+parseInt(t[2]+i*(e[2]-t[2]),10)+(","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1))+")"}function wt(){return!1}function Ct(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e}function St(){return J.apply(V.window,arguments)}function Et(){}function Tt(){}function At(){}function It(t){for(var e=null,i=this;i.constructor.superclass;){var n=i.constructor.superclass.prototype[t];if(i[t]!==n){e=n;break}i=i.constructor.superclass.prototype}return e?1<arguments.length?e.apply(this,K.call(arguments,1)):e.call(this):console.log("tried to callSuper "+t+", method not found in prototype chain",this)}function D(t,e,i){if(i)if(!V.isLikelyNode&&e instanceof Element)t=e;else if(e instanceof Array){t=[];for(var n=0,s=e.length;n<s;n++)t[n]=D({},e[n],i)}else if(e&&"object"==typeof e)for(var r in e)"canvas"===r||"group"===r?t[r]=null:e.hasOwnProperty(r)&&(t[r]=D({},e[r],i));else t=e;else for(var r in e)t[r]=e[r];return t}function Ot(t,e,i){if(t&&0!==t.length){var n=t.length-1,s=e?t[n][e]:t[n];if(e)for(;n--;)i(t[n][e],s)&&(s=t[n][e]);else for(;n--;)i(t[n],s)&&(s=t[n]);return s}}function kt(t,e,i,n){e=Math.atan2(e,t),t=Math.atan2(n,i);return e<=t?t-e:2*Math.PI-(e-t)}function Mt(t,e,i){for(var n=i[1],s=i[2],W=i[3],r=i[4],a=i[5],o=function(t,e,i,n,s,r){var a=Math.PI,o=W*a/180,l=V.util.sin(o),c=V.util.cos(o),h=0,d=0,o=-c*t*.5-l*e*.5,u=-c*e*.5+l*t*.5,p=(i=Math.abs(i))*i,f=(n=Math.abs(n))*n,g=u*u,m=o*o,v=p*f-p*g-f*m,b=0,y=(v<0?(i*=y=Math.sqrt(1-v/(p*f)),n*=y):b=(s===r?-1:1)*Math.sqrt(v/(p*g+f*m)),b*i*u/n),s=-b*n*o/i,F=c*y-l*s+.5*t,j=l*y+c*s+.5*e,x=kt(1,0,(o-y)/i,(u-s)/n),v=kt((o-y)/i,(u-s)/n,(-o-y)/i,(-u-s)/n);0===r&&0<v?v-=2*a:1===r&&v<0&&(v+=2*a);for(var w,C,S,E,T,A,I,O,k,R,N,M,P,H=Math.ceil(Math.abs(v/a*2)),_=[],D=v/H,z=8/3*Math.sin(D/4)*Math.sin(D/4)/Math.sin(D/2),L=x+D,B=0;B<H;B++)_[B]=(w=x,C=L,S=c,E=l,T=i,A=n,I=F,O=j,k=z,R=h,N=d,P=M=void 0,M=V.util.cos(w),w=V.util.sin(w),P=V.util.cos(C),C=V.util.sin(C),["C",R+k*(-S*T*w-E*A*M),N+k*(-E*T*w+S*A*M),(I=S*T*P-E*A*C+I)+k*(S*T*C+E*A*P),(O=E*T*P+S*A*C+O)+k*(E*T*C-S*A*P),I,O]),h=_[B][5],d=_[B][6],x=L,L+=D;return _}(i[6]-t,i[7]-e,n,s,r,a),l=0,c=o.length;l<c;l++)o[l][1]+=t,o[l][2]+=e,o[l][3]+=t,o[l][4]+=e,o[l][5]+=t,o[l][6]+=e;return o}function L(t,e,i,n){return Math.sqrt((i-t)*(i-t)+(n-e)*(n-e))}function Pt(t,e,i){for(var n,s={x:e,y:i},r=0,a=1;a<=100;a+=1)n=t(a/100),r+=L(s.x,s.y,n.x,n.y),s=n;return r}function _t(t){for(var e,i,n,s,r=0,a=t.length,o=0,l=0,c=0,h=0,d=[],u=0;u<a;u++){switch(n={x:o,y:l,command:(e=t[u])[0]},e[0]){case"M":n.length=0,c=o=e[1],h=l=e[2];break;case"L":n.length=L(o,l,e[1],e[2]),o=e[1],l=e[2];break;case"C":i=function(s,r,a,o,l,c,h,d){return function(t){var e=t*t*t,i=3*t*t*(1-t),n=3*t*(1-t)*(1-t),t=(1-t)*(1-t)*(1-t);return{x:h*e+l*i+a*n+s*t,y:d*e+c*i+o*n+r*t}}}(o,l,e[1],e[2],e[3],e[4],e[5],e[6]),s=function(i,n,s,r,a,o,l,c){return function(t){var e=1-t;return Math.atan2(3*e*e*(r-n)+6*e*t*(o-r)+3*t*t*(c-o),3*e*e*(s-i)+6*e*t*(a-s)+3*t*t*(l-a))}}(o,l,e[1],e[2],e[3],e[4],e[5],e[6]),n.iterator=i,n.angleFinder=s,n.length=Pt(i,o,l),o=e[5],l=e[6];break;case"Q":i=function(n,s,r,a,o,l){return function(t){var e=t*t,i=2*t*(1-t),t=(1-t)*(1-t);return{x:o*e+r*i+n*t,y:l*e+a*i+s*t}}}(o,l,e[1],e[2],e[3],e[4]),s=function(i,n,s,r,a,o){return function(t){var e=1-t;return Math.atan2(2*e*(r-n)+2*t*(o-r),2*e*(s-i)+2*t*(a-s))}}(o,l,e[1],e[2],e[3],e[4]),n.iterator=i,n.angleFinder=s,n.length=Pt(i,o,l),o=e[3],l=e[4];break;case"Z":case"z":n.destX=c,n.destY=h,n.length=L(o,l,c,h),o=c,l=h}r+=n.length,d.push(n)}return d.push({length:r,x:o,y:l}),d}function Dt(t,e){this.__eventListeners[t]&&(t=this.__eventListeners[t],e?t[t.indexOf(e)]=!1:V.util.array.fill(t,!1))}function Lt(t,e){var i=function(){e.apply(this,arguments),this.off(t,i)}.bind(this);this.on(t,i)}T=V.util.addListener,A=V.util.removeListener,I={passive:!1},V.util.object.extend(V.Canvas.prototype,{mainTouchId:null,_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(T,"add")},_getEventPrefix:function(){return this.enablePointerEvents?"pointer":"mouse"},addOrRemove:function(t,e){var i=this.upperCanvasEl,n=this._getEventPrefix();t(V.window,"resize",this._onResize),t(i,n+"down",this._onMouseDown),t(i,n+"move",this._onMouseMove,I),t(i,n+"out",this._onMouseOut),t(i,n+"enter",this._onMouseEnter),t(i,"wheel",this._onMouseWheel),t(i,"contextmenu",this._onContextMenu),t(i,"dblclick",this._onDoubleClick),t(i,"dragover",this._onDragOver),t(i,"dragenter",this._onDragEnter),t(i,"dragleave",this._onDragLeave),t(i,"drop",this._onDrop),this.enablePointerEvents||t(i,"touchstart",this._onTouchStart,I),"undefined"!=typeof eventjs&&e in eventjs&&(eventjs[e](i,"gesture",this._onGesture),eventjs[e](i,"drag",this._onDrag),eventjs[e](i,"orientation",this._onOrientationChange),eventjs[e](i,"shake",this._onShake),eventjs[e](i,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(A,"remove");var t=this._getEventPrefix();A(V.document,t+"up",this._onMouseUp),A(V.document,"touchend",this._onTouchEnd,I),A(V.document,t+"move",this._onMouseMove,I),A(V.document,"touchmove",this._onMouseMove,I)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onTouchStart=this._onTouchStart.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._onTouchEnd=this._onTouchEnd.bind(this),this._onResize=this._onResize.bind(this),this._onGesture=this._onGesture.bind(this),this._onDrag=this._onDrag.bind(this),this._onShake=this._onShake.bind(this),this._onLongPress=this._onLongPress.bind(this),this._onOrientationChange=this._onOrientationChange.bind(this),this._onMouseWheel=this._onMouseWheel.bind(this),this._onMouseOut=this._onMouseOut.bind(this),this._onMouseEnter=this._onMouseEnter.bind(this),this._onContextMenu=this._onContextMenu.bind(this),this._onDoubleClick=this._onDoubleClick.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragEnter=this._simpleEventHandler.bind(this,"dragenter"),this._onDragLeave=this._simpleEventHandler.bind(this,"dragleave"),this._onDrop=this._onDrop.bind(this),this.eventsBound=!0)},_onGesture:function(t,e){this.__onTransformGesture&&this.__onTransformGesture(t,e)},_onDrag:function(t,e){this.__onDrag&&this.__onDrag(t,e)},_onMouseWheel:function(t){this.__onMouseWheel(t)},_onMouseOut:function(e){var i=this._hoveredTarget,n=(this.fire("mouse:out",{target:i,e:e}),this._hoveredTarget=null,i&&i.fire("mouseout",{e:e}),this);this._hoveredTargets.forEach(function(t){n.fire("mouse:out",{target:i,e:e}),t&&i.fire("mouseout",{e:e})}),this._hoveredTargets=[]},_onMouseEnter:function(t){this._currentTransform||this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null,this._hoveredTargets=[])},_onOrientationChange:function(t,e){this.__onOrientationChange&&this.__onOrientationChange(t,e)},_onShake:function(t,e){this.__onShake&&this.__onShake(t,e)},_onLongPress:function(t,e){this.__onLongPress&&this.__onLongPress(t,e)},_onDragOver:function(t){t.preventDefault();var e=this._simpleEventHandler("dragover",t);this._fireEnterLeaveEvents(e,t)},_onDrop:function(t){return this._simpleEventHandler("drop:before",t),this._simpleEventHandler("drop",t)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},getPointerId:function(t){var e=t.changedTouches;return e?e[0]&&e[0].identifier:this.enablePointerEvents?t.pointerId:-1},_isMainEvent:function(t){return!0===t.isPrimary||!1!==t.isPrimary&&("touchend"===t.type&&0===t.touches.length||!t.changedTouches||t.changedTouches[0].identifier===this.mainTouchId)},_onTouchStart:function(t){t.preventDefault(),null===this.mainTouchId&&(this.mainTouchId=this.getPointerId(t)),this.__onMouseDown(t),this._resetTransformEventData();var t=this.upperCanvasEl,e=this._getEventPrefix();T(V.document,"touchend",this._onTouchEnd,I),T(V.document,"touchmove",this._onMouseMove,I),A(t,e+"down",this._onMouseDown)},_onMouseDown:function(t){this.__onMouseDown(t),this._resetTransformEventData();var t=this.upperCanvasEl,e=this._getEventPrefix();A(t,e+"move",this._onMouseMove,I),T(V.document,e+"up",this._onMouseUp),T(V.document,e+"move",this._onMouseMove,I)},_onTouchEnd:function(t){var e,i;0<t.touches.length||(this.__onMouseUp(t),this._resetTransformEventData(),this.mainTouchId=null,e=this._getEventPrefix(),A(V.document,"touchend",this._onTouchEnd,I),A(V.document,"touchmove",this._onMouseMove,I),(i=this)._willAddMouseDown&&clearTimeout(this._willAddMouseDown),this._willAddMouseDown=setTimeout(function(){T(i.upperCanvasEl,e+"down",i._onMouseDown),i._willAddMouseDown=0},400))},_onMouseUp:function(t){this.__onMouseUp(t),this._resetTransformEventData();var e=this.upperCanvasEl,i=this._getEventPrefix();this._isMainEvent(t)&&(A(V.document,i+"up",this._onMouseUp),A(V.document,i+"move",this._onMouseMove,I),T(e,i+"move",this._onMouseMove,I))},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t){var e=this._activeObject;return!!(!!e!=!!t||e&&t&&e!==t)||(e&&e.isEditing,!1)},__onMouseUp:function(t){var e,i,n,s,r,a=this._currentTransform,o=this._groupSelector,l=!1,o=!o||0===o.left&&0===o.top;this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),_(t,3)?this.fireRightClick&&this._handleEvent(t,"up",3,o):_(t,2)?(this.fireMiddleClick&&this._handleEvent(t,"up",2,o),this._resetTransformEventData()):this.isDrawingMode&&this._isCurrentlyDrawing?this._onMouseUpInDrawingMode(t):this._isMainEvent(t)&&(a&&(this._finalizeCurrentTransform(t),l=a.actionPerformed),o||(n=e===this._activeObject,this._maybeGroupObjects(t),l=l||this._shouldRender(e)||!n&&e===this._activeObject),e&&(s=e._findTargetCorner(this.getPointer(t,!0),V.util.isTouchEvent(t)),e.selectable&&e!==this._activeObject&&"up"===e.activeOn?(this.setActiveObject(e,t),l=!0):(n=(i=e.controls[s])&&i.getMouseUpHandler(t,e,i))&&n(t,a,(r=this.getPointer(t)).x,r.y),e.isMoving=!1),!a||a.target===e&&a.corner===s||(s=(n=a.target&&a.target.controls[a.corner])&&n.getMouseUpHandler(t,e,i),r=r||this.getPointer(t),s&&s(t,a,r.x,r.y)),this._setCursorFromEvent(t,e),this._handleEvent(t,"up",1,o),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),l?this.requestRenderAll():o||this.renderTop())},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,s={e:e,target:i,subTargets:n};if(this.fire(t,s),i&&i.fire(t,s),n)for(var r=0;r<n.length;r++)n[r].fire(t,s);return i},_handleEvent:function(t,e,i,n){var s=this._target,r=this.targets||[],a={e:t,target:s,subTargets:r,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};"up"===e&&(a.currentTarget=this.findTarget(t),a.currentSubTargets=this.targets),this.fire("mouse:"+e,a),s&&s.fire("mouse"+e,a);for(var o=0;o<r.length;o++)r[o].fire("mouse"+e,a)},_finalizeCurrentTransform:function(t){var e=this._currentTransform,i=e.target,t={e:t,target:i,transform:e,action:e.action};i._scaling&&(i._scaling=!1),i.setCoords(),(e.actionPerformed||this.stateful&&i.hasStateChanged())&&this._fire("modified",t)},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll();var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e,{e:t,pointer:e}),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){var e;this._isCurrentlyDrawing&&(e=this.getPointer(t),this.freeDrawingBrush.onMouseMove(e,{e:t,pointer:e})),this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){var e=this.getPointer(t);this._isCurrentlyDrawing=this.freeDrawingBrush.onMouseUp({e:t,pointer:e}),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e,i,n,s,r,a=this._target;_(t,3)?this.fireRightClick&&this._handleEvent(t,"down",3):_(t,2)?this.fireMiddleClick&&this._handleEvent(t,"down",2):this.isDrawingMode?this._onMouseDownInDrawingMode(t):this._isMainEvent(t)&&!this._currentTransform&&(e=this._pointer,this._previousPointer=e,i=this._shouldRender(a),n=this._shouldGroup(t,a),this._shouldClearSelection(t,a)?this.discardActiveObject(t):n&&(this._handleGrouping(t,a),a=this._activeObject),!this.selection||a&&(a.selectable||a.isEditing||a===this._activeObject)||(this._groupSelector={ex:this._absolutePointer.x,ey:this._absolutePointer.y,top:0,left:0}),a&&(s=a===this._activeObject,a.selectable&&"down"===a.activeOn&&this.setActiveObject(a,t),r=a._findTargetCorner(this.getPointer(t,!0),V.util.isTouchEvent(t)),a.__corner=r,a===this._activeObject)&&(r||!n)&&(this._setupCurrentTransform(t,a,s),s=a.controls[r],e=this.getPointer(t),r=s&&s.getMouseDownHandler(t,a,s))&&r(t,this._currentTransform,e.x,e.y),this._handleEvent(t,"down"),i||n)&&this.requestRenderAll()},_resetTransformEventData:function(){this._target=null,this._pointer=null,this._absolutePointer=null},_cacheTransformEventData:function(t){this._resetTransformEventData(),this._pointer=this.getPointer(t,!0),this._absolutePointer=this.restorePointerVpt(this._pointer),this._target=this._currentTransform?this._currentTransform.target:this.findTarget(t)||null},_beforeTransform:function(t){var e=this._currentTransform;this.stateful&&e.target.saveState(),this.fire("before:transform",{e:t,transform:e})},__onMouseMove:function(t){var e,i;this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode?this._onMouseMoveInDrawingMode(t):this._isMainEvent(t)&&((i=this._groupSelector)?(e=this._absolutePointer,i.left=e.x-i.ex,i.top=e.y-i.ey,this.renderTop()):this._currentTransform?this._transformObject(t):(e=this.findTarget(t)||null,this._setCursorFromEvent(t,e),this._fireOverOutEvents(e,t)),this._handleEvent(t,"move"),this._resetTransformEventData())},_fireOverOutEvents:function(t,e){var i=this._hoveredTarget,n=this._hoveredTargets,s=this.targets,r=Math.max(n.length,s.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"mouseout",canvasEvtOut:"mouse:out",evtIn:"mouseover",canvasEvtIn:"mouse:over"});for(var a=0;a<r;a++)this.fireSyntheticInOutEvents(s[a],e,{oldTarget:n[a],evtOut:"mouseout",evtIn:"mouseover"});this._hoveredTarget=t,this._hoveredTargets=this.targets.concat()},_fireEnterLeaveEvents:function(t,e){var i=this._draggedoverTarget,n=this._hoveredTargets,s=this.targets,r=Math.max(n.length,s.length);this.fireSyntheticInOutEvents(t,e,{oldTarget:i,evtOut:"dragleave",evtIn:"dragenter"});for(var a=0;a<r;a++)this.fireSyntheticInOutEvents(s[a],e,{oldTarget:n[a],evtOut:"dragleave",evtIn:"dragenter"});this._draggedoverTarget=t},fireSyntheticInOutEvents:function(t,e,i){var n,s,r=i.oldTarget,a=r!==t,o=i.canvasEvtIn,l=i.canvasEvtOut;a&&(n={e:e,target:t,previousTarget:r},s={e:e,target:r,nextTarget:t}),e=t&&a,r&&a&&(l&&this.fire(l,s),r.fire(i.evtOut,s)),e&&(o&&this.fire(o,n),t.fire(i.evtIn,n))},__onMouseWheel:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"wheel"),this._resetTransformEventData()},_transformObject:function(t){var e=this.getPointer(t),i=this._currentTransform;i.reset=!1,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var n=i.x,i=i.y,s=e.action,r=!1,a=e.actionHandler;a&&(r=a(t,e,n,i)),"drag"===s&&r&&(e.target.isMoving=!0,this.setCursor(e.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||r},_fire:V.controlsUtils.fireEvent,_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;var i=e.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,n=(!n||!n.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));n?this.setCursor(this.getCornerCursor(n,e,t)):(e.subTargetCheck&&this.targets.concat().reverse().map(function(t){i=t.hoverCursor||i}),this.setCursor(i))},getCornerCursor:function(t,e,i){t=e.controls[t];return t.cursorStyleHandler(i,t,e)}}),u=Math.min,N=Math.max,V.util.object.extend(V.Canvas.prototype,{_shouldGroup:function(t,e){var i=this._activeObject;return i&&this._isSelectionKeyPressed(t)&&e&&e.selectable&&this.selection&&(i!==e||"activeSelection"===i.type)&&!e.onSelect({e:t})},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0))&&e.selectable)&&(i&&"activeSelection"===i.type?this._updateActiveSelection(e,t):this._createActiveSelection(e,t))},_updateActiveSelection:function(t,e){var i=this._activeObject,n=i._objects.slice(0);i.contains(t)?(i.removeWithUpdate(t),this._hoveredTarget=t,this._hoveredTargets=this.targets.concat(),1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i,this._hoveredTargets=this.targets.concat()),this._fireSelectionEvents(n,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),t=this._createGroup(t);this._hoveredTarget=t,this._setActiveObject(t,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this._objects,e=e.indexOf(this._activeObject)<e.indexOf(t)?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new V.ActiveSelection(e,{canvas:this})},_groupSelectedObjects:function(t){var e=this._collectObjects(t);1===e.length?this.setActiveObject(e[0],t):1<e.length&&(e=new V.ActiveSelection(e.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(e){for(var t,i=[],n=this._groupSelector.ex,s=this._groupSelector.ey,r=n+this._groupSelector.left,a=s+this._groupSelector.top,o=new V.Point(u(n,r),u(s,a)),l=new V.Point(N(n,r),N(s,a)),c=!this.selectionFullyContained,h=n===r&&s===a,d=this._objects.length;d--&&!((t=this._objects[d])&&t.selectable&&t.visible&&(c&&t.intersectsWithRect(o,l,!0)||t.isContainedWithinRect(o,l,!0)||c&&t.containsPoint(o,null,!0)||c&&t.containsPoint(l,null,!0))&&(i.push(t),h)););return i=1<i.length?i.filter(function(t){return!t.onSelect({e:e})}):i},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}}),V.util.object.extend(V.StaticCanvas.prototype,{toDataURL:function(t){var e=(t=t||{}).format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?this.getRetinaScaling():1),n=this.toCanvasElement(n,t);return V.util.toDataURL(n,e,i)},toCanvasElement:function(t,e){var i=((e=e||{}).width||this.width)*(t=t||1),n=(e.height||this.height)*t,s=this.getZoom(),r=this.width,a=this.height,s=s*t,o=this.viewportTransform,l=(o[4]-(e.left||0))*t,e=(o[5]-(e.top||0))*t,t=this.interactive,s=[s,0,0,s,l,e],l=this.enableRetinaScaling,e=V.util.createCanvasElement(),c=this.contextTop;return e.width=i,e.height=n,this.contextTop=null,this.enableRetinaScaling=!1,this.interactive=!1,this.viewportTransform=s,this.width=i,this.height=n,this.calcViewportBoundaries(),this.renderCanvas(e.getContext("2d"),this._objects),this.viewportTransform=o,this.width=r,this.height=a,this.calcViewportBoundaries(),this.interactive=t,this.enableRetinaScaling=l,this.contextTop=c,e}}),V.util.object.extend(V.StaticCanvas.prototype,{loadFromJSON:function(t,i,e){var n,s,r,a;if(t)return n="string"==typeof t?JSON.parse(t):V.util.object.clone(t),r=n.clipPath,a=(s=this).renderOnAddRemove,this.renderOnAddRemove=!1,delete n.clipPath,this._enlivenObjects(n.objects,function(e){s.clear(),s._setBgOverlay(n,function(){r?s._enlivenObjects([r],function(t){s.clipPath=t[0],s.__setupCanvas.call(s,n,e,a,i)}):s.__setupCanvas.call(s,n,e,a,i)})},e),this},__setupCanvas:function(t,e,i,n){var s=this;e.forEach(function(t,e){s.insertAt(t,e)}),this.renderOnAddRemove=i,delete t.objects,delete t.backgroundImage,delete t.overlayImage,delete t.background,delete t.overlay,this._setOptions(t),this.renderAll(),n&&n()},_setBgOverlay:function(t,e){var i,n={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};t.backgroundImage||t.overlayImage||t.background||t.overlay?(this.__setBgOverlay("backgroundImage",t.backgroundImage,n,i=function(){n.backgroundImage&&n.overlayImage&&n.backgroundColor&&n.overlayColor&&e&&e()}),this.__setBgOverlay("overlayImage",t.overlayImage,n,i),this.__setBgOverlay("backgroundColor",t.background,n,i),this.__setBgOverlay("overlayColor",t.overlay,n,i)):e&&e()},__setBgOverlay:function(e,t,i,n){var s=this;t?"backgroundImage"===e||"overlayImage"===e?V.util.enlivenObjects([t],function(t){s[e]=t[0],i[e]=!0,n&&n()}):this["set"+V.util.string.capitalize(e,!0)](t,function(){i[e]=!0,n&&n()}):(i[e]=!0,n&&n())},_enlivenObjects:function(t,e,i){t&&0!==t.length?V.util.enlivenObjects(t,function(t){e&&e(t)},null,i):e&&e([])},_toDataURL:function(e,i){this.clone(function(t){i(t.toDataURL(e))})},_toDataURLWithMultiplier:function(e,i,n){this.clone(function(t){n(t.toDataURLWithMultiplier(e,i))})},clone:function(e,t){var i=JSON.stringify(this.toJSON(t));this.cloneWithoutData(function(t){t.loadFromJSON(i,function(){e&&e(t)})})},cloneWithoutData:function(t){var e=V.util.createCanvasElement(),i=(e.width=this.width,e.height=this.height,new V.Canvas(e));this.backgroundImage?(i.setBackgroundImage(this.backgroundImage.src,function(){i.renderAll(),t&&t(i)}),i.backgroundImageOpacity=this.backgroundImageOpacity,i.backgroundImageStretch=this.backgroundImageStretch):t&&t(i)}}),function(t){"use strict";var f=t.fabric||(t.fabric={}),t=f.util.object.extend,r=f.util.object.clone,i=f.util.toFixed,e=f.util.string.capitalize,a=f.util.degreesToRadians,n=!f.isLikelyNode;f.Object||(f.Object=f.util.createClass(f.CommonMethods,{type:"object",originX:"left",originY:"top",top:0,left:0,width:0,height:0,scaleX:1,scaleY:1,flipX:!1,flipY:!1,opacity:1,angle:0,skewX:0,skewY:0,cornerSize:13,touchCornerSize:24,transparentCorners:!0,hoverCursor:null,moveCursor:null,padding:0,borderColor:"rgb(178,204,255)",borderDashArray:null,cornerColor:"rgb(178,204,255)",cornerStrokeColor:null,cornerStyle:"rect",cornerDashArray:null,centeredScaling:!1,centeredRotation:!0,fill:"rgb(0,0,0)",fillRule:"nonzero",globalCompositeOperation:"source-over",backgroundColor:"",selectionBackgroundColor:"",stroke:null,strokeWidth:1,strokeDashArray:null,strokeDashOffset:0,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,perPixelTargetFind:!1,includeDefaultValues:!0,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:n,statefullCache:!1,noScaleCache:!0,strokeUniform:!1,dirty:!0,__corner:0,paintFirst:"fill",activeOn:"down",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow visible backgroundColor skewX skewY fillRule paintFirst clipPath strokeUniform".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeUniform strokeLineCap strokeDashOffset strokeLineJoin strokeMiterLimit backgroundColor clipPath".split(" "),colorProperties:"fill stroke backgroundColor".split(" "),clipPath:void 0,inverted:!1,absolutePositioned:!1,initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=f.util.createCanvasElement(),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var e,i,n=f.perfLimitSizeTotal,s=t.width,r=t.height,a=f.maxCacheSideLimit,o=f.minCacheSideLimit;return s<=a&&r<=a&&s*r<=n?(s<o&&(t.width=o),r<o&&(t.height=o)):(n=f.util.limitDimsByArea(s/r,n),e=(i=f.util.capValue)(o,n.x,a),i=i(o,n.y,a),e<s&&(t.zoomX/=s/e,t.width=e,t.capped=!0),i<r&&(t.zoomY/=r/i,t.height=i,t.capped=!0)),t},_getCacheCanvasDimensions:function(){var t=this.getTotalObjectScaling(),e=this._getTransformedDimensions(0,0),i=e.x*t.scaleX/this.scaleX,e=e.y*t.scaleY/this.scaleY;return{width:2+i,height:2+e,zoomX:t.scaleX,zoomY:t.scaleY,x:i,y:e}},_updateCacheCanvas:function(){var t=this.canvas;if(this.noScaleCache&&t&&t._currentTransform){var e=t._currentTransform.target,t=t._currentTransform.action;if(this===e&&t.slice&&"scale"===t.slice(0,5))return!1}var i,n,e=this._cacheCanvas,t=this._limitCacheSize(this._getCacheCanvasDimensions()),s=f.minCacheSideLimit,r=t.width,a=t.height,o=t.zoomX,l=t.zoomY,c=r!==this.cacheWidth||a!==this.cacheHeight,h=this.zoomX!==o||this.zoomY!==l,h=c||h,d=0,u=0,p=!1;return c&&(c=this._cacheCanvas.width,i=this._cacheCanvas.height,p=(n=c<r||i<a)||(r<.9*c||a<.9*i)&&s<c&&s<i,n)&&!t.capped&&(s<r||s<a)&&(d=.1*r,u=.1*a),this instanceof f.Text&&this.path&&(p=h=!0,d+=this.getHeightOfLine(0)*this.zoomX,u+=this.getHeightOfLine(0)*this.zoomY),!!h&&(p?(e.width=Math.ceil(r+d),e.height=Math.ceil(a+u)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,e.width,e.height)),c=t.x/2,i=t.y/2,this.cacheTranslationX=Math.round(e.width/2-c)+c,this.cacheTranslationY=Math.round(e.height/2-i)+i,this.cacheWidth=r,this.cacheHeight=a,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(o,l),this.zoomX=o,this.zoomY=l,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e=this.group&&!this.group._transformDone||this.group&&this.canvas&&t===this.canvas.contextTop,e=this.calcTransformMatrix(!e);t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},toObject:function(t){var e=f.Object.NUM_FRACTION_DIGITS,e={type:this.type,version:f.version,originX:this.originX,originY:this.originY,left:i(this.left,e),top:i(this.top,e),width:i(this.width,e),height:i(this.height,e),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:i(this.strokeWidth,e),strokeDashArray:this.strokeDashArray&&this.strokeDashArray.concat(),strokeLineCap:this.strokeLineCap,strokeDashOffset:this.strokeDashOffset,strokeLineJoin:this.strokeLineJoin,strokeUniform:this.strokeUniform,strokeMiterLimit:i(this.strokeMiterLimit,e),scaleX:i(this.scaleX,e),scaleY:i(this.scaleY,e),angle:i(this.angle,e),flipX:this.flipX,flipY:this.flipY,opacity:i(this.opacity,e),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,skewX:i(this.skewX,e),skewY:i(this.skewY,e)};return this.clipPath&&!this.clipPath.excludeFromExport&&(e.clipPath=this.clipPath.toObject(t),e.clipPath.inverted=this.clipPath.inverted,e.clipPath.absolutePositioned=this.clipPath.absolutePositioned),f.util.populateWithProperties(this,e,t),e=this.includeDefaultValues?e:this._removeDefaultValues(e)},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(e){var i=f.util.getKlass(e.type).prototype;return i.stateProperties.forEach(function(t){"left"!==t&&"top"!==t&&(e[t]===i[t]&&delete e[t],Array.isArray(e[t]))&&Array.isArray(i[t])&&0===e[t].length&&0===i[t].length&&delete e[t]}),e},toString:function(){return"#<fabric."+e(this.type)+">"},getObjectScaling:function(){var t;return this.group?(t=f.util.qrDecompose(this.calcTransformMatrix()),{scaleX:Math.abs(t.scaleX),scaleY:Math.abs(t.scaleY)}):{scaleX:this.scaleX,scaleY:this.scaleY}},getTotalObjectScaling:function(){var t,e,i=this.getObjectScaling(),n=i.scaleX,i=i.scaleY;return this.canvas&&(n*=(t=this.canvas.getZoom())*(e=this.canvas.getRetinaScaling()),i*=t*e),{scaleX:n,scaleY:i}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,e){var i=this[t]!==e;return("scaleX"===t||"scaleY"===t)&&(e=this._constrainScale(e)),"scaleX"===t&&e<0?(this.flipX=!this.flipX,e*=-1):"scaleY"===t&&e<0?(this.flipY=!this.flipY,e*=-1):"shadow"!==t||!e||e instanceof f.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",e):e=new f.Shadow(e),this[t]=e,i&&(e=this.group&&this.group.isOnACache(),-1<this.cacheProperties.indexOf(t)?(this.dirty=!0,e&&this.group.set("dirty",!0)):e&&-1<this.stateProperties.indexOf(t)&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:f.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||!this.width&&!this.height&&0===this.strokeWidth||!this.visible},render:function(t){this.isNotVisible()||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(t.save(),this._setupCompositeOperation(t),this.drawSelectionBackground(t),this.transform(t),this._setOpacity(t),this._setShadow(t,this),this.shouldCache()?(this.renderCache(),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),t.restore())},renderCache:function(t){t=t||{},this._cacheCanvas&&this._cacheContext||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext,t.forClipping),this.dirty=!1)},_removeCacheCanvas:function(){this._cacheCanvas=null,this._cacheContext=null,this.cacheWidth=0,this.cacheHeight=0},hasStroke:function(){return this.stroke&&"transparent"!==this.stroke&&0!==this.strokeWidth},hasFill:function(){return this.fill&&"transparent"!==this.fill},needsItsOwnCache:function(){return!("stroke"!==this.paintFirst||!this.hasFill()||!this.hasStroke()||"object"!=typeof this.shadow)||!!this.clipPath},shouldCache:function(){return this.ownCaching=this.needsItsOwnCache()||this.objectCaching&&(!this.group||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawClipPathOnCache:function(t,e){var i;t.save(),e.inverted?t.globalCompositeOperation="destination-out":t.globalCompositeOperation="destination-in",e.absolutePositioned&&(i=f.util.invertTransform(this.calcTransformMatrix()),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])),e.transform(t),t.scale(1/e.zoomX,1/e.zoomY),t.drawImage(e._cacheCanvas,-e.cacheTranslationX,-e.cacheTranslationY),t.restore()},drawObject:function(t,e){var i=this.fill,n=this.stroke;e?(this.fill="black",this.stroke="",this._setClippingProperties(t)):this._renderBackground(t),this._render(t),this._drawClipPath(t,this.clipPath),this.fill=i,this.stroke=n},_drawClipPath:function(t,e){e&&(e.canvas=this.canvas,e.shouldCache(),e._transformDone=!0,e.renderCache({forClipping:!0}),this.drawClipPathOnCache(t,e))},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){var e;return!(this.isNotVisible()||(!this._cacheCanvas||!this._cacheContext||t||!this._updateCacheCanvas())&&(!(this.dirty||this.clipPath&&this.clipPath.absolutePositioned||this.statefullCache&&this.hasStateChanged("cacheProperties"))||(this._cacheCanvas&&this._cacheContext&&!t&&(t=this.cacheWidth/this.zoomX,e=this.cacheHeight/this.zoomY,this._cacheContext.clearRect(-t/2,-e/2,t,e)),0)))},_renderBackground:function(t){var e;this.backgroundColor&&(e=this._getNonTransformedDimensions(),t.fillStyle=this.backgroundColor,t.fillRect(-e.x/2,-e.y/2,e.x,e.y),this._removeShadow(t))},_setOpacity:function(t){this.group&&!this.group._transformDone?t.globalAlpha=this.getObjectOpacity():t.globalAlpha*=this.opacity},_setStrokeStyles:function(t,e){var i=e.stroke;i&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineDashOffset=e.strokeDashOffset,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?this._applyPatternForTransformedGradient(t,i):(t.strokeStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):t.strokeStyle=e.stroke)},_setFillStyles:function(t,e){var i=e.fill;i&&(i.toLive?(t.fillStyle=i.toLive(t,this),this._applyPatternGradientTransform(t,e.fill)):t.fillStyle=i)},_setClippingProperties:function(t){t.globalAlpha=1,t.strokeStyle="transparent",t.fillStyle="#000000"},_setLineDash:function(t,e){e&&0!==e.length&&(1&e.length&&e.push.apply(e,e),t.setLineDash(e))},_renderControls:function(t,e){var i=this.getViewportTransform(),n=this.calcTransformMatrix(),s=(void 0!==(e=e||{}).hasBorders?e:this).hasBorders,r=(void 0!==e.hasControls?e:this).hasControls,n=f.util.multiplyTransformMatrices(i,n),i=f.util.qrDecompose(n);t.save(),t.translate(i.translateX,i.translateY),t.lineWidth=+this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),this.flipX&&(i.angle-=180),t.rotate(a((this.group?i:this).angle)),e.forActiveSelection||this.group?s&&this.drawBordersInGroup(t,i,e):s&&this.drawBorders(t,e),r&&this.drawControls(t,e),t.restore()},_setShadow:function(t){var e,i,n,s,r;this.shadow&&(e=this.shadow,n=(i=this.canvas)&&i.viewportTransform[0]||1,s=i&&i.viewportTransform[3]||1,r=e.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),i&&i._isRetinaScaling()&&(n*=f.devicePixelRatio,s*=f.devicePixelRatio),t.shadowColor=e.color,t.shadowBlur=e.blur*f.browserShadowBlurConstant*(n+s)*(r.scaleX+r.scaleY)/4,t.shadowOffsetX=e.offsetX*n*r.scaleX,t.shadowOffsetY=e.offsetY*s*r.scaleY)},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){var i,n,s;return e&&e.toLive?(i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,s=-this.height/2+e.offsetY||0,"percentage"===e.gradientUnits?t.transform(this.width,0,0,this.height,n,s):t.transform(1,0,0,1,n,s),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:s}):{offsetX:0,offsetY:0}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_render:function(){},_renderFill:function(t){this.fill&&(t.save(),this._setFillStyles(t,this),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){var e;this.stroke&&0!==this.strokeWidth&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this.strokeUniform&&this.group?(e=this.getObjectScaling(),t.scale(1/e.scaleX,1/e.scaleY)):this.strokeUniform&&t.scale(1/this.scaleX,1/this.scaleY),this._setLineDash(t,this.strokeDashArray),this._setStrokeStyles(t,this),t.stroke(),t.restore())},_applyPatternForTransformedGradient:function(t,e){var i,n=this._limitCacheSize(this._getCacheCanvasDimensions()),s=f.util.createCanvasElement(),r=this.canvas.getRetinaScaling(),a=n.x/this.scaleX/r,o=n.y/this.scaleY/r;s.width=a,s.height=o,(i=s.getContext("2d")).beginPath(),i.moveTo(0,0),i.lineTo(a,0),i.lineTo(a,o),i.lineTo(0,o),i.closePath(),i.translate(a/2,o/2),i.scale(n.zoomX/this.scaleX/r,n.zoomY/this.scaleY/r),this._applyPatternGradientTransform(i,e),i.fillStyle=e.toLive(t),i.fill(),t.translate(-this.width/2-this.strokeWidth/2,-this.height/2-this.strokeWidth/2),t.scale(r*this.scaleX/n.zoomX,r*this.scaleY/n.zoomY),t.strokeStyle=i.createPattern(s,"no-repeat")},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){var t;this.transformMatrix&&(t=f.util.qrDecompose(this.transformMatrix),this.flipX=!1,this.flipY=!1,this.set("scaleX",t.scaleX),this.set("scaleY",t.scaleY),this.angle=t.angle,this.skewX=t.skewX,this.skewY=0)},_removeTransformMatrix:function(t){var e=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),e=f.util.transformPoint(e,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,e.x+=t.offsetLeft,e.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(e,"center","center")},clone:function(t,e){e=this.toObject(e);this.constructor.fromObject?this.constructor.fromObject(e,t):f.Object._fromObject("Object",e,t)},cloneAsImage:function(t,e){e=this.toCanvasElement(e);return t&&t(new f.Image(e)),this},toCanvasElement:function(t){t=t||{};var e=f.util,i=e.saveObjectTransform(this),n=this.group,s=this.shadow,r=Math.abs,a=(t.multiplier||1)*(t.enableRetinaScaling?f.devicePixelRatio:1);delete this.group,t.withoutTransform&&e.resetObjectTransform(this),t.withoutShadow&&(this.shadow=null);var o,e=f.util.createCanvasElement(),l=this.getBoundingRect(!0,!0),c=this.shadow,h={x:0,y:0},r=(c&&(o=c.blur,d=c.nonScaling?{scaleX:1,scaleY:1}:this.getObjectScaling(),h.x=2*Math.round(r(c.offsetX)+o)*r(d.scaleX),h.y=2*Math.round(r(c.offsetY)+o)*r(d.scaleY)),c=l.width+h.x,o=l.height+h.y,e.width=Math.ceil(c),e.height=Math.ceil(o),new f.StaticCanvas(e,{enableRetinaScaling:!1,renderOnAddRemove:!1,skipOffscreen:!1})),d=("jpeg"===t.format&&(r.backgroundColor="#fff"),this.setPositionByOrigin(new f.Point(r.width/2,r.height/2),"center","center"),this.canvas),l=(r.add(this),r.toCanvasElement(a||1,t));return this.shadow=s,this.set("canvas",d),n&&(this.group=n),this.set(i).setCoords(),r._objects=[],r.dispose(),r=null,l},toDataURL:function(t){return f.util.toDataURL(this.toCanvasElement(t=t||{}),t.format||"png",t.quality||1)},isType:function(t){return 1<arguments.length?Array.from(arguments).includes(this.type):this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},rotate:function(t){var e=("center"!==this.originX||"center"!==this.originY)&&this.centeredRotation;return e&&this._setOriginToCenter(),this.set("angle",t),e&&this._resetOrigin(),this},centerH:function(){return this.canvas&&this.canvas.centerObjectH(this),this},viewportCenterH:function(){return this.canvas&&this.canvas.viewportCenterObjectH(this),this},centerV:function(){return this.canvas&&this.canvas.centerObjectV(this),this},viewportCenterV:function(){return this.canvas&&this.canvas.viewportCenterObjectV(this),this},center:function(){return this.canvas&&this.canvas.centerObject(this),this},viewportCenter:function(){return this.canvas&&this.canvas.viewportCenterObject(this),this},getLocalPointer:function(t,e){e=e||this.canvas.getPointer(t);t=new f.Point(e.x,e.y),e=this._getLeftTopCoords();return{x:(t=this.angle?f.util.rotatePoint(t,e,a(-this.angle)):t).x-e.x,y:t.y-e.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)},dispose:function(){f.runningAnimations&&f.runningAnimations.cancelByTarget(this)}}),f.util.createAccessors&&f.util.createAccessors(f.Object),t(f.Object.prototype,f.Observable),f.Object.NUM_FRACTION_DIGITS=2,f.Object.ENLIVEN_PROPS=["clipPath"],f.Object._fromObject=function(t,e,i,n){var s=f[t];e=r(e,!0),f.util.enlivenPatterns([e.fill,e.stroke],function(t){void 0!==t[0]&&(e.fill=t[0]),void 0!==t[1]&&(e.stroke=t[1]),f.util.enlivenObjectEnlivables(e,e,function(){var t=n?new s(e[n],e):new s(e);i&&i(t)})})},f.Object.__uid=0)}(i),h=V.util.degreesToRadians,d={left:-.5,center:0,right:.5},H={top:-.5,center:0,bottom:.5},V.util.object.extend(V.Object.prototype,{translateToGivenOrigin:function(t,e,i,n,s){var r=t.x,a=t.y;return"string"==typeof e?e=d[e]:e-=.5,"string"==typeof n?n=d[n]:n-=.5,"string"==typeof i?i=H[i]:i-=.5,"string"==typeof s?s=H[s]:s-=.5,s=s-i,((i=n-e)||s)&&(n=this._getTransformedDimensions(),r=t.x+i*n.x,a=t.y+s*n.y),new V.Point(r,a)},translateToCenterPoint:function(t,e,i){e=this.translateToGivenOrigin(t,e,i,"center","center");return this.angle?V.util.rotatePoint(e,t,h(this.angle)):e},translateToOriginPoint:function(t,e,i){e=this.translateToGivenOrigin(t,"center","center",e,i);return this.angle?V.util.rotatePoint(e,t,h(this.angle)):e},getCenterPoint:function(){var t=new V.Point(this.left,this.top);return this.translateToCenterPoint(t,this.originX,this.originY)},getPointByOrigin:function(t,e){var i=this.getCenterPoint();return this.translateToOriginPoint(i,t,e)},toLocalPoint:function(t,e,i){var n=this.getCenterPoint(),e=void 0!==e&&void 0!==i?this.translateToGivenOrigin(n,"center","center",e,i):new V.Point(this.left,this.top),i=new V.Point(t.x,t.y);return(i=this.angle?V.util.rotatePoint(i,n,-h(this.angle)):i).subtractEquals(e)},setPositionByOrigin:function(t,e,i){t=this.translateToCenterPoint(t,e,i),e=this.translateToOriginPoint(t,this.originX,this.originY);this.set("left",e.x),this.set("top",e.y)},adjustPosition:function(t){var e=h(this.angle),i=this.getScaledWidth(),n=V.util.cos(e)*i,e=V.util.sin(e)*i,i="string"==typeof this.originX?d[this.originX]:this.originX-.5,s="string"==typeof t?d[t]:t-.5;this.left+=n*(s-i),this.top+=e*(s-i),this.setCoords(),this.originX=t},_setOriginToCenter:function(){this._originalOriginX=this.originX,this._originalOriginY=this.originY;var t=this.getCenterPoint();this.originX="center",this.originY="center",this.left=t.x,this.top=t.y},_resetOrigin:function(){var t=this.translateToOriginPoint(this.getCenterPoint(),this._originalOriginX,this._originalOriginY);this.originX=this._originalOriginX,this.originY=this._originalOriginY,this.left=t.x,this.top=t.y,this._originalOriginX=null,this._originalOriginY=null},_getLeftTopCoords:function(){return this.translateToOriginPoint(this.getCenterPoint(),"left","top")}}),C=V.util,q=C.degreesToRadians,S=C.multiplyTransformMatrices,E=C.transformPoint,C.object.extend(V.Object.prototype,{oCoords:null,aCoords:null,lineCoords:null,ownMatrixCache:null,matrixCache:null,controls:{},_getCoords:function(t,e){return e?t?this.calcACoords():this.calcLineCoords():(this.aCoords&&this.lineCoords||this.setCoords(!0),t?this.aCoords:this.lineCoords)},getCoords:function(t,e){return t=this._getCoords(t,e),[new V.Point(t.tl.x,t.tl.y),new V.Point(t.tr.x,t.tr.y),new V.Point(t.br.x,t.br.y),new V.Point(t.bl.x,t.bl.y)]},intersectsWithRect:function(t,e,i,n){i=this.getCoords(i,n);return"Intersection"===V.Intersection.intersectPolygonRectangle(i,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===V.Intersection.intersectPolygonPolygon(this.getCoords(e,i),t.getCoords(e,i)).status||t.isContainedWithinObject(this,e,i)||this.isContainedWithinObject(t,e,i)},isContainedWithinObject:function(t,e,i){for(var n=this.getCoords(e,i),i=e?t.aCoords:t.lineCoords,s=0,r=t._getImageLines(i);s<4;s++)if(!t.containsPoint(n[s],r))return!1;return!0},isContainedWithinRect:function(t,e,i,n){i=this.getBoundingRect(i,n);return i.left>=t.x&&i.left+i.width<=e.x&&i.top>=t.y&&i.top+i.height<=e.y},containsPoint:function(t,e,i,n){i=this._getCoords(i,n),e=e||this._getImageLines(i),n=this._findCrossPoints(t,e);return 0!==n&&n%2==1},isOnScreen:function(t){var e,i;return!!this.canvas&&(e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br,!!this.getCoords(!0,t).some(function(t){return t.x<=i.x&&t.x>=e.x&&t.y<=i.y&&t.y>=e.y})||!!this.intersectsWithRect(e,i,!0,t)||this._containsCenterOfCanvas(e,i,t))},_containsCenterOfCanvas:function(t,e,i){t={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(t,null,!0,i)},isPartiallyOnScreen:function(t){var e,i;return!!this.canvas&&(e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br,!!this.intersectsWithRect(e,i,!0,t)||this.getCoords(!0,t).every(function(t){return(t.x>=i.x||t.x<=e.x)&&(t.y>=i.y||t.y<=e.y)})&&this._containsCenterOfCanvas(e,i,t))},_getImageLines:function(t){return{topline:{o:t.tl,d:t.tr},rightline:{o:t.tr,d:t.br},bottomline:{o:t.br,d:t.bl},leftline:{o:t.bl,d:t.tl}}},_findCrossPoints:function(t,e){var i,n,s,r=0;for(s in e)if(!((n=e[s]).o.y<t.y&&n.d.y<t.y||n.o.y>=t.y&&n.d.y>=t.y||(n=n.o.x===n.d.x&&n.o.x>=t.x?n.o.x:(i=(n.d.y-n.o.y)/(n.d.x-n.o.x),-(t.y-0*t.x-(n.o.y-i*n.o.x))/(0-i)),n>=t.x&&(r+=1),2!==r)))break;return r},getBoundingRect:function(t,e){t=this.getCoords(t,e);return C.makeBoundingBoxFromPoints(t)},getScaledWidth:function(){return this._getTransformedDimensions().x},getScaledHeight:function(){return this._getTransformedDimensions().y},_constrainScale:function(t){return Math.abs(t)<this.minScaleLimit?t<0?-this.minScaleLimit:this.minScaleLimit:0===t?1e-4:t},scale:function(t){return this._set("scaleX",t),this._set("scaleY",t),this.setCoords()},scaleToWidth:function(t,e){e=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/e)},scaleToHeight:function(t,e){e=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/e)},calcLineCoords:function(){var t=this.getViewportTransform(),e=this.padding,i=q(this.angle),n=C.cos(i)*e,i=C.sin(i)*e,s=n+i,n=n-i,i=this.calcACoords(),i={tl:E(i.tl,t),tr:E(i.tr,t),bl:E(i.bl,t),br:E(i.br,t)};return e&&(i.tl.x-=n,i.tl.y-=s,i.tr.x+=s,i.tr.y-=n,i.bl.x-=s,i.bl.y+=n,i.br.x+=n,i.br.y+=s),i},calcOCoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),i=this.getViewportTransform(),e=S(i,e),n=S(e,t),s=(n=S(n,[1/i[0],0,0,1/i[3],0,0]),this._calculateCurrentDimensions()),r={};return this.forEachControl(function(t,e,i){r[e]=t.positionHandler(s,n,i)}),r},calcACoords:function(){var t=this._calcRotateMatrix(),e=this._calcTranslateMatrix(),e=S(e,t),t=this._getTransformedDimensions(),i=t.x/2,t=t.y/2;return{tl:E({x:-i,y:-t},e),tr:E({x:i,y:-t},e),bl:E({x:-i,y:t},e),br:E({x:i,y:t},e)}},setCoords:function(t){return this.aCoords=this.calcACoords(),this.lineCoords=this.group?this.aCoords:this.calcLineCoords(),t||(this.oCoords=this.calcOCoords(),this._setCornerCoords&&this._setCornerCoords()),this},_calcRotateMatrix:function(){return C.calcRotateMatrix(this)},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="_",i="";return(i=!t&&this.group?this.group.transformMatrixKey(t)+e:i)+this.top+e+this.left+e+this.scaleX+e+this.scaleY+e+this.skewX+e+this.skewY+e+this.angle+e+this.originX+e+this.originY+e+this.width+e+this.height+e+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){var e,i=this.calcOwnMatrix();return t||!this.group?i:(t=this.transformMatrixKey(t),(e=this.matrixCache||(this.matrixCache={})).key===t?e.value:(this.group&&(i=S(this.group.calcTransformMatrix(!1),i)),e.key=t,e.value=i))},calcOwnMatrix:function(){var t,e=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});return i.key!==e&&(t=this._calcTranslateMatrix(),t={angle:this.angle,translateX:t[4],translateY:t[5],scaleX:this.scaleX,scaleY:this.scaleY,skewX:this.skewX,skewY:this.skewY,flipX:this.flipX,flipY:this.flipY},i.key=e,i.value=C.composeMatrix(t)),i.value},_getNonTransformedDimensions:function(){var t=this.strokeWidth;return{x:this.width+t,y:this.height+t}},_getTransformedDimensions:function(t,e){void 0===t&&(t=this.skewX),void 0===e&&(e=this.skewY);var i,n,s=0===t&&0===e;return n=this.strokeUniform?(i=this.width,this.height):(i=(n=this._getNonTransformedDimensions()).x,n.y),s?this._finalizeDimensions(i*this.scaleX,n*this.scaleY):(s=C.sizeAfterTransform(i,n,{scaleX:this.scaleX,scaleY:this.scaleY,skewX:t,skewY:e}),this._finalizeDimensions(s.x,s.y))},_finalizeDimensions:function(t,e){return this.strokeUniform?{x:t+this.strokeWidth,y:e+this.strokeWidth}:{x:t,y:e}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return E(e,t,!0).scalarAdd(2*this.padding)}}),V.util.object.extend(V.Object.prototype,{sendToBack:function(){return this.group?V.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas&&this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?V.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas&&this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?V.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas&&this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?V.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas&&this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?V.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas&&this.canvas.moveTo(this,t),this}}),w=V.util.toFixed,V.util.object.extend(V.Object.prototype,{getSvgStyles:function(t){var e=this.fillRule||"nonzero",i=this.strokeWidth||"0",n=this.strokeDashArray?this.strokeDashArray.join(" "):"none",s=this.strokeDashOffset||"0",r=this.strokeLineCap||"butt",a=this.strokeLineJoin||"miter",o=this.strokeMiterLimit||"4",l=void 0!==this.opacity?this.opacity:"1",c=this.visible?"":" visibility: hidden;",t=t?"":this.getSvgFilter(),h=P("fill",this.fill);return[P("stroke",this.stroke),"stroke-width: ",i,"; ","stroke-dasharray: ",n,"; ","stroke-linecap: ",r,"; ","stroke-dashoffset: ",s,"; ","stroke-linejoin: ",a,"; ","stroke-miterlimit: ",o,"; ",h,"fill-rule: ",e,"; ","opacity: ",l,";",t,c].join("")},getSvgSpanStyles:function(t,e){var i="; ",n=t.fontFamily?"font-family: "+(-1===t.fontFamily.indexOf("'")&&-1===t.fontFamily.indexOf('"')?"'"+t.fontFamily+"'":t.fontFamily)+i:"",s=t.strokeWidth?"stroke-width: "+t.strokeWidth+i:"",r=t.fontSize?"font-size: "+t.fontSize+"px"+i:"",a=t.fontStyle?"font-style: "+t.fontStyle+i:"",o=t.fontWeight?"font-weight: "+t.fontWeight+i:"",l=t.fill?P("fill",t.fill):"",c=t.stroke?P("stroke",t.stroke):"",h=this.getSvgTextDecoration(t);return[c,s,n,r,a,o,h=h&&"text-decoration: "+h+i,l,t.deltaY?"baseline-shift: "+-t.deltaY+"; ":"",e?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(e){return["overline","underline","line-through"].filter(function(t){return e[t.replace("-","")]}).join(" ")},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgCommons:function(){return[this.id?'id="'+this.id+'" ':"",this.clipPath?'clip-path="url(#'+this.clipPath.clipPathId+')" ':""].join("")},getSvgTransform:function(t,e){t=t?this.calcTransformMatrix():this.calcOwnMatrix();return'transform="'+V.util.matrixToSVG(t)+(e||"")+'" '},_setSVGBg:function(t){var e;this.backgroundColor&&(e=V.Object.NUM_FRACTION_DIGITS,t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',w(-this.width/2,e),'" y="',w(-this.height/2,e),'" width="',w(this.width,e),'" height="',w(this.height,e),'"></rect>\n'))},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(t),{reviver:t})},toClipPathSVG:function(t){return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(t),{reviver:t})},_createBaseClipPathSVGMarkup:function(t,e){var i=(e=e||{}).reviver,e=e.additionalTransform||"",e=[this.getSvgTransform(!0,e),this.getSvgCommons()].join(""),n=t.indexOf("COMMON_PARTS");return t[n]=e,i?i(t.join("")):t.join("")},_createBaseSVGMarkup:function(t,e){var i,n=(e=e||{}).noStyle,s=e.reviver,r=n?"":'style="'+this.getSvgStyles()+'" ',a=e.withShadow?'style="'+this.getSvgFilter()+'" ':"",o=this.clipPath,l=this.strokeUniform?'vector-effect="non-scaling-stroke" ':"",c=o&&o.absolutePositioned,h=this.stroke,d=this.fill,u=this.shadow,p=[],f=t.indexOf("COMMON_PARTS"),e=e.additionalTransform;return o&&(o.clipPathId="CLIPPATH_"+V.Object.__uid++,i='<clipPath id="'+o.clipPathId+'" >\n'+o.toClipPathSVG(s)+"</clipPath>\n"),c&&p.push("<g ",a,this.getSvgCommons()," >\n"),p.push("<g ",this.getSvgTransform(!1),c?"":a+this.getSvgCommons()," >\n"),a=[r,l,n?"":this.addPaintOrder()," ",e?'transform="'+e+'" ':""].join(""),t[f]=a,d&&d.toLive&&p.push(d.toSVG(this)),h&&h.toLive&&p.push(h.toSVG(this)),u&&p.push(u.toSVG(this)),o&&p.push(i),p.push(t.join("")),p.push("</g>\n"),c&&p.push("</g>\n"),s?s(p.join("")):p.join("")},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}}),Y=V.util.object.extend,x="stateProperties",V.util.object.extend(V.Object.prototype,{hasStateChanged:function(t){var e="_"+(t=t||x);return Object.keys(this[e]).length<this[t].length||!function t(e,i,n){if(e===i)return 1;if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return;for(var s=0,r=e.length;s<r;s++)if(!t(e[s],i[s]))return;return 1}if(e&&"object"==typeof e){var a,o=Object.keys(e);if(i&&"object"==typeof i&&(n||o.length===Object.keys(i).length)){for(s=0,r=o.length;s<r;s++)if("canvas"!==(a=o[s])&&"group"!==a&&!t(e[a],i[a]))return;return 1}}}(this[e],this,!0)},saveState:function(t){var e=t&&t.propertySet||x,i="_"+e;return this[i]?(gt(this,i,this[e]),t&&t.stateProperties&&gt(this,i,t.stateProperties),this):this.setupState(t)},setupState:function(t){var e=(t=t||{}).propertySet||x;return this["_"+(t.propertySet=e)]={},this.saveState(t),this}}),U=V.util.degreesToRadians,V.util.object.extend(V.Object.prototype,{_findTargetCorner:function(t,e){if(this.hasControls&&!this.group&&this.canvas&&this.canvas._activeObject===this){var i,n,s=t.x,r=t.y,a=Object.keys(this.oCoords),o=a.length-1;for(this.__corner=0;0<=o;o--)if(n=a[o],this.isControlVisible(n)&&(i=this._getImageLines(e?this.oCoords[n].touchCorner:this.oCoords[n].corner),0!==(i=this._findCrossPoints({x:s,y:r},i)))&&i%2==1)return this.__corner=n}return!1},forEachControl:function(t){for(var e in this.controls)t(this.controls[e],e,this)},_setCornerCoords:function(){var t,e=this.oCoords;for(t in e){var i=this.controls[t];e[t].corner=i.calcCornerCoords(this.angle,this.cornerSize,e[t].x,e[t].y,!1),e[t].touchCorner=i.calcCornerCoords(this.angle,this.touchCornerSize,e[t].x,e[t].y,!0)}},drawSelectionBackground:function(t){var e,i,n;return!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this||(t.save(),e=this.getCenterPoint(),i=this._calculateCurrentDimensions(),n=this.canvas.viewportTransform,t.translate(e.x,e.y),t.scale(1/n[0],1/n[3]),t.rotate(U(this.angle)),t.fillStyle=this.selectionBackgroundColor,t.fillRect(-i.x/2,-i.y/2,i.x,i.y),t.restore()),this},drawBorders:function(n,t){t=t||{};var e=this._calculateCurrentDimensions(),i=this.borderScaleFactor,s=e.x+i,r=e.y+i,e=(void 0!==t.hasControls?t:this).hasControls,a=!1;return n.save(),n.strokeStyle=t.borderColor||this.borderColor,this._setLineDash(n,t.borderDashArray||this.borderDashArray),n.strokeRect(-s/2,-r/2,s,r),e&&(n.beginPath(),this.forEachControl(function(t,e,i){t.withConnection&&t.getVisibility(i,e)&&(a=!0,n.moveTo(t.x*s,t.y*r),n.lineTo(t.x*s+t.offsetX,t.y*r+t.offsetY))}),a)&&n.stroke(),n.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var n=V.util.sizeAfterTransform(this.width,this.height,e),s=this.strokeWidth,r=this.strokeUniform,a=this.borderScaleFactor,o=n.x+s*(r?this.canvas.getZoom():e.scaleX)+a,n=n.y+s*(r?this.canvas.getZoom():e.scaleY)+a;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-o/2,-n/2,o,n),t.restore(),this},drawControls:function(n,s){s=s||{},n.save();var r,a,t=this.canvas.getRetinaScaling();return n.setTransform(t,0,0,t,0,0),n.strokeStyle=n.fillStyle=s.cornerColor||this.cornerColor,this.transparentCorners||(n.strokeStyle=s.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(n,s.cornerDashArray||this.cornerDashArray),this.setCoords(),this.group&&(r=this.group.calcTransformMatrix()),this.forEachControl(function(t,e,i){a=i.oCoords[e],t.getVisibility(i,e)&&(r&&(a=V.util.transformPoint(a,r)),t.render(n,a.x,a.y,s,i))}),n.restore(),this},isControlVisible:function(t){return this.controls[t]&&this.controls[t].getVisibility(this,t)},setControlVisible:function(t,e){return this._controlsVisibility||(this._controlsVisibility={}),this._controlsVisibility[t]=e,this},setControlsVisibility:function(t){for(var e in t=t||{})this.setControlVisible(e,t[e]);return this},onDeselect:function(){},onSelect:function(){}}),V.util.object.extend(V.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(e,t){function i(){}var n=(t=t||{}).onComplete||i,s=t.onChange||i,r=this;return V.util.animate({target:this,startValue:e.left,endValue:this.getCenterPoint().x,duration:this.FX_DURATION,onChange:function(t){e.set("left",t),r.requestRenderAll(),s()},onComplete:function(){e.setCoords(),n()}})},fxCenterObjectV:function(e,t){function i(){}var n=(t=t||{}).onComplete||i,s=t.onChange||i,r=this;return V.util.animate({target:this,startValue:e.top,endValue:this.getCenterPoint().y,duration:this.FX_DURATION,onChange:function(t){e.set("top",t),r.requestRenderAll(),s()},onComplete:function(){e.setCoords(),n()}})},fxRemove:function(e,t){function i(){}var n=(t=t||{}).onComplete||i,s=t.onChange||i,r=this;return V.util.animate({target:this,startValue:e.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(t){e.set("opacity",t),r.requestRenderAll(),s()},onComplete:function(){r.remove(e),n()}})}}),V.util.object.extend(V.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var t,e,i=[],n=[];for(t in arguments[0])i.push(t);for(var s=0,r=i.length;s<r;s++)e=s!==r-1,n.push(this._animate(t=i[s],arguments[0][t],arguments[1],e));return n}return this._animate.apply(this,arguments)},_animate:function(n,t,s,r){var a,o=this,e=(t=t.toString(),s=s?V.util.object.clone(s):{},~n.indexOf(".")&&(a=n.split(".")),-1<o.colorProperties.indexOf(n)||a&&-1<o.colorProperties.indexOf(a[1])),i=a?this.get(a[0])[a[1]]:this.get(n),i=("from"in s||(s.from=i),e||(t=~t.indexOf("=")?i+parseFloat(t.replace("=","")):parseFloat(t)),{target:this,startValue:s.from,endValue:t,byValue:s.by,easing:s.easing,duration:s.duration,abort:s.abort&&function(t,e,i){return s.abort.call(o,t,e,i)},onChange:function(t,e,i){a?o[a[0]][a[1]]=t:o.set(n,t),r||s.onChange&&s.onChange(t,e,i)},onComplete:function(t,e,i){r||(o.setCoords(),s.onComplete&&s.onComplete(t,e,i))}});return e?V.util.animateColor(i.startValue,i.endValue,i.duration,i):V.util.animate(i)}}),function(t){"use strict";var s=t.fabric||(t.fabric={}),r=s.util.object.extend,n=s.util.object.clone,i={x1:1,x2:1,y1:1,y2:1};function e(t,e){var i=t.origin,n=t.axis1,s=t.axis2,r=t.dimension,a=e.nearest,o=e.center,l=e.farthest;return function(){switch(this.get(i)){case a:return Math.min(this.get(n),this.get(s));case o:return Math.min(this.get(n),this.get(s))+.5*this.get(r);case l:return Math.max(this.get(n),this.get(s))}}}s.Line?s.warn("fabric.Line is already defined"):(s.Line=s.util.createClass(s.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:s.Object.prototype.cacheProperties.concat("x1","x2","y1","y2"),initialize:function(t,e){t=t||[0,0,0,0],this.callSuper("initialize",e),this.set("x1",t[0]),this.set("y1",t[1]),this.set("x2",t[2]),this.set("y2",t[3]),this._setWidthHeight(e)},_setWidthHeight:function(t){t=t||{},this.width=Math.abs(this.x2-this.x1),this.height=Math.abs(this.y2-this.y1),this.left="left"in t?t.left:this._getLeftToOriginX(),this.top="top"in t?t.top:this._getTopToOriginY()},_set:function(t,e){return this.callSuper("_set",t,e),void 0!==i[t]&&this._setWidthHeight(),this},_getLeftToOriginX:e({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:e({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){t.beginPath();var e=this.calcLinePoints(),e=(t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2),t.lineWidth=this.strokeWidth,t.strokeStyle);t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=e},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return r(this.callSuper("toObject",t),this.calcLinePoints())},_getNonTransformedDimensions:function(){var t=this.callSuper("_getNonTransformedDimensions");return"butt"===this.strokeLineCap&&(0===this.width&&(t.y-=this.strokeWidth),0===this.height)&&(t.x-=this.strokeWidth),t},calcLinePoints:function(){var t=this.x1<=this.x2?-1:1,e=this.y1<=this.y2?-1:1,i=t*this.width*.5,n=e*this.height*.5;return{x1:i,x2:t*this.width*-.5,y1:n,y2:e*this.height*-.5}},_toSVG:function(){var t=this.calcLinePoints();return["<line ","COMMON_PARTS",'x1="',t.x1,'" y1="',t.y1,'" x2="',t.x2,'" y2="',t.y2,'" />\n']}}),s.Line.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),s.Line.fromElement=function(t,e,i){i=i||{};var t=s.parseAttributes(t,s.Line.ATTRIBUTE_NAMES),n=[t.x1||0,t.y1||0,t.x2||0,t.y2||0];e(new s.Line(n,r(t,i)))},s.Line.fromObject=function(t,e){var i=n(t,!0);i.points=[t.x1,t.y1,t.x2,t.y2],s.Object._fromObject("Line",i,function(t){delete t.points,e&&e(t)},"points")})}(i),function(t){"use strict";var s=t.fabric||(t.fabric={}),r=s.util.degreesToRadians;s.Circle?s.warn("fabric.Circle is already defined."):(s.Circle=s.util.createClass(s.Object,{type:"circle",radius:0,startAngle:0,endAngle:360,cacheProperties:s.Object.prototype.cacheProperties.concat("radius","startAngle","endAngle"),_set:function(t,e){return this.callSuper("_set",t,e),"radius"===t&&this.setRadius(e),this},toObject:function(t){return this.callSuper("toObject",["radius","startAngle","endAngle"].concat(t))},_toSVG:function(){var t,e,i,n=(this.endAngle-this.startAngle)%360;return 0==n?["<circle ","COMMON_PARTS",'cx="0" cy="0" ','r="',this.radius,'" />\n']:(t=r(this.startAngle),e=r(this.endAngle),i=this.radius,['<path d="M '+s.util.cos(t)*i+" "+s.util.sin(t)*i," A "+i+" "+i," 0 ",+(180<n?"1":"0")+" 1"," "+s.util.cos(e)*i+" "+s.util.sin(e)*i,'" ',"COMMON_PARTS"," />\n"])},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,r(this.startAngle),r(this.endAngle),!1),this._renderPaintInOrder(t)},getRadiusX:function(){return this.get("radius")*this.get("scaleX")},getRadiusY:function(){return this.get("radius")*this.get("scaleY")},setRadius:function(t){return this.radius=t,this.set("width",2*t).set("height",2*t)}}),s.Circle.ATTRIBUTE_NAMES=s.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),s.Circle.fromElement=function(t,e){t=s.parseAttributes(t,s.Circle.ATTRIBUTE_NAMES);if(!("radius"in t&&0<=t.radius))throw new Error("value of `r` attribute is required and can not be negative");t.left=(t.left||0)-t.radius,t.top=(t.top||0)-t.radius,e(new s.Circle(t))},s.Circle.fromObject=function(t,e){s.Object._fromObject("Circle",t,e)})}(i),function(t){"use strict";var i=t.fabric||(t.fabric={});i.Triangle?i.warn("fabric.Triangle is already defined"):(i.Triangle=i.util.createClass(i.Object,{type:"triangle",width:100,height:100,_render:function(t){var e=this.width/2,i=this.height/2;t.beginPath(),t.moveTo(-e,i),t.lineTo(0,-i),t.lineTo(e,i),t.closePath(),this._renderPaintInOrder(t)},_toSVG:function(){var t=this.width/2,e=this.height/2;return["<polygon ","COMMON_PARTS",'points="',[-t+" "+e,"0 "+-e,t+" "+e].join(","),'" />']}}),i.Triangle.fromObject=function(t,e){return i.Object._fromObject("Triangle",t,e)})}(i),function(t){"use strict";var i=t.fabric||(t.fabric={}),e=2*Math.PI;i.Ellipse?i.warn("fabric.Ellipse is already defined."):(i.Ellipse=i.util.createClass(i.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:i.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this.set("rx",t&&t.rx||0),this.set("ry",t&&t.ry||0)},_set:function(t,e){switch(this.callSuper("_set",t,e),t){case"rx":this.rx=e,this.set("width",2*e);break;case"ry":this.ry=e,this.set("height",2*e)}return this},getRx:function(){return this.get("rx")*this.get("scaleX")},getRy:function(){return this.get("ry")*this.get("scaleY")},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<ellipse ","COMMON_PARTS",'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" />\n']},_render:function(t){t.beginPath(),t.save(),t.transform(1,0,0,this.ry/this.rx,0,0),t.arc(0,0,this.rx,0,e,!1),t.restore(),this._renderPaintInOrder(t)}}),i.Ellipse.ATTRIBUTE_NAMES=i.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),i.Ellipse.fromElement=function(t,e){t=i.parseAttributes(t,i.Ellipse.ATTRIBUTE_NAMES);t.left=(t.left||0)-t.rx,t.top=(t.top||0)-t.ry,e(new i.Ellipse(t))},i.Ellipse.fromObject=function(t,e){i.Object._fromObject("Ellipse",t,e)})}(i),function(t){"use strict";var n=t.fabric||(t.fabric={}),s=n.util.object.extend;n.Rect?n.warn("fabric.Rect is already defined"):(n.Rect=n.util.createClass(n.Object,{stateProperties:n.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:n.Object.prototype.cacheProperties.concat("rx","ry"),initialize:function(t){this.callSuper("initialize",t),this._initRxRy()},_initRxRy:function(){this.rx&&!this.ry?this.ry=this.rx:this.ry&&!this.rx&&(this.rx=this.ry)},_render:function(t){var e=this.rx?Math.min(this.rx,this.width/2):0,i=this.ry?Math.min(this.ry,this.height/2):0,n=this.width,s=this.height,r=-this.width/2,a=-this.height/2,o=0!==e||0!==i,l=.4477152502;t.beginPath(),t.moveTo(r+e,a),t.lineTo(r+n-e,a),o&&t.bezierCurveTo(r+n-l*e,a,r+n,a+l*i,r+n,a+i),t.lineTo(r+n,a+s-i),o&&t.bezierCurveTo(r+n,a+s-l*i,r+n-l*e,a+s,r+n-e,a+s),t.lineTo(r+e,a+s),o&&t.bezierCurveTo(r+l*e,a+s,r,a+s-l*i,r,a+s-i),t.lineTo(r,a+i),o&&t.bezierCurveTo(r,a+l*i,r+l*e,a,r+e,a),t.closePath(),this._renderPaintInOrder(t)},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},_toSVG:function(){return["<rect ","COMMON_PARTS",'x="',-this.width/2,'" y="',-this.height/2,'" rx="',this.rx,'" ry="',this.ry,'" width="',this.width,'" height="',this.height,'" />\n']}}),n.Rect.ATTRIBUTE_NAMES=n.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),n.Rect.fromElement=function(t,e,i){if(!t)return e(null);i=i||{};t=n.parseAttributes(t,n.Rect.ATTRIBUTE_NAMES),t.left=t.left||0,t.top=t.top||0,t.height=t.height||0,t.width=t.width||0,i=new n.Rect(s(i?n.util.object.clone(i):{},t));i.visible=i.visible&&0<i.width&&0<i.height,e(i)},n.Rect.fromObject=function(t,e){return n.Object._fromObject("Rect",t,e)})}(i),function(t){"use strict";var a=t.fabric||(t.fabric={}),r=a.util.object.extend,n=a.util.array.min,s=a.util.array.max,o=a.util.toFixed,e=a.util.projectStrokeOnPoints;a.Polyline?a.warn("fabric.Polyline is already defined"):(a.Polyline=a.util.createClass(a.Object,{type:"polyline",points:null,exactBoundingBox:!1,cacheProperties:a.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e),this._setPositionDimensions(e)},_projectStrokeOnPoints:function(){return e(this.points,this,!0)},_setPositionDimensions:function(t){var e,i=this._calcDimensions(t),n=this.exactBoundingBox?this.strokeWidth:0;this.width=i.width-n,this.height=i.height-n,t.fromSVG||(e=this.translateToGivenOrigin({x:i.left-this.strokeWidth/2+n/2,y:i.top-this.strokeWidth/2+n/2},"left","top",this.originX,this.originY)),void 0===t.left&&(this.left=t.fromSVG?i.left:e.x),void 0===t.top&&(this.top=t.fromSVG?i.top:e.y),this.pathOffset={x:i.left+this.width/2+n/2,y:i.top+this.height/2+n/2}},_calcDimensions:function(){var t=this.exactBoundingBox?this._projectStrokeOnPoints():this.points,e=n(t,"x")||0,i=n(t,"y")||0;return{left:e,top:i,width:(s(t,"x")||0)-e,height:(s(t,"y")||0)-i}},toObject:function(t){return r(this.callSuper("toObject",t),{points:this.points.concat()})},_toSVG:function(){for(var t=[],e=this.pathOffset.x,i=this.pathOffset.y,n=a.Object.NUM_FRACTION_DIGITS,s=0,r=this.points.length;s<r;s++)t.push(o(this.points[s].x-e,n),",",o(this.points[s].y-i,n)," ");return["<"+this.type+" ","COMMON_PARTS",'points="',t.join(""),'" />\n']},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,s=this.pathOffset.y;if(!i||isNaN(this.points[i-1].y))return!1;t.beginPath(),t.moveTo(this.points[0].x-n,this.points[0].y-s);for(var r=0;r<i;r++)e=this.points[r],t.lineTo(e.x-n,e.y-s);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},complexity:function(){return this.get("points").length}}),a.Polyline.ATTRIBUTE_NAMES=a.SHARED_ATTRIBUTES.concat(),a.Polyline.fromElementGenerator=function(s){return function(t,e,i){if(!t)return e(null);i=i||{};var n=a.parsePointsAttribute(t.getAttribute("points")),t=a.parseAttributes(t,a[s].ATTRIBUTE_NAMES);t.fromSVG=!0,e(new a[s](n,r(t,i)))}},a.Polyline.fromElement=a.Polyline.fromElementGenerator("Polyline"),a.Polyline.fromObject=function(t,e){return a.Object._fromObject("Polyline",t,e,"points")})}(i),function(t){"use strict";var i=t.fabric||(t.fabric={}),e=i.util.projectStrokeOnPoints;i.Polygon?i.warn("fabric.Polygon is already defined"):(i.Polygon=i.util.createClass(i.Polyline,{type:"polygon",_projectStrokeOnPoints:function(){return e(this.points,this)},_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))}}),i.Polygon.ATTRIBUTE_NAMES=i.SHARED_ATTRIBUTES.concat(),i.Polygon.fromElement=i.Polyline.fromElementGenerator("Polygon"),i.Polygon.fromObject=function(t,e){i.Object._fromObject("Polygon",t,e,"points")})}(i),function(t){"use strict";var u=t.fabric||(t.fabric={}),p=u.util.array.min,f=u.util.array.max,n=u.util.object.extend,i=u.util.object.clone,e=u.util.toFixed;u.Path?u.warn("fabric.Path is already defined"):(u.Path=u.util.createClass(u.Object,{type:"path",path:null,cacheProperties:u.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:u.Object.prototype.stateProperties.concat("path"),initialize:function(t,e){delete(e=i(e||{})).path,this.callSuper("initialize",e),this._setPath(t||[],e)},_setPath:function(t,e){this.path=u.util.makePathSimpler(Array.isArray(t)?t:u.util.parsePath(t)),u.Polyline.prototype._setPositionDimensions.call(this,e||{})},_renderPathCommands:function(t){var e,i=0,n=0,s=0,r=0,a=0,o=0,l=-this.pathOffset.x,c=-this.pathOffset.y;t.beginPath();for(var h=0,d=this.path.length;h<d;++h)switch((e=this.path[h])[0]){case"L":s=e[1],r=e[2],t.lineTo(s+l,r+c);break;case"M":i=s=e[1],n=r=e[2],t.moveTo(s+l,r+c);break;case"C":s=e[5],r=e[6],a=e[3],o=e[4],t.bezierCurveTo(e[1]+l,e[2]+c,a+l,o+c,s+l,r+c);break;case"Q":t.quadraticCurveTo(e[1]+l,e[2]+c,e[3]+l,e[4]+c),s=e[3],r=e[4],a=e[1],o=e[2];break;case"z":case"Z":s=i,r=n,t.closePath()}},_render:function(t){this._renderPathCommands(t),this._renderPaintInOrder(t)},toString:function(){return"#<fabric.Path ("+this.complexity()+'): { "top": '+this.top+', "left": '+this.left+" }>"},toObject:function(t){return n(this.callSuper("toObject",t),{path:this.path.map(function(t){return t.slice()})})},toDatalessObject:function(t){t=this.toObject(["sourcePath"].concat(t));return t.sourcePath&&delete t.path,t},_toSVG:function(){return["<path ","COMMON_PARTS",'d="',u.util.joinPath(this.path),'" stroke-linecap="round" ',"/>\n"]},_getOffsetTransform:function(){var t=u.Object.NUM_FRACTION_DIGITS;return" translate("+e(-this.pathOffset.x,t)+", "+e(-this.pathOffset.y,t)+")"},toClipPathSVG:function(t){var e=this._getOffsetTransform();return"\t"+this._createBaseClipPathSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},toSVG:function(t){var e=this._getOffsetTransform();return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,additionalTransform:e})},complexity:function(){return this.path.length},_calcDimensions:function(){for(var t,e,i=[],n=[],s=0,r=0,a=0,o=0,l=0,c=this.path.length;l<c;++l){switch((t=this.path[l])[0]){case"L":a=t[1],o=t[2],e=[];break;case"M":s=a=t[1],r=o=t[2],e=[];break;case"C":e=u.util.getBoundsOfCurve(a,o,t[1],t[2],t[3],t[4],t[5],t[6]),a=t[5],o=t[6];break;case"Q":e=u.util.getBoundsOfCurve(a,o,t[1],t[2],t[1],t[2],t[3],t[4]),a=t[3],o=t[4];break;case"z":case"Z":a=s,o=r}e.forEach(function(t){i.push(t.x),n.push(t.y)}),i.push(a),n.push(o)}var h=p(i)||0,d=p(n)||0;return{left:h,top:d,width:(f(i)||0)-h,height:(f(n)||0)-d}}}),u.Path.fromObject=function(i,n){var t;"string"==typeof i.sourcePath?(t=i.sourcePath,u.loadSVGFromURL(t,function(t){var e=t[0];e.setOptions(i),i.clipPath?u.util.enlivenObjects([i.clipPath],function(t){e.clipPath=t[0],n&&n(e)}):n&&n(e)})):u.Object._fromObject("Path",i,n,"path")},u.Path.ATTRIBUTE_NAMES=u.SHARED_ATTRIBUTES.concat(["d"]),u.Path.fromElement=function(t,e,i){t=u.parseAttributes(t,u.Path.ATTRIBUTE_NAMES);t.fromSVG=!0,e(new u.Path(t.d,n(t,i)))})}(i),function(t){"use strict";var a=t.fabric||(t.fabric={}),o=a.util.array.min,l=a.util.array.max;a.Group||(a.Group=a.util.createClass(a.Object,a.Collection,{type:"group",strokeWidth:0,subTargetCheck:!1,cacheProperties:[],useSetOnGroup:!1,initialize:function(t,e,i){e=e||{},this._objects=[],i&&this.callSuper("initialize",e),this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i?this._updateObjectsACoords():(t=e&&e.centerPoint,void 0!==e.originX&&(this.originX=e.originX),void 0!==e.originY&&(this.originY=e.originY),t||this._calcBounds(),this._updateObjectsCoords(t),delete e.centerPoint,this.callSuper("initialize",e)),this.setCoords()},_updateObjectsACoords:function(){for(var t=this._objects.length;t--;)this._objects[t].setCoords(!0)},_updateObjectsCoords:function(t){t=t||this.getCenterPoint();for(var e=this._objects.length;e--;)this._updateObjectCoords(this._objects[e],t)},_updateObjectCoords:function(t,e){var i=t.left,n=t.top;t.set({left:i-e.x,top:n-e.y}),t.group=this,t.setCoords(!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){var e=!!this.group;return this._restoreObjectsState(),a.util.resetObjectTransform(this),t&&(e&&a.util.removeTransformFromObject(t,this.group.calcTransformMatrix()),this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.dirty=!0,e?this.group.addWithUpdate():this.setCoords(),this},removeWithUpdate:function(t){return this._restoreObjectsState(),a.util.resetObjectTransform(this),this.remove(t),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},_onObjectAdded:function(t){this.dirty=!0,t.group=this,t._set("canvas",this.canvas)},_onObjectRemoved:function(t){this.dirty=!0,delete t.group},_set:function(t,e){var i=this._objects.length;if(this.useSetOnGroup)for(;i--;)this._objects[i].setOnGroup(t,e);if("canvas"===t)for(;i--;)this._objects[i]._set(t,e);a.Object.prototype._set.call(this,t,e)},toObject:function(n){var s=this.includeDefaultValues,t=this._objects.filter(function(t){return!t.excludeFromExport}).map(function(t){var e=t.includeDefaultValues,i=(t.includeDefaultValues=s,t.toObject(n));return t.includeDefaultValues=e,i}),e=a.Object.prototype.toObject.call(this,n);return e.objects=t,e},toDatalessObject:function(n){var s,t=this.sourcePath,e=(t=t||(s=this.includeDefaultValues,this._objects.map(function(t){var e=t.includeDefaultValues,i=(t.includeDefaultValues=s,t.toDatalessObject(n));return t.includeDefaultValues=e,i})),a.Object.prototype.toDatalessObject.call(this,n));return e.objects=t,e},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=a.Object.prototype.shouldCache.call(this);if(t)for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return this.ownCaching=!1;return t},willDrawShadow:function(){if(a.Object.prototype.willDrawShadow.call(this))return!0;for(var t=0,e=this._objects.length;t<e;t++)if(this._objects[t].willDrawShadow())return!0;return!1},isOnACache:function(){return this.ownCaching||this.group&&this.group.isOnACache()},drawObject:function(t){for(var e=0,i=this._objects.length;e<i;e++)this._objects[e].render(t);this._drawClipPath(t,this.clipPath)},isCacheDirty:function(t){if(this.callSuper("isCacheDirty",t))return!0;if(this.statefullCache)for(var e,i,n=0,s=this._objects.length;n<s;n++)if(this._objects[n].isCacheDirty(!0))return this._cacheCanvas&&(e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY,this._cacheContext.clearRect(-e/2,-i/2,e,i)),!0;return!1},_restoreObjectsState:function(){var e=this.calcOwnMatrix();return this._objects.forEach(function(t){a.util.addTransformToObject(t,e),delete t.group,t.setCoords()}),this},destroy:function(){return this._objects.forEach(function(t){t.set("dirty",!0)}),this._restoreObjectsState()},dispose:function(){this.callSuper("dispose"),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[]},toActiveSelection:function(){var t,e,i,n;if(this.canvas)return t=this._objects,e=this.canvas,this._objects=[],delete(i=this.toObject()).objects,(n=new a.ActiveSelection([])).set(i),n.type="activeSelection",e.remove(this),t.forEach(function(t){t.group=n,t.dirty=!0,e.add(t)}),n.canvas=e,n._objects=t,(e._activeObject=n).setCoords(),n},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(t){t.setCoords(!0)}),this},_calcBounds:function(t){for(var e,i,n,s,r=[],a=[],o=["tr","br","bl","tl"],l=0,c=this._objects.length,h=o.length;l<c;++l){for(n=(e=this._objects[l]).calcACoords(),s=0;s<h;s++)r.push(n[i=o[s]].x),a.push(n[i].y);e.aCoords=n}this._getBounds(r,a,t)},_getBounds:function(t,e,i){var n=new a.Point(o(t),o(e)),t=new a.Point(l(t),l(e)),e=n.y||0,s=n.x||0,r=t.x-n.x||0,t=t.y-n.y||0;this.width=r,this.height=t,i||this.setPositionByOrigin({x:s,y:e},"left","top")},_toSVG:function(t){for(var e=["<g ","COMMON_PARTS"," >\n"],i=0,n=this._objects.length;i<n;i++)e.push("\t\t",this._objects[i].toSVG(t));return e.push("</g>\n"),e},getSvgStyles:function(){var t=void 0!==this.opacity&&1!==this.opacity?"opacity: "+this.opacity+";":"",e=this.visible?"":" visibility: hidden;";return[t,this.getSvgFilter(),e].join("")},toClipPathSVG:function(t){for(var e=[],i=0,n=this._objects.length;i<n;i++)e.push("\t",this._objects[i].toClipPathSVG(t));return this._createBaseClipPathSVGMarkup(e,{reviver:t})}}),a.Group.fromObject=function(i,n){var s=i.objects,r=a.util.object.clone(i,!0);delete r.objects,"string"!=typeof s?a.util.enlivenObjects(s,function(t){a.util.enlivenObjectEnlivables(i,r,function(){n&&n(new a.Group(t,r,!0))})}):a.loadSVGFromURL(s,function(t){var e=a.util.groupSVGElements(t,i,s),t=r.clipPath;delete r.clipPath,e.set(r),t?a.util.enlivenObjects([t],function(t){e.clipPath=t[0],n&&n(e)}):n&&n(e)})})}(i),function(t){"use strict";var n=t.fabric||(t.fabric={});n.ActiveSelection||(n.ActiveSelection=n.util.createClass(n.Group,{type:"activeSelection",initialize:function(t,e){e=e||{},this._objects=t||[];for(var i=this._objects.length;i--;)this._objects[i].group=this;e.originX&&(this.originX=e.originX),e.originY&&(this.originY=e.originY),this._calcBounds(),this._updateObjectsCoords(),n.Object.prototype.initialize.call(this,e),this.setCoords()},toGroup:function(){var t=this._objects.concat(),e=(this._objects=[],n.Object.prototype.toObject.call(this)),i=new n.Group([]);return delete e.type,i.set(e),t.forEach(function(t){t.canvas.remove(t),t.group=i}),i._objects=t,this.canvas&&((e=this.canvas).add(i),(e._activeObject=i).setCoords()),i},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},shouldCache:function(){return!1},isOnACache:function(){return!1},_renderControls:function(t,e,i){t.save(),t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1,this.callSuper("_renderControls",t,e),void 0===(i=i||{}).hasControls&&(i.hasControls=!1),i.forActiveSelection=!0;for(var n=0,s=this._objects.length;n<s;n++)this._objects[n]._renderControls(t,i);t.restore()}}),n.ActiveSelection.fromObject=function(e,i){n.util.enlivenObjects(e.objects,function(t){delete e.objects,i&&i(new n.ActiveSelection(t,e,!0))})})}(i),function(t){"use strict";var n=V.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?V.warn("fabric.Image is already defined."):(V.Image=V.util.createClass(V.Object,{type:"image",strokeWidth:0,srcFromAttribute:!1,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:V.Object.prototype.stateProperties.concat("cropX","cropY"),cacheProperties:V.Object.prototype.cacheProperties.concat("cropX","cropY"),cacheKey:"",cropX:0,cropY:0,imageSmoothing:!0,initialize:function(t,e){e=e||{},this.filters=[],this.cacheKey="texture"+V.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element||{}},setElement:function(t,e){return this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._element=t,this._originalElement=t,this._initConfig(e),0!==this.filters.length&&this.applyFilters(),this.resizeFilter&&this.applyResizeFilters(),this},removeTexture:function(t){var e=V.filterBackend;e&&e.evictCachesForKey&&e.evictCachesForKey(t)},dispose:function(){this.callSuper("dispose"),this.removeTexture(this.cacheKey),this.removeTexture(this.cacheKey+"_filtered"),this._cacheContext=void 0,["_originalElement","_element","_filteredEl","_cacheCanvas"].forEach(function(t){V.util.cleanUpJsdomNode(this[t]),this[t]=void 0}.bind(this))},getCrossOrigin:function(){return this._originalElement&&(this._originalElement.crossOrigin||null)},getOriginalSize:function(){var t=this.getElement();return{width:t.naturalWidth||t.width,height:t.naturalHeight||t.height}},_stroke:function(t){var e,i;this.stroke&&0!==this.strokeWidth&&(e=this.width/2,i=this.height/2,t.beginPath(),t.moveTo(-e,-i),t.lineTo(e,-i),t.lineTo(e,i),t.lineTo(-e,i),t.lineTo(-e,-i),t.closePath())},toObject:function(t){var e=[],t=(this.filters.forEach(function(t){t&&e.push(t.toObject())}),n(this.callSuper("toObject",["cropX","cropY"].concat(t)),{src:this.getSrc(),crossOrigin:this.getCrossOrigin(),filters:e}));return this.resizeFilter&&(t.resizeFilter=this.resizeFilter.toObject()),t},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},_toSVG:function(){var t,e,i=[],n=[],s=this._element,r=-this.width/2,a=-this.height/2,o="",l="";return s?(this.hasCrop()&&(e=V.Object.__uid++,i.push('<clipPath id="imageCrop_'+e+'">\n','\t<rect x="'+r+'" y="'+a+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+e+')" '),this.imageSmoothing||(l='" image-rendering="optimizeSpeed'),n.push("\t<image ","COMMON_PARTS",'xlink:href="',this.getSvgSrc(!0),'" x="',r-this.cropX,'" y="',a-this.cropY,'" width="',s.width||s.naturalWidth,'" height="',s.height||s.height,l,'"',o,"></image>\n"),(this.stroke||this.strokeDashArray)&&(e=this.fill,this.fill=null,t=["\t<rect ",'x="',r,'" y="',a,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'],this.fill=e),"fill"!==this.paintFirst?i.concat(t,n):i.concat(n,t)):[]},getSrc:function(t){t=t?this._element:this._originalElement;return t?t.toDataURL?t.toDataURL():this.srcFromAttribute?t.getAttribute("src"):t.src:this.src||""},setSrc:function(t,i,n){return V.util.loadImage(t,function(t,e){this.setElement(t,n),this._setWidthHeight(),i&&i(this,e)},this,n&&n.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t,e,i,n=this.resizeFilter,s=this.minimumScaleTrigger,r=this.getTotalObjectScaling(),a=r.scaleX,r=r.scaleY,o=this._filteredEl||this._originalElement;this.group&&this.set("dirty",!0),!n||s<a&&s<r?(this._element=o,this._filterScalingX=1,this._filterScalingY=1,this._lastScaleX=a,this._lastScaleY=r):(V.filterBackend||(V.filterBackend=V.initFilterBackend()),s=V.util.createCanvasElement(),t=this._filteredEl?this.cacheKey+"_filtered":this.cacheKey,e=o.width,i=o.height,s.width=e,s.height=i,this._element=s,this._lastScaleX=n.scaleX=a,this._lastScaleY=n.scaleY=r,V.filterBackend.applyFilters([n],o,e,i,this._element,t),this._filterScalingX=s.width/this._originalElement.width,this._filterScalingY=s.height/this._originalElement.height)},applyFilters:function(t){var e,i,n;return(t=(t=t||this.filters||[]).filter(function(t){return t&&!t.isNeutralState()}),this.set("dirty",!0),this.removeTexture(this.cacheKey+"_filtered"),0===t.length)?(this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1):(e=(i=this._originalElement).naturalWidth||i.width,i=i.naturalHeight||i.height,this._element===this._originalElement?((n=V.util.createCanvasElement()).width=e,n.height=i,this._element=n,this._filteredEl=n):(this._element=this._filteredEl,this._filteredEl.getContext("2d").clearRect(0,0,e,i),this._lastScaleX=1,this._lastScaleY=1),V.filterBackend||(V.filterBackend=V.initFilterBackend()),V.filterBackend.applyFilters(t,this._originalElement,e,i,this._element,this.cacheKey),this._originalElement.width===this._element.width&&this._originalElement.height===this._element.height||(this._filterScalingX=this._element.width/this._originalElement.width,this._filterScalingY=this._element.height/this._originalElement.height)),this},_render:function(t){V.util.setImageSmoothing(t,this.imageSmoothing),!0!==this.isMoving&&this.resizeFilter&&this._needsResize()&&this.applyResizeFilters(),this._stroke(t),this._renderPaintInOrder(t)},drawCacheOnCanvas:function(t){V.util.setImageSmoothing(t,this.imageSmoothing),V.Object.prototype.drawCacheOnCanvas.call(this,t)},shouldCache:function(){return this.needsItsOwnCache()},_renderFill:function(t){var e,i,n,s,r,a,o,l,c,h,d,u,p,f,g,m=this._element;m&&(e=this._filterScalingX,i=this._filterScalingY,f=this.width,n=this.height,s=Math.min,r=(a=Math.max)(this.cropX,0),a=a(this.cropY,0),g=m.naturalWidth||m.width,o=m.naturalHeight||m.height,c=a*i,h=s(f*e,g-(l=r*e)),d=s(n*i,o-c),u=-f/2,p=-n/2,f=s(f,g/e-r),g=s(n,o/i-a),m)&&t.drawImage(m,l,c,h,d,u,p,f,g)},_needsResize:function(){var t=this.getTotalObjectScaling();return t.scaleX!==this._lastScaleX||t.scaleY!==this._lastScaleY},_resetWidthHeight:function(){this.set(this.getOriginalSize())},_initElement:function(t,e){this.setElement(V.util.getById(t),e),V.util.addClass(this.getElement(),V.Image.CSS_CANVAS)},_initConfig:function(t){this.setOptions(t=t||{}),this._setWidthHeight(t)},_initFilters:function(t,e){t&&t.length?V.util.enlivenObjects(t,function(t){e&&e(t)},"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){t=t||{};var e=this.getElement();this.width=t.width||e.naturalWidth||e.width||0,this.height=t.height||e.naturalHeight||e.height||0},parsePreserveAspectRatioAttribute:function(){var t,e=V.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,n=this._element.height,s=1,r=1,a=0,o=0,l=0,c=0,h=this.width,d=this.height,u={width:h,height:d};return!e||"none"===e.alignX&&"none"===e.alignY?(s=h/i,r=d/n):("meet"===e.meetOrSlice&&(t=(h-i*(s=r=V.util.findScaleToFit(this._element,u)))/2,"Min"===e.alignX&&(a=-t),"Max"===e.alignX&&(a=t),t=(d-n*r)/2,"Min"===e.alignY&&(o=-t),"Max"===e.alignY)&&(o=t),"slice"===e.meetOrSlice&&(t=i-h/(s=r=V.util.findScaleToCover(this._element,u)),"Mid"===e.alignX&&(l=t/2),"Max"===e.alignX&&(l=t),t=n-d/r,"Mid"===e.alignY&&(c=t/2),"Max"===e.alignY&&(c=t),i=h/s,n=d/r)),{width:i,height:n,scaleX:s,scaleY:r,offsetLeft:a,offsetTop:o,cropX:l,cropY:c}}}),V.Image.CSS_CANVAS="canvas-img",V.Image.prototype.getSvgSrc=V.Image.prototype.getSrc,V.Image.fromObject=function(t,i){var n=V.util.object.clone(t);V.util.loadImage(n.src,function(e,t){t?i&&i(null,!0):V.Image.prototype._initFilters.call(n,n.filters,function(t){n.filters=t||[],V.Image.prototype._initFilters.call(n,[n.resizeFilter],function(t){n.resizeFilter=t[0],V.util.enlivenObjectEnlivables(n,n,function(){var t=new V.Image(e,n);i(t,!1)})})})},null,n.crossOrigin)},V.Image.fromURL=function(t,i,n){V.util.loadImage(t,function(t,e){i&&i(new V.Image(t,n),e)},null,n&&n.crossOrigin)},V.Image.ATTRIBUTE_NAMES=V.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin image-rendering".split(" ")),V.Image.fromElement=function(t,e,i){t=V.parseAttributes(t,V.Image.ATTRIBUTE_NAMES);V.Image.fromURL(t["xlink:href"],e,n(i?V.util.object.clone(i):{},t))})}(i),V.util.object.extend(V.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return 0<t?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten())},fxStraighten:function(t){function e(){}var i=(t=t||{}).onComplete||e,n=t.onChange||e,s=this;return V.util.animate({target:this,startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){s.rotate(t),n()},onComplete:function(){s.setCoords(),i()}})}}),V.util.object.extend(V.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this},fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound})}}),function(){"use strict";function t(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}V.isWebglSupported=function(t){if(V.isLikelyNode)return!1;t=t||V.WebglFilterBackend.prototype.tileSize;var e,i,n,s=document.createElement("canvas"),r=s.getContext("webgl")||s.getContext("experimental-webgl"),s=!1;if(r){V.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE);for(var s=V.maxTextureSize>=t,a=["highp","mediump","lowp"],o=0;o<3;o++)if(n=void 0,i="precision "+(i=a[o])+" float;\nvoid main(){}",n=(e=r).createShader(e.FRAGMENT_SHADER),e.shaderSource(n,i),e.compileShader(n),e.getShaderParameter(n,e.COMPILE_STATUS)){V.webGlPrecision=a[o];break}}return this.isSupported=s},(V.WebglFilterBackend=t).prototype={tileSize:2048,resources:{},setupGLContext:function(t,e){this.dispose(),this.createWebGLCanvas(t,e),this.aPosition=new Float32Array([0,0,0,1,1,0,1,1]),this.chooseFastestCopyGLTo2DMethod(t,e)},chooseFastestCopyGLTo2DMethod:function(t,e){var i=void 0!==window.performance;try{new ImageData(1,1),n=!0}catch(t){n=!1}var n,s="undefined"!=typeof ArrayBuffer,r="undefined"!=typeof Uint8ClampedArray;i&&n&&s&&r&&(i=V.util.createCanvasElement(),n=new ArrayBuffer(t*e*4),V.forceGLPutImageData||(s={imageBuffer:n,destinationWidth:t,destinationHeight:e,targetCanvas:i},i.width=t,i.height=e,r=window.performance.now(),st.call(s,this.gl,s),i=window.performance.now()-r,r=window.performance.now(),rt.call(s,this.gl,s),i>window.performance.now()-r)?(this.imageBuffer=n,this.copyGLTo2D=rt):this.copyGLTo2D=st)},createWebGLCanvas:function(t,e){var i=V.util.createCanvasElement(),t=(i.width=t,i.height=e,{alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1}),e=i.getContext("webgl",t);(e=e||i.getContext("experimental-webgl",t))&&(e.clearColor(0,0,0,0),this.canvas=i,this.gl=e)},applyFilters:function(t,e,i,n,s,r){var a,o=this.gl,l=(r&&(a=this.getCachedTexture(r,e)),{originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:o,sourceTexture:this.createTexture(o,i,n,!a&&e),targetTexture:this.createTexture(o,i,n),originalTexture:a||this.createTexture(o,i,n,!a&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:s}),r=o.createFramebuffer();return o.bindFramebuffer(o.FRAMEBUFFER,r),t.forEach(function(t){t&&t.applyTo(l)}),n=(i=l.targetCanvas).width,a=i.height,e=l.destinationHeight,n===(t=l.destinationWidth)&&a===e||(i.width=t,i.height=e),this.copyGLTo2D(o,l),o.bindTexture(o.TEXTURE_2D,null),o.deleteTexture(l.sourceTexture),o.deleteTexture(l.targetTexture),o.deleteFramebuffer(r),s.getContext("2d").setTransform(1,0,0,1,0,0),l},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n,s){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,s||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,s||t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),n?t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,i,0,t.RGBA,t.UNSIGNED_BYTE,null),r},getCachedTexture:function(t,e){return this.textureCache[t]||(e=this.createTexture(this.gl,e.width,e.height,e),this.textureCache[t]=e)},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:st,captureGPUInfo:function(){var t,e,i,n;return this.gpuInfo||(t={renderer:"",vendor:""},(n=this.gl)&&((e=n.getExtension("WEBGL_debug_renderer_info"))&&(i=n.getParameter(e.UNMASKED_RENDERER_WEBGL),n=n.getParameter(e.UNMASKED_VENDOR_WEBGL),i&&(t.renderer=i.toLowerCase()),n)&&(t.vendor=n.toLowerCase()),this.gpuInfo=t),t)}}}(),function(){"use strict";function t(){}function e(){}(V.Canvas2dFilterBackend=e).prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,s){var r=s.getContext("2d"),a=(r.drawImage(e,0,0,i,n),{sourceWidth:i,sourceHeight:n,imageData:r.getImageData(0,0,i,n),originalEl:e,originalImageData:r.getImageData(0,0,i,n),canvasEl:s,ctx:r,filterBackend:this});return t.forEach(function(t){t.applyTo(a)}),a.imageData.width===i&&a.imageData.height===n||(s.width=a.imageData.width,s.height=a.imageData.height),r.putImageData(a.imageData,0,0),a}}}(),V.Image=V.Image||{},V.Image.filters=V.Image.filters||{},V.Image.filters.BaseFilter=V.util.createClass({type:"BaseFilter",vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvoid main(){\nvTexCoord=aPosition;\ngl_Position=vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:"precision highp float;\nvarying vec2 vTexCoord;\nuniform sampler2D uTexture;\nvoid main(){\ngl_FragColor=texture2D(uTexture, vTexCoord);\n}",initialize:function(t){t&&this.setOptions(t)},setOptions:function(t){for(var e in t)this[e]=t[e]},createProgram:function(t,e,i){e=e||this.fragmentSource,i=i||this.vertexSource,"highp"!==V.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+V.webGlPrecision+" float"));var n=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(n,i),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(n));i=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(i,e),t.compileShader(i),!t.getShaderParameter(i,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(i));e=t.createProgram();if(t.attachShader(e,n),t.attachShader(e,i),t.linkProgram(e),t.getProgramParameter(e,t.LINK_STATUS))return n=this.getAttributeLocations(t,e),(i=this.getUniformLocations(t,e)||{}).uStepW=t.getUniformLocation(e,"uStepW"),i.uStepH=t.getUniformLocation(e,"uStepH"),{program:e,attributeLocations:n,uniformLocations:i};throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(e))},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var e=e.aPosition,n=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,n),t.enableVertexAttribArray(e),t.vertexAttribPointer(e,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;1<t.passes?(e=t.destinationWidth,i=t.destinationHeight,t.sourceWidth===e&&t.sourceHeight===i||(n.deleteTexture(t.targetTexture),t.targetTexture=t.filterBackend.createTexture(n,e,i)),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t.targetTexture,0)):(n.bindFramebuffer(n.FRAMEBUFFER,null),n.finish())},_swapTextures:function(t){t.passes--,t.pass++;var e=t.targetTexture;t.targetTexture=t.sourceTexture,t.sourceTexture=e},isNeutralState:function(){var t=this.mainParameter,e=V.Image.filters[this.type].prototype;if(t){if(Array.isArray(e[t])){for(var i=e[t].length;i--;)if(this[t][i]!==e[t][i])return!1;return!0}return e[t]===this[t]}return!1},applyTo:function(t){t.webgl?(this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},retrieveShader:function(t){return t.programCache.hasOwnProperty(this.type)||(t.programCache[this.type]=this.createProgram(t.context)),t.programCache[this.type]},applyToWebGL:function(t){var e=t.context,i=this.retrieveShader(t);0===t.pass&&t.originalTexture?e.bindTexture(e.TEXTURE_2D,t.originalTexture):e.bindTexture(e.TEXTURE_2D,t.sourceTexture),e.useProgram(i.program),this.sendAttributeData(e,i.attributeLocations,t.aPosition),e.uniform1f(i.uniformLocations.uStepW,1/t.sourceWidth),e.uniform1f(i.uniformLocations.uStepH,1/t.sourceHeight),this.sendUniformData(e,i.uniformLocations),e.viewport(0,0,t.destinationWidth,t.destinationHeight),e.drawArrays(e.TRIANGLE_STRIP,0,4)},bindAdditionalTexture:function(t,e,i){t.activeTexture(i),t.bindTexture(t.TEXTURE_2D,e),t.activeTexture(t.TEXTURE0)},unbindAdditionalTexture:function(t,e){t.activeTexture(e),t.bindTexture(t.TEXTURE_2D,null),t.activeTexture(t.TEXTURE0)},getMainParameter:function(){return this[this.mainParameter]},setMainParameter:function(t){this[this.mainParameter]=t},sendUniformData:function(){},createHelpLayer:function(t){var e;t.helpLayer||((e=document.createElement("canvas")).width=t.sourceWidth,e.height=t.sourceHeight,t.helpLayer=e)},toObject:function(){var t={type:this.type},e=this.mainParameter;return e&&(t[e]=this[e]),t},toJSON:function(){return this.toObject()}}),V.Image.filters.BaseFilter.fromObject=function(t,e){t=new V.Image.filters[t.type](t);return e&&e(t),t},function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.ColorMatrix=i(e.BaseFilter,{type:"ColorMatrix",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nuniform mat4 uColorMatrix;\nuniform vec4 uConstants;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\ncolor *=uColorMatrix;\ncolor +=uConstants;\ngl_FragColor=color;\n}",matrix:[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],mainParameter:"matrix",colorsOnly:!0,initialize:function(t){this.callSuper("initialize",t),this.matrix=this.matrix.slice(0)},applyTo2d:function(t){for(var e,i,n,s,r=t.imageData.data,a=r.length,o=this.matrix,l=this.colorsOnly,c=0;c<a;c+=4)e=r[c],i=r[c+1],n=r[c+2],l?(r[c]=e*o[0]+i*o[1]+n*o[2]+255*o[4],r[c+1]=e*o[5]+i*o[6]+n*o[7]+255*o[9],r[c+2]=e*o[10]+i*o[11]+n*o[12]+255*o[14]):(s=r[c+3],r[c]=e*o[0]+i*o[1]+n*o[2]+s*o[3]+255*o[4],r[c+1]=e*o[5]+i*o[6]+n*o[7]+s*o[8]+255*o[9],r[c+2]=e*o[10]+i*o[11]+n*o[12]+s*o[13]+255*o[14],r[c+3]=e*o[15]+i*o[16]+n*o[17]+s*o[18]+255*o[19])},getUniformLocations:function(t,e){return{uColorMatrix:t.getUniformLocation(e,"uColorMatrix"),uConstants:t.getUniformLocation(e,"uConstants")}},sendUniformData:function(t,e){var i=this.matrix,n=[i[0],i[1],i[2],i[3],i[5],i[6],i[7],i[8],i[10],i[11],i[12],i[13],i[15],i[16],i[17],i[18]],i=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,n),t.uniform4fv(e.uConstants,i)}}),t.Image.filters.ColorMatrix.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Brightness=i(e.BaseFilter,{type:"Brightness",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBrightness;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\ncolor.rgb +=uBrightness;\ngl_FragColor=color;\n}",brightness:0,mainParameter:"brightness",applyTo2d:function(t){if(0!==this.brightness)for(var e=t.imageData.data,i=e.length,n=Math.round(255*this.brightness),s=0;s<i;s+=4)e[s]=e[s]+n,e[s+1]=e[s+1]+n,e[s+2]=e[s+2]+n},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),t.Image.filters.Brightness.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.util.object.extend,i=t.Image.filters,n=t.util.createClass;i.Convolute=n(i.BaseFilter,{type:"Convolute",opaque:!1,matrix:[0,0,0,0,1,0,0,0,0],fragmentSource:{Convolute_3_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 0);\nfor (float h=0.0; h < 3.0; h+=1.0){\nfor (float w=0.0; w < 3.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 1), uStepH * (h - 1));\ncolor +=texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 3.0 + w)];\n}\n}\ngl_FragColor=color;\n}",Convolute_3_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[9];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 1);\nfor (float h=0.0; h < 3.0; h+=1.0){\nfor (float w=0.0; w < 3.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 1.0), uStepH * (h - 1.0));\ncolor.rgb +=texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 3.0 + w)];\n}\n}\nfloat alpha=texture2D(uTexture, vTexCoord).a;\ngl_FragColor=color;\ngl_FragColor.a=alpha;\n}",Convolute_5_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 0);\nfor (float h=0.0; h < 5.0; h+=1.0){\nfor (float w=0.0; w < 5.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor +=texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 5.0 + w)];\n}\n}\ngl_FragColor=color;\n}",Convolute_5_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[25];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 1);\nfor (float h=0.0; h < 5.0; h+=1.0){\nfor (float w=0.0; w < 5.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 2.0), uStepH * (h - 2.0));\ncolor.rgb +=texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 5.0 + w)];\n}\n}\nfloat alpha=texture2D(uTexture, vTexCoord).a;\ngl_FragColor=color;\ngl_FragColor.a=alpha;\n}",Convolute_7_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 0);\nfor (float h=0.0; h < 7.0; h+=1.0){\nfor (float w=0.0; w < 7.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor +=texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 7.0 + w)];\n}\n}\ngl_FragColor=color;\n}",Convolute_7_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[49];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 1);\nfor (float h=0.0; h < 7.0; h+=1.0){\nfor (float w=0.0; w < 7.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 3.0), uStepH * (h - 3.0));\ncolor.rgb +=texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 7.0 + w)];\n}\n}\nfloat alpha=texture2D(uTexture, vTexCoord).a;\ngl_FragColor=color;\ngl_FragColor.a=alpha;\n}",Convolute_9_1:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 0);\nfor (float h=0.0; h < 9.0; h+=1.0){\nfor (float w=0.0; w < 9.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor +=texture2D(uTexture, vTexCoord + matrixPos) * uMatrix[int(h * 9.0 + w)];\n}\n}\ngl_FragColor=color;\n}",Convolute_9_0:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uMatrix[81];\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=vec4(0, 0, 0, 1);\nfor (float h=0.0; h < 9.0; h+=1.0){\nfor (float w=0.0; w < 9.0; w+=1.0){\nvec2 matrixPos=vec2(uStepW * (w - 4.0), uStepH * (h - 4.0));\ncolor.rgb +=texture2D(uTexture, vTexCoord + matrixPos).rgb * uMatrix[int(h * 9.0 + w)];\n}\n}\nfloat alpha=texture2D(uTexture, vTexCoord).a;\ngl_FragColor=color;\ngl_FragColor.a=alpha;\n}"},retrieveShader:function(t){var e=Math.sqrt(this.matrix.length),e=this.type+"_"+e+"_"+(this.opaque?1:0),i=this.fragmentSource[e];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyTo2d:function(t){for(var e,i,n,s,r,a,o,l,c,h,d,u=t.imageData,p=u.data,f=this.matrix,g=Math.round(Math.sqrt(f.length)),m=Math.floor(g/2),v=u.width,b=u.height,u=t.ctx.createImageData(v,b),y=u.data,x=this.opaque?1:0,w=0;w<b;w++)for(c=0;c<v;c++){for(r=4*(w*v+c),d=s=n=i=e=0;d<g;d++)for(h=0;h<g;h++)a=c+h-m,(o=w+d-m)<0||b<=o||a<0||v<=a||(l=f[d*g+h],e+=p[o=4*(o*v+a)]*l,i+=p[1+o]*l,n+=p[2+o]*l,x)||(s+=p[3+o]*l);y[r]=e,y[1+r]=i,y[2+r]=n,y[3+r]=x?p[3+r]:s}t.imageData=u},getUniformLocations:function(t,e){return{uMatrix:t.getUniformLocation(e,"uMatrix"),uOpaque:t.getUniformLocation(e,"uOpaque"),uHalfSize:t.getUniformLocation(e,"uHalfSize"),uSize:t.getUniformLocation(e,"uSize")}},sendUniformData:function(t,e){t.uniform1fv(e.uMatrix,this.matrix)},toObject:function(){return e(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),t.Image.filters.Convolute.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Grayscale=i(e.BaseFilter,{type:"Grayscale",fragmentSource:{average:"precision highp float;\nuniform sampler2D uTexture;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nfloat average=(color.r + color.b + color.g) / 3.0;\ngl_FragColor=vec4(average, average, average, color.a);\n}",lightness:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 col=texture2D(uTexture, vTexCoord);\nfloat average=(max(max(col.r, col.g),col.b) + min(min(col.r, col.g),col.b)) / 2.0;\ngl_FragColor=vec4(average, average, average, col.a);\n}",luminosity:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uMode;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 col=texture2D(uTexture, vTexCoord);\nfloat average=0.21 * col.r + 0.72 * col.g + 0.07 * col.b;\ngl_FragColor=vec4(average, average, average, col.a);\n}"},mode:"average",mainParameter:"mode",applyTo2d:function(t){for(var e,i=t.imageData.data,n=i.length,s=this.mode,r=0;r<n;r+=4)"average"===s?e=(i[r]+i[r+1]+i[r+2])/3:"lightness"===s?e=(Math.min(i[r],i[r+1],i[r+2])+Math.max(i[r],i[r+1],i[r+2]))/2:"luminosity"===s&&(e=.21*i[r]+.72*i[r+1]+.07*i[r+2]),i[r]=e,i[r+1]=e,i[r+2]=e},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.fragmentSource[this.mode],t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){t.uniform1i(e.uMode,1)},isNeutralState:function(){return!1}}),t.Image.filters.Grayscale.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Invert=i(e.BaseFilter,{type:"Invert",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform int uInvert;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nif(uInvert==1){\ngl_FragColor=vec4(1.0 - color.r,1.0 -color.g,1.0 -color.b,color.a);\n}else{\ngl_FragColor=color;\n}\n}",invert:!0,mainParameter:"invert",applyTo2d:function(t){for(var e=t.imageData.data,i=e.length,n=0;n<i;n+=4)e[n]=255-e[n],e[n+1]=255-e[n+1],e[n+2]=255-e[n+2]},isNeutralState:function(){return!this.invert},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),t.Image.filters.Invert.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.util.object.extend,i=t.Image.filters,n=t.util.createClass;i.Noise=n(i.BaseFilter,{type:"Noise",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uStepH;\nuniform float uNoise;\nuniform float uSeed;\nvarying vec2 vTexCoord;\nfloat rand (vec2 co, float seed, float vScale){\nreturn fract(sin(dot(co.xy * vScale ,vec2(12.9898 , 78.233))) * 43758.5453 * (seed + 0.01) / 2.0);\n}\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\ncolor.rgb +=(0.5 - rand (vTexCoord, uSeed, 0.1 / uStepH)) * uNoise;\ngl_FragColor=color;\n}",mainParameter:"noise",noise:0,applyTo2d:function(t){if(0!==this.noise)for(var e,i=t.imageData.data,n=(i.length,this.noise),s=0,r=i.length;s<r;s+=4)e=(.5-Math.random())*n,i[s]+=e,i[s+1]+=e,i[s+2]+=e},getUniformLocations:function(t,e){return{uNoise:t.getUniformLocation(e,"uNoise"),uSeed:t.getUniformLocation(e,"uSeed")}},sendUniformData:function(t,e){t.uniform1f(e.uNoise,this.noise/255),t.uniform1f(e.uSeed,Math.random())},toObject:function(){return e(this.callSuper("toObject"),{noise:this.noise})}}),t.Image.filters.Noise.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Pixelate=i(e.BaseFilter,{type:"Pixelate",blocksize:4,mainParameter:"blocksize",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uBlocksize;\nuniform float uStepW;\nuniform float uStepH;\nvarying vec2 vTexCoord;\nvoid main(){\nfloat blockW=uBlocksize * uStepW;\nfloat blockH=uBlocksize * uStepW;\nint posX=int(vTexCoord.x / blockW);\nint posY=int(vTexCoord.y / blockH);\nfloat fposX=float(posX);\nfloat fposY=float(posY);\nvec2 squareCoords=vec2(fposX * blockW, fposY * blockH);\nvec4 color=texture2D(uTexture, squareCoords);\ngl_FragColor=color;\n}",applyTo2d:function(t){for(var e,i,n,s,r,a,o,l,c,h,t=t.imageData,d=t.data,u=t.height,p=t.width,f=0;f<u;f+=this.blocksize)for(i=0;i<p;i+=this.blocksize)for(n=d[e=4*f*p+4*i],s=d[1+e],r=d[2+e],a=d[3+e],c=Math.min(f+this.blocksize,u),h=Math.min(i+this.blocksize,p),o=f;o<c;o++)for(l=i;l<h;l++)d[e=4*o*p+4*l]=n,d[1+e]=s,d[2+e]=r,d[3+e]=a},isNeutralState:function(){return 1===this.blocksize},getUniformLocations:function(t,e){return{uBlocksize:t.getUniformLocation(e,"uBlocksize"),uStepW:t.getUniformLocation(e,"uStepW"),uStepH:t.getUniformLocation(e,"uStepH")}},sendUniformData:function(t,e){t.uniform1f(e.uBlocksize,this.blocksize)}}),t.Image.filters.Pixelate.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var c=t.fabric||(t.fabric={}),e=c.util.object.extend,t=c.Image.filters,i=c.util.createClass;t.RemoveColor=i(t.BaseFilter,{type:"RemoveColor",color:"#FFFFFF",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uLow;\nuniform vec4 uHigh;\nvarying vec2 vTexCoord;\nvoid main(){\ngl_FragColor=texture2D(uTexture, vTexCoord);\nif(all(greaterThan(gl_FragColor.rgb,uLow.rgb))&&all(greaterThan(uHigh.rgb,gl_FragColor.rgb))){\ngl_FragColor.a=0.0;\n}\n}",distance:.02,useAlpha:!1,applyTo2d:function(t){for(var e,i,n,s=t.imageData.data,t=255*this.distance,r=new c.Color(this.color).getSource(),a=[r[0]-t,r[1]-t,r[2]-t],o=[r[0]+t,r[1]+t,r[2]+t],l=0;l<s.length;l+=4)e=s[l],i=s[l+1],n=s[l+2],a[0]<e&&a[1]<i&&a[2]<n&&e<o[0]&&i<o[1]&&n<o[2]&&(s[l+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,e){var i=new c.Color(this.color).getSource(),n=parseFloat(this.distance),s=[0+i[0]/255-n,0+i[1]/255-n,0+i[2]/255-n,1],i=[i[0]/255+n,i[1]/255+n,i[2]/255+n,1];t.uniform4fv(e.uLow,s),t.uniform4fv(e.uHigh,i)},toObject:function(){return e(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),c.Image.filters.RemoveColor.fromObject=c.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e,i=t.fabric||(t.fabric={}),n=i.Image.filters,s=i.util.createClass,r={Brownie:[.5997,.34553,-.27082,0,.186,-.0377,.86095,.15059,0,-.1449,.24113,-.07441,.44972,0,-.02965,0,0,0,1,0],Vintage:[.62793,.32021,-.03965,0,.03784,.02578,.64411,.03259,0,.02926,.0466,-.08512,.52416,0,.02023,0,0,0,1,0],Kodachrome:[1.12855,-.39673,-.03992,0,.24991,-.16404,1.08352,-.05498,0,.09698,-.16786,-.56034,1.60148,0,.13972,0,0,0,1,0],Technicolor:[1.91252,-.85453,-.09155,0,.04624,-.30878,1.76589,-.10601,0,-.27589,-.2311,-.75018,1.84759,0,.12137,0,0,0,1,0],Polaroid:[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],Sepia:[.393,.769,.189,0,0,.349,.686,.168,0,0,.272,.534,.131,0,0,0,0,0,1,0],BlackWhite:[1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,1.5,1.5,1.5,0,-1,0,0,0,1,0]};for(e in r)n[e]=s(n.ColorMatrix,{type:e,matrix:r[e],mainParameter:!1,colorsOnly:!0}),i.Image.filters[e].fromObject=i.Image.filters.BaseFilter.fromObject}(i),function(){"use strict";var d=i.fabric,t=d.Image.filters,e=d.util.createClass;t.BlendColor=e(t.BaseFilter,{type:"BlendColor",color:"#F95C63",mode:"multiply",alpha:1,fragmentSource:{multiply:"gl_FragColor.rgb *=uColor.rgb;\n",screen:"gl_FragColor.rgb=1.0 - (1.0 - gl_FragColor.rgb) * (1.0 - uColor.rgb);\n",add:"gl_FragColor.rgb +=uColor.rgb;\n",diff:"gl_FragColor.rgb=abs(gl_FragColor.rgb - uColor.rgb);\n",subtract:"gl_FragColor.rgb -=uColor.rgb;\n",lighten:"gl_FragColor.rgb=max(gl_FragColor.rgb, uColor.rgb);\n",darken:"gl_FragColor.rgb=min(gl_FragColor.rgb, uColor.rgb);\n",exclusion:"gl_FragColor.rgb +=uColor.rgb - 2.0 * (uColor.rgb * gl_FragColor.rgb);\n",overlay:"if(uColor.r < 0.5){\ngl_FragColor.r *=2.0 * uColor.r;\n}else{\ngl_FragColor.r=1.0 - 2.0 * (1.0 - gl_FragColor.r) * (1.0 - uColor.r);\n}\nif(uColor.g < 0.5){\ngl_FragColor.g *=2.0 * uColor.g;\n}else{\ngl_FragColor.g=1.0 - 2.0 * (1.0 - gl_FragColor.g) * (1.0 - uColor.g);\n}\nif(uColor.b < 0.5){\ngl_FragColor.b *=2.0 * uColor.b;\n}else{\ngl_FragColor.b=1.0 - 2.0 * (1.0 - gl_FragColor.b) * (1.0 - uColor.b);\n}\n",tint:"gl_FragColor.rgb *=(1.0 - uColor.a);\ngl_FragColor.rgb +=uColor.rgb;\n"},buildSource:function(t){return"precision highp float;\nuniform sampler2D uTexture;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\ngl_FragColor=color;\nif(color.a > 0.0){\n"+this.fragmentSource[t]+"}\n}"},retrieveShader:function(t){var e,i=this.type+"_"+this.mode;return t.programCache.hasOwnProperty(i)||(e=this.buildSource(this.mode),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},applyTo2d:function(t){for(var e,i,n,s=t.imageData.data,r=s.length,a=1-this.alpha,o=(t=new d.Color(this.color).getSource())[0]*this.alpha,l=t[1]*this.alpha,c=t[2]*this.alpha,h=0;h<r;h+=4)switch(e=s[h],i=s[h+1],n=s[h+2],this.mode){case"multiply":s[h]=e*o/255,s[h+1]=i*l/255,s[h+2]=n*c/255;break;case"screen":s[h]=255-(255-e)*(255-o)/255,s[h+1]=255-(255-i)*(255-l)/255,s[h+2]=255-(255-n)*(255-c)/255;break;case"add":s[h]=e+o,s[h+1]=i+l,s[h+2]=n+c;break;case"diff":case"difference":s[h]=Math.abs(e-o),s[h+1]=Math.abs(i-l),s[h+2]=Math.abs(n-c);break;case"subtract":s[h]=e-o,s[h+1]=i-l,s[h+2]=n-c;break;case"darken":s[h]=Math.min(e,o),s[h+1]=Math.min(i,l),s[h+2]=Math.min(n,c);break;case"lighten":s[h]=Math.max(e,o),s[h+1]=Math.max(i,l),s[h+2]=Math.max(n,c);break;case"overlay":s[h]=o<128?2*e*o/255:255-2*(255-e)*(255-o)/255,s[h+1]=l<128?2*i*l/255:255-2*(255-i)*(255-l)/255,s[h+2]=c<128?2*n*c/255:255-2*(255-n)*(255-c)/255;break;case"exclusion":s[h]=o+e-2*o*e/255,s[h+1]=l+i-2*l*i/255,s[h+2]=c+n-2*c*n/255;break;case"tint":s[h]=o+e*a,s[h+1]=l+i*a,s[h+2]=c+n*a}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,e){var i=new d.Color(this.color).getSource();i[0]=this.alpha*i[0]/255,i[1]=this.alpha*i[1]/255,i[2]=this.alpha*i[2]/255,i[3]=this.alpha,t.uniform4fv(e.uColor,i)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),d.Image.filters.BlendColor.fromObject=d.Image.filters.BaseFilter.fromObject}(),function(){"use strict";var v=i.fabric,t=v.Image.filters,e=v.util.createClass;t.BlendImage=e(t.BaseFilter,{type:"BlendImage",image:null,mode:"multiply",alpha:1,vertexSource:"attribute vec2 aPosition;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nuniform mat3 uTransformMatrix;\nvoid main(){\nvTexCoord=aPosition;\nvTexCoord2=(uTransformMatrix * vec3(aPosition, 1.0)).xy;\ngl_Position=vec4(aPosition * 2.0 - 1.0, 0.0, 1.0);\n}",fragmentSource:{multiply:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nvec4 color2=texture2D(uImage, vTexCoord2);\ncolor.rgba *=color2.rgba;\ngl_FragColor=color;\n}",mask:"precision highp float;\nuniform sampler2D uTexture;\nuniform sampler2D uImage;\nuniform vec4 uColor;\nvarying vec2 vTexCoord;\nvarying vec2 vTexCoord2;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nvec4 color2=texture2D(uImage, vTexCoord2);\ncolor.a=color2.a;\ngl_FragColor=color;\n}"},retrieveShader:function(t){var e=this.type+"_"+this.mode,i=this.fragmentSource[this.mode];return t.programCache.hasOwnProperty(e)||(t.programCache[e]=this.createProgram(t.context,i)),t.programCache[e]},applyToWebGL:function(t){var e=t.context,i=this.createTexture(t.filterBackend,this.image);this.bindAdditionalTexture(e,i,e.TEXTURE1),this.callSuper("applyToWebGL",t),this.unbindAdditionalTexture(e,e.TEXTURE1)},createTexture:function(t,e){return t.getCachedTexture(e.cacheKey,e._element)},calculateMatrix:function(){var t=this.image,e=t._element.width,i=t._element.height;return[1/t.scaleX,0,0,0,1/t.scaleY,0,-t.left/e,-t.top/i,1]},applyTo2d:function(t){var e,i,n,s,r,a,o,l,c,h=t.imageData,t=t.filterBackend.resources,d=h.data,u=d.length,p=h.width,h=h.height,f=this.image;t.blendImage||(t.blendImage=v.util.createCanvasElement()),c=(t=t.blendImage).getContext("2d"),t.width!==p||t.height!==h?(t.width=p,t.height=h):c.clearRect(0,0,p,h),c.setTransform(f.scaleX,0,0,f.scaleY,f.left,f.top),c.drawImage(f._element,0,0,p,h);for(var g=c.getImageData(0,0,p,h).data,m=0;m<u;m+=4)switch(r=d[m],a=d[m+1],o=d[m+2],l=d[m+3],e=g[m],i=g[m+1],n=g[m+2],s=g[m+3],this.mode){case"multiply":d[m]=r*e/255,d[m+1]=a*i/255,d[m+2]=o*n/255,d[m+3]=l*s/255;break;case"mask":d[m+3]=s}},getUniformLocations:function(t,e){return{uTransformMatrix:t.getUniformLocation(e,"uTransformMatrix"),uImage:t.getUniformLocation(e,"uImage")}},sendUniformData:function(t,e){var i=this.calculateMatrix();t.uniform1i(e.uImage,1),t.uniformMatrix3fv(e.uTransformMatrix,!1,i)},toObject:function(){return{type:this.type,image:this.image&&this.image.toObject(),mode:this.mode,alpha:this.alpha}}}),v.Image.filters.BlendImage.fromObject=function(i,n){v.Image.fromObject(i.image,function(t){var e=v.util.object.clone(i);e.image=t,n(new v.Image.filters.BlendImage(e))})}}(),function(t){"use strict";var m=t.fabric||(t.fabric={}),M=Math.pow,P=Math.floor,_=Math.sqrt,D=Math.abs,a=Math.round,n=Math.sin,L=Math.ceil,t=m.Image.filters,e=m.util.createClass;t.Resize=e(t.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:1,scaleY:1,lanczosLobes:3,getUniformLocations:function(t,e){return{uDelta:t.getUniformLocation(e,"uDelta"),uTaps:t.getUniformLocation(e,"uTaps")}},sendUniformData:function(t,e){t.uniform2fv(e.uDelta,this.horizontal?[1/this.width,0]:[0,1/this.height]),t.uniform1fv(e.uTaps,this.taps)},retrieveShader:function(t){var e=this.getFilterWindow(),i=this.type+"_"+e;return t.programCache.hasOwnProperty(i)||(e=this.generateShader(e),t.programCache[i]=this.createProgram(t.context,e)),t.programCache[i]},getFilterWindow:function(){var t=this.tempScale;return Math.ceil(this.lanczosLobes/t)},getTaps:function(){for(var t=this.lanczosCreate(this.lanczosLobes),e=this.tempScale,i=this.getFilterWindow(),n=new Array(i),s=1;s<=i;s++)n[s-1]=t(s*e);return n},generateShader:function(t){for(var e=new Array(t),i=this.fragmentSourceTOP,n=1;n<=t;n++)e[n-1]=n+".0 * uDelta";return i=(i=i+("uniform float uTaps["+t+"];\n")+"void main(){\n")+"  vec4 color=texture2D(uTexture, vTexCoord);\n"+"  float sum=1.0;\n",e.forEach(function(t,e){i=(i+="  color +=texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n")+("  color +=texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n")+("  sum +=2.0 * uTaps["+e+"];\n")}),i=i+"  gl_FragColor=color / sum;\n"+"}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){t.webgl?(t.passes++,this.width=t.sourceWidth,this.horizontal=!0,this.dW=Math.round(this.width*this.scaleX),this.dH=t.sourceHeight,this.tempScale=this.dW/this.width,this.taps=this.getTaps(),t.destinationWidth=this.dW,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceWidth=t.destinationWidth,this.height=t.sourceHeight,this.horizontal=!1,this.dH=Math.round(this.height*this.scaleY),this.tempScale=this.dH/this.height,this.taps=this.getTaps(),t.destinationHeight=this.dH,this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t),t.sourceHeight=t.destinationHeight):this.applyTo2d(t)},isNeutralState:function(){return 1===this.scaleX&&1===this.scaleY},lanczosCreate:function(i){return function(t){var e;return i<=t||t<=-i?0:t<1.1920929e-7&&-1.1920929e-7<t?1:(e=(t*=Math.PI)/i,n(t)/t*n(e)/e)}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var s,r=e.width,e=e.height,i=a(r*i),n=a(e*n);"sliceHack"===this.resizeType?s=this.sliceByTwo(t,r,e,i,n):"hermite"===this.resizeType?s=this.hermiteFastResize(t,r,e,i,n):"bilinear"===this.resizeType?s=this.bilinearFiltering(t,r,e,i,n):"lanczos"===this.resizeType&&(s=this.lanczosResize(t,r,e,i,n)),t.imageData=s},sliceByTwo:function(t,e,i,n,s){var r,a,t=t.imageData,o=!1,l=!1,c=.5*e,h=.5*i,d=m.filterBackend.resources,u=0,p=0,f=e,g=0;for(d.sliceByTwo||(d.sliceByTwo=document.createElement("canvas")),((r=d.sliceByTwo).width<1.5*e||r.height<i)&&(r.width=1.5*e,r.height=i),(a=r.getContext("2d")).clearRect(0,0,1.5*e,i),a.putImageData(t,0,0),n=P(n),s=P(s);!o||!l;)i=h,n<P(.5*(e=c))?c=P(.5*c):(c=n,o=!0),s<P(.5*h)?h=P(.5*h):(h=s,l=!0),a.drawImage(r,u,p,e,i,f,g,c,h),u=f,p=g,g+=h;return a.getImageData(u,p,n,s)},lanczosResize:function(t,p,f,g,m){var v=t.imageData.data,b=t.ctx.createImageData(g,m),y=b.data,x=this.lanczosCreate(this.lanczosLobes),w=this.rcpScaleX,C=this.rcpScaleY,S=2/this.rcpScaleX,E=2/this.rcpScaleY,T=L(w*this.lanczosLobes/2),A=L(C*this.lanczosLobes/2),I={},O={},k={};return function t(e){var i,n,s,r,a,o,l,c,h,d;for(O.x=(e+.5)*w,k.x=P(O.x),i=0;i<m;i++){for(O.y=(i+.5)*C,k.y=P(O.y),c=l=o=a=r=0,n=k.x-T;n<=k.x+T;n++)if(!(n<0||p<=n)){h=P(1e3*D(n-O.x)),I[h]||(I[h]={});for(var u=k.y-A;u<=k.y+A;u++)u<0||f<=u||(d=P(1e3*D(u-O.y)),I[h][d]||(I[h][d]=x(_(M(h*S,2)+M(d*E,2))/1e3)),0<(d=I[h][d])&&(r+=d,a+=d*v[s=4*(u*p+n)],o+=d*v[s+1],l+=d*v[s+2],c+=d*v[s+3]))}y[s=4*(i*g+e)]=a/r,y[s+1]=o/r,y[s+2]=l/r,y[s+3]=c/r}return++e<g?t(e):b}(0)},bilinearFiltering:function(t,e,i,n,s){for(var r,a,o,l,c,h,d,u,p=0,f=this.rcpScaleX,g=this.rcpScaleY,m=4*(e-1),v=t.imageData.data,t=t.ctx.createImageData(n,s),b=t.data,y=0;y<s;y++)for(o=0;o<n;o++)for(l=f*o-(r=P(f*o)),c=g*y-(a=P(g*y)),u=4*(a*e+r),h=0;h<4;h++)d=v[u+h]*(1-l)*(1-c)+v[4+u+h]*l*(1-c)+v[u+m+h]*c*(1-l)+v[u+m+4+h]*l*c,b[p++]=d;return t},hermiteFastResize:function(t,e,i,n,s){for(var r=this.rcpScaleX,a=this.rcpScaleY,o=L(r/2),l=L(a/2),c=t.imageData.data,t=t.ctx.createImageData(n,s),h=t.data,d=0;d<s;d++)for(var u=0;u<n;u++){for(var p=4*(u+d*n),f=0,g=0,m=0,v=0,b=0,y=0,x=0,w=(d+.5)*a,C=P(d*a);C<(d+1)*a;C++)for(var S=D(w-(C+.5))/l,E=(u+.5)*r,T=S*S,A=P(u*r);A<(u+1)*r;A++){var I=D(E-(A+.5))/o,O=_(T+I*I);1<O&&O<-1||0<(f=2*O*O*O-3*O*O+1)&&(x+=f*c[3+(I=4*(A+C*e))],m+=f,v+=(f=c[3+I]<255?f*c[3+I]/250:f)*c[I],b+=f*c[1+I],y+=f*c[2+I],g+=f)}h[p]=v/g,h[1+p]=b/g,h[2+p]=y/g,h[3+p]=x/m}return t},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),m.Image.filters.Resize.fromObject=m.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Contrast=i(e.BaseFilter,{type:"Contrast",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uContrast;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nfloat contrastF=1.015 * (uContrast + 1.0) / (1.0 * (1.015 - uContrast));\ncolor.rgb=contrastF * (color.rgb - 0.5) + 0.5;\ngl_FragColor=color;\n}",contrast:0,mainParameter:"contrast",applyTo2d:function(t){if(0!==this.contrast)for(var e=t.imageData.data,i=e.length,t=Math.floor(255*this.contrast),n=259*(t+255)/(255*(259-t)),s=0;s<i;s+=4)e[s]=n*(e[s]-128)+128,e[s+1]=n*(e[s+1]-128)+128,e[s+2]=n*(e[s+2]-128)+128},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),t.Image.filters.Contrast.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Saturation=i(e.BaseFilter,{type:"Saturation",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uSaturation;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nfloat rgMax=max(color.r, color.g);\nfloat rgbMax=max(rgMax, color.b);\ncolor.r +=rgbMax!=color.r ? (rgbMax - color.r) * uSaturation:0.00;\ncolor.g +=rgbMax!=color.g ? (rgbMax - color.g) * uSaturation:0.00;\ncolor.b +=rgbMax!=color.b ? (rgbMax - color.b) * uSaturation:0.00;\ngl_FragColor=color;\n}",saturation:0,mainParameter:"saturation",applyTo2d:function(t){if(0!==this.saturation)for(var e,i=t.imageData.data,n=i.length,s=-this.saturation,r=0;r<n;r+=4)e=Math.max(i[r],i[r+1],i[r+2]),i[r]+=e!==i[r]?(e-i[r])*s:0,i[r+1]+=e!==i[r+1]?(e-i[r+1])*s:0,i[r+2]+=e!==i[r+2]?(e-i[r+2])*s:0},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),t.Image.filters.Saturation.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Vibrance=i(e.BaseFilter,{type:"Vibrance",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform float uVibrance;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nfloat max=max(color.r, max(color.g, color.b));\nfloat avg=(color.r + color.g + color.b) / 3.0;\nfloat amt=(abs(max - avg) * 2.0) * uVibrance;\ncolor.r +=max!=color.r ? (max - color.r) * amt:0.00;\ncolor.g +=max!=color.g ? (max - color.g) * amt:0.00;\ncolor.b +=max!=color.b ? (max - color.b) * amt:0.00;\ngl_FragColor=color;\n}",vibrance:0,mainParameter:"vibrance",applyTo2d:function(t){if(0!==this.vibrance)for(var e,i,n=t.imageData.data,s=n.length,r=-this.vibrance,a=0;a<s;a+=4)e=Math.max(n[a],n[a+1],n[a+2]),i=(n[a]+n[a+1]+n[a+2])/3,i=2*Math.abs(e-i)/255*r,n[a]+=e!==n[a]?(e-n[a])*i:0,n[a+1]+=e!==n[a+1]?(e-n[a+1])*i:0,n[a+2]+=e!==n[a+2]?(e-n[a+2])*i:0},getUniformLocations:function(t,e){return{uVibrance:t.getUniformLocation(e,"uVibrance")}},sendUniformData:function(t,e){t.uniform1f(e.uVibrance,-this.vibrance)}}),t.Image.filters.Vibrance.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var p=t.fabric||(t.fabric={}),t=p.Image.filters,e=p.util.createClass;t.Blur=e(t.BaseFilter,{type:"Blur",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\nconst float nSamples=15.0;\nvec3 v3offset=vec3(12.9898, 78.233, 151.7182);\nfloat random(vec3 scale){\nreturn fract(sin(dot(gl_FragCoord.xyz, scale)) * 43758.5453);\n}\nvoid main(){\nvec4 color=vec4(0.0);\nfloat total=0.0;\nfloat offset=random(v3offset);\nfor (float t=-nSamples; t <=nSamples; t++){\nfloat percent=(t + offset - 0.5) / nSamples;\nfloat weight=1.0 - abs(percent);\ncolor +=texture2D(uTexture, vTexCoord + uDelta * percent) * weight;\ntotal +=weight;\n}\ngl_FragColor=color / total;\n}",blur:0,mainParameter:"blur",applyTo:function(t){t.webgl?(this.aspectRatio=t.sourceWidth/t.sourceHeight,t.passes++,this._setupFrameBuffer(t),this.horizontal=!0,this.applyToWebGL(t),this._swapTextures(t),this._setupFrameBuffer(t),this.horizontal=!1,this.applyToWebGL(t),this._swapTextures(t)):this.applyTo2d(t)},applyTo2d:function(t){t.imageData=this.simpleBlur(t)},simpleBlur:function(t){var e,i,n=t.filterBackend.resources,s=t.imageData.width,r=t.imageData.height;n.blurLayer1||(n.blurLayer1=p.util.createCanvasElement(),n.blurLayer2=p.util.createCanvasElement()),e=n.blurLayer1,i=n.blurLayer2,e.width===s&&e.height===r||(i.width=e.width=s,i.height=e.height=r);var a,o,l,c,h=e.getContext("2d"),d=i.getContext("2d"),u=.06*this.blur*.5;for(h.putImageData(t.imageData,0,0),d.clearRect(0,0,s,r),c=-15;c<=15;c++)l=u*(o=c/15)*s+(a=(Math.random()-.5)/4),d.globalAlpha=1-Math.abs(o),d.drawImage(e,l,a),h.drawImage(i,0,0),d.globalAlpha=1,d.clearRect(0,0,i.width,i.height);for(c=-15;c<=15;c++)l=u*(o=c/15)*r+(a=(Math.random()-.5)/4),d.globalAlpha=1-Math.abs(o),d.drawImage(e,a,l),h.drawImage(i,0,0),d.globalAlpha=1,d.clearRect(0,0,i.width,i.height);t.ctx.drawImage(e,0,0);n=t.ctx.getImageData(0,0,e.width,e.height);return h.globalAlpha=1,h.clearRect(0,0,e.width,e.height),n},getUniformLocations:function(t,e){return{delta:t.getUniformLocation(e,"uDelta")}},sendUniformData:function(t,e){var i=this.chooseRightDelta();t.uniform2fv(e.delta,i)},chooseRightDelta:function(){var t=1,e=[0,0];return this.horizontal?1<this.aspectRatio&&(t=1/this.aspectRatio):this.aspectRatio<1&&(t=this.aspectRatio),t=t*this.blur*.12,this.horizontal?e[0]=t:e[1]=t,e}}),t.Blur.fromObject=p.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var t=t.fabric||(t.fabric={}),e=t.Image.filters,i=t.util.createClass;e.Gamma=i(e.BaseFilter,{type:"Gamma",fragmentSource:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec3 uGamma;\nvarying vec2 vTexCoord;\nvoid main(){\nvec4 color=texture2D(uTexture, vTexCoord);\nvec3 correction=(1.0 / uGamma);\ncolor.r=pow(color.r, correction.r);\ncolor.g=pow(color.g, correction.g);\ncolor.b=pow(color.b, correction.b);\ngl_FragColor=color;\ngl_FragColor.rgb *=color.a;\n}",gamma:[1,1,1],mainParameter:"gamma",initialize:function(t){this.gamma=[1,1,1],e.BaseFilter.prototype.initialize.call(this,t)},applyTo2d:function(t){var e,i=t.imageData.data,t=this.gamma,n=i.length,s=1/t[0],r=1/t[1],a=1/t[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,n=256;e<n;e++)this.rVals[e]=255*Math.pow(e/255,s),this.gVals[e]=255*Math.pow(e/255,r),this.bVals[e]=255*Math.pow(e/255,a);for(e=0,n=i.length;e<n;e+=4)i[e]=this.rVals[i[e]],i[e+1]=this.gVals[i[e+1]],i[e+2]=this.bVals[i[e+2]]},getUniformLocations:function(t,e){return{uGamma:t.getUniformLocation(e,"uGamma")}},sendUniformData:function(t,e){t.uniform3fv(e.uGamma,this.gamma)}}),t.Image.filters.Gamma.fromObject=t.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var i=t.fabric||(t.fabric={}),t=i.Image.filters,e=i.util.createClass;t.Composed=e(t.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(e){e.passes+=this.subFilters.length-1,this.subFilters.forEach(function(t){t.applyTo(e)})},toObject:function(){return i.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(t){return t.toObject()})})},isNeutralState:function(){return!this.subFilters.some(function(t){return!t.isNeutralState()})}}),i.Image.filters.Composed.fromObject=function(t,e){t=(t.subFilters||[]).map(function(t){return new i.Image.filters[t.type](t)}),t=new i.Image.filters.Composed({subFilters:t});return e&&e(t),t}}(i),function(t){"use strict";var n=t.fabric||(t.fabric={}),e=n.Image.filters,t=n.util.createClass;e.HueRotation=t(e.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,e=n.util.cos(t),t=n.util.sin(t),t=Math.sqrt(1/3)*t,i=1-e;this.matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.matrix[0]=e+i/3,this.matrix[1]=1/3*i-t,this.matrix[2]=1/3*i+t,this.matrix[5]=1/3*i+t,this.matrix[6]=e+1/3*i,this.matrix[7]=1/3*i-t,this.matrix[10]=1/3*i-t,this.matrix[11]=1/3*i+t,this.matrix[12]=e+1/3*i},isNeutralState:function(t){return this.calculateMatrix(),e.BaseFilter.prototype.isNeutralState.call(this,t)},applyTo:function(t){this.calculateMatrix(),e.BaseFilter.prototype.applyTo.call(this,t)}}),n.Image.filters.HueRotation.fromObject=n.Image.filters.BaseFilter.fromObject}(i),function(t){"use strict";var e,w=t.fabric||(t.fabric={}),a=w.util.object.clone;w.Text?w.warn("fabric.Text is already defined"):(e="fontFamily fontWeight fontSize text underline overline linethrough textAlign fontStyle lineHeight textBackgroundColor charSpacing styles direction path pathStartOffset pathSide pathAlign".split(" "),w.Text=w.util.createClass(w.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles","path","pathStartOffset","pathSide","pathAlign"],_reNewline:/\r?\n/,_reSpacesAndTabs:/[ \t\r]/g,_reSpaceAndTab:/[ \t\r]/,_reWords:/\S+/g,type:"text",fontSize:40,fontWeight:"normal",fontFamily:"Times New Roman",underline:!1,overline:!1,linethrough:!1,textAlign:"left",fontStyle:"normal",lineHeight:1.16,superscript:{size:.6,baseline:-.35},subscript:{size:.6,baseline:.11},textBackgroundColor:"",stateProperties:w.Object.prototype.stateProperties.concat(e),cacheProperties:w.Object.prototype.cacheProperties.concat(e),stroke:null,shadow:null,path:null,pathStartOffset:0,pathSide:"left",pathAlign:"baseline",_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,direction:"ltr",_styleProperties:["stroke","strokeWidth","fill","fontFamily","fontSize","fontWeight","fontStyle","underline","overline","linethrough","deltaY","textBackgroundColor"],__charBounds:[],CACHE_FONT_SIZE:400,MIN_TEXT_WIDTH:2,initialize:function(t,e){this.styles=e&&e.styles||{},this.text=t,this.__skipDimension=!0,this.callSuper("initialize",e),this.path&&this.setPathInfo(),this.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},setPathInfo:function(){var t=this.path;t&&(t.segmentsInfo=w.util.getPathSegmentsInfo(t.path))},getMeasuringContext:function(){return w._measuringContext||(w._measuringContext=this.canvas&&this.canvas.contextCache||w.util.createCanvasElement().getContext("2d")),w._measuringContext},_splitText:function(){var t=this._splitTextIntoLines(this.text);return this.textLines=t.lines,this._textLines=t.graphemeLines,this._unwrappedTextLines=t._unwrappedLines,this._text=t.graphemeText,t},initDimensions:function(){this.__skipDimension||(this._splitText(),this._clearCache(),this.path?(this.width=this.path.width,this.height=this.path.height):(this.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,this.height=this.calcTextHeight()),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,n,s=0,r=this._textLines.length;s<r;s++)if(("justify"===this.textAlign||s!==r-1&&!this.isEndOfWrapping(s))&&(e=0,i=this._textLines[s],(t=this.getLineWidth(s))<this.width)&&(a=this.textLines[s].match(this._reSpacesAndTabs)))for(var a=a.length,o=(this.width-t)/a,l=0,c=i.length;l<=c;l++)n=this.__charBounds[s][l],this._reSpaceAndTab.test(i[l])?(n.width+=o,n.kernedWidth+=o,n.left+=e,e+=o):n.left+=e},isEndOfWrapping:function(t){return t===this._textLines.length-1},missingNewlineOffset:function(){return 1},toString:function(){return"#<fabric.Text ("+this.complexity()+'): { "text": "'+this.text+'", "fontFamily": "'+this.fontFamily+'" }>'},_getCacheCanvasDimensions:function(){var t=this.callSuper("_getCacheCanvasDimensions"),e=this.fontSize;return t.width+=e*t.zoomX,t.height+=e*t.zoomY,t},_render:function(t){var e=this.path;e&&!e.isNotVisible()&&e._render(t),this._setTextStyles(t),this._renderTextLinesBackground(t),this._renderTextDecoration(t,"underline"),this._renderText(t),this._renderTextDecoration(t,"overline"),this._renderTextDecoration(t,"linethrough")},_renderText:function(t){"stroke"===this.paintFirst?(this._renderTextStroke(t),this._renderTextFill(t)):(this._renderTextFill(t),this._renderTextStroke(t))},_setTextStyles:function(t,e,i){if(t.textBaseline="alphabetical",this.path)switch(this.pathAlign){case"center":t.textBaseline="middle";break;case"ascender":t.textBaseline="top";break;case"descender":t.textBaseline="bottom"}t.font=this._getFontDeclaration(e,i)},calcTextWidth:function(){for(var t=this.getLineWidth(0),e=1,i=this._textLines.length;e<i;e++){var n=this.getLineWidth(e);t<n&&(t=n)}return t},_renderTextLine:function(t,e,i,n,s,r){this._renderChars(t,e,i,n,s,r)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,s,r=t.fillStyle,a=this._getLeftOffset(),o=this._getTopOffset(),l=0,c=0,h=this.path,d=0,u=this._textLines.length;d<u;d++){if(e=this.getHeightOfLine(d),this.textBackgroundColor||this.styleHas("textBackgroundColor",d)){for(var p=this._textLines[d],f=this._getLineLeftOffset(d),c=0,l=0,g=this.getValueOfPropertyAt(d,0,"textBackgroundColor"),m=0,v=p.length;m<v;m++)i=this.__charBounds[d][m],n=this.getValueOfPropertyAt(d,m,"textBackgroundColor"),h?(t.save(),t.translate(i.renderLeft,i.renderTop),t.rotate(i.angle),(t.fillStyle=n)&&t.fillRect(-i.width/2,-e/this.lineHeight*(1-this._fontSizeFraction),i.width,e/this.lineHeight),t.restore()):n!==g?(s=a+f+l,"rtl"===this.direction&&(s=this.width-s-c),(t.fillStyle=g)&&t.fillRect(s,o,c,e/this.lineHeight),l=i.left,c=i.width,g=n):c+=i.kernedWidth;n&&!h&&(s=a+f+l,"rtl"===this.direction&&(s=this.width-s-c),t.fillStyle=n,t.fillRect(s,o,c,e/this.lineHeight))}o+=e}t.fillStyle=r,this._removeShadow(t)}},getFontCache:function(t){var e=t.fontFamily.toLowerCase(),e=(w.charWidthsCache[e]||(w.charWidthsCache[e]={}),w.charWidthsCache[e]),t=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return e[t]||(e[t]={}),e[t]},_measureChar:function(t,e,i,n){var s,r,a,o,l,c=this.getFontCache(e),h=i+t,n=this._getFontDeclaration(e)===this._getFontDeclaration(n),d=e.fontSize/this.CACHE_FONT_SIZE;return i&&void 0!==c[i]&&(a=c[i]),void 0!==c[t]&&(o=s=c[t]),n&&void 0!==c[h]&&(o=(r=c[h])-a),void 0!==s&&void 0!==a&&void 0!==r||(l=this.getMeasuringContext(),this._setTextStyles(l,e,!0)),void 0===s&&(o=s=l.measureText(t).width,c[t]=s),void 0===a&&n&&i&&(a=l.measureText(i).width,c[i]=a),n&&void 0===r&&(r=l.measureText(h).width,o=(c[h]=r)-a),{width:s*d,kernedWidth:o*d}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){t=this._measureLine(t);return 0!==this.charSpacing&&(t.width-=this._getWidthOfCharSpacing()),t.width<0&&(t.width=0),t},_measureLine:function(t){var e,i,n,s,r,a,o=0,l=this._textLines[t],c=new Array(l.length),h=0,d=this.path,u="right"===this.pathSide;for(this.__charBounds[t]=c,e=0;e<l.length;e++)i=l[e],s=this._getGraphemeBox(i,t,e,n),o+=(c[e]=s).kernedWidth,n=i;if(c[e]={left:s?s.left+s.width:0,width:0,kernedWidth:0,height:this.fontSize},d){switch(a=d.segmentsInfo[d.segmentsInfo.length-1].length,(r=w.util.getPointOnPath(d.path,0,d.segmentsInfo)).x+=d.pathOffset.x,r.y+=d.pathOffset.y,this.textAlign){case"left":h=u?a-o:0;break;case"center":h=(a-o)/2;break;case"right":h=u?0:a-o}for(h+=this.pathStartOffset*(u?-1:1),e=u?l.length-1:0;u?0<=e:e<l.length;u?e--:e++)s=c[e],a<h?h%=a:h<0&&(h+=a),this._setGraphemeOnPath(h,s,r),h+=s.kernedWidth}return{width:o,numOfSpaces:0}},_setGraphemeOnPath:function(t,e,i){var t=t+e.kernedWidth/2,n=this.path,t=w.util.getPointOnPath(n.path,t,n.segmentsInfo);e.renderLeft=t.x-i.x,e.renderTop=t.y-i.y,e.angle=t.angle+("right"===this.pathSide?Math.PI:0)},_getGraphemeBox:function(t,e,i,n,s){var r=this.getCompleteStyleDeclaration(e,i),a=n?this.getCompleteStyleDeclaration(e,i-1):{},t=this._measureChar(t,r,n,a),n=t.kernedWidth,a=t.width,o=(0!==this.charSpacing&&(a+=o=this._getWidthOfCharSpacing(),n+=o),{width:a,left:0,height:r.fontSize,kernedWidth:n,deltaY:r.deltaY});return 0<i&&!s&&(a=this.__charBounds[e][i-1],o.left=a.left+a.width+t.kernedWidth-t.width),o},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,s=e.length;n<s;n++)i=Math.max(this.getHeightOfChar(t,n),i);return this.__lineHeights[t]=i*this.lineHeight*this._fontSizeMult},calcTextHeight:function(){for(var t,e=0,i=0,n=this._textLines.length;i<n;i++)t=this.getHeightOfLine(i),e+=i===n-1?t/this.lineHeight:t;return e},_getLeftOffset:function(){return"ltr"===this.direction?-this.width/2:this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,n=this._getLeftOffset(),s=this._getTopOffset(),r=0,a=this._textLines.length;r<a;r++){var o=this.getHeightOfLine(r),l=o/this.lineHeight,c=this._getLineLeftOffset(r);this._renderTextLine(e,t,this._textLines[r],n+c,s+i+l,r),i+=o}t.restore()},_renderTextFill:function(t){(this.fill||this.styleHas("fill"))&&this._renderTextCommon(t,"fillText")},_renderTextStroke:function(t){(this.stroke&&0!==this.strokeWidth||!this.isEmptyStyles())&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray),t.beginPath(),this._renderTextCommon(t,"strokeText"),t.closePath(),t.restore())},_renderChars:function(t,e,i,n,s,r){var a,o,l,c,h=this.getHeightOfLine(r),d=-1!==this.textAlign.indexOf("justify"),u="",p=0,f=this.path,g=!d&&0===this.charSpacing&&this.isEmptyStyles(r)&&!f,m="ltr"===this.direction,v="ltr"===this.direction?1:-1,b=e.canvas.getAttribute("dir");if(e.save(),b!==this.direction&&(e.canvas.setAttribute("dir",m?"ltr":"rtl"),e.direction=m?"ltr":"rtl",e.textAlign=m?"left":"right"),s-=h*this._fontSizeFraction/this.lineHeight,g)this._renderChar(t,e,r,0,i.join(""),n,s,h);else for(var y=0,x=i.length-1;y<=x;y++)c=y===x||this.charSpacing||f,u+=i[y],l=this.__charBounds[r][y],0===p?(n+=v*(l.kernedWidth-l.width),p+=l.width):p+=l.kernedWidth,(c=d&&!c&&this._reSpaceAndTab.test(i[y])?!0:c)||(a=a||this.getCompleteStyleDeclaration(r,y),o=this.getCompleteStyleDeclaration(r,y+1),c=w.util.hasStyleChanged(a,o,!1)),c&&(f?(e.save(),e.translate(l.renderLeft,l.renderTop),e.rotate(l.angle),this._renderChar(t,e,r,y,u,-p/2,0,h),e.restore()):(c=n,this._renderChar(t,e,r,y,u,c,s,h)),u="",a=o,n+=v*p,p=0);e.restore()},_applyPatternGradientTransformText:function(t){var e,i=w.util.createCanvasElement(),n=this.width+this.strokeWidth,s=this.height+this.strokeWidth;return i.width=n,i.height=s,(e=i.getContext("2d")).beginPath(),e.moveTo(0,0),e.lineTo(n,0),e.lineTo(n,s),e.lineTo(0,s),e.closePath(),e.translate(n/2,s/2),e.fillStyle=t.toLive(e),this._applyPatternGradientTransform(e,t),e.fill(),e.createPattern(i,"no-repeat")},handleFiller:function(t,e,i){var n,s;return i.toLive?"percentage"===i.gradientUnits||i.gradientTransform||i.patternTransform?(n=-this.width/2,s=-this.height/2,t.translate(n,s),t[e]=this._applyPatternGradientTransformText(i),{offsetX:n,offsetY:s}):(t[e]=i.toLive(t,this),this._applyPatternGradientTransform(t,i)):(t[e]=i,{offsetX:0,offsetY:0})},_setStrokeStyles:function(t,e){return t.lineWidth=e.strokeWidth,t.lineCap=this.strokeLineCap,t.lineDashOffset=this.strokeDashOffset,t.lineJoin=this.strokeLineJoin,t.miterLimit=this.strokeMiterLimit,this.handleFiller(t,"strokeStyle",e.stroke)},_setFillStyles:function(t,e){return this.handleFiller(t,"fillStyle",e.fill)},_renderChar:function(t,e,i,n,s,r,a){var o,l,c=this._getStyleDeclaration(i,n),i=this.getCompleteStyleDeclaration(i,n),n="fillText"===t&&i.fill,t="strokeText"===t&&i.stroke&&i.strokeWidth;(t||n)&&(e.save(),n&&(o=this._setFillStyles(e,i)),t&&(l=this._setStrokeStyles(e,i)),e.font=this._getFontDeclaration(i),c&&c.textBackgroundColor&&this._removeShadow(e),c&&c.deltaY&&(a+=c.deltaY),n&&e.fillText(s,r-o.offsetX,a-o.offsetY),t&&e.strokeText(s,r-l.offsetX,a-l.offsetY),e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)},_setScript:function(t,e,i){var n=this.get2DCursorLocation(t,!0),s=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),n=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),n={fontSize:s*i.size,deltaY:n+s*i.baseline};return this.setSelectionStyles(n,t,e),this},_getLineLeftOffset:function(t){var e=this.getLineWidth(t),e=this.width-e,i=this.textAlign,n=this.direction,s=0,t=this.isEndOfWrapping(t);return"justify"===i||"justify-center"===i&&!t||"justify-right"===i&&!t||"justify-left"===i&&!t?0:("center"===i&&(s=e/2),"right"===i&&(s=e),"justify-center"===i&&(s=e/2),"justify-right"===i&&(s=e),"rtl"===n&&(s-=e),s)},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return(t=t||this.hasStateChanged("_dimensionAffectingProps"))&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){var e;return void 0!==this.__lineWidths[t]?this.__lineWidths[t]:(e=this.measureLine(t).width,this.__lineWidths[t]=e)},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){t=this._getStyleDeclaration(t,e);return(t&&void 0!==t[i]?t:this)[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,n,s,r,a,o,l=this._getLeftOffset(),c=this._getTopOffset(),h=this.path,d=this._getWidthOfCharSpacing(),u=this.offsets[e],p=0,f=this._textLines.length;p<f;p++){if(i=this.getHeightOfLine(p),this[e]||this.styleHas(e,p)){for(var g,m=this._textLines[p],v=i/this.lineHeight,b=this._getLineLeftOffset(p),y=0,x=0,w=this.getValueOfPropertyAt(p,0,e),C=this.getValueOfPropertyAt(p,0,"fill"),S=c+v*(1-this._fontSizeFraction),E=this.getHeightOfChar(p,0),T=this.getValueOfPropertyAt(p,0,"deltaY"),A=0,I=m.length;A<I;A++)r=this.__charBounds[p][A],a=this.getValueOfPropertyAt(p,A,e),o=this.getValueOfPropertyAt(p,A,"fill"),n=this.getHeightOfChar(p,A),s=this.getValueOfPropertyAt(p,A,"deltaY"),h&&a&&o?(t.save(),t.fillStyle=C,t.translate(r.renderLeft,r.renderTop),t.rotate(r.angle),t.fillRect(-r.kernedWidth/2,u*n+s,r.kernedWidth,this.fontSize/15),t.restore()):(a!==w||o!==C||n!==E||s!==T)&&0<x?(g=l+b+y,"rtl"===this.direction&&(g=this.width-g-x),w&&C&&(t.fillStyle=C,t.fillRect(g,S+u*E+T,x,this.fontSize/15)),y=r.left,x=r.width,w=a,C=o,E=n,T=s):x+=r.kernedWidth;g=l+b+y,"rtl"===this.direction&&(g=this.width-g-x),t.fillStyle=o,a&&o&&t.fillRect(g,S+u*E+T,x-d,this.fontSize/15)}c+=i}this._removeShadow(t)}},_getFontDeclaration:function(t,e){var t=t||this,i=this.fontFamily,n=-1<w.Text.genericFonts.indexOf(i.toLowerCase()),i=void 0===i||-1<i.indexOf("'")||-1<i.indexOf(",")||-1<i.indexOf('"')||n?t.fontFamily:'"'+t.fontFamily+'"';return[w.isLikelyNode?t.fontWeight:t.fontStyle,w.isLikelyNode?t.fontStyle:t.fontWeight,e?this.CACHE_FONT_SIZE+"px":t.fontSize+"px",i].join(" ")},render:function(t){!this.visible||this.canvas&&this.canvas.skipOffscreen&&!this.group&&!this.isOnScreen()||(this._shouldClearDimensionCache()&&this.initDimensions(),this.callSuper("render",t))},_splitTextIntoLines:function(t){for(var e=t.split(this._reNewline),i=new Array(e.length),n=["\n"],s=[],r=0;r<e.length;r++)i[r]=w.util.string.graphemeSplit(e[r]),s=s.concat(i[r],n);return s.pop(),{_unwrappedLines:i,lines:e,graphemeText:s,graphemeLines:i}},toObject:function(t){t=e.concat(t),t=this.callSuper("toObject",t);return t.styles=w.util.stylesToArray(this.styles,this.text),t.path&&(t.path=this.path.toObject()),t},set:function(t,e){this.callSuper("set",t,e);var i=!1,n=!1;if("object"==typeof t)for(var s in t)"path"===s&&this.setPathInfo(),i=i||-1!==this._dimensionAffectingProps.indexOf(s),n=n||"path"===s;else i=-1!==this._dimensionAffectingProps.indexOf(t),n="path"===t;return n&&this.setPathInfo(),i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),w.Text.ATTRIBUTE_NAMES=w.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),w.Text.DEFAULT_SVG_FONT_SIZE=16,w.Text.fromElement=function(t,e,i){if(!t)return e(null);var n=w.parseAttributes(t,w.Text.ATTRIBUTE_NAMES),s=n.textAnchor||"left",r=((i=w.util.object.extend(i?a(i):{},n)).top=i.top||0,i.left=i.left||0,n.textDecoration&&(-1!==(r=n.textDecoration).indexOf("underline")&&(i.underline=!0),-1!==r.indexOf("overline")&&(i.overline=!0),-1!==r.indexOf("line-through")&&(i.linethrough=!0),delete i.textDecoration),"dx"in n&&(i.left+=n.dx),"dy"in n&&(i.top+=n.dy),"fontSize"in i||(i.fontSize=w.Text.DEFAULT_SVG_FONT_SIZE),""),n=("textContent"in t?r=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(r=t.firstChild.data),r=r.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," "),i.strokeWidth),t=(i.strokeWidth=0,new w.Text(r,i)),r=t.getScaledHeight()/t.height,i=((t.height+t.strokeWidth)*t.lineHeight-t.height)*r,r=t.getScaledHeight()+i,i=0;"center"===s&&(i=t.getScaledWidth()/2),"right"===s&&(i=t.getScaledWidth()),t.set({left:t.left-i,top:t.top-(r-t.fontSize*(.07+t._fontSizeFraction))/t.lineHeight,strokeWidth:void 0!==n?n:1}),e(t)},w.Text.fromObject=function(t,i){var e=a(t),n=t.path;return delete e.path,w.Object._fromObject("Text",e,function(e){e.styles=w.util.stylesFromArray(t.styles,t.text),n?w.Object._fromObject("Path",n,function(t){e.set("path",t),i(e)},"path"):i(e)},"text")},w.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],w.util.createAccessors&&w.util.createAccessors(w.Text))}(i),V.util.object.extend(V.Text.prototype,{isEmptyStyles:function(t){if(this.styles&&(void 0===t||this.styles[t])){var e,i=void 0===t?this.styles:{line:this.styles[t]};for(e in i)for(var n in i[e])for(var s in i[e][n])return!1}return!0},styleHas:function(t,e){if(this.styles&&t&&""!==t&&(void 0===e||this.styles[e])){var i,n=void 0===e?this.styles:{0:this.styles[e]};for(i in n)for(var s in n[i])if(void 0!==n[i][s][t])return!0}return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,n,s,r=this.styles,a=0,o=!0,l=0;for(n in r){for(var c in e=0,r[n])a++,(s=r[n][c]).hasOwnProperty(t)?(i?s[t]!==i&&(o=!1):i=s[t],s[t]===this[t]&&delete s[t]):o=!1,0!==Object.keys(s).length?e++:delete r[n][c];0===e&&delete r[n]}for(var h=0;h<this._textLines.length;h++)l+=this._textLines[h].length;o&&a===l&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,n,s=this.styles;for(i in s){for(n in e=s[i])delete e[n][t],0===Object.keys(e[n]).length&&delete e[n];0===Object.keys(e).length&&delete s[i]}}},_extendStyles:function(t,e){t=this.get2DCursorLocation(t);this._getLineStyle(t.lineIndex)||this._setLineStyle(t.lineIndex),this._getStyleDeclaration(t.lineIndex,t.charIndex)||this._setStyleDeclaration(t.lineIndex,t.charIndex,{}),V.util.object.extend(this._getStyleDeclaration(t.lineIndex,t.charIndex),e)},get2DCursorLocation:function(t,e){void 0===t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,n=i.length,s=0;s<n;s++){if(t<=i[s].length)return{lineIndex:s,charIndex:t};t-=i[s].length+this.missingNewlineOffset(s)}return{lineIndex:s-1,charIndex:i[s-1].length<t?i[s-1].length:t}},getSelectionStyles:function(t,e,i){void 0===t&&(t=this.selectionStart||0),void 0===e&&(e=this.selectionEnd||t);for(var n=[],s=t;s<e;s++)n.push(this.getStyleAtPosition(s,i));return n},getStyleAtPosition:function(t,e){t=this.get2DCursorLocation(t);return(e?this.getCompleteStyleDeclaration(t.lineIndex,t.charIndex):this._getStyleDeclaration(t.lineIndex,t.charIndex))||{}},setSelectionStyles:function(t,e,i){void 0===e&&(e=this.selectionStart||0),void 0===i&&(i=this.selectionEnd||e);for(var n=e;n<i;n++)this._extendStyles(n,t);return this._forceClearCache=!0,this},_getStyleDeclaration:function(t,e){t=this.styles&&this.styles[t];return t?t[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,n=this._getStyleDeclaration(t,e)||{},s={},r=0;r<this._styleProperties.length;r++)s[i=this._styleProperties[r]]=(void 0===n[i]?this:n)[i];return s},_setStyleDeclaration:function(t,e,i){this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){delete this.styles[t][e]},_getLineStyle:function(t){return!!this.styles[t]},_setLineStyle:function(t){this.styles[t]={}},_deleteLineStyle:function(t){delete this.styles[t]}}),V.IText=V.util.createClass(V.Text,V.Observable,{type:"i-text",selectionStart:0,selectionEnd:0,selectionColor:"rgba(17,119,255,0.3)",isEditing:!1,editable:!0,editingBorderColor:"rgba(102,153,255,0.25)",cursorWidth:2,cursorColor:"",cursorDelay:1e3,cursorDuration:600,caching:!0,hiddenTextareaContainer:null,_reSpace:/\s|\n/,_currentCursorOpacity:0,_selectionDirection:null,_abortCursorAnimation:!1,__widthOfSpace:[],inCompositionMode:!1,initialize:function(t,e){this.callSuper("initialize",t,e),this.initBehavior()},setSelectionStart:function(t){t=Math.max(t,0),this._updateAndFire("selectionStart",t)},setSelectionEnd:function(t){t=Math.min(t,this.text.length),this._updateAndFire("selectionEnd",t)},_updateAndFire:function(t,e){this[t]!==e&&(this._fireSelectionChanged(),this[t]=e),this._updateTextarea()},_fireSelectionChanged:function(){this.fire("selection:changed"),this.canvas&&this.canvas.fire("text:selection:changed",{target:this})},initDimensions:function(){this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this.callSuper("initDimensions")},render:function(t){this.clearContextTop(),this.callSuper("render",t),this.cursorOffsetCache={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){var e,i;this.isEditing&&this.canvas&&this.canvas.contextTop&&(e=this.canvas.contextTop,i=this.canvas.viewportTransform,e.save(),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),this.transform(e),this._clearTextArea(e),t||e.restore())},renderCursorOrSelection:function(){var t,e;this.isEditing&&this.canvas&&this.canvas.contextTop&&(t=this._getCursorBoundaries(),e=this.canvas.contextTop,this.clearContextTop(!0),this.selectionStart===this.selectionEnd?this.renderCursor(t,e):this.renderSelection(t,e),e.restore())},_clearTextArea:function(t){var e=this.width+4,i=this.height+4;t.clearRect(-e/2,-i/2,e,i)},_getCursorBoundaries:function(t){void 0===t&&(t=this.selectionStart);var e=this._getLeftOffset(),i=this._getTopOffset(),t=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:t.left,topOffset:t.top}},_getCursorBoundariesOffsets:function(t){if(!(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)){for(var e=0,i=0,t=this.get2DCursorLocation(t),n=t.charIndex,s=t.lineIndex,r=0;r<s;r++)e+=this.getHeightOfLine(r);var t=this._getLineLeftOffset(s),a=this.__charBounds[s][n];a&&(i=a.left),0!==this.charSpacing&&n===this._textLines[s].length&&(i-=this._getWidthOfCharSpacing()),a={top:e,left:t+(0<i?i:0)},"rtl"===this.direction&&(a.left*=-1),this.cursorOffsetCache=a}return this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,i=0<i.charIndex?i.charIndex-1:0,s=this.getValueOfPropertyAt(n,i,"fontSize"),r=this.scaleX*this.canvas.getZoom(),r=this.cursorWidth/r,a=t.topOffset,o=this.getValueOfPropertyAt(n,i,"deltaY");a+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-s*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.cursorColor||this.getValueOfPropertyAt(n,i,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-r/2,a+t.top+o,r,s)},renderSelection:function(t,e){for(var i=(this.inCompositionMode?this.hiddenTextarea:this).selectionStart,n=(this.inCompositionMode?this.hiddenTextarea:this).selectionEnd,s=-1!==this.textAlign.indexOf("justify"),i=this.get2DCursorLocation(i),n=this.get2DCursorLocation(n),r=i.lineIndex,a=n.lineIndex,o=i.charIndex<0?0:i.charIndex,l=n.charIndex<0?0:n.charIndex,c=r;c<=a;c++){var h,d=this._getLineLeftOffset(c)||0,u=this.getHeightOfLine(c),p=0,f=0,d=(c===r&&(p=this.__charBounds[r][o].left),r<=c&&c<a?f=s&&!this.isEndOfWrapping(c)?this.width:this.getLineWidth(c)||5:c===a&&(f=0===l?this.__charBounds[a][l].left:(h=this._getWidthOfCharSpacing(),this.__charBounds[a][l-1].left+this.__charBounds[a][l-1].width-h)),h=u,(this.lineHeight<1||c===a&&1<this.lineHeight)&&(u/=this.lineHeight),t.left+d+p),f=f-p,p=u,g=0;this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",p=1,g=u):e.fillStyle=this.selectionColor,"rtl"===this.direction&&(d=this.width-d-f),e.fillRect(d,t.top+t.topOffset+g,f,p),t.topOffset+=h}},getCurrentCharFontSize:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fontSize")},getCurrentCharColor:function(){var t=this._getCurrentCharIndex();return this.getValueOfPropertyAt(t.l,t.c,"fill")},_getCurrentCharIndex:function(){var t=this.get2DCursorLocation(this.selectionStart,!0),e=0<t.charIndex?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),V.IText.fromObject=function(t,e){var i=V.util.stylesFromArray(t.styles,t.text),n=Object.assign({},t,{styles:i});if(ft(n),n.styles)for(var s in n.styles)for(var r in n.styles[s])ft(n.styles[s][r]);V.Object._fromObject("IText",n,e,"text")},p=V.util.object.clone,V.util.object.extend(V.IText.prototype,{initBehavior:function(){this.initAddedHandler(),this.initRemovedHandler(),this.initCursorSelectionHandlers(),this.initDoubleClickSimulation(),this.mouseMoveHandler=this.mouseMoveHandler.bind(this)},onDeselect:function(){this.isEditing&&this.exitEditing(),this.selected=!1},initAddedHandler:function(){var e=this;this.on("added",function(){var t=e.canvas;t&&(t._hasITextHandlers||(t._hasITextHandlers=!0,e._initCanvasHandlers(t)),t._iTextInstances=t._iTextInstances||[],t._iTextInstances.push(e))})},initRemovedHandler:function(){var e=this;this.on("removed",function(){var t=e.canvas;t&&(t._iTextInstances=t._iTextInstances||[],V.util.removeFromArray(t._iTextInstances,e),0===t._iTextInstances.length)&&(t._hasITextHandlers=!1,e._removeCanvasHandlers(t))})},_initCanvasHandlers:function(t){t._mouseUpITextHandler=function(){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.__isMousedown=!1})},t.on("mouse:up",t._mouseUpITextHandler)},_removeCanvasHandlers:function(t){t.off("mouse:up",t._mouseUpITextHandler)},_tick:function(){this._currentTickState=this._animateCursor(this,1,this.cursorDuration,"_onTickComplete")},_animateCursor:function(t,e,i,n){var s={isAborted:!1,abort:function(){this.isAborted=!0}};return t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){s.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return s.isAborted}}),s},_onTickComplete:function(){var t=this;this._cursorTimeout1&&clearTimeout(this._cursorTimeout1),this._cursorTimeout1=setTimeout(function(){t._currentTickCompleteState=t._animateCursor(t,0,this.cursorDuration/2,"_tick")},100)},initDelayedCursor:function(t){var e=this,t=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){e._tick()},t)},abortCursorAnimation:function(){var t=this._currentTickState||this._currentTickCompleteState,e=this.canvas;this._currentTickState&&this._currentTickState.abort(),this._currentTickCompleteState&&this._currentTickCompleteState.abort(),clearTimeout(this._cursorTimeout1),clearTimeout(this._cursorTimeout2),this._currentCursorOpacity=0,t&&e&&e.clearContext(e.contextTop||e.contextContainer)},selectAll:function(){return this.selectionStart=0,this.selectionEnd=this._text.length,this._fireSelectionChanged(),this._updateTextarea(),this},getSelectedText:function(){return this._text.slice(this.selectionStart,this.selectionEnd).join("")},findWordBoundaryLeft:function(t){var e=0,i=t-1;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i--;for(;/\S/.test(this._text[i])&&-1<i;)e++,i--;return t-e},findWordBoundaryRight:function(t){var e=0,i=t;if(this._reSpace.test(this._text[i]))for(;this._reSpace.test(this._text[i]);)e++,i++;for(;/\S/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},findLineBoundaryLeft:function(t){for(var e=0,i=t-1;!/\n/.test(this._text[i])&&-1<i;)e++,i--;return t-e},findLineBoundaryRight:function(t){for(var e=0,i=t;!/\n/.test(this._text[i])&&i<this._text.length;)e++,i++;return t+e},searchWordBoundary:function(t,e){for(var i=this._text,n=this._reSpace.test(i[t])?t-1:t,s=i[n],r=V.reNonWord;!r.test(s)&&0<n&&n<i.length;)s=i[n+=e];return r.test(s)&&(n+=1===e?0:1),n},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),t=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=t,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),t=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=t,this._fireSelectionChanged(),this._updateTextarea(),this},enterEditing:function(t){if(!this.isEditing&&this.editable)return this.canvas&&(this.canvas.calcOffset(),this.exitEditingOnOthers(this.canvas)),this.isEditing=!0,this.initHiddenTextarea(t),this.hiddenTextarea.focus(),this.hiddenTextarea.value=this.text,this._updateTextarea(),this._saveEditingProps(),this._setEditingProps(),this._textBeforeEdit=this.text,this._tick(),this.fire("editing:entered"),this._fireSelectionChanged(),this.canvas&&(this.canvas.fire("text:editing:entered",{target:this}),this.initMouseMoveHandler(),this.canvas.requestRenderAll()),this},exitEditingOnOthers:function(t){t._iTextInstances&&t._iTextInstances.forEach(function(t){t.selected=!1,t.isEditing&&t.exitEditing()})},initMouseMoveHandler:function(){this.canvas.on("mouse:move",this.mouseMoveHandler)},mouseMoveHandler:function(t){var e,i;this.__isMousedown&&this.isEditing&&(document.activeElement!==this.hiddenTextarea&&this.hiddenTextarea.focus(),t=this.getSelectionStartFromPointer(t.e),e=this.selectionStart,i=this.selectionEnd,t===this.__selectionStartOnMouseDown&&e!==i||e!==t&&i!==t)&&(t>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=t):(this.selectionStart=t,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===e&&this.selectionEnd===i||(this.restartCursorIfNeeded(),this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()))},_setEditingProps:function(){this.hoverCursor="text",this.canvas&&(this.canvas.defaultCursor=this.canvas.moveCursor="text"),this.borderColor=this.editingBorderColor,this.hasControls=this.selectable=!1,this.lockMovementX=this.lockMovementY=!0},fromStringToGraphemeSelection:function(t,e,i){var n=i.slice(0,t),n=V.util.string.graphemeSplit(n).length;return t===e?{selectionStart:n,selectionEnd:n}:(i=i.slice(t,e),{selectionStart:n,selectionEnd:n+V.util.string.graphemeSplit(i).length})},fromGraphemeToStringSelection:function(t,e,i){var n=i.slice(0,t).join("").length;return t===e?{selectionStart:n,selectionEnd:n}:{selectionStart:n,selectionEnd:n+i.slice(t,e).join("").length}},_updateTextarea:function(){var t;this.cursorOffsetCache={},this.hiddenTextarea&&(this.inCompositionMode||(t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text),this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd),this.updateTextareaPosition())},updateFromTextArea:function(){var t;this.hiddenTextarea&&(this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),t=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),this.selectionEnd=this.selectionStart=t.selectionEnd,this.inCompositionMode||(this.selectionStart=t.selectionStart),this.updateTextareaPosition())},updateTextareaPosition:function(){var t;this.selectionStart===this.selectionEnd&&(t=this._calcTextareaPosition(),this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top)},_calcTextareaPosition:function(){var t,e,i,n,s,r,a,o;return this.canvas?(o=this.inCompositionMode?this.compositionStart:this.selectionStart,i=this._getCursorBoundaries(o),t=(o=this.get2DCursorLocation(o)).lineIndex,o=o.charIndex,t=this.getValueOfPropertyAt(t,o,"fontSize")*this.lineHeight,o=i.leftOffset,e=this.calcTransformMatrix(),o={x:i.left+o,y:i.top+i.topOffset+t},i=this.canvas.getRetinaScaling(),n=(r=(a=this.canvas.upperCanvasEl).width/i)-t,s=(i=a.height/i)-t,r=a.clientWidth/r,a=a.clientHeight/i,o=V.util.transformPoint(o,e),(o=V.util.transformPoint(o,this.canvas.viewportTransform)).x*=r,o.y*=a,o.x<0&&(o.x=0),o.x>n&&(o.x=n),o.y<0&&(o.y=0),o.y>s&&(o.y=s),o.x+=this.canvas._offset.left,o.y+=this.canvas._offset.top,{left:o.x+"px",top:o.y+"px",fontSize:t+"px",charHeight:t}):{x:1,y:1}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,selectable:this.selectable,defaultCursor:this.canvas&&this.canvas.defaultCursor,moveCursor:this.canvas&&this.canvas.moveCursor}},_restoreEditingProps:function(){this._savedProps&&(this.hoverCursor=this._savedProps.hoverCursor,this.hasControls=this._savedProps.hasControls,this.borderColor=this._savedProps.borderColor,this.selectable=this._savedProps.selectable,this.lockMovementX=this._savedProps.lockMovementX,this.lockMovementY=this._savedProps.lockMovementY,this.canvas)&&(this.canvas.defaultCursor=this._savedProps.defaultCursor,this.canvas.moveCursor=this._savedProps.moveCursor)},exitEditing:function(){var t=this._textBeforeEdit!==this.text,e=this.hiddenTextarea;return this.selected=!1,this.isEditing=!1,this.selectionEnd=this.selectionStart,e&&(e.blur&&e.blur(),e.parentNode)&&e.parentNode.removeChild(e),this.hiddenTextarea=null,this.abortCursorAnimation(),this._restoreEditingProps(),this._currentCursorOpacity=0,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this.fire("editing:exited"),t&&this.fire("modified"),this.canvas&&(this.canvas.off("mouse:move",this.mouseMoveHandler),this.canvas.fire("text:editing:exited",{target:this}),t)&&this.canvas.fire("object:modified",{target:this}),this},_removeExtraneousStyles:function(){for(var t in this.styles)this._textLines[t]||delete this.styles[t]},removeStyleFromTo:function(t,e){var t=this.get2DCursorLocation(t,!0),e=this.get2DCursorLocation(e,!0),i=t.lineIndex,n=t.charIndex,s=e.lineIndex,r=e.charIndex;if(i!==s){if(this.styles[i])for(h=n;h<this._unwrappedTextLines[i].length;h++)delete this.styles[i][h];if(this.styles[s])for(h=r;h<this._unwrappedTextLines[s].length;h++)(l=this.styles[s][h])&&(this.styles[i]||(this.styles[i]={}),this.styles[i][n+h-r]=l);for(h=i+1;h<=s;h++)delete this.styles[h];this.shiftLineStyles(s,i-s)}else if(this.styles[i]){for(var a,o,l=this.styles[i],c=r-n,h=n;h<r;h++)delete l[h];for(o in this.styles[i])(a=parseInt(o,10))>=r&&(l[a-c]=l[o],delete l[o])}},shiftLineStyles:function(t,e){var i,n=p(this.styles);for(i in this.styles){var s=parseInt(i,10);t<s&&(this.styles[s+e]=n[s],n[s-e]||delete this.styles[s])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(t,e,i,n){var s,r,a={},o=!1,l=this._unwrappedTextLines[t].length===e;for(r in this.shiftLineStyles(t,i=i||1),this.styles[t]&&(s=this.styles[t][0===e?e:e-1]),this.styles[t]){var c=parseInt(r,10);e<=c&&(o=!0,a[c-e]=this.styles[t][r],l&&0===e||delete this.styles[t][r])}var h=!1;for(o&&!l&&(this.styles[t+i]=a,h=!0),h&&i--;0<i;)n&&n[i-1]?this.styles[t+i]={0:p(n[i-1])}:s?this.styles[t+i]={0:p(s)}:delete this.styles[t+i],i--;this._forceClearCache=!0},insertCharStyleObject:function(t,e,i,n){this.styles||(this.styles={});var s,r=this.styles[t],a=r?p(r):{};for(s in i=i||1,a){var o=parseInt(s,10);e<=o&&(r[o+i]=a[o],a[o-i]||delete r[o])}if(this._forceClearCache=!0,n)for(;i--;)Object.keys(n[i]).length&&(this.styles[t]||(this.styles[t]={}),this.styles[t][e+i]=p(n[i]));else if(r)for(var l=r[e?e-1:1];l&&i--;)this.styles[t][e+i]=p(l)},insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),s=[0],r=0,a=0;a<t.length;a++)"\n"===t[a]?s[++r]=0:s[r]++;for(0<s[0]&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,s[0],i),i=i&&i.slice(s[0]+1)),r&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+s[0],r),a=1;a<r;a++)0<s[a]?this.insertCharStyleObject(n.lineIndex+a,0,s[a],i):i&&this.styles[n.lineIndex+a]&&i[0]&&(this.styles[n.lineIndex+a][0]=i[0]),i=i&&i.slice(s[a]+1);0<s[a]&&this.insertCharStyleObject(n.lineIndex+a,0,s[a],i)},setSelectionStartEndWithShift:function(t,e,i){i<=t?(e===t?this._selectionDirection="left":"right"===this._selectionDirection&&(this._selectionDirection="left",this.selectionEnd=t),this.selectionStart=i):t<i&&i<e?"right"===this._selectionDirection?this.selectionEnd=i:this.selectionStart=i:(e===t?this._selectionDirection="right":"left"===this._selectionDirection&&(this._selectionDirection="right",this.selectionStart=e),this.selectionEnd=i)},setSelectionInBoundaries:function(){var t=this.text.length;this.selectionStart>t?this.selectionStart=t:this.selectionStart<0&&(this.selectionStart=0),this.selectionEnd>t?this.selectionEnd=t:this.selectionEnd<0&&(this.selectionEnd=0)}}),V.util.object.extend(V.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){var e;this.canvas&&(this.__newClickTime=+new Date,e=t.pointer,this.isTripleClick(e)&&(this.fire("tripleclick",t),this._stopEvent(t.e)),this.__lastLastClickTime=this.__lastClickTime,this.__lastClickTime=this.__newClickTime,this.__lastPointer=e,this.__lastIsEditing=this.isEditing,this.__lastSelected=this.selected)},isTripleClick:function(t){return this.__newClickTime-this.__lastClickTime<500&&this.__lastClickTime-this.__lastLastClickTime<500&&this.__lastPointer.x===t.x&&this.__lastPointer.y===t.y},_stopEvent:function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation()},initCursorSelectionHandlers:function(){this.initMousedownHandler(),this.initMouseupHandler(),this.initClicks()},doubleClickHandler:function(t){this.isEditing&&this.selectWord(this.getSelectionStartFromPointer(t.e))},tripleClickHandler:function(t){this.isEditing&&this.selectLine(this.getSelectionStartFromPointer(t.e))},initClicks:function(){this.on("mousedblclick",this.doubleClickHandler),this.on("tripleclick",this.tripleClickHandler)},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&(this.inCompositionMode=!1,this.setCursorByClick(t.e)),this.isEditing&&(this.__selectionStartOnMouseDown=this.selectionStart,this.selectionStart===this.selectionEnd&&this.abortCursorAnimation(),this.renderCursorOrSelection()))},_mouseDownHandlerBefore:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.selected=this===this.canvas._activeObject)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){if(this.__isMousedown=!1,!(!this.editable||this.group||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button)){if(this.canvas){var e=this.canvas._activeObject;if(e&&e!==this)return}this.__lastSelected&&!this.__corner?(this.selected=!1,this.__lastSelected=!1,this.enterEditing(t.e),this.selectionStart===this.selectionEnd?this.initDelayedCursor(!0):this.renderCursorOrSelection()):this.selected=!0}},setCursorByClick:function(t){var e=this.getSelectionStartFromPointer(t),i=this.selectionStart,n=this.selectionEnd;t.shiftKey?this.setSelectionStartEndWithShift(i,n,e):(this.selectionStart=e,this.selectionEnd=e),this.isEditing&&(this._fireSelectionChanged(),this._updateTextarea())},getSelectionStartFromPointer:function(t){for(var e=this.getLocalPointer(t),i=0,n=0,s=0,r=0,a=0,o=0,l=this._textLines.length;o<l&&s<=e.y;o++)s+=this.getHeightOfLine(o)*this.scaleY,0<(a=o)&&(r+=this._textLines[o-1].length+this.missingNewlineOffset(o-1));n=this._getLineLeftOffset(a)*this.scaleX,t=this._textLines[a],"rtl"===this.direction&&(e.x=this.width*this.scaleX-e.x+n);for(var c=0,h=t.length;c<h&&(i=n,(n+=this.__charBounds[a][c].kernedWidth*this.scaleX)<=e.x);c++)r++;return this._getNewSelectionStartFromOffset(e,i,n,r,h)},_getNewSelectionStartFromOffset:function(t,e,i,n,s){e=t.x-e,i-=t.x,t=n+(e<i||i<0?0:1);return t=(t=this.flipX?s-t:t)>this._text.length?this._text.length:t}}),V.util.object.extend(V.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=V.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","false"),this.hiddenTextarea.setAttribute("data-fabric-hiddentextarea",""),this.hiddenTextarea.setAttribute("wrap","off");var t=this._calcTextareaPosition();this.hiddenTextarea.style.cssText="position: absolute; top: "+t.top+"; left: "+t.left+"; z-index: -999; opacity: 0; width: 1px; height: 1px; font-size: 1px; padding-top: "+t.fontSize+";",(this.hiddenTextareaContainer||V.document.body).appendChild(this.hiddenTextarea),V.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),V.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),V.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),V.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),V.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),V.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),V.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),V.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),V.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(V.util.addListener(this.canvas.upperCanvasEl,"click",this.onClick.bind(this)),this._clickHandlerInitialized=!0)},keysMap:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorRight",36:"moveCursorLeft",37:"moveCursorLeft",38:"moveCursorUp",39:"moveCursorRight",40:"moveCursorDown"},keysMapRtl:{9:"exitEditing",27:"exitEditing",33:"moveCursorUp",34:"moveCursorDown",35:"moveCursorLeft",36:"moveCursorRight",37:"moveCursorRight",38:"moveCursorUp",39:"moveCursorLeft",40:"moveCursorDown"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing){var e="rtl"===this.direction?this.keysMapRtl:this.keysMap;if(t.keyCode in e)this[e[t.keyCode]](t);else{if(!(t.keyCode in this.ctrlKeysMapDown)||!t.ctrlKey&&!t.metaKey)return;this[this.ctrlKeysMapDown[t.keyCode]](t)}t.stopImmediatePropagation(),t.preventDefault(),33<=t.keyCode&&t.keyCode<=40?(this.inCompositionMode=!1,this.clearContextTop(),this.renderCursorOrSelection()):this.canvas&&this.canvas.requestRenderAll()}},onKeyUp:function(t){!this.isEditing||this._copyDone||this.inCompositionMode?this._copyDone=!1:t.keyCode in this.ctrlKeysMapUp&&(t.ctrlKey||t.metaKey)&&(this[this.ctrlKeysMapUp[t.keyCode]](t),t.stopImmediatePropagation(),t.preventDefault(),this.canvas)&&this.canvas.requestRenderAll()},onInput:function(t){var e,i,n,s,r,a,o,l,c,h,d,u=this.fromPaste;this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing&&(t=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,s=this._text.length,a=(r=t.length)-s,c=(o=this.selectionStart)!==(l=this.selectionEnd),""===this.hiddenTextarea.value?this.styles={}:(d=o>(h=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value)).selectionStart,c?(e=this._text.slice(o,l),a+=l-o):r<s&&(e=d?this._text.slice(l+a,l):this._text.slice(o,o-a)),r=t.slice(h.selectionEnd-a,h.selectionEnd),e&&e.length&&(r.length&&(i=this.getSelectionStyles(o,o+1,!1),i=r.map(function(){return i[0]})),s=c?(n=o,l):d?(n=l-e.length,l):(n=l)+e.length,this.removeStyleFromTo(n,s)),r.length&&(u&&r.join("")===V.copiedText&&!V.disableStyleCopyPaste&&(i=V.copiedTextStyle),this.insertNewStyleBlock(r,o,i))),this.updateFromTextArea(),this.fire("changed"),this.canvas)&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll())},onCompositionStart:function(){this.inCompositionMode=!0},onCompositionEnd:function(){this.inCompositionMode=!1},onCompositionUpdate:function(t){this.compositionStart=t.target.selectionStart,this.compositionEnd=t.target.selectionEnd,this.updateTextareaPosition()},copy:function(){this.selectionStart!==this.selectionEnd&&(V.copiedText=this.getSelectedText(),V.disableStyleCopyPaste?V.copiedTextStyle=null:V.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||V.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i=this._getLineLeftOffset(t);return 0<e&&(i+=(t=this.__charBounds[t][e-1]).left+t.width),i},getDownCursorOffset:function(t,e){var e=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(e),n=i.lineIndex;return n===this._textLines.length-1||t.metaKey||34===t.keyCode?this._text.length-e:(t=i.charIndex,e=this._getWidthBeforeCursor(n,t),i=this._getIndexOnLine(n+1,e),this._textLines[n].slice(t).length+i+1+this.missingNewlineOffset(n))},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var e=this._getSelectionForOffset(t,e),i=this.get2DCursorLocation(e),n=i.lineIndex;return 0===n||t.metaKey||33===t.keyCode?-e:(t=i.charIndex,e=this._getWidthBeforeCursor(n,t),i=this._getIndexOnLine(n-1,e),e=this._textLines[n].slice(0,t),t=this.missingNewlineOffset(n-1),-this._textLines[n-1].length+i-e.length+(1-t))},_getIndexOnLine:function(t,e){for(var i=this._textLines[t],n=this._getLineLeftOffset(t),s=0,r=0,a=i.length;r<a;r++)if((n+=c=this.__charBounds[t][r].width)>e){var o=!0,l=n,c=Math.abs(n-c-e),s=Math.abs(l-e)<c?r:r-1;break}return s=o?s:i.length-1},moveCursorDown:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorUpOrDown("Down",t)},moveCursorUp:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorUpOrDown("Up",t)},_moveCursorUpOrDown:function(t,e){t=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(t):this.moveCursorWithoutShift(t),0!==t&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorWithShift:function(t){var e="left"===this._selectionDirection?this.selectionStart+t:this.selectionEnd+t;return this.setSelectionStartEndWithShift(this.selectionStart,this.selectionEnd,e),0!==t},moveCursorWithoutShift:function(t){return t<0?(this.selectionStart+=t,this.selectionEnd=this.selectionStart):(this.selectionEnd+=t,this.selectionStart=this.selectionEnd),0!==t},moveCursorLeft:function(t){0===this.selectionStart&&0===this.selectionEnd||this._moveCursorLeftOrRight("Left",t)},_move:function(t,e,i){var n;if(t.altKey)n=this["findWordBoundary"+i](this[e]);else{if(!t.metaKey&&35!==t.keyCode&&36!==t.keyCode)return this[e]+="Left"===i?-1:1,!0;n=this["findLineBoundary"+i](this[e])}if(void 0!==n&&this[e]!==n)return this[e]=n,!0},_moveLeft:function(t,e){return this._move(t,e,"Left")},_moveRight:function(t,e){return this._move(t,e,"Right")},moveCursorLeftWithoutShift:function(t){var e=!0;return this._selectionDirection="left",this.selectionEnd===this.selectionStart&&0!==this.selectionStart&&(e=this._moveLeft(t,"selectionStart")),this.selectionEnd=this.selectionStart,e},moveCursorLeftWithShift:function(t){return"right"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveLeft(t,"selectionEnd"):0!==this.selectionStart?(this._selectionDirection="left",this._moveLeft(t,"selectionStart")):void 0},moveCursorRight:function(t){this.selectionStart>=this._text.length&&this.selectionEnd>=this._text.length||this._moveCursorLeftOrRight("Right",t)},_moveCursorLeftOrRight:function(t,e){t="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?t+="Shift":t+="outShift",this[t](e)&&(this.abortCursorAnimation(),this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())},moveCursorRightWithShift:function(t){return"left"===this._selectionDirection&&this.selectionStart!==this.selectionEnd?this._moveRight(t,"selectionStart"):this.selectionEnd!==this._text.length?(this._selectionDirection="right",this._moveRight(t,"selectionEnd")):void 0},moveCursorRightWithoutShift:function(t){var e=!0;return this._selectionDirection="right",this.selectionStart===this.selectionEnd?(e=this._moveRight(t,"selectionStart"),this.selectionEnd=this.selectionStart):this.selectionStart=this.selectionEnd,e},removeChars:function(t,e){this.removeStyleFromTo(t,e=void 0===e?t+1:e),this._text.splice(t,e-t),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()},insertChars:function(t,e,i,n){i<(n=void 0===n?i:n)&&this.removeStyleFromTo(i,n);t=V.util.string.graphemeSplit(t);this.insertNewStyleBlock(t,i,e),this._text=[].concat(this._text.slice(0,i),t,this._text.slice(n)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),f=V.util.toFixed,z=/  +/g,V.util.object.extend(V.Text.prototype,{_toSVG:function(){var t=this._getSVGLeftTopOffsets(),t=this._getSVGTextAndBg(t.textTop,t.textLeft);return this._wrapSVGTextAndBg(t)},toSVG:function(t){return this._createBaseSVGMarkup(this._toSVG(),{reviver:t,noStyle:!0,withShadow:!0})},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t){var e=this.getSvgTextDecoration(this);return[t.textBgRects.join(""),'\t\t<text xml:space="preserve" ',this.fontFamily?'font-family="'+this.fontFamily.replace(/"/g,"'")+'" ':"",this.fontSize?'font-size="'+this.fontSize+'" ':"",this.fontStyle?'font-style="'+this.fontStyle+'" ':"",this.fontWeight?'font-weight="'+this.fontWeight+'" ':"",e?'text-decoration="'+e+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",t.textSpans.join(""),"</text>\n"]},_getSVGTextAndBg:function(t,e){var i,n=[],s=[],r=t;this._setSVGBg(s);for(var a=0,o=this._textLines.length;a<o;a++)i=this._getLineLeftOffset(a),(this.textBackgroundColor||this.styleHas("textBackgroundColor",a))&&this._setSVGTextLineBg(s,a,e+i,r),this._setSVGTextLineText(n,a,e+i,r),r+=this.getHeightOfLine(a);return{textSpans:n,textBgRects:s}},_createTextCharSpan:function(t,e,i,n){var s=t!==t.trim()||t.match(z),s=this.getSvgSpanStyles(e,s),s=s?'style="'+s+'"':"",e=e.deltaY,r="",a=V.Object.NUM_FRACTION_DIGITS;return e&&(r=' dy="'+f(e,a)+'" '),['<tspan x="',f(i,a),'" y="',f(n,a),'" ',r,s,">",V.util.string.escapeXml(t),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,n){var s,r,a,o,l=this.getHeightOfLine(e),c=-1!==this.textAlign.indexOf("justify"),h="",d=0,u=this._textLines[e];n+=l*(1-this._fontSizeFraction)/this.lineHeight;for(var p=0,f=u.length-1;p<=f;p++)o=p===f||this.charSpacing,h+=u[p],a=this.__charBounds[e][p],0===d?(i+=a.kernedWidth-a.width,d+=a.width):d+=a.kernedWidth,(o=c&&!o&&this._reSpaceAndTab.test(u[p])?!0:o)||(s=s||this.getCompleteStyleDeclaration(e,p),r=this.getCompleteStyleDeclaration(e,p+1),o=V.util.hasStyleChanged(s,r,!0)),o&&(a=this._getStyleDeclaration(e,p)||{},t.push(this._createTextCharSpan(h,a,i,n)),h="",s=r,i+=d,d=0)},_pushTextBgRect:function(t,e,i,n,s,r){var a=V.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(e),' x="',f(i,a),'" y="',f(n,a),'" width="',f(s,a),'" height="',f(r,a),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,n){for(var s,r,a=this._textLines[e],o=this.getHeightOfLine(e)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),d=0,u=a.length;d<u;d++)s=this.__charBounds[e][d],(r=this.getValueOfPropertyAt(e,d,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(t,h,i+c,n,l,o),c=s.left,l=s.width,h=r):l+=s.kernedWidth;r&&this._pushTextBgRect(t,r,i+c,n,l,o)},_getFillAttributes:function(t){var e=t&&"string"==typeof t?new V.Color(t):"";return e&&e.getSource()&&1!==e.getAlpha()?'opacity="'+e.getAlpha()+'" fill="'+e.setAlpha(1).toRgb()+'"':'fill="'+t+'"'},_getSVGLineTopOffset:function(t){for(var e,i=0,n=0;n<t;n++)i+=this.getHeightOfLine(n);return e=this.getHeightOfLine(n),{lineTop:i,offset:(this._fontSizeMult-this._fontSizeFraction)*e/(this.lineHeight*this._fontSizeMult)}},getSvgStyles:function(t){return V.Object.prototype.getSvgStyles.call(this,t)+" white-space: pre;"}}),function(t){"use strict";var b=t.fabric||(t.fabric={});b.Textbox=b.util.createClass(b.IText,b.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:b.Text.prototype._dimensionAffectingProps.concat("width"),_wordJoiners:/[ \t\r]/,splitByGrapheme:!1,initDimensions:function(){this.__skipDimension||(this.isEditing&&this.initDelayedCursor(),this.clearContextTop(),this._clearCache(),this.dynamicMinWidth=0,this._styleMap=this._generateStyleMap(this._splitText()),this.dynamicMinWidth>this.width&&this._set("width",this.dynamicMinWidth),-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},_generateStyleMap:function(t){for(var e=0,i=0,n=0,s={},r=0;r<t.graphemeLines.length;r++)"\n"===t.graphemeText[n]&&0<r?(i=0,n++,e++):!this.splitByGrapheme&&this._reSpaceAndTab.test(t.graphemeText[n])&&0<r&&(i++,n++),s[r]={line:e,offset:i},n+=t.graphemeLines[r].length,i+=t.graphemeLines[r].length;return s},styleHas:function(t,e){var i;return this._styleMap&&!this.isWrapping&&(i=this._styleMap[e])&&(e=i.line),b.Text.prototype.styleHas.call(this,t,e)},isEmptyStyles:function(t){if(this.styles){var e,i,n,s=0,r=!1,a=this._styleMap[t],o=this._styleMap[t+1];for(n in a&&(t=a.line,s=a.offset),o&&(r=o.line===t,e=o.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var l in i[n])if(s<=l&&(!r||l<e))for(var c in i[n][l])return!1}return!0},_getStyleDeclaration:function(t,e){if(this._styleMap&&!this.isWrapping){var i=this._styleMap[t];if(!i)return null;t=i.line,e=i.offset+e}return this.callSuper("_getStyleDeclaration",t,e)},_setStyleDeclaration:function(t,e,i){var n=this._styleMap[t];t=n.line,e=n.offset+e,this.styles[t][e]=i},_deleteStyleDeclaration:function(t,e){var i=this._styleMap[t];t=i.line,e=i.offset+e,delete this.styles[t][e]},_getLineStyle:function(t){t=this._styleMap[t];return!!this.styles[t.line]},_setLineStyle:function(t){t=this._styleMap[t];this.styles[t.line]={}},_wrapText:function(t,e){var i,n=[];for(this.isWrapping=!0,i=0;i<t.length;i++)n=n.concat(this._wrapLine(t[i],i,e));return this.isWrapping=!1,n},_measureWord:function(t,e,i){var n,s=0;i=i||0;for(var r=0,a=t.length;r<a;r++)s+=this._getGraphemeBox(t[r],e,r+i,n,!0).kernedWidth,n=t[r];return s},_wrapLine:function(t,e,i,n){var s,r,a=0,o=this.splitByGrapheme,l=[],c=[],h=o?b.util.string.graphemeSplit(t):t.split(this._wordJoiners),d=0,u=o?"":" ",p=0,f=0,g=!0,m=this._getWidthOfCharSpacing();n=n||0,0===h.length&&h.push([]),i-=n;for(var v=0;v<h.length;v++)s=o?h[v]:b.util.string.graphemeSplit(h[v]),r=this._measureWord(s,e,d),d+=s.length,(a+=p+r-m)>i&&!g?(l.push(c),c=[],a=r,g=!0):a+=m,g||o||c.push(u),c=c.concat(s),p=o?0:this._measureWord([u],e,d),d++,g=!1,f<r&&(f=r);return v&&l.push(c),f+n>this.dynamicMinWidth&&(this.dynamicMinWidth=f-m+n),l},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},missingNewlineOffset:function(t){return!this.splitByGrapheme||this.isEndOfWrapping(t)?1:0},_splitTextIntoLines:function(t){for(var t=b.Text.prototype._splitTextIntoLines.call(this,t),e=this._wrapText(t.lines,this.width),i=new Array(e.length),n=0;n<e.length;n++)i[n]=e[n].join("");return t.lines=i,t.graphemeLines=e,t},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},_removeExtraneousStyles:function(){var t,e={};for(t in this._styleMap)this._textLines[t]&&(e[this._styleMap[t].line]=1);for(t in this.styles)e[t]||delete this.styles[t]},toObject:function(t){return this.callSuper("toObject",["minWidth","splitByGrapheme"].concat(t))}}),b.Textbox.fromObject=function(t,e){var i=b.util.stylesFromArray(t.styles,t.text),t=Object.assign({},t,{styles:i});return b.Object._fromObject("Textbox",t,e,"text")}}(i),t=V.controlsUtils,e=t.scaleSkewCursorStyleHandler,g=t.scaleCursorStyleHandler,m=t.scalingEqually,W=t.scalingYOrSkewingX,v=t.scalingXOrSkewingY,b=t.scaleOrSkewActionName,(y=V.Object.prototype.controls).ml=new V.Control({x:-.5,y:0,cursorStyleHandler:e,actionHandler:v,getActionName:b}),y.mr=new V.Control({x:.5,y:0,cursorStyleHandler:e,actionHandler:v,getActionName:b}),y.mb=new V.Control({x:0,y:.5,cursorStyleHandler:e,actionHandler:W,getActionName:b}),y.mt=new V.Control({x:0,y:-.5,cursorStyleHandler:e,actionHandler:W,getActionName:b}),y.tl=new V.Control({x:-.5,y:-.5,cursorStyleHandler:g,actionHandler:m}),y.tr=new V.Control({x:.5,y:-.5,cursorStyleHandler:g,actionHandler:m}),y.bl=new V.Control({x:-.5,y:.5,cursorStyleHandler:g,actionHandler:m}),y.br=new V.Control({x:.5,y:.5,cursorStyleHandler:g,actionHandler:m}),y.mtr=new V.Control({x:0,y:-.5,actionHandler:t.rotationWithSnapping,cursorStyleHandler:t.rotationStyleHandler,offsetY:-40,withConnection:!0,actionName:"rotate"}),V.Textbox&&((v=V.Textbox.prototype.controls={}).mtr=y.mtr,v.tr=y.tr,v.br=y.br,v.tl=y.tl,v.bl=y.bl,v.mt=y.mt,v.mb=y.mb,v.mr=new V.Control({x:.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}),v.ml=new V.Control({x:-.5,y:0,actionHandler:t.changeWidth,cursorStyleHandler:e,actionName:"resizing"}))},331:function(t){t.exports=function(){"use strict";function a(){}var o=Object.prototype.hasOwnProperty,l=Array.prototype.slice;function c(t,e,i){for(var n,s,r=0,a=(i=l.call(arguments,2)).length;r<a;r++)for(n in s=i[r])t&&!o.call(s,n)||(e[n]=s[n])}function t(){}t.class_="Nevis",t.super_=Object,t.extend=function(t,e,i,n){var s,r=this;return"string"!=typeof t&&(n=i,i=e,e=t,t=null),"function"!=typeof e&&(n=i,i=e,e=function(){return r.apply(this,arguments)}),c(!1,e,r,n),e.prototype=(n=r.prototype,i=i,"function"==typeof Object.create?s=Object.create(n):(a.prototype=n,s=new a,a.prototype=null),i&&c(!0,s,i),s),(e.prototype.constructor=e).class_=t||r.class_,e.super_=r,e};var e=t,i=e.extend(function(t,e,i){this.qrious=t,this.element=e,this.element.qrious=t,this.enabled=Boolean(i)},{draw:function(t){},getElement:function(){return this.enabled||(this.enabled=!0,this.render()),this.element},getModuleSize:function(t){var e=this.qrious,i=e.padding||0,e=Math.floor((e.size-2*i)/t.width);return Math.max(1,e)},getOffset:function(t){var e=this.qrious,i=e.padding;return null!=i?i:(i=this.getModuleSize(t),e=Math.floor((e.size-i*t.width)/2),Math.max(0,e))},render:function(t){this.enabled&&(this.resize(),this.reset(),this.draw(t))},reset:function(){},resize:function(){}}),n=i.extend({draw:function(t){var e,i,n=this.qrious,s=this.getModuleSize(t),r=this.getOffset(t),a=this.element.getContext("2d");for(a.fillStyle=n.foreground,a.globalAlpha=n.foregroundAlpha,e=0;e<t.width;e++)for(i=0;i<t.width;i++)t.buffer[i*t.width+e]&&a.fillRect(s*e+r,s*i+r,s,s)},reset:function(){var t=this.qrious,e=this.element.getContext("2d"),i=t.size;e.lineWidth=1,e.clearRect(0,0,i,i),e.fillStyle=t.background,e.globalAlpha=t.backgroundAlpha,e.fillRect(0,0,i,i)},resize:function(){var t=this.element;t.width=t.height=this.qrious.size}}),r=e.extend(null,{BLOCK:[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28]}),h=e.extend(null,{BLOCKS:[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],FINAL_FORMAT:[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],LEVELS:{L:1,M:2,Q:3,H:4}}),d=e.extend(null,{EXPONENT:[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],LOG:[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175]}),u=e.extend(null,{BLOCK:[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177]}),p=e.extend(function(t){var e,i,n,s,r,a=t.value.length;for(this._badness=[],this._level=h.LEVELS[t.level],this._polynomial=[],this._value=t.value,this._version=0,this._stringBuffer=[];this._version<40&&(this._version++,n=4*(this._level-1)+16*(this._version-1),s=h.BLOCKS[n++],r=h.BLOCKS[n++],e=h.BLOCKS[n++],i=h.BLOCKS[n],!(a<=e*(s+r)+r-3+(this._version<=9))););this._dataBlock=e,this._eccBlock=i,this._neccBlock1=s,this._neccBlock2=r;t=this.width=17+4*this._version;this.buffer=p._createArray(t*t),this._ecc=p._createArray(e+(e+i)*(s+r)+r),this._mask=p._createArray((t*(1+t)+1)/2),this._insertFinders(),this._insertAlignments(),this.buffer[8+t*(t-8)]=1,this._insertTimingGap(),this._reverseMask(),this._insertTimingRowAndColumn(),this._insertVersion(),this._syncMask(),this._convertBitStream(a),this._calculatePolynomial(),this._appendEccToData(),this._interleaveBlocks(),this._pack(),this._finish()},{_addAlignment:function(t,e){var i,n=this.buffer,s=this.width;for(n[t+s*e]=1,i=-2;i<2;i++)n[t+i+s*(e-2)]=1,n[t-2+s*(e+i+1)]=1,n[t+2+s*(e+i)]=1,n[t+i+1+s*(e+2)]=1;for(i=0;i<2;i++)this._setMask(t-1,e+i),this._setMask(t+1,e-i),this._setMask(t-i,e-1),this._setMask(t+i,e+1)},_appendData:function(t,e,i,n){for(var s,r,a=this._polynomial,o=this._stringBuffer,l=0;l<n;l++)o[i+l]=0;for(l=0;l<e;l++){if(255!==(s=d.LOG[o[t+l]^o[i]]))for(r=1;r<n;r++)o[i+r-1]=o[i+r]^d.EXPONENT[p._modN(s+a[n-r])];else for(r=i;r<i+n;r++)o[r]=o[r+1];o[i+n-1]=255===s?0:d.EXPONENT[p._modN(s+a[0])]}},_appendEccToData:function(){for(var t=0,e=this._dataBlock,i=this._calculateMaxLength(),n=this._eccBlock,s=0;s<this._neccBlock1;s++)this._appendData(t,e,i,n),t+=e,i+=n;for(s=0;s<this._neccBlock2;s++)this._appendData(t,e+1,i,n),t+=e+1,i+=n},_applyMask:function(t){var e,i,n,s,r=this.buffer,a=this.width;switch(t){case 0:for(s=0;s<a;s++)for(n=0;n<a;n++)n+s&1||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 1:for(s=0;s<a;s++)for(n=0;n<a;n++)1&s||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 2:for(s=0;s<a;s++)for(n=e=0;n<a;n++,e++)(e=3===e?0:e)||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 3:for(s=i=0;s<a;s++,i++)for(e=i=3===i?0:i,n=0;n<a;n++,e++)(e=3===e?0:e)||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 4:for(s=0;s<a;s++)for(i=s>>1&1,n=e=0;n<a;n++,e++)3===e&&(e=0,i=!i),i||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 5:for(s=i=0;s<a;s++,i++)for(3===i&&(i=0),n=e=0;n<a;n++,e++)(n&s&1)+!(!(e=3===e?0:e)|!i)||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 6:for(s=i=0;s<a;s++,i++)for(3===i&&(i=0),n=e=0;n<a;n++,e++)(n&s&1)+((e=3===e?0:e)&&e===i)&1||this._isMasked(n,s)||(r[n+s*a]^=1);break;case 7:for(s=i=0;s<a;s++,i++)for(3===i&&(i=0),n=e=0;n<a;n++,e++)((e=3===e?0:e)&&e===i)+(n+s&1)&1||this._isMasked(n,s)||(r[n+s*a]^=1)}},_calculateMaxLength:function(){return this._dataBlock*(this._neccBlock1+this._neccBlock2)+this._neccBlock2},_calculatePolynomial:function(){var t,e,i=this._eccBlock,n=this._polynomial;for(n[0]=1,t=0;t<i;t++){for(n[t+1]=1,e=t;0<e;e--)n[e]=n[e]?n[e-1]^d.EXPONENT[p._modN(d.LOG[n[e]]+t)]:n[e-1];n[0]=d.EXPONENT[p._modN(d.LOG[n[0]]+t)]}for(t=0;t<=i;t++)n[t]=d.LOG[n[t]]},_checkBadness:function(){for(var t,e,i,n,s=0,r=this._badness,a=this.buffer,o=this.width,l=0;l<o-1;l++)for(n=0;n<o-1;n++)(a[n+o*l]&&a[n+1+o*l]&&a[n+o*(l+1)]&&a[n+1+o*(l+1)]||!(a[n+o*l]||a[n+1+o*l]||a[n+o*(l+1)]||a[n+1+o*(l+1)]))&&(s+=p.N2);var c=0;for(l=0;l<o;l++){for(n=t=r[i=0]=0;n<o;n++)t===(e=a[n+o*l])?r[i]++:r[++i]=1,c+=(t=e)?1:-1;s+=this._getBadness(i)}for(var h=0,d=(d=c=c<0?-c:c)+(d<<2)<<1;o*o<d;)d-=o*o,h++;for(s+=h*p.N4,n=0;n<o;n++){for(l=t=r[i=0]=0;l<o;l++)t===(e=a[n+o*l])?r[i]++:r[++i]=1,t=e;s+=this._getBadness(i)}return s},_convertBitStream:function(t){for(var e,i=this._ecc,n=this._version,s=0;s<t;s++)i[s]=this._value.charCodeAt(s);var r=this._stringBuffer=i.slice(),a=this._calculateMaxLength(),o=(a-2<=t&&(t=a-2,9<n)&&t--,t);if(9<n){for(r[o+2]=0,r[o+3]=0;o--;)e=r[o],r[o+3]|=255&e<<4,r[o+2]=e>>4;r[2]|=255&t<<4,r[1]=t>>4,r[0]=64|t>>12}else{for(r[o+1]=0,r[o+2]=0;o--;)e=r[o],r[o+2]|=255&e<<4,r[o+1]=e>>4;r[1]|=255&t<<4,r[0]=64|t>>4}for(o=t+3-(n<10);o<a;)r[o++]=236,r[o++]=17},_getBadness:function(t){for(var e=0,i=this._badness,n=0;n<=t;n++)5<=i[n]&&(e+=p.N1+i[n]-5);for(n=3;n<t-1;n+=2)i[n-2]===i[n+2]&&i[n+2]===i[n-1]&&i[n-1]===i[n+1]&&3*i[n-1]===i[n]&&(0===i[n-3]||t<n+3||3*i[n-3]>=4*i[n]||3*i[n+3]>=4*i[n])&&(e+=p.N3);return e},_finish:function(){this._stringBuffer=this.buffer.slice();for(var t,e=0,i=3e4,n=0;n<8&&(this._applyMask(n),(t=this._checkBadness())<i&&(i=t,e=n),7!==e);n++)this.buffer=this._stringBuffer.slice();e!==n&&this._applyMask(e);var i=h.FINAL_FORMAT[e+(this._level-1<<3)],s=this.buffer,r=this.width;for(n=0;n<8;n++,i>>=1)1&i&&(s[r-1-n+8*r]=1,n<6?s[8+r*n]=1:s[8+r*(n+1)]=1);for(n=0;n<7;n++,i>>=1)1&i&&(s[8+r*(r-7+n)]=1,n?s[6-n+8*r]=1:s[7+8*r]=1)},_interleaveBlocks:function(){for(var t,e=this._dataBlock,i=this._ecc,n=this._eccBlock,s=0,r=this._calculateMaxLength(),a=this._neccBlock1,o=this._neccBlock2,l=this._stringBuffer,c=0;c<e;c++){for(t=0;t<a;t++)i[s++]=l[c+t*e];for(t=0;t<o;t++)i[s++]=l[a*e+c+t*(e+1)]}for(t=0;t<o;t++)i[s++]=l[a*e+c+t*(e+1)];for(c=0;c<n;c++)for(t=0;t<a+o;t++)i[s++]=l[r+c+t*n];this._stringBuffer=i},_insertAlignments:function(){var t,e,i,n=this._version,s=this.width;if(1<n)for(t=r.BLOCK[n],i=s-7;;){for(e=s-7;t-3<e&&(this._addAlignment(e,i),!(e<t));)e-=t;if(i<=t+9)break;i-=t,this._addAlignment(6,i),this._addAlignment(i,6)}},_insertFinders:function(){for(var t,e,i,n=this.buffer,s=this.width,r=0;r<3;r++){for(i=t=0,n[(i=2===r?s-7:i)+3+s*((t=1===r?s-7:t)+3)]=1,e=0;e<6;e++)n[i+e+s*t]=1,n[i+s*(t+e+1)]=1,n[i+6+s*(t+e)]=1,n[i+e+1+s*(t+6)]=1;for(e=1;e<5;e++)this._setMask(i+e,t+1),this._setMask(i+1,t+e+1),this._setMask(i+5,t+e),this._setMask(i+e+1,t+5);for(e=2;e<4;e++)n[i+e+s*(t+2)]=1,n[i+2+s*(t+e+1)]=1,n[i+4+s*(t+e)]=1,n[i+e+1+s*(t+4)]=1}},_insertTimingGap:function(){for(var t,e=this.width,i=0;i<7;i++)this._setMask(7,i),this._setMask(e-8,i),this._setMask(7,i+e-7);for(t=0;t<8;t++)this._setMask(t,7),this._setMask(t+e-8,7),this._setMask(t,e-8)},_insertTimingRowAndColumn:function(){for(var t=this.buffer,e=this.width,i=0;i<e-14;i++)1&i?(this._setMask(8+i,6),this._setMask(6,8+i)):(t[8+i+6*e]=1,t[6+e*(8+i)]=1)},_insertVersion:function(){var t,e,i,n,s=this.buffer,r=this._version,a=this.width;if(6<r)for(t=u.BLOCK[r-7],e=17,i=0;i<6;i++)for(n=0;n<3;n++,e--)1&(11<e?r>>e-12:t>>e)?(s[5-i+a*(2-n+a-11)]=1,s[2-n+a-11+a*(5-i)]=1):(this._setMask(5-i,2-n+a-11),this._setMask(2-n+a-11,5-i))},_isMasked:function(t,e){t=p._getMaskBit(t,e);return 1===this._mask[t]},_pack:function(){for(var t,e,i=1,n=1,s=this.width,r=s-1,a=s-1,o=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2,l=0;l<o;l++)for(t=this._stringBuffer[l],e=0;e<8;e++,t<<=1)for(128&t&&(this.buffer[r+s*a]=1);n?r--:(r++,i?0!==a?a--:(i=!i,6==(r-=2)&&(r--,a=9)):a!==s-1?a++:(i=!i,6==(r-=2)&&(r--,a-=8))),n=!n,this._isMasked(r,a););},_reverseMask:function(){for(var t,e=this.width,i=0;i<9;i++)this._setMask(i,8);for(i=0;i<8;i++)this._setMask(i+e-8,8),this._setMask(8,i);for(t=0;t<7;t++)this._setMask(8,t+e-7)},_setMask:function(t,e){t=p._getMaskBit(t,e);this._mask[t]=1},_syncMask:function(){for(var t,e=this.width,i=0;i<e;i++)for(t=0;t<=i;t++)this.buffer[t+e*i]&&this._setMask(t,i)}},{_createArray:function(t){for(var e=[],i=0;i<t;i++)e[i]=0;return e},_getMaskBit:function(t,e){var i;return e<t&&(i=t,t=e,e=i),(i=(i=e)+e*e>>1)+t},_modN:function(t){for(;255<=t;)t=((t-=255)>>8)+(255&t);return t},N1:3,N2:3,N3:40,N4:10}),s=p,f=i.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var t=this.element;t.width=t.height=this.qrious.size}}),i=e.extend(function(t,e,i,n){this.name=t,this.modifiable=Boolean(e),this.defaultValue=i,this._valueTransformer=n},{transform:function(t){var e=this._valueTransformer;return"function"==typeof e?e(t,this):t}}),g=e.extend(null,{abs:function(t){return null!=t?Math.abs(t):null},hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},noop:function(){},toUpperCase:function(t){return null!=t?t.toUpperCase():null}}),m=e.extend(function(t){this.options={},t.forEach(function(t){this.options[t.name]=t},this)},{exists:function(t){return null!=this.options[t]},get:function(t,e){return m._get(this.options[t],e)},getAll:function(t){var e,i=this.options,n={};for(e in i)g.hasOwn(i,e)&&(n[e]=m._get(i[e],t));return n},init:function(t,e,i){var n,s;for(n in"function"!=typeof i&&(i=g.noop),this.options)g.hasOwn(this.options,n)&&(s=this.options[n],m._set(s,s.defaultValue,e),m._createAccessor(s,e,i));this._setAll(t,e,!0)},set:function(t,e,i){return this._set(t,e,i)},setAll:function(t,e){return this._setAll(t,e)},_set:function(t,e,i,n){var s=this.options[t];if(!s)throw new Error("Invalid option: "+t);if(s.modifiable||n)return m._set(s,e,i);throw new Error("Option cannot be modified: "+t)},_setAll:function(t,e,i){if(!t)return!1;var n,s=!1;for(n in t)g.hasOwn(t,n)&&this._set(n,t[n],e,i)&&(s=!0);return s}},{_createAccessor:function(e,i,n){var t={get:function(){return m._get(e,i)}};e.modifiable&&(t.set=function(t){m._set(e,t,i)&&n(t,e)}),Object.defineProperty(i,e.name,t)},_get:function(t,e){return e["_"+t.name]},_set:function(t,e,i){var n="_"+t.name,s=i[n],e=t.transform(null!=e?e:t.defaultValue);return(i[n]=e)!==s}}),v=m,b=e.extend(function(){this._services={}},{getService:function(t){var e=this._services[t];if(e)return e;throw new Error("Service is not being managed with name: "+t)},setService:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}),y=new v([new i("background",!0,"white"),new i("backgroundAlpha",!0,1,g.abs),new i("element"),new i("foreground",!0,"black"),new i("foregroundAlpha",!0,1,g.abs),new i("level",!0,"L",g.toUpperCase),new i("mime",!0,"image/png"),new i("padding",!0,null,g.abs),new i("size",!0,100,g.abs),new i("value",!0,"")]),x=new b,v=e.extend(function(t){y.init(t,this,this.update.bind(this));var t=y.get("element",this),e=x.getService("element"),i=t&&e.isCanvas(t)?t:e.createCanvas(),e=t&&e.isImage(t)?t:e.createImage();this._canvasRenderer=new n(this,i,!0),this._imageRenderer=new f(this,e,e===t),this.update()},{get:function(){return y.getAll(this)},set:function(t){y.setAll(t,this)&&this.update()},toDataURL:function(t){return this.canvas.toDataURL(t||this.mime)},update:function(){var t=new s({level:this.level,value:this.value});this._canvasRenderer.render(t),this._imageRenderer.render(t)}},{use:function(t){x.setService(t.getName(),t)}}),i=(Object.defineProperties(v.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}}),v),b=e.extend({getName:function(){}}).extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(t){},isImage:function(t){}}).extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(t){return t instanceof HTMLCanvasElement},isImage:function(t){return t instanceof HTMLImageElement}});return i.use(new b),i}()},933:(t,e,F)=>{var o,l,s,i,f,E,T,A,I,O,n,r;function j(t,e,i){return t.call.apply(t.bind,arguments)}function R(e,i,t){var n;if(e)return 2<arguments.length?(n=Array.prototype.slice.call(arguments,2),function(){var t=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(t,n),e.apply(i,t)}):function(){return e.apply(i,arguments)};throw Error()}function g(t,e,i){return(g=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?j:R).apply(null,arguments)}function N(t,e){this.a=t,this.o=e||t,this.c=this.o.document}function c(t,e,i,n){if(e=t.c.createElement(e),i)for(var s in i)i.hasOwnProperty(s)&&("style"==s?e.style.cssText=i[s]:e.setAttribute(s,i[s]));return n&&e.appendChild(t.c.createTextNode(n)),e}function h(t,e,i){(t=(t=t.c.getElementsByTagName(e)[0])||document.documentElement).insertBefore(i,t.lastChild)}function a(t){t.parentNode&&t.parentNode.removeChild(t)}function m(t,e,i){e=e||[],i=i||[];for(var n=t.className.split(/\s+/),s=0;s<e.length;s+=1){for(var r=!1,a=0;a<n.length;a+=1)if(e[s]===n[a]){r=!0;break}r||n.push(e[s])}for(e=[],s=0;s<n.length;s+=1){for(r=!1,a=0;a<i.length;a+=1)if(n[s]===i[a]){r=!0;break}r||e.push(n[s])}t.className=e.join(" ").replace(/\s+/g," ").replace(/^\s+|\s+$/,"")}function d(t,e){for(var i=t.className.split(/\s+/),n=0,s=i.length;n<s;n++)if(i[n]==e)return!0;return!1}function k(t,e,i){function n(){a&&s&&(a(r),a=null)}e=c(t,"link",{rel:"stylesheet",href:e,media:"all"});var s=!1,r=null,a=i||null;l?(e.onload=function(){s=!0,n()},e.onerror=function(){s=!0,r=Error("Stylesheet failed to load"),n()}):setTimeout(function(){s=!0,n()},0),h(t,"head",e)}function u(t,e,i,n){var s,r,a=t.c.getElementsByTagName("head")[0];return a?(s=c(t,"script",{src:e}),r=!1,s.onload=s.onreadystatechange=function(){r||this.readyState&&"loaded"!=this.readyState&&"complete"!=this.readyState||(r=!0,i&&i(null),s.onload=s.onreadystatechange=null,"HEAD"==s.parentNode.tagName&&a.removeChild(s))},a.appendChild(s),setTimeout(function(){r||(r=!0,i&&i(Error("Script load timeout")))},n||5e3),s):null}function M(){this.a=0,this.c=null}function P(t){return t.a++,function(){t.a--,p(t)}}function _(t,e){t.c=e,p(t)}function p(t){0==t.a&&t.c&&(t.c(),t.c=null)}function v(t){this.a=t||"-"}function D(t,e){this.c=t,this.f=4,this.a="n";t=(e||"n4").match(/^([nio])([1-9])$/i);t&&(this.a=t[1],this.f=parseInt(t[2],10))}function b(t){var e=[];t=t.split(/,\s*/);for(var i=0;i<t.length;i++){var n=t[i].replace(/['"]/g,"");-1!=n.indexOf(" ")||/^\d/.test(n)?e.push("'"+n+"'"):e.push(n)}return e.join(",")}function y(t){return t.a+t.f}function H(t){var e="normal";return"o"===t.a?e="oblique":"i"===t.a&&(e="italic"),e}function z(t,e){this.c=t,this.f=t.o.document.documentElement,this.h=e,this.a=new v("-"),this.j=!1!==e.events,this.g=!1!==e.classes}function W(t){var e,i,n;t.g&&(e=d(t.f,t.a.c("wf","active")),i=[],n=[t.a.c("wf","loading")],e||i.push(t.a.c("wf","inactive")),m(t.f,i,n)),x(t,"inactive")}function x(t,e,i){t.j&&t.h[e]&&(i?t.h[e](i.c,y(i)):t.h[e]())}function V(){this.c={}}function w(t,e){this.c=t,this.f=e,this.a=c(this.c,"span",{"aria-hidden":"true"},this.f)}function C(t){h(t.c,"body",t.a)}function S(t){return"display:block;position:absolute;top:-9999px;left:-9999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;white-space:nowrap;font-family:"+b(t.c)+";font-style:"+H(t)+";font-weight:"+t.f+"00;"}function U(t,e,i,n,s,r){this.g=t,this.j=e,this.a=n,this.c=i,this.f=s||3e3,this.h=r||void 0}function Y(t,e,i,n,s,r,a){this.v=t,this.B=e,this.c=i,this.a=n,this.s=a||"BESbswy",this.f={},this.w=s||3e3,this.u=r||null,this.m=this.j=this.h=this.g=null,this.g=new w(this.c,this.s),this.h=new w(this.c,this.s),this.j=new w(this.c,this.s),this.m=new w(this.c,this.s),t=S(t=new D(this.a.c+",serif",y(this.a))),this.g.a.style.cssText=t,t=S(t=new D(this.a.c+",sans-serif",y(this.a))),this.h.a.style.cssText=t,t=S(t=new D("serif",y(this.a))),this.j.a.style.cssText=t,t=S(t=new D("sans-serif",y(this.a))),this.m.a.style.cssText=t,C(this.g),C(this.h),C(this.j),C(this.m)}function q(){var t;return null===i&&(t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent),i=!!t&&(parseInt(t[1],10)<536||536===parseInt(t[1],10)&&parseInt(t[2],10)<=11)),i}function G(t,e,i){for(var n in s)if(s.hasOwnProperty(n)&&e===t.f[s[n]]&&i===t.f[s[n]])return!0;return!1}function L(t,e){setTimeout(g(function(){a(this.g.a),a(this.h.a),a(this.j.a),a(this.m.a),e(this.a)},t),0)}function B(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}function X(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&m(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),x(t,"active")):W(t.a))}function Z(t){this.j=t,this.a=new V,this.h=0,this.f=this.g=!0}function J(t,e){this.c=t,this.a=e}function Q(t,e){this.c=t,this.a=e}function K(t,e){this.c=t||"https://fonts.googleapis.com/css",this.a=[],this.f=[],this.g=e||""}function $(t){this.f=t,this.a=[],this.c={}}function tt(t,e){this.c=t,this.a=e}function et(t,e){this.c=t,this.a=e}function it(t,e){this.c=t,this.f=e,this.a=[]}o=Date.now||function(){return+new Date},l=!!window.FontFace,v.prototype.c=function(t){for(var e=[],i=0;i<arguments.length;i++)e.push(arguments[i].replace(/[\W_]+/g,"").toLowerCase());return e.join(this.a)},U.prototype.start=function(){var s=this.c.o.document,r=this,a=o(),t=new Promise(function(i,n){!function e(){var t;o()-a>=r.f?n():s.fonts.load(H(t=r.a)+" "+t.f+"00 300px "+b(t.c),r.h).then(function(t){1<=t.length?i():setTimeout(e,25)},function(){n()})}()}),i=null,e=new Promise(function(t,e){i=setTimeout(e,r.f)});Promise.race([e,t]).then(function(){i&&(clearTimeout(i),i=null),r.g(r.a)},function(){r.j(r.a)})},s={D:"serif",C:"sans-serif"},i=null,Y.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=o(),function t(e){var i=e.g.a.offsetWidth,n=e.h.a.offsetWidth;i===e.f.serif&&n===e.f["sans-serif"]||q()&&G(e,i,n)?o()-e.A>=e.w?q()&&G(e,i,n)&&(null===e.u||e.u.hasOwnProperty(e.a.c))?L(e,e.v):L(e,e.B):setTimeout(g(function(){t(this)},e),50):L(e,e.v)}(this)},f=null,B.prototype.g=function(t){var e=this.a;e.g&&m(e.f,[e.a.c("wf",t.c,y(t).toString(),"active")],[e.a.c("wf",t.c,y(t).toString(),"loading"),e.a.c("wf",t.c,y(t).toString(),"inactive")]),x(e,"fontactive",t),this.m=!0,X(this)},B.prototype.h=function(t){var e,i,n,s=this.a;s.g&&(e=d(s.f,s.a.c("wf",t.c,y(t).toString(),"active")),i=[],n=[s.a.c("wf",t.c,y(t).toString(),"loading")],e||i.push(s.a.c("wf",t.c,y(t).toString(),"inactive")),m(s.f,i,n)),x(s,"fontinactive",t),X(this)},Z.prototype.load=function(t){this.c=new N(this.j,t.context||this.j),this.g=!1!==t.events,this.f=!1!==t.classes;var e,n=this,i=new z(this.c,t),s=t,r=[],t=s.timeout,a=((e=i).g&&m(e.f,[e.a.c("wf","loading")]),x(e,"loading"),r=function(t,e,i){var n,s,r=[];for(n in e)e.hasOwnProperty(n)&&(s=t.c[n])&&r.push(s(e[n],i));return r}(n.a,s,n.c),new B(n.c,i,t));for(n.h=r.length,i=0,s=r.length;i<s;i++)r[i].load(function(t,e,i){var c,h,d,u,p;c=a,h=t,d=e,u=i,p=0==--(t=n).h,(t.f||t.g)&&setTimeout(function(){var t=u||null,e=d||{};if(0===h.length&&p)W(c.a);else{c.f+=h.length,p&&(c.j=p);for(var i=[],n=0;n<h.length;n++){var s,r=h[n],a=e[r.c],o=c.a,l=r;o.g&&m(o.f,[o.a.c("wf",l.c,y(l).toString(),"loading")]),x(o,"fontloading",l),o=(f=(o=null)===f?!!window.FontFace&&(l=/Gecko.*Firefox\/(\d+)/.exec(window.navigator.userAgent),s=/OS X.*Version\/10\..*Safari/.exec(window.navigator.userAgent)&&/Apple/.exec(window.navigator.vendor),l?42<parseInt(l[1],10):!s):f)?new U(g(c.g,c),g(c.h,c),c.c,r,c.s,a):new Y(g(c.g,c),g(c.h,c),c.c,r,c.s,t,a),i.push(o)}for(n=0;n<i.length;n++)i[n].start()}},0)})},J.prototype.load=function(a){var o,e=this,l=e.a.projectId,t=e.a.version;l?(o=e.c.o,u(this.c,(e.a.api||"https://fast.fonts.net/jsapi")+"/"+l+".js"+(t?"?v="+t:""),function(t){t?a([]):(o["__MonotypeConfiguration__"+l]=function(){return e.a},function t(){if(o["__mti_fntLst"+l]){var e,i=o["__mti_fntLst"+l](),n=[];if(i)for(var s=0;s<i.length;s++){var r=i[s].fontfamily;null!=i[s].fontStyle&&null!=i[s].fontWeight?(e=i[s].fontStyle+i[s].fontWeight,n.push(new D(r,e))):n.push(new D(r))}a(n)}else setTimeout(function(){t()},50)}())}).id="__MonotypeAPIScript__"+l):a([])},Q.prototype.load=function(t){for(var e=this.a.urls||[],i=this.a.families||[],n=this.a.testStrings||{},s=new M,r=0,a=e.length;r<a;r++)k(this.c,e[r],P(s));var o=[];for(r=0,a=i.length;r<a;r++)if((e=i[r].split(":"))[1])for(var l=e[1].split(","),c=0;c<l.length;c+=1)o.push(new D(e[0],l[c]));else o.push(new D(e[0]));_(s,function(){t(o,n)})},E={latin:"BESbswy","latin-ext":"çöüğş",cyrillic:"йяЖ",greek:"αβΣ",khmer:"កខគ",Hanuman:"កខគ"},T={thin:"1",extralight:"2","extra-light":"2",ultralight:"2","ultra-light":"2",light:"3",regular:"4",book:"4",medium:"5","semi-bold":"6",semibold:"6","demi-bold":"6",demibold:"6",bold:"7","extra-bold":"8",extrabold:"8","ultra-bold":"8",ultrabold:"8",black:"9",heavy:"9",l:"3",r:"4",b:"7"},A={i:"i",italic:"i",n:"n",normal:"n"},I=/^(thin|(?:(?:extra|ultra)-?)?light|regular|book|medium|(?:(?:semi|demi|extra|ultra)-?)?bold|black|heavy|l|r|b|[1-9]00)?(n|i|normal|italic)?$/,O={Arimo:!0,Cousine:!0,Tinos:!0},tt.prototype.load=function(t){for(var e=new M,i=this.c,n=new K(this.a.api,this.a.text),s=this.a.families,r=n,a=s,o=a.length,l=0;l<o;l++){var c=a[l].split(":"),h=(3==c.length&&r.f.push(c.pop()),"");2==c.length&&""!=c[1]&&(h=":"),r.a.push(c.join(h))}for(var d=new $(s),u=d,p=u.f.length,f=0;f<p;f++){var g=u.f[f].split(":"),m=g[0].replace(/\+/g," "),v=["n4"];if(2<=g.length){var b,y,x=[];if(w=g[1])for(var w,C=(w=w.split(",")).length,S=0;S<C;S++)(b=!(b=w[S]).match(/^[\w-]+$/)||null==(y=I.exec(b.toLowerCase()))?"":[b=null==(b=y[2])||""==b?"n":A[b],y=null==(y=y[1])||""==y?"4":T[y]||(isNaN(y)?"4":y.substr(0,1))].join(""))&&x.push(b);0<x.length&&(v=x),3==g.length&&(x=[],0<(g=(g=g[2])?g.split(","):x).length)&&(g=E[g[0]])&&(u.c[m]=g)}for(u.c[m]||(g=E[m])&&(u.c[m]=g),g=0;g<v.length;g+=1)u.a.push(new D(m,v[g]))}k(i,function(t){if(0==t.a.length)throw Error("No fonts to load!");if(-1!=t.c.indexOf("kit="))return t.c;for(var e=t.a.length,i=[],n=0;n<e;n++)i.push(t.a[n].replace(/ /g,"+"));return e=t.c+"?family="+i.join("%7C"),0<t.f.length&&(e+="&subset="+t.f.join(",")),0<t.g.length&&(e+="&text="+encodeURIComponent(t.g)),e}(n),P(e)),_(e,function(){t(d.a,d.c,O)})},et.prototype.load=function(a){var t=this.a.id,o=this.c.o;t?u(this.c,(this.a.api||"https://use.typekit.net")+"/"+t+".js",function(t){if(t)a([]);else if(o.Typekit&&o.Typekit.config&&o.Typekit.config.fn){t=o.Typekit.config.fn;for(var e=[],i=0;i<t.length;i+=2)for(var n=t[i],s=t[i+1],r=0;r<s.length;r++)e.push(new D(n,s[r]));try{o.Typekit.load({events:!1,classes:!1,async:!0})}catch(t){}a(e)}},2e3):a([])},it.prototype.load=function(l){var t=this.f.id,e=this.c.o,c=this;t?(e.__webfontfontdeckmodule__||(e.__webfontfontdeckmodule__={}),e.__webfontfontdeckmodule__[t]=function(t,e){for(var i,n,s,r=0,a=e.fonts.length;r<a;++r){var o=e.fonts[r];c.a.push(new D(o.name,(o="font-weight:"+o.weight+";font-style:"+o.style,s=n=i=void 0,i=4,n="n",s=null,o&&((s=o.match(/(normal|oblique|italic)/i))&&s[1]&&(n=s[1].substr(0,1).toLowerCase()),s=o.match(/([1-9]00|normal|bold)/i))&&s[1]&&(/bold/i.test(s[1])?i=7:/[1-9]00/.test(s[1])&&(i=parseInt(s[1].substr(0,1),10))),n+i)))}l(c.a)},u(this.c,(this.f.api||"https://f.fontdeck.com/s/css/js/")+((e=this.c).o.location.hostname||e.a.location.hostname)+"/"+t+".js",function(t){t&&l([])})):l([])},(n=new Z(window)).a.c.custom=function(t,e){return new Q(e,t)},n.a.c.fontdeck=function(t,e){return new it(e,t)},n.a.c.monotype=function(t,e){return new J(e,t)},n.a.c.typekit=function(t,e){return new et(e,t)},n.a.c.google=function(t,e){return new tt(e,t)},r={load:g(n.load,n)},void 0!==(n=function(){return r}.call(e,F,e,t))&&(t.exports=n)},960:()=>{},759:()=>{},272:()=>{}},n={};function Zo(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,Zo)),e.exports}Zo.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return Zo.d(e,{a:e}),e},Zo.d=(t,e)=>{for(var i in e)Zo.o(e,i)&&!Zo.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},Zo.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";function i(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=document.body.querySelector(".fpd-snackbar-wrapper"),n=(i||((i=document.createElement("div")).className="fpd-snackbar-wrapper",document.body.append(i)),document.createElement("div"));return n.className="fpd-snackbar fpd-shadow-1",n.innerHTML="<p>"+t+"</p>",n.addEventListener("click",t=>{n.remove(),n=null}),i.append(n),e&&setTimeout(()=>{n&&(n.remove(),n=null)},5e3),n}const a=function(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:document.body;n===document.body&&n.classList.add("fpd-overflow-hidden"),"prompt"===i?t=`
<input type="text" placeholder="${t}" />
<span class="fpd-btn"></span>
`:"confirm"===i&&(t=`
<div class="fpd-confirm-msg">${t}</div>
<span class="fpd-btn fpd-confirm"></span>
`);var s=`
<div class="fpd-modal-inner fpd-shadow-3">
<div class="fpd-modal-close">
<span class="fpd-icon-close"></span>
</div>
<div class="fpd-modal-content">${t}</div>
</div>
`;const r=document.createElement("div");return r.className="fpd-modal-internal fpd-modal-overlay fpd-container "+(e?"fpd-fullscreen":""),r.innerHTML=s,r.dataset.type=i,n.append(r),u(r.querySelector(".fpd-modal-close"),["click"],t=>{n.classList.remove("fpd-overflow-hidden"),r.remove()}),r},l=i;function j(t){return(j="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)}window.FPDSnackbar=i;var R=/^\s+/,N=/\s+$/;function b(t,e){var i,n,s,r,a,o,l,c,h,d,u,p,f,g,m;return e=e||{},(t=t||"")instanceof b?t:this instanceof b?(u={r:0,g:0,b:0},f=null,m=g=!(p=1),p=st(p="object"==j(i="string"==typeof(i=t)?function(t){t=t.replace(R,"").replace(N,"").toLowerCase();var e,i=!1;if(it[t])t=it[t],i=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};return(e=w.rgb.exec(t))?{r:e[1],g:e[2],b:e[3]}:(e=w.rgba.exec(t))?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=w.hsl.exec(t))?{h:e[1],s:e[2],l:e[3]}:(e=w.hsla.exec(t))?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=w.hsv.exec(t))?{h:e[1],s:e[2],v:e[3]}:(e=w.hsva.exec(t))?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=w.hex8.exec(t))?{r:x(e[1]),g:x(e[2]),b:x(e[3]),a:lt(e[4]),format:i?"name":"hex8"}:(e=w.hex6.exec(t))?{r:x(e[1]),g:x(e[2]),b:x(e[3]),format:i?"name":"hex"}:(e=w.hex4.exec(t))?{r:x(e[1]+""+e[1]),g:x(e[2]+""+e[2]),b:x(e[3]+""+e[3]),a:lt(e[4]+""+e[4]),format:i?"name":"hex8"}:!!(e=w.hex3.exec(t))&&{r:x(e[1]+""+e[1]),g:x(e[2]+""+e[2]),b:x(e[3]+""+e[3]),format:i?"name":"hex"}}(i):i)&&(ct(i.r)&&ct(i.g)&&ct(i.b)?(l=i.r,a=i.g,o=i.b,u={r:255*y(l,255),g:255*y(a,255),b:255*y(o,255)},g=!0,m="%"===String(i.r).substr(-1)?"prgb":"rgb"):ct(i.h)&&ct(i.s)&&ct(i.v)?(f=at(i.s),l=at(i.v),a=i.h,o=f,l=l,a=6*y(a,360),o=y(o,100),l=y(l,100),c=Math.floor(a),u={r:255*[l,d=l*(1-(a-=c)*o),h=l*(1-o),h,a=l*(1-(1-a)*o),l][o=c%6],g:255*[a,l,l,d,h,h][o],b:255*[h,h,a,l,l,d][o]},g=!0,m="hsv"):ct(i.h)&&ct(i.s)&&ct(i.l)&&(f=at(i.s),c=at(i.l),h=i.h,a=f,l=c,h=y(h,360),a=y(a,100),l=y(l,100),0===a?n=s=r=l:(n=v(a=2*l-(l=l<.5?l*(1+a):l+a-l*a),l,h+1/3),s=v(a,l,h),r=v(a,l,h-1/3)),u={r:255*n,g:255*s,b:255*r},g=!0,m="hsl"),i.hasOwnProperty("a"))?i.a:p),d={ok:g,format:i.format||m,r:Math.min(255,Math.max(u.r,0)),g:Math.min(255,Math.max(u.g,0)),b:Math.min(255,Math.max(u.b,0)),a:p},this._originalInput=t,this._r=d.r,this._g=d.g,this._b=d.b,this._a=d.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||d.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),void(this._ok=d.ok)):new b(t,e);function v(t,e,i){return i<0&&(i+=1),1<i&&--i,i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}}function H(t,e,i){t=y(t,255),e=y(e,255),i=y(i,255);var n,s=Math.max(t,e,i),r=Math.min(t,e,i),a=(s+r)/2;if(s==r)n=l=0;else{var o=s-r,l=.5<a?o/(2-s-r):o/(s+r);switch(s){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}return{h:n,s:l,l:a}}function z(t,e,i){t=y(t,255),e=y(e,255),i=y(i,255);var n,s=Math.max(t,e,i),r=Math.min(t,e,i),a=s,o=s-r,l=0===s?0:o/s;if(s==r)n=0;else{switch(s){case t:n=(e-i)/o+(e<i?6:0);break;case e:n=(i-t)/o+2;break;case i:n=(t-e)/o+4}n/=6}return{h:n,s:l,v:a}}function W(t,e,i,n){t=[r(Math.round(t).toString(16)),r(Math.round(e).toString(16)),r(Math.round(i).toString(16))];return n&&t[0].charAt(0)==t[0].charAt(1)&&t[1].charAt(0)==t[1].charAt(1)&&t[2].charAt(0)==t[2].charAt(1)?t[0].charAt(0)+t[1].charAt(0)+t[2].charAt(0):t.join("")}function V(t,e,i,n){return[r(ot(n)),r(Math.round(t).toString(16)),r(Math.round(e).toString(16)),r(Math.round(i).toString(16))].join("")}function U(t,e){e=0===e?0:e||10;t=b(t).toHsl();return t.s-=e/100,t.s=rt(t.s),b(t)}function Y(t,e){e=0===e?0:e||10;t=b(t).toHsl();return t.s+=e/100,t.s=rt(t.s),b(t)}function q(t){return b(t).desaturate(100)}function G(t,e){e=0===e?0:e||10;t=b(t).toHsl();return t.l+=e/100,t.l=rt(t.l),b(t)}function X(t,e){e=0===e?0:e||10;t=b(t).toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(-e/100*255))),t.g=Math.max(0,Math.min(255,t.g-Math.round(-e/100*255))),t.b=Math.max(0,Math.min(255,t.b-Math.round(-e/100*255))),b(t)}function Z(t,e){e=0===e?0:e||10;t=b(t).toHsl();return t.l-=e/100,t.l=rt(t.l),b(t)}function J(t,e){t=b(t).toHsl(),e=(t.h+e)%360;return t.h=e<0?360+e:e,b(t)}function Q(t){t=b(t).toHsl();return t.h=(t.h+180)%360,b(t)}function K(t,e){if(isNaN(e)||e<=0)throw new Error("Argument to polyad must be a positive number");for(var i=b(t).toHsl(),n=[b(t)],s=360/e,r=1;r<e;r++)n.push(b({h:(i.h+r*s)%360,s:i.s,l:i.l}));return n}function $(t){var e=b(t).toHsl(),i=e.h;return[b(t),b({h:(i+72)%360,s:e.s,l:e.l}),b({h:(i+216)%360,s:e.s,l:e.l})]}function tt(t,e,i){e=e||6,i=i||30;var n=b(t).toHsl(),s=360/i,r=[b(t)];for(n.h=(n.h-(s*e>>1)+720)%360;--e;)n.h=(n.h+s)%360,r.push(b(n));return r}function et(t,e){e=e||6;for(var t=b(t).toHsv(),i=t.h,n=t.s,s=t.v,r=[],a=1/e;e--;)r.push(b({h:i,s:n,v:s})),s=(s+a)%1;return r}b.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var t=this.toRgb();return(299*t.r+587*t.g+114*t.b)/1e3},getLuminance:function(){var t=this.toRgb(),e=t.r/255,i=t.g/255,t=t.b/255;return.2126*(e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((.055+i)/1.055,2.4))+.0722*(t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4))},setAlpha:function(t){return this._a=st(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=z(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=z(this._r,this._g,this._b),e=Math.round(360*t.h),i=Math.round(100*t.s),t=Math.round(100*t.v);return 1==this._a?"hsv("+e+", "+i+"%, "+t+"%)":"hsva("+e+", "+i+"%, "+t+"%, "+this._roundA+")"},toHsl:function(){var t=H(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=H(this._r,this._g,this._b),e=Math.round(360*t.h),i=Math.round(100*t.s),t=Math.round(100*t.l);return 1==this._a?"hsl("+e+", "+i+"%, "+t+"%)":"hsla("+e+", "+i+"%, "+t+"%, "+this._roundA+")"},toHex:function(t){return W(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){var e=this._r,i=this._g,n=this._b,s=this._a;return e=[r(Math.round(e).toString(16)),r(Math.round(i).toString(16)),r(Math.round(n).toString(16)),r(ot(s))],t&&e[0].charAt(0)==e[0].charAt(1)&&e[1].charAt(0)==e[1].charAt(1)&&e[2].charAt(0)==e[2].charAt(1)&&e[3].charAt(0)==e[3].charAt(1)?e[0].charAt(0)+e[1].charAt(0)+e[2].charAt(0)+e[3].charAt(0):e.join("")},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*y(this._r,255))+"%",g:Math.round(100*y(this._g,255))+"%",b:Math.round(100*y(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*y(this._r,255))+"%, "+Math.round(100*y(this._g,255))+"%, "+Math.round(100*y(this._b,255))+"%)":"rgba("+Math.round(100*y(this._r,255))+"%, "+Math.round(100*y(this._g,255))+"%, "+Math.round(100*y(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(nt[W(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+V(this._r,this._g,this._b,this._a),i=e;return"progid:DXImageTransform.Microsoft.gradient("+(this._gradientType?"GradientType=1, ":"")+"startColorstr="+e+",endColorstr="+(i=t?"#"+V((e=b(t))._r,e._g,e._b,e._a):i)+")"},toString:function(t){var e=!!t,i=(t=t||this._format,!1),n=this._a<1&&0<=this._a;return e||!n||"hex"!==t&&"hex6"!==t&&"hex3"!==t&&"hex4"!==t&&"hex8"!==t&&"name"!==t?("rgb"===t&&(i=this.toRgbString()),"prgb"===t&&(i=this.toPercentageRgbString()),"hex"!==t&&"hex6"!==t||(i=this.toHexString()),"hex3"===t&&(i=this.toHexString(!0)),"hex4"===t&&(i=this.toHex8String(!0)),"hex8"===t&&(i=this.toHex8String()),"name"===t&&(i=this.toName()),"hsl"===t&&(i=this.toHslString()),(i="hsv"===t?this.toHsvString():i)||this.toHexString()):"name"===t&&0===this._a?this.toName():this.toRgbString()},clone:function(){return b(this.toString())},_applyModification:function(t,e){t=t.apply(null,[this].concat([].slice.call(e)));return this._r=t._r,this._g=t._g,this._b=t._b,this.setAlpha(t._a),this},lighten:function(){return this._applyModification(G,arguments)},brighten:function(){return this._applyModification(X,arguments)},darken:function(){return this._applyModification(Z,arguments)},desaturate:function(){return this._applyModification(U,arguments)},saturate:function(){return this._applyModification(Y,arguments)},greyscale:function(){return this._applyModification(q,arguments)},spin:function(){return this._applyModification(J,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(tt,arguments)},complement:function(){return this._applyCombination(Q,arguments)},monochromatic:function(){return this._applyCombination(et,arguments)},splitcomplement:function(){return this._applyCombination($,arguments)},triad:function(){return this._applyCombination(K,[3])},tetrad:function(){return this._applyCombination(K,[4])}},b.fromRatio=function(t,e){if("object"==j(t)){var i,n={};for(i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:at(t[i]));t=n}return b(t,e)},b.equals=function(t,e){return!(!t||!e)&&b(t).toRgbString()==b(e).toRgbString()},b.random=function(){return b.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},b.mix=function(t,e,i){i=0===i?0:i||50;t=b(t).toRgb(),e=b(e).toRgb(),i/=100;return b({r:(e.r-t.r)*i+t.r,g:(e.g-t.g)*i+t.g,b:(e.b-t.b)*i+t.b,a:(e.a-t.a)*i+t.a})},b.readability=function(t,e){t=b(t),e=b(e);return(Math.max(t.getLuminance(),e.getLuminance())+.05)/(Math.min(t.getLuminance(),e.getLuminance())+.05)},b.isReadable=function(t,e,i){var n=b.readability(t,e),s=!1,t=i;switch((e={level:e="AA"!==(e=((t=i||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==e?"AA":e,size:i="small"!==(i=(t.size||"small").toLowerCase())&&"large"!==i?"small":i}).level+e.size){case"AAsmall":case"AAAlarge":s=4.5<=n;break;case"AAlarge":s=3<=n;break;case"AAAsmall":s=7<=n}return s},b.mostReadable=function(t,e,i){for(var n,s=null,r=0,a=(i=i||{}).includeFallbackColors,o=i.level,l=i.size,c=0;c<e.length;c++)(n=b.readability(t,e[c]))>r&&(r=n,s=b(e[c]));return b.isReadable(t,s,{level:o,size:l})||!a?s:(i.includeFallbackColors=!1,b.mostReadable(t,["#fff","#000"],i))};var it=b.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},nt=b.hexNames=function(t){var e,i={};for(e in t)t.hasOwnProperty(e)&&(i[t[e]]=e);return i}(it);function st(t){return t=parseFloat(t),t=isNaN(t)||t<0||1<t?1:t}function y(t,e){var i="string"==typeof(t="string"==typeof(i=t)&&-1!=i.indexOf(".")&&1===parseFloat(i)?"100%":t)&&-1!=t.indexOf("%");return t=Math.min(e,Math.max(0,parseFloat(t))),i&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function rt(t){return Math.min(1,Math.max(0,t))}function x(t){return parseInt(t,16)}function r(t){return 1==t.length?"0"+t:""+t}function at(t){return t=t<=1?100*t+"%":t}function ot(t){return Math.round(255*parseFloat(t)).toString(16)}function lt(t){return x(t)/255}Wt="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",Xt="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";var w={CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+Wt),rgba:new RegExp("rgba"+Xt),hsl:new RegExp("hsl"+Wt),hsla:new RegExp("hsla"+Xt),hsv:new RegExp("hsv"+Wt),hsva:new RegExp("hsva"+Xt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function ct(t){return w.CSS_UNIT.exec(t)}function ht(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"inch",t=t*(2<arguments.length&&void 0!==arguments[2]?arguments[2]:72);return"cm"==e?Math.round(t/2.54):"mm"==e?Math.round(t/25.4):Math.round(t)}function c(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"inch",t=t/(2<arguments.length&&void 0!==arguments[2]?arguments[2]:72);return"cm"==e?Math.round(2.54*t):"mm"==e?Math.round(25.4*t):Math.round(t)}const dt=t=>"[object Object]"===Object.prototype.toString.call(t),M=(e,i)=>{if(e&&"object"==typeof e){let t=!0;for(var n=0;n<i.length;++n){var s=i[n];if(!e.hasOwnProperty(s)){t=!1;break}}return t}return!1},h=(t,e)=>{var i={...t,...e};if(Object.keys(e).length)for(const n of Object.keys(i))dt(i[n])&&t[n]&&e[n]&&(i[n]=h(t[n],e[n]));return i},ut=(t,e,i)=>{if(e)return void 0===(e=(Array.isArray(e)?e:e.match(/([^[.\]])+/g)).reduce((t,e)=>t&&t[e],t))?i:e},pt=t=>/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test(t),ft=t=>{for(var e=t.concat(),i=0;i<e.length;++i)for(var n=i+1;n<e.length;++n)e[i]===e[n]&&e.splice(n--,1);return e},gt=t=>0===t||"string"==typeof t&&"0"===t,u=function(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:()=>{},n=3<arguments.length&&void 0!==arguments[3]&&arguments[3];e="string"==typeof e?[e]:e;const s=new AbortController,r=s["signal"];e.forEach(e=>{!(t instanceof HTMLElement||t instanceof window.constructor)&&Array.from(t).length?t&&t.forEach&&t.forEach(t=>{t.addEventListener(e,i,{capture:n,signal:r}),t.abortController=s}):(t.addEventListener(e,i,{capture:n,signal:r}),t.abortController=s)})},o=function(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};window&&t.dispatchEvent(new CustomEvent(e,{detail:i})),window.jQuery&&t.container&&jQuery(t.container).trigger(e,Object.values(i))},p=function(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return e&&(e instanceof HTMLElement?t.forEach(t=>{e.classList.add(t)}):e.forEach(e=>{t.forEach(t=>{e.classList.add(t)})})),e},d=function(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return e&&(e instanceof HTMLElement?t.forEach(t=>{e.classList.remove(t)}):e.forEach(e=>{t.forEach(t=>{e.classList.remove(t)})})),e},f=function(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];return e&&(e instanceof HTMLElement?t.forEach(t=>{e.classList.toggle(t,i)}):e.forEach(e=>{t.forEach(t=>{e.classList.toggle(t,i)})})),e},g=t=>void 0===t||null==t||("string"==typeof t?!t.trim().length:Array.isArray(t)?!t.length:"object"==typeof t&&!Object.keys(t).length),m=()=>{var e=!0;try{window.localStorage.length,window.localStorage.setItem("fpd-storage","just-testing")}catch(t){e=!1}return e},mt=function(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(t.url){const i=document.createElement("div"),n=(i.className="fpd-item fpd-hover-thumbnail",i.dataset.source=t.url,t.disableDraggable||i.classList.add("fpd-draggable"),t.title&&(i.dataset.title=t.title,i.setAttribute("aria-label",t.title)),document.createElement("picture"));n.dataset.img=t.thumbnailUrl||t.url,i.append(n);var e=new Image;if(e.onerror=()=>{i.remove()},e.src=n.dataset.img,!t.disablePrice){const n=document.createElement("span");n.className="fpd-price",n.innerHTML=t.price,i.append(n),f(n,["fpd-hidden"],!Boolean(t.price))}if(t.removable){const t=document.createElement("span");t.className="fpd-delete fpd-icon-remove",i.append(t)}return i}},vt=function(t,e){let i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t.currentViewInstance)return"";var n=t.currentViewInstance.options;if(document.querySelector(".fpd-upload-zone-content").contains(e)&&t.currentViewInstance.currentUploadZone){const e=t.currentViewInstance.fabricCanvas.getUploadZone(t.currentViewInstance.currentUploadZone);e&&e.price&&(i=e.price)}return(i=null==i?ut(n,"customImageParameters.price",0):i)?St(i,t.mainOptions.priceFormat):""},bt=(e,t,i)=>{var n=e.currentViewInstance;let s=n.options.customImageParameters;var r=n.fabricCanvas.getUploadZone(n.currentUploadZone);if(t>(s=r?h(s,r):s).maxW||t<s.minW||i>s.maxH||i<s.minH){e.loadingCustomImage=!1,e.mainBar&&(e.mainBar.toggleContentDisplay(!1),n.currentUploadZone)&&e.mainBar.toggleUploadZonePanel(!1);let t=e.translator.getTranslation("misc","uploaded_image_size_alert");return t=t.replace("%minW",s.minW).replace("%minH",s.minH).replace("%maxW",s.maxW).replace("%maxH",s.maxH),a(t),!1}return!0},yt=t=>t.split(".").pop().toLowerCase().split("?")[0],xt=t=>t.split("/").pop(),wt=(t,e)=>{var i=[];if("group"==t.type){const e=t.getObjects();1===e.length?i=!0===t.colors||1===t.colors?["#000"]:t.colors:(i=[],e.forEach(t=>{t=b(t.fill);i.push(t.toHexString())}))}else{if(t.__editorMode)return["#000"];i=t.colorLinkGroup&&e.colorLinkGroups[t.colorLinkGroup]?e.colorLinkGroups[t.colorLinkGroup].colors:!0===t.colors||1===t.colors?["#000"]:t.colors}return i},Ct=t=>{let e=t.fill;return"string"==typeof e?e:"object"==typeof e?e.source?"url("+(e=e.source.src)+")":e[0]:!0===t.colors&&"group"===t.type?b(t.getObjects()[0].fill):!1===e&&t.colors&&t.colors[0]?t.colors[0]:void 0},St=function(s){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(isNaN(s)||"object"!=typeof r)return s;{var a=r.thousandSep||",",o=r.decimalSep||".";let t=s.toString().split("."),e=t[0],i=t[1],n="";if(void 0!==e){for(var l=e.length-1;0<=l;l--)n+=e.charAt(l);for((n=n.replace(/(\d{3})/g,"$1"+a)).slice(-a.length)==a&&(n=n.slice(0,-a.length)),e="",l=n.length-1;0<=l;l--)e+=n.charAt(l);void 0!==i&&0<i.length&&(1==i.length&&(i+="0"),e+=o+i)}return e=(r.currency||"&#36;%d").replace("%d",e.toString())}};"undefined"!=typeof window&&(window.FPDUtils={},window.FPDUtils.showModal=function(){a(...arguments)},window.FPDUtils.showMessage=function(){l(...arguments)},window.FPDUtils.isUrl=pt,window.FPDUtils.pixelToUnit=c,window.FPDUtils.unitToPixel=ht);class Et{static defaults={imageLoadTimestamp:!1,stageWidth:900,stageHeight:600,editorMode:!1,editorBoxParameters:["left","top","angle","fill","width","height","fontSize","price"],fonts:[{name:"Arial"},{name:"Lobster",url:"google"}],facebookAppId:"",instagramClientId:"",instagramRedirectUri:"",instagramTokenUri:"",hexNames:{},selectedColor:"#f5f5f5",boundingBoxColor:"#2185d0",outOfBoundaryColor:"#990000",replaceInitialElements:!1,fileServerURL:null,responsive:!0,cornerIconColor:"#000000",langJSON:{},colorPickerPalette:[],actions:{left:["info","download","print","preview-lightbox","reset-product"],center:["undo","redo"],right:["zoom","ruler","guided-tour"]},mainBarModules:["products","images","text","designs","manage-layers"],initialActiveModule:"",maxValues:{},watermark:!1,priceFormat:{currency:"&#36;%d",decimalSep:".",thousandSep:","},mainBarContainer:!1,modalMode:!1,keyboardControl:!0,deselectActiveOnOutside:!0,uploadZonesTopped:!0,loadFirstProductInStage:!0,unsavedProductAlert:!1,hideDialogOnAdd:!0,toolbarPlacement:"smart",snapGridSize:[50,50],fabricCanvasOptions:{},namesNumbersDropdown:[],namesNumbersEntryPrice:0,colorSelectionPlacement:"",bulkVariationsPlacement:"",bulkVariations:{},toolbarDynamicContext:"body",boundingBoxProps:{strokeWidth:1},fitImagesInCanvas:!1,maxPrice:-1,inCanvasTextEditing:!0,openTextInputOnSelect:!1,designCategories:[],optionalView:!1,saveActionBrowserStorage:!0,pricingRules:[],uploadAgreementModal:!1,imageEditorSettings:{masks:[]},printingBox:null,printingBox:{},autoOpenInfo:!1,guidedTour:null,replaceColorsInColorGroup:!1,allowedImageTypes:["jpeg","png","svg","pdf"],pixabayApiKey:"",pixabayHighResImages:!1,pixabayLang:"en",sizeTooltip:!1,highlightEditableObjects:"",applyFillWhenReplacing:!0,applySizeWhenReplacing:!1,layouts:[],dynamicViewsOptions:{unit:"mm",formats:[],pricePerArea:0,minWidth:0,minHeight:0,maxWidth:1e4,maxHeight:1e4},enableDynamicViews:!1,disableTextEmojis:!1,smartGuides:!0,usePrintingBoxAsBounding:!1,productsJSON:null,designsJSON:null,customizationRequiredRule:"any",swapProductConfirmation:!1,textLinkGroupProps:[],textTemplates:[],multiSelection:!1,multiSelectionColor:"#54dfe6",canvasHeight:"auto",maxCanvasHeight:.8,mobileGesturesBehaviour:"none",imageQualityRatings:null,splitMultiSVG:!1,cornerControlsStyle:"advanced",downloadFilename:"Product",autoFillUploadZones:!1,dragDropImagesToUploadZones:!1,responsiveBreakpoints:{small:768,medium:1024},dynamicDesigns:{},customTextAsTextbox:!1,viewThumbnailsWrapper:"",rulerUnit:"px",rulerPosition:"canvas",rulerFixed:!1,aiService:{serverURL:null,removeBG:!0,superRes:!0,text2Img:!0},cropMasks:[],industry:{type:null,opts:{}},elementParameters:{objectCaching:!1,z:-1,price:0,colors:!1,removable:!1,draggable:!1,rotatable:!1,resizable:!1,copyable:!1,zChangeable:!1,boundingBox:!1,boundingBoxMode:"clipping",autoCenter:!1,replace:"",replaceInAllViews:!1,autoSelect:!1,topped:!1,colorPrices:{},colorLinkGroup:!1,patterns:[],sku:"",excludeFromExport:!1,showInColorSelection:!1,locked:!1,uniScalingUnlockable:!1,fixed:!1,shadowColor:"",shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,colorLink3DLayer:!1,originX:"center",originY:"center",cornerSize:24,fill:!1,lockUniScaling:!0,pattern:!1,top:0,left:0,angle:0,flipX:!1,flipY:!1,opacity:1,scaleX:1,scaleY:1},textParameters:{maxLength:0,curved:!1,curvable:!1,curveRadius:80,maxCurveRadius:400,curveReverse:!1,maxLines:0,textBox:!1,textPlaceholder:!1,numberPlaceholder:!1,letterSpacing:0,chargeAfterEditing:!1,minFontSize:1,textTransform:"none",widthFontSize:0,maxFontSize:200,textLinkGroup:"",strokeColors:[],neonText:!1,editable:!0,fontFamily:"Arial",fontSize:18,lineHeight:1,fontWeight:"normal",fontStyle:"normal",textDecoration:"normal",padding:10,textAlign:"left",stroke:null,strokeWidth:0,charSpacing:0},imageParameters:{uploadZone:!1,filter:null,scaleMode:"fit",resizeToW:0,resizeToH:0,advancedEditing:!1,uploadZoneMovable:!1,uploadZoneRemovable:!1,padding:0,minScaleLimit:.01},customImageParameters:{minW:100,minH:100,maxW:1e4,maxH:1e4,minDPI:72,maxSize:10,autoCenter:!0},customTextParameters:{autoCenter:!0,copyable:!0},customAdds:{designs:!0,uploads:!0,texts:!0,drawing:!0},qrCodeProps:{autoCenter:!0,draggable:!0,removable:!0,resizable:!0}};static merge(){return h(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},1<arguments.length&&void 0!==arguments[1]?arguments[1]:{})}static getParameterKeys(){var t=Object.keys(this.defaults.elementParameters),e=Object.keys(this.defaults.imageParameters),i=Object.keys(this.defaults.textParameters);return(t=t.concat(e)).concat(i)}}function Tt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function At(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}window&&(window.FPDOptions=Et);var It=new WeakSet,Ot=new WeakSet,kt=new WeakSet,Mt=new WeakSet;class Pt{constructor(t){Tt(this,Mt),Tt(this,kt),Tt(this,Ot),Tt(this,It),this.fpdInstance=t,u(t,["elementModify","productCreate","elementAdd","elementRemove","viewCreate","viewRemove","elementFillChange","textLinkApply"],this.doPricingRules.bind(this))}doPricingRules(t){const a=this.fpdInstance.mainOptions.dynamicViewsOptions?this.fpdInstance.mainOptions.dynamicViewsOptions.unit:"mm";this.fpdInstance.pricingRulesPrice=0;var e=this.fpdInstance.mainOptions.pricingRules;e&&0<e.length&&e.forEach(i=>{var n,s,r;i.property&&i.target&&(n=[],"canvasSize"==i.property||"coverage"==i.property?n=this.fpdInstance.viewInstances:void 0!==i.target.elements&&"#"===i.target.elements.charAt(0)?n.push(this.fpdInstance.currentViewInstance.fabricCanvas.getElementByTitle(i.target.elements.replace("#",""),i.target.views)):n=void 0!==i.target.elements&&-1!==i.target.elements.search("custom")?this.fpdInstance.getCustomElements(i.target.elements.replace("custom","").toLowerCase(),i.target.views,!1):this.fpdInstance.getElements(i.target.views,i.target.elements,!1),n=n.filter(t=>!t.uploadZone),r=!1,-1!==["elementsLength","colorsLength"].indexOf(i.property)&&(r=!0),n.forEach((t,e)=>{!t||r&&0<e||(t.hasOwnProperty("element")&&(t=t.element),"textLength"===i.property?s=t.text?t.text.replace(/\s/g,"").length:null:"linesLength"===i.property&&(s=t.text?t.text.split("\n").length:null),"fontSize"===i.property?s=t.text?t.fontSize:null:"imageSize"===i.property?s="image"===t.getType()&&t.title?{width:t.width,height:t.height}:null:"imageSizeScaled"===i.property?s="image"===t.getType()&&t.title?{width:t.width*t.scaleX,height:t.height*t.scaleY}:null:"canvasSize"===i.property?s={width:c(t.options.stageWidth,a),height:c(t.options.stageHeight,a)}:"coverage"===i.property?s=At(this,Mt,Bt).call(this,t):"pattern"===i.property?s=t.pattern:"elementsLength"===i.property?s=n.length:"colorsLength"===i.property&&(s=this.fpdInstance.getUsedColors(i.target.views).length),null!=s&&(i.rules.forEach(t=>{t.property=s}),"any"===i.type?i.rules.some(At(this,It,_t).bind(this)):i.rules.forEach(At(this,It,_t).bind(this))))}))}),this.fpdInstance.calculatePrice()}}function _t(t,e){return!!At(this,Ot,Dt).call(this,t.operator,t.property,t.value)&&("number"==typeof t.price&&(this.fpdInstance.pricingRulesPrice+=t.price),!0)}function Dt(e,i,n){var t,s;return"object"==typeof n?(t=Object.keys(n),s=null,t.forEach(t=>{!1!==s&&(s=At(this,kt,Lt).call(this,e,i[t],n[t]))}),s):At(this,kt,Lt).call(this,e,i,n)}function Lt(t,e,i){return"="===t?e===i:">"===t?i<e:"<"===t?e<i:">="===t?i<=e:"<="===t?e<=i:void 0}function Bt(t){if(!t||!t.fabricCanvas||!M(t.options.printingBox,["left","top","width","height"]))return null;let e,i,n,s,r=(t.fabricCanvas.forEachObject(t=>{!t.excludeFromExport&&!t._ignore&&(t=t.getBoundingRect(!0),(void 0===e||t.left<e)&&(e=t.left),(void 0===i||t.top<i)&&(i=t.top),(void 0===n||t.left+t.width>n)&&(n=t.left+t.width),void 0===s||t.top+t.height>s)&&(s=t.top+t.height)}),{});var a,o;return e&&(r={minX:e,minY:i,maxX:n,maxY:s}),M(r,["minX","minY","maxX","maxY"])?(t=t.options.printingBox,a=Math.max(t.left,r.minX),a=Math.min(t.left+t.width,r.maxX)-a,o=Math.max(t.top,r.minY),a*(Math.min(t.top+t.height,r.maxY)-o)/(t.width*t.height)*100):null}var Ft,jt,Rt,Nt,Ht,zt,k=Zo(777),t=(t,e,i,n,s)=>{n=n||{},t.save(),t.translate(e,i),t.rotate(k.fabric.util.degreesToRadians(s.angle)),t.fillStyle=n.cornerColor||s.cornerColor,t.beginPath(),t.roundRect?t.roundRect(-3,-7.5,6,15,4):t.rect(-3,-7.5,6,15),t.filter="drop-shadow(0px 0px 2px rgba(0,0,0, 0.3))",t.fill(),t.restore()},Wt=(t,e,i,n,s)=>{n=n||{},t.save(),t.translate(e,i),t.rotate(k.fabric.util.degreesToRadians(s.angle)),t.fillStyle=n.cornerColor||s.cornerColor,t.beginPath(),t.roundRect?t.roundRect(-7.5,-3,15,6,4):t.rect(-7.5,-3,15,6),t.filter="drop-shadow(0px 0px 2px rgba(0,0,0, 0.3))",t.fill(),t.restore()};k.fabric.Control.prototype.touchSizeX=40,k.fabric.Control.prototype.touchSizeY=40,k.fabric.Object.prototype.transparentCorners=!1,k.fabric.Object.prototype.controls.ml.render=t,k.fabric.Object.prototype.controls.mr.render=t,k.fabric.Object.prototype.controls.mt.render=Wt,k.fabric.Object.prototype.controls.mb.render=Wt,k.fabric.Textbox.prototype.controls.ml.render=t,k.fabric.Textbox.prototype.controls.mr.render=t,k.fabric.Object.prototype.controls.bl.visible=!1,k.fabric.Object.prototype.controls.mtr.withConnection=!1,k.fabric.Object.prototype.controls.mtr.y=.5,k.fabric.Object.prototype.controls.mtr.offsetY=25,k.fabric.Object.prototype.controls.mtr.offsetX=-8,k.fabric.Object.prototype.controls.tl.render=k.fabric.Object.prototype.controls.tr.render=k.fabric.Object.prototype.controls.mtr.render=k.fabric.Object.prototype.controls.br.render=function(t,e,i,n,s){k.fabric.controlsUtils.renderCircleControl.call(this,t,e,i,n,s)},k.fabric.Object.prototype.controls.cropMaskDoneControl=new k.fabric.Control({x:.5,y:-.5,actionName:"crop-mask-done",offsetY:-20,offsetX:-45,cursorStyle:"pointer",mouseDownHandler:function(t,e){e.target.targetElement},render:(t,e,i,n,s)=>{"crop-mask"===s.name&&(n.cornerColor="#2ecc71",n.cornerIconColor="#fff")},cornerSize:24}),k.fabric.Object.prototype.controls.cropMaskCancelControl=new k.fabric.Control({x:.5,y:-.5,actionName:"crop-mask-cancel",offsetY:-20,offsetX:-12,cursorStyle:"pointer",mouseDownHandler:function(t,e){e=e.target;e.targetElement&&(e.canvas.removeElement(e),e.targetElement.cropMask=null)},render:(t,e,i,n,s)=>{"crop-mask"===s.name&&(n.cornerColor="#c44d56",n.cornerIconColor="#fff")},cornerSize:24});const Vt=()=>{function r(t,e,i,n,s,r,a){var o=7<arguments.length&&void 0!==arguments[7]?arguments[7]:8,l=8<arguments.length&&void 0!==arguments[8]?arguments[8]:8,c=(s=s||{},t.sizeX||s.cornerSize||r.cornerSize),t=t.sizeY||s.cornerSize||r.cornerSize,h=c/2,d=t/2,u=.6*c,p=s.cornerIconColor||r.cornerIconColor||"#000000";e.save(),e.translate(i,n),e.rotate(k.fabric.util.degreesToRadians(r.angle)),e.fillStyle=s.cornerColor||r.cornerColor,e.beginPath(),e.roundRect?e.roundRect(-h+o,-d+l,c,t,4):e.rect(-h+o,-d+l,c,t),e.filter="drop-shadow(0px 0px 2px rgba(0,0,0, 0.3))",e.fill(),e.font=u+"px FontFPD",e.fillStyle=p,e.textAlign="left",e.textBaseline="top",e.filter="none",e.fillText(a,-.5*u+o,-.5*u+l),e.restore()}k.fabric.Object.prototype.controls.tl.cursorStyleHandler=()=>"pointer",k.fabric.Object.prototype.controls.tl.mouseDownHandler=function(t,e){e=e.target;"advanced"===e.canvas.viewOptions.cornerControlsStyle&&e.canvas.duplicateElement(e)},k.fabric.Object.prototype.controls.tl.actionHandler=null,k.fabric.Object.prototype.controls.tl.render=function(t,e,i,n,s){r(this,t,e,i,n,s,String.fromCharCode("0xe94d"),-8,-8)},k.fabric.Object.prototype.controls.tr.cursorStyleHandler=()=>"pointer",k.fabric.Object.prototype.controls.tr.mouseDownHandler=function(t,e){e=e.target;e.canvas.removeElement(e)},k.fabric.Object.prototype.controls.tr.actionHandler=null,k.fabric.Object.prototype.controls.tr.render=function(t,e,i,n,s){r(this,t,e,i,n,s,String.fromCharCode("0xe907"),8,-8)},k.fabric.Object.prototype.controls.mtr.render=function(t,e,i,n,s){r(this,t,e,i,n,s,String.fromCharCode("0xe957"))},k.fabric.Object.prototype.controls.br.render=function(t,e,i,n,s){r(this,t,e,i,n,s,String.fromCharCode("0xe922"))}};k.fabric.Group.prototype.changeObjectColor=function(t,e){let i=[];return this.getObjects().forEach(t=>{t=b(t.fill);i.push(t.toHexString())}),i[t]=e,this.changeColor(i),i},k.fabric.Text.prototype.initialize=(Ft=k.fabric.Text.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Ft.call(this,...e),this._TextInit(),this}),k.fabric.Text.prototype.toImageSVG=function(t){var e=this.clipPath;this.clipPath=null;let i=1;if(this?.canvas?.viewOptions?.printingBox&&this?.canvas?.viewOptions?.output){const t=Math.ceil(25.4*this.canvas.viewOptions.printingBox.width/this.canvas.viewOptions.output.width);i=parseInt(300/t)}let n=this.width,s=this.height;this.curved&&this.set("shadow",{color:"rgba(0,0,0,0)",blur:100,offsetX:0,offsetY:0}),this.shadow?.color&&(r=this.shadow,n+=2*(Math.abs(r.offsetX)+r.blur),s+=2*(Math.abs(r.offsetY)+r.blur));var r=this.toDataURL({withoutShadow:!1,withoutTransform:!0,multiplier:i,enableRetinaScaling:!1});return this.clipPath=e,this._createBaseSVGMarkup([`<image href="${r}" width="${n}" height="${s}" x="${-n/2}" y="${-s/2}" style="scale: ${1/this.scaleX} ${1/this.scaleY}"/>`],{reviver:t[0],noStyle:!0,withShadow:!1})},k.fabric.Text.prototype.toSVG=(Nt=k.fabric.Text.prototype.toSVG,function(){for(var t=arguments.length,A=new Array(t),e=0;e<t;e++)A[e]=arguments[e];if(this.canvas.printMode&&(this.curved&&this.path||1!=this.opacity||this.shadow?.color||this.pattern))return this.toImageSVG(A);if(this.curved&&this.path){let e=this.fontFamily.replace(/"/g,"'"),i=this.fontSize,t=this.fontStyle,n=this.fontWeight,s=this.fill,r=this.letterSpacing/10*i,a=this.textDecoration,o=this.opacity,l=this.stroke,c=this.strokeWidth,h=this.path,d=h.fill||"none",u=h.stroke||"none",p=h.strokeWidth||0,f=h.visible?"block":"none",g=this.path.path,m=k.fabric.util.getPathSegmentsInfo(g),v=m[m.length-1].length,b=(g="right"===this.pathSide?function(e){var i=[],n=e=>{var t,i=[];for(let t=0;t<e.length;t+=2)i.push([e[t],e[t+1]]);return t=i.pop(),i.reverse(),[i,t]},t="z"===e[e.length-1][0].toLowerCase(),s=(t&&(e=function(t){var e=t.length,i="Z"===t[e-1][0],[n,s]=[(n=t[0])[1],n[2]],r=(e=i?t[e-2]:t[e-1]).length,[e,r]=[e[r-2],e[r-1]];return!i||n===e&&s===r||(t.pop(),t.push(["L",n,s],["Z"])),path}(e)).pop(),e[e.length-1]),r=s.length,s=t?e[0]:["M",s[r-2],s[r-1]];i.push(s),e.reverse();for(let t=1;t<e.length;t++){var a=e[t].slice(1),o=e[t-1],l=o[0],[o,,]=n(o.slice(1)),[,a]=n(a),o=o.flat().concat(a);i.push([l,...o])}return t&&i.push(["z"]),i}(g=JSON.parse(JSON.stringify(g))):g).flat().join(" "),y=Math.random().toString(36).substr(2,9),x="auto",w=this.pathStartOffset,C=0,S=("center"===this.pathAlign?x="middle":"baseline"===this.pathAlign?x="auto":"ascender"===this.pathAlign?x="hanging":"descender"===this.pathAlign&&(x="auto",C=i/100*-22),"start");"center"==this.textAlign&&(S="middle",w+=v/2),"right"==this.textAlign&&(S="end",w+=v);let E="",T=w;for(let t=0;t<this.text.length;t++){var I=this.text[t],O=`<textPath
xlink:href="#textOnPath${y}"
startOffset="${T<0?T+v:T}"
dominant-baseline="${x}"
dy="${C}"
style="
stroke: ${l};
stroke-width: ${c};
"
>
${I}
</textPath>`;T+=new k.fabric.Text(I,{fontFamily:e,fontSize:i}).width+1+r,E+=O}return this._createBaseSVGMarkup(this.path?.path?[d&&"none"!==d||!u&&"none"!==u?`<path id="textOnPath${y}" display="${f}" fill="${d}" stroke="${u}" stroke-width="${p}" d="${b}" style="display: none"/>`:`<defs>
<path id="textOnPath${y}" d="${b}" />
</defs>`,`<text
font-family="${e.replace(/"/g,"'")}"
fill="${s}"
font-size="${i}"
font-style="${t}"
font-weight="${n}"
letter-spacing="${r}"
style="
text-decoration: ${a};
opacity: ${o};
"
>
${E}
</text>`]:[`<text
xml:space="preserve"
font-family="${e}"
font-size="${i}"
font-style="${t}"
font-weight="${n}"
>
${this.addPaintOrder()}
${this.text}
</text>`],{reviver:A[0],noStyle:!0,withShadow:!0})}return Nt.call(this,...A)}),k.fabric.Text.prototype._constrainScale=(Rt=k.fabric.Text.prototype._constrainScale,function(t){return t=Rt.call(this,t),void 0!==this.minFontSize&&parseFloat(Number(t*this.fontSize).toFixed(0))<this.minFontSize?this.minFontSize/this.fontSize:void 0!==this.maxFontSize&&parseFloat(Number(t*this.fontSize).toFixed(0))>this.maxFontSize?this.maxFontSize/this.fontSize:t}),k.fabric.Text.prototype._TextInit=function(){this.on({modified:t=>{var e,i;(e=this).curved||e.uniScalingUnlockable||(i=e.fontSize*e.scaleX,i=parseFloat(Number(i).toFixed(0)),e.scaleX=1,e.scaleY=1,e._clearCache(),e.set("fontSize",i),e.canvas&&e.canvas.fire("elementModify",{element:e,options:{fontSize:i}}))}})},k.fabric.Text.prototype._createTextCharSpan=function(t,e,i,n){e.fontWeight=this.fontWeight,e.fontStyle=this.fontStyle;var s=t!==t.trim()||t.match(/  +/g),s=this.getSvgSpanStyles(e,s);let r=(s+="underline"===this.textDecoration?" text-decoration: underline;":"")?'style="'+s+'"':"",a=e.deltaY,o="",l=k.fabric.Object.NUM_FRACTION_DIGITS;return a&&(o=' dy="'+k.fabric.util.toFixed(a,l)+'" '),['<tspan x="',k.fabric.util.toFixed(i,l),'" y="',k.fabric.util.toFixed(n,l),'" ',o,r,">",k.fabric.util.string.escapeXml(t),"</tspan>"].join("")},k.fabric.Text.prototype._renderChars=(jt=k.fabric.Text.prototype._renderChars,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];jt.call(this,...e),this.canvas&&this.canvas.lowerCanvasEl.setAttribute("dir","ltr")});function Ut(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:0,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:0,s=1,r=0!==(i="number"!=typeof i?0:i),a=0!==(n="number"!=typeof n?0:n),s="cover"===(4<arguments.length&&void 0!==arguments[4]?arguments[4]:"fit")?i-t<n-e?r?Math.max(i/t,n/e):1:a?Math.max(i/t,n/e):1:e<t?r?Math.min(i/t,n/e):1:a?Math.min(i/t,n/e):1;return parseFloat(s.toFixed(10))}window&&(window.FPDFabricUtils={getScaleByDimesions:Ut}),k.fabric.IText.prototype.initialize=(zt=k.fabric.IText.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return zt.call(this,...e),this._ITextInit(),this}),k.fabric.IText.prototype._ITextInit=function(){this.on({added:()=>{this.setCurvedTextPath()},"editing:entered":()=>{this.canvas.viewOptions.inCanvasTextEditing||this.exitEditing(),this.curved&&this.exitEditing()},changed:()=>{var t;if(0!=this.maxLines&&this.textLines.length>this.maxLines&&(t=this.textLines.slice(0,this.maxLines),this.set("text",t.join("\n")),this.exitEditing()),0!=this.maxLength&&this.text.length>this.maxLength&&(this.set("text",this.text.substr(0,this.maxLength)),this.exitEditing()),this.canvas.viewOptions.disableTextEmojis){let t=this.text.replace(FPDEmojisRegex,"");t=t.replace(String.fromCharCode(65039),""),this.set("text",t)}if(this.widthFontSize){let t;(t=this.width>this.widthFontSize?this.fontSize*(this.widthFontSize/(this.width+1)):this.fontSize*(this.widthFontSize/(this.width-1)))<this.minFontSize?t=this.minFontSize:t>this.maxFontSize&&(t=this.maxFontSize),t=parseInt(t),this.set("fontSize",t)}}})},k.fabric.IText.prototype.setCurvedTextPath=function(){var t;this.curved&&(t=new k.fabric.Path("M0,0m"+-(t=this.curveRadius)+",0a"+t+","+t+" 0 1,0 "+2*t+",0a"+t+","+t+" 0 1,0 "+2*-t+",0",{fill:"transparent",strokeWidth:1,stroke:"rgba(0,0,0, 0.1)",visible:!1}),this.set("path",t),this.setCurvedTextPosition())},k.fabric.IText.prototype.setCurvedTextPosition=function(){var t;this.curved&&this.path&&(this.pathSide=this.curveReverse?"left":"right",t=this.curveReverse?Math.PI*this.curveRadius*2*.25:Math.PI*this.curveRadius/2,this.pathStartOffset=t-this.calcTextWidth()/2,this.pathAlign="center")},k.fabric.Textbox.prototype.initialize=(Ht=k.fabric.Textbox.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Ht.call(this,...e),this._TextboxInit(),this}),k.fabric.Textbox.prototype._TextboxInit=function(){this.on({added:()=>{var t;this._calcWidth&&(this.set("width",1e3),t=this.calcTextWidth(),this.set("width",t),delete this._calcWidth)}})};var Yt,qt,Gt,Xt=k.fabric.util.createClass(k.fabric.Group,{type:"neon-text",text:"",fontFamily:"Arial",fontSize:40,lineHeight:1,charSpacing:0,textAlign:"left",initialize:function(i,n){n=n||{},this.text=i,this.texts=[],[{color:"#fff",offsetX:0,offsetY:0,blur:5},{color:"#fff",offsetX:0,offsetY:0,blur:10},{color:n.fill,offsetX:0,offsetY:0,blur:40},{color:n.fill,offsetX:0,offsetY:0,blur:80}].forEach((t,e)=>{t=new k.fabric.IText(i,{left:0,top:0,originX:"center",originY:"center",fontSize:n.fontSize,fontFamily:n.fontFamily,fill:"#fff",shadow:new k.fabric.Shadow(t)});this.texts.push(t)}),this.callSuper("initialize",this.texts,n)},set:function(e,i){["fill","fontFamily","text","fontSize","lineHeight","charSpacing","textAlign"].includes(e)&&this.texts.forEach(t=>{"text"!=e&&"fill"==e?(this.texts[2].shadow.color=i,this.texts[3].shadow.color=i):t[e]=i}),setTimeout(()=>{this.width=this.texts[0].width,this.height=this.texts[0].height,this.canvas&&this.canvas.renderAll()},10),this.callSuper("set",e,i)}}),Wt=(k.fabric.NeonText=Xt,k.fabric.NeonText.fromObject=function(t,e){return k.fabric.Object._fromObject("NeonText",t,e)},k.fabric.Object.propertiesToInclude=["_isInitial","lockMovementX","lockMovementY","lockRotation","lockScalingX","lockScalingY","lockScalingFlip","lockUniScaling","resizeType","boundingBox","boundingBoxMode","selectable","evented","title","editable","cornerColor","cornerIconColor","borderColor","isEditable","hasUploadZone","cornerSize","source","_optionsSet"],k.fabric.Object.prototype._limitModifyOpts={},k.fabric.Object.prototype.__editorMode=!1,k.fabric.Object.prototype.initialize=(Yt=k.fabric.Object.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Yt.call(this,...e),this._elementInit(),this}),k.fabric.Object.prototype._elementInit=function(){this.on({added:()=>{!this.isCustom||this.hasUploadZone||this.replace||(this.copyable=this.originParams.copyable=!0)},moving:()=>{this._checkContainment()},rotating:()=>{this._checkContainment()},scaling:()=>{this._checkContainment()},selected:()=>{this._elementControls()}})},k.fabric.Object.prototype._elementControls=function(){let t=Boolean(!this.lockUniScaling||this.__editorMode),e=Boolean(!this.lockUniScaling||this.__editorMode),i=Boolean(this.copyable||this.__editorMode),n=Boolean(this.removable||this.__editorMode),s=Boolean((this.resizable||this.__editorMode)&&!this.curved),r=Boolean(this.rotatable||this.__editorMode);this.textBox&&!this.curved&&(t=!0),this.canvas&&"basic"==this.canvas.viewOptions.cornerControlsStyle&&(this.controls.mtr.offsetX=0,this.cornerSize=16),"printing-boxes"!=this.name&&"view-mask"!=this.name||(t=!1,e=!1,r=!1,i=!1,n=!1),this.setControlsVisibility({ml:t,mr:t,mt:e,mb:e,tr:n,tl:i,mtr:r,br:s})},k.fabric.Object.prototype._checkContainment=function(){var t,e,i,n,s;this.canvas&&this.canvas.currentBoundingObject&&!this.hasUploadZone&&(this.setCoords(),"limitModify"===this.boundingBoxMode?(t=this.getBoundingRect(),s=(i=this.canvas.currentBoundingObject.getBoundingRect()).left,n=i.left+i.width-t.width,e=i.top,i=i.top+i.height-t.height,this.isContainedWithinObject(this.canvas.currentBoundingObject)?(this._limitModifyOpts={left:this.left,top:this.top,angle:this.angle,scaleX:this.scaleX,scaleY:this.scaleY},"text"==this.getType()&&(this._limitModifyOpts.fontSize=this.fontSize,this._limitModifyOpts.lineHeight=this.lineHeight,this._limitModifyOpts.charSpacing=this.charSpacing)):(t.left>s&&t.left<n&&(this._limitModifyOpts.left=this.left),t.top>e&&t.top<i&&(this._limitModifyOpts.top=this.top),this.setOptions(this._limitModifyOpts))):"inside"!==this.boundingBoxMode&&"clipping"!==this.boundingBoxMode||(s=this.isOut,(n=!this.isContainedWithinObject(this.canvas.currentBoundingObject))?("inside"===this.boundingBoxMode&&(this.borderColor=this.canvas.viewOptions.outOfBoundaryColor),this.isOut=!0):("inside"===this.boundingBoxMode&&(this.borderColor=this.canvas.viewOptions.selectedColor),this.isOut=!1),s!=this.isOut&&null!=s&&(n?this.canvas.fire("elementOut",{target:this}):this.canvas.fire("elementIn",{target:this})),this.canvas.fire("elementCheckContainemt",{target:this,boundingBoxMode:this.boundingBoxMode})))},k.fabric.Object.prototype._clipElement=function(){var t=this.getClippingObject();t&&(t.type?t.clone(t=>{t.set({absolutePositioned:!0,opacity:1}),this.clipPath=t}):(t=new k.fabric.Rect({originX:"left",originY:"top",angle:t.angle||0,left:t.left,top:t.top,width:t.width,height:t.height,fill:"#DDD",absolutePositioned:!0,rx:t.borderRadius,ry:t.borderRadius}),this.clipPath=t),this.canvas.renderAll())},k.fabric.Object.prototype.getType=function(t){return"text"===(t=t||this.type)||"i-text"===t||"textbox"===t||"neon-text"===t||"engraved-text"===t?"text":"image"},k.fabric.Object.prototype.isSVG=function(){return"group"===this.type||"path"===this.type||this.source&&this.source.includes(".svg")},k.fabric.Object.prototype.isColorizable=function(){return"text"===this.getType()?"text":!!this.source&&(1==this.source.split(".").length?this.source.includes("data:image/png;")?"dataurl":this.fill=this.colors=!1:this.source.replace(/\?.*$/,"").includes(".png")||this.isSVG()?this.isSVG()?"svg":"png":this.fill=this.colors=!1)},k.fabric.Object.prototype.isBitmap=function(){return"image"===this.type},k.fabric.Object.prototype.hasColorSelection=function(){return(Array.isArray(this.colors)||Boolean(this.colors)||this.colorLinkGroup||this.__editorMode)&&!1!==this.isColorizable()},k.fabric.Object.prototype.checkEditable=function(t){return"object"==typeof(t=t||this).colors||!0===t.colors||1==t.colors||t.removable||t.draggable||t.resizable||t.rotatable||t.zChangeable||t.advancedEditing||t.editable||t.uploadZone||t.colorLinkGroup&&0<t.colorLinkGroup.length||t.__editorMode},k.fabric.Object.prototype.changeColor=function(t){let i=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];var e=this.isColorizable();if("string"==typeof t&&/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)&&(t=b(t).toHexString()),"text"===this.getType())"object"==typeof t&&(t=t[0]),this.set("fill",t),this.canvas.renderAll(),this.pattern=null;else if("group"==this.type&&"object"==typeof t){const i=this.getObjects();t.forEach((t,e)=>{i[e]&&i[e].set("fill",t)}),this.canvas.renderAll(),this.svgFill=t,delete this.fill}else"string"!=typeof(t="object"==typeof t?t[0]:t)&&(t=!1),"png"!=e&&"dataurl"!=e||!t?"svg"==e&&(this.set("fill",t),this.canvas.renderAll()):(this.filters=[],this.filters.push(new k.fabric.Image.filters.BlendColor({mode:"tint",color:t})),this.applyFilters(),this.canvas.renderAll(),this.fill=t);this.canvas.fire("elementFillChange",{element:this,colorLinking:i})},k.fabric.Object.prototype.setPattern=function(t){t&&(this.canvas.proxyFileServer&&(t=this.canvas.proxyFileServer+t),k.fabric.util.loadImage(t,t=>{var e;if(this.isSVG())if(this.hasOwnProperty("getObjects"))for(var i=this.getObjects(),n=0;n<i.length;++n)i[n].set("fill",new k.fabric.Pattern({source:t,repeat:"repeat"}));else this.set("fill",new k.fabric.Pattern({source:t,repeat:"repeat"}));else"text"==this.getType()?this.set("fill",new k.fabric.Pattern({source:t,repeat:"repeat"})):(e=this.fill||this.colors[0],this.set("fill",e=e||"#000000"));this.canvas.renderAll(),this.canvas.fire("elementFillChange",{element:this})}),this.pattern=t)},k.fabric.Object.prototype.getZIndex=function(){return this.canvas.getObjects().indexOf(this)},k.fabric.Object.prototype.centerElement=function(){let t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=this.getBoundingBoxCoords(),n=this.left,s=this.top;t&&(n=i?i.cp?i.cp.x:i.left+.5*i.width:.5*this.canvas.viewOptions.stageWidth),e&&(s=i?i.cp?i.cp.y:i.top+.5*i.height:.5*this.canvas.viewOptions.stageHeight),this.setPositionByOrigin(new k.fabric.Point(n,s),"center","center"),this.canvas.renderAll(),this.setCoords(),this._checkContainment(),this.autoCenter=!1},k.fabric.Object.prototype.getBoundingBoxCoords=function(){if(this.boundingBox||this.uploadZone){if("object"==typeof this.boundingBox)return!!(this.boundingBox.hasOwnProperty("x")&&this.boundingBox.hasOwnProperty("y")&&this.boundingBox.width&&this.boundingBox.height)&&{left:this.boundingBox.x,top:this.boundingBox.y,width:this.boundingBox.width,height:this.boundingBox.height,borderRadius:this.boundingBox.borderRadius||0};var t,e=this.canvas.getElementByTitle(this.boundingBox);if(e)return{left:(t=e.getPointByOrigin("left","top")).x,top:t.y,width:e.width*e.scaleX,height:e.height*e.scaleY,angle:e.angle||0,cp:e.getCenterPoint()}}return!1},k.fabric.Object.prototype.getClippingObject=function(){if(this.boundingBox||this.uploadZone){if("object"==typeof this.boundingBox)return this.getBoundingBoxCoords();var t=this.canvas.getElementByTitle(this.boundingBox);if(t)return"image"==t.type?this.getBoundingBoxCoords():t}return!1},k.fabric.Object.prototype.getElementJSON=function(){let t=0<arguments.length&&void 0!==arguments[0]&&arguments[0],e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=(this.canvas&&(e=Object.keys(this.canvas.viewOptions.elementParameters),e="text"===this.getType()?e.concat(Object.keys(this.canvas.viewOptions.textParameters)):e.concat(Object.keys(this.canvas.viewOptions.imageParameters))),t&&(e=e.concat(k.fabric.Object.propertiesToInclude)),this.uploadZone&&(e.push("customAdds"),e.push("designCategories"),e.push("designCategories[]")),"text"===this.getType()&&(e.push("text"),e.push("_initialText")),"group"===this.type&&e.push("svgFill"),e.push("width"),e.push("height"),e.push("isEditable"),e.push("hasUploadZone"),e.push("evented"),e.push("isCustom"),e.push("currentColorPrice"),e.push("_isPriced"),e.push("originParams"),e.push("originSource"),e.push("_printingBox"),e.push("_optionsSet"),e.push("_isQrCode"),e.push("cropMask"),e.push("isCustomImage"),e=e.sort(),{});return e.forEach(t=>{void 0!==this[t]&&(i[t]=this[t])}),i},k.fabric.Object.prototype.alignToPosition=function(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"left",e=this.getPointByOrigin("left","top"),i=this.getBoundingBoxCoords(),n="left",s="top";"left"===t?(e.x=i?i.left:0,e.x+=this.padding+1):"top"===t?(e.y=i?i.top:0,e.y+=this.padding+1):"right"===t?(e.x=i?i.left+i.width-this.padding:this.canvas.viewOptions.stageWidth-this.padding,n="right"):(e.y=i?i.top+i.height-this.padding:this.canvas.viewOptions.stageHeight,s="bottom"),this.setPositionByOrigin(e,n,s),this.canvas.renderAll(),this._checkContainment()},k.fabric.Object.prototype.toggleUploadZone=function(){if(this.hasUploadZone&&this.canvas){let t=this.canvas.getObjects(),e=!0;for(var i=0;i<t.lenth;++i)if(t[i].replace==this.replace){e=!1;break}var n=this.canvas.getUploadZone(this.replace);n&&(n.set("opacity",e?1:0),n.evented=e),this.canvas.renderAll()}},Zo(106),fabric.Canvas.prototype.panCanvas=!1,fabric.Canvas.prototype.snapToObjects=!1,fabric.Canvas.prototype.snapToGrid=!1,fabric.Canvas.prototype.snapGridSize=[50,50],fabric.Canvas.prototype.enableRuler=!1,fabric.Canvas.prototype.rulerBg="rgba(0,0,0, 0.6)",fabric.Canvas.prototype.rulerTickColor="#ccc",k.fabric.Canvas.prototype.viewOptions={},k.fabric.Canvas.prototype.elements=[],k.fabric.Canvas.prototype.currentElement=null,k.fabric.Canvas.prototype.responsiveScale=1,k.fabric.Canvas.prototype.currentBoundingObject=null,k.fabric.Canvas.prototype.initialElementsLoaded=!1,k.fabric.Canvas.prototype.isCustomized=!1,k.fabric.Canvas.prototype.printingBoxObject=null,k.fabric.Canvas.prototype._canvasCreated=!1,k.fabric.Canvas.prototype.currentCurvedTextPath=!1,k.fabric.Canvas.prototype._doHistory=!1,k.fabric.Canvas.prototype.forbiddenTextChars=/<|>/g,k.fabric.Canvas.prototype.proxyFileServer="",k.fabric.Canvas.prototype.initialize=(Gt=k.fabric.Canvas.prototype.initialize,function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return Gt.call(this,...e),this._fpdCanvasInit(),this}),k.fabric.Canvas.prototype._onTouchStart=(qt=k.fabric.Canvas.prototype._onTouchStart,function(t){var e=this.findTarget(t);this.allowTouchScrolling&&!e&&!this.isDrawingMode||qt.call(this,t)}),k.fabric.Canvas.prototype._fpdCanvasInit=function(){if(!this.containerClass.includes("fpd-hidden-canvas")){let n=null;this.on({"after:render":()=>{this._canvasCreated||this._onCreated(),this.viewOptions&&this.viewOptions.highlightEditableObjects&&3<this.viewOptions.highlightEditableObjects.length&&(this.contextContainer.strokeStyle=this.viewOptions.highlightEditableObjects,this.forEachObject(t=>{t!==this.getActiveObject()&&!t.isMoving&&("text"===t.getType()&&t.editable||t.uploadZone)?(t=t.getBoundingRect(),this.contextContainer.setLineDash([5,15]),this.contextContainer.strokeRect(t.left,t.top,t.width,t.height)):this.contextContainer.setLineDash([])}))},"object:added":t=>{var{}=t;this._bringToppedElementsToFront()},"object:moving":t=>{t=t.target;n="moving",this.fire("elementChange",{type:"moving",element:t})},"object:rotating":t=>{t=t.target;n="rotating",this.fire("elementChange",{type:"rotating",element:t})},"object:scaling":t=>{t=t.target;n="scaling",this.fire("elementChange",{type:"scaling",element:t})},"object:modified":t=>{var t=t["target"],e=t;if(null!==n){var i={};switch(n){case"moving":i.left=Number(e.left),i.top=Number(e.top);break;case"scaling":"text"!==e.getType()||e.curved||e.uniScalingUnlockable?(i.scaleX=parseFloat(e.scaleX),i.scaleY=parseFloat(e.scaleY)):i.fontSize=parseInt(e.fontSize);break;case"rotating":i.angle=e.angle}this.fire("elementModify",{element:e,options:i})}n=null},"selection:created":t=>{t=t.selected;1==t.length?this._onSelected(t[0]):this._onMultiSelected(t)},"selection:updated":t=>{t=t.selected;1==t.length?this._onSelected(t[0]):this._onMultiSelected(t)},"selection:cleared":t=>{var{}=t;this.currentCurvedTextPath&&(this.currentCurvedTextPath.visible=!1,this.currentCurvedTextPath=null)},"mouse:down":t=>{t.target&&t.target.__corner&&"function"==typeof t.target.exitEditing&&t.target.exitEditing(),null==t.target&&this.deselectElement()},elementAdd:()=>{this.forEachObject(t=>{!t.clipPath&&(t.boundingBox&&"clipping"===t.boundingBoxMode||t.hasUploadZone)&&t._clipElement()})},"text:changed":t=>{t=t.target;this.fire("elementModify",{element:t,options:{text:t.text}})}})}},k.fabric.Canvas.prototype._onCreated=function(){var k;this._canvasCreated=!0;{var h=this,d=this.viewOptions.mobileGesturesBehaviour;let s,r,a,o,l=!1,c=null;h.on({"mouse:down":t=>{l=!0,t.e.touches&&(s=t.e.touches[0].clientX,r=t.e.touches[0].clientY,h.currentElement)&&(a=h.currentElement.scaleX,o=h.currentElement.scaleY)},"mouse:up":function(t){l=!1,c=null},"mouse:move":function(t){let e=null;var i,n;"pinchImageScale"!=d&&"pinchPanCanvas"!=d||!t.e.touches||2!=t.e.touches.length||(n=t.e.touches[0],i=t.e.touches[1],null===c&&(c=Math.sqrt(Math.pow(i.clientX-n.clientX,2)+Math.pow(i.clientY-n.clientY,2))),e=Math.sqrt(Math.pow(i.clientX-n.clientX,2)+Math.pow(i.clientY-n.clientY,2))/c),"pinchImageScale"==d&&null!==e&&h.currentElement&&"image"==h.currentElement.getType()&&h.currentElement.resizable?h.setElementOptions({scaleX:a*e,scaleY:o*e},h.currentElement):"pinchPanCanvas"==d&&t.e.touches&&null!==e?h.setResZoom(e):h.panCanvas&&(t.e.touches?1==t.e.touches.length&&(i=t.e.touches[0].clientX,n=t.e.touches[0].clientY,h.relativePan(new fabric.Point(i-s,n-r)),s=i,r=n):l&&h.relativePan(new fabric.Point(t.e.movementX,t.e.movementY)))}})}{var b=this;let v,s=b.getSelectionContext(),r=1,a="rgba(255,0,241,0.5)",o=1;function i(t){e(t-r,0,t-r,b.getHeight()/o)}function n(t){e(0,t-r,b.getWidth()/o,t-r)}function e(t,e,i,n){s.save(),s.lineWidth=r,s.strokeStyle=a,s.beginPath(),b.snapToGrid||s.setLineDash([5,10]),s.moveTo((t+v[4])*o,(e+v[5])*o),s.lineTo((i+v[4])*o,(n+v[5])*o),s.stroke(),s.restore()}function y(t,e){t=Math.round(t),e=Math.round(e);for(var i=t-4,n=t+4;i<=n;i++)if(i===e)return 1}var x=[],w=[];b.on("mouse:down",()=>{v=b.viewportTransform,o=b.getZoom()}),b.on("object:moving",t=>{let e=t.target,i=b.getObjects(),n=e.getCenterPoint(),s=n.x,r=n.y,a=e.getBoundingRect(),o=a.height/v[3],l=a.width/v[0],c=!1,h=!1,d=b._currentTransform;if(b.snapToGrid,b.snapToObjects&&!b.snapToGrid&&d){for(var u,p,f,g,m=i.length;m--;)i[m]!==e&&(u=(p=i[m].getCenterPoint()).x,p=p.y,f=(g=i[m].getBoundingRect()).height/v[3],g=g.width/v[0],y(u,s)&&(h=!0,x.push({x:u,y1:p<r?p-f/2-1:p+f/2+1,y2:p<r?r+o/2+1:r-o/2-1}),e.setPositionByOrigin(new fabric.Point(u,r),"center","center")),y(u-g/2,s-l/2)&&(h=!0,x.push({x:u-g/2,y1:p<r?p-f/2-1:p+f/2+1,y2:p<r?r+o/2+1:r-o/2-1}),e.setPositionByOrigin(new fabric.Point(u-g/2+l/2,r),"center","center")),y(u+g/2,s+l/2)&&(h=!0,x.push({x:u+g/2,y1:p<r?p-f/2-1:p+f/2+1,y2:p<r?r+o/2+1:r-o/2-1}),e.setPositionByOrigin(new fabric.Point(u+g/2-l/2,r),"center","center")),y(p,r)&&(c=!0,w.push({y:p,x1:u<s?u-g/2-1:u+g/2+1,x2:u<s?s+l/2+1:s-l/2-1}),e.setPositionByOrigin(new fabric.Point(s,p),"center","center")),y(p-f/2,r-o/2)&&(c=!0,w.push({y:p-f/2,x1:u<s?u-g/2-1:u+g/2+1,x2:u<s?s+l/2+1:s-l/2-1}),e.setPositionByOrigin(new fabric.Point(s,p-f/2+o/2),"center","center")),y(p+f/2,r+o/2))&&(c=!0,w.push({y:p+f/2,x1:u<s?u-g/2-1:u+g/2+1,x2:u<s?s+l/2+1:s-l/2-1}),e.setPositionByOrigin(new fabric.Point(s,p+f/2-o/2),"center","center"));c||(w.length=0),h||(x.length=0)}}),b.on("before:render",()=>{b.contextTop&&b.clearContext(b.contextTop)}),b.on("after:render",()=>{if(!b.panCanvas)if(b.snapToGrid){if(v=b.viewportTransform,o=b.getZoom(),b.snapGridSize){const v=Math.round(b.width/o/b.snapGridSize[0]);for(let t=0;t<v;++t)i(t*b.snapGridSize[0]);const e=Math.round(b.height/o/b.snapGridSize[1]);for(let t=0;t<e;++t)n(t*b.snapGridSize[1])}}else{for(var e=x.length;e--;)i(x[e].x);for(e=w.length;e--;)n(w[e].y);x.length=w.length=0}}),b.on("mouse:up",()=>{x.length=w.length=0,b.renderAll()})}(k=this).on("after:render",()=>{if(k.viewOptions&&k.enableRuler){const C=k.viewOptions.rulerUnit,S=k.viewOptions.rulerPosition,E=k.viewOptions.printingBox,T=k.getZoom(),A=k.getSelectionContext();if(A){var f=k.viewOptions.stageWidth,g=k.viewOptions.stageHeight,m=t=>{var t=t/10,e=Math.pow(10,Math.floor(Math.log10(t))),t=t/e;return 5<=t?5*e:2<=t?2*e:e};let t,e="cm"==C?10:1,i=1,n=1,s=("px"!=C&&M(E,["left","top","width","height"])&&M(k.viewOptions.output,["width","height"])?(t=k.viewOptions.output,i=t.width/E.width,n=t.height/E.height):e=1,20*T),r=20*T,a=0,o=0,l=k.width-r,c=0,h=f,d=g,u=f*i,p=g*n;"pb"==S&&t&&(a=E.left*T,o=(E.top-s)*T,h=E.width*T,l=(E.left+E.width)*T,c=E.top*T,d=E.height*T,u=t.width,p=t.height),A.fillStyle=k.rulerBg,A.fillRect(a,o,h,s);for(var v,b,y=0;y<=u;y+=m(u)){const w=y%100==0?s:s/3,I=y*T/i;A.fillRect(a+I,o,1,w),y%100==0&&(A.fillStyle=k.rulerTickColor,A.font="10px Arial",v=a+I,b=A.measureText(Math.round(y/e)),v+=0==y?2:-(b.width+2),A.fillText(Math.round(y/e)+(0==y?" "+C.toUpperCase():""),v,o+s-2))}A.fillStyle=k.rulerBg,A.fillRect(l,c,r,d);for(var x,w=0;w<=p;w+=m(p)){const y=w%100==0?r:r/3,O=w*T/n;A.fillRect(l,c+O,y,1),w%100==0&&(A.fillStyle=k.rulerTickColor,A.font="10px Arial",x=c+O,x+=0==w?12:-2,A.fillText(Math.round(w/e),l,x))}}}}),k.on("before:render",()=>{k.contextTop&&k.clearContext(k.contextTop)}),this._renderPrintingBox()},k.fabric.Canvas.prototype._onSelected=function(t){if("crop-mask"!==t.name){const t=this.getObjects().find(t=>"crop-mask"===t.name);t&&this.remove(t)}if(this.deselectElement(!1),this.dragStage)return this.deselectElement(),!1;this.currentElement=t,this.currentCurvedTextPath&&(this.currentCurvedTextPath.visible=!1),this.currentCurvedTextPath=t.path,this.currentCurvedTextPath&&(this.currentCurvedTextPath.visible=!0),this.fire("elementSelect",{element:t}),this.hoverCursor=t.draggable?"move":"pointer",t.boundingBox&&!t.uploadZone&&this._renderElementBoundingBox(t)},k.fabric.Canvas.prototype._onMultiSelected=function(t){const e=this.getActiveObject();this.viewOptions.multiSelection&&(e.set({lockScalingX:!Boolean(this.viewOptions.editorMode),lockScalingY:!Boolean(this.viewOptions.editorMode),lockRotation:!Boolean(this.viewOptions.editorMode),hasControls:Boolean(this.viewOptions.editorMode),borderDashArray:[8,8],cornerSize:24,transparentCorners:!1,borderColor:this.viewOptions.multiSelectionColor,borderScaleFactor:3}),t.forEach(t=>{(t.draggable||this.viewOptions.editorMode)&&t.evented||e.removeWithUpdate(t)}),e.setControlsVisibility({tr:!1,tl:!1,mtr:!1}),this.fire("multiSelect",{activeSelection:e}))},k.fabric.Canvas.prototype._renderElementBoundingBox=function(i){var e=this;this.currentBoundingObject&&(this.remove(this.currentBoundingObject),this.currentBoundingObject=null);function n(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;t&&(e.add(t),t.bringToFront(),e.fire("boundingBoxToggle",{currentBoundingObject:e.currentBoundingObject,state:!0}))}if(i&&(!i._printingBox||!this.viewOptions.printingBox.visibility)){var t=i.getBoundingBoxCoords();if(t&&"none"!=i.boundingBoxMode){let e={stroke:this.viewOptions.boundingBoxColor,strokeWidth:1,strokeLineCap:"square",strokeDashArray:[10,10],fill:!1,selectable:!1,evented:!1,name:"bounding-box",excludeFromExport:!0,_ignore:!0,rx:t.borderRadius,ry:t.borderRadius};e=h(e,this.viewOptions.boundingBoxProps),i.clipPath&&"rect"!=i.clipPath.type?i.clipPath&&i.clipPath.clone(t=>{e=h(e,{fill:"transparent"}),t.set(e),"group"==t.type&&t.forEachObject(t=>{t.set("fill","transparent")}),this.currentBoundingObject=t,n(this.currentBoundingObject),i._checkContainment()}):(e=h(e,{left:t.left,top:t.top,width:t.width,height:t.height,angle:t.angle||0,originX:"left",originY:"top"}),this.currentBoundingObject=new k.fabric.Rect(e),n(this.currentBoundingObject))}i._checkContainment()}},k.fabric.Canvas.prototype._renderPrintingBox=function(){var t;this.printingBoxObject&&(this.remove(this.printingBoxObject),this.printingBoxObject=null),M(this.viewOptions.printingBox,["left","top","width","height"])&&(t=new k.fabric.Rect({left:100,top:100,width:this.viewOptions.printingBox.width,height:this.viewOptions.printingBox.height,stroke:this.viewOptions.printingBox.visibility||this.viewOptions.editorMode?"#db2828":"transparent",strokeWidth:1,strokeLineCap:"square",fill:!1,originX:"left",originY:"top",name:"printing-box",excludeFromExport:!0,_ignore:!0}),this.printingBoxObject=new k.fabric.Group([t],{left:this.viewOptions.printingBox.left,top:this.viewOptions.printingBox.top,evented:!1,resizable:!0,removable:!1,copyable:!1,rotatable:!1,uniformScaling:!1,lockRotation:!0,borderColor:"transparent",transparentCorners:!0,cornerColor:this.viewOptions.selectedColor,cornerIconColor:this.viewOptions.cornerIconColor,cornerSize:24,originX:"left",originY:"top",name:"printing-boxes",excludeFromExport:!0,selectable:!1,_ignore:!0}),this.viewOptions?.output?.bleed,this.add(this.printingBoxObject),this.printingBoxObject.setCoords(),this.renderAll())},k.fabric.Canvas.prototype._bringToppedElementsToFront=function(){let t=this.getObjects(),e=[];t.forEach(t=>{(t.topped||t.uploadZone&&this.viewOptions.uploadZonesTopped)&&e.push(t)}),e.forEach(t=>{t.bringToFront()}),this.currentBoundingObject&&this.currentBoundingObject.bringToFront(),this.printingBoxObject&&this.printingBoxObject.bringToFront()},k.fabric.Canvas.prototype.addElements=function(i,t){let e=-1;const n=()=>{if(++e<i.length){const t=i[e];s(t)||this.addElement(t.type,t.source,t.title,t.parameters)}else this.off("elementAdd",n),void 0!==t&&t.call(t,this),this.initialElementsLoaded=!0},s=t=>{if(void 0===t.type||void 0===t.source||void 0===t.title){var e=i.indexOf(t);if(-1!==e)return console.log("Element index "+e+" from elements removed, its not a valid element object!","info"),n(),!0}else this.elements.push(t);return!1};i[0]?(this.on("elementAdd",n),n()):(void 0!==t&&t.call(t,this),this.initialElementsLoaded=!0)},k.fabric.Canvas.prototype.addElement=function(r,i,e){var a=this;let n,o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(void 0!==r&&void 0!==i&&void 0!==e){if(this.fire("beforeElementAdd",{type:r,source:i,title:e,params:o}),"text"===r&&(i=(i=i.replace(/(<([^>]+)>)/gi,"")).replace(this.forbiddenTextChars,""),e=e.replace(/(<([^>]+)>)/gi,"")),o.colorLinkGroup){var l=this.getElements();if(l){const i=l.find(t=>t.colorLinkGroup===o.colorLinkGroup);i&&i.fill&&(o.fill=i.fill)}}"string"==typeof o.fill||Array.isArray(o.fill)||(o.fill=!1),n=r.toLowerCase().includes("text")?h(this.viewOptions.elementParameters,this.viewOptions.textParameters):h(this.viewOptions.elementParameters,this.viewOptions.imageParameters),(o=h(n,o)).colors&&"string"==typeof o.colors&&0==o.colors.indexOf("#")&&(l=o.colors.replace(/\s+/g,"").split(","),o.colors=l),o._isInitial=!this.initialElementsLoaded,r.toLowerCase().includes("text")&&(l=o.colors[0]||"#000000",o.fill=o.fill||l);let s={source:i,title:e,id:String((new Date).getTime())},t=(this.viewOptions.editorMode?(o.__editorMode=this.viewOptions.editorMode,s.selectable=s.evented=!0):s=h(s,{selectable:!1,lockRotation:!0,hasRotatingPoint:!1,lockScalingX:!0,lockScalingY:!0,lockMovementX:!0,lockMovementY:!0,hasControls:!1,evented:!1,lockScalingFlip:!0}),(s=h(o,s)).isCustom&&("engraving"==ut(this.viewOptions,"industry.type")&&(s.opacity=ut(this.viewOptions,"industry.opts.opacity",.5)),this.isCustomized=!0),!1);if(("string"==typeof s.boundingBox&&0<s.boundingBox.length||"object"==typeof s.boundingBox&&M(s.boundingBox,["width","height"])&&0<s.boundingBox.width&&0<s.boundingBox.height)&&(t=!0),this.viewOptions.usePrintingBoxAsBounding&&!t&&M(this.viewOptions.printingBox,["left","top","width","height"])&&(s.boundingBox={x:this.viewOptions.printingBox.left-1,y:this.viewOptions.printingBox.top-1,width:this.viewOptions.printingBox.width+1,height:this.viewOptions.printingBox.height+1},s._printingBox=s.boundingBox),"image"==r||"path"==r||"group"==r){-1===i.search("<svg ")&&(l=i.split("?"),i=s.source=l[0]);const r=function(t,e,i){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};t?(e.originParams=h(e,n),t.setOptions(e),a.add(t),a.setElementOptions(e,t),t.originParams.angle=t.angle,t.originParams.z=t.getZIndex()):a.fire("imageFail",{url:e.source}),a.fire("elementAdd",{element:t})};if(void 0===i||0===i.length)console.log("No image source set for: "+e);else if(-1!==i.search("<svg"))k.fabric.loadSVGFromString(i,(t,e)=>{e=k.fabric.util.groupSVGElements(t,e);if(s.fill)s.svgFill||(s.svgFill=s.fill),delete s.fill;else if(!s.fill&&!s.svgFill){if(t){o.colors=[];for(var i=0;i<t.length;++i){var n=0<t[i].fill.length?b(t[i].fill).toHexString():"transparent";o.colors.push(n)}o.svgFill=o.colors}s.svgFill=o.svgFill}delete s.boundingBox,delete s.originParams,delete s.colors,delete s.svgFill,delete s.width,delete s.height,delete s.originX,delete s.originY,delete s.objectCaching,r(e,s,!0,{svgFill:o.svgFill})});else if(i.split(".").includes("svg")){let t=Date.now().toString(),e=pt(i)?new URL(this.proxyFileServer+i):i;!i.includes(".cloudfront.net/")&&!this.viewOptions.imageLoadTimestamp||this.proxyFileServer||e.searchParams.append("t",t),"object"==typeof e&&(e=e.toString()),k.fabric.loadSVGFromURL(e,(t,e)=>{e=t?k.fabric.util.groupSVGElements(t,e):null;if(s.fill)s.svgFill||(s.svgFill=s.fill),delete s.fill;else if(!s.fill&&!s.svgFill){if(t){o.colors=[];for(var i=0;i<t.length;++i){var n=0<t[i].fill.length?b(t[i].fill).toHexString():"transparent";o.colors.push(n)}o.svgFill=o.colors}s.svgFill=o.svgFill}r(e,s,!0,{svgFill:o.svgFill})})}else{let t,e=Date.now().toString();i.includes("data:image/")?t=i:(t=pt(i)?new URL(this.proxyFileServer+i):i,this.viewOptions.imageLoadTimestamp&&!this.proxyFileServer&&t.searchParams.append("t",e),"object"==typeof t&&(t=t.toString())),new k.fabric.Image.fromURL(t,function(t){t=""===t.getSrc()?null:t,r(t,s,!1)},{crossOrigin:"anonymous"})}}else r.toLowerCase().includes("text")&&(i=i.replace(/\\n/g,"\n"),o.text=o.text||i,s._initialText=o.hasOwnProperty("_initialText")?o._initialText:o.text,s.originParams={...o},o.originParams&&o.originParams.text&&(s.originParams.text=s._initialText),l=o.curved?new k.fabric.IText(i.replace(/(?:\r\n|\r|\n)/g,""),s):new(o.textBox?k.fabric.Textbox:o.neonText?k.fabric.NeonText:k.fabric.IText)(i,s),(s.textPlaceholder||s.numberPlaceholder)&&(this[s.textPlaceholder?"textPlaceholder":"numberPlaceholder"]=l),this.add(l),this.setElementOptions(s,l),l.originParams=h(l.toJSON(),l.originParams),l.originParams.z=l.getZIndex(),this.fire("elementAdd",{element:l}))}},k.fabric.Canvas.prototype.deselectElement=function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.currentBoundingObject&&(this.remove(this.currentBoundingObject),this.fire("boudingBoxToggle",{boundingBox:this.currentBoundingObject,state:!1}),this.currentBoundingObject=null),t&&this.discardActiveObject(),this.currentElement=null,this.fire("elementSelect",{element:null})},k.fabric.Canvas.prototype.resetSize=function(){if(this.wrapperEl&&this.wrapperEl.parentNode){var n=this.wrapperEl.parentNode.clientWidth;let t=window.innerHeight*parseFloat(this.viewOptions.maxCanvasHeight||1),e=this.viewOptions.stageHeight,i=null;this.responsiveScale=n<this.viewOptions.stageWidth?n/this.viewOptions.stageWidth:1;n=e*this.responsiveScale;return this.viewOptions.canvasHeight&&"auto"!==this.viewOptions.canvasHeight&&this.viewOptions.canvasHeight.includes("px")&&(i=parseInt(this.viewOptions.canvasHeight),t=i),n>t&&(this.responsiveScale=t/e),this.responsiveScale=parseFloat(Number(this.responsiveScale.toFixed(7))),this.responsiveScale=Math.min(this.responsiveScale,1),this.viewOptions.responsive||(this.responsiveScale=1),this.setDimensions({width:this.viewOptions.stageWidth*this.responsiveScale,height:this.viewOptions.stageHeight*this.responsiveScale}).setZoom(this.responsiveScale).calcOffset().renderAll(),this.fire("sizeUpdate",{responsiveScale:this.responsiveScale,canvasHeight:i||e*this.responsiveScale||e}),this.responsiveScale}},k.fabric.Canvas.prototype.setResZoom=function(t){this.deselectElement();var e=new k.fabric.Point(.5*this.getWidth(),.5*this.getHeight());this.zoomToPoint(e,t*this.responsiveScale),1==t&&this.resetZoom()},k.fabric.Canvas.prototype.resetZoom=function(){this.deselectElement(),this.zoomToPoint(new k.fabric.Point(0,0),this.responsiveScale),this.absolutePan(new k.fabric.Point(0,0))},k.fabric.Canvas.prototype.getElements=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"all";1<arguments.length&&void 0!==arguments[1]&&!arguments[1]||this.deselectElement();let e=this.getObjects();return e=e.filter(t=>!t._ignore),"text"===t?e.filter(t=>"text"===t.getType()):"image"===t?e.filter(t=>"image"===t.getType()):e},k.fabric.Canvas.prototype.getElementsJSON=function(){let s=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],e=this.getElements("all",t),r=[];return e.forEach(t=>{var e,i,n;void 0!==t.title&&void 0!==t.source&&(e={title:t.title,source:t.source,parameters:t.getElementJSON(),type:t.getType()},(i=this.viewOptions&&this.viewOptions.printingBox?this.viewOptions.printingBox:null)&&i.hasOwnProperty("left")&&i.hasOwnProperty("top")&&(n=t.getPointByOrigin("left","top"),e.printingBoxCoords={left:n.x-i.left,top:n.y-i.top}),s&&!t.isEditable||r.push(e))}),r},k.fabric.Canvas.prototype.getElementByTitle=function(t){for(var e=this.getObjects(),i=0;i<e.length;++i)if(e[i].title===t)return e[i]},k.fabric.Canvas.prototype.getElementByID=function(t){for(var e=this.getObjects(),i=0;i<e.length;++i)if(e[i].id==t)return e[i];return!1},k.fabric.Canvas.prototype.reset=function(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.clear(),t&&this.wrapperEl.remove(),this.fire("clear")},k.fabric.Canvas.prototype.removeElement=function(t){"string"==typeof t&&(t=this.getElementByTitle(t)),this.deselectElement(),t.toggleUploadZone&&t.toggleUploadZone(),this.remove(t),this.fire("elementRemove",{element:t})},k.fabric.Canvas.prototype.getElementByReplace=function(t){for(var e=this.getObjects(),i=0;i<e.length;++i){var n=e[i];if(n.replace===t)return n}return null},k.fabric.Canvas.prototype.setElementOptions=function(i,n){if(!(n=void 0===n?this.getActiveObject():n)||void 0===i)return!1;const t=(n="string"==typeof n?this.getElementByTitle(n):n).getType();if(void 0!==i.scale&&(i.scaleX=i.scaleY=Number(i.scale)),"image"==t&&!n._isInitial&&!n._optionsSet&&!n._addToUZ&&1===n.scaleX){let t=null;if(gt(n.resizeToW)&&gt(n.resizeToH)){if(n.boundingBox){const i=n.getBoundingBoxCoords();t=Ut(n.width,n.height,i.width,i.height,n.scaleMode)}else if(this.viewOptions.fitImagesInCanvas&&n.isCustom){const i=3*n.cornerSize;(n.width*n.scaleX+i>this.viewOptions.stageWidth||n.height*n.scaleY+i>this.viewOptions.stageHeight)&&(t=Ut(n.width,n.height,this.viewOptions.stageWidth-i,this.viewOptions.stageHeight-i))}}else{var e=n.resizeToW,s=n.resizeToH,e=isNaN(e)?parseFloat(e)/100*this.viewOptions.stageWidth:parseInt(e),s=isNaN(s)?parseFloat(s)/100*this.viewOptions.stageHeight:parseInt(s);t=Ut(n.width,n.height,e,s,n.scaleMode)}null!==t&&(i=h(i,{scaleX:t,scaleY:t}))}if(Boolean(n._addToUZ)){i.z=-1;let t=this.getElementByTitle(n._addToUZ),e=1;"image"==n.getType()&&(e=Ut(n.width,n.height,t.width*t.scaleX,t.height*t.scaleY,t.scaleMode)),(i=h(i,{boundingBox:n._addToUZ,boundingBoxMode:"clipping",scaleX:e,scaleY:e,autoCenter:!0,removable:!0,zChangeable:!1,autoSelect:!1,copyable:!1,hasUploadZone:!0,z:this.getElementByTitle(n._addToUZ).getZIndex(),rotatable:t.rotatable,draggable:t.draggable,resizable:t.resizable,price:t.price||i.price,replace:n._addToUZ,lockUniScaling:t.lockUniScaling,uniScalingUnlockable:t.uniScalingUnlockable,advancedEditing:t.advancedEditing,originX:t.originX,originY:t.originY,angle:t.angle})).originParams=h(i.originParams,{boundingBox:i.boundingBox,replace:i.replace,rotatable:i.rotatable,draggable:i.draggable,resizable:i.resizable,lockUniScaling:i.lockUniScaling,uniScalingUnlockable:i.uniScalingUnlockable,price:i.price,scaleX:i.scaleX,scaleY:i.scaleY,hasUploadZone:!0,autoCenter:!0,originX:i.originX,originY:i.originY,angle:i.angle}),delete i[""],delete n._addToUZ}if(i.topped&&(i.zChangeable=!1),n.checkEditable(i)&&(i.isEditable=i.evented=i.selectable=!0),(!i.uploadZone||this.viewOptions.editorMode)&&(i.draggable&&(i.lockMovementX=i.lockMovementY=!1),i.rotatable&&(i.lockRotation=!1,i.hasRotatingPoint=!0),i.resizable&&(i.lockScalingX=i.lockScalingY=!1),i.resizable||i.rotatable||i.removable)&&(i.hasControls=!0),i.uploadZone&&(this.viewOptions.editorMode||(i.uploadZoneMovable&&(i.lockMovementX=i.lockMovementY=!1),i.uploadZoneRemovable&&(i.removable=!0,i.copyable=!1,i.hasControls=!0)),i.borderColor="transparent",i.excludeFromExport=!0),i.fixed&&g(i.replace)&&(i.replace=n.title),!this.viewOptions.editorMode&&i.replace&&""!=i.replace){e=this.getElementByReplace(i.replace);if(null!==e&&e!==n){if(i.z=e.getZIndex(),i.left=n.originParams.left=e.left,i.top=n.originParams.top=e.top,i.autoCenter=!1,this.viewOptions.applySizeWhenReplacing){const r=e.getScaledWidth()/n.getScaledWidth();i.scaleX=n.originParams.scaleX=r,i.scaleY=n.originParams.scaleY=r}this.viewOptions.applyFillWhenReplacing&&!n._isQrCode&&(i.fill=i.svgFill=e.fill),this.removeElement(e)}}if("text"===t){if("string"==typeof i.text){let t=i.text;t=t.replace(this.forbiddenTextChars,""),0!=n.maxLength&&t.length>n.maxLength&&(t=t.substr(0,n.maxLength),n.set("text",t)),0!=n.maxLines&&0!=n.maxLines&&t.split("\n").length>n.maxLines&&(s=t.split("\n").slice(0,n.maxLines),t=s.join("\n")),"uppercase"===n.textTransform?t=t.toUpperCase():"lowercase"===n.textTransform&&(t=t.toLowerCase()),i.text=t}if(i.hasOwnProperty("textDecoration")&&(i.underline="underline"===i.textDecoration),void 0!==i.letterSpacing&&(i.charSpacing=100*i.letterSpacing),i.fontSize&&i.fontSize<n.minFontSize?i.fontSize=n.minFontSize:i.fontSize&&i.fontSize>n.maxFontSize&&(i.fontSize=n.maxFontSize),i.textTransform){let t=n.text;"uppercase"===i.textTransform?t=t.toUpperCase():"lowercase"===i.textTransform&&(t=t.toLowerCase()),i.text=t}}if(i.hasOwnProperty("shadowColor")||i.hasOwnProperty("shadowBlur")||i.hasOwnProperty("shadowOffsetX")||i.hasOwnProperty("shadowOffsetY")&&!n.neonText)if(null===i.shadowColor)n.set("shadow",null);else{let t={};n.shadow&&(t=n.shadow.toObject());e={color:i.hasOwnProperty("shadowColor")?i.shadowColor:t.color,blur:i.hasOwnProperty("shadowBlur")?i.shadowBlur:t.blur,offsetX:i.hasOwnProperty("shadowOffsetX")?i.shadowOffsetX:t.offsetX,offsetY:i.hasOwnProperty("shadowOffsetY")?i.shadowOffsetY:t.offsetY};n.set("shadow",e)}if(delete i.paths,n.setOptions(i),(i.fontSize||i.fontFamily||i.letterSpacing)&&n.setCurvedTextPosition&&n.setCurvedTextPosition(),"i-text"==n.type&&n.widthFontSize&&0<n.text.length){let t;(t=n.width>n.widthFontSize?n.fontSize*(n.widthFontSize/(n.width+1)):n.fontSize*(n.widthFontSize/(n.width-1)))<n.minFontSize?t=n.minFontSize:t>n.maxFontSize&&(t=n.maxFontSize),t=parseInt(t),n.set("fontSize",t)}if(n.setCurvedTextPosition&&n.setCurvedTextPosition(),i.autoCenter&&n.centerElement(),i.hasOwnProperty("lockUniScaling")&&n._elementControls(),i.filter){const t=function(t,e){var i=1<arguments.length&&void 0!==e?e:{};if("string"==typeof t)switch(t=t.toLowerCase()){case"grayscale":return new k.fabric.Image.filters.Grayscale;case"sepia":return new k.fabric.Image.filters.Sepia;case"kodachrome":return new k.fabric.Image.filters.Kodachrome;case"black_white":return new k.fabric.Image.filters.BlackWhite;case"vintage":return new k.fabric.Image.filters.Vintage;case"technicolor":return new k.fabric.Image.filters.Technicolor;case"brightness":return new k.fabric.Image.filters.Brightness(i);case"contrast":return new k.fabric.Image.filters.Contrast(i);case"removewhite":return new k.fabric.Image.filters.RemoveColor(i)}else if(Array.isArray(t))return new k.fabric.Image.filters.ColorMatrix({matrix:t});return null}(i.filter);t&&n.applyFilters?(n.filters=[t],n.applyFilters()):n.applyFilters&&(n.filters=[],n.applyFilters())}if(void 0!==i.fill||void 0!==i.svgFill){const t=void 0!==i.svgFill?i.svgFill:i.fill;n.changeColor(t),n.pattern=void 0}if(void 0!==i.pattern&&n.setPattern(i.pattern),n.canvas&&0<=i.z&&(n.moveTo(i.z),this._bringToppedElementsToFront()),i.hasOwnProperty("curved")&&n.setCurvedTextPath)if(i.curved){if("textbox"==n.type)return delete(s=n.getElementJSON()).width,this.addElement("text",s.text,n.title,s),void this.removeElement(n);n.setCurvedTextPath(),n==this.getActiveObject()&&n.path&&(n.path.visible=!0),n.textAlign="left",n.set("text",n.text.replace(/[\r\n]+/g,"")),n.setCurvedTextPosition()}else n.set("path",null);i.hasOwnProperty("curveRadius")&&n.setCurvedTextPath&&(n.setCurvedTextPath(),n==this.getActiveObject())&&n.path&&(n.path.visible=!0),n.uploadZone?n.evented=0!==n.opacity:n.isEditable&&!this.viewOptions.editorMode&&(n.evented=!i.locked),(n.textPlaceholder||n.numberPlaceholder)&&(n.removable=!1);for(var r=this.getObjects(),a=0;a<r.length;++a){var o=r[a];o.uploadZone&&o.title==i.replace&&(o.opacity=0,o.evented=!1)}n.setCoords(),this.renderAll().calcOffset(),this.fire("elementModify",{element:n,options:i}),n._checkContainment(),this._doHistory&&this.historySaveAction(),i.autoSelect&&n.isEditable&&!this.editorMode&&this.wrapperEl.offsetParent&&setTimeout(()=>{this.setActiveObject(n),this.renderAll()},200),n._optionsSet=!0},k.fabric.Canvas.prototype.duplicateElement=function(t){var e=t.getElementJSON();e.top=e.top+30,e.left=e.left+30,this.viewOptions.editorMode||(e.autoSelect=!0),this.addElement(t.getType(),t.source,"Copy "+t.title,e)},k.fabric.Canvas.prototype.getUploadZone=function(t){for(var e=this.getObjects(),i=0;i<e.length;++i)if(e[i].uploadZone&&e[i].title==t)return e[i]},k.fabric.Canvas.prototype.setMask=function(){let n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},s=1<arguments.length&&void 0!==arguments[1]?arguments[1]:()=>{};var t;n&&n.url&&n.url.includes(".svg")?(t=this.proxyFileServer+n.url,this.maskOptions=n,k.fabric.loadSVGFromURL(t,(t,e)=>{let i=null;t&&((i=t?k.fabric.util.groupSVGElements(t,e):null).setOptions({left:n.left?Number(n.left):0,top:n.top?Number(n.top):0,scaleX:n.scaleX?Number(n.scaleX):1,scaleY:n.scaleY?Number(n.scaleY):1,selectable:!0,evented:!1,resizable:!0,lockUniScaling:!1,lockRotation:!0,borderColor:"transparent",fill:"rgba(0,0,0,0)",transparentCorners:!0,cornerColor:this.viewOptions.selectedColor,cornerIconColor:this.viewOptions.cornerIconColor,cornerSize:24,originX:"left",originY:"top",name:"view-mask",objectCaching:!1,excludeFromExport:!0,_ignore:!0}),this.maskObject=i,this.clipPath=i,this.resetSize()),s(i)})):(this.maskObject=this.maskOptions=this.clipPath=null,this.renderAll(),s(null))},Zo(933)),Zt=Zo.n(Wt);const Jt=t=>{let e="";if(t.hasOwnProperty("url")){t.name;var i=-1!==t.url.search(".woff")?"woff":"TrueType",n=FancyProductDesigner.proxyFileServer+t.url;if(e+='@font-face {font-family:"'+t.name+'"; font-style: normal; font-weight: normal; src:url("'+n+'") format("'+i+'");}\n',t.variants){for(const s in t.variants){n=FancyProductDesigner.proxyFileServer+t.variants[s];e+='@font-face {font-family:"'+t.name+'"; '+{n7:"font-style: normal; font-weight: bold;",i4:"font-style: italic; font-weight: normal;",i7:"font-style: italic; font-weight: bold;"}[s]+' src:url("'+n+'") format("'+i+'");}\n'}Object.keys(t.variants).toString()}}return e};function Qt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function v(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function Kt(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var $t=new WeakSet,te=new WeakSet;class ee extends EventTarget{constructor(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=2<arguments.length?arguments[2]:void 0,n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},i=(super(),Qt(this,te),Qt(this,$t),v(this,"totalPrice",0),v(this,"truePrice",0),v(this,"additionalPrice",0),v(this,"locked",!1),v(this,"mask",null),v(this,"viewData",void 0),v(this,"onCreatedCallback",void 0),v(this,"title",void 0),v(this,"thumbnail",void 0),v(this,"options",void 0),v(this,"names_numbers",void 0),v(this,"canvasElem",null),v(this,"fabricCanvas",null),v(this,"elementsAdded",!1),this.viewData=e,this.onCreatedCallback=i,this.title=e.title,this.thumbnail=e.thumbnail,this.options=e.options,this.mask=e.mask,this.locked=void 0!==e.locked?e.locked:this.options.optionalView,this.names_numbers=e.names_numbers||null,fabric.Canvas.prototype.snapGridSize=this.options.snapGridSize,fabric.Canvas.prototype.snapToObjects=this.options.smartGuides,this.options.selectedColor);fabric.Object.prototype.borderColor=i,fabric.Object.prototype.cornerColor=i,fabric.Object.prototype.cornerIconColor=this.options.cornerIconColor,n=h({containerClass:"fpd-view-stage fpd-hidden",selection:this.options.multiSelection,selectionBorderColor:this.options.multiSelectionColor,selectionColor:b(this.options.multiSelectionColor).setAlpha(.1).toRgbString(),hoverCursor:"pointer",controlsAboveOverlay:!0,centeredScaling:!0,allowTouchScrolling:!0,preserveObjectStacking:!0,enablePointerEvents:!1},n),this.fabricOptions=n,this.canvasElem=document.createElement("canvas"),t.append(this.canvasElem),fabric.Canvas.prototype.forbiddenTextChars=FancyProductDesigner.forbiddenTextChars,fabric.Canvas.prototype.proxyFileServer=FancyProductDesigner.proxyFileServer,this.fabricCanvas=new fabric.Canvas(this.canvasElem,n),this.fabricCanvas.viewOptions=this.options,this.fabricCanvas.setDimensions({width:this.options.stageWidth,height:this.options.stageHeight}),this.fabricCanvas.on({imageFail:t=>{t=t.url;a(`
<p>The image with the URL<br /><i style='font-size: 10px;'>${t}</i><br />can not be loaded into the canvas.</p>
<p><b>Troubleshooting</b>
<ul>
<li>The URL is not correct!</li>
<li>The image has been blocked by <a href='https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS' target='_blank'>CORS policy</a>. You need to host the image under the same protocol and domain or enable 'Access-Control-Allow-Origin' on the server where you host the image. <a href='http://enable-cors.org/' target='_blank'>Read more about it here.</a><
/li>
</ul>
</p>
`)}}),this.toggleLock(Boolean(this.locked));const s=t=>{t.chargeAfterEditing&&(t._isPriced||(this.changePrice(t.price,"+"),t._isPriced=!0),t._initialText===t.text)&&t._isPriced&&(this.changePrice(t.price,"-"),t._isPriced=!1)};this.fabricCanvas.on({"object:added":t=>{let e=t.target,i=e.price;e._addToUZ&&""!=e._addToUZ&&(t=this.fabricCanvas.getElementByTitle(e._addToUZ),i=t&&t.price?t.price:i),void 0===i||0===i||e.uploadZone||e._ignore||e.chargeAfterEditing&&!e._isPriced||this.changePrice(i,"+")},"object:removed":t=>{t=t.target;void 0===t.price||0===t.price||t.uploadZone||t.chargeAfterEditing&&!t._isPriced||this.changePrice(t.price,"-")},"text:changed":t=>{s(t.target)},elementModify:t=>{this.elementsAdded&&t.options.hasOwnProperty("text")&&s(t.element)},elementFillChange:t=>{Kt(this,te,ne).call(this,t.element)}})}init(){this.loadElements(this.viewData.elements,Kt(this,$t,ie).bind(this))}loadElements(t,e){this.fabricCanvas.initialElementsLoaded&&this.fabricCanvas.reset(!1),this.fabricCanvas.offHistory(),this.fabricCanvas.addElements(t,e)}toDataURL(e){let i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=(e=void 0===e?function(){}:e,i.onlyExportable=void 0!==i.onlyExportable&&i.onlyExportable,i.multiplier=void 0===i.multiplier?1:i.multiplier,i.backgroundColor=void 0===i.backgroundColor?"transparent":i.backgroundColor,i.watermarkImg=void 0===i.watermarkImg?null:i.watermarkImg,[]),s=this.options.highlightEditableObjects;this.options.highlightEditableObjects="transparent",this.fabricCanvas.getObjects().forEach(t=>{t.excludeFromExport&&i.onlyExportable&&(t.visible=!1,n.push(t))}),t&&this.fabricCanvas.deselectElement(),this.fabricCanvas.setDimensions({width:this.options.stageWidth,height:this.options.stageHeight}).setZoom(1),this.fabricCanvas.setBackgroundColor(i.backgroundColor,()=>{i.watermarkImg&&(this.fabricCanvas.add(i.watermarkImg),i.watermarkImg.center(),i.watermarkImg.bringToFront()),e(this.fabricCanvas.toDataURL(i)),i.watermarkImg&&this.fabricCanvas.remove(i.watermarkImg),this.fabricCanvas.wrapperEl.offsetParent&&this.fabricCanvas.resetSize(),this.fabricCanvas.setBackgroundColor("transparent",()=>{this.fabricCanvas.renderAll()});for(var t=0;t<n.length;++t)n[t].visible=!0;this.fabricCanvas.renderAll(),this.options.highlightEditableObjects=s})}toSVG(){var t,i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];if(i.respectPrintingBox=void 0!==i.respectPrintingBox&&i.respectPrintingBox,i.watermarkImg=void 0===i.watermarkImg?null:i.watermarkImg,this.fabricCanvas.deselectElement(),i.respectPrintingBox&&M(this.options.printingBox,["left","top","width","height"])){let t=0,e=0;M(this.options.output,["bleed","width","height"])&&(t=this.options.output.bleed/this.options.output.width*this.options.printingBox.width,e=this.options.output.bleed/this.options.output.height*this.options.printingBox.height),i.viewBox={x:this.options.printingBox.left-t,y:this.options.printingBox.top-e,width:this.options.printingBox.width+2*t,height:this.options.printingBox.height+2*e},this.fabricCanvas.setDimensions({width:this.options.printingBox.width,height:this.options.printingBox.height}).setZoom(1)}else this.fabricCanvas.setDimensions({width:this.options.stageWidth,height:this.options.stageHeight}).setZoom(1);var n=this.fabricCanvas.backgroundColor,i=("transparent"==n&&(this.fabricCanvas.backgroundColor=!1),i.watermarkImg&&(this.fabricCanvas.add(i.watermarkImg),i.watermarkImg.center(),i.watermarkImg.bringToFront()),t=this.fabricCanvas.toSVG(i,i.reviver),i.watermarkImg&&this.fabricCanvas.remove(i.watermarkImg),this.fabricCanvas.backgroundColor=n,this.fabricCanvas.wrapperEl.offsetParent&&this.fabricCanvas.resetSize(),document.createElement("div"));i.innerHTML=t;const s=i.querySelector("defs");i.querySelectorAll("clipPath").forEach(t=>{s.appendChild(t)});n=document.createElement("style");let r="",a="",o=(e.forEach(t=>{t.hasOwnProperty("url")&&("google"==t.url?r+=t.name.replace(/\s/g,"+")+":ital,wght@0,400;0,700;1,700&":a+=Jt(t))}),0<r.length&&n.insertAdjacentHTML("beforeend",'@import url("https://fonts.googleapis.com/css2?family='+r.replace(/&/g,"&amp;")+'display=swap");'),0<a.length&&n.insertAdjacentHTML("beforeend",a),s.appendChild(n),i.innerHTML);return o=o.replace(/(?:\r\n|\r|\n)/g,"")}toggleLock(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];return this.locked=t,f(this.fabricCanvas.wrapperEl,["fpd-disabled"],t),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:0,truePrice:this.truePrice}})),t}changePrice(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return"number"!=typeof t&&(t=Number(t)),"+"===e?this.totalPrice+=t:this.totalPrice-=t,null!==i&&(e=this.additionalPrice,this.totalPrice-=e,this.additionalPrice=i,this.totalPrice+=i),this.truePrice=this.totalPrice,"number"==typeof this.options.maxPrice&&-1!=this.options.maxPrice&&this.truePrice>this.options.maxPrice&&(this.truePrice=Number(this.options.maxPrice)),this.truePrice%1!=0&&(this.truePrice=Number(this.truePrice.toFixed(2))),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:t,truePrice:this.truePrice}})),this.truePrice}}function ie(){this.elementsAdded=!0,this.fabricCanvas._doHistory=!0,this.mask&&this.fabricCanvas.setMask(this.mask),this.onCreatedCallback&&this.onCreatedCallback(this),this.dispatchEvent(new CustomEvent("priceChange",{detail:{elementPrice:0,truePrice:this.truePrice}}))}function ne(t){var e;this.elementsAdded&&t.colorPrices&&"object"==typeof t.colors&&1<t.colors.length&&(void 0!==t.currentColorPrice&&(t.price-=t.currentColorPrice,this.changePrice(t.currentColorPrice,"-")),"string"==typeof(e=t.fill)&&(e=e.replace("#",""),t.colorPrices.hasOwnProperty(e)||t.colorPrices.hasOwnProperty(e.toUpperCase()))?(e=void 0===t.colorPrices[e]?t.colorPrices[e.toUpperCase()]:t.colorPrices[e],t.currentColorPrice=e,t.price+=t.currentColorPrice,this.changePrice(t.currentColorPrice,"+")):t.currentColorPrice=0)}v(ee,"relevantOptions",["stageWidth","stageHeight","selectedColor","boundingBoxColor","outOfBoundaryColor","cornerIconColor","customAdds","elementParameters","imageParameters","textParameters","customImageParameters","customTextParameters","maxPrice","optionalView","designCategories","printingBox","output","layouts","usePrintingBoxAsBounding","threeJsPreviewModel","editorMode","imageLoadTimestamp","fitImagesInCanvas","inCanvasTextEditing","applyFillWhenReplacing","disableTextEmojis","cornerControlsStyle","responsive","canvasHeight","maxCanvasHeight","boundingBoxProps","highlightEditableObjects","multiSelection","multiSelectionColor","mobileGesturesBehaviour","smartGuides","snapGridSize","rulerUnit","namesNumbersEntryPrice","applySizeWhenReplacing","rulerPosition","rulerFixed","industry"]),window.FancyProductDesigner=ee;const se=e=>{let t=e.url;e.params&&(t+="?"+new URLSearchParams(e.params).toString());const i=new XMLHttpRequest;return i.responseType="json",i.open("GET",t),i.onreadystatechange=t=>{4==i.readyState&&200==i.status?e.onSuccess&&e.onSuccess(i.response):200!==i.status&&e.onError&&e.onError(i)},i.send(),i},re=e=>{var t=e.url,i={Accept:"application/json"};return e.body instanceof FormData||(i["Content-Type"]="application/json"),fetch(t,{method:"POST",redirect:"follow",headers:i,body:e.body instanceof FormData?e.body:JSON.stringify(e.body)}).then(t=>t.json()).then(t=>{e.onSuccess&&e.onSuccess(t)}).catch(t=>{e.onError&&e.onError(t)})};class ae extends EventTarget{langJSON=null;constructor(){super()}loadLangJSON(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:()=>{};!1!==e?"object"==typeof e?(this.langJSON=e,i.call(this)):se({url:e,onSuccess:t=>{this.langJSON=t,i.call(this)},onError:t=>{alert('Language JSON "'+e+'" could not be loaded or is not valid. Make sure you set the correct URL in the options and the JSON is valid!'),i.call(this)}}):i.call(this)}translateElement(t){let e="";var i,n;return this.langJSON?(i="",!(i=t.getAttribute("placeholder")?t.getAttribute("placeholder"):t.getAttribute("title")?t.getAttribute("title"):t.dataset.title||t.innerHTML).includes(".")||/\s/.test(i)?e=i:(i=i.toLowerCase().split("."),(n=this.langJSON[i[0]])?void 0===(e=n[i[1]])&&(console.log("FPD label not found: "+t.dataset.defaulttext,i),e=t.dataset.defaulttext):e=t.dataset.defaulttext)):e=t.dataset.defaulttext,t.getAttribute("placeholder")?(t.setAttribute("placeholder",e),t.innerText=""):t.getAttribute("title")?t.setAttribute("title",e):t.dataset.title?t.dataset.title=e:t.innerHTML=e,e}getTranslation(t,e){let i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",n=i;return g(this.langJSON)||(t=this.langJSON[t])&&(n=t[e]||i),n.replace(/\n/g,""),n}translateArea(t){t=t.querySelectorAll("[data-defaulttext]");Array.from(t).forEach(t=>{this.translateElement(t)})}}function oe(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function le(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var ce=new WeakSet;class he extends HTMLElement{constructor(){super();var t=this,e=ce;if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),oe(this,"placeholder",""),oe(this,"value",""),oe(this,"searchable",!1),oe(this,"inputElem",null),oe(this,"listElem",null)}connectedCallback(){this.innerHTML='<input type="text" class="fpd-dropdown-current"/> <div class="fpd-dropdown-arrow"><span class="fpd-icon-arrow-dropdown"></span></div> <div class="fpd-dropdown-list"> <div class="fpd-scroll-area"></div> </div> ',this.inputElem=this.querySelector("input.fpd-dropdown-current"),this.listElem=this.querySelector(".fpd-dropdown-list"),document.addEventListener("click",t=>{this.contains(t.target)||this.classList.remove("fpd-active")}),this.addEventListener("click",()=>{le(this,ce,de).call(this),this.classList.toggle("fpd-active")}),this.querySelector(".fpd-dropdown-arrow").addEventListener("click",t=>{t.stopPropagation(),le(this,ce,de).call(this),this.classList.toggle("fpd-active")}),this.inputElem.addEventListener("keyup",t=>{if(this.searchable){const e=t.currentTarget.value;this.listElem.querySelectorAll(".fpd-item").forEach(t=>{0==e.length?t.classList.remove("fpd-hidden"):t.classList.toggle("fpd-hidden",!t.innerText.toLowerCase().includes(e.toLowerCase()))})}}),window.addEventListener("scroll",()=>{le(this,ce,de).call(this)});const i=t=>{var e=t.parentNode;e&&(t.addEventListener("scroll",()=>{le(this,ce,de).call(this)}),i(e))};i(this),this.inputElem.setAttribute("placeholder",this.getAttribute("placeholder")||""),le(this,ce,de).call(this)}static get observedAttributes(){return["searchable","placeholder","value"]}attributeChangedCallback(t,e,i){e!==i&&(this.inputElem&&("placeholder"===t?this.inputElem.setAttribute("placeholder",i):"value"===t&&(this.inputElem.value=i)),"searchable"===t)&&(this.searchable=this.hasAttribute("searchable"))}}function de(){var t=this.getBoundingClientRect();this.listElem.style.width=t.width+"px",this.listElem.style.left=t.left+"px",this.listElem.style.top=t.top+t.height+"px"}customElements.define("fpd-dropdown",he),Zo(653);class ue extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-pos="left"> <fpd-actions-menu data-font-icon="fpd-icon-menu"></fpd-actions-menu> </div> <div data-pos="center"> <fpd-actions-menu class="fpd-only-uncollapsed"></fpd-actions-menu> </div> <div data-pos="right"> <fpd-actions-menu data-font-icon="fpd-icon-more"></fpd-actions-menu> </div> <div data-pos="modal"> <span class="fpd-btn fpd-btn-fill fpd-close fpd-done"> <i class="fpd-icon-done"></i> <span class="fpd-label" data-defaulttext="Done">actions.modal_done</span> <span class="fpd-total-price">10.00$</span> </span> <span class="fpd-btn fpd-close"> <i class="fpd-icon-close"></i> </span> </div>'}}customElements.define("fpd-actions-bar",ue);class pe extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div> <input type="text" data-defaulttext="Enter a URL, some text..." placeholder="modules.qr_code_input"/> <div class="fpd-qr-code-colors"> <div class="fpd-qr-code-color-dark"></div> <div class="fpd-qr-code-color-light"></div> </div> <span class="fpd-add-qr-code fpd-btn" data-defaulttext="Add QR-Code">modules.qr_code_add_btn</span> </div> '}}customElements.define("fpd-module-qr-code",pe);function fe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ge(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t)){var i=t,n=e,s=[],r=!0,t=!1,e=void 0;try{for(var a,o=i[Symbol.iterator]();!(r=(a=o.next()).done)&&(s.push(a.value),!n||s.length!==n);r=!0);}catch(i){t=!0,e=i}finally{try{!r&&o.return&&o.return()}finally{if(t)throw e}}return s}throw new TypeError("Invalid attempt to destructure non-iterable instance")}t=function(t,e,i){return e&&me(t.prototype,e),i&&me(t,i),t};function me(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}String.prototype.startsWith=String.prototype.startsWith||function(t){return 0===this.indexOf(t)},String.prototype.padStart=String.prototype.padStart||function(t,e){for(var i=this;i.length<t;)i=e+i;return i};var ve={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function be(t,e){e=1<arguments.length&&void 0!==e?e:1;return(0<e?t.toFixed(e).replace(/0+$/,"").replace(/\.$/,""):t.toString())||"0"}t(C,[{key:"printRGB",value:function(t){var e=(t?this.rgba:this.rgba.slice(0,3)).map(function(t,e){return be(t,3===e?3:0)});return t?"rgba("+e+")":"rgb("+e+")"}},{key:"printHSL",value:function(t){var i=[360,100,100,1],n=["","%","%",""],e=(t?this.hsla:this.hsla.slice(0,3)).map(function(t,e){return be(t*i[e],3===e?3:1)+n[e]});return t?"hsla("+e+")":"hsl("+e+")"}},{key:"printHex",value:function(t){var e=this.hex;return t?e:e.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(this._hsla)return this._rgba=C.hslToRgb(this._hsla);throw new Error("No color is set")},set:function(t){3===t.length&&(t[3]=1),this._rgba=t,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(this._rgba)return this._hsla=C.rgbToHsl(this._rgba);throw new Error("No color is set")},set:function(t){3===t.length&&(t[3]=1),this._hsla=t,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map(function(t,e){return(e<3?t:Math.round(255*t)).toString(16)}).map(function(t){return t.padStart(2,"0")}).join("")},set:function(t){this.rgba=C.hexToRgb(t)}}],[{key:"hexToRgb",value:function(t){var e=(t.startsWith("#")?t.slice(1):t).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(e.match(/^([0-9a-fA-F]{8})$/))return(e=e.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map(function(t){return parseInt(t,16)}))[3]=e[3]/255,e;throw new Error("Unknown hex color; "+t)}},{key:"nameToRgb",value:function(t){t=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),t=ve[t];return void 0===t?t:C.hexToRgb(t.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(t){var t=ge(t,4),e=t[0],i=t[1],n=t[2],t=t[3],s=(e/=255,i/=255,n/=255,Math.max(e,i,n)),r=Math.min(e,i,n),a=void 0,o=void 0,l=(s+r)/2;if(s===r)a=o=0;else{var c=s-r,o=.5<l?c/(2-s-r):c/(s+r);switch(s){case e:a=(i-n)/c+(i<n?6:0);break;case i:a=(n-e)/c+2;break;case n:a=(e-i)/c+4}a/=6}return[a,o,l,t]}},{key:"hslToRgb",value:function(t){var t=ge(t,4),e=t[0],i=t[1],n=t[2],t=t[3],s=void 0,r=void 0,a=void 0,o=(0===i?s=r=a=n:(s=(o=function(t,e,i){return i<0&&(i+=1),1<i&&--i,i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t})(i=2*n-(n=n<.5?n*(1+i):n+i-n*i),n,e+1/3),r=o(i,n,e),a=o(i,n,e-1/3)),[255*s,255*r,255*a].map(Math.round));return o[3]=t,o}}]);var ye=C,xe=(t(we,[{key:"add",value:function(t,e,i){t.addEventListener(e,i,!1),this._events.push({target:t,type:e,handler:i})}},{key:"remove",value:function(i,n,s){this._events=this._events.filter(function(t){var e=!0;return i&&i!==t.target&&(e=!1),n&&n!==t.type&&(e=!1),(e=s&&s!==t.handler?!1:e)&&we._doRemove(t.target,t.type,t.handler),!e})}},{key:"destroy",value:function(){this._events.forEach(function(t){return we._doRemove(t.target,t.type,t.handler)}),this._events=[]}}],[{key:"_doRemove",value:function(t,e,i){t.removeEventListener(e,i,!1)}}]),we);function we(){fe(this,we),this._events=[]}function C(t,e,i,n){fe(this,C);var s,r,a,o,l,c=this;void 0!==t&&(Array.isArray(t)?this.rgba=t:void 0===i?(s=t&&""+t)&&((s=s.toLowerCase()).startsWith("hsl")?(a=s.match(/([\-\d\.e]+)/g).map(Number),o=(a=ge(a,4))[0],l=a[1],r=a[2],a=a[3],c.hsla=[o/=360,l/=100,r/=100,a=void 0===a?1:a]):s.startsWith("rgb")?(o=s.match(/([\-\d\.e]+)/g).map(Number),r=(l=ge(o,4))[0],a=l[1],o=l[2],l=l[3],c.rgba=[r,a,o,l=void 0===l?1:l]):s.startsWith("#")?c.rgba=C.hexToRgb(s):c.rgba=C.nameToRgb(s)||C.hexToRgb(s)):this.rgba=[t,e,i,void 0===n?1:n])}function Ce(t,r,a){var o=!1;function l(t,e,i){return Math.max(e,Math.min(t,i))}function i(t,e,i){var n,s;(o=!!i||o)&&(t.preventDefault(),t=(i=r.getBoundingClientRect()).width,n=i.height,s=e.clientX,e=e.clientY,s=l(s-i.left,0,t),e=l(e-i.top,0,n),a(s/t,e/n))}function e(t,e){1===(void 0===t.buttons?t.which:t.buttons)?i(t,t,e):o=!1}function n(t,e){1===t.touches.length?i(t,t.touches[0],e):o=!1}t.add(r,"mousedown",function(t){e(t,!0)}),t.add(r,"touchstart",function(t){n(t,!0)}),t.add(window,"mousemove",e),t.add(r,"touchmove",n),t.add(window,"mouseup",function(t){o=!1}),t.add(r,"touchend",function(t){o=!1}),t.add(r,"touchcancel",function(t){o=!1})}var Se="mousedown",Ee="focusin";function Te(t,e){return(e||document).querySelector(t)}function Ae(t){t.preventDefault(),t.stopPropagation()}function Ie(t,e,i,n,s){t.add(e,"keydown",function(t){0<=i.indexOf(t.key)&&(s&&Ae(t),n(t))})}t(Me,[{key:"setOptions",value:function(t){var e=this;if(t){var i=this.settings;if(t instanceof HTMLElement)i.parent=t;else{i.parent&&t.parent&&i.parent!==t.parent&&(this._events.remove(i.parent),this._popupInited=!1);var n,s=t,r=i;for(n in s)r[n]=s[n];t.onChange&&(this.onChange=t.onChange),t.onDone&&(this.onDone=t.onDone),t.onOpen&&(this.onOpen=t.onOpen),t.onClose&&(this.onClose=t.onClose);var a=t.color||t.colour;a&&this._setColor(a)}var o,a=i.parent;a&&i.popup&&!this._popupInited?(this._events.add(a,"click",o=function(t){return e.openHandler(t)}),Ie(this._events,a,[" ","Spacebar","Enter"],o),this._popupInited=!0):t.parent&&!i.popup&&this.show()}}},{key:"openHandler",value:function(t){var e;this.show()&&(t&&t.preventDefault(),this.settings.parent.style.pointerEvents="none",e=t&&"keydown"===t.type?this._domEdit:this.domElement,setTimeout(function(){return e.focus()},100),this.onOpen)&&this.onOpen(this.colour)}},{key:"closeHandler",value:function(t){var e,i=t&&t.type,n=!1;t?i===Se||i===Ee?(e=(this.__containedEvent||0)+100,t.timeStamp>e&&(n=!0)):(Ae(t),n=!0):n=!0,n&&this.hide()&&(this.settings.parent.style.pointerEvents="",i!==Se&&this.settings.parent.focus(),this.onClose)&&this.onClose(this.colour)}},{key:"movePopup",value:function(t,e){this.closeHandler(),this.setOptions(t),e&&this.openHandler()}},{key:"setColor",value:function(t,e){this._setColor(t,{silent:e})}},{key:"_setColor",value:function(t,e){if(t="string"==typeof t?t.trim():t){e=e||{};var i,n=void 0;try{n=new ye(t)}catch(t){if(e.failSilently)return;throw t}this.settings.alpha||((i=n.hsla)[3]=1,n.hsla=i),this.colour=this.color=n,this._setHSLA(null,null,null,null,e)}}},{key:"setColour",value:function(t,e){this.setColor(t,e)}},{key:"show",value:function(){var t,e,i;return!!this.settings.parent&&(this.domElement?(t=this._toggleDOM(!0),this._setPosition(),t):(t=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',(e=document.createElement("div")).innerHTML=t,i=e.firstElementChild,this.domElement=i,this._domH=Te(".picker_hue",i),this._domSL=Te(".picker_sl",i),this._domA=Te(".picker_alpha",i),this._domEdit=Te(".picker_editor input",i),this._domSample=Te(".picker_sample",i),this._domOkay=Te(".picker_done button",i),this._domCancel=Te(".picker_cancel button",i),i.classList.add("layout_"+this.settings.layout),this.settings.alpha||i.classList.add("no_alpha"),this.settings.editor||i.classList.add("no_editor"),this.settings.cancelButton||i.classList.add("no_cancel"),this._ifPopup(function(){return i.classList.add("popup")}),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0))}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var i=this,n=this,s=this.domElement,r=this._events;function a(t,e,i){r.add(t,e,i)}a(s,"click",function(t){return t.preventDefault()}),Ce(r,this._domH,function(t,e){n._setHSLA(t)}),Ce(r,this._domSL,function(t,e){n._setHSLA(null,t,1-e)}),this.settings.alpha&&Ce(r,this._domA,function(t,e){n._setHSLA(null,null,null,1-e)});function t(t){i._ifPopup(function(){return i.closeHandler(t)}),i.onDone&&i.onDone(i.colour)}var e=this._domEdit;a(e,"input",function(t){n._setColor(this.value,{fromEditor:!0,failSilently:!0})}),a(e,"focus",function(t){this.selectionStart===this.selectionEnd&&this.select()}),this._ifPopup(function(){function t(t){return i.closeHandler(t)}function e(t){i.__containedEvent=t.timeStamp}a(window,Se,t),a(window,Ee,t),Ie(r,s,["Esc","Escape"],t);a(s,Se,e),a(s,Ee,e),a(i._domCancel,"click",t)});a(this._domOkay,"click",t),Ie(r,s,["Enter"],t)}},{key:"_setPosition",value:function(){var i=this.settings.parent,n=this.domElement;i!==n.parentNode&&i.appendChild(n),this._ifPopup(function(t){"static"===getComputedStyle(i).position&&(i.style.position="relative");var e=!0===t?"popup_right":"popup_"+t;["popup_top","popup_bottom","popup_left","popup_right"].forEach(function(t){t===e?n.classList.add(t):n.classList.remove(t)}),n.classList.add(e)})}},{key:"_setHSLA",value:function(t,e,i,n,s){s=s||{};var r=this.colour,a=r.hsla;[t,e,i,n].forEach(function(t,e){!t&&0!==t||(a[e]=t)}),r.hsla=a,this._updateUI(s),this.onChange&&!s.silent&&this.onChange(r)}},{key:"_updateUI",value:function(t){if(this.domElement){t=t||{};var e=this.colour,i=e.hsla,n="hsl("+360*i[0]+", 100%, 50%)",s=e.hslString,r=e.hslaString,a=this._domH,o=this._domSL,l=this._domA,a=Te(".picker_selector",a),c=Te(".picker_selector",o),l=Te(".picker_selector",l),a=(u(0,a,i[0]),this._domSL.style.backgroundColor=this._domH.style.color=n,u(0,c,i[1]),p(0,c,1-i[2]),o.style.color=s,p(0,l,1-i[3]),s),n=a.replace("hsl","hsla").replace(")",", 0)");if(this._domA.style.background="linear-gradient("+[a,n]+")"+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n                   linear-gradient(45deg, lightgrey 25%,       white 25%,       white 75%, lightgrey 75%) 1em 1em / 2em 2em",!t.fromEditor){var c=this.settings.editorFormat,h=this.settings.alpha,d=void 0;switch(c){case"rgb":d=e.printRGB(h);break;case"hsl":d=e.printHSL(h);break;default:d=e.printHex(h)}this._domEdit.value=d}this._domSample.style.color=r}function u(t,e,i){e.style.left=100*i+"%"}function p(t,e,i){e.style.top=100*i+"%"}}},{key:"_ifPopup",value:function(t,e){this.settings.parent&&this.settings.popup?t&&t(this.settings.popup):e&&e()}},{key:"_toggleDOM",value:function(t){var e,i=this.domElement;return!!i&&((e=i.style.display!==(t=t?"":"none"))&&(i.style.display=t),e)}}]);var Oe=Me,Xt=Zo(331),ke=Zo.n(Xt);function Me(t){fe(this,Me),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new xe,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}class Pe extends EventTarget{constructor(n,t){super(),this.fpdInstance=n,this.darkColor="#000",this.lightColor="#fff",this.container=document.createElement("fpd-module-qr-code"),t.append(this.container);const e=this.container.querySelector(".fpd-qr-code-color-dark"),i=(e.style.backgroundColor="#000",new Oe({parent:e,popup:"bottom",alpha:!1,color:this.darkColor,onChange:t=>{this.darkColor=b(t.rgbaString).toHexString(),e.style.backgroundColor=this.darkColor}}),this.container.querySelector(".fpd-qr-code-color-light"));i.style.backgroundColor=this.lightColor,new Oe({parent:i,popup:"bottom",alpha:!1,color:this.lightColor,onChange:t=>{this.lightColor=b(t.rgbaString).toHexString(),i.style.backgroundColor=this.lightColor}}),u(this.container.querySelector(".fpd-btn"),"click",t=>{o(this,"qrCodeModuleBtnClick");var e=this.container.querySelector('input[type="text"]').value;if(e&&0<e.length){const t=new(ke())({background:this.lightColor,backgroundAlpha:1,foreground:this.darkColor,foregroundAlpha:1,size:500,value:this.container.querySelector('input[type="text"]').value}),i=h(n.mainOptions.qrCodeProps,{_addToUZ:n.currentViewInstance.currentUploadZone,_isQrCode:!0});n._addCanvasImage(t.toDataURL(),"QR-Code: "+e,i)}})}}var Wt=Zo(729),_e=Zo.n(Wt);class De extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-save" data-defaulttext="Saved Designs" data-title="modules.save_load"> <div class="fpd-save-design"> <input type="text" data-defaulttext="Optional: Enter a title" placeholder="modules.save_load_input_placeholder"> <div class="fpd-btn"> <span data-defaulttext="Save Design">modules.save_load_add_btn</span> </div> </div> <div class="fpd-saved-designs fpd-scroll-area"> <div class="fpd-grid fpd-grid-contain"></div> </div> </div>'}}function Le(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-save-load",De);var Be=new WeakSet;class Fe extends EventTarget{constructor(i,t){super();var e,n=this;if((e=Be).has(n))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(this),this.fpdInstance=i,this.container=document.createElement("fpd-module-save-load"),t.append(this.container),this.inputElem=this.container.querySelector("input"),this.gridElem=this.container.querySelector(".fpd-grid"),u(this.container.querySelector(".fpd-btn"),"click",t=>{var e=Ut(this.fpdInstance.currentViewInstance.options.stageWidth,this.fpdInstance.currentViewInstance.options.stageHeight,300,300,"cover");i.viewInstances[0].toDataURL(e=>{var t=this.fpdInstance.getProduct(),e={thumbnail:e,product:t,title:this.inputElem.value||""};if(t&&this.fpdInstance.mainOptions.saveActionBrowserStorage){let t=Le(this,Be,je).call(this);t=t||[],this.addSavedProduct(e),t.push(e),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(t)),l(this.fpdInstance.translator.getTranslation("misc","product_saved"))}t&&(this.fpdInstance.dispatchEvent(new CustomEvent("actionSave",{detail:e})),this.fpdInstance.doUnsavedAlert=!1)},{multiplier:e,format:"png",backgroundColor:"transparent"})}),this.fpdInstance.mainOptions.saveActionBrowserStorage&&(n=Le(this,Be,je).call(this))&&0<n.length&&n.forEach(t=>{this.addSavedProduct(t)})}addSavedProduct(t){var{thumbnail:t,product:e,title:i=""}=t;const n=mt({url:t,title:i,removable:!0,disablePrice:!0,disableDraggable:!0});return this.fpdInstance.lazyBackgroundObserver.observe(n.querySelector("picture")),n.product=e,this.gridElem.append(n),u(n,"click",t=>{this.fpdInstance.loadProduct(n.product),this.fpdInstance.currentProductIndex=-1}),u(n.querySelector(".fpd-delete"),"click",t=>{t.stopPropagation();var e,t=t.currentTarget.parentNode,i=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t);this.fpdInstance.mainOptions.saveActionBrowserStorage&&((e=Le(this,Be,je).call(this)).splice(i,1),window.localStorage.setItem(this.fpdInstance.container.id,JSON.stringify(e))),this.fpdInstance.dispatchEvent(new CustomEvent("actionLoad:Remove",{detail:{index:i,item:t}})),t.remove()}),n}}function je(){return!!m()&&JSON.parse(window.localStorage.getItem(this.fpdInstance.container.id))}function Re(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}window.FPDSaveLoadModule=Fe;var Ne=new WeakSet;class He extends EventTarget{constructor(e){super();var t=this,i=Ne;if(i.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");i.add(this),Re(this,"currentActions",{}),this.fpdInstance=e,this.container=document.createElement("fpd-actions-bar"),e.container.append(this.container),this.leftActionsMenu=this.container.querySelector('[data-pos="left"] fpd-actions-menu'),this.leftActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_file")),this.centerActionsMenu=this.container.querySelector('[data-pos="center"] fpd-actions-menu'),this.rightActionsMenu=this.container.querySelector('[data-pos="right"] fpd-actions-menu'),this.rightActionsMenu.setAttribute("placeholder",this.fpdInstance.translator.getTranslation("actions","menu_more")),u(e.container.querySelectorAll(".fpd-close"),"click",t=>{d(this.fpdInstance.modalWrapper,["fpd-show"]),this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerClose"))}),u(e.container.querySelector(".fpd-done"),"click",t=>{this.fpdInstance.dispatchEvent(new CustomEvent("modalDesignerDone"))}),u(e,["viewSelect"],t=>{this.reset()}),u(window,"resize",t=>{e.inTextField||this.reset()}),u(window,["resize","fpdModalDesignerOpen"],()=>{this.leftActionsMenu&&this.leftActionsMenu.toggleMenus(),this.rightActionsMenu&&this.rightActionsMenu.toggleMenus()}),this.setup(e.mainOptions.actions)}addActionBtn(t,e){let i=2<arguments.length&&void 0!==arguments[2]&&arguments[2];if(He.availableActions.hasOwnProperty(e)){var n=He.availableActions[e],s=this.fpdInstance.translator.getTranslation("actions",e.replace(/-/g,"_"),n.title);if(i)n.type=e,n.title=s,n.handler=t=>{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)},t.items=[...t.items,n];else{const i=document.createElement("div");i.className="fpd-btn fpd-tooltip",i.setAttribute("aria-label",s),i.dataset.action=e,i.innerHTML=`<i class="${n.icon}"></i><span>${s}</span>`,He.toggleActions.includes(e)&&i.insertAdjacentHTML("beforeend",'<input type="checkbox" class="fpd-switch" />'),t.append(i),u(i,"click",t=>{var e=t.currentTarget.querySelector(".fpd-switch");e&&!t.target.classList.contains("fpd-switch")&&(e.checked=!e.checked),this.doAction(t.currentTarget.dataset.action)})}}}doAction(e){if(this.fpdInstance.currentViewInstance){if(this.fpdInstance.deselectElement(),"print"===e)this.fpdInstance.print();else if("reset-product"===e){var i=a(this.fpdInstance.translator.getTranslation("misc","reset_confirm"),!1,"confirm",this.fpdInstance.container);const e=i.querySelector(".fpd-confirm");e.innerText=this.fpdInstance.translator.getTranslation("actions","reset_product"),u(e,["click"],()=>{this.fpdInstance.loadProduct(this.fpdInstance.productViews),i.remove()})}else if("undo"===e)this.fpdInstance.currentViewInstance.fabricCanvas.undo();else if("redo"===e)this.fpdInstance.currentViewInstance.fabricCanvas.redo();else if("info"===e)a(this.fpdInstance.translator.getTranslation("actions","info_content"),!1,"",this.fpdInstance.container);else if("preview-lightbox"===e)this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=!1,this.fpdInstance.getProductDataURL(t=>{const e=new Image;e.src=t,e.onload=()=>{var t=a('<div style="background: url('+e.src+'); height: 90vh; width:100%; background-size:contain; background-repeat:no-repeat; background-position:center;"></div>',!0);o(this.fpdInstance,"actionPreviewModalOpen",{modal:t})},this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=this.fpdInstance.mainOptions.rulerFixed,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll()});else if("snap"===e)this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid=!this.fpdInstance.currentViewInstance.fabricCanvas.snapToGrid,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll();else if("zoom"===e){const a=this.fpdInstance.mainWrapper.container.querySelector(".fpd-zoom-wrapper");if(a)return void a.remove();const e=document.createElement("div"),i=(e.className="fpd-zoom-wrapper fpd-shadow-1",this.fpdInstance.currentViewInstance.fabricCanvas.getZoom()/this.fpdInstance.currentViewInstance.fabricCanvas.responsiveScale),n=document.createElement("fpd-range-slider"),s=(n.className="fpd-progress",n.setAttribute("value",i),n.setAttribute("step",.02),n.setAttribute("min",1),n.setAttribute("max",3),n.onInput=t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setResZoom(Number(t.currentTarget.value))},e.append(n),document.createElement("div"));s.className="fpd-stage-pan fpd-toggle",s.innerHTML='<span class="fpd-icon-drag"></span>',e.append(s),u(s,"click",t=>{this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas=!this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas,f(s,["fpd-active"],this.fpdInstance.currentViewInstance.fabricCanvas.panCanvas)});var t=document.createElement("div");t.className="fpd-close",t.innerHTML='<span class="fpd-icon-close"></span>',e.append(t),u(t,"click",t=>{e&&e.remove()}),this.fpdInstance.mainWrapper.container.append(e)}else if("download"===e){const e=`<div class="fpd-modal-download">
<span data-value="jpeg">
<span class="fpd-icon-jpg"></span>
</span>
<span data-value="png">
<span class="fpd-icon-png"></span>
</span>
<span data-value="pdf">
<span class="fpd-icon-pdf"></span>
</span>
<span data-value="svg">
<span class="fpd-icon-svg"></span>
</span>
<div class="fpd-switch-wrapper">
<input type="checkbox" class="fpd-switch" id="fpd-action-download-single-view" />
<label for="fpd-action-download-single-view">${this.fpdInstance.translator.getTranslation("actions","download_current_view")}</label>
</div>
</div>`,i=a(e,!1,"",this.fpdInstance.container);u(i.querySelectorAll("span[data-value]"),"click",t=>{this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=!1,this.downloadFile(t.currentTarget.dataset.value,i.querySelector(".fpd-switch").checked),i.remove(),this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=this.fpdInstance.mainOptions.rulerFixed,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll()})}else if("ruler"===e)this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler=!this.fpdInstance.currentViewInstance.fabricCanvas.enableRuler,this.fpdInstance.currentViewInstance.fabricCanvas.renderAll();else if("previous-view"===e)this.fpdInstance.selectView(this.fpdInstance.currentViewIndex-1);else if("next-view"===e)this.fpdInstance.selectView(this.fpdInstance.currentViewIndex+1);else if("guided-tour"===e&&this.fpdInstance.guidedTour)this.fpdInstance.guidedTour.start();else if("qr-code"===e){const e=this.fpdInstance.container.querySelector(".fpd-modal-internal"),i=(e&&e.remove(),a("",!1,"",this.fpdInstance.container)),r=new Pe(this.fpdInstance,i.querySelector(".fpd-modal-content"));this.fpdInstance.translator.translateArea(i),u(r,"qrCodeModuleBtnClick",()=>{i.remove()})}else if("save-load"===e){const e=this.fpdInstance.container.querySelector(".fpd-modal-internal"),i=(e&&e.remove(),a("",!1,"",this.fpdInstance.container));new Fe(this.fpdInstance,i.querySelector(".fpd-modal-content")),this.fpdInstance.translator.translateArea(i)}o(this.fpdInstance,"actionClick",{action:e})}}downloadFile(e){let a=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(this.fpdInstance.currentViewInstance){const o=this.fpdInstance.mainOptions.downloadFilename;var t,n;"jpeg"===e||"png"===e?(document.createElement("a"),t="jpeg"===e?"#fff":"transparent",a?this.fpdInstance.currentViewInstance.toDataURL(t=>{_e()(t,o+"."+e,"image/"+e)},{format:e,backgroundColor:t,watermarkImg:this.fpdInstance.watermarkImg}):this.fpdInstance.getProductDataURL(t=>{_e()(t,o+"."+e,"image/"+e)},{format:e,backgroundColor:t})):"svg"===e?_e()(this.fpdInstance.currentViewInstance.toSVG({suppressPreamble:!1,watermarkImg:this.fpdInstance.watermarkImg}),"Product_"+this.fpdInstance.currentViewIndex+".svg","image/svg+xml"):(n="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js",new Promise(function(t,e){var i;null===document.querySelector("script[src='"+n+"']")?((i=document.createElement("script")).onload=()=>{t()},i.onerror=()=>{e()},i.src=n,document.body.appendChild(i)):t()}).then(()=>{var t=e=>{let i;e="string"==typeof e?[e]:e;for(let t=0;t<e.length;++t){var n=a?this.fpdInstance.currentViewIndex:t,s=this.fpdInstance.viewInstances[n].options.stageWidth,n=this.fpdInstance.viewInstances[n].options.stageHeight,r=n<s?"l":"p";0!=t?i.addPage([s,n],r):i=new jspdf.jsPDF({orientation:r,unit:"px",format:[s,n]}),i.addImage(e[t],"PNG",0,0,i.internal.pageSize.getWidth(),i.internal.pageSize.getHeight())}i.save(o+".pdf")};jspdf&&(a?this.fpdInstance.currentViewInstance.toDataURL(t,{format:"png",watermarkImg:this.fpdInstance.watermarkImg}):this.fpdInstance.getViewsDataURL(t,{format:"png"}))}))}}reset(){var t=this.container.querySelectorAll(".fpd-switch"),t=(t&&t.forEach(t=>{t.checked=!1}),this.fpdInstance.mainWrapper.container.querySelector(".fpd-zoom-wrapper"));t&&t.remove(),this.fpdInstance.currentViewInstance&&this.fpdInstance.currentViewInstance.fabricCanvas.setResZoom(1)}setup(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if("object"==typeof(this.currentActions=t)){this.container.querySelectorAll("fpd-actions-menu").forEach(t=>{t.items=[]});for(const e in t)!function(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}(this,Ne,ze).call(this,e,t[e])}this.fpdInstance.translator.translateArea(this.container)}}function ze(i,t){Array.isArray(t)&&t.length?t.forEach(t=>{let e;"left"==i?e=this.leftActionsMenu:"center"==i?e=this.centerActionsMenu:"right"==i&&(e=this.rightActionsMenu),e&&this.addActionBtn(e,t,!0)}):"left"!=i&&"right"!=i||p(this.container.querySelector('[data-pos="'+i+'"]'),["fpd-visible-hidden"])}function We(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Ve(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}Re(He,"toggleActions",["ruler"]),Re(He,"availableActions",{print:{icon:"fpd-icon-print",title:"Print"},"reset-product":{icon:"fpd-icon-reset",title:"Reset Product"},undo:{icon:"fpd-icon-undo",title:"Undo"},redo:{icon:"fpd-icon-redo",title:"Redo"},info:{icon:"fpd-icon-info",title:"Info"},zoom:{icon:"fpd-icon-zoom-in",title:"Zoom"},download:{icon:"fpd-icon-download",title:"Download"},"preview-lightbox":{icon:"fpd-icon-preview-lightbox",title:"Preview Lightbox"},ruler:{icon:"fpd-icon-ruler",title:"Ruler"},"previous-view":{icon:"fpd-icon-back",title:"Previous View"},"next-view":{icon:"fpd-icon-forward",title:"Next View"},"guided-tour":{icon:"fpd-icon-guided-tour",title:"Guided Tour"},"qr-code":{icon:"fpd-icon-qrcode",title:"QR-Code"},"save-load":{icon:"fpd-icon-save",title:"Saved Designs"}}),window.FPDActions=He;var Ue=new WeakSet,Ye=new WeakSet;class qe extends HTMLElement{constructor(){super(),We(this,Ye),We(this,Ue),this.items=[]}connectedCallback(){this.innerHTML='<div class="fpd-uncollapsed-menu fpd-visible-hidden fpd-hidden"></div> <div class="fpd-collapsed-menu fpd-hidden"> <div class="fpd-dropdown-btn"> <i></i> <span class="fpd-label"></span> <div class="fpd-dropdown-menu fpd-shadow-1"></div> </div> </div>',this.uncollapsedMenu=this.querySelector(".fpd-uncollapsed-menu"),this.collapsedMenu=this.querySelector(".fpd-collapsed-menu"),this.collapsedMenu.querySelector(".fpd-dropdown-btn > i").className=this.dataset.fontIcon||"",u(this.collapsedMenu.querySelectorAll(".fpd-dropdown-btn"),"click",t=>{t=t.currentTarget.querySelector(".fpd-dropdown-menu");f(t,["fpd-show"],!t.classList.contains("fpd-show"))})}static get observedAttributes(){return["items","placeholder"]}attributeChangedCallback(t,e,i){e!==i&&"placeholder"==t&&this.collapsedMenu&&(this.collapsedMenu.querySelector(".fpd-dropdown-btn > .fpd-label").innerText=i)}get items(){return this._items}set items(t){this._items=t,Ve(this,Ue,Ge).call(this)}toggleMenus(){this.isConnected&&this.uncollapsedMenu&&(d(this.uncollapsedMenu,["fpd-hidden"]),(this.uncollapsedMenu.offsetWidth>this.offsetWidth&&!this.classList.contains("fpd-only-uncollapsed")?(p(this.uncollapsedMenu,["fpd-visible-hidden"]),p(this.uncollapsedMenu,["fpd-hidden"]),d):(d(this.uncollapsedMenu,["fpd-visible-hidden"]),p))(this.collapsedMenu,["fpd-hidden"]))}}function Ge(){Ve(this,Ye,Xe).call(this),this._items.forEach(t=>{var e=document.createElement("div"),i=(e.className="fpd-btn fpd-tooltip",e.setAttribute("aria-label",t.title),e.dataset.action=t.type,e.innerHTML=`<i class="${t.icon}"></i><span>${t.title}</span>`,He.toggleActions.includes(t.type)&&e.insertAdjacentHTML("beforeend",'<input type="checkbox" class="fpd-switch" />'),this.uncollapsedMenu.append(e),e.cloneNode(!0));this.collapsedMenu.querySelector(".fpd-dropdown-menu").append(i),u([e,i],"click",t.handler)}),this.toggleMenus()}function Xe(){this.isConnected&&this.uncollapsedMenu&&(this.uncollapsedMenu.innerHTML="",this.collapsedMenu.querySelector(".fpd-dropdown-menu").innerHTML="")}customElements.define("fpd-actions-menu",qe);class Ze extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-navigation fpd-scrollbar-hidden"></div> <div class="fpd-module-content"></div> <div class="fpd-secondary-content"> <div class="fpd-upload-zone-panel"> <div class="fpd-upload-zone-content"></div> <div class="fpd-bottom-nav fpd-module-tabs"> <div class="fpd-add-image" data-module="images"> <span class="fpd-icon-photo"></span> </div> <div class="fpd-add-text" data-module="text"> <span class="fpd-icon-text-secondary"></span> </div> <div class="fpd-add-design" data-module="designs"> <span class="fpd-icon-design-library"></span> </div> </div> </div> </div> <div class="fpd-close"> <span class="fpd-icon-close"></span> </div> <div class="fpd-draggable-dialog fpd-container fpd-shadow-2"> <div class="fpd-dialog-head"> <div class="fpd-dialog-drag-handle"> <div> <span class="fpd-icon-drag"></span><span class="fpd-dialog-title"></span> </div> </div> <div class="fpd-close-dialog"> <span class="fpd-icon-close"></span> </div> </div> </div> '}}customElements.define("fpd-main-bar",Ze);class Je extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-grid" data-defaulttext="Swap Product" data-title="modules.products"> <fpd-dropdown class="fpd-product-categories" searchable></fpd-dropdown> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-contain fpd-padding"> </div> </div> </div>'}}function Qe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Ke(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-products",Je);var $e=new WeakSet,ti=new WeakSet;class ei extends EventTarget{constructor(t,e){var i,n;super(),Qe(this,ti),Qe(this,$e),n=i="currentCategoryIndex",(i=String(n))in this?Object.defineProperty(this,i,{value:0,enumerable:!0,configurable:!0,writable:!0}):this[i]=0,this.fpdInstance=t,this.container=document.createElement("fpd-module-products"),e.append(this.container),t.addEventListener("productsSet",t=>{const n=this.container.querySelector(".fpd-dropdown-list > .fpd-scroll-area");n.innerHTML="",this.fpdInstance.products&&0<this.fpdInstance.products.length&&(void 0!==this.fpdInstance.products[0].category&&1<this.fpdInstance.products.length&&(this.container.classList.add("fpd-categories-enabled"),this.fpdInstance.products.forEach((t,e)=>{var i=document.createElement("span");i.className="fpd-item",i.dataset.index=e,i.innerText=t.category,i.addEventListener("click",t=>{this.selectCategory(t.currentTarget.dataset.index)}),n.append(i)})),Ke(this,$e,ii).call(this),this.selectCategory(0))}),t.addEventListener("productAdd",(t,e,i,n)=>{n==this.currentCategoryIndex&&Ke(this,ti,ni).call(this,e)})}selectCategory(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;if(this.currentCategoryIndex=e,this.container.querySelector(".fpd-grid").innerHTML="",this.fpdInstance.products&&0<this.fpdInstance.products.length){let t;void 0!==this.fpdInstance.products[0].category?(t=this.fpdInstance.products[e].products,this.container.querySelector(".fpd-dropdown-current").value=this.fpdInstance.products[e].category):t=this.fpdInstance.products,t.forEach((t,e)=>{Ke(this,ti,ni).call(this,t,e)})}}}function ii(){if(!this.fpdInstance.mainOptions.editorMode){let t=this.fpdInstance.products[0],e=void 0===t;void 0!==t&&(e=!!(!t.hasOwnProperty("category")&&this.fpdInstance.products.length<2||t.hasOwnProperty("category")&&t.products.length<2&&this.fpdInstance.products.length<2)),this.fpdInstance.container.classList.toggle("fpd-products-module-hidden",e);var i=this.fpdInstance.mainBar.navElem.querySelector(".fpd-active");e&&i&&"products"==i.dataset.module&&i.nextSibling&&i.nextSibling.click()}}function ni(t,i){var e=t[0].productThumbnail||t[0].thumbnail,t=t[0].productTitle||t[0].title,n=document.createElement("div"),t=(n.className="fpd-item fpd-hover-thumbnail",n.dataset.title=t,n.dataset.source=e,n.dataset.index=i,n.addEventListener("click",t=>{if(t.preventDefault(),this.fpdInstance.mainOptions.swapProductConfirmation){var e=a(this.fpdInstance.translator.getTranslation("modules","products_confirm_replacement"),!1,"confirm",this.fpdInstance.container);const t=e.querySelector(".fpd-confirm");t.innerText=this.fpdInstance.translator.getTranslation("modules","products_confirm_button"),u(t,["click"],()=>{this.fpdInstance.selectProduct(i,this.currentCategoryIndex),e.remove()})}else this.fpdInstance.selectProduct(Number(t.currentTarget.dataset.index),this.currentCategoryIndex)}),this.container.querySelector(".fpd-grid").append(n),document.createElement("picture"));t.dataset.img=e,n.append(t),this.fpdInstance.lazyBackgroundObserver.observe(t)}window.FPDProductsModule=ei;class si extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-text-secondary" data-defaulttext="Add Text" data-title="modules.text"> <div class="fpd-add-text"> <textarea data-defaulttext="Enter some text" placeholder="modules.text_input_placeholder"></textarea> <div class="fpd-btn"> <span data-defaulttext="Add Text">modules.text_add_btn</span> <span class="fpd-price"></span> </div> </div> <div class="fpd-text-templates fpd-scroll-area"> <div class="fpd-grid fpd-padding"></div> </div> </div>'}}customElements.define("fpd-module-text",si);class ri extends EventTarget{constructor(r,t){var s;super(),this.fpdInstance=r,this.container=document.createElement("fpd-module-text"),t.append(this.container),this.container.querySelector(".fpd-btn").addEventListener("click",t=>{var e=this.container.querySelector("textarea"),i=e.value;if(r.currentViewInstance&&0<i.length){const t=r.currentViewInstance.options;var n=h(t.customTextParameters,{textBox:Boolean(this.fpdInstance.mainOptions.customTextAsTextbox),resizable:!0,isCustom:!0,_addToUZ:r.currentViewInstance.currentUploadZone,_calcWidth:!0});r.currentViewInstance.fabricCanvas.addElement("text",i,i,n)}e.value=""}),u(this.container.querySelector("textarea"),["input","change"],t=>{var e=r.currentViewInstance.options;let i=t.currentTarget.value,n=e.customTextParameters.maxLength,s=e.customTextParameters.maxLines;i=i.replace(FancyProductDesigner.forbiddenTextChars,""),r.mainOptions.disableTextEmojis&&(i=(i=i.replace(FPDEmojisRegex,"")).replace(String.fromCharCode(65039),"")),0!=n&&i.length>n&&(i=i.substr(0,n)),0!=s&&i.split("\n").length>s&&(i=i.replace(/([\s\S]*)\n/,"$1")),t.currentTarget.value=i}),u(r,["viewSelect","secondaryModuleCalled"],e=>{if(r.currentViewInstance){var i=r.currentViewInstance.options;let t=null;if(r.currentViewInstance.currentUploadZone&&this.container.parentNode.classList.contains("fpd-upload-zone-content")){const e=r.currentViewInstance.fabricCanvas.getUploadZone(r.currentViewInstance.currentUploadZone);ut(e,"price")&&(t=e.price)}i=ut(i,"customTextParameters.price",0),i=(null==t&&i&&(t=i),this.container.querySelector(".fpd-btn > .fpd-price"));i&&(i.innerHTML=t?" - "+r.formatPrice(t):"")}}),Array.isArray(r.mainOptions.textTemplates)&&(s=this.container.querySelector(".fpd-text-templates .fpd-grid"),r.mainOptions.textTemplates.forEach(i=>{var t=i.properties,e="font-family:"+(t.fontFamily||"Arial"),t=(e+="; text-align:"+(t.textAlign||"left"),document.createElement("div")),n=(t.className="fpd-item",t.addEventListener("click",t=>{if(r.currentViewInstance){const t=r.currentViewInstance.options;var e={...i.properties},e=(e.isCustom=!0,e.textBox=Boolean(this.fpdInstance.mainOptions.customTextAsTextbox),e.resizable=!0,e._addToUZ=r.currentViewInstance.currentUploadZone,e._calcWidth=!0,h(t.customTextParameters,e));r.currentViewInstance.fabricCanvas.addElement("text",i.text,i.text,e)}}),document.createElement("div"));n.setAttribute("style",e),n.innerHTML=i.text.replace(/(?:\r\n|\r|\n)/g,"<br>"),t.append(n),s.append(t)}))}}window.FPDTextsModule=ri;class ai extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-design-library" data-defaulttext="Add Designs" data-title="modules.designs"> <div class="fpd-head"> <div class="fpd-input-back-search"> <div class="fpd-back fpd-btn"> <span class="fpd-icon-back"></span> </div> <div class="fpd-input-search"> <input type="text"/> <span class="fpd-icon-magnify"></span> </div> </div> </div> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-contain fpd-padding"></div> </div> </div>'}}function oi(t,e){ci(t,e),e.add(t)}function li(t,e,i){ci(t,e),e.set(t,i)}function ci(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function hi(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}function S(t,e){return(e=ui(t=t,e,"get")).get?e.get.call(t):e.value}function di(t,e,i){var n=t,t=ui(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function ui(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}customElements.define("fpd-module-designs",ai);var pi=new WeakMap,fi=new WeakMap,gi=new WeakMap,mi=new WeakMap,vi=new WeakMap,bi=new WeakSet,yi=new WeakSet,xi=new WeakSet,wi=new WeakSet;class Ci extends EventTarget{constructor(i,t){var e=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;super(),oi(this,wi),oi(this,xi),oi(this,yi),oi(this,bi),li(this,pi,{writable:!0,value:""}),li(this,fi,{writable:!0,value:!1}),li(this,gi,{writable:!0,value:[]}),li(this,mi,{writable:!0,value:null}),li(this,vi,{writable:!0,value:null}),di(this,pi,i.translator.getTranslation("modules","designs_search_in","Search in").toUpperCase()),this.fpdInstance=i,di(this,vi,e),this.container=document.createElement("fpd-module-designs"),t.append(this.container),e&&(this.container.dataset.dynamicDesignsId=e),this.headElem=this.container.querySelector(".fpd-head"),this.gridElem=this.container.querySelector(".fpd-grid"),this.headElem.querySelector(".fpd-input-search input").addEventListener("keyup",t=>{var e=t.currentTarget,i=this.gridElem.querySelectorAll(".fpd-item");if(""==e.value)for(var n of i)n.classList.remove("fpd-hidden");else{const t=e.value.toLowerCase().trim();for(var s of i)s.classList.add("fpd-hidden"),s.dataset.search.includes(t)&&s.classList.remove("fpd-hidden")}}),u(this.headElem.querySelector(".fpd-back"),"click",t=>{0<this.gridElem.querySelectorAll(".fpd-category").length&&S(this,gi).pop();let e,i=this.fpdInstance.designs;S(this,gi).forEach(t=>{e=i[t],i=e.category}),di(this,mi,i),i&&hi(this,bi,Si).call(this,S(this,mi),e),void 0===e&&this.toggleCategories()});let n=!1;u(i,["designsSet"],t=>{var e;n||(n=!0,e=i.designs,Array.isArray(e)&&0!==e.length&&(e[0].hasOwnProperty("source")?(this.container.classList.add("fpd-single-cat"),hi(this,xi,Ti).call(this,e)):1<e.length||e[0].category?(di(this,fi,!0),this.toggleCategories()):1===e.length&&e[0].designs&&(this.container.classList.add("fpd-single-cat"),hi(this,xi,Ti).call(this,e[0].designs))))}),u(i,"viewSelect",()=>{this.toggleCategories()})}toggleCategories(){if(S(this,fi)){di(this,gi,[]),this.container.classList.remove("fpd-head-visible","fpd-single-cat"),di(this,mi,this.fpdInstance.designs),hi(this,bi,Si).call(this,S(this,mi));let t=[];if("string"==typeof S(this,vi))t=this.fpdInstance.mainOptions.dynamicDesigns[S(this,vi)].categories;else if(this.fpdInstance.currentViewInstance){const e=this.fpdInstance.currentElement;t=(e&&e.uploadZone&&e.designCategories?this.fpdInstance.currentElement:this.fpdInstance.currentViewInstance.options).designCategories}t=t.map(t=>t.toLowerCase());var e=this.container.querySelectorAll(".fpd-category");if(0<t.length){var i,n=[];for(i of e)t.includes(i.dataset.title.toLowerCase())?(i.classList.remove("fpd-hidden"),n.push(i)):i.classList.add("fpd-hidden");1===n.length&&(this.container.classList.add("fpd-single-cat"),n[0].click())}else for(var s of e)s.classList.remove("fpd-hidden")}}}function Si(t,e){this.gridElem.innerHTML="",this.headElem.querySelector(".fpd-input-search input").value="",this.container.classList.remove("fpd-designs-active"),this.container.classList.add("fpd-categories-active"),t.forEach((t,e)=>{hi(this,yi,Ei).call(this,t)}),e&&(this.headElem.querySelector(".fpd-input-search input").setAttribute("placeholder",S(this,pi)+" "+e.title.toUpperCase()),this.container.classList.add("fpd-head-visible"))}function Ei(t){var e,i=document.createElement("div");i.className="fpd-category fpd-item",i.dataset.title=t.title,i.dataset.search=t.title.toLowerCase(),t.thumbnail?((e=document.createElement("picture")).dataset.img=t.thumbnail,i.append(e),this.fpdInstance.lazyBackgroundObserver.observe(e),(e=document.createElement("span")).innerText=t.title,i.append(e)):i.innerHTML="<span>"+t.title+"</span>",i.addEventListener("click",t=>{var t=t.currentTarget,e=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t),i=S(this,mi)[e];i.category?(S(this,gi).push(e),di(this,mi,i.category),hi(this,bi,Si).call(this,S(this,mi),i)):hi(this,xi,Ti).call(this,i.designs,i.parameters),this.headElem.querySelector(".fpd-input-search input").setAttribute("placeholder",S(this,pi)+" "+t.dataset.search.toUpperCase())}),this.gridElem.append(i)}function Ti(t){let e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.gridElem.innerHTML="",this.headElem.querySelector(".fpd-input-search input").value="",this.container.classList.remove("fpd-categories-active"),this.container.classList.add("fpd-designs-active","fpd-head-visible"),t.forEach(t=>{t.parameters=h(e,t.parameters),hi(this,wi,Ai).call(this,t)})}function Ai(t){t.thumbnail=void 0===t.thumbnail?t.source:t.thumbnail;var e=vt(this.fpdInstance,this.container,t.parameters.price),e=mt({url:t.source,thumbnailUrl:t.thumbnail,title:t.title,price:e,disablePrice:!Boolean(e)});e.dataset.search=t.title.toLowerCase(),e.parameters=t.parameters,e.addEventListener("click",t=>{t=t.currentTarget;this.fpdInstance.addCanvasDesign(t.dataset.source,t.dataset.title,t.parameters)}),this.gridElem.append(e),this.fpdInstance.lazyBackgroundObserver.observe(e.querySelector("picture"))}window.FPDDesignsModule=Ci;class Ii extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-images" data-defaulttext="Add Image" data-title="modules.images"> <div class="fpd-module-tabs"> <div data-context="upload" class="fpd-active fpd-tooltip" data-defaulttext="Uploads" title="modules.uploads"> <span class="fpd-icon-cloud-upload"></span> </div> <div data-context="facebook" class="fpd-hidden fpd-tooltip" aria-label="Facebook"> <span class="fpd-icon-facebook"></span> </div> <div data-context="instagram" class="fpd-hidden fpd-tooltip" aria-label="Instagram"> <span class="fpd-icon-instagram"></span> </div> <div data-context="pixabay" class="fpd-hidden fpd-tooltip" aria-label="Pixabay"> <span class="fpd-icon-pixabay"></span> </div> <div data-context="qr-code" class="fpd-tooltip" data-defaulttext="QR-Code" title="actions.qr_code"> <span class="fpd-icon-qrcode"></span> </div> <div data-context="text2Img" class="fpd-hidden fpd-tooltip" data-defaulttext="Text to Images" title="modules.text_to_images"> <span class="fpd-icon-ai"></span> </div> </div> <div class="fpd-module-tabs-content"> <div data-context="upload" class="fpd-active"></div> <div data-context="facebook"></div> <div data-context="instagram"></div> <div data-context="pixabay"></div> <div data-context="qr-code"></div> <div data-context="text2Img"></div> </div> </div>'}}customElements.define("fpd-module-images",Ii);class Oi extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-upload-image"> <span data-defaulttext="Drop images here">modules.upload_zone</span> <span class="fpd-btn" data-defaulttext="Browse File">modules.browse_file</span> <span class="fpd-price"></span> </div> <input type="file" multiple="multiple" class="fpd-upload-input fpd-hidden" name="files[]" accept="image/jpeg,image/jpg,image/png,image/svg+xml,application/pdf"/> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-cover fpd-photo-grid"></div> </div>'}}function ki(t,e){Pi(t,e),e.add(t)}function Mi(t,e,i){Pi(t,e),e.set(t,i)}function Pi(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function E(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}function T(t,e){return(e=Di(t=t,e,"get")).get?e.get.call(t):e.value}function _i(t,e,i){var n=t,t=Di(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function Di(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}customElements.define("fpd-module-uploads",Oi);var Li=new WeakMap,A=new WeakMap,Bi=new WeakMap,Fi=new WeakMap,ji=new WeakMap,Ri=new WeakSet,Ni=new WeakSet,Hi=new WeakSet,zi=new WeakSet,Wi=new WeakSet,Vi=new WeakSet,Ui=new WeakSet,Yi=new WeakSet,qi=new WeakSet;class Gi extends EventTarget{constructor(i,t){super(),ki(this,qi),ki(this,Yi),ki(this,Ui),ki(this,Vi),ki(this,Wi),ki(this,zi),ki(this,Hi),ki(this,Ni),ki(this,Ri),Mi(this,Li,{writable:!0,value:void 0}),Mi(this,A,{writable:!0,value:0}),Mi(this,Bi,{writable:!0,value:!1}),Mi(this,Fi,{writable:!0,value:[]}),Mi(this,ji,{writable:!0,value:0}),this.fpdInstance=i,this.container=document.createElement("fpd-module-uploads"),t.append(this.container),this.gridElem=this.container.querySelector(".fpd-grid");t=this.container.querySelector(".fpd-upload-image");_i(this,Li,i.mainOptions.allowedImageTypes),T(this,Li).includes("jpeg")&&!T(this,Li).includes("jpg")&&T(this,Li).push("jpg");const e=this.container.querySelector(".fpd-upload-input");let n=[];if(T(this,Li).forEach(t=>{"pdf"==t?n.push("application/pdf"):("svg"==t&&(t+="+xml"),n.push("image/"+t))}),e.setAttribute("accept",n.join()),u(t,"click",async t=>{t.preventDefault(),e.click()}),u(e,"change",t=>{E(this,Ri,Xi).call(this,t.currentTarget.files)}),u(t,["dragover","dragleave"],t=>{t.stopPropagation(),t.preventDefault(),t.currentTarget.classList.toggle("fpd-hover","dragover"===t.type)}),u(t,"drop",t=>{t.stopPropagation(),t.preventDefault();t=t.target.files||t.dataTransfer.files;E(this,Ri,Xi).call(this,t)}),u(i,"productCreate",t=>{_i(this,Bi,!1)}),m()&&window.localStorage.getItem("fpd_uploaded_images")){const i=JSON.parse(window.localStorage.getItem("fpd_uploaded_images"));i.forEach(t=>{E(this,Ui,tn).call(this,t.url,t.title);var e=new Image;e.src=t.url,e.onerror=()=>{i.forEach((t,e)=>{i.splice(e,1)})}}),window.localStorage.setItem("fpd_uploaded_images",JSON.stringify(i))}}}function Xi(t){var e,i;this.fpdInstance.mainOptions.uploadAgreementModal?((i=(e=a(this.fpdInstance.translator.getTranslation("modules","images_agreement"),!1,"confirm",this.fpdInstance.container)).querySelector(".fpd-confirm")).innerText=this.fpdInstance.translator.getTranslation("modules","images_confirm_button"),u(i,["click"],()=>{E(this,Ni,Zi).call(this,t),e.remove()})):E(this,Ni,Zi).call(this,t)}function Zi(t){_i(this,A,0),_i(this,ji,t.length);for(var e=0;e<this.fpdInstance.viewInstances.length;++e)this.fpdInstance.getElements(e).forEach(t=>{t.uploadZone&&T(this,Fi).push({uz:t.title,viewIndex:e})});this.fpdInstance.loadingCustomImage=!0,Array.from(t).forEach((t,e)=>{T(this,Li).includes(yt(t.name))&&E(this,Hi,Ji).call(this,t,0==e)}),this.container.querySelector(".fpd-upload-image").classList.remove("fpd-hover"),this.container.querySelector(".fpd-upload-input").value=""}function Ji(t,e){var i=1024*this.fpdInstance.mainOptions.customImageParameters.maxSize*1024;t.size>i?(l(this.fpdInstance.translator.getTranslation("misc","maximum_size_info").replace("%filename",t.name).replace("%mb",this.fpdInstance.mainOptions.customImageParameters.maxSize)),this.fpdInstance.loadingCustomImage=!1):("application/pdf"===t.type?E(this,Wi,Ki):E(this,zi,Qi)).call(this,t,e)}function Qi(s){let r=1<arguments.length&&void 0!==arguments[1]&&arguments[1];const i=this.fpdInstance.mainOptions,t=new FileReader;t.onload=t=>{const e=t.currentTarget.result,n=E(this,Ui,tn).call(this,e,s.name);if(FancyProductDesigner.uploadsToServer){if(!i.fileServerURL)return n.remove(),void alert("You need to set the fileServerURL in the option, otherwise file uploading does not work!");n.classList.add("fpd-loading"),n.insertAdjacentHTML("beforeend",'<div class="fpd-loading-bar"><div class="fpd-loading-progress"></div></div>')}t=new Image;t.onload=t=>{const i=t.currentTarget;var t=i.height,e=i.width;if(bt(this.fpdInstance,e,t))if(FancyProductDesigner.uploadsToServer){const t=new FormData,i=(t.append("images[]",s),new XMLHttpRequest);i.responseType="json",i.onreadystatechange=t=>{if(i.readyState===XMLHttpRequest.DONE){const t=i.status;if(0===t||200<=t&&t<400){const t=i.response;var e;t.image_src&&(E(this,Vi,$i).call(this,t.image_src,t.filename),n.dataset.source=t.image_src,n.classList.remove("fpd-loading"),n.querySelector(".fpd-loading-bar").remove(),E(this,Yi,en).call(this,n,r),_i(this,A,(e=T(this,A),++e)),n.xhr=null),this.fpdInstance.loadingCustomImage=!1}}},i.upload.onprogress=t=>{var e=t.total,t=t.loaded,t=parseInt(100*t/e);n.querySelector(".fpd-loading-progress").style.width=t+"%"},i.upload.onerror=t=>{this.fpdInstance.loadingCustomImage=!1,n.remove(),l("Upload failed. Please try again or check your web console!")},i.open("POST",this.fpdInstance.getFileServerURL()),i.send(t),n.xhr=i}else E(this,Vi,$i).call(this,i,s.name),E(this,Yi,en).call(this,n,r),_i(this,A,(e=T(this,A),++e));else n.remove(),this.fpdInstance.currentViewInstance.currentUploadZone=null},t.src=e},t.readAsDataURL(s)}function Ki(t){this.fpdInstance.mainOptions;const i=l(this.fpdInstance.translator.getTranslation("modules","images_pdf_upload_info"),!1),e=new FormData,n=(e.append("pdf",t),new XMLHttpRequest);n.responseType="json",n.onreadystatechange=t=>{if(n.readyState===XMLHttpRequest.DONE){const t=n.status;if(0===t||200<=t&&t<400){var e;const t=n.response;_i(this,ji,(e=T(this,ji),--e)),t.pdf_images.forEach((t,e)=>{var i=E(this,Ui,tn).call(this,t.image_url,t.filename);E(this,Yi,en).call(this,i,0==e),E(this,Vi,$i).call(this,t.image_url,t.filename),_i(this,A,(i=T(this,A),++i))}),i.remove(),_i(this,ji,(e=T(this,ji),++e)),this.fpdInstance.loadingCustomImage=!1}}},n.upload.onerror=()=>{this.fpdInstance.loadingCustomImage=!1,i.remove(),l("Upload failed. Please try again or check your web console!")},n.open("POST",this.fpdInstance.getFileServerURL()),n.send(e)}function $i(t,e){var i;m()&&((i=window.localStorage.getItem("fpd_uploaded_images")?JSON.parse(window.localStorage.getItem("fpd_uploaded_images")):[]).push({url:t,title:e}),window.localStorage.setItem("fpd_uploaded_images",JSON.stringify(i)))}function tn(t,e){const i=mt({url:t,title:e,price:vt(this.fpdInstance,this.container),removable:!0});return E(this,qi,nn).call(this,i,t),this.gridElem.append(i),this.fpdInstance.lazyBackgroundObserver.observe(i.querySelector("picture")),u(i,["click"],t=>{this.fpdInstance.loadingCustomImage||this.fpdInstance._addGridItemToCanvas(t.currentTarget,{},void 0,!1)}),u(i.querySelector(".fpd-delete"),"click",t=>{t.stopPropagation(),t.preventDefault();var e,t=Array.from(this.gridElem.children).indexOf(i);i.classList.contains("fpd-loading")||((e=JSON.parse(window.localStorage.getItem("fpd_uploaded_images"))).splice(t,1),window.localStorage.setItem("fpd_uploaded_images",JSON.stringify(e)),i.xhr&&i.xhr.abort(),i.remove())}),i}function en(t,e){if(!T(this,Bi)&&this.fpdInstance.mainOptions.autoFillUploadZones){const e=T(this,Fi)[T(this,A)]?T(this,Fi)[T(this,A)]:null;e&&this.fpdInstance._addGridItemToCanvas(t,{_addToUZ:e.uz},e.viewIndex,!1)}else e&&this.fpdInstance._addGridItemToCanvas(t,{},void 0,!1);T(this,A)==T(this,ji)-1&&_i(this,Bi,!0)}function nn(o,t){var e=this.fpdInstance.mainOptions.imageQualityRatings;if(e&&"object"==typeof e){let i=e.low||null,n=e.mid||null,s=e.high||null,r="fpd-icon-star",a="fpd-icon-star-outline";const l=new Image;l.onload=()=>{var t=document.createElement("div");let e;if(t.className="fpd-image-quality-ratings",o.append(t),i&&2==i.length){const o=l.width<Number(i[0])||l.height<Number(i[1])?a:r,n=document.createElement("span");n.className=o,t.append(n),o==r&&(e=this.fpdInstance.translator.getTranslation("misc","image_quality_rating_low"))}if(n&&2==n.length){const o=l.width<Number(n[0])||l.height<Number(n[1])?a:r,i=document.createElement("span");i.className=o,t.append(i),o==r&&(e=this.fpdInstance.translator.getTranslation("misc","image_quality_rating_mid"))}if(s&&2==s.length){const o=l.width<Number(s[0])||l.height<Number(s[1])?a:r,i=document.createElement("span");i.className=o,t.append(i),o==r&&(e=this.fpdInstance.translator.getTranslation("misc","image_quality_rating_high"))}e&&(t.dataset.qualityLabel=e)},l.src=t}}window.FPDUploadsModule=Gi;class sn extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-head"> <div class="fpd-facebook-login"> <fb:login-button data-max-rows="1" data-show-faces="false" data-scope="user_photos"> </fb:login-button> </div> <fpd-dropdown class="fpd-facebook-albums" placeholder="Select An Album" searchable></fpd-dropdown> </div> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-cover fpd-photo-grid"></div> </div>'}}function rn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function an(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-facebook-images",sn);var on=new WeakSet,ln=new WeakSet,cn=new WeakSet;class hn extends EventTarget{constructor(t,e){super(),rn(this,cn),rn(this,ln),rn(this,on),this.fpdInstance=t,this.container=document.createElement("fpd-module-facebook-images"),e.append(this.container),this.dropdown=this.container.querySelector("fpd-dropdown"),this.dropdownList=this.container.querySelector(".fpd-dropdown-list > .fpd-scroll-area"),this.gridElem=this.container.querySelector(".fpd-grid"),an(this,on,dn).call(this)}}function dn(){var t=document.createElement("script");t.src="//connect.facebook.com/en_US/sdk.js",t.addEventListener("load",()=>{FB.init({appId:this.fpdInstance.mainOptions.facebookAppId,autoLogAppEvents:!0,xfbml:!0,version:"v16.0"}),FB.getLoginStatus(an(this,ln,un).bind(this)),FB.Event.subscribe("auth.statusChange",an(this,ln,un).bind(this))}),document.body.appendChild(t)}function un(t){"connected"===t.status&&(p(this.container,["fpd-facebook-logged-in"]),FB.api("/me/albums?fields=name,count,id",t=>{t=t.data;t&&t.forEach(t=>{var e=document.createElement("span");e.className="fpd-item",e.dataset.albumid=t.id,e.innerText=t.name,e.addEventListener("click",t=>{this.dropdown.setAttribute("value",t.currentTarget.innerText),an(this,cn,pn).call(this,t.currentTarget.dataset.albumid)}),this.dropdownList.append(e)}),d(this.dropdown,["fpd-on-loading"])}))}function pn(e){this.gridElem.innerHTML="",p(this.dropdown,["fpd-on-loading"]),FB.api("/"+e+"?fields=count",t=>{t=t.count;FB.api("/"+e+"?fields=photos.limit("+t+").fields(source,images)",t=>{d(this.dropdown,["fpd-on-loading"]),t.error||t.photos.data.forEach(t=>{var e=(t.images[0]||t).source,i=(t.images[t.images.length-1]?t.images[t.images.length-1]:t).source,e=mt({url:e,thumbnailUrl:i,title:t.id,price:vt(this.fpdInstance,this.container)});u(e,["click"],t=>{this.fpdInstance.loadingCustomImage||this.fpdInstance._addGridItemToCanvas(t.currentTarget)}),this.gridElem.append(e),this.fpdInstance.lazyBackgroundObserver.observe(e.querySelector("picture"))}),this.fpdInstance.toggleSpinner(!1)})})}class fn extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-cover fpd-photo-grid"></div> </div>'}}function gn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function mn(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function vn(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-instagram-images",fn);var bn=new WeakSet,yn=new WeakSet,xn=new WeakSet;class wn extends EventTarget{constructor(t,e){super(),gn(this,xn),gn(this,yn),gn(this,bn),mn(this,"accessToken",null),mn(this,"nextStack",null),mn(this,"loadingStack",!1),mn(this,"scrollArea",null),this.fpdInstance=t,this.container=document.createElement("fpd-module-instagram-images"),e.append(this.container),this.gridElem=this.container.querySelector(".fpd-grid"),this.scrollArea=this.container.querySelector(".fpd-scroll-area"),this.scrollArea.addEventListener("scroll",vn(this,xn,En).bind(this))}authenticate(){const t=this.fpdInstance.mainOptions;if(m()){const t=window.localStorage.getItem("fpd_insta_access_token");if(!g(t))return this.accessToken=t,void vn(this,yn,Sn).call(this)}var e=(window.screen.width-700)/2,i=(window.screen.height-500)/2,n={app_id:t.instagramClientId,redirect_uri:t.instagramRedirectUri,scope:"user_profile,user_media",response_type:"code"},n=new URLSearchParams(n).toString(),s=window.open("https://api.instagram.com/oauth/authorize?"+n,"","width=700,height=500,left="+e+",top="+i),r=setInterval(()=>{s.closed&&clearInterval(r);try{var t;s.location&&s.location.href&&(t=new URL(s.location.href).searchParams.get("code"))&&(t=t.replace("#_",""),vn(this,bn,Cn).call(this,t),s.close())}catch(t){}},500)}}function Cn(t){var e=this.fpdInstance.mainOptions;this.fpdInstance.toggleSpinner(!0),se({url:e.instagramTokenUri,params:{code:t,client_app_id:e.instagramClientId,redirect_uri:e.instagramRedirectUri},onSuccess:t=>{t.access_token?(m()&&window.localStorage.setItem("fpd_insta_access_token",t.access_token),this.accessToken=t.access_token,vn(this,yn,Sn).call(this)):t.error_message&&this.fpdInstance.toggleSpinner(!1)},onError:t=>{this.fpdInstance.toggleSpinner(!1)}})}function Sn(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"https://graph.instagram.com/me/media",e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],t=(this.loadingStack=!0,this.fpdInstance.toggleSpinner(!0),{url:t,onSuccess:t=>{t.data&&(this.nextStack=t.paging&&t.paging.next?t.paging.next:null,t.data.forEach(t=>{"VIDEO"!==t.media_type&&(t=mt({url:t.media_url,thumbnailUrl:t.thumbnail_url||t.media_url,title:t.id,price:vt(this.fpdInstance,this.container)}),u(t,["click"],t=>{this.fpdInstance.loadingCustomImage||this.fpdInstance._addGridItemToCanvas(t.currentTarget)}),this.gridElem.append(t),this.fpdInstance.lazyBackgroundObserver.observe(t.querySelector("picture")))})),this.fpdInstance.toggleSpinner(!1),this.loadingStack=!1,vn(this,xn,En).call(this)},onError:t=>{t.response&&t.response.error&&t.response.error.code&&m()&&190==t.response.error.code&&(window.localStorage.removeItem("fpd_insta_access_token"),this.accessToken=null,this.authenticate()),this.fpdInstance.toggleSpinner(!1),this.loadingStack=!1}});e&&(this.gridElem.innerHTML="",t.params={fields:"id,caption,media_url,media_type",access_token:this.accessToken}),se(t)}function En(){var t=this.scrollArea.scrollHeight;(this.scrollArea.clientHeight+this.scrollArea.scrollTop+100>t||this.gridElem.clientHeight<t)&&null!==this.nextStack&&!this.loadingStack&&vn(this,yn,Sn).call(this,this.nextStack,!1)}class Tn extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-loader-wrapper"> <div class="fpd-loader"> <div class="fpd-loader-circle"></div> </div> </div> <div class="fpd-head"> <a href="https://pixabay.com/" target="_blank" class="fpd-pixabay-logo"> </a> <div class="fpd-input-search"> <input type="text" data-defaulttext="Search in Pixabay library" placeholder="modules.pixabay_search"/> <span class="fpd-icon-magnify"></span> </div> </div> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-cover fpd-photo-grid"></div> </div>'}}customElements.define("fpd-module-pixabay-images",Tn);class An extends EventTarget{loadingStack=!1;currentQuery="";pixabayPage=1;constructor(t,e){super(),this.fpdInstance=t,this.container=document.createElement("fpd-module-pixabay-images"),e.append(this.container),this.gridElem=this.container.querySelector(".fpd-grid"),this.loader=this.container.querySelector(".fpd-loader-wrapper");const i=this.container.querySelector(".fpd-scroll-area");i.addEventListener("scroll",t=>{var e=i.scrollHeight;i.clientHeight+i.scrollTop+100>e&&(this.loadingStack||(this.pixabayPage++,this.loadImages(void 0,!1)))}),u(this.container.querySelector("input"),["keypress"],t=>{13==t.which&&(this.pixabayPage=1,this.loadImages(t.currentTarget.value))})}loadImages(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];if(this.currentQuery===t)return!1;var i=this.fpdInstance.mainOptions,t=(this.loadingStack=!0,this.currentQuery=void 0===t?this.currentQuery:t,i.pixabayHighResImages?"&response_group=high_resolution":""),t="https://pixabay.com/api/?safesearch=true&key="+i.pixabayApiKey+"&page="+this.pixabayPage+"&per_page=40&min_width="+i.customImageParameters.minW+"&min_height="+i.customImageParameters.minH+t+"&q="+encodeURIComponent(this.currentQuery)+"&lang="+i.pixabayLang;e&&(this.gridElem.innerHTML=""),d(this.loader,["fpd-hidden"]),se({url:t,onSuccess:t=>{p(this.loader,["fpd-hidden"]),0<t.hits.length&&t.hits.forEach(t=>{t=mt({url:t.imageURL||t.webformatURL,thumbnailUrl:t.webformatURL,title:t.id||t.id_hash,price:vt(this.fpdInstance,this.container)});u(t,["click"],t=>{this.fpdInstance.loadingCustomImage||this.fpdInstance._addGridItemToCanvas(t.currentTarget)}),this.gridElem.append(t),this.fpdInstance.lazyBackgroundObserver.observe(t.querySelector("picture"))}),this.loadingStack=!1},onError:t=>{p(this.loader,["fpd-hidden"])}})}}class In extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-head"> <div class="fpd-info" data-defaulttext="Describe your image">modules.text_to_images_info</div> <textarea placeholder="e.g. Beautiful sunset with a white sandy beach"></textarea> <span class="fpd-btn" data-defaulttext="Generate">modules.text_to_images_generate</span> </div> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-cover fpd-photo-grid"></div> </div>'}}function On(t,e){kn(t,e),e.add(t)}function kn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mn(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}function Pn(t,e,i){var n=t,t=_n(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function _n(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}customElements.define("fpd-module-text-to-image",In);var Dn=new WeakMap,Ln=new WeakSet,Bn=new WeakSet;class Fn extends EventTarget{constructor(n,t){var e,i;super(),On(this,Bn),On(this,Ln),i={writable:!0,value:!1},kn(this,e=Dn),e.set(this,i),this.fpdInstance=n,this.container=document.createElement("fpd-module-text-to-image"),t.append(this.container),this.inputElem=this.container.querySelector(".fpd-head textarea"),this.gridElem=this.container.querySelector(".fpd-grid"),this.container.querySelector(".fpd-head .fpd-btn").addEventListener("click",t=>{const e=t.currentTarget;var i;g(this.inputElem.value)||((i=_n(t=t=this,Dn,"get")).get?i.get.call(t):i.value)||(Pn(this,Dn,!0),e.classList.add("fpd-loading"),re({url:n.mainOptions.aiService.serverURL,body:{service:"text2Img",prompt:this.inputElem.value},onSuccess:t=>{t&&t.images?(Mn(this,Bn,Rn).call(this,t.images),t.images.forEach(t=>{var e;m()&&((e=(e=window.localStorage.getItem("fpd_ai_images"))?JSON.parse(e):[]).push(t),window.localStorage.setItem("fpd_ai_images",JSON.stringify(e)))})):n.aiRequestError(t.error),Pn(this,Dn,!1),e.classList.remove("fpd-loading")},onError:()=>{Pn(this,Dn,!1),e.classList.remove("fpd-loading"),n.aiRequestError.bind(n)}}))}),u(n,"productCreate",Mn(this,Ln,jn).bind(this))}}function jn(){this.gridElem.innerHTML="";var t=window.localStorage.getItem("fpd_ai_images");m()&&t&&(t=JSON.parse(t),Mn(this,Bn,Rn).call(this,t))}function Rn(){(0<arguments.length&&void 0!==arguments[0]?arguments[0]:[]).forEach(t=>{const i=mt({url:t,title:xt(t),price:vt(this.fpdInstance,this.container),removable:!0});this.gridElem.prepend(i),this.fpdInstance.lazyBackgroundObserver.observe(i.querySelector("picture")),u(i,["click"],t=>{this.fpdInstance.loadingCustomImage||this.fpdInstance._addGridItemToCanvas(t.currentTarget)}),u(i.querySelector(".fpd-delete"),"click",t=>{t.stopPropagation(),t.preventDefault();var e,t=Array.from(this.gridElem.children).indexOf(i);i.classList.contains("fpd-loading")||((e=JSON.parse(window.localStorage.getItem("fpd_ai_images"))).splice(t,1),window.localStorage.setItem("fpd_ai_images",JSON.stringify(e)),i.xhr&&i.xhr.abort(),i.remove())})})}window.FPDTextToImageModule=Fn;class Nn extends EventTarget{constructor(n,t){super(),this.fpdInstance=n,this.container=document.createElement("fpd-module-images"),t.append(this.container);const i=Array.from(this.container.querySelectorAll(".fpd-module-tabs > div")),s=Array.from(this.container.querySelectorAll(".fpd-module-tabs-content > div"));let r=null,a=null;u(i,"click",t=>{const e=t.currentTarget;d(i,["fpd-active"]),d(s,["fpd-active"]),p(e,["fpd-active"]),p(s.find(t=>t.dataset.context==e.dataset.context),["fpd-active"]),"instagram"==e.dataset.context&&r&&!r.accessToken?r.authenticate():"pixabay"==e.dataset.context&&a&&a.loadImages()});t=n.mainOptions;new Gi(n,s.find(t=>"upload"==t.dataset.context)),u(n,["viewSelect","secondaryModuleCalled"],t=>{const e=vt(n,this.container),i=this.container.querySelectorAll(".fpd-price");i&&(f(i,["fpd-hidden"],!Boolean(e)),i.forEach(t=>{t.innerHTML=e}))}),g(t.facebookAppId)||(new hn(n,s.find(t=>"facebook"==t.dataset.context)),i.find(t=>"facebook"==t.dataset.context).classList.remove("fpd-hidden")),g(t.instagramClientId)||(r=new wn(n,s.find(t=>"instagram"==t.dataset.context)),i.find(t=>"instagram"==t.dataset.context).classList.remove("fpd-hidden")),g(t.pixabayApiKey)||(a=new An(n,s.find(t=>"pixabay"==t.dataset.context)),i.find(t=>"pixabay"==t.dataset.context).classList.remove("fpd-hidden")),!g(t.aiService.serverURL)&&t.aiService.text2Img&&(new Fn(n,s.find(t=>"text2Img"==t.dataset.context)),i.find(t=>"text2Img"==t.dataset.context).classList.remove("fpd-hidden")),new Pe(n,s.find(t=>"qr-code"==t.dataset.context)),i.filter(t=>!t.classList.contains("fpd-hidden")).length<2&&this.container.classList.add("fpd-hide-tabs")}}window.FPDImagesModule=Nn;class Hn extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-layers" data-defaulttext="Manage Layers" data-title="modules.manage_layers"> <div class="fpd-scroll-area"> <div class="fpd-list"></div> </div> </div>'}}customElements.define("fpd-module-manage-layers",Hn);const zn=i=>{let n=!1,s=null;var t=document.createElement("div");t.className="fpd-colorpicker-wrapper";const e=new Oe({parent:t,popup:!1,alpha:!1,color:b(i.initialColor).isValid()?i.initialColor:"#fff",onChange:t=>{const e=b(t.rgbaString).toHexString();n&&i.onMove&&i.onMove(e),"number"==typeof s&&clearTimeout(s),s=setTimeout(()=>{n&&i.onChange&&i.onChange(e),n=!0},500)}});if(void 0!==window.EyeDropper){const i=e.domElement.querySelector(".picker_sample"),n=document.createElement("span");n.className="fpd-icon-color",i.append(n),u(i,"click",t=>{(new EyeDropper).open().then(t=>{e.setColor(t.sRGBHex)}).catch(t=>{console.log(t)})})}if(i.palette&&Array.isArray(i.palette)){const n=Vn({colors:i.palette,colorNames:i.colorNames,onChange:t=>{i.onChange&&i.onChange(t)}});t.append(n)}return t},Wn=s=>{var t=document.createElement("div");t.className="fpd-scroll-area",(s.enablePicker||s.subPalette)&&p(t,["fpd-has-subpanel"]);const r=document.createElement("div");let a;return r.className="fpd-color-palette",t.append(r),s.colors&&Array.isArray(s.colors)&&s.colors.forEach((e,i)=>{let t=e;if(s.colorNames){const r=s.colorNames[e.replace("#","").toLowerCase()];r&&(t=r.toUpperCase())}const n=document.createElement("span");n.className="fpd-item",n.style.backgroundColor=e,n.setAttribute("aria-label",t),n.dataset.hex=e,r.append(n),s.enablePicker||s.subPalette||p(n,["fpd-tooltip"]),u(n,"click",t=>{if(t.stopPropagation(),s.enablePicker||s.subPalette){a&&(a.remove(),a=null);const t=n.classList.contains("fpd-active");t||(a=s.enablePicker?zn({initialColor:e,colorNames:s.colorNames,palette:s.palette,onMove:t=>{s.onMove&&s.onMove(t,i)},onChange:t=>{n.style.backgroundColor=t,s.onChange&&s.onChange(t,i)}}):Wn({colors:s.palette,colorNames:s.colorNames,onChange:t=>{n.style.backgroundColor=t,s.onChange&&s.onChange(t,i)}}),r.append(a)),d(r,["fpd-sub-show"]),d(r.querySelectorAll(".fpd-item"),["fpd-active"]),t||(p(r,["fpd-sub-show"]),p(n,["fpd-active"]))}else s.onChange&&s.onChange(e)})}),t},Vn=Wn,Un=(t,e)=>{if(e.colors){var i,n=document.createElement("div");if(n.className="fpd-color-panel",1===e.colors.length?(i=zn({initialColor:e.colors[0],colorNames:t.mainOptions.hexNames,palette:t.mainOptions.colorPickerPalette,onMove:t=>{e.onMove&&e.onMove(t)},onChange:t=>{e.onChange&&e.onChange(t)}}),n.append(i)):(i=Vn({colors:e.colors,colorNames:t.mainOptions.hexNames,palette:t.mainOptions.colorPickerPalette,onChange:t=>{e.onChange&&e.onChange(t)}}),n.append(i)),e.patterns){const t=(s=>{var t=document.createElement("div");t.className="fpd-scroll-area";const r=document.createElement("div");return r.className="fpd-patterns-wrapper",t.append(r),s.images&&Array.isArray(s.images)&&s.images.forEach((e,t)=>{var i=e.replace(/^.*[\\\/]/,"").replace(/\.[^/.]+$/,"").replace("_"," ").toUpperCase(),n=document.createElement("span");n.className="fpd-item fpd-tooltip",n.style.backgroundImage=`url("${e}")`,n.setAttribute("aria-label",i),r.append(n),u(n,"click",t=>{s.onChange&&s.onChange(e)})}),t})({images:e.patterns,onChange:t=>{e.onPatternChange&&e.onPatternChange(t)}});n.append(t)}return n}};var t=Zo(148),Yn=Zo.n(t);function qn(t,e){Gn(t,e),e.add(t)}function Gn(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xn(t,e){return(e=Zn(t=t,e,"get")).get?e.get.call(t):e.value}function Zn(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}function Jn(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var Qn=new WeakMap,Kn=new WeakSet,$n=new WeakSet,ts=new WeakSet,es=new WeakSet,is=new WeakSet,ns=new WeakSet;class ss extends EventTarget{constructor(n,t){var e,i;super(),qn(this,ns),qn(this,is),qn(this,es),qn(this,ts),qn(this,$n),qn(this,Kn),i={writable:!0,value:null},Gn(this,e=Qn),e.set(this,i),this.fpdInstance=n,this.container=document.createElement("fpd-module-manage-layers"),t.append(this.container),this.listElem=this.container.querySelector(".fpd-list"),u(n,["elementAdd","elementRemove","viewSelect","productCreate"],t=>{n.productCreated&&Jn(this,Kn,rs).call(this)}),u(n,["elementModify","textLinkApply"],t=>{if(n.productCreated){const{element:n,options:e}=t.detail,i=this.listElem.querySelector('.fpd-list-row[id="'+n.id+'"]');if(i){const n=i.querySelector("textarea");e.text&&n&&(n.value=e.text)}}}),u(n,["elementModify","elementChange"],t=>{if(n.productCreated){const{element:n,options:e,type:i}=t.detail;(e&&e.scaleX||"scaling"==i)&&Jn(this,ns,hs).call(this,n)}}),u(n,"elementFillChange",t=>{if(n.productCreated){const n=t.detail.element,e=this.listElem.querySelector('.fpd-list-row[id="'+n.id+'"]');e&&e.querySelector(".fpd-current-color")&&(e.querySelector(".fpd-current-color").style.background=Ct(n))}})}}function rs(){this.listElem.innerHTML="",this.fpdInstance.getElements(this.fpdInstance.currentViewIndex,"all",!1).forEach(t=>{t.checkEditable()&&Jn(this,$n,as).call(this,t)}),Xn(this,Qn)&&Xn(this,Qn).dispose(),i=Qn,t=Yn()("vertical",{container:this.listElem,handle:"fpd-icon-reorder",item:"fpd-list-row",placeholder:"fpd-sortable-placeholder",activeItem:"fpd-sortable-dragged",closestItem:"fpd-sortable-closest",autoscroll:!0,animationMs:0,onStart:t=>{const e=window.pageYOffset||document.documentElement.scrollTop||0;window.onscroll=()=>{window.scrollTo({top:e})}},onChange:t=>{var e=this.fpdInstance.currentViewInstance.fabricCanvas,i=e.getElementByID(t.id);let n=this.listElem.querySelector(".fpd-sortable-closest"),s=e.getElementByID((n||t).id).getZIndex();n||s++,e.setElementOptions({z:s},i)},onEnd:t=>{window.onscroll=()=>{}}});var t,e=this,i=Zn(this,i,"set");if(i.set)i.set.call(e,t);else{if(!i.writable)throw new TypeError("attempted to set read only private field");i.value=t}}function as(i){const n=document.createElement("div");n.className="fpd-list-row",n.id=i.id;let t=document.createElement("span"),e=null;if(!i.uploadZone&&i.hasColorSelection()){e=wt(i,this.fpdInstance);const s=Ct(i);t.style.background=s,t.className="fpd-current-color",n.colors=e}const s=document.createElement("div");s.className="fpd-cell-0",s.append(t),n.append(s);let r=i.title;"text"===i.getType()&&i.editable&&((r=document.createElement("textarea")).value=i.text,u(r,"keyup",t=>{t.stopPropagation();let e=t.target.value;e=e.replace(FancyProductDesigner.forbiddenTextChars,""),this.fpdInstance.mainOptions.disableTextEmojis&&(e=(e=e.replace(FPDEmojisRegex,"")).replace(String.fromCharCode(65039),"")),this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({text:e},i)}),i.on({"editing:exited":()=>{r.value=i.text}}));var a=document.createElement("div");if(a.className="fpd-cell-1",a.append(r),i.isBitmap()){const i=document.createElement("div");i.className="fpd-img-meta",i.innerHTML='W: <span data-prop="width"></span>H: <span data-prop="height"></span>',i.innerHTML+='<div class="fpd-dpi">DPI: <span data-prop="dpi"></span></div>',a.append(i)}n.append(a);a=document.createElement("div");if(a.className="fpd-cell-2",n.append(a),i.uploadZone){p(n,["fpd-add-layer"]);const i=document.createElement("span");i.className="fpd-icon-add",a.append(i)}else{if(i.zChangeable){const i=document.createElement("span");i.className="fpd-icon-reorder",a.append(i)}const t=i.locked?"fpd-icon-locked":"fpd-icon-unlocked",e=document.createElement("span"),s=(e.className="fpd-lock-element",e.innerHTML=`<span class="${t}"></span>`,a.append(e),u(e,"click",t=>{t.stopPropagation(),d(n,["fpd-show-colors"]),i.evented=!i.evented,i.locked=!i.evented;t=t.currentTarget.querySelector("span");f(t,["fpd-icon-unlocked"],i.evented),f(t,["fpd-icon-locked"],!i.evented),f(n,["fpd-locked"],!i.evented)}),f(n,["fpd-locked"],i.locked),i.visible?"fpd-icon-eye-hide":"fpd-icon-eye"),r=document.createElement("span");r.className="fpd-visible-element",r.innerHTML=`<span class="${s}"></span>`,a.append(r),u(r,"click",t=>{i.set("visible",!i.visible),i.canvas.renderAll(),f(r.querySelector("span"),["fpd-icon-eye-hide"],i.visible),f(r.querySelector("span"),["fpd-icon-eye"],!i.visible)})}let o,l=i.removable||i.__editorMode;if(l=i.uploadZone?i.uploadZoneRemovable:l){const n=document.createElement("span");n.className="fpd-remove-element",n.innerHTML='<span class="fpd-icon-bin"></span>',a.append(n),u(n,"click",t=>{t.stopPropagation(),this.fpdInstance.currentViewInstance.fabricCanvas.removeElement(i)})}if(this.listElem.prepend(n),e){if(o=document.createElement("div"),"group"===i.type&&1<i.getObjects().length){const n=Array.isArray(i.colors)&&1<i.colors.length;a=Vn({colors:e,colorNames:this.fpdInstance.mainOptions.hexNames,palette:i.colors,subPalette:n,enablePicker:!n,onChange:(t,e)=>{Jn(this,is,cs).call(this,i,e,t)},onMove:(t,e)=>{i.changeObjectColor(e,t)}});o.append(a)}else o=Un(this.fpdInstance,{colors:e,patterns:Array.isArray(i.patterns)&&(i.isSVG()||"text"===i.getType())?i.patterns:null,onMove:t=>{Jn(this,ts,os).call(this,i,t)},onChange:t=>{Jn(this,es,ls).call(this,i,t)},onPatternChange:t=>{n.querySelector(".fpd-current-color").style.backgroundImage=`url("${t}")`,this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({pattern:t},i)}});o&&(p(o,["fpd-cell-full"]),n.append(o)),u(n.querySelector(".fpd-current-color"),"click",t=>{var e=!n.classList.contains("fpd-show-colors");d(this.listElem.querySelectorAll(".fpd-list-row"),["fpd-show-colors"]),f(n,["fpd-show-colors"],e)})}u(n.querySelector(".fpd-cell-1"),"click",t=>{var e=t.currentTarget.parentNode;e.classList.contains("fpd-locked")||"TEXTAREA"==t.target.nodeName||(t=this.fpdInstance.currentViewInstance.fabricCanvas.getElementByID(e.id))&&t.canvas.setActiveObject(t).renderAll()}),Jn(this,ns,hs).call(this,i)}function os(t,e){"png"!==t.isColorizable()&&t.changeColor(e)}function ls(t,e){var i=this.listElem.querySelector('.fpd-list-row[id="'+t.id+'"]');i&&i.querySelector(".fpd-current-color")&&(i.querySelector(".fpd-current-color").style.background=Ct(t)),this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}function cs(t,e,i){e=t.changeObjectColor(e,i);this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}function hs(t){var e=this.listElem.querySelector('.fpd-list-row[id="'+t.id+'"]');e&&t.isBitmap()&&(t=this.fpdInstance.calcDisplaySize(t),e.querySelector('[data-prop="width"]')&&(e.querySelector('[data-prop="width"]').innerText=t.width+t.unit,e.querySelector('[data-prop="height"]').innerText=t.height+t.unit),t.dpi?e.querySelector('[data-prop="dpi"]').innerText=t.dpi:p(e,["fpd-hide-dpi"]))}window.FPDLayersModule=ss;class ds extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-text-layers" data-defaulttext="Text Layers" data-title="modules.text_layers"> <div class="fpd-scroll-area"> <div class="fpd-list"></div> </div> </div>'}}function us(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function ps(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-text-layers",ds);var fs=new WeakSet,gs=new WeakSet,ms=new WeakSet;class vs extends EventTarget{constructor(s,t){super(),us(this,ms),us(this,gs),us(this,fs),this.fpdInstance=s,this.container=document.createElement("fpd-module-text-layers"),t.append(this.container),this.listElem=this.container.querySelector(".fpd-list"),u(s,["elementAdd","elementRemove","viewSelect","productCreate"],t=>{s.productCreated&&ps(this,fs,bs).call(this)}),u(s,["elementModify","textLinkApply"],t=>{if(s.productCreated){const{element:s,options:i}=t.detail,n=this.listElem.querySelector('.fpd-list-row[id="'+s.id+'"]');if(n){const s=n.querySelector('[data-control="fontSize"]'),t=(i.fontSize&&s&&(s.value=i.fontSize),n.querySelector("fpd-dropdown"));i.fontFamily&&t&&t.setAttribute("value",i.fontFamily);var e=n.querySelector(".fpd-text-input");i.text&&e&&(e.value=i.text)}}})}}function bs(){this.listElem.innerHTML="",this.fpdInstance.getElements(this.fpdInstance.currentViewIndex,"all",!1).forEach(t=>{t.checkEditable()&&"text"==t.getType()&&ps(this,ms,xs).call(this,t)})}function ys(t,e,n){const s=document.createElement("fpd-dropdown"),r=(s.searchable=!0,e.append(s),s.querySelector(".fpd-dropdown-list > .fpd-scroll-area"));return t.forEach((e,t)=>{var i;r&&("object"==typeof e&&(e=e.name),(i=document.createElement("span")).className="fpd-item",i.family=e,i.style.fontFamily=e,i.innerText=e,i.addEventListener("click",t=>{s.setAttribute("value",t.currentTarget.innerText),this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fontFamily:e},n)}),r.append(i))}),s}function xs(i){var t=document.createElement("div");if(t.className="fpd-list-row",t.id=i.id,this.listElem.prepend(t),i.editable){var n=document.createElement("div"),n=(n.className="fpd-cell-full fpd-title",n.innerText=i.title,t.append(n),document.createElement("div"));let e;n.className="fpd-cell-full",t.append(n),1==i.maxLines?(e=document.createElement("input")).value=i.text:((e=document.createElement("textarea")).value=i.text,i.maxLines&&(e.rows=i.maxLines)),n.append(e),e.className="fpd-text-input";var s=document.createElement("span"),n=(s.className="fpd-clear-text",s.innerText=this.fpdInstance.translator.getTranslation("modules","text_layers_clear","Clear"),n.append(s),u(s,"click",t=>{t.stopPropagation(),this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({text:""},i),e.value=""}),i.on({"editing:exited":()=>{e.value=i.text}}),u(e,"keyup",t=>{t.stopPropagation();let e=t.target.value;e=e.replace(FancyProductDesigner.forbiddenTextChars,""),this.fpdInstance.mainOptions.disableTextEmojis&&(e=(e=e.replace(FPDEmojisRegex,"")).replace(String.fromCharCode(65039),"")),this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({text:e},i)}),Array.isArray(this.fpdInstance.mainOptions.fonts)?this.fpdInstance.mainOptions.fonts:[]);n.length&&((s=document.createElement("div")).className="fpd-cell-1",t.append(s),ps(this,gs,ys).call(this,n,s,i).setAttribute("value",i.fontFamily))}if(i.resizable||i.__editorMode){n=document.createElement("div");n.className="fpd-cell-2",t.append(n);const e=document.createElement("input");e.className="fpd-tooltip",e.setAttribute("aria-label",this.fpdInstance.translator.getTranslation("toolbar","font_size","Font Size")),e.type="number",e.value=i.fontSize,e.dataset.control="fontSize",e.min=i.minFontSize,e.max=i.maxFontSize,n.append(e),u(e,"change",t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fontSize:parseInt(t.currentTarget.value)},i),e.value=i.fontSize})}i.hasColorSelection()&&((s=document.createElement("div")).className="fpd-cell-full",t.append(s),n=wt(i,this.fpdInstance),t=Un(this.fpdInstance,{colors:n,patterns:Array.isArray(i.patterns)&&(i.isSVG()||"text"===i.getType())?i.patterns:null,onMove:t=>{i.changeColor(t)},onChange:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:t},i)},onPatternChange:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({pattern:t},i)}}))&&s.append(t)}window.FPDTextLayersModule=vs;class ws extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-layouts" data-defaulttext="Layouts" data-title="modules.layouts"> <div class="fpd-scroll-area"> <div class="fpd-grid fpd-grid-contain fpd-padding"></div> </div> </div>'}}function Cs(t,e){Es(t,e),e.add(t)}function Ss(t,e,i){Es(t,e),e.set(t,i)}function Es(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ts(t,e,i){var n=t,t=Is(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function As(t,e){return(e=Is(t=t,e,"get")).get?e.get.call(t):e.value}function Is(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}function Os(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-layouts",ws);var ks=new WeakMap,Ms=new WeakMap,Ps=new WeakMap,_s=new WeakSet,Ds=new WeakSet;class Ls extends EventTarget{constructor(e,t){super(),Cs(this,Ds),Cs(this,_s),Ss(this,ks,{writable:!0,value:0}),Ss(this,Ms,{writable:!0,value:0}),Ss(this,Ps,{writable:!0,value:!1}),this.fpdInstance=e,this.container=document.createElement("fpd-module-layouts"),t.append(this.container),this.gridElem=this.container.querySelector(".fpd-grid"),u(e,"layoutsSet",t=>{this.layoutsData=e.currentLayouts,Os(this,Ds,Fs).call(this)}),u(this.fpdInstance,"beforeElementAdd",Os(this,_s,Bs).bind(this))}}function Bs(t){var e,i=t.detail.element;if(As(this,Ps)){Ts(this,ks,(e=As(this,ks),++e));const t=i.title+"<br>"+String(As(this,ks))+"/"+As(this,Ms);this.fpdInstance.mainLoader.querySelector(".fpd-loader-text").innerHTML=t}}function Fs(){this.gridElem.innerHTML="",Array.isArray(this.layoutsData)&&this.layoutsData.forEach(n=>{var t=mt({url:n.thumbnail,title:n.title,disablePrice:!0,disableDraggable:!0});u(t,"click",t=>{var i,e;this.fpdInstance.productCreated&&((e=(i=a(this.fpdInstance.translator.getTranslation("modules","layouts_confirm_replacement","Yes, please!"),!1,"confirm",this.fpdInstance.container)).querySelector(".fpd-confirm")).innerText=this.fpdInstance.translator.getTranslation("modules","layouts_confirm_button","Sure?"),u(e,"click",()=>{Ts(this,ks,0),Ts(this,Ms,n.elements.length),this.fpdInstance.globalCustomElements=[],this.fpdInstance.mainOptions.replaceInitialElements&&(this.fpdInstance.globalCustomElements=this.fpdInstance.getCustomElements()),this.fpdInstance.deselectElement(),this.fpdInstance.toggleSpinner(!0),Ts(this,Ps,!0);const e={};dt(n.options)&&ee.relevantOptions.forEach(t=>{void 0!==n.options[t]&&(e[t]=n.options[t])}),this.fpdInstance.currentViewInstance.options={...this.fpdInstance.currentViewInstance.options,...e},this.fpdInstance.currentViewInstance.fabricCanvas.viewOptions=this.fpdInstance.currentViewInstance.options,this.fpdInstance.currentViewInstance.loadElements(n.elements,()=>{Ts(this,Ps,!1),this.fpdInstance.toggleSpinner(!1),this.fpdInstance.dispatchEvent(new CustomEvent("layoutElementsAdded",{detail:{layoutView:n}})),this.fpdInstance.currentViewInstance.fabricCanvas._renderPrintingBox(),this.fpdInstance.currentViewInstance.fabricCanvas.resetSize()}),i.remove()}))}),this.gridElem.append(t),this.fpdInstance.lazyBackgroundObserver.observe(t.querySelector("picture"))})}window.FPDLayoutsModule=Ls;class js extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div data-moduleicon="fpd-icon-name-number" data-defaulttext="Names & Numbers" data-title="modules.names_numbers"> <div class="fpd-head"> <span class="fpd-btn" data-defaulttext="Add New">modules.names_numbers_add_new</span> </div> <div class="fpd-scroll-area"> <div class="fpd-list"></div> </div> </div>'}}function Rs(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function I(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-module-names-numbers",js);var Ns=new WeakSet,Hs=new WeakSet,zs=new WeakSet,Ws=new WeakSet,Vs=new WeakSet,Us=new WeakSet,Ys=new WeakSet;class qs extends EventTarget{constructor(i,t){super(),Rs(this,Ys),Rs(this,Us),Rs(this,Vs),Rs(this,Ws),Rs(this,zs),Rs(this,Hs),Rs(this,Ns),this.fpdInstance=i,this.container=document.createElement("fpd-module-names-numbers"),t.append(this.container),this.listElem=this.container.querySelector(".fpd-list"),u(i,"viewSelect",t=>{I(this,Hs,Xs).call(this)}),u(this.container.querySelector(".fpd-btn"),"click",t=>{var e=I(this,zs,Zs).call(this);I(this,Ns,Gs).call(this,e),i.currentViewInstance.names_numbers=this.getViewNamesNumbers(),i.mainOptions.namesNumbersEntryPrice&&i.currentViewInstance.changePrice(i.mainOptions.namesNumbersEntryPrice,"+")})}getViewNamesNumbers(){let n=[];return this.container.querySelectorAll(".fpd-list .fpd-row").forEach(t=>{var e={},i=t.querySelector(".fpd-number-col"),i=(i&&(e.number=i.querySelector("input").value),t.querySelector(".fpd-name-col")),i=(i&&(e.name=i.querySelector("input").value),t.querySelector(".fpd-select-col"));i&&(e.select=i.querySelector("select").value),n.push(e)}),n}}function Gs(t){t.querySelector("input").focus();var e=t.querySelector(".fpd-number-col"),e=(e&&I(this,Ys,$s).call(this,e.querySelector("input").value||e.querySelector("input").placeholder),t.querySelector(".fpd-name-col"));e&&I(this,Ys,$s).call(this,null,e.querySelector("input").value||e.querySelector("input").placeholder)}function Xs(){this.listElem.innerHTML="";var t=this.fpdInstance.currentViewInstance;(t.fabricCanvas.textPlaceholder||t.fabricCanvas.numberPlaceholder?(t.names_numbers&&Array.isArray(t.names_numbers)?t.names_numbers.forEach(t=>{I(this,zs,Zs).call(this,t.number,t.name,t.select)}):I(this,zs,Zs).call(this),d):p)(this.container,["fpd-disabled"])}function Zs(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",i=2<arguments.length?arguments[2]:void 0;const n=this.fpdInstance.currentViewInstance.fabricCanvas,s=document.createElement("div");s.className="fpd-row";var r=document.createElement("div"),a=(r.className="fpd-remove-col",document.createElement("span"));return a.innerText=this.fpdInstance.translator.getTranslation("modules","names_numbers_remove","Remove"),r.append(a),u(a,"click",t=>{s.remove(),I(this,Ns,Gs).call(this,this.container.querySelector(".fpd-row:first-child")),this.fpdInstance.currentViewInstance.names_numbers=this.getViewNamesNumbers(),this.fpdInstance.mainOptions.namesNumbersEntryPrice&&this.fpdInstance.currentViewInstance.changePrice(this.fpdInstance.mainOptions.namesNumbersEntryPrice,"-")}),s.append(r),n.numberPlaceholder&&s.append(I(this,Ws,Js).call(this,t)),n.textPlaceholder&&s.append(I(this,Vs,Qs).call(this,e)),(this.fpdInstance.mainOptions.namesNumbersDropdown&&0<this.fpdInstance.mainOptions.namesNumbersDropdown.length||i)&&s.append(I(this,Us,Ks).call(this,i)),this.listElem.append(s),s}function Js(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";const e=this.fpdInstance.currentViewInstance.fabricCanvas,i=document.createElement("div"),n=(i.className="fpd-number-col fpd-input-col",document.createElement("input"));return n.type="number",i.append(n),Array.isArray(e.numberPlaceholder.numberPlaceholder)&&(n.setAttribute("min",Number(e.numberPlaceholder.numberPlaceholder[0])),n.setAttribute("max",Number(e.numberPlaceholder.numberPlaceholder[1]))),n.setAttribute("placeholder",e.numberPlaceholder.originParams.text),n.value=t,u(n,["mouseup","keyup"],t=>{Array.isArray(e.numberPlaceholder.numberPlaceholder)&&(n.value>Number(n.max)&&(n.value=Number(n.max)),n.value<Number(n.min))&&(n.value=Number(n.min)),n.value=I(this,Ys,$s).call(this,n.value),this.fpdInstance.currentViewInstance.names_numbers=this.getViewNamesNumbers()}),i}function Qs(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=this.fpdInstance.currentViewInstance.fabricCanvas,i=document.createElement("div");i.className="fpd-name-col fpd-input-col";const n=document.createElement("input");return n.type="text",i.append(n),n.setAttribute("placeholder",e.textPlaceholder.originParams.text),n.value=t,u(n,["mouseup","keyup"],t=>{n.value=I(this,Ys,$s).call(this,null,n.value),this.fpdInstance.currentViewInstance.names_numbers=this.getViewNamesNumbers()}),i}function Ks(){let i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";var t=document.createElement("div");t.className="fpd-select-col fpd-input-col";const n=document.createElement("select");t.append(n);var e=[i];return(0<this.fpdInstance.mainOptions.namesNumbersDropdown.length?this.fpdInstance.mainOptions.namesNumbersDropdown:e).forEach(t=>{var e=document.createElement("option");e.value=t,e.selected=i===t,e.innerText=t,n.append(e)}),u(n,"change",t=>{this.fpdInstance.currentViewInstance.names_numbers=this.getViewNamesNumbers()}),t}function $s(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=this.fpdInstance.currentViewInstance.fabricCanvas,i="string"==typeof t?e.numberPlaceholder:e.textPlaceholder;let n="string"==typeof t?t:1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;t=i.maxLength;return n=(n=0!=t&&n.length>t?n.substr(0,t):n).replace(FancyProductDesigner.forbiddenTextChars,""),this.fpdInstance.mainOptions.disableTextEmojis&&(n=(n=n.replace(FPDEmojisRegex,"")).replace(String.fromCharCode(65039),"")),e.setElementOptions({text:n},i),n}window.FPDNamesNumbersModule=qs;class tr extends EventTarget{constructor(e,i,n){let s;if(super(),"products"===n)s=new ei(e,i);else if("text"===n)s=new ri(e,i);else if(n.includes("designs")){let t=null;if(n.includes("designs_")&&!g(e.mainOptions.dynamicDesigns)){if(!(t=n.split("_").pop())||!e.mainOptions.dynamicDesigns[t])return;{var r=e.mainOptions.dynamicDesigns[t];const i={};i["data-dynamic-designs-id"]=t,this.configs={icon:!g(r.icon)&&r.icon.includes(".svg")?r.icon:"fpd-icon-design-library",defaultText:r.name,attrs:i}}}s=new Ci(e,i,t)}else"images"===n?s=new Nn(e,i):"manage-layers"===n?s=new ss(e,i):"save-load"===n?s=new Fe(e,i):"text-layers"===n?s=new vs(e,i):"layouts"===n?s=new Ls(e,i):"names-numbers"===n&&(s=new qs(e,i));if(FancyProductDesigner.additionalModules&&!s){const r=FancyProductDesigner.additionalModules[n];r&&(s=new r(e,i))}if(s&&(this.moduleInstance=s,e["moduleInstance_"+n]=s,!n.includes("designs_"))){const e=s.container.querySelector("div");this.configs={icon:e.dataset.moduleicon,langId:e.dataset.title,langKeys:e.dataset.title.split("."),defaultText:e.dataset.defaulttext}}}}function er(t,e){nr(t,e),e.add(t)}function ir(t,e,i){nr(t,e),e.set(t,i)}function nr(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function sr(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function rr(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}function O(t,e){return(e=ar(t=t,e,"get")).get?e.get.call(t):e.value}function n(t,e,i){var n=t,t=ar(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}}function ar(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}var or=new WeakMap,P=new WeakMap,lr=new WeakMap,cr=new WeakMap,hr=new WeakMap,dr=new WeakMap,ur=new WeakMap,pr=new WeakMap,fr=new WeakMap,gr=new WeakSet,mr=new WeakSet,vr=new WeakSet,br=new WeakSet,yr=new WeakSet,xr=new WeakSet;class wr extends EventTarget{constructor(t){super(),er(this,xr),er(this,yr),er(this,br),er(this,vr),er(this,mr),er(this,gr),ir(this,or,{writable:!0,value:null}),ir(this,P,{writable:!0,value:null}),ir(this,lr,{writable:!0,value:!1}),ir(this,cr,{writable:!0,value:0}),ir(this,hr,{writable:!0,value:0}),ir(this,dr,{writable:!0,value:0}),ir(this,ur,{writable:!0,value:0}),ir(this,pr,{writable:!0,value:!1}),ir(this,fr,{writable:!0,value:!1}),sr(this,"contentElem",null),sr(this,"navElem",null),sr(this,"currentModuleKey",""),sr(this,"currentModules",[]);var e,i=(this.fpdInstance=t).container;if(this.container=document.createElement("fpd-main-bar"),(t.mainOptions.mainBarContainer&&!t.mainOptions.modalMode&&(e=document.querySelector(t.mainOptions.mainBarContainer))?(d(i,["fpd-off-canvas","fpd-topbar"]),p(i,["fpd-main-bar-container-enabled","fpd-sidebar"]),p(e,["fpd-container","fpd-main-bar-container","fpd-sidebar"]),e):i).append(this.container),this.contentElem=this.container.querySelector(".fpd-module-content"),this.navElem=this.container.querySelector(".fpd-navigation"),this.secContent=this.container.querySelector(".fpd-secondary-content"),n(this,or,document.querySelector(this.fpdInstance.mainOptions.modalMode?".fpd-modal-product-designer":"body")),n(this,P,document.querySelector(".fpd-draggable-dialog")),O(this,or).append(O(this,P)),u(O(this,P),["mousedown","touchstart"],rr(this,gr,Cr).bind(this)),u(document,["mouseup","touchend"],rr(this,vr,Er).bind(this)),u(document,["mousemove","touchmove"],rr(this,mr,Sr).bind(this)),u(O(this,P).querySelector(".fpd-close-dialog"),["click","touchstart"],rr(this,yr,Ar).bind(this)),u(this.container.querySelector(".fpd-close"),["click","touchmove"],rr(this,yr,Ar).bind(this)),u(t,"viewSelect",rr(this,xr,Ir).bind(this)),i.classList.contains("fpd-off-canvas")){let n=0,s=0,r=0;this.contentElem.addEventListener("touchstart",t=>{n=t.touches[0].pageX,s=t.touches[0].pageY,p(this.container,["fpd-is-dragging"])}),this.contentElem.addEventListener("touchmove",t=>{var e=t.touches[0].pageX,i=t.touches[0].pageY,e=(r=n-e,s-i);Math.abs(r)>Math.abs(e)&&(r=Math.abs(r)<0?0:Math.abs(r),this.contentElem.style.left=-r+"px",this.contentElem.previousElementSibling.style.left=this.contentElem.clientWidth-r+"px",t.preventDefault())}),this.contentElem.addEventListener("touchend",t=>{100<Math.abs(r)?this.toggleContentDisplay(!1):(this.contentElem.style.left="0px",this.contentElem.previousElementSibling.style.left=this.contentElem.clientWidth+"px"),r=0,d(this.container,["fpd-is-dragging"])})}this.updateContentWrapper(),this.setup(t.mainOptions.mainBarModules),this.fpdInstance.translator.translateArea(this.container),O(this,pr)&&this.fpdInstance.translator.translateArea(O(this,P))}callModule(t){let e,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(d(this.navElem.querySelectorAll(".fpd-nav-item"),["fpd-active"]),d(Array.from(this.contentElem.children),["fpd-active"]),i)e=p(this.navElem.querySelector('.fpd-nav-item[data-dynamic-designs-id="'+i+'"]'),["fpd-active"]),p(this.contentElem.querySelector('[data-dynamic-designs-id="'+i+'"]'),["fpd-active"]);else{e=p(this.navElem.querySelector('.fpd-nav-item[data-module="'+t+'"]'),["fpd-active"]);const i=this.contentElem.querySelector("fpd-module-"+t);p(i,["fpd-active"]),"text"==t&&i.querySelector("textarea").focus()}this.toggleContentDisplay(),this.currentModuleKey=t,this.fpdInstance.dispatchEvent(new CustomEvent("moduleCalled",{detail:{moduleName:t}}))}callSecondary(t){d(this.navElem.querySelectorAll(".fpd-nav-item"),["fpd-active"]),p(this.secContent.querySelector(".fpd-"+t),["fpd-active"]),p([this.fpdInstance.container,O(this,P)],["fpd-secondary-visible"]),this.fpdInstance.dispatchEvent(new CustomEvent("secondaryModuleCalled",{detail:{moduleName:t}}))}get contentClosable(){var t=this.fpdInstance.container;return O(this,fr)||O(this,pr)||t.classList.contains("fpd-layout-small")}toggleContentDisplay(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];d([this.fpdInstance.container,O(this,P)],["fpd-secondary-visible"]),f([this.fpdInstance.container,O(this,P)],["fpd-module-visible"],t),this.contentClosable&&!t&&d(this.navElem.querySelectorAll(".fpd-nav-item"),["fpd-active"]),O(this,fr)?(!t&&this.currentModuleKey.length&&this.fpdInstance.deselectElement(),this.contentElem.style.removeProperty("left"),this.contentElem.previousElementSibling.style.removeProperty("left"),this.container.style.setProperty("--fpd-content-height",this.fpdInstance.mainWrapper.container.clientHeight+"px"),f(this.container,["fpd-show"],t)):O(this,pr)&&(t&&(O(this,P).querySelector(".fpd-dialog-title").innerText=this.navElem.querySelector(".fpd-nav-item.fpd-active .fpd-label").innerText),f(O(this,P),["fpd-show"],t)),!t&&this.contentClosable&&(this.currentModuleKey=""),!t&&this.fpdInstance.currentViewInstance&&(this.fpdInstance.currentViewInstance.currentUploadZone=null)}updateContentWrapper(){var t=this.fpdInstance.container;this.toggleContentDisplay(!1),n(this,fr,!1),n(this,pr,!1),d(this.navElem.querySelectorAll(".fpd-nav-item"),["fpd-active"]),t.classList.contains("fpd-off-canvas")?(n(this,fr,!0),this.container.append(this.contentElem)):t.classList.contains("fpd-sidebar")?this.container.append(this.contentElem):(n(this,pr,!0),O(this,P).append(this.contentElem),O(this,P).append(this.secContent),this.fpdInstance.translator.translateArea(O(this,P))),this.fpdInstance.translator.translateArea(this.container)}toggleUploadZonePanel(){let t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!this.fpdInstance.loadingCustomImage){if(t){O(this,pr)&&(O(this,P).querySelector(".fpd-dialog-title").innerText=""),f(this.uploadZoneNavItems.find(t=>t.classList.contains("fpd-add-image")),["fpd-hidden"],!Boolean(e.uploads)),f(this.uploadZoneNavItems.find(t=>t.classList.contains("fpd-add-text")),["fpd-hidden"],!Boolean(e.texts)),f(this.uploadZoneNavItems.find(t=>t.classList.contains("fpd-add-design")),["fpd-hidden"],!Boolean(e.designs)),this.fpdInstance.UZmoduleInstance_designs&&this.fpdInstance.UZmoduleInstance_designs.toggleCategories();const t=this.uploadZoneNavItems.find(t=>!t.classList.contains("fpd-hidden"));t&&t.click(),this.callSecondary("upload-zone-panel")}else this.fpdInstance.currentViewInstance.currentUploadZone=null;f([this.fpdInstance.container,O(this,P)],["fpd-secondary-visible"],t),O(this,pr)&&f(O(this,P),["fpd-show"],t)}}setup(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t=(this.currentModules=[],this.fpdInstance.mainOptions.initialActiveModule||"");const a=this.container.querySelector(".fpd-navigation");0!=e.length||this.fpdInstance.mainOptions.editorMode?1!=e.length||this.fpdInstance.container.classList.contains("fpd-topbar")||this.fpdInstance.mainOptions.editorMode?this.fpdInstance.container.classList.contains("fpd-sidebar")&&""==t?t=e[0]||"":a.classList.remove("fpd-hidden"):(t=e[0]||"",p(this.fpdInstance.container,["fpd-one-module-mode"])):p(this.fpdInstance.container,["fpd-no-modules-mode"]),a.innerHTML=this.contentElem.innerHTML="",FancyProductDesigner.additionalModules&&Object.keys(FancyProductDesigner.additionalModules).forEach(t=>{e.push(t)}),e.forEach(t=>{let i="";var n=new tr(this.fpdInstance,this.contentElem,t);if(n.moduleInstance&&n.configs){this.currentModules.push(t);var s,r=document.createElement("div");r.classList.add("fpd-nav-item"),r.dataset.module=t,r.addEventListener("click",rr(this,br,Tr).bind(this)),a.appendChild(r);let e=document.createElement("span");if("string"==typeof n.configs.icon&&n.configs.icon.includes(".svg")?(s={url:n.configs.icon,onSuccess:t=>{e.innerHTML=t},onError:t=>{console.log(t)}},fetch(s.url).then(t=>{t.ok?t.text().then(t=>{s.onSuccess&&s.onSuccess(t)}):t.text().then(t=>{s.onError&&s.onError(t)})})):(e.classList.add("fpd-nav-icon"),e.classList.add(n.configs.icon)),r.append(e),n.configs.langKeys){const t=n.configs.langKeys;i=this.fpdInstance.translator.getTranslation(t[0],t[1],n.configs.defaultText)}else n.configs.defaultText&&(i=n.configs.defaultText);t=document.createElement("span");if(t.className="fpd-label",t.innerText=i,r.append(t),n.configs.attrs)for(const[t,i]of Object.entries(n.configs.attrs))r.setAttribute(t,i)}});var i=a.querySelector(`[data-module="${t}"]`);if(!this.contentClosable&&i&&i.click(),this.uploadZoneContent=this.secContent.querySelector(".fpd-upload-zone-content"),!this.fpdInstance.mainOptions.editorMode){const e=new tr(this.fpdInstance,this.uploadZoneContent,"images"),t=(this.fpdInstance.UZmoduleInstance_images=e.moduleInstance,new tr(this.fpdInstance,this.uploadZoneContent,"text")),a=(this.fpdInstance.UZmoduleInstance_text=t.moduleInstance,new tr(this.fpdInstance,this.uploadZoneContent,"designs"));this.fpdInstance.UZmoduleInstance_designs=a.moduleInstance}this.uploadZoneNavItems=Array.from(this.secContent.querySelectorAll(".fpd-upload-zone-panel .fpd-bottom-nav > div")),u(this.uploadZoneNavItems,"click",t=>{d(this.uploadZoneNavItems,["fpd-active"]),p(t.currentTarget,["fpd-active"]),d(Array.from(this.uploadZoneContent.children),["fpd-active"]),p(this.uploadZoneContent.querySelector("fpd-module-"+t.currentTarget.dataset.module),["fpd-active"])}),this.fpdInstance.translator.translateArea(this.container)}}function Cr(t){O(this,P).querySelector(".fpd-dialog-drag-handle").contains(t.target)&&(t.preventDefault(),n(this,lr,!0),n(this,cr,(t.touches?event.touches[0]:t).clientX),n(this,hr,(t.touches?event.touches[0]:t).clientY),n(this,dr,O(this,cr)-O(this,P).offsetLeft),n(this,ur,O(this,hr)-O(this,P).offsetTop))}function Sr(i){if(O(this,lr)){var n=O(this,or).clientWidth<window.innerWidth?window.innerWidth:O(this,or).clientWidth,s=O(this,or).clientHeight<window.innerHeight?window.innerHeight:O(this,or).clientHeight,n=n-O(this,P).clientWidth,s=s-O(this,P).clientHeight,r=(i.touches?event.touches[0]:i).clientX;let t=(i.touches?event.touches[0]:i).clientY-O(this,ur),e=r-O(this,dr);e<0&&(e=0),t<0&&(t=0),e>n&&(e=n),t>s&&(t=s),O(this,P).style.top=t+"px",O(this,P).style.left=e+"px"}}function Er(t){n(this,lr,!1)}function Tr(t){t.stopPropagation(),this.fpdInstance.deselectElement(),this.fpdInstance.currentViewInstance&&(this.fpdInstance.currentViewInstance.currentUploadZone=null),t.currentTarget.classList.contains("fpd-active")&&this.contentClosable?this.toggleContentDisplay(!1):this.callModule(t.currentTarget.dataset.module,t.currentTarget.dataset.dynamicDesignsId),this.fpdInstance.dispatchEvent(new CustomEvent("navItemSelect",{detail:{item:t.currentTarget}}))}function Ar(t){t.preventDefault(),document.body.classList.contains("fpd-toolbar-visible")&&this.fpdInstance.container.classList.contains("fpd-sidebar")?(this.fpdInstance.toolbar.toggle(!1),this.fpdInstance.deselectElement()):(this.fpdInstance.currentViewInstance&&this.fpdInstance.currentViewInstance.currentUploadZone&&this.fpdInstance.currentViewInstance.fabricCanvas.deselectElement(),this.toggleContentDisplay(!1))}function Ir(){var t=this.fpdInstance.currentViewInstance,e=t.options.customAdds;f(document.querySelectorAll('.fpd-nav-item[data-module^="designs"], fpd-module-designs'),["fpd-disabled"],!e.designs),f(document.querySelectorAll('.fpd-nav-item[data-module="images"], fpd-module-images'),["fpd-disabled"],!e.uploads),f(document.querySelectorAll('.fpd-nav-item[data-module="text-to-image"]'),["fpd-disabled"],!e.uploads),f(document.querySelectorAll('.fpd-nav-item[data-module="text"], fpd-module-text'),["fpd-disabled"],!e.texts),f(document.querySelectorAll('.fpd-nav-item[data-module="names-numbers"], fpd-module-names-numbers'),["fpd-disabled"],!t.fabricCanvas.textPlaceholder&&!t.fabricCanvas.numberPlaceholder),this.contentClosable||document.querySelectorAll('.fpd-nav-item[data-module="'+this.currentModuleKey+'"]').forEach(t=>{if(t.classList.contains("fpd-disabled")){const t=this.navElem.querySelector(".fpd-nav-item:not(.fpd-disabled)");t&&this.callModule(t.dataset.module)}}),this.toggleContentDisplay(!1)}sr(wr,"availableModules",["products","images","text","designs","manage-layers","text-layers","layouts","save-load","names-numbers"]),window.FPDMainBar=wr;class Or extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-product-stage"></div> <div class="fpd-warnings"></div> <div class="fpd-advanced-image-editor fpd-hidden"> <canvas></canvas> <span class="fpd-close"><span class="fpd-icon-close"></span></span> <span class="fpd-done"><span class="fpd-icon-done"></span></span> </div>'}}customElements.define("fpd-main-wrapper",Or);class kr{constructor(t){this.container=document.createElement("fpd-main-wrapper"),t.container.append(this.container)}}class Mr extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-view-edit-size fpd-hidden"> <label class="fpd-input"> <span>W</span> <input type="number" min="1" step="1" data-type="width" class="fpd-tooltip"> </label> <label class="fpd-input fpd-tooltip"> <span>H</span> <input type="number" min="1" step="1" data-type="height" class="fpd-tooltip"> </label> </div> <div class="fpd-view-locker"> <span class="fpd-icon-locked"></span> <span class="fpd-icon-unlocked fpd-hidden"></span> </div> <div class="fpd-view-prev"> <span class="fpd-icon-forward"></span> </div> <div class="fpd-show-views-grid"> <span class="fpd-icon-pages"></span> <span class="fpd-current-view">0</span> <span class="fpd-total-views">0</span> </div> <div class="fpd-view-next"> <span class="fpd-icon-forward"></span> </div> '}}function Pr(t,e,i){_r(t,e),e.set(t,i)}function _r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Dr(t,e){var e=function(t,e){if(e.has(t))return e.get(t);throw new TypeError("attempted to get private field on non-instance")}(t,e);return(e=e).get?e.get.call(t):e.value}function Lr(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-views-nav",Mr);var Br=new WeakMap,Fr=new WeakMap,jr=new WeakSet;class Rr extends EventTarget{constructor(r){var t;super(),_r(this,t=jr),t.add(this),Pr(this,Br,{writable:!0,value:1e3}),Pr(this,Fr,{writable:!0,value:100}),this.fpdInstance=r,this.container=document.createElement("fpd-views-nav"),this.unitFormat=r.mainOptions.dynamicViewsOptions.unit,this.minWidth=parseInt(r.mainOptions.dynamicViewsOptions.minWidth),this.minHeight=parseInt(r.mainOptions.dynamicViewsOptions.minHeight),this.maxWidth=parseInt(r.mainOptions.dynamicViewsOptions.maxWidth),this.maxHeight=parseInt(r.mainOptions.dynamicViewsOptions.maxHeight),r.mainWrapper.container.append(this.container);let a=null;if(Boolean(r.mainOptions.enableDynamicViews)){a=this.container.querySelector(".fpd-view-edit-size"),d(a,["fpd-hidden"]);const r=a.querySelector('[data-type="width"]'),t=(r.setAttribute("aria-label",this.minWidth+this.unitFormat+" - "+this.maxWidth+this.unitFormat),r.setAttribute("placeholder",this.minWidth+this.unitFormat+" - "+this.maxWidth+this.unitFormat),a.querySelector('[data-type="height"]'));t.setAttribute("aria-label",this.minHeight+this.unitFormat+" - "+this.maxHeight+this.unitFormat),t.setAttribute("placeholder",this.minHeight+this.unitFormat+" - "+this.maxHeight+this.unitFormat)}u(r,["viewCreate","viewRemove"],t=>{this.container.querySelector(".fpd-total-views").innerText=r.viewInstances.length}),u(r,["viewSelect"],i=>{if(f(this.container.querySelector(".fpd-view-locker"),["fpd-hidden"],!r.currentViewInstance.options.optionalView),this.container.querySelector(".fpd-current-view").innerText=r.currentViewIndex+1,Lr(this,jr,Nr).call(this,r.currentViewInstance),a){const i=r.currentViewInstance;let t=c(i.options.stageWidth,this.unitFormat),e=c(i.options.stageHeight,this.unitFormat);M(i.options.output,["width","height"])&&(t=i.options.output.width,e=i.options.output.height);var n=a.querySelector('[data-type="width"]'),s=a.querySelector('[data-type="height"]');n.min=this.minWidth,n.max=this.maxWidth,n.value=t,s.min=this.minHeight,s.max=this.maxHeight,s.value=e}}),u(this.container.querySelector(".fpd-view-prev"),"click",t=>{r.selectView(r.currentViewIndex-1)}),u(this.container.querySelector(".fpd-view-next"),"click",t=>{r.selectView(r.currentViewIndex+1)}),u(this.container.querySelector(".fpd-show-views-grid"),"click",t=>{r.deselectElement(),f(r.viewsGrid.container,["fpd-show"],!0)}),u(this.container.querySelector(".fpd-view-locker"),"click",t=>{r.currentViewInstance&&(r.deselectElement(),r.currentViewInstance.toggleLock(!r.currentViewInstance.locked),Lr(this,jr,Nr).call(this,r.currentViewInstance),r.currentViewInstance.locked||l(r.translator.getTranslation("misc","view_unlocked_info","The view is unlocked")))}),a&&u(a.querySelectorAll("input"),"change",t=>{var t=t.currentTarget,t=(this.checkDimensionLimits(t.dataset.type,t),r.currentViewInstance),e=ht(a.querySelector('[data-type="width"]').value,this.unitFormat),i=ht(a.querySelector('[data-type="height"]').value,this.unitFormat),e=this.calcPageOptions(e,i);t.options=h(t.options,e),t.fabricCanvas.viewOptions=t.options,t.fabricCanvas._renderPrintingBox(),t.fabricCanvas.resetSize(),this.doPricing(t)})}checkDimensionLimits(t,e){let i=parseInt(e.value);return"width"==t?i<this.minWidth?i=this.minWidth:i>this.maxWidth&&(i=this.maxWidth):i<this.minHeight?i=this.minHeight:i>this.maxHeight&&(i=this.maxHeight),e.value=i}calcPageOptions(t,e){var i=Math.min((Dr(this,Br)-Dr(this,Fr))/t,(Dr(this,Br)-Dr(this,Fr))/e),n=parseInt(t*i),i=parseInt(e*i);return{stageWidth:n+Dr(this,Fr),stageHeight:i+Dr(this,Fr),printingBox:{width:n,height:i,left:(n+Dr(this,Fr))/2-n/2,top:(i+Dr(this,Fr))/2-i/2,visibility:!0},usePrintingBoxAsBounding:!0,output:{width:c(t,"mm"),height:c(e,"mm")}}}doPricing(i){if(i&&this.fpdInstance.mainOptions.dynamicViewsOptions.pricePerArea){let t=c(i.options.stageWidth,"cm"),e=c(i.options.stageHeight,"cm");M(i.options.output,["width","height"])&&(t=i.options.output.width/10,e=i.options.output.height/10);var n=Math.ceil(t*e)*Number(this.fpdInstance.mainOptions.dynamicViewsOptions.pricePerArea);i.changePrice(0,"+",n)}}}function Nr(t){var e=this.container.querySelector(".fpd-view-locker");f(e.querySelector(".fpd-icon-locked"),["fpd-hidden"],!t.locked),f(e.querySelector(".fpd-icon-unlocked"),["fpd-hidden"],t.locked)}class Hr extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-head"> <span class="fpd-btn fpd-add-blank fpd-hidden" data-defaulttext="Add Blank Page">misc.dynamic_views_add_blank</span> <span class="fpd-btn fpd-add-layout" data-defaulttext="Add Page from Layouts">misc.dynamic_views_add_from_layouts</span> <div class="fpd-close"> <span class="fpd-icon-close"></span> </div> </div> <div class="fpd-scroll-area"> <div class="fpd-grid"></div> </div> <div class="fpd-blank-page-modal fpd-shadow-1 fpd-hidden"> <div class="fpd-head"> <label class="fpd-input"> <span data-defaulttext="Width">misc.dynamic_views_width</span> <input type="number" min="1" step="1" data-type="width" class="fpd-tooltip"> </label> <label class="fpd-input"> <span data-defaulttext="Height">misc.dynamic_views_height</span> <input type="number" min="1" step="1" data-type="height" class="fpd-tooltip"> </label> <span class="fpd-btn" data-defaulttext="Add Page">misc.dynamic_views_add_view</span> <div class="fpd-close"> <span class="fpd-icon-close"></span> </div> </div> <div class="fpd-scroll-area"> <div class="fpd-grid"></div> </div> </div> <div class="fpd-layouts-modal fpd-shadow-1 fpd-hidden"> <div class="fpd-head"> <div class="fpd-close"> <span class="fpd-icon-close"></span> </div> </div> <div class="fpd-scroll-area"> <div class="fpd-grid"></div> </div> </div> '}}function zr(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Wr(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}customElements.define("fpd-views-grid",Hr);var Vr=new WeakSet,Ur=new WeakSet,Yr=new WeakSet;class qr extends EventTarget{constructor(l){if(super(),zr(this,Yr),zr(this,Ur),zr(this,Vr),this.fpdInstance=l,this.formats=l.mainOptions.dynamicViewsOptions.formats,this.currentLayouts=[],this.container=document.createElement("fpd-views-grid"),l.container.append(this.container),f(l.container,["fpd-dynamic-views-enabled"],l.mainOptions.enableDynamicViews),this.gridElem=this.container.querySelector(".fpd-grid"),this.blankPageModal=this.container.querySelector(".fpd-blank-page-modal"),this.layoutsModal=this.container.querySelector(".fpd-layouts-modal"),l.mainOptions.enableDynamicViews){let i;this.blankPageCustomWidthInput=this.blankPageModal.querySelectorAll(".fpd-head input")[0],this.blankPageCustomHeightInput=this.blankPageModal.querySelectorAll(".fpd-head input")[1],this.blankPageCustomWidthInput.setAttribute("placeholder",this.fpdInstance.viewsNav.unitFormat),this.blankPageCustomHeightInput.setAttribute("placeholder",this.fpdInstance.viewsNav.unitFormat),Array.isArray(this.formats)&&this.formats.length&&(d(this.container.querySelector(".fpd-btn.fpd-add-blank"),["fpd-hidden"]),this.formats.forEach(t=>{const e=t[0],i=t[1];let n,s;e>i?(n=150,s=150/e*i):(s=150,n=150/i*e);t=document.createElement("div");t.className="fpd-shadow-1 fpd-item",t.innerHTML="<span>"+e+"x"+i+"<br>"+this.fpdInstance.viewsNav.unitFormat+"</span>",t.style.width=n+"px",t.style.height=s+"px",this.blankPageModal.querySelector(".fpd-grid").append(t),u(t,"click",t=>{Wr(this,Vr,Gr).call(this,e,i)})})),Yn()("unrestricted",{container:this.gridElem,handle:"fpd-sort",item:"fpd-item",placeholder:"fpd-sortable-placeholder",activeItem:"fpd-sortable-dragged",closestItem:"fpd-sortable-closest",autoscroll:!0,animationMs:0,onStart:t=>{i=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t);const e=window.pageYOffset||document.documentElement.scrollTop||0;window.onscroll=()=>{window.scrollTo({top:e})}},onEnd:t=>{t=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(t);i!=t&&(Wr(this,Yr,Zr).call(this,l.viewInstances,i,t),l.productStage.innerHTML="",l.viewInstances.forEach(t=>{l.productStage.append(t.fabricCanvas.wrapperEl)}),o(l,"viewMove"),l.selectView(0)),window.onscroll=()=>{}}}),u(this.container.querySelectorAll(".fpd-btn.fpd-add-blank, .fpd-btn.fpd-add-layout"),"click",t=>{p(this.container,["fpd-modal-visible"]),t.currentTarget.classList.contains("fpd-add-blank")?d(this.blankPageModal,["fpd-hidden"]):d(this.layoutsModal,["fpd-hidden"])}),u(this.container.querySelectorAll(".fpd-blank-page-modal .fpd-close, .fpd-layouts-modal .fpd-close"),"click",()=>{d(this.container,["fpd-modal-visible"]),p(this.blankPageModal,["fpd-hidden"]),p(this.layoutsModal,["fpd-hidden"])}),u(l,"layoutsSet",()=>{f(this.container.querySelectorAll(".fpd-btn.fpd-add-layout"),["fpd-hidden"],!(l.currentLayouts&&0<l.currentLayouts.length)),l.currentLayouts&&l.currentLayouts.length&&l.currentLayouts.forEach(e=>{var t=document.createElement("div");t.className="fpd-shadow-1 fpd-item",t.innerHTML='<picture  style="background-image: url('+e.thumbnail+');"></picture><span>'+e.title+"</span>",this.layoutsModal.querySelector(".fpd-grid").append(t),u(t,"click",t=>{l.addView(e),this.hideModals()})})}),u(this.blankPageModal.querySelector(".fpd-head .fpd-btn"),"click",t=>{if(this.blankPageCustomWidthInput.value&&this.blankPageCustomHeightInput.value){const t=parseInt(Math.abs(this.blankPageCustomWidthInput.value)),e=parseInt(Math.abs(this.blankPageCustomHeightInput.value));Wr(this,Vr,Gr).call(this,t,e)}}),this.blankPageModal.querySelector('.fpd-input input[data-type="width"]').value=this.fpdInstance.viewsNav.minWidth,this.blankPageModal.querySelector('.fpd-input input[data-type="width"]').setAttribute("aria-label",this.fpdInstance.viewsNav.minWidth+this.fpdInstance.viewsNav.unitFormat+" - "+this.fpdInstance.viewsNav.maxWidth+this.fpdInstance.viewsNav.unitFormat),this.blankPageModal.querySelector('.fpd-input input[data-type="height"]').value=this.fpdInstance.viewsNav.minHeight,this.blankPageModal.querySelector('.fpd-input input[data-type="height"]').setAttribute("aria-label",this.fpdInstance.viewsNav.minHeight+this.fpdInstance.viewsNav.unitFormat+" - "+this.fpdInstance.viewsNav.maxHeight+this.fpdInstance.viewsNav.unitFormat),u(this.blankPageModal.querySelectorAll(".fpd-input input"),"change",t=>{t.currentTarget.value=this.fpdInstance.viewsNav.checkDimensionLimits(t.currentTarget.dataset.type,t.currentTarget)})}u(l,"viewCreate",i=>{const n=i.detail.viewInstance,s=FancyProductDesigner.proxyFileServer?FancyProductDesigner.proxyFileServer+n.thumbnail:n.thumbnail,r=document.createElement("div");if(r.className="fpd-shadow-1 fpd-item",r.title=n.title,r.innerHTML='<picture style="background-image: url('+s+');"></picture><span>'+r.title+"</span>",this.gridElem.append(r),l.mainOptions.enableDynamicViews){const i=document.createElement("div"),s=(i.className="fpd-sort",i.innerHTML='<span class="fpd-icon-drag"></span>',r.append(i),document.createElement("div"));s.className="fpd-options",s.innerHTML="···",r.append(s);var a=document.createElement("div");a.className="fpd-dropdown-menu fpd-shadow-1",a.innerHTML=`
<span data-option="edit-size">${l.translator.getTranslation("misc","view_edit_size")}</span>
<span data-option="duplicate">${l.translator.getTranslation("misc","view_duplicate")}</span>
<span data-option="delete">${l.translator.getTranslation("misc","view_delete")}</span>
`,s.append(a);let t=c(n.options.stageWidth,this.fpdInstance.viewsNav.unitFormat),e=c(n.options.stageHeight,this.fpdInstance.viewsNav.unitFormat);M(n.options.output,["width","height"])&&(t=n.options.output.width,e=n.options.output.height);const o=document.createElement("div");o.className="fpd-edit-size-overlay",o.innerHTML=`
<input type="number" data-type="width" step=1 class="fpd-tooltip" min=${this.fpdInstance.viewsNav.minWidth} max=${this.fpdInstance.viewsNav.maxWidth} value=${t} aria-label="${this.fpdInstance.viewsNav.minWidth+this.fpdInstance.viewsNav.unitFormat+" - "+this.fpdInstance.viewsNav.maxWidth+this.fpdInstance.viewsNav.unitFormat}" />
<input type="number" data-type="height" step=1 class="fpd-tooltip" min=${this.fpdInstance.viewsNav.minHeight} max=${this.fpdInstance.viewsNav.maxHeight} value=${e} aria-label="${this.fpdInstance.viewsNav.minHeight+this.fpdInstance.viewsNav.unitFormat+" - "+this.fpdInstance.viewsNav.maxHeight+this.fpdInstance.viewsNav.unitFormat}" />
<span class="fpd-btn"><span class="fpd-icon-done"></span></span>
<span class="fpd-btn fpd-secondary"><span class="fpd-icon-close"></span></span>
`,r.append(o),u(o.querySelectorAll(".fpd-btn"),"click",t=>{var e;t.currentTarget.classList.contains("fpd-secondary")||(t=ht(o.querySelector('[data-type="width"]').value,this.fpdInstance.viewsNav.unitFormat),e=ht(o.querySelector('[data-type="height"]').value,this.fpdInstance.viewsNav.unitFormat),t=this.fpdInstance.viewsNav.calcPageOptions(t,e),n.options=h(n.options,t),n.fabricCanvas.viewOptions=n.options,n.fabricCanvas._renderPrintingBox(),n==this.fpdInstance.currentViewInstance&&n.fabricCanvas.resetSize(),this.fpdInstance.viewsNav.doPricing(n),this.reset()),d(o,["fpd-show"])}),u(o.querySelectorAll("input"),"change",t=>{t=t.currentTarget;"width"==t.dataset.type?(this.fpdInstance.viewsNav.checkDimensionLimits("width",t),this.fpdInstance.viewsNav.checkDimensionLimits("height",t.nextElementSibling)):(this.fpdInstance.viewsNav.checkDimensionLimits("height",t),this.fpdInstance.viewsNav.checkDimensionLimits("width",t.previousElementSibling))}),u(s,"click",t=>{t.stopPropagation();t=s.querySelector(".fpd-dropdown-menu");f(t,["fpd-show"],!t.classList.contains("fpd-show"))}),u(a.querySelectorAll("span"),"click",t=>{t=t.currentTarget.dataset.option;if("edit-size"==t)p(o,["fpd-show"]);else if("duplicate"==t)Wr(this,Ur,Xr).call(this,n);else if("delete"==t){const t=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(r);l.removeView(t)}}),this.fpdInstance.viewsNav.doPricing(n)}u(r.querySelector("picture"),"click",t=>{var e=Array.from(this.gridElem.querySelectorAll(".fpd-item")).indexOf(r);l.selectView(e),this.reset()})}),u(l,"viewRemove",t=>{t=this.gridElem.querySelectorAll(".fpd-item").item(t.detail.viewIndex);t&&t.remove()}),u(l,"clear",()=>{this.gridElem.innerHTML=""}),u(this.container.querySelector(".fpd-close"),"click",this.reset.bind(this)),u(l,"navItemSelect",this.reset.bind(this))}hideModals(){d(this.container,["fpd-modal-visible"]),p(this.blankPageModal,["fpd-hidden"]),p(this.layoutsModal,["fpd-hidden"])}reset(){this.hideModals(),d(this.container,["fpd-show"])}}function Gr(t,e){var i,n;t&&e&&(n=ht(Number(t),this.fpdInstance.viewsNav.unitFormat),i=ht(Number(e),this.fpdInstance.viewsNav.unitFormat),n=this.fpdInstance.viewsNav.calcPageOptions(n,i),this.fpdInstance.addView({title:t+"x"+e,thumbnail:"",elements:[],options:n}),this.hideModals())}function Xr(t){let e=t.fabricCanvas.getObjects(),i=[];e.forEach(t=>{void 0!==t.title&&void 0!==t.source&&(t={title:t.title,source:t.source,parameters:t.getElementJSON(),type:t.getType()},i.push(t))}),this.fpdInstance.addView({title:t.title,thumbnail:t.thumbnail,elements:i,options:t.options})}function Zr(t,e,i){var n=t[e];t.splice(e,1),t.splice(i,0,n)}class Jr extends HTMLElement{constructor(){super()}connectedCallback(){this.innerHTML='<div class="fpd-close-sub-panel"> <span class="fpd-icon-back"></span> <span class="fpd-label" data-defaulttext="Back">toolbar.sub_panel_back</span> </div> <div class="fpd-close"> <span class="fpd-icon-close"></span> </div> <div class="fpd-tools-nav fpd-scroll-area"> <div class="fpd-primary-tools"> <div class="fpd-tool-color" data-panel="color"> <span class="fpd-current-fill"></span> <span class="fpd-label" data-defaulttext="Color">toolbar.color</span> </div> <div class="fpd-tool-edit-text" data-panel="edit-text"> <span class="fpd-icon-text-input"></span> <span class="fpd-label" data-defaulttext="Edit Text">toolbar.edit_text</span> </div> <div class="fpd-tool-text-size" data-panel="text-size"> <input type="text" class="fpd-input"> <span class="fpd-icon-font-size"></span> <span class="fpd-label" data-defaulttext="Size & Spacing">toolbar.text_size_spacing</span> </div> <div class="fpd-tool-font-family" data-panel="font-family"> <fpd-dropdown placeholder=""></fpd-dropdown> <span class="fpd-icon-font"></span> <span class="fpd-label" data-defaulttext="Font">toolbar.font</span> </div> </div> <div class="fpd-secondary-tools fpd-scroll-area"> <div class="fpd-tool-text-format" data-panel="text-format"> <span class="fpd-icon-text-format"></span> <span class="fpd-label" data-defaulttext="Format">toolbar.text_format</span> </div> <div class="fpd-tool-transform" data-panel="transform"> <span class="fpd-icon-transform"></span> <span class="fpd-label" data-defaulttext="Transform">toolbar.transform</span> </div> <div class="fpd-tool-position" data-panel="position"> <span class="fpd-icon-position"></span> <span class="fpd-label" data-defaulttext="Position">toolbar.position</span> </div> <div class="fpd-tool-curved-text" data-panel="curved-text"> <span class="fpd-icon-curved-text"></span> <span class="fpd-label" data-defaulttext="Curved Text">toolbar.curved_text</span> </div> <div class="fpd-tool-advanced-editing" data-panel="advanced-editing"> <span class="fpd-icon-effects"></span> <span class="fpd-label" data-defaulttext="Edit Image">toolbar.advanced_editing</span> </div> <div class="fpd-tool-remove-bg"> <span class="fpd-icon-remove-bg"></span> <span class="fpd-label" data-defaulttext="Remove Background">toolbar.remove_background</span> </div> <div class="fpd-tool-reset"> <span class="fpd-icon-reset"></span> <span class="fpd-label" data-defaulttext="Reset">toolbar.reset</span> </div> <div class="fpd-tool-duplicate"> <span class="fpd-icon-copy"></span> <span class="fpd-label" data-defaulttext="Duplicate">toolbar.duplicate</span> </div> <div class="fpd-tool-remove"> <span class="fpd-icon-bin"></span> <span class="fpd-label" data-defaulttext="Remove">toolbar.remove</span> </div> </div> </div> <div class="fpd-sub-panel"> <div class="fpd-panel-color"> <div class="fpd-panel-tabs"> <span data-tab="fill" data-defaulttext="Fill" class="fpd-active">toolbar.fill</span> <span data-tab="stroke" data-defaulttext="Stroke" class="fpd-tool-text-stroke">toolbar.stroke</span> <span data-tab="shadow" data-defaulttext="Shadow" class="fpd-tool-text-shadow">toolbar.shadow</span> </div> <div class="fpd-panel-tabs-content fpd-scroll-area"> <div data-id="fill" class="fpd-active"> <div class="fpd-color-wrapper"></div> <div class="fpd-tool-fill-opacity fpd-input"> <span class="fpd-label" data-defaulttext="Transparency">toolbar.transparency</span> <fpd-range-slider class="fpd-progress" value="1" step="0.01" min="0" max="1" data-control="opacity"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="1" step="0.01" min="0" max="1" data-control="opacity"/> </div> </div> <div data-id="stroke"> <div class="fpd-stroke-color-wrapper"></div> <div class="fpd-tool-stroke-width fpd-input"> <span class="fpd-label" data-defaulttext="Stroke Width">toolbar.stroke_width</span> <fpd-range-slider class="fpd-progress" value="0" step="1" min="0" max="20" data-control="strokeWidth"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="0" step="1" min="0" max="20" data-control="strokeWidth"/> </div> </div> <div data-id="shadow"> <div class="fpd-shadow-color-wrapper"></div> <div class="fpd-tool-shadow-blur fpd-input"> <span class="fpd-label" data-defaulttext="Blur">toolbar.shadow_blur</span> <fpd-range-slider class="fpd-progress" value="0" step="1" min="0" max="200" data-control="shadowBlur"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="0" step="1" min="0" max="200" data-control="shadowBlur"/> </div> <div class="fpd-tool-shadow-offsetX fpd-input"> <span class="fpd-label" data-defaulttext="Offset X">toolbar.shadow_offset_x</span> <fpd-range-slider class="fpd-progress" value="0" step="1" min="-100" max="100" data-control="shadowOffsetX"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="0" step="1" min="-100" max="100" data-control="shadowOffsetX"/> </div> <div class="fpd-tool-shadow-offsetY fpd-input"> <span class="fpd-label" data-defaulttext="Offset Y">toolbar.shadow_offset_y</span> <fpd-range-slider class="fpd-progress" value="0" step="1" min="-100" max="100" data-control="shadowOffsetY"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="0" step="1" min="-100" max="100" data-control="shadowOffsetY"/> </div> <div class="fpd-btn fpd-secondary fpd-remove-shadow" data-defaulttext="Remove Shadow">toolbar.remove_shadow</div> </div> </div> </div> <div class="fpd-panel-edit-text fpd-padding"> <textarea data-control="text"></textarea> </div> <div class="fpd-panel-text-size fpd-padding"> <div class="fpd-tool-text-size fpd-input"> <span class="fpd-label" data-defaulttext="Font Size">toolbar.font_size</span> <fpd-range-slider class="fpd-progress" value="12" step="1" min="1" max="200" data-control="fontSize"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="12" step="1" min="1" max="200" data-control="fontSize"/> </div> <div class="fpd-tool-text-line-spacing fpd-input"> <span class="fpd-label" data-defaulttext="Line Spacing">toolbar.line_spacing</span> <fpd-range-slider class="fpd-progress" value="1" step="0.1" min="-2" max="3" data-control="lineHeight"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="1" step="0.1" min="-2" max="3" data-control="lineHeight"/> </div> <div class="fpd-tool-text-letter-spacing fpd-input"> <span class="fpd-label" data-defaulttext="Letter Spacing">toolbar.letter_spacing</span> <fpd-range-slider class="fpd-progress" value="0" step="1" min="-30" max="30" data-control="letterSpacing"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="0" step="1" min="-30" max="30" data-control="letterSpacing"/> </div> </div> <div class="fpd-panel-text-format fpd-padding"> <div class="fpd-tools-group"> <div class="fpd-tool-text-bold fpd-toggle" data-defaulttext="Bold" data-control="fontWeight" data-enabled="bold" data-disabled="normal" title="toolbar.bold"> <span class="fpd-icon-format-bold"></span> </div> <div class="fpd-tool-text-italic fpd-toggle" data-defaulttext="Italic" data-control="fontStyle" data-enabled="italic" data-disabled="normal" title="toolbar.italic"> <span class="fpd-icon-format-italic"></span> </div> <div class="fpd-tool-text-underline fpd-toggle" data-defaulttext="Underline" data-control="textDecoration" data-enabled="underline" data-disabled="normal" title="toolbar.underline"> <span class="fpd-icon-format-underline"></span> </div> <div class="fpd-tool-text-transform fpd-btn-options" data-control="textTransform" data-options=\'{"none": "fpd-icon-text-transform", "uppercase": "fpd-icon-uppercase", "lowercase": "fpd-icon-lowercase"}\' data-defaulttext="Text Transform" title="toolbar.text_transform"> <span class="fpd-icon-text-transform"></span> </div> </div> <div class="fpd-tool-text-align fpd-btn-group" data-control="textAlign"> <span class="fpd-icon-format-align-left" data-option="left"></span> <span class="fpd-icon-format-align-center" data-option="center"></span> <span class="fpd-icon-format-align-right" data-option="right"></span> <span class="fpd-icon-format-align-justify" data-option="justify"></span> </div> </div> <div class="fpd-panel-font-family fpd-padding" data-control="fontFamily"> <input type="text" data-defaulttext="Search Fonts" placeholder="toolbar.font_family_search"/> <div class="fpd-scroll-area"> <div class="fpd-fonts-list"></div> </div> </div> <div class="fpd-panel-curved-text fpd-padding"> <div class="fpd-curved-options"> <span data-value="normal"> <svg width="48" height="14" viewBox="0 0 48 14" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M2.04787 13.327H0L4.60146 0.673004H6.83039L11.4318 13.327H9.38398L5.76899 2.97148H5.6691L2.04787 13.327ZM2.39126 8.37167H9.03434V9.97814H2.39126V8.37167Z" fill="#485563"/> <path d="M13.2784 13.327V0.673004H17.961C18.8684 0.673004 19.6197 0.821293 20.2149 1.11787C20.8101 1.41033 21.2555 1.80783 21.551 2.31036C21.8465 2.80878 21.9943 3.37104 21.9943 3.99715C21.9943 4.5244 21.8965 4.96926 21.7008 5.33175C21.5052 5.69011 21.243 5.97845 20.9142 6.19677C20.5895 6.41096 20.2315 6.56749 19.8403 6.66635V6.78992C20.2648 6.81052 20.679 6.94645 21.0827 7.19772C21.4906 7.44487 21.8278 7.79705 22.0942 8.25428C22.3606 8.7115 22.4938 9.26759 22.4938 9.92253C22.4938 10.5692 22.3398 11.15 22.0317 11.6649C21.7279 12.1757 21.2575 12.5814 20.6207 12.8821C19.9839 13.1787 19.1701 13.327 18.1795 13.327H13.2784ZM15.2076 11.6896H17.9922C18.9162 11.6896 19.578 11.5125 19.9776 11.1583C20.3772 10.804 20.577 10.3612 20.577 9.82985C20.577 9.43029 20.475 9.06369 20.2711 8.73004C20.0671 8.39639 19.7758 8.1307 19.397 7.93298C19.0224 7.73527 18.577 7.63641 18.0609 7.63641H15.2076V11.6896ZM15.2076 6.14734H17.7924C18.2253 6.14734 18.6145 6.06496 18.9599 5.90019C19.3096 5.73542 19.5864 5.50475 19.7903 5.20817C19.9984 4.90748 20.1025 4.55323 20.1025 4.14544C20.1025 3.62231 19.9173 3.18362 19.5468 2.82937C19.1764 2.47513 18.6082 2.298 17.8424 2.298H15.2076V6.14734Z" fill="#485563"/> <path d="M35.4022 4.78802H33.4542C33.3793 4.37611 33.2399 4.01362 33.0359 3.70057C32.8319 3.38752 32.5822 3.12183 32.2867 2.90352C31.9912 2.6852 31.6602 2.52044 31.294 2.40922C30.9318 2.298 30.5468 2.2424 30.1389 2.2424C29.4022 2.2424 28.7425 2.4257 28.1597 2.7923C27.5812 3.1589 27.1233 3.69645 26.7862 4.40494C26.4532 5.11343 26.2867 5.97845 26.2867 7C26.2867 8.02979 26.4532 8.89892 26.7862 9.60741C27.1233 10.3159 27.5832 10.8514 28.166 11.2139C28.7487 11.5764 29.4043 11.7576 30.1327 11.7576C30.5364 11.7576 30.9194 11.7041 31.2815 11.597C31.6478 11.4857 31.9787 11.323 32.2742 11.1088C32.5697 10.8946 32.8195 10.6331 33.0234 10.3241C33.2315 10.0111 33.3751 9.65273 33.4542 9.24905L35.4022 9.25523C35.2981 9.87722 35.0963 10.4498 34.7966 10.9729C34.501 11.4919 34.1202 11.9409 33.654 12.3199C33.192 12.6947 32.6634 12.9851 32.0682 13.1911C31.4729 13.397 30.8236 13.5 30.1202 13.5C29.013 13.5 28.0265 13.2405 27.1608 12.7215C26.295 12.1984 25.6124 11.4507 25.1129 10.4786C24.6176 9.5065 24.3699 8.34696 24.3699 7C24.3699 5.64892 24.6197 4.48939 25.1191 3.52139C25.6186 2.54927 26.3012 1.80371 27.167 1.2847C28.0328 0.761565 29.0172 0.5 30.1202 0.5C30.7986 0.5 31.4313 0.5968 32.0182 0.7904C32.6093 0.97988 33.14 1.25998 33.6103 1.6307C34.0806 1.99731 34.4698 2.44629 34.7778 2.97766C35.0858 3.50491 35.294 4.10837 35.4022 4.78802Z" fill="#485563"/> <path d="M41.8502 13.327H37.7107V0.673004H41.9813C43.2341 0.673004 44.3101 0.926331 45.2092 1.43299C46.1082 1.93552 46.7971 2.65843 47.2758 3.60171C47.7586 4.54087 48 5.66746 48 6.98146C48 8.29959 47.7565 9.43235 47.2695 10.3798C46.7867 11.3272 46.0874 12.0562 45.1717 12.567C44.256 13.0737 43.1488 13.327 41.8502 13.327ZM39.64 11.6587H41.744C42.718 11.6587 43.5276 11.4775 44.1727 11.115C44.8179 10.7484 45.3007 10.2191 45.6212 9.52709C45.9417 8.83096 46.102 7.98241 46.102 6.98146C46.102 5.98875 45.9417 5.14639 45.6212 4.45437C45.3049 3.76236 44.8325 3.23717 44.204 2.8788C43.5754 2.52044 42.795 2.34125 41.8626 2.34125H39.64V11.6587Z" fill="#485563"/> </svg> </span> <span data-value="curved"> <svg width="60" height="26" viewBox="0 0 60 26" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M4.30362 19.2601L2.8934 20.2466L0 9.08293L1.5349 8.00919L10.7657 14.7396L9.35546 15.7261L1.90512 10.1456L1.83632 10.1938L4.30362 19.2601ZM2.16616 15.591L6.74076 12.3909L7.51036 13.5267L2.93577 16.7269L2.16616 15.591Z" fill="#485563"/> <path d="M17.9225 11.7765L15.7371 1.14353L19.5693 0.330317C20.3119 0.172734 20.9524 0.166864 21.4907 0.312707C22.0283 0.455088 22.4615 0.711755 22.7901 1.08271C23.1181 1.4502 23.3361 1.897 23.4442 2.42311C23.5353 2.86615 23.5321 3.25695 23.4346 3.59552C23.3364 3.93062 23.1716 4.21845 22.9401 4.459C22.7114 4.69537 22.4455 4.88907 22.1424 5.04008L22.1637 5.14392C22.5147 5.0875 22.8772 5.1298 23.251 5.27081C23.6275 5.40765 23.9642 5.64504 24.2612 5.98298C24.5582 6.32091 24.7632 6.76505 24.8763 7.31539C24.988 7.85881 24.9623 8.37359 24.7991 8.85974C24.6387 9.34171 24.3238 9.76433 23.8546 10.1276C23.3846 10.4874 22.7443 10.7533 21.9336 10.9254L17.9225 11.7765ZM19.2186 10.0656L21.4975 9.58204C22.2537 9.42157 22.7648 9.1578 23.0306 8.79074C23.2964 8.42367 23.3835 8.01689 23.2917 7.57039C23.2227 7.23465 23.0759 6.9443 22.8514 6.69936C22.6268 6.45442 22.3425 6.28177 21.9984 6.18141C21.6576 6.08032 21.2761 6.0746 20.8537 6.16423L18.5186 6.65975L19.2186 10.0656ZM18.2614 5.4085L20.3768 4.95961C20.7311 4.88443 21.0353 4.74762 21.2896 4.54917C21.5473 4.35 21.734 4.1081 21.8497 3.82347C21.9681 3.53466 21.9921 3.21892 21.9216 2.87625C21.8313 2.43667 21.6039 2.10021 21.2396 1.86688C20.8752 1.63355 20.3797 1.58338 19.7529 1.71639L17.5966 2.17395L18.2614 5.4085Z" fill="#485563"/> <path d="M43.1012 4.5657L41.5023 4.25126C41.5069 3.89201 41.4506 3.56401 41.3335 3.26726C41.2163 2.9705 41.054 2.70627 40.8464 2.47458C40.6389 2.24288 40.3938 2.05061 40.111 1.89775C39.8316 1.74557 39.5245 1.63655 39.1897 1.57071C38.5849 1.45179 38.014 1.49978 37.4768 1.71468C36.9431 1.93025 36.481 2.30938 36.0905 2.85206C35.7035 3.39541 35.428 4.09755 35.264 4.95849C35.0987 5.82637 35.0958 6.58574 35.2554 7.23659C35.4184 7.88811 35.71 8.41365 36.1301 8.81321C36.5502 9.21276 37.0592 9.47133 37.6571 9.58891C37.9885 9.65408 38.3114 9.67076 38.6258 9.63896C38.9443 9.60435 39.2421 9.52064 39.519 9.38783C39.796 9.25501 40.043 9.07488 40.26 8.84744C40.481 8.6172 40.6564 8.33836 40.7861 8.01091L42.3841 8.33056C42.1988 8.83796 41.9412 9.28792 41.6112 9.68042C41.2854 10.0701 40.9007 10.3871 40.4572 10.6312C40.0178 10.8725 39.5373 11.0319 39.0157 11.1094C38.494 11.1869 37.9445 11.1689 37.3671 11.0553C36.4584 10.8766 35.6903 10.4987 35.063 9.92152C34.4363 9.34089 33.996 8.60062 33.7421 7.70072C33.4916 6.80149 33.4745 5.78428 33.6907 4.64909C33.9076 3.51043 34.2987 2.57351 34.8641 1.83833C35.4301 1.09968 36.1101 0.581522 36.904 0.283862C37.6986 -0.0172703 38.5486 -0.0788126 39.454 0.0992351C40.0109 0.208751 40.5146 0.392457 40.9653 0.650354C41.42 0.90545 41.8107 1.22718 42.1372 1.61554C42.4644 2.00042 42.7118 2.44164 42.8793 2.93918C43.0475 3.43326 43.1215 3.97543 43.1012 4.5657Z" fill="#485563"/> <path d="M51.5599 16.7757L48.7094 14.7817L54.7715 5.8346L57.7123 7.89185C58.5751 8.49539 59.1947 9.19283 59.5711 9.98417C59.9494 10.7726 60.0775 11.6156 59.9552 12.5131C59.8378 13.4097 59.4643 14.3226 58.8348 15.2517C58.2033 16.1837 57.493 16.8673 56.7038 17.3025C55.9174 17.7398 55.0866 17.9185 54.2113 17.8385C53.338 17.7556 52.4542 17.4013 51.5599 16.7757ZM50.8371 14.5315L52.2861 15.5451C52.9568 16.0143 53.6011 16.2761 54.219 16.3306C54.8389 16.3822 55.425 16.2405 55.9772 15.9056C56.5314 15.5678 57.0483 15.0451 57.5278 14.3373C58.0034 13.6354 58.2966 12.9626 58.4074 12.319C58.5211 11.6773 58.4473 11.0784 58.1862 10.5222C57.9251 9.96604 57.4735 9.4634 56.8314 9.01425L55.3008 7.94352L50.8371 14.5315Z" fill="#485563"/> <path d="M57.0036 24.5816C53.8499 20.4523 49.8075 17.1117 45.1862 14.816C40.565 12.5203 35.4877 11.3305 30.3437 11.3379C25.1997 11.3453 20.1257 12.5496 15.5109 14.8585C10.896 17.1675 6.86285 20.5196 3.7207 24.658L5.4326 25.1704C8.37306 21.2977 12.1473 18.1607 16.466 16C20.7846 13.8393 25.5329 12.7123 30.3467 12.7054C35.1605 12.6984 39.9119 13.8119 44.2366 15.9602C48.5612 18.1085 52.3442 21.2347 55.2954 25.0989L57.0036 24.5816Z" fill="#485563"/> </svg> </span> <span data-value="curveReverse"> <svg width="54" height="25" viewBox="0 0 54 25" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M54.0007 1.3373C50.9302 5.23068 46.9944 8.38039 42.495 10.5449C37.9956 12.7094 33.0522 13.8312 28.0439 13.8242C23.0356 13.8173 18.0954 12.6818 13.6023 10.5048C9.10912 8.32778 5.18233 5.16714 2.12305 1.26525L3.78979 0.747006C6.65271 4.39845 10.3275 7.35622 14.5322 9.39348C18.737 11.4307 23.36 12.4934 28.0469 12.4999C32.7337 12.5064 37.3598 11.4566 41.5704 9.43103C45.781 7.40546 49.4642 4.45791 52.3376 0.814432L54.0007 1.3373Z" fill="#485563"/> <path d="M1.37302 16.3375L0 15.4074L8.98733 9.06152L10.4818 10.0739L7.66465 20.5998L6.29163 19.6696L8.69804 11.1241L8.63106 11.0787L1.37302 16.3375ZM3.91457 13.19L8.36853 16.2073L7.61922 17.2783L3.16527 14.2609L3.91457 13.19Z" fill="#485563"/> <path d="M15.9304 23.9401L18.0582 13.9146L21.7893 14.6814C22.5123 14.83 23.086 15.0705 23.5104 15.4029C23.9355 15.7321 24.2236 16.1199 24.3745 16.5665C24.5262 17.0097 24.5494 17.4794 24.4441 17.9754C24.3554 18.3932 24.2027 18.7296 23.9859 18.9848C23.7697 19.2367 23.5123 19.4222 23.2136 19.5413C22.9189 19.6578 22.6073 19.7232 22.279 19.7375L22.2582 19.8354C22.593 19.9212 22.9001 20.0967 23.1796 20.3619C23.4631 20.6245 23.6725 20.9588 23.8079 21.3646C23.9432 21.7705 23.9559 22.2329 23.8457 22.7518C23.737 23.2641 23.5166 23.6991 23.1846 24.0566C22.8566 24.4115 22.4136 24.6559 21.8556 24.7899C21.2983 24.9206 20.625 24.9048 19.8356 24.7426L15.9304 23.9401ZM17.7429 22.9587L19.9617 23.4147C20.698 23.566 21.2551 23.534 21.6331 23.3188C22.011 23.1036 22.2447 22.7855 22.334 22.3645C22.4012 22.0479 22.3816 21.7408 22.2752 21.443C22.1688 21.1453 21.9813 20.8871 21.7128 20.6684C21.4475 20.4504 21.1093 20.2992 20.698 20.2147L18.4245 19.7475L17.7429 22.9587ZM18.6749 18.5677L20.7345 18.991C21.0794 19.0618 21.4033 19.0603 21.7063 18.9863C22.0126 18.913 22.272 18.7756 22.4843 18.574C22.7007 18.3699 22.8432 18.1062 22.9118 17.7832C22.9998 17.3687 22.9259 16.9908 22.6903 16.6495C22.4547 16.3082 22.0318 16.0748 21.4215 15.9494L19.3222 15.518L18.6749 18.5677Z" fill="#485563"/> <path d="M39.1873 17.1784L37.6305 17.4749C37.5063 17.159 37.3382 16.8922 37.1263 16.6744C36.9144 16.4567 36.6732 16.2836 36.403 16.1551C36.1327 16.0266 35.8425 15.9461 35.5323 15.9134C35.2256 15.8802 34.9092 15.8946 34.5832 15.9567C33.9944 16.0688 33.4958 16.3148 33.0874 16.6948C32.6824 17.0742 32.4005 17.571 32.2418 18.1853C32.0864 18.799 32.0885 19.5117 32.2482 20.3235C32.4091 21.1417 32.678 21.807 33.0549 22.3194C33.4351 22.831 33.8863 23.1865 34.4087 23.3859C34.931 23.5852 35.4832 23.6295 36.0654 23.5186C36.388 23.4572 36.6857 23.3563 36.9583 23.2161C37.2337 23.072 37.4727 22.8923 37.6754 22.6772C37.8781 22.462 38.0368 22.2161 38.1515 21.9396C38.2689 21.6592 38.3277 21.3525 38.3278 21.0197L39.8855 20.7282C39.8995 21.2383 39.8277 21.724 39.67 22.1853C39.5149 22.6427 39.2807 23.0574 38.9674 23.4295C38.6567 23.7977 38.2797 24.1089 37.8362 24.3631C37.3927 24.6174 36.8899 24.798 36.3277 24.9051C35.4429 25.0736 34.614 25.0175 33.841 24.7369C33.0673 24.4529 32.4049 23.9627 31.8538 23.2663C31.3061 22.5692 30.9269 21.6855 30.7164 20.6152C30.5052 19.5416 30.5236 18.5822 30.7715 17.737C31.0187 16.8885 31.4477 16.1921 32.0585 15.648C32.6686 15.1005 33.4144 14.7428 34.2959 14.575C34.8381 14.4717 35.3589 14.4523 35.8581 14.5168C36.3601 14.5775 36.828 14.7193 37.2618 14.9423C37.695 15.162 38.0762 15.4595 38.4054 15.8349C38.7339 16.207 38.9946 16.6548 39.1873 17.1784Z" fill="#485563"/> <path d="M51.4414 18.6799L48.666 20.5601L42.7638 12.1242L45.6271 10.1845C46.4671 9.61549 47.3066 9.29566 48.1457 9.22507C48.9829 9.15173 49.782 9.32077 50.5429 9.7322C51.3046 10.139 51.992 10.7804 52.6049 11.6564C53.2197 12.5351 53.5848 13.4009 53.7002 14.2536C53.8183 15.1045 53.6896 15.9082 53.3139 16.6646C52.9362 17.4183 52.3121 18.0901 51.4414 18.6799ZM49.1814 18.5717L50.5921 17.616C51.2451 17.1736 51.7034 16.6851 51.9668 16.1504C52.2284 15.613 52.3052 15.0408 52.1973 14.4339C52.0875 13.8242 51.7992 13.1858 51.3323 12.5185C50.8693 11.8567 50.3689 11.3679 49.8313 11.0521C49.2964 10.7345 48.7347 10.5989 48.1461 10.6455C47.5576 10.6921 46.9508 10.9271 46.3256 11.3506L44.8354 12.3601L49.1814 18.5717Z" fill="#485563"/> </svg> </span> </div> <div class="fpd-tool-curved-text-radius fpd-input"> <span class="fpd-label" data-defaulttext="Radius">toolbar.radius</span> <fpd-range-slider class="fpd-progress" value="80" step="1" min="0" max="400" data-control="curveRadius"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="80" step="1" min="0" max="400" data-control="curveRadius"/> </div> </div> <div class="fpd-panel-transform fpd-padding"> <div class="fpd-tool-angle fpd-input"> <span class="fpd-label" data-defaulttext="Rotate">toolbar.rotate</span> <fpd-range-slider class="fpd-progress" value="1" step="1" min="0" max="359" data-control="angle"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="1" step="1" min="0" max="359" data-control="angle"/> </div> <div class="fpd-tool-scaleX fpd-tool-scale fpd-input"> <span class="fpd-label" data-defaulttext="Scale X">toolbar.scaleX</span> <fpd-range-slider class="fpd-progress" value="1" step="0.01" min="0" max="5" data-control="scaleX"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="1" step="0.01" min="0" max="5" data-control="scaleX"/> </div> <div class="fpd-tool-uniscaling-locker fpd-tool-scale fpd-toggle" data-control="lockUniScaling" data-enabled="true" data-disabled="false"> <span class="fpd-icon-unlocked"></span> </div> <div class="fpd-tool-scaleY fpd-tool-scale fpd-input"> <span class="fpd-label" data-defaulttext="Scale Y">toolbar.scaleY</span> <fpd-range-slider class="fpd-progress" value="1" step="0.01" min="0" max="5" data-control="scaleY"></fpd-range-slider> <input class="fpd-slider-number fpd-number" type="number" value="1" step="0.01" min="0" max="5" data-control="scaleY"/> </div> <div class="fpd-tool-flip fpd-tools-group"> <div data-do="flip-x"> <span class="fpd-icon-flip-horizontal"></span> <span data-defaulttext="Flip Horizontal">toolbar.flip_h</span> </div> <div data-do="flip-y"> <span class="fpd-icon-flip-vertical"></span> <span data-defaulttext="Flip Vertical">toolbar.flip_v</span> </div> </div> </div> <div class="fpd-panel-position"> <div class="fpd-panel-tabs"> <span data-tab="align" data-defaulttext="Align">toolbar.align</span> <span data-tab="arrange" data-defaulttext="Arrange" class="fpd-active">toolbar.arrange</span> </div> <div class="fpd-panel-tabs-content fpd-scroll-area"> <div data-id="align"> <div class="fpd-tool-position-align fpd-tools-group"> <div data-do="align-top"> <span class="fpd-icon-align-top"></span> <span data-defaulttext="Top">toolbar.align_top</span> </div> <div data-do="align-middle"> <span class="fpd-icon-align-horizontal-middle"></span> <span data-defaulttext="Middle">toolbar.center_h</span> </div> <div data-do="align-bottom"> <span class="fpd-icon-align-bottom"></span> <span data-defaulttext="Bottom">toolbar.align_bottom</span> </div> <div data-do="align-left"> <span class="fpd-icon-align-left"></span> <span data-defaulttext="Left">toolbar.align_left</span> </div> <div data-do="align-center"> <span class="fpd-icon-align-vertical-middle"></span> <span data-defaulttext="Center">toolbar.center_v</span> </div> <div data-do="align-right"> <span class="fpd-icon-align-right"></span> <span data-defaulttext="Right">toolbar.align_right</span> </div> </div> </div> <div data-id="arrange"> <div class="fpd-tool-layer-depth fpd-tools-group"> <div data-do="layer-up"> <span class="fpd-icon-move-up"></span> <span data-defaulttext="Move Up">toolbar.move_up</span> </div> <div data-do="layer-down"> <span class="fpd-icon-move-down"></span> <span data-defaulttext="Move Down">toolbar.move_down</span> </div> </div> </div> </div> </div> <div class="fpd-panel-advanced-editing"> <div class="fpd-panel-tabs"> <span data-tab="filters" data-defaulttext="Filters" class="fpd-active">toolbar.filters</span> <span data-tab="crop" data-defaulttext="Crop">toolbar.crop</span> </div> <div class="fpd-panel-tabs-content"> <div data-id="filters"> <div class="fpd-tool-filters fpd-grid fpd-scroll-area fpd-padding"></div> </div> <div data-id="crop"> <div class="fpd-tool-crop-masks fpd-grid fpd-scroll-area fpd-padding"></div> </div> </div> </div> </div>'}}customElements.define("fpd-element-toolbar",Jr);const Qr={none:{name:"None",preview:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAAAXNSR0IArs4c6QAAAAlwSFlzAAALEwAACxMBAJqcGAAABGhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iCiAgICAgICAgICAgIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgICAgICAgICAgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIj4KICAgICAgICAgPHhtcE1NOkRlcml2ZWRGcm9tIHJkZjpwYXJzZVR5cGU9Il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Y+Zzih34loWCorDggdqgtIiFUKhIDtRFnRXT9uEDC1aH39AHmxckhHS9myH6ZQKoq9PYJ6XseWy0ayGSKsr42Cji0nysM95k4BKnEnH6upLRafXQdMpf7+QZn/ZzDUx/mcj/lYFUFO73N0sdte7qzu3MEVu3EJBh2HxzeYzPDMcCXtqbcNQ9dkcWNmHGZc8RDDat+PyLuxbmcGWnrGonq/aF6uVdeoFRJ1C9SUn+Y1Rarn0iaYkoM0MYM2jZyv02BEW7cvMpaSzEihlz7CUNaU/lUpWWx6l4CSeoiXf+OLl1W1FcCqsZJOwhdhb4MhEiMJNwPwUQMBHJyZ0lUmhCRjij3nDZJWYuJMPUF15WR6rcmfHFfoY2kRhfXx9HviFIaT2NFGmcNqRh213yJOTHgBuvejavuT67d3Cz+f8IKBjT1t4CLAAAAAElFTkSuQmCC"},grayscale:{name:"Grayscale",preview:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAANRElEQVRoQ92aR2hW3RaGT3577713RMSCFRVUVNShiIgzERxEjIJkoCASUBQHOhIEkQwEHYsDM1AEIYMoasQWNbH33ruey7Ouz2H7/fnv5U7vByen7bLeVd619j4py/6PfmVguXHjRt6yZcusrKwsy/M84P369Sv78uVL9vr166yhoSF79uxZPP/27Vv2/fv3eG9b+rVq1ao42rVrl7Vp0yaO1q1bF2fm4KBtixYt4qCvZ6450l9673yc//rrr6KZ/aJnY2Nj7oA05EDYr1+/Zm/fvgVsdufOnejMsx8/fvxtoBQMINq2bVsA4p3ABMR8KtC5EbA5QCk45eNc2rYAw4QM9vPnzzhojODv37/Pbt++HYAAiFWwjoMhCP04sIKCp5ZpDgxAtI5jIJwab85CAgFcaiXuAxgXTU1NOYIIBoF1KcDcv38/u3r1algEQIDhWiEUCgF1K8BoLZ556GalYFLrKFypu5UC8H3h7oJhcsDoXjQA1IcPH7LHjx9nly5dihgSpH6bCqEFcDGtVAqIe10tBaR1/8nVtFQpID0kzikYOqh5XQowz58/z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J98vFHGhH41zc3tHyNUgbhWPZUkwIyor5y8HtxrkVlbCUcI+6u20tX+GRe19zqJrlmWY/uvaPv//B7it46+fMq5RuGPxF7variheGDQ53+5z31Pt7T2cMTfbx7pu/N0RyBKXsjStzWUmaj9BRW89dZmrywaOGkZdiFr7ROAHgnY/Wxv48xtidqrfKdcZnYarksKbW2kOrZ2xt67sXb2tzY1OoqFTiN2mBwxuIGnyuAlrvSmNhsEtxzS9eA71AHx/T0u9t6tH+oxfqyor/6zjeqlI+ajfk2fQG0SLXamCc5mQqxcFg9QdgTuibvUy8s07ENmKTPd8YeiW3CPh5TC5GsXEtNWBHMwbuXeDJWIUdD6HVAp8ea2IDVlyaKNLowoU0MRE3p/kS3ujynjasruvXMFisvG+pQDQdPEQ3+fO5GC8C5nQHWVNaUNx2WJVrcTw7u+8OMeZnVOoLXLBQTC2mLkplPZgkNV8LRn8/W6CFisOzF6jhhbda8C1QMI9dgjM1EwAvgOWO7X/HEhqit6utBCI4pzztnOLj9iSH0/EDKC9iMGHa4iD9Ofz46dVKJ84fpOPdvvsNQFVrBBEiHCSOnSW4UUFA0nBCothSvhZ0JEDqGtbxE6vOkwTQcHYzhOo2UPy3P/ksGFnIZg5COl/AfcCwsu/x/WywcSoRQq7nY4NxaekcMC8kDvhrO/RtbYzCbKbwVFA2XuIwEzMcvL5wZQhYk7NYOswQLBzPiUp5zJ2h2mlETAiAssOUbJArxHwXsHddjnt5LmabxWfbmtz3mQi9kY54IknH0XLauH0FRV9ZW0jEWDOAblo2nwgcoX0edi1k48h5XEkMq1FYWkGQU3AdmnUHD6glPetIwCUJcKuzlVXjhQnmm8d/ZIQT/5W/U4TdTAbUwOQ8FsSABj2kXzMCIohfvc/H/bzaox/FhNkIYD9Pwq6b/BoN59YGiHgKVAAAAAElFTkSuQmCC"}};function _(t,e){Kr(t,e),e.add(t)}function Kr(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function $r(t,e){return(e=ta(t=t,e,"get")).get?e.get.call(t):e.value}function ta(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}function D(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var ea=new WeakMap,ia=new WeakSet,na=new WeakSet,L=new WeakSet,sa=new WeakSet,ra=new WeakSet,aa=new WeakSet,oa=new WeakSet,la=new WeakSet,ca=new WeakSet,ha=new WeakSet,da=new WeakSet,ua=new WeakSet,pa=new WeakSet,fa=new WeakSet,ga=new WeakSet,ma=new WeakSet;class va extends EventTarget{constructor(s){var n,t,e,i,r;if(super(),_(this,ma),_(this,ga),_(this,fa),_(this,pa),_(this,ua),_(this,da),_(this,ha),_(this,ca),_(this,la),_(this,oa),_(this,aa),_(this,ra),_(this,sa),_(this,L),_(this,na),_(this,ia),e=this,r=i="currentPlacement",(i=String(r))in e?Object.defineProperty(e,i,{value:"",enumerable:!0,configurable:!0,writable:!0}):e[i]="",t={writable:!0,value:void 0},Kr(this,n=ea),n.set(this,t),this.fpdInstance=s,this.container=document.createElement("fpd-element-toolbar"),D(this,fa,Ma).call(this),Object.keys(s.mainOptions.maxValues).forEach(t=>{var e=this.container.querySelector('[data-control="'+t+'"]');e&&e.setAttribute("max",s.mainOptions.maxValues[t])}),Array.isArray(s.mainOptions.fonts)&&s.mainOptions.fonts.length){const n=this.subPanel.querySelector(".fpd-fonts-list");s.mainOptions.fonts.forEach(t=>{let e="object"==typeof t?t.name:t;const i=document.createElement("span");i.className="fpd-item",i.dataset.value=e,i.innerText=e,i.style.fontFamily=e,n.append(i),u(i,"click",t=>{d(Array.from(n.children),["fpd-active"]),p(i,["fpd-active"]),s.currentViewInstance.fabricCanvas.setElementOptions({fontFamily:e}),D(this,ia,ba).call(this,s.currentElement)})}),u(this.subPanel.querySelector(".fpd-panel-font-family input"),"keyup",t=>{const e=t.currentTarget.value;n.querySelectorAll(".fpd-item").forEach(t=>{0==e.length?t.classList.remove("fpd-hidden"):t.classList.toggle("fpd-hidden",!t.innerText.toLowerCase().includes(e.toLowerCase()))})})}else this.navElem.querySelector(".fpd-tool-font-family").style.display="none";var a=this.subPanel.querySelector(".fpd-tool-filters");for(const n in Qr){const t=document.createElement("div"),l=Qr[n];t.className="fpd-item",t.setAttribute("aria-label",l.name),t.style.backgroundImage=`url(${l.preview})`,a.append(t),u(t,"click",t=>{s.currentViewInstance.fabricCanvas.setElementOptions({filter:l.array||n})})}const o=this.subPanel.querySelector(".fpd-tool-crop-masks");Array.isArray(s.mainOptions.cropMasks)&&s.mainOptions.cropMasks.forEach(e=>{var t=document.createElement("div");t.className="fpd-item",t.setAttribute("aria-label",xt(e)),t.style.backgroundImage=`url(${e})`,o.append(t),u(t,"click",t=>{this.toggle(!1),s.advancedImageEditor.loadImage(s.currentElement,e)})}),u(s,"elementSelect",()=>{var t=s.currentElement;D(this,da,Ia).call(this,t)?(D(this,ua,Oa).call(this,t),D(this,pa,ka).call(this),"text"==t.getType()&&(t.off("changed",D(this,pa,ka).bind(this)),t.on("changed",D(this,pa,ka).bind(this))),D(this,ia,ba).call(this,t)):this.toggle(!1)}),u(s,"elementChange",()=>{"smart"==this.currentPlacement&&this.toggle(!1)}),u(s,"elementModify",t=>{t=t.detail.options;void 0!==t.fontSize&&(D(this,ga,Pa).call(this,"fontSize",t.fontSize),this.navElem.querySelector(".fpd-tool-text-size > input").value=t.fontSize),void 0!==t.fontFamily&&(this.navElem.querySelector(".fpd-tool-font-family fpd-dropdown > input").value=t.fontFamily),void 0!==t.scaleX&&D(this,ga,Pa).call(this,"scaleX",parseFloat(Number(t.scaleX).toFixed(2))),void 0!==t.scaleY&&D(this,ga,Pa).call(this,"scaleY",parseFloat(Number(t.scaleY).toFixed(2))),void 0!==t.angle&&D(this,ga,Pa).call(this,"angle",parseInt(t.angle)),void 0!==t.text&&D(this,ga,Pa).call(this,"text",t.text)}),u(document.body,["mouseup","touchend"],()=>{this.fpdInstance.currentElement&&D(this,pa,ka).call(this)}),u(this.subPanel.querySelectorAll(".fpd-number"),"change",t=>{var t=t.currentTarget,e={},i=(t.value>Number(t.max)&&(t.value=Number(t.max)),t.value<Number(t.min)&&(t.value=Number(t.min)),Number(t.value));t.classList.contains("fpd-slider-number")&&(t.previousElementSibling.setAttribute("value",i),"scaleX"===t.dataset.control)&&s.currentElement&&s.currentElement.lockUniScaling&&(e.scaleY=i,D(this,ga,Pa).call(this,"scaleY",i)),e[t.dataset.control]=i,s.currentViewInstance&&s.currentViewInstance.fabricCanvas.setElementOptions(e)}),u(this.subPanel.querySelectorAll("fpd-range-slider"),"onInput",t=>{var e,i=t.currentTarget,n=t.detail,i=(s.currentViewInstance&&s.currentElement&&((e={})[i=i.dataset.control]=n,"scaleX"===i&&s.currentElement&&s.currentElement.lockUniScaling&&(e.scaleY=n,D(this,ga,Pa).call(this,"scaleY",n)),s.currentViewInstance.fabricCanvas.setElementOptions(e)),t.currentTarget.nextElementSibling);i&&i.classList.contains("fpd-slider-number")&&(i.value=n)}),u(this.subPanel.querySelectorAll(".fpd-panel-tabs > span"),"click",t=>{const e=t.currentTarget,i=e.parentNode,n=i.nextElementSibling;d(i.querySelectorAll("span"),["fpd-active"]),p(e,["fpd-active"]);t=Array.from(n.children);d(t,["fpd-active"]),p(t.filter(t=>t.dataset.id==e.dataset.tab),["fpd-active"])}),u(this.subPanel.querySelectorAll(".fpd-toggle"),"click",t=>{var t=t.currentTarget,e={};f(t,["fpd-enabled"],!t.classList.contains("fpd-enabled")),e[t.dataset.control]=t.classList.contains("fpd-enabled")?t.dataset.enabled:t.dataset.disabled,["true","false"].includes(e[t.dataset.control])&&(e[t.dataset.control]="true"===e[t.dataset.control]),t.classList.contains("fpd-tool-uniscaling-locker")&&D(this,ca,Ta).call(this,e[t.dataset.control]),s.currentViewInstance.fabricCanvas.setElementOptions(e)}),u(this.subPanel.querySelectorAll(".fpd-btn-options"),"click",t=>{t.preventDefault();var t=t.currentTarget,e=JSON.parse(t.dataset.options),i=Object.keys(e),n=s.currentElement?s.currentElement[t.dataset.control]:i[0],i=i.indexOf(n)==i.length-1?i[0]:i[i.indexOf(n)+1],n={};n[t.dataset.control]=i,t.querySelector("span").className=e[i],s.currentViewInstance.fabricCanvas.setElementOptions(n)}),u(this.subPanel.querySelectorAll(".fpd-btn-group [data-option]"),"click",t=>{t.preventDefault();var t=t.currentTarget,e=t.dataset.option,i=(d(Array.from(t.parentNode.children),["fpd-active"]),p(t,["fpd-active"]),{});i[t.parentNode.dataset.control]=e,s.currentViewInstance.fabricCanvas.setElementOptions(i)}),u(this.subPanel.querySelectorAll(".fpd-tools-group > [data-do]"),"click",t=>{var e=t.currentTarget.dataset.do;if("align-left"==e)s.currentElement.alignToPosition("left");else if("align-right"==e)s.currentElement.alignToPosition("right");else if("align-top"==e)s.currentElement.alignToPosition("top");else if("align-bottom"==e)s.currentElement.alignToPosition("bottom");else if("align-middle"==e)s.currentElement.centerElement(!1,!0);else if("align-center"==e)s.currentElement.centerElement(!0,!1);else if("layer-up"==e||"layer-down"==e){t=s.currentElement.getZIndex();s.currentViewInstance.fabricCanvas.setElementOptions({z:(t="layer-up"==e?t+1:t-1)<0?0:t})}else if("flip-x"==e||"flip-y"==e){const t={};"flip-x"==e?t.flipX=!s.currentElement.flipX:t.flipY=!s.currentElement.flipY,s.currentViewInstance.fabricCanvas.setElementOptions(t)}}),u(this.subPanel.querySelector('textarea[data-control="text"]'),"keyup",t=>{t.stopPropagation,t.preventDefault();var e=t.currentTarget.selectionStart,i=t.currentTarget.selectionEnd;s.currentViewInstance.fabricCanvas.setElementOptions({text:t.currentTarget.value}),t.currentTarget.selectionStart=e,t.currentTarget.selectionEnd=i}),u(this.subPanel.querySelectorAll(".fpd-curved-options > span"),"click",t=>{var t=t.currentTarget,e={};"normal"==t.dataset.value?e.curved=!1:(e.curved=!0,e.curveReverse="curveReverse"==t.dataset.value),s.currentViewInstance.fabricCanvas.setElementOptions(e),D(this,ha,Aa).call(this,e)}),u(this.navElem.querySelector(".fpd-tool-reset"),"click",t=>{var e=s.currentElement.originParams;delete e.clipPath,delete e.path,s.currentElement.boundingBox&&(s.currentElement.scaleX=1,e.boundingBox=s.currentElement.boundingBox),s.currentViewInstance.fabricCanvas.setElementOptions(e),s.deselectElement()}),u(this.navElem.querySelector(".fpd-tool-duplicate"),"click",t=>{s.currentViewInstance.fabricCanvas.duplicateElement(s.currentElement)}),u(this.navElem.querySelector(".fpd-tool-remove"),"click",t=>{s.currentViewInstance.fabricCanvas.removeElement(s.currentElement)}),u(this.subPanel.querySelector(".fpd-panel-color .fpd-remove-shadow"),"click",t=>{s.currentViewInstance.fabricCanvas.setElementOptions({shadowColor:null})}),u(this.navElem.querySelector(".fpd-tool-remove-bg"),"click",t=>{let e=s.currentElement;s.deselectElement(),s.toggleSpinner(!0,s.translator.getTranslation("misc","loading_image")),re({url:s.mainOptions.aiService.serverURL,body:{service:"removeBG",image:e.source},onSuccess:t=>{t&&t.new_image?e.setSrc(t.new_image,()=>{e.source=t.new_image,e.canvas.renderAll(),l(s.translator.getTranslation("misc","ai_remove_bg_success"))},{crossOrigin:"anonymous"}):s.aiRequestError(t.error),s.toggleSpinner(!1)},onError:s.aiRequestError.bind(s)})}),u(this.navElem.querySelectorAll("[class^=fpd-tool-]"),"click",t=>{const e=t.currentTarget;if(e.dataset.panel){d(this.navElem.querySelectorAll("[class^=fpd-tool-]"),["fpd-active"]),p(e,["fpd-active"]);const t=Array.from(this.subPanel.children),i=t.filter(t=>t.classList.contains("fpd-panel-"+e.dataset.panel));d(t,["fpd-active"]),p(i,["fpd-active"]),"smart"==this.currentPlacement&&(p(this.container,["fpd-panel-visible"]),D(this,pa,ka).call(this))}}),u(this.container.querySelector(".fpd-close"),"click",t=>{this.toggle(!1),s.deselectElement()}),u(this.container.querySelector(".fpd-close-sub-panel"),"click",t=>{d(Array.from(this.subPanel.children),["fpd-active"]),d(this.container,["fpd-panel-visible"])})}toggle(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];f(this.container,["fpd-show"],t),f(document.body,["fpd-toolbar-visible"],t)}}function ba(e){var t;e.hasOwnProperty("fontFamily")&&(D(this,na,ya).call(this,!1,!1),Array.isArray(this.fpdInstance.mainOptions.fonts))&&this.fpdInstance.mainOptions.fonts.length&&((t=this.fpdInstance.mainOptions.fonts.find(t=>t.name==e.fontFamily))?.url&&t.url.toLowerCase().includes(".ttf")?t.variants?D(this,na,ya).call(this,Boolean(t.variants.n7),Boolean(t.variants.i4)):D(this,na,ya).call(this,!1,!1):"google"===t?.url&&t.variants&&D(this,na,ya).call(this,Boolean(t.variants.includes("bold")),Boolean(t.variants.includes("italic"))))}function ya(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];f(this.subPanel.querySelector(".fpd-tool-text-bold"),["fpd-disabled"],!t),f(this.subPanel.querySelector(".fpd-tool-text-italic"),["fpd-disabled"],!e)}function B(t){var e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],t=this.navElem.querySelectorAll(".fpd-tools-nav .fpd-tool-"+t);return f(t,["fpd-hidden"],!Boolean(e)),t}function xa(t,e,i){i=Boolean(i);var n=this.subPanel.querySelector(".fpd-panel-"+t);return f(n.querySelectorAll(".fpd-tool-"+e),["fpd-hidden"],!i),t}function wa(t,e,i){t=this.subPanel.querySelector(".fpd-panel-"+t);f(t.querySelectorAll('.fpd-panel-tabs [data-tab="'+e+'"]'),["fpd-hidden"],!i)}function Ca(t,e){"png"!==t.isColorizable()&&t.changeColor(e)}function Sa(t,e){this.navElem.querySelector(".fpd-current-fill").style.background=e,this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}function Ea(t,e,i){e=t.changeObjectColor(e,i);this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}function Ta(t){this.subPanel.querySelector(".fpd-tool-uniscaling-locker > span").className=t?"fpd-icon-locked":"fpd-icon-unlocked",f(this.subPanel.querySelector(".fpd-tool-scaleY"),["fpd-disabled"],t)}function Aa(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=this.subPanel.querySelector(".fpd-curved-options");d(e.querySelectorAll("[data-value]"),["fpd-active"]),t.curved?t.curveReverse?p(e.querySelectorAll('[data-value="curveReverse"]'),["fpd-active"]):p(e.querySelectorAll('[data-value="curved"]'),["fpd-active"]):p(e.querySelectorAll('[data-value="normal"]'),["fpd-active"]),f(this.subPanel.querySelector(".fpd-tool-curved-text-radius"),["fpd-hidden"],!t.curved)}function Ia(t){return t&&!t._ignore&&!t.uploadZone}function Oa(s){let t;D(this,ma,_a).call(this),d(this.container,["fpd-type-image"]),s.hasColorSelection()&&(e=wt(s,this.fpdInstance),(t="group"===s.type&&1<s.getObjects().length?(i=Array.isArray(s.colors)&&1<s.colors.length,Vn({colors:e,colorNames:this.fpdInstance.mainOptions.hexNames,palette:s.colors,subPalette:i,enablePicker:!!this.fpdInstance.mainOptions.editorMode||!i,onChange:(t,e)=>{D(this,la,Ea).call(this,s,e,t)},onMove:(t,e)=>{s.changeObjectColor(e,t)}})):Un(this.fpdInstance,{colors:e,patterns:Array.isArray(s.patterns)&&(s.isSVG()||"text"===s.getType())?s.patterns:null,onMove:t=>{D(this,aa,Ca).call(this,s,t)},onChange:t=>{D(this,oa,Sa).call(this,s,t)},onPatternChange:t=>{this.navElem.querySelector(".fpd-current-fill").style.background=`url("${t}")`,this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({pattern:t},s)}}))&&$r(this,ea).append(t),(i=this.subPanel.querySelector(".fpd-stroke-color-wrapper")).innerHTML="",e=Un(this.fpdInstance,{colors:Array.isArray(s.strokeColors)&&0<s.strokeColors.length?s.strokeColors:[s.stroke||"#000"],onMove:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({stroke:t},s)},onChange:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({stroke:t},s)}}),i.append(e),(i=this.subPanel.querySelector(".fpd-shadow-color-wrapper")).innerHTML="",e=zn({initialColor:b(s.shadowColor).isValid()?s.shadowColor:"#000000",colorNames:this.fpdInstance.mainOptions.hexNames,palette:this.fpdInstance.mainOptions.colorPickerPalette,onMove:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({shadowColor:t},s)},onChange:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({shadowColor:t},s)}}),i.append(e),D(this,L,B).call(this,"color"),D(this,ra,wa).call(this,"color","fill",!0),D(this,ra,wa).call(this,"color","stroke","text"===s.getType()),D(this,ra,wa).call(this,"color","shadow",!0)),!t&&(s.isSVG()||"text"===s.getType())&&s.patterns&&s.patterns.length&&(t=Un(this.fpdInstance,{colors:[],patterns:s.patterns,onPatternChange:t=>{this.navElem.querySelector(".fpd-current-fill").style.background=`url("${t}")`,this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({pattern:t},s)}}),$r(this,ea).append(t),D(this,L,B).call(this,"color"),D(this,ra,wa).call(this,"color","fill",!0));var e,i=Boolean(s.resizable&&"image"===s.getType()||s.uniScalingUnlockable||s.__editorMode);(i||s.rotatable)&&(D(this,L,B).call(this,"transform"),D(this,sa,xa).call(this,"transform","scale",i),D(this,ca,Ta).call(this,s.lockUniScaling),D(this,sa,xa).call(this,"transform","uniscaling-locker",Boolean(s.uniScalingUnlockable||s.__editorMode)),D(this,sa,xa).call(this,"transform","angle",Boolean(s.rotatable||s.__editorMode)),D(this,sa,xa).call(this,"transform","flip",Boolean(i||s.__editorMode))),(s.draggable||s.zChangeable||s.__editorMode)&&(D(this,L,B).call(this,"position"),D(this,ra,wa).call(this,"position","arrange",Boolean(s.zChangeable||s.__editorMode)),D(this,ra,wa).call(this,"position","align",Boolean(s.draggable||s.__editorMode))),"text"===s.getType()&&(s.editable||s.__editorMode)?(D(this,L,B).call(this,"edit-text"),D(this,L,B).call(this,"text-size",Boolean(s.resizable||s.__editorMode)&&!s.widthFontSize),D(this,L,B).call(this,"font-family"),D(this,L,B).call(this,"text-format"),s.curvable&&(D(this,L,B).call(this,"curved-text"),D(this,ha,Aa).call(this,s),this.subPanel.querySelector('fpd-range-slider[data-control="curveRadius"]').setAttribute("max",s.maxCurveRadius)),this.subPanel.querySelector('textarea[data-control="text"]').value=s.text,D(this,L,B).call(this,"edit-text",!s.textPlaceholder&&!s.numberPlaceholder)):"text"!==s.getType()&&p(this.container,["fpd-type-image"]),s.advancedEditing&&s.source&&(e=s.source,["jpeg","jpg","png"].includes(yt(e)))&&(D(this,L,B).call(this,"advanced-editing"),D(this,ra,wa).call(this,"advanced-editing","filters",!0),D(this,ra,wa).call(this,"advanced-editing","crop",Boolean(Array.isArray(this.fpdInstance.mainOptions.cropMasks)&&this.fpdInstance.mainOptions.cropMasks.length)),D(this,L,B).call(this,"remove-bg",Boolean(this.fpdInstance.mainOptions.aiService.serverURL&&this.fpdInstance.mainOptions.aiService.removeBG))),D(this,sa,xa).call(this,"text-size","text-line-spacing",!s.curved),D(this,L,B).call(this,"reset"),D(this,L,B).call(this,"duplicate",s.copyable||s.__editorMode),D(this,L,B).call(this,"remove",s.removable||s.__editorMode),this.subPanel.querySelectorAll(".fpd-panel-tabs").forEach(t=>{var e=t.querySelectorAll("[data-tab]:not(.fpd-hidden)");f(t,["fpd-hidden"],e.length<=1),e.item(0)&&e.item(0).click()}),this.container.querySelectorAll("[data-control]").forEach(t=>{const e=t.dataset.control;if(t.classList.contains("fpd-number")){if(void 0!==s[e]){var i=t.step&&1<t.step.length?parseFloat(s[e]).toFixed(2):parseInt(s[e]);if(t.value=i,t.classList.contains("fpd-slider-number")){const n=t.previousElementSibling;"fontSize"==e?(n.setAttribute("min",s.minFontSize),n.setAttribute("max",s.maxFontSize)):"scaleX"!=e&&"scaleY"!=e||n.setAttribute("min",s.minScaleLimit),n.setAttribute("value",i)}}}else if(t.classList.contains("fpd-toggle"))f(t,["fpd-enabled"],s[e]===t.dataset.enabled);else if(t.classList.contains("fpd-btn-options")){const i=JSON.parse(t.dataset.options);t.querySelector("span").className=i[s[e]]}else if(t.classList.contains("fpd-btn-group")){d(Array.from(t.children),["fpd-active"]);const e=t.dataset.control;p(t.querySelector('[data-option="'+s[e]+'"]'),["fpd-active"])}else"fontFamily"==e?(this.navElem.querySelector(".fpd-tool-font-family fpd-dropdown > input").value=s[e],void 0!==s[e]&&(d(this.subPanel.querySelectorAll(".fpd-fonts-list .fpd-item"),["fpd-active"]),p(this.subPanel.querySelector('.fpd-fonts-list .fpd-item[data-value="'+s[e]+'"]'),["fpd-active"]))):"fontSize"==e&&(this.navElem.querySelector(".fpd-tool-text-size > input").value=s[e]);const n=Ct(s);n&&(this.navElem.querySelector(".fpd-current-fill").style.background=n)}),"sidebar"==this.currentPlacement&&this.navElem.querySelector("[data-panel]:not(.fpd-hidden)").click(),this.toggle(),this.container.querySelectorAll(".fpd-scroll-area").forEach(t=>{t.scrollLeft=t.scrollTop=0}),this.container.dataset.fabricType=s.type,this.container.dataset.elementType=s.getType()}function ka(){if("smart"===this.currentPlacement&&D(this,da,Ia).call(this,this.fpdInstance.currentElement)&&!this.fpdInstance.container.classList.contains("fpd-aie-visible")&&(this.toggle(Boolean(this.fpdInstance.currentElement)),this.fpdInstance.currentElement)){var e=this.fpdInstance.currentElement,i=this.fpdInstance.container.getBoundingClientRect(),n=e.getBoundingRect(),n=n.top+n.height+e.controls.mtr.offsetY+e.cornerSize;let t=this.fpdInstance.productStage.getBoundingClientRect().top+n;(t=t>i.height+i.top?i.height+i.top:t)>window.innerHeight-this.container.clientHeight&&(t=window.innerHeight-this.container.clientHeight);n=e.oCoords,i=this.container.offsetWidth/2,e=this.fpdInstance.currentViewInstance.fabricCanvas.wrapperEl.getBoundingClientRect().left+n.mt.x;e=(e=e<i?i:e)>window.innerWidth-i?window.innerWidth-i:e,this.container.style.top=t+"px",this.container.style.left=e+"px"}}function Ma(){var t,e=this.fpdInstance.container.dataset.layout,i=(this.container.className="fpd-layout-"+e,this.fpdInstance.container.classList.contains("fpd-sidebar")||(this.fpdInstance.mainOptions.toolbarPlacement="smart"),"smart"==this.fpdInstance.mainOptions.toolbarPlacement||this.fpdInstance.container.classList.contains("fpd-layout-small")?("smart"!=this.currentPlacement&&("body"==this.fpdInstance.mainOptions.toolbarDynamicContext?document.body:document.querySelector(this.fpdInstance.mainOptions.toolbarDynamicContext)).appendChild(this.container),this.currentPlacement="smart",this.container.className+=" fpd-container fpd-smart"):("sidebar"!=this.currentPlacement&&this.fpdInstance.mainBar.container.appendChild(this.container),this.currentPlacement="sidebar",this.container.className+=" fpd-container fpd-sidebar"),this.navElem=this.container.querySelector(".fpd-tools-nav"),this.subPanel=this.container.querySelector(".fpd-sub-panel"),e=ea,t=this.subPanel.querySelector(".fpd-color-wrapper"),this),e=ta(this,e,"set");if(e.set)e.set.call(i,t);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=t}d(this.fpdInstance.container,["fpd-toolbar-smart","fpd-toolbar-sidebar"]),p(this.fpdInstance.container,["fpd-toolbar-"+this.currentPlacement])}function Pa(t,e){this.subPanel.querySelectorAll('[data-control="'+t+'"]').forEach(t=>{t.value=e,t.setAttribute("value",e)})}function _a(){$r(this,ea).innerHTML="",d(this.container,["fpd-panel-visible"]),p(this.navElem.querySelectorAll("[class^=fpd-tool-]"),["fpd-hidden"]),d(this.navElem.querySelectorAll("[class^=fpd-tool-]"),["fpd-active"]),d(Array.from(this.subPanel.children),["fpd-active"]),p(this.subPanel.querySelectorAll(".fpd-panel-tabs > span"),["fpd-hidden"]),d(this.subPanel.querySelectorAll(".fpd-panel-tabs-content > *, .fpd-panel-tabs > *"),["fpd-active"])}class Da{constructor(t){this.fpdInstance=t}start(){var t;this.fpdInstance.mainOptions.guidedTour&&Object.keys(this.fpdInstance.mainOptions.guidedTour).length&&(t=Object.keys(this.fpdInstance.mainOptions.guidedTour)[0],this.selectStep(t))}selectStep=s=>{const r=document.body.querySelector(".fpd-gt-step");r&&r.remove();let a=Object.keys(this.fpdInstance.mainOptions.guidedTour).indexOf(s),t=s.split(":"),o=null;if("module"===t[0]?o=this.fpdInstance.mainBar.container.querySelector('.fpd-navigation > [data-module="'+t[1]+'"]'):"action"===t[0]?o=document.body.querySelector('.fpd-btn[data-action="'+t[1]+'"]'):1===t.length&&(o=document.body.querySelector(t[0])),o)if(0===o.length)Object.keys(this.fpdInstance.mainOptions.guidedTour)[a+1]&&this.selectStep(Object.keys(this.fpdInstance.mainOptions.guidedTour)[a+1]);else{const r=document.createElement("div");r.className="fpd-container fpd-gt-step",r.innerHTML=`<div class="fpd-gt-pointer">
<span class="fpd-icon-arrow-dropdown"></span>
</div>
<div class="fpd-gt-close">
<span class="fpd-icon-close"></span>
</div>
<div class="fpd-gt-text">${this.fpdInstance.mainOptions.guidedTour[s]}</div>
<div class="fpd-gt-actions">
<div class="fpd-gt-next fpd-btn fpd-primary">${this.fpdInstance.translator.getTranslation("misc","guided_tour_next","Next")}</div>
<div class="fpd-gt-back fpd-btn fpd-primary">${this.fpdInstance.translator.getTranslation("misc","guided_tour_back","Back")}</div>
<span class="fpd-gt-counter">${String(a+1)+"/"+Object.keys(this.fpdInstance.mainOptions.guidedTour).length}</span>
</div>`,document.body.append(r);let t=o.getBoundingClientRect(),e=.5*t.width,i=t.left+e,n=t.top+t.height;i<24&&(i=24),r.style.left=i+"px",r.style.top=n+"px";s=r.getBoundingClientRect();s.width+s.left>window.innerWidth&&(e=window.innerWidth-(s.width+i),r.style.left=i+e+"px",r.querySelector(".fpd-gt-pointer").style.marginLeft=Math.abs(e)+"px"),n>window.innerHeight-s.height&&(n-=s.height,r.style.top=n+"px",p(r,["fpd-reverse"]));const l=r.querySelector(".fpd-gt-back"),c=Object.keys(this.fpdInstance.mainOptions.guidedTour)[a-1],h=(c?u(l,"click",t=>{this.selectStep(c)}):p(l,["fpd-hidden"]),r.querySelector(".fpd-gt-next")),d=Object.keys(this.fpdInstance.mainOptions.guidedTour)[a+1];d?u(h,"click",t=>{this.selectStep(d)}):p(h,["fpd-hidden"]),u(r.querySelector(".fpd-gt-close"),"click",t=>{m()&&window.localStorage.setItem("fpd-gt-closed","yes"),r.remove()})}}}function La(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Ba(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var Fa=new WeakSet,ja=new WeakSet;class Ra extends EventTarget{constructor(t){if(super(),La(this,ja),La(this,Fa),i=this,s=!1,e=n="enabled",(n=String(e))in i?Object.defineProperty(i,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):i[n]=s,this.fpdInstance=t,this.variations=t.mainOptions.bulkVariations,t.mainOptions.bulkVariationsPlacement&&"object"==typeof this.variations&&(this.container=document.querySelector(t.mainOptions.bulkVariationsPlacement),this.container)){this.enabled=!0;const i=document.createElement("div"),n=(i.className="fpd-head",this.container.append(i),document.createElement("div")),s=(n.className="fpd-headline",n.innerText=t.translator.getTranslation("misc","bulk_add_variations_title","Bulk Order"),i.append(n),document.createElement("span"));s.className="fpd-btn",s.innerText=t.translator.getTranslation("misc","bulk_add_variations_add","Add"),i.append(s),u(s,"click",t=>{Ba(this,Fa,Na).call(this)}),this.listElem=document.createElement("div"),this.listElem.className="fpd-variations-list",this.container.append(this.listElem),p(this.container,["fpd-bulk-variations","fpd-container"]),Ba(this,Fa,Na).call(this),u(t,"getOrder",()=>{t._order.bulkVariations=this.getOrderVariations()})}var e,i,n,s}getOrderVariations(){if(!this.listElem)return!1;let i=[];return this.listElem.querySelectorAll(".fpd-row").forEach(t=>{var e={};t.querySelectorAll("select").forEach(t=>{g(t.value)&&(i=!1,p(t,["fpd-error"])),e[t.name]=t.value}),!1!==i?i.push({variation:e,quantity:parseInt(t.querySelector(".fpd-quantity").value)}):l(this.fpdInstance.translator.getTranslation("misc","bulk_add_variations_term"))}),i}setup(t){Array.isArray(t)&&(this.listElem.innerHTML="",t.forEach(t=>{Ba(this,Fa,Na).call(this,t)})),Ba(this,ja,Ha).call(this)}}function Na(){let i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};const e=document.createElement("div"),n=(e.className="fpd-row",this.listElem.append(e),i.variation||{});for(const i in this.variations){const s=document.createElement("select");s.name=i,s.innerHTML=`<option value='' disabled selected>${i}</option>`,e.append(s),this.variations[i].forEach(t=>{var e=document.createElement("option");e.value=t,e.innerText=t,n[i]==t&&(e.selected=!0),s.append(e)}),u(s,["change"],t=>{d(s,["fpd-error"])})}const s=document.createElement("input");s.className="fpd-quantity",s.type="number",s.min=1,s.step=1,s.value=i.quantity||1,e.append(s),u(s,"change",t=>{s.value<Number(s.min)&&(s.value=Number(s.min)),""==s.inputElem&&(s.value=1),Ba(this,ja,Ha).call(this)});var t=document.createElement("span");t.className="fpd-icon-close",e.append(t),u(t,"click",t=>{e.remove(),Ba(this,ja,Ha).call(this)}),Ba(this,ja,Ha).call(this)}function Ha(){let e=0;this.listElem.querySelectorAll(".fpd-quantity").forEach(t=>{e+=parseInt(t.value)}),this.fpdInstance.setOrderQuantity(parseInt(e))}function za(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object");e.add(t)}function Wa(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var Va=new WeakSet,Ua=new WeakSet,Ya=new WeakSet,qa=new WeakSet,Ga=new WeakSet;class Xa extends EventTarget{constructor(t){super(),za(this,Ga),za(this,qa),za(this,Ya),za(this,Ua),za(this,Va),this.fpdInstance=t,g(t.mainOptions.colorSelectionPlacement)||(this.container=document.querySelector(t.mainOptions.colorSelectionPlacement),this.container&&(p(this.container,["fpd-color-selection","fpd-container"]),u(t,"productCreate",Wa(this,Va,Za).bind(this)),u(t,"elementAdd",Wa(this,Va,Za).bind(this)))),u(t,"elementRemove",t=>{var e=t.detail["element"];if(e&&e.showInColorSelection){const t=this.container.querySelector('.fpd-cs-item[data-id="'+e.id+'"]');t&&t.remove()}})}}function Za(){this.container.innerHTML="";var t=this.fpdInstance.getElements(0).filter(t=>t.showInColorSelection);f(this.container,["fpd-hidden"],0==t.length),t.forEach(t=>{Wa(this,Ua,Ja).call(this,t)})}function Ja(i){if(i.hasColorSelection()){var n,s=document.createElement("div");s.className="fpd-cs-item",s.dataset.id=i.id,s.innerHTML=`<div class="fpd-title">${i.title}</div>`,this.container.append(s);let t,e=wt(i,this.fpdInstance);(t="group"===i.type&&1<i.getObjects().length?(n=Array.isArray(i.colors)&&1<i.colors.length,Vn({colors:e,colorNames:this.fpdInstance.mainOptions.hexNames,palette:i.colors,subPalette:n,enablePicker:!n,onChange:(t,e)=>{Wa(this,Ya,Qa).call(this,i,e,t)},onMove:(t,e)=>{i.changeObjectColor(e,t)}})):Un(this.fpdInstance,{colors:e,patterns:Array.isArray(i.patterns)&&(i.isSVG()||"text"===i.getType())?i.patterns:null,onMove:t=>{Wa(this,qa,Ka).call(this,i,t)},onChange:t=>{Wa(this,Ga,$a).call(this,i,t)},onPatternChange:t=>{this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({pattern:t},i)}}))&&s.append(t)}}function Qa(t,e,i){e=t.changeObjectColor(e,i);this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}function Ka(t,e){"png"!==t.isColorizable()&&t.changeColor(e)}function $a(t,e){this.fpdInstance.currentViewInstance.fabricCanvas.setElementOptions({fill:e},t)}window.FPDColorSelection=Xa;var to=new WeakSet;class eo{constructor(e){var t,i=this,t=to;if(t.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object");if(t.add(this),(this.fpdInstance=e).mainOptions.viewThumbnailsWrapper){let t;"main-wrapper"==e.mainOptions.viewThumbnailsWrapper?(t=document.createElement("div"),this.fpdInstance.mainWrapper.container.append(t)):t=e.mainOptions.viewThumbnailsWrapper,this.container="string"==typeof t?document.querySelector(t):t,this.container&&(p(this.container,["fpd-view-thumbnails-wrapper"]),u(this.fpdInstance,["viewCreate","viewRemove","viewMove"],function(t,e){if(to.has(t))return e;throw new TypeError("attempted to get private field on non-instance")}(this,io).bind(this)))}}}function io(t){this.container.innerHTML="",this.fpdInstance.viewInstances.forEach((t,e)=>{var i=document.createElement("div");i.className="fpd-item fpd-tooltip fpd-shadow-1",i.setAttribute("aria-label",t.title),i.style.backgroundImage=`url("${t.thumbnail}")`,this.container.append(i),u(i,"click",()=>{this.fpdInstance.selectView(e)})}),f(this.container,["fpd-hidden"],this.fpdInstance.viewInstances.length<2)}class no extends EventTarget{constructor(e){super(),this.fpdInstance=e,this.container=e.mainWrapper.container.querySelector(".fpd-advanced-image-editor"),this.currentElement=null,this.fImg=null,this.mask=null,this.fabricCanvas=new fabric.Canvas(this.container.querySelector("canvas"),{containerClass:"fpd-aie-canvas",selection:!1}),this.fabricCanvas.setBackgroundColor("#fff",this.fabricCanvas.renderAll.bind(this.fabricCanvas)),u(this.container.querySelector(".fpd-close"),"click",()=>{this.fabricCanvas.clear(),this.toggle(!1)}),u(this.container.querySelector(".fpd-done"),"click",()=>{this.mask.set("fill","transparent"),this.fabricCanvas.clipPath=this.mask;var t={format:"png",top:this.fImg.top,left:this.fImg.left,width:this.fImg.getScaledWidth(),height:this.fImg.getScaledHeight(),multiplier:this.fImg.width/this.fabricCanvas.width},t=this.fabricCanvas.toDataURL(t);e._downloadRemoteImage(t,"mask",{},t=>{t.url?this.currentElement.setSrc(t.url,()=>{this.currentElement.source=t.url,this.currentElement.canvas.renderAll(),o(e,"viewCanvasUpdate",{viewInstance:e.currentViewInstance})},{crossOrigin:"anonymous"}):t.error&&l(t.error),d(e.viewsNav.container,["fpd-disabled"]),e.loadingCustomImage=!1,e.toggleSpinner(!1)}),this.toggle(!1)})}toggle(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.fabricCanvas.clipPath=null,this.fabricCanvas.clear(),f(this.container,["fpd-hidden"],!t),f(this.fpdInstance.container,["fpd-aie-visible"],t)}loadImage(t,e){this.mask=null,this.currentElement=t,this.toggle(),this.fabricCanvas.setDimensions({width:this.container.offsetWidth,height:this.container.offsetHeight}),fabric.Image.fromURL(t.originParams.source,t=>{(this.fImg=t).evented=!1,t.width>t.height?t.scaleToWidth(this.fabricCanvas.width):t.scaleToHeight(this.fabricCanvas.height),this.fabricCanvas.add(t),t.center(),fabric.loadSVGFromURL(e,(t,e)=>{t&&(this.mask=t?fabric.util.groupSVGElements(t,e):null,this.mask.setOptions({selectable:!0,evented:!0,resizable:!0,rotatable:!0,lockUniScaling:!1,lockRotation:!1,borderColor:"transparent",fill:"rgba(184,233,134,0.4)",centeredScaling:!0,transparentCorners:!0,absolutePositioned:!1,cornerSize:24,objectCaching:!1}),this.fabricCanvas.width<this.fabricCanvas.height?this.mask.scaleToWidth(this.fabricCanvas.width-100):this.mask.scaleToHeight(this.fabricCanvas.height-100),this.fabricCanvas.add(this.mask),this.mask.center(),this.fabricCanvas.setActiveObject(this.mask))})},{crossOrigin:"anonymous"})}}function so(t,e){ro(t,e),e.add(t)}function ro(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ao(t,e){return(e=oo(t=t,e,"get")).get?e.get.call(t):e.value}function oo(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}function lo(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var co=new WeakMap,ho=new WeakSet,uo=new WeakSet,po=new WeakSet;class fo extends EventTarget{constructor(t){var e,i,n;super(),so(this,po),so(this,uo),so(this,ho),i={writable:!0,value:0},ro(this,e=co),e.set(this,i),e=this,n=i="currentLayout",(i=String(n))in e?Object.defineProperty(e,i,{value:"",enumerable:!0,configurable:!0,writable:!0}):e[i]="",this.fpdInstance=t}init(){if(this.fpdInstance.mainOptions.modalMode){this.fpdInstance.mainOptions.maxCanvasHeight=.75,this.fpdInstance.mainOptions.canvasHeight="auto";let e=this.fpdInstance.mainOptions.fabricCanvasOptions.allowTouchScrolling=!1;p(document.body,["fpd-modal-mode-active"]),d(this.fpdInstance.container,["fpd-off-canvas","fpd-topbar"]),p(this.fpdInstance.container,["fpd-sidebar"]);const i=document.createElement("div");i.className="fpd-modal-product-designer fpd-modal-overlay fpd-fullscreen",document.body.append(i),this.fpdInstance.modalWrapper=i;var t=document.createElement("div"),t=(t.className="fpd-modal-inner",t.append(this.fpdInstance.container),i.append(t),document.querySelector(this.fpdInstance.mainOptions.modalMode));u(t,"click",t=>{t.preventDefault(),p(document.body,["fpd-overflow-hidden","fpd-modal-designer-visible"]),p(i,["fpd-show"]),this.fpdInstance.selectView(0),this.fpdInstance.currentViewInstance&&(this.fpdInstance.currentViewInstance.fabricCanvas.resetZoom(),e||this.fpdInstance.doAutoSelect()),e=!0,o(this.fpdInstance,"modalDesignerOpen",{}),o(window,"fpdModalDesignerOpen",{})}),u(this.fpdInstance,"modalDesignerClose",()=>{d(document.body,["fpd-overflow-hidden","fpd-modal-designer-visible"])}),u(this.fpdInstance,"priceChange",()=>{i.querySelector("fpd-actions-bar .fpd-total-price").innerHTML=this.fpdInstance.formatPrice(this.fpdInstance.currentPrice)})}this.fpdInstance.container.classList.add("fpd-container"),this.fpdInstance.container.classList.add("fpd-wrapper");t=document.createElement("div");t.innerHTML='<div class="fpd-loader-wrapper"> <div class="fpd-loader"> <div class="fpd-loader-circle"></div> <span class="fpd-loader-text" data-defaulttext="Initializing Product Designer">misc.initializing</span> </div> </div>',this.fpdInstance.container.appendChild(t.firstChild.cloneNode(!0)),this.fpdInstance.mainLoader=this.fpdInstance.container.querySelector(".fpd-loader-wrapper"),this.fpdInstance.actionsBar=new He(this.fpdInstance),this.fpdInstance.mainBar=new wr(this.fpdInstance),this.fpdInstance.mainWrapper=new kr(this.fpdInstance),this.fpdInstance.productStage=this.fpdInstance.mainWrapper.container.querySelector(".fpd-product-stage"),this.fpdInstance.viewsNav=new Rr(this.fpdInstance),this.fpdInstance.viewsGrid=new qr(this.fpdInstance),this.fpdInstance.advancedImageEditor=new no(this.fpdInstance),this.fpdInstance.bulkVariations=new Ra(this.fpdInstance),this.fpdInstance.colorSelection=new Xa(this.fpdInstance),this.fpdInstance.viewThumbnails=new eo(this.fpdInstance),this.fpdInstance.guidedTour=new Da(this.fpdInstance),this.fpdInstance.translator.translateArea(this.fpdInstance.container),this.dispatchEvent(new CustomEvent("ready")),window.addEventListener("resize",lo(this,ho,go).bind(this)),lo(this,ho,go).call(this),lo(this,uo,mo).call(this),lo(this,po,vo).call(this)}updateToolbarWrapper(){var t=document.querySelector("fpd-element-toolbar");t&&t.remove(),this.fpdInstance.toolbar=new va(this.fpdInstance),this.fpdInstance.translator.translateArea(this.fpdInstance.toolbar.container)}}function go(){var t=this.fpdInstance.mainOptions.responsiveBreakpoints;let e;var i=window.innerWidth,n=this,s=oo(this,co,"set");if(s.set)s.set.call(n,i);else{if(!s.writable)throw new TypeError("attempted to set read only private field");s.value=i}e=ao(this,co)<t.small?(this.fpdInstance.container.classList.remove("fpd-layout-medium"),this.fpdInstance.container.classList.remove("fpd-layout-large"),this.fpdInstance.container.classList.add("fpd-layout-small"),"small"):ao(this,co)<t.medium?(this.fpdInstance.container.classList.remove("fpd-layout-small"),this.fpdInstance.container.classList.remove("fpd-layout-large"),this.fpdInstance.container.classList.add("fpd-layout-medium"),"medium"):(this.fpdInstance.container.classList.remove("fpd-layout-medium"),this.fpdInstance.container.classList.remove("fpd-layout-small"),this.fpdInstance.container.classList.add("fpd-layout-large"),"large"),(this.fpdInstance.container.dataset.layout=e)!=this.currentLayout&&(this.currentLayout=e,this.updateToolbarWrapper(),this.fpdInstance.dispatchEvent(new CustomEvent("uiLayoutChange",{detail:{layout:e}})))}function mo(){var t=document.body;let i;(i=document.createElement("div")).className="fpd-thumbnail-preview fpd-shadow-1 fpd-hidden",i.innerHTML="<picture></picture>";const n=document.createElement("div");n.className="fpd-preview-title",i.append(n),t.append(i),u(t,["mouseover","mouseout","mousemove","click"],t=>{if(this.fpdInstance.draggedPlaceholder)i.classList.add("fpd-hidden");else{var e=t.target;if(e.classList.contains("fpd-hover-thumbnail")&&i.classList.contains("fpd-hidden")&&"mouseover"===t.type&&e.dataset.source){i.querySelector(".fpd-price")&&i.querySelector(".fpd-price").remove(),i.querySelector(".fpd-image-quality-ratings")&&i.querySelector(".fpd-image-quality-ratings").remove(),i.querySelector("picture").style.backgroundImage=`url("${e.dataset.source}")`,e.dataset.title&&(n.innerText=e.dataset.title),f(n,["fpd-hidden"],!e.dataset.title),f(i,["fpd-title-enabled"],e.dataset.title);const t=e.querySelector(".fpd-price");t&&i.append(t.cloneNode(!0));e=e.querySelector(".fpd-image-quality-ratings");if(e){const t=e.cloneNode(!0),n=document.createElement("span");n.className="fpd-image-quality-rating-label",n.innerText=e.dataset.qualityLabel,t.prepend(n),i.append(t)}i.classList.remove("fpd-hidden")}if(i.classList.contains("fpd-hidden")||"mousemove"!==t.type&&"mouseover"!==t.type)"mouseout"!==t.type&&"click"!=t.type||i.classList.add("fpd-hidden");else{const n=t.pageX+10+i.offsetWidth>window.innerWidth?window.innerWidth-i.offsetWidth:t.pageX+10;i.style.left=n+"px",i.style.top=t.pageY+10+"px"}}})}function vo(){const t=document.body,o=document.createElement("div");o.className="fpd-main-tooltip",t.append(o),this.fpdInstance.mainTooltip=o,t.addEventListener("mouseover",n=>{n=n.target;if(n.classList.contains("fpd-tooltip")){let t=n.getAttribute("aria-label");null===t&&(t=n.getAttribute("title")),o.innerHTML=t;var{x:n,y:s,width:r,height:a}=n.getBoundingClientRect();let e=Math.floor(s-o.clientHeight-5),i=Math.floor(n+r/2-o.clientWidth/2);e<0&&(e=Math.floor(s+a+5)),i<0?i=0:i>window.outerWidth-o.clientWidth&&(i=window.outerWidth-o.clientWidth-5),o.style.left=i+"px",o.style.top=e+"px",o.classList.add("fpd-show")}else o.classList.remove("fpd-show")}),t.addEventListener("touchstart",t=>{o.classList.remove("fpd-show")})}class bo{constructor(i){const e=document.querySelector(i.mainOptions.editorMode);e&&(p(e,["fpd-editor-box-wrapper","fpd-container"]),this.titleElem=document.createElement("div"),this.titleElem.className="fpd-eb-title",e.append(this.titleElem),this.gridElem=document.createElement("div"),this.gridElem.className="fpd-eb-grid",e.append(this.gridElem),i.mainOptions.editorBoxParameters.forEach(t=>{var e=document.createElement("div");e.innerHTML="<span>"+t+'</span><input type="text" readonly data-prop="'+t+'" />',this.gridElem.append(e)})),u(i,["elementSelect","elementChange"],t=>{e&&(i.currentElement?(this.titleElem.innerText=i.currentElement.title,i.mainOptions.editorBoxParameters.forEach(t=>{let e=i.currentElement[t];void 0!==e&&(e="object"==typeof(e="number"==typeof e?e.toFixed(2):e)&&e.source?e.source.src:e,"fill"===t&&"group"===i.currentElement.type&&(e=i.currentElement.svgFill),t=this.gridElem.querySelector('input[data-prop="'+t+'"]'))&&(t.value=e)})):this.titleElem.innerText="",f(this.gridElem,["fpd-hidden"],!i.currentElement))})}}function e(t,e){xo(t,e),e.add(t)}function yo(t,e,i){xo(t,e),e.set(t,i)}function xo(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function s(t,e,i){var n;n=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0===e)return String(t);e=e.call(t,"string");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}(e),(e="symbol"==typeof n?n:String(n))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}function wo(t,e){return(e=So(t=t,e,"get")).get?e.get.call(t):e.value}function Co(t,e,i){var n=t,t=So(t,e,"set"),e=i;if(t.set)t.set.call(n,e);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=e}return i}function So(t,e,i){if(e.has(t))return e.get(t);throw new TypeError("attempted to "+i+" private field on non-instance")}function F(t,e,i){if(e.has(t))return i;throw new TypeError("attempted to get private field on non-instance")}var Eo=new WeakMap,To=new WeakMap,Ao=new WeakSet,Io=new WeakSet,Oo=new WeakSet,ko=new WeakSet,Mo=new WeakSet,Po=new WeakSet,_o=new WeakSet,Do=new WeakSet,Lo=new WeakSet,Bo=new WeakSet,Fo=new WeakSet;class jo extends EventTarget{constructor(t){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(super(),e(this,Fo),e(this,Bo),e(this,Lo),e(this,Do),e(this,_o),e(this,Po),e(this,Mo),e(this,ko),e(this,Oo),e(this,Io),e(this,Ao),s(this,"container",null),s(this,"mainOptions",{}),s(this,"currentViewInstance",null),s(this,"currentViewIndex",0),s(this,"products",[]),s(this,"designs",[]),s(this,"modalContainer",document.body),s(this,"currentCategoryIndex",0),s(this,"currentProductIndex",0),s(this,"viewInstances",[]),s(this,"productViews",null),s(this,"currentElement",null),s(this,"productCreated",!1),s(this,"colorLinkGroups",{}),s(this,"globalCustomElements",[]),s(this,"doUnsavedAlert",!1),s(this,"currentPrice",0),s(this,"singleProductPrice",0),s(this,"pricingRulesPrice",0),s(this,"watermarkImg",null),s(this,"currentLayouts",[]),s(this,"orderQuantity",1),s(this,"bulkVariations",null),s(this,"industryType",null),s(this,"loadingCustomImage",!1),s(this,"lazyBackgroundObserver",null),s(this,"draggedPlaceholder",null),s(this,"mouseOverCanvas",!1),s(this,"firstProductCreated",!1),yo(this,Eo,{writable:!0,value:0}),yo(this,To,{writable:!0,value:0}),s(this,"inTextField",!1),s(this,"_order",{}),t){this.lazyBackgroundObserver=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(function(t,e){var i,e=1<arguments.length&&void 0!==e?e:null;t&&(t.classList.add("fpd-on-loading"),(i=new Image).src=e||t.dataset.img,i.onload=function(){t.dataset.originwidth=this.width,t.dataset.originheight=this.height,t.classList.remove("fpd-on-loading"),t.style.backgroundImage='url("'+this.src+'")'},i.onerror=function(){t.parentNode.remove()})}(t.target),this.lazyBackgroundObserver.unobserve(t.target))})}),this.container=t,(this.container.instance=this).mainOptions=Et.merge(Et.defaults,i);let e={};Object.keys(this.mainOptions.hexNames).forEach(t=>{e[t.toLowerCase()]=this.mainOptions.hexNames[t]}),this.mainOptions.hexNames=e,this.mainOptions.textParameters.direction=window.getComputedStyle(document.body||document.documentElement).direction,"rtl"==this.mainOptions.textParameters.direction&&(this.mainOptions.textParameters.textAlign="right"),"advanced"==this.mainOptions.cornerControlsStyle&&Vt(),(t.classList.contains("fpd-off-canvas")||t.classList.contains("fpd-topbar"))&&(this.mainOptions.toolbarPlacement="smart"),Array.isArray(this.mainOptions.pricingRules)&&this.mainOptions.pricingRules.length&&(this.pricingRulesInstance=new Pt(this)),this.mainOptions.editorMode&&p(document.body,["fpd-editor-mode"]),this.translator=new ae,this.translator.loadLangJSON(this.mainOptions.langJSON,F(this,Ao,Ro).bind(this))}else console.log("No DOM element found for FPD.")}setupProducts(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];this.products=[],t.forEach(e=>{e.hasOwnProperty("category")?e.products.forEach(t=>{this.addProduct(t,e.category)}):this.addProduct(e)}),this.mainOptions.loadFirstProductInStage&&0<t.length?this.selectProduct(0):this.toggleSpinner(!1),o(this,"productsSet",{})}setupDesigns(t){this.designs=t,o(this,"designsSet",{})}addProduct(t,e){var i=F(this,ko,zo).call(this,e);(void 0===e?this:(!1===i&&(i=this.products.length,this.products[i]={category:e,products:[]}),this.products[i])).products.push(t),o(this,"productAdd",{views:t,category:e,catIndex:i})}selectProduct(t,e){Co(this,Eo,Co(this,To,0)),this.currentCategoryIndex=void 0===e?this.currentCategoryIndex:e,e=(this.products&&this.products.length&&this.products[0].category?this.products[this.currentCategoryIndex]:this).products,(this.currentProductIndex=t)<0?this.currentProductIndex=0:t>e.length-1&&(this.currentProductIndex=e.length-1);t=e[this.currentProductIndex];this.loadProduct(t,this.mainOptions.replaceInitialElements)}loadProduct(t){let e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],n=2<arguments.length&&void 0!==arguments[2]&&arguments[2];t&&(o(this,"productSelect",{product:t}),this.toggleSpinner(!0),this.productCreated=!1,this.colorLinkGroups={},this.globalCustomElements=[],e?this.globalCustomElements=this.getCustomElements():this.doUnsavedAlert=!1,this.fixedElements=this.getFixedElements(),this.reset(),t.forEach((e,t)=>{n&&(e.options=Et.merge(this.mainOptions,e.options));const i={};dt(e.options)&&ee.relevantOptions.forEach(t=>{void 0!==e.options[t]&&(i[t]=e.options[t])}),e.options=i}),this.productViews=t,Co(this,Eo,Co(this,To,0)),t.forEach((t,e)=>{Co(this,Eo,wo(this,Eo)+t.elements.length)}),u(this,"viewCreate",F(this,Mo,Wo)),t)&&this.addView(t[0])}addView(t){let i={},n=(ee.relevantOptions.forEach(t=>{var e=this.mainOptions[t];i[t]=dt(e)?{...e}:e}),t.options=dt(t.options)?h(i,t.options):i,document.body.dataset.fpdIndustryType="",this.industryType=null,0==this.viewInstances.length&&t.options.industry&&t.options.industry.type&&(this.industryType=t.options.industry.type,document.body.dataset.fpdIndustryType=this.industryType),new ee(this.productStage,t,F(this,Do,Yo).bind(this),this.mainOptions.fabricCanvasOptions));n.fabricCanvas.on({"mouse:move":t=>{this.mouseOverCanvas=!t.target||t.target},"mouse:out":t=>{this.mouseOverCanvas=!1},beforeElementAdd:t=>{var e;t.params,this.mainBar&&this.uiManager&&"small"==this.uiManager.currentLayout&&this.mainBar.toggleContentDisplay(!1),this.productCreated||(Co(this,To,(e=wo(this,To),++e)),e=t.title+"<br>"+String(wo(this,To))+"/"+wo(this,Eo),this.mainLoader.querySelector(".fpd-loader-text").innerHTML=e),o(this,"beforeElementAdd",{element:t})},elementAdd:t=>{let i=t["element"];if(i){if(this.productCreated&&"image"==i.getType()&&i.isCustom&&this.toggleSpinner(!1),!this.mainOptions.editorMode&&i.replace&&i.replaceInAllViews&&this.viewInstances.forEach((t,e)=>{this.currentViewIndex!=e&&t.fabricCanvas.getElementByReplace(i.replace)&&!i._replaceAdded&&t.fabricCanvas.addElement(i.getType(),i.source,i.title,{...i.originParams,_replaceAdded:!0})}),i.colorLinkGroup&&0<i.colorLinkGroup.length&&!this.mainOptions.editorMode){t=this.getViewIndexByWrapper(n.fabricCanvas.wrapperEl);if(this.colorLinkGroups.hasOwnProperty(i.colorLinkGroup))if(this.colorLinkGroups[i.colorLinkGroup].elements.push({id:i.id,viewIndex:t}),"object"==typeof i.colors){const t=this.mainOptions.replaceColorsInColorGroup?i.colors:this.colorLinkGroups[i.colorLinkGroup].colors.concat(i.colors);this.colorLinkGroups[i.colorLinkGroup].colors=ft(t)}else 1!==i.colors&&!0!==i.colors||(this.colorLinkGroups[i.colorLinkGroup].colors=["#000"]);else this.colorLinkGroups[i.colorLinkGroup]={elements:[{id:i.id,viewIndex:t}],colors:[]},"object"==typeof i.colors?this.colorLinkGroups[i.colorLinkGroup].colors=i.colors:1!==i.colors&&!0!==i.colors||(this.colorLinkGroups[i.colorLinkGroup].colors=["#000"])}this.productCreated&&this.mainOptions.hideDialogOnAdd&&this.mainBar&&this.mainBar.toggleContentDisplay(!1),o(this,"elementAdd",{element:i}),o(this,"viewCanvasUpdate",{viewInstance:n})}else this.toggleSpinner(!1)},elementRemove:t=>{let e=t["element"];t=this.fixedElements.findIndex(t=>t.element.title==e.title);-1!=t&&this.fixedElements.splice(t,1),o(this,"elementRemove",{element:e}),o(this,"viewCanvasUpdate",{viewInstance:n})},elementSelect:t=>{let e=t["element"];if(this.currentElement=e,F(this,Lo,qo).call(this),e&&!e._ignore&&this.currentViewInstance){if(e.uploadZone&&!this.mainOptions.editorMode){let t=h(this.currentViewInstance.options.customAdds,e.customAdds||{});return void setTimeout(()=>{this.currentViewInstance.currentUploadZone=e.title,this.mainBar.toggleUploadZonePanel(!0,t)},100)}this.currentViewInstance.currentUploadZone&&this.mainBar.toggleUploadZonePanel(!1)}o(this,"elementSelect",{}),this.mainOptions.openTextInputOnSelect&&e&&"text"===e.getType()&&e.editable&&this.toolbar&&this.toolbar.container.querySelector(".fpd-tool-edit-text").click(),F(this,Bo,Go).call(this)},multiSelect:t=>{t=t.activeSelection;o(this,"multiSelect",{activeSelection:t})},elementCheckContainemt:t=>{t=t.boundingBoxMode;"inside"===t&&F(this,Lo,qo).call(this)},elementFillChange:t=>{let{element:e,colorLinking:i}=t;if(this.productCreated&&i&&e.colorLinkGroup&&0<e.colorLinkGroup.length){const t=this.colorLinkGroups[e.colorLinkGroup];t&&t.elements&&t.elements.forEach(t=>{e.id!=t.id&&(t=this.viewInstances[t.viewIndex].fabricCanvas.getElementByID(t.id))&&t.changeColor(e.fill,!1)})}o(this,"elementFillChange",{element:e,colorLinking:i}),o(this,"viewCanvasUpdate",{viewInstance:n}),this.applyTextLinkGroup(e,{fill:e.fill})},elementChange:t=>{var{element:t,type:e}=t;F(this,Lo,qo).call(this),"scaling"===e&&F(this,Bo,Go).call(this,t),o(this,"elementChange",{type:e,element:t})},elementModify:t=>{var{element:t,options:e}=t;F(this,Lo,qo).call(this),this.applyTextLinkGroup(t,e),F(this,Bo,Go).call(this,t),o(this,"elementModify",{options:e,element:t}),o(this,"viewCanvasUpdate",{viewInstance:n})},"text:changed":t=>{t=t.target;this.applyTextLinkGroup(t,{text:t.text})},"history:append":()=>{F(this,Po,Vo).call(this,"append")},"history:clear":()=>{F(this,Po,Vo).call(this,"clear")},"history:undo":()=>{F(this,Po,Vo).call(this,"undo")},"history:redo":()=>{F(this,Po,Vo).call(this,"redo")}}),u(n,"priceChange",t=>{this.calculatePrice()}),n.init()}doAutoSelect(){if(!this.currentViewInstance.locked){let e=null;this.currentViewInstance.fabricCanvas.getObjects().forEach(t=>{t.autoSelect&&!t.hasUploadZone&&(e=t)}),e&&setTimeout(()=>{this.currentViewInstance.fabricCanvas.setActiveObject(e).renderAll()},500)}}aiRequestError(t){l(t),this.toggleSpinner(!1)}calcElementDPI(t){return t&&!t.uploadZone&&t.isBitmap()&&M(this.currentViewInstance.options.output,["width","height"])&&M(this.currentViewInstance.options.printingBox,["left","top","width","height"])?Math.ceil(25.4*this.currentViewInstance.options.printingBox.width/this.currentViewInstance.options.output.width/t.scaleX):null}calcDisplaySize(t){let e=this.mainOptions.rulerUnit,i="cm"==e?10:1,n=1,s=1,r=null;M(this.currentViewInstance.options.printingBox,["left","top","width","height"])&&M(this.currentViewInstance.options.output,["width","height"])?(r=this.calcElementDPI(t),"px"!=e&&(n=this.currentViewInstance.options.output.width/this.currentViewInstance.options.printingBox.width,s=this.currentViewInstance.options.output.height/this.currentViewInstance.options.printingBox.height)):(i=1,e="px");var a=parseInt(t.width*t.scaleX*n),a=parseInt(a/i),t=parseInt(t.height*t.scaleY*s);return{width:a,height:parseInt(t/i),unit:e,dpi:r}}applyTextLinkGroup(i){let n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(i&&!g(i.textLinkGroup)){const s=this.mainOptions.textLinkGroupProps||[];this.viewInstances.forEach(t=>{t.fabricCanvas.getObjects().forEach(e=>{e!==i&&"text"===e.getType()&&e.textLinkGroup===i.textLinkGroup&&("string"==typeof n.text&&(e.set("text",i.text),e.fire("changed"),o(this,"textLinkApply",{element:e,options:{text:i.text}})),Object.keys(i).filter(t=>s.includes(t)).forEach(t=>{e.set(t,i[t]),o(this,"textLinkApply",{element:e,options:{[t]:i[t]}})}),t.fabricCanvas.renderAll())})})}}getViewIndexByWrapper(t){return Array.from(this.productStage.querySelectorAll(".fpd-view-stage")).indexOf(t)}toggleSpinner(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return!!this.mainLoader&&(this.mainLoader.querySelector(".fpd-loader-text").innerText=e,this.mainLoader.classList.toggle("fpd-hidden",!t),this.mainLoader)}selectView(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;this.viewInstances.length<=0||(this.currentViewInstance&&this.currentViewInstance.fabricCanvas&&this.currentViewInstance.fabricCanvas.resetZoom(),(this.currentViewIndex=t)<0?this.currentViewIndex=0:t>this.viewInstances.length-1&&(this.currentViewIndex=this.viewInstances.length-1),this.currentViewInstance&&this.currentViewInstance.fabricCanvas&&this.currentViewInstance.fabricCanvas.clearHistory(),this.currentViewInstance=this.viewInstances[this.currentViewIndex],this.deselectElement(),t=this.productStage.querySelectorAll(".fpd-view-stage"),p(t,["fpd-hidden"]),d(t.item(this.currentViewIndex),["fpd-hidden"]),f(document.body.querySelectorAll('.fpd-btn[data-action="previous-view"], .fpd-btn[data-action="next-view"]'),["fpd-hidden"],this.viewInstances.length<=1),f(document.body.querySelectorAll("fpd-views-nav"),["fpd-hidden"],this.viewInstances.length<=1&&!this.mainOptions.enableDynamicViews),f(document.body.querySelectorAll('.fpd-btn[data-action="previous-view"], .fpd-view-prev'),["fpd-disabled"],0==this.currentViewIndex),f(document.body.querySelectorAll('.fpd-btn[data-action="next-view"], .fpd-view-next'),["fpd-disabled"],this.currentViewIndex===this.viewInstances.length-1),F(this,_o,Uo).call(this),this.currentViewInstance.fabricCanvas.snapToGrid=!1,this.currentViewInstance.fabricCanvas.enableRuler=this.mainOptions.rulerFixed,this.currentViewInstance.fabricCanvas.resetSize(),o(this,"viewSelect"))}getElements(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"all",i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2];t=void 0===t||isNaN(t)?-1:t,i&&this.deselectElement();let n=[];if(-1===t)for(var s=0;s<this.viewInstances.length;++s)n=n.concat(this.viewInstances[s].fabricCanvas.getElements(e,i));else{if(!this.viewInstances[t])return[];n=this.viewInstances[t].fabricCanvas.getElements(e,i)}return n}getCustomElements(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"all",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=[];return this.getElements(e,t,i).forEach(t=>{var e;t.isCustom&&(e=this.getViewIndexByWrapper(t.canvas.wrapperEl),n.push({element:t,viewIndex:e}))}),n}getFixedElements(){let t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"all",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:-1,i=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],n=[];return this.getElements(e,t,i).forEach(t=>{var e;t.fixed&&(e=this.getViewIndexByWrapper(t.canvas.wrapperEl),n.push({element:t,viewIndex:e}))}),n}reset(){null!==this.productViews&&(this.removeEventListener("viewCreate",F(this,Mo,Wo)),this.deselectElement(),this.currentViewInstance&&this.currentViewInstance.fabricCanvas.resetZoom(),this.currentViewIndex=this.currentPrice=this.singleProductPrice=this.pricingRulesPrice=0,this.currentViewInstance=this.productViews=this.currentElement=null,this.viewInstances.forEach(t=>{t.fabricCanvas.dispose()}),this.productStage.innerHTML="",this.viewInstances=[],o(this,"clear"),o(this,"priceChange"))}deselectElement(){this.currentViewInstance&&this.currentViewInstance.fabricCanvas&&(this.currentViewInstance.fabricCanvas.deselectElement(),this.currentElement=null)}addCustomImage(n,s){let r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a=3<arguments.length?arguments[3]:void 0;a=void 0===a?this.currentViewIndex:a;const o=new Image;o.crossOrigin="anonymous",o.src=n,this.toggleSpinner(!0,this.translator.getTranslation("misc","loading_image")),p(this.viewsNav.container,["fpd-disabled"]),o.onload=()=>{this.loadingCustomImage=!1;var t=o.height,e=o.width,i=this.currentViewInstance.options.customImageParameters;if(!bt(this,e,t))return this.toggleSpinner(!1),!1;e={isCustom:!0,isCustomImage:!0},o.src.includes(".svg")&&!i.colors&&(e.colors=!0),t=h(i,e),t=h(t,r);this.viewInstances[a].fabricCanvas.addElement("image",n,s,t,a),d(this.viewsNav.container,["fpd-disabled"])},o.onerror=()=>{d(this.viewsNav.container,["fpd-disabled"]),l("Image could not be loaded!")}}_addGridItemToCanvas(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=2<arguments.length?arguments[2]:void 0,n=!(3<arguments.length&&void 0!==arguments[3])||arguments[3];this.currentViewInstance&&(i=void 0===i?this.currentViewIndex:i,e=h({_addToUZ:this.currentViewInstance.currentUploadZone},e),this.productCreated&&this.mainOptions.hideDialogOnAdd&&this.mainBar&&this.mainBar.toggleContentDisplay(!1),this._addCanvasImage(t.dataset.source,t.dataset.title,e,i,n))}_addCanvasImage(t,e){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=3<arguments.length?arguments[3]:void 0,s=!(4<arguments.length&&void 0!==arguments[4])||arguments[4];this.currentViewInstance&&(n=void 0===n?this.currentViewIndex:n,jo.uploadsToServer&&s?this._downloadRemoteImage(t,e,i):(this.loadingCustomImage=!0,this.addCustomImage(t,e,i,n)))}_downloadRemoteImage(t,e){let i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;if(this.mainOptions.fileServerURL){this.loadingCustomImage=!0,this.toggleSpinner(!0,this.translator.getTranslation("misc","loading_image")),p(this.viewsNav.container,["fpd-disabled"]);var s=new FormData;s.append("url",t);const r=t=>{d(this.viewsNav.container,["fpd-disabled"]),this.toggleSpinner(!1),l(t)};re({url:this.getFileServerURL(),body:s,onSuccess:t=>{t&&t.image_src?n?n({url:t.image_src}):this.addCustomImage(t.image_src,t.filename||e,i):n?n({error:t.image_src}):r(t.error)},onError:r})}else alert("You need to set the fileServerURL in the option, otherwise file uploading does not work!")}addCanvasDesign(t,e){let i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};this.currentViewInstance&&(this.toggleSpinner(!0,this.translator.getTranslation("misc","loading_image")),(i=h(this.currentViewInstance.options.customImageParameters,i)).isCustom=!0,this.currentViewInstance.currentUploadZone&&(i._addToUZ=this.currentViewInstance.currentUploadZone),this.productCreated&&this.mainOptions.hideDialogOnAdd&&this.mainBar&&this.mainBar.toggleContentDisplay(!1),Array.isArray(i.relatedViewImages)?(i.replaceInAllViews=!1,this.viewInstances[0].fabricCanvas.addElement("image",t,e,i),i.relatedViewImages.forEach(t=>{!g(t.viewIndex)&&!g(t.url)&&!g(t.title)&&0<t.viewIndex&&this.viewInstances[t.viewIndex]&&this.viewInstances[t.viewIndex].fabricCanvas.addElement("image",t.url,t.title,{replaceInAllViews:!1,replace:i.replace})})):this.currentViewInstance.fabricCanvas.addElement("image",t,e,i))}toggleResponsive(i){return i=void 0===i?this.container.classList.contains("fpd-not-responsive"):i,f(this.container,["fpd-not-responsive"],!i),this.viewInstances.forEach((t,e)=>{t.options.responsive=i,e==this.currentViewIndex&&t.fabricCanvas.resetSize()}),i}getProduct(){let i=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],e,n="all"==this.mainOptions.customizationRequiredRule?"every":"some";if(e=this.viewInstances[n](t=>t.fabricCanvas.isCustomized),t&&!e)return l(this.translator.getTranslation("misc","customization_required_info")),!1;this.deselectElement(),this.currentViewInstance.fabricCanvas.resetZoom(),this.doUnsavedAlert=!1;let s=[];return this.getElements().forEach(t=>{t.isOut&&"inside"===t.boundingBoxMode&&!t.__editorMode&&(l(t.title+": "+this.translator.getTranslation("misc","out_of_bounding_box")),s=!1)}),!1!==s&&(this.viewInstances.forEach((t,e)=>{t={title:t.title,thumbnail:t.thumbnail,elements:t.fabricCanvas.getElementsJSON(i),options:t.options,names_numbers:t.names_numbers,mask:t.mask,locked:t.locked};0==e&&this.productViews[0].hasOwnProperty("productTitle")&&(t.productTitle=this.productViews[0].productTitle),s.push(t)}),s)}getProductDataURL(){let a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:()=>{},o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[];if(o.onlyExportable=void 0!==o.onlyExportable&&o.onlyExportable,o.enableRetinaScaling=void 0!==o.enableRetinaScaling&&o.enableRetinaScaling,o.watermarkImg=this.watermarkImg,0===this.viewInstances.length)a("");else{this.currentViewInstance.fabricCanvas.resetZoom();var e=document.createElement("canvas");let i=new fabric.Canvas(e,{containerClass:"fpd-hidden fpd-hidden-canvas",enableRetinaScaling:!1}),n=0,s=o.multiplier||1,r=2==t.length?this.viewInstances.slice(t[0],t[1]):this.viewInstances;const l=e=>{e.toDataURL(t=>{fabric.Image.fromURL(t,t=>{i.add(t),0<n&&(t.set("top",i.getHeight()),i.setDimensions({height:i.getHeight()+e.options.stageHeight*s})),++n<r.length?l(r[n]):(delete o.multiplier,setTimeout(function(){a(i.toDataURL(o)),i.dispose(),this.currentViewInstance&&this.currentViewInstance.fabricCanvas.resetSize()},100))},{crossOrigin:"anonymous"})},o),e.options.stageWidth*s>i.getWidth()&&i.setDimensions({width:e.options.stageWidth*s})},c=r[0];i.setDimensions({width:c.options.stageWidth*s,height:c.options.stageHeight*s}),l(c)}}getViewsDataURL(){let e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:()=>{},t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=(t.watermarkImg=this.watermarkImg,[]);this.currentViewInstance.fabricCanvas.resetZoom();for(var n=0;n<this.viewInstances.length;++n)this.viewInstances[n].toDataURL(t=>{i.push(t),i.length===this.viewInstances.length&&e(i)},t)}print(){this.getViewsDataURL(s=>{let r=[],a=0;for(var t=0;t<s.length;++t){let n=new Image;n.src=s[t],n.onload=()=>{if(r.push(n),++a==s.length){const a=window.open("","","width="+r[0].width+",height="+r[0].height*s.length+",location=no,menubar=no,scrollbars=yes,status=no,toolbar=no");e=a,i=this.translator.getTranslation("misc","popup_blocker_alert"),null!=e&&void 0!==e||l(i),a.document.title="Print Image";for(var t=0;t<r.length;++t)a.document.body.append(r[t]);setTimeout(()=>{a.print()},1e3)}var e,i}}})}getUsedFonts(){let s=[],r=[];return this.getElements(-1,"all",!1).forEach(i=>{var t,n;"text"===i.getType()&&-1===s.indexOf(i.fontFamily)&&(t={name:i.fontFamily},(n=this.mainOptions.fonts.find(t=>t.name==i.fontFamily))&&(n.url&&(t.url=n.url),n.variants)&&Object.keys(n.variants).forEach(t=>{var e=i.fontFamily;"n7"==t?e+=" Bold":"i4"==t?e+=" Italic":"i7"==t&&(e+=" Bold Italic"),s.push(e),r.push({name:e,url:n.variants[t]})}),s.push(i.fontFamily),r.push(t))}),r}getViewsSVG(t){for(var e=[],i=0;i<this.viewInstances.length;++i)e.push(this.viewInstances[i].toSVG(t,this.getUsedFonts()));return e}getUsedColors(){var i=[];return this.getElements(0<arguments.length&&void 0!==arguments[0]?arguments[0]:-1,"all",!1).forEach(t=>{var e=t.isColorizable();e&&("svg"===e&&"group"===t.type?t.getObjects().forEach(t=>{b(t.fill).isValid()&&i.push(b(t.fill).toHexString())}):b(t.fill).isValid()&&i.push(b(t.fill).toHexString()))}),ft(i)}removeView(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;this.viewInstances[t].fabricCanvas.wrapperEl.remove(),this.viewInstances.splice(t,1),0<this.viewInstances.length&&(t==this.currentViewIndex?this.selectView(0):this.selectView(t)),o(this,"viewRemove",{viewIndex:t}),this.calculatePrice()}setOrderQuantity(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;this.orderQuantity=""==t||t<0?1:t,this.calculatePrice()}getOrder(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this._order.product=this.getProduct(t.onlyEditableElements,t.customizationRequired),this._order.usedFonts=this.getUsedFonts(),this._order.usedColors=[],this.getUsedColors().forEach(t=>{var e=this.mainOptions.hexNames[t.replace("#","").toLowerCase()],t={hex:t};e&&(t.name=e),this._order.usedColors.push(t)}),o(this,"getOrder",{}),this._order}getPrintOrderData(){let t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e={used_fonts:this.getUsedFonts(),svg_data:[],custom_images:[]};return t&&this.viewInstances.forEach(t=>{e.svg_data.push({svg:t.toSVG({respectPrintingBox:!0}),output:t.options.output})}),this.getCustomElements("image").forEach(t=>{e.custom_images.includes(t.element.source)||e.custom_images.push(t.element.source)}),e}calculatePrice(){var t=!(0<arguments.length&&void 0!==arguments[0])||arguments[0],e=!(1<arguments.length&&void 0!==arguments[1])||arguments[1];F(this,Fo,Xo).call(this);let i=this.singleProductPrice;return this.currentPrice=i,i+=this.pricingRulesPrice,t&&(i*=this.orderQuantity),i%1!=0&&(i=Number(i.toFixed(2))),this.currentPrice=i,e&&o(this,"priceChange"),this.currentPrice}formatPrice(t){return St(t,this.mainOptions.priceFormat)}getFileServerURL(){var t=new URL(this.mainOptions.fileServerURL);return"engraving"==ut(this.viewInstances[0].options,"industry.type")&&(ut(this.viewInstances[0].options,"industry.opts.negative")?t.searchParams.set("filter","threshold_negative"):t.searchParams.set("filter","threshold")),t.href}}function Ro(){{var t,o=t=>{this.mainOptions.fonts=t,setTimeout(()=>{this.uiManager=new fo(this),this.uiManager.addEventListener("ready",F(this,Io,No).bind(this)),this.uiManager.init()},1)};let a=(t=this).mainOptions.fonts;if(a&&0<a.length&&"object"==typeof a[0]){a.sort((t,e)=>{t=t.name.toUpperCase(),e=e.name.toUpperCase();return t<e?-1:e<t?1:0});let n=[],s=[],r=0;const l=document.createElement("style");l.id="fpd-fonts",t.container.before(l),a.forEach(e=>{if(e.hasOwnProperty("url"))if("google"==e.url)n.push(e.name+":400,400i,700,700i");else{let t=e.name;t+=":n4",e.variants&&(t+=","+Object.keys(e.variants).toString()),s.push(t),l.append(Jt(e))}});var i=function(t,e,i){"inactive"==t&&console.log(e+" font could not be loaded."),r==n.length+s.length-1&&o(a),r++},t={fontactive:function(t,e){i("active",t)},fontinactive:function(t,e){i("inactive",t)},timeout:3e3};0<n.length&&(t.google={families:n}),0<s.length&&(t.custom={families:s}),0<n.length||0<s.length?Zt().load(t):o(a)}else o(a)}}function No(){o(this,"ready",{}),this.warningsWrapper=this.container.querySelector(".fpd-warnings"),this.mainOptions.productsJSON&&("object"==typeof this.mainOptions.productsJSON?this.setupProducts(this.mainOptions.productsJSON):se({url:this.mainOptions.productsJSON,onSuccess:t=>{this.setupProducts(t)},onError:()=>{alert("Products JSON could not be loaded. Please check that your URL is correct! URL: "+this.mainOptions.productsJSON)}})),this.mainOptions.designsJSON&&("object"==typeof this.mainOptions.designsJSON?this.setupDesigns(this.mainOptions.designsJSON):se({url:this.mainOptions.designsJSON,onSuccess:t=>{this.setupDesigns(t)},onError:()=>{alert("Design JSON could not be loaded. Please check that your URL is correct! URL: "+this.mainOptions.designsJSON)}})),this.mainOptions.keyboardControl&&u(document,"keydown",t=>{if(this.currentViewInstance&&this.currentViewInstance.fabricCanvas){var e=this.currentViewInstance,i=t.target.nodeName,n=e.fabricCanvas.getActiveObject();if(n&&!["TEXTAREA","INPUT"].includes(i)){switch(t.which){case 8:n.removable&&e.fabricCanvas.removeElement(n);break;case 37:n.draggable&&e.fabricCanvas.setElementOptions({left:n.left-1});break;case 38:n.draggable&&e.fabricCanvas.setElementOptions({top:n.top-1});break;case 39:n.draggable&&e.fabricCanvas.setElementOptions({left:n.left+1});break;case 40:n.draggable&&e.fabricCanvas.setElementOptions({top:n.top+1});break;default:return}t.preventDefault()}}}),this.mainOptions.watermark&&fabric.Image.fromURL(this.mainOptions.watermark,(t,e)=>{e||(this.watermarkImg=t)},{crossOrigin:"anonymous"}),this.mainOptions.unsavedProductAlert&&(window.onbeforeunload=()=>{if(this.doUnsavedAlert)return""});let e=0;if(window.addEventListener("resize",t=>{window.innerWidth===e||this.inTextField||(e=window.innerWidth,this.currentElement&&!["INPUT","TEXTAREA"].includes(document.activeElement)&&this.deselectElement(),this.currentViewInstance&&setTimeout(()=>{this.currentViewInstance.fabricCanvas.resetSize()},100))}),u(this,["productCreate","layoutElementsAdded"],F(this,Oo,Ho).bind(this)),u(this,["productCreate","modalDesignerOpen"],t=>{(this.firstProductCreated||this.mainOptions.modalMode)&&(this.firstProductCreated||"modalDesignerOpen"!==t.type)||(this.mainOptions.autoOpenInfo&&this.actionsBar&&this.actionsBar.doAction("info"),!this.guidedTour)||m()&&"yes"===window.localStorage.getItem("fpd-gt-closed")||this.guidedTour.start(),this.firstProductCreated=this.mainOptions.modalMode&&"modalDesignerOpen"===t.type}),u(document.body,["focusin","blur"],t=>{["TEXTAREA","INPUT"].includes(t.target.nodeName)&&(this.inTextField="focusin"==t.type)},!0),u(document.body,["mouseup","touchend"],e=>{var t=Array.from(document.querySelectorAll(".fpd-container"));!Boolean(t.find(t=>t.contains(e.target)))&&this.mainOptions.deselectActiveOnOutside&&this.deselectElement()},!0),this.mainOptions.dragDropImagesToUploadZones){let e=null;u(document.body,["mousedown","touchstart"],t=>{1==t.which&&(t=t.target).classList.contains("fpd-draggable")&&(e=t,this.draggedPlaceholder=document.createElement("div"),this.draggedPlaceholder.className="fpd-dragged-image fpd-shadow-1 fpd-hidden",this.draggedPlaceholder.style.backgroundImage=`url("${t.querySelector("picture").dataset.img}")`,document.body.append(this.draggedPlaceholder))}),u(document.body,["mousemove"],t=>{this.draggedPlaceholder&&(this.draggedPlaceholder.style.left=t.pageX-.5*e.offsetWidth+"px",this.draggedPlaceholder.style.top=t.pageY-.5*e.offsetHeight+"px",d(this.draggedPlaceholder,["fpd-hidden"]),setTimeout(()=>{this.draggedPlaceholder&&p(this.draggedPlaceholder,["fpd-animate"])},1),t.stopPropagation(),t.preventDefault())}),u(document.body,["mouseup"],t=>{this.draggedPlaceholder&&(this.draggedPlaceholder.remove(),this.draggedPlaceholder=null),!this.loadingCustomImage&&e&&this.mouseOverCanvas&&this._addGridItemToCanvas(e,this.mouseOverCanvas.uploadZone?{_addToUZ:this.mouseOverCanvas.title}:{}),e=null,this.mouseOverCanvas=!1})}"string"==typeof this.mainOptions.editorMode&&new bo(this)}function Ho(){const t=this.globalCustomElements.concat(this.fixedElements);if(!t.length)return;let e=0;const i=e=>{var i=this.viewInstances[e.viewIndex];if(i){e=e.element;if(!i.fabricCanvas.getElementByTitle(e.title)){let t=Object.keys(this.mainOptions.elementParameters);t="text"===e.getType()?t.concat(Object.keys(this.mainOptions.textParameters)):t.concat(Object.keys(this.mainOptions.imageParameters));var n=e.getElementJSON(!1,t);n._printingBox&&delete n.boundingBox,i.fabricCanvas.addElement(e.getType(),e.source,e.title,n)}}else s()},s=()=>{++e<t.length?i(t[e]):this.removeEventListener("elementAdd",s)};u(this,"elementAdd",s),t[0]&&i(t[0])}function zo(e){var t=this.products.findIndex(t=>t.category===e);return-1!==t&&t}function Wo(){var t;this.viewInstances.length<this.productViews.length?this.addView(this.productViews[this.viewInstances.length]):(this.removeEventListener("viewCreate",F(this,Mo,Wo)),this.toggleSpinner(!1),this.selectView(0),!this.mainOptions.editorMode&&this.currentViewInstance&&this.currentViewInstance.fabricCanvas.wrapperEl.offsetParent&&this.doAutoSelect(),this.productCreated=!0,"string"==typeof(t=this.productViews[0].options.layouts)?se({url:t,onSuccess:t=>{this.currentLayouts=t,o(this,"layoutsSet",{})},onError:()=>{alert("Layouts JSON could not be loaded. Please check that your URL is correct! URL: "+this.mainOptions.layouts)}}):Array.isArray(t)&&(this.currentLayouts=t,o(this,"layoutsSet",{})),o(this,"productCreate"))}function Vo(t){["undo","redo"].includes(t)&&this.currentViewInstance.fabricCanvas._renderPrintingBox(),o(this,"historyAction",{type:t}),F(this,_o,Uo).call(this)}function Uo(){var t,e;this.currentViewInstance&&(t=this.currentViewInstance.fabricCanvas.historyUndo,e=this.currentViewInstance.fabricCanvas.historyRedo,t.length&&(this.doUnsavedAlert=!0),t)&&(f(document.body.querySelectorAll('.fpd-btn[data-action="undo"]'),["fpd-disabled"],0==t.length),f(document.body.querySelectorAll('.fpd-btn[data-action="redo"]'),["fpd-disabled"],0==e.length))}function Yo(t){t.fabricCanvas.wrapperEl.parentNode&&(this.viewInstances.push(t),t.fabricCanvas.on("sizeUpdate",t=>{var t=t["canvasHeight"],e=t+"px";this.productStage.style.height=e,this.container.classList.contains("fpd-sidebar")&&(this.mainBar.container.style.height=e,t!=this.mainWrapper.container.offsetHeight)&&(this.mainBar.container.style.height=this.mainWrapper.container.offsetHeight+"px")}),t.names_numbers&&1<t.names_numbers.length&&t.changePrice((t.names_numbers.length-1)*t.options.namesNumbersEntryPrice,"+"),o(this,"viewCreate",{viewInstance:t}),t.fabricCanvas.onHistory(),t.fabricCanvas.clearHistory())}function qo(){if(this.mainTooltip){const s=this.currentElement;if(this.productCreated&&s&&!s.uploadZone&&!s.__editorMode){if(s.isOut&&"inside"===s.boundingBoxMode){const s=this.translator.getTranslation("misc","out_of_bounding_box","Move element inside the boundary!");this.mainTooltip.innerHTML=s,this.mainTooltip.classList.add("fpd-show")}else if(this.mainOptions.sizeTooltip){var i=this.calcDisplaySize(s);let t=i.width+"x"+i.height+i.unit;i.dpi&&(t+=" | DPI:"+i.dpi),this.mainTooltip.innerHTML=t,this.mainTooltip.classList.add("fpd-show")}else this.mainTooltip.classList.remove("fpd-show");if(this.mainTooltip.classList.contains("fpd-show")){var i=s.oCoords,n=this.currentViewInstance.fabricCanvas.wrapperEl.getBoundingClientRect();let t=n.left+i.mt.x-this.mainTooltip.clientWidth/2,e=n.top+i.mt.y-this.mainTooltip.clientHeight-20;n=this.container.getBoundingClientRect();e=(e=e<n.top?n.top-this.mainTooltip.clientHeight:e)<0?0:e,this.mainTooltip.style.left=t+"px",this.mainTooltip.style.top=e+"px"}}else this.mainTooltip.classList.remove("fpd-show")}}function Go(){if(this.warningsWrapper&&!this.mainOptions.editorMode){this.warningsWrapper.innerHTML="";const n=this.currentElement;var t,e,i;this.productCreated&&n&&(t=this.calcElementDPI(n),n.isCustomImage&&null!==t&&t<this.mainOptions.customImageParameters.minDPI?((e=document.createElement("div")).className="fpd-size-warning",e.innerHTML="<span>"+this.translator.getTranslation("misc","dpi_warning","Low resolution!")+"</span>",this.warningsWrapper.append(e),this.mainOptions.aiService.serverURL&&this.mainOptions.aiService.superRes&&((i=document.createElement("span")).className="fpd-btn",i.innerText=this.translator.getTranslation("misc","ai_upscale_btn"),e.append(i),u(i,"click",t=>{var e=this.calcDisplaySize(n),i="mm"==e.unit?25.4:2.54,e=parseInt(this.mainOptions.customImageParameters.minDPI*e.width/i)/n.width;e=4<(e=Math.ceil(e))?4:e,console.log("AI SuperRes - Scale:",e),this.deselectElement(),this.toggleSpinner(!0,this.translator.getTranslation("misc","loading_image")),re({url:this.mainOptions.aiService.serverURL,body:{service:"superRes",image:n.source,scale:e},onSuccess:e=>{if(e&&e.new_image){let t=n.getScaledWidth();n.setSrc(e.new_image,()=>{n.source=e.new_image,n.scaleToWidth(t),n.scaleToWidth(t),n.canvas.renderAll(),l(this.translator.getTranslation("misc","ai_upscale_success")),o(this,"elementModify",{options:{scaleX:n.scaleX},element:n})},{crossOrigin:"anonymous"})}else this.aiRequestError(e.error);this.toggleSpinner(!1)},onError:this.aiRequestError.bind(this)})})),o(this,"imageDPIWarningOn",{element:n,dpi:t})):o(this,"imageDPIWarningOff",{element:n,dpi:t}))}}function Xo(){this.currentPrice=this.singleProductPrice=0,this.viewInstances.forEach(t=>{t.locked||(this.singleProductPrice+=t.truePrice)})}s(jo,"version","6.3.3"),s(jo,"forbiddenTextChars",/<|>/g),s(jo,"proxyFileServer",""),s(jo,"uploadsToServer",!0),s(jo,"additionalModules",{}),window.FancyProductDesigner=jo,window.FPDEmojisRegex=/(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F/g})()})();
var fancyProductDesigner,
$body,
$selector,
$productWrapper,
$cartForm,
$modalPrice=null,
fpdProductCreated=false;
document.addEventListener('DOMContentLoaded', ()=> {
if(typeof fpd_setup_configs==='undefined') return;
fabric.textureSize=Number(fpd_setup_configs.misc.fabric_js_texture_size);
$body=jQuery('body');
$selector=jQuery('#'+fpd_setup_configs.selector);
$productWrapper=jQuery('.post-'+fpd_setup_configs.post_id).first();
$cartForm=jQuery('[name="fpd_product"]:first').parents('form:first');
fancyProductDesigner=new FancyProductDesigner($selector.get(0), fpd_setup_configs.app_options);
fancyProductDesigner.addEventListener('ready', ()=> {
jQuery('.fpd-sc-module-wrapper').each((i, moduleWrapper)=> {
switch(moduleWrapper.dataset.type){
case 'products':
new FPDProductsModule(fancyProductDesigner, moduleWrapper);
break;
case 'text':
new FPDTextsModule(fancyProductDesigner, moduleWrapper);
break;
case 'designs':
new FPDDesignsModule(fancyProductDesigner, moduleWrapper);
break;
case 'images':
new FPDImagesModule(fancyProductDesigner, moduleWrapper);
break;
case 'layouts':
new FPDLayoutsModule(fancyProductDesigner, moduleWrapper);
break;
case 'manage-layers':
new FPDLayersModule(fancyProductDesigner, moduleWrapper);
break;
case 'save-load':
new FPDSaveLoadModule(fancyProductDesigner, moduleWrapper);
break;
case 'text-layers':
new FPDTextLayersModule(fancyProductDesigner, moduleWrapper);
break;
case 'names-numbers':
new FPDNamesNumbersModule(fancyProductDesigner, moduleWrapper);
break;
}
fancyProductDesigner.translator.translateArea(moduleWrapper);
});
jQuery('.fpd-sc-action-placeholder').each((i, item)=> {
item.classList.add('fpd-container');
fancyProductDesigner.actionsBar.addActionBtn(item, item.dataset.action);
});
if(fpd_setup_configs.initial_product&&fpd_setup_configs.initial_product.length > 1){
var fpdData=typeof fpd_setup_configs.initial_product=='string' ? JSON.parse(fpd_setup_configs.initial_product):fpd_setup_configs.initial_product;
product=fpdData.product ? fpdData.product:fpdData;
fancyProductDesigner.toggleSpinner(true);
fancyProductDesigner.loadProduct(product);
if(fpdData.bulkVariations){
fancyProductDesigner.bulkVariations.setup(fpdData.bulkVariations);
}}
if(fpd_setup_configs.misc.login_required){
jQuery('fpd-module-uploads .fpd-upload-image')
.html('<div class="fpd-login-info">'+fpd_setup_configs.labels.login_required+'</div>');
}
if(fpd_setup_configs.misc.pro_export_enabled&&fpd_setup_configs.misc.print_download_designer){
jQuery('.fpd-btn[data-action="download"]').each((i, printActionElem)=> {
if(printActionElem.abortController){
printActionElem.abortController.abort();
printActionElem.addEventListener('click', ()=> {
if(window.fpdDownloadPrintFile){
printActionElem.classList.add('fpd-disabled');
window.fpdDownloadPrintFile(fancyProductDesigner, ()=> {
printActionElem.classList.remove('fpd-disabled');
})
}})
}})
}})
fancyProductDesigner.addEventListener('productCreate', ()=> {
fpdProductCreated=true;
if(['all', 'any'].includes(fancyProductDesigner.mainOptions.customizationRequiredRule)){
$body.addClass('fpd-customization-required');
}})
fancyProductDesigner
.addEventListener('historyAction', ()=> {
let customizationChecker=false,
jsMethod=fancyProductDesigner.mainOptions.customizationRequiredRule=='all' ? 'every':'some';
customizationChecker=fancyProductDesigner.viewInstances[jsMethod]((viewInst)=> {
return viewInst.fabricCanvas.isCustomized;
})
if(customizationChecker){
$body.removeClass('fpd-customization-required');
}})
if(fpd_setup_configs.misc.store_designs_account){
fancyProductDesigner
.addEventListener('actionSave', (evt)=> {
const { product, thumbnail, title }=evt.detail;
if(fpd_setup_configs.current_user_id==0){
FPDSnackbar(fpd_setup_configs.labels.account_storage_login_required);
return;
}
if(product){
fancyProductDesigner.toggleSpinner(true);
let data={
action: 'fpd_saveuserproduct',
title: title,
thumbnail: thumbnail,
product: JSON.stringify(product),
post_id: fpd_setup_configs.post_id
};
jQuery.post(fpd_setup_configs.admin_ajax_url, data, (response)=> {
FPDSnackbar(response.error ? response.error:response.message);
fancyProductDesigner.toggleSpinner(false);
}, 'json');
}})
fancyProductDesigner
.addEventListener('ready', ()=> {
const gridElem=fancyProductDesigner.container.querySelector('fpd-module-save-load .fpd-grid');
if(gridElem&&fancyProductDesigner['moduleInstance_save-load']){
let data={
action: 'fpd_loaduserproducts',
post_id: fpd_setup_configs.post_id
};
jQuery.post(fpd_setup_configs.admin_ajax_url, data, function (response){
if(response.data){
Object.keys(response.data).forEach((metaKey)=> {
const fpdData=response.data[metaKey].fpd_data;
const item=fancyProductDesigner['moduleInstance_save-load'].addSavedProduct(fpdData);
item.dataset.key=metaKey;
});
}}, 'json');
}})
fancyProductDesigner
.addEventListener('actionLoad:Remove', (evt)=> {
const { item, index }=evt.detail;
let data={
action: 'fpd_removeuserproducts',
key: item.dataset.key,
};
jQuery.post(fpd_setup_configs.admin_ajax_url, data, (response)=> { }, 'json');
});
}});
window.fpdDownloadPrintFile=(fancyProductDesigner, callback)=> {
if(fpd_setup_configs.misc.pro_export_enabled&&fancyProductDesigner){
fancyProductDesigner.toggleSpinner(true);
let printData=fancyProductDesigner.getPrintOrderData(fpd_setup_configs.misc.export_method=="svg2pdf");
printData.name=fancyProductDesigner?.viewInstances[0]?.viewData?.productTitle;
const urlParams=new URLSearchParams(window.location.search);
if(urlParams.get("order")&&urlParams.get("item_id"))
printData.name=urlParams.get("order") + "_" + urlParams.get("item_id");
if(fpd_setup_configs.misc.export_method.includes("nodecanvas")){
printData.product_data=fancyProductDesigner.getProduct();
}
const data={
action: "fpd_pr_export",
print_data: JSON.stringify(printData),
};
jQuery.post(fpd_setup_configs.admin_ajax_url,
data,
function (response){
if(response&&response.file_url){
window.open(response.file_url, "_blank");
}else{
alert("Something went wrong. Please contact the site owner!");
}
fancyProductDesigner.toggleSpinner(false);
callback&&callback();
},
"json"
);
}};
jQuery(document).ready(()=> {
function fpdReady(){
let wcPrice=fpd_woo_configs.options.wcPrice,
modalDesignerOnceOpened=false;
jQuery(document)
.on('found_variation', '.variations_form', (evt, variation)=> {
let variationPrice;
if(variation.display_price!==undefined){
wcPrice=variation.display_price;
}
_setTotalPrice();
})
fancyProductDesigner.addEventListener('productCreate', ()=> {
_setTotalPrice();
if(fpd_setup_configs.initial_product){
setTimeout(_setProductImage, 5);
}});
fancyProductDesigner.addEventListener('priceChange', ()=> {
_setTotalPrice();
});
$cartForm.on('fpdProductSubmit', ()=> {
if(!fpd_setup_configs.misc.ajax_add_to_cart_mode)
fancyProductDesigner.toggleSpinner(true);
$cartForm.submit();
})
$cartForm.on('click', ':submit', (evt)=> {
evt.preventDefault();
$quantityInput=$cartForm.find('.quantity input');
if($quantityInput.length > 0&&parseInt($quantityInput.val()) < parseInt($quantityInput.attr('min'))){
return;
}
if(!fpdProductCreated||jQuery(this).is('.wc-variation-selection-needed')){ return false; }
let order=fancyProductDesigner.getOrder({
customizationRequired: fpd_setup_configs.misc.customization_required!=='none'
});
const addToCartDisabled=jQuery('.single_add_to_cart_button').hasClass('disabled');
if(order.product!=false&&order.bulkVariations!==false&&!addToCartDisabled){
FPDSnackbar(fpd_woo_configs.labels.add_to_cart);
let priceSet=_setTotalPrice();
const $addToCartBtn=jQuery('.single_add_to_cart_button').addClass('fpd-disabled');
if(fpd_setup_configs.misc.ajax_add_to_cart_mode){
setTimeout(()=> {
$addToCartBtn.removeClass('fpd-disabled');
}, 3000)
}
let tempDevicePixelRation=fabric.devicePixelRatio,
viewOpts=fancyProductDesigner.viewInstances[0].options,
multiplier=FPDFabricUtils.getScaleByDimesions(viewOpts.stageWidth,
viewOpts.stageHeight,
fpd_woo_configs.options.cart_thumbnail_width,
fpd_woo_configs.options.cart_thumbnail_height
);
fabric.devicePixelRatio=1;
fancyProductDesigner.viewInstances[0].toDataURL((dataURL)=> {
if(fancyProductDesigner.mainOptions.modalMode){
modalDesignerOnceOpened&&$cartForm.find('input[name="fpd_product_thumbnail"]').val(dataURL);
}else{
$cartForm.find('input[name="fpd_product_thumbnail"]').val(dataURL);
}
$cartForm.find('input[name="fpd_product"]').val(JSON.stringify(order));
$cartForm.find('input[name="fpd_print_order"]').val(JSON.stringify(fancyProductDesigner.getPrintOrderData(fpd_setup_configs.misc.export_method=='svg2pdf')));
if(priceSet){
$cartForm.trigger('fpdProductSubmit');
}
fabric.devicePixelRatio=tempDevicePixelRation;
}, {format: 'png', multiplier: multiplier})
}});
fancyProductDesigner.addEventListener('modalDesignerDone', ()=> {
if($selector.parents('.woocommerce').length > 0){
_setProductImage();
}
if(fpd_woo_configs.options.lightbox_add_to_cart){
$cartForm.find(':submit').click();
}})
fancyProductDesigner.addEventListener('modalDesignerOpen', ()=> {
modalDesignerOnceOpened=true;
})
jQuery('#fpd-extern-download-pdf').click((evt)=> {
var $this=jQuery(this);
evt.preventDefault();
if(fpdProductCreated){
if(fpd_setup_configs.misc.pro_export_enabled){
if(window.fpdDownloadPrintFile){
$this.addClass('fpd-disabled');
window.fpdDownloadPrintFile(fancyProductDesigner, ()=> {
$this.removeClass('fpd-disabled');
})
}}else{
fancyProductDesigner.actions.downloadFile('pdf');
}}
});
jQuery('#fpd-save-order').click(function(evt){
evt.preventDefault();
const urlParams=new URLSearchParams(window.location.search);
if(fpdProductCreated&&urlParams.get('item_id')){
fancyProductDesigner.toggleSpinner(true);
const data={
action: 'fpd_save_order',
item_id: urlParams.get('item_id'),
fpd_order: JSON.stringify(fancyProductDesigner.getOrder()),
print_order: fpd_setup_configs.misc.pro_export_enabled ? JSON.stringify(fancyProductDesigner.getPrintOrderData(fpd_setup_configs.misc.export_method=='svg2pdf')):''
};
jQuery.post(fpd_setup_configs.admin_ajax_url,
data,
(response)=> {
fancyProductDesigner.toggleSpinner(false);
FPDSnackbar(typeof response==='object' ?
fpd_woo_configs.labels.order_saved :
fpd_woo_configs.labels.order_saving_failed
);
},
'json'
);
}});
function _setTotalPrice(){
if($body.hasClass('wcbv-product')){
return false;
}
$cartForm.find('input[name="fpd_quantity"]').val(fancyProductDesigner.orderQuantity);
if(fpd_woo_configs.options.disable_price_calculation){
return true;
}
let totalPrice=(parseFloat(wcPrice) *  fancyProductDesigner.orderQuantity) + parseFloat(fancyProductDesigner.calculatePrice(true, false)),
htmlPrice;
totalPrice=totalPrice.toFixed(fpd_woo_configs.options.number_of_decimals);
if(!$priceElem||$priceElem.length==0){
htmlPrice=fancyProductDesigner.formatPrice(totalPrice);
var $priceElem,
selectorPriceAmount=fpd_woo_configs.options.price_selector;
if($productWrapper.find('.variations_form').length > 0){
if($productWrapper.find('.price:first > .amount').length >=2||$productWrapper.find('.price:first ins > .amount').length >=2){
$priceElem=$cartForm.find('.woocommerce-Price-amount:first').length > 0 ?
$cartForm.find(selectorPriceAmount)
:
$productWrapper.find('.single_variation .price .amount:last');
}else{
$priceElem=$productWrapper.find('.woocommerce-Price-amount:first').length > 0 ?
$productWrapper.find(selectorPriceAmount)
:
$productWrapper.find('.price:first .amount:last');
}}else{
$priceElem=$productWrapper.find('.woocommerce-Price-amount').length > 0 ?
$productWrapper.find(selectorPriceAmount)
:
$productWrapper.find('.price:first .amount:last');
}}
if($priceElem&&$priceElem.length > 0){
$priceElem.html(htmlPrice);
}else{
console.info('No price element could be found in the document!');
}
setTimeout(()=> {
jQuery('.fpd-modal-product-designer fpd-actions-bar .fpd-total-price').html(htmlPrice);
}, 1);
if($cartForm.find('input[name="fpd_product_price"]').length > 0){
$cartForm.find('input[name="fpd_product_price"]').val(parseFloat(wcPrice) + fancyProductDesigner.calculatePrice(false, false));
return true;
}else{
return false;
}};
let fpdImage;
function _updateProductImage(imageSrc){
var $firstProductImage=$productWrapper.find('.images'),
firstImageSelector='.woocommerce-product-gallery__image:first img, .slide:first img, .owl-stage .img-thumbnail img';
firstImageSelector +=fpd_woo_configs.options.product_image_css_selector ? ','+fpd_woo_configs.options.product_image_css_selector:'';
var image=new Image();
image.onload=function(){
$firstProductImage.find(firstImageSelector)
.attr('data-large_image_width', this.width)
.attr('data-large_image_height', this.height);
};
image.src=imageSrc;
$firstProductImage
.find(firstImageSelector)
.attr('src', imageSrc).attr('srcset', imageSrc)
.parent('a').attr('href', imageSrc)
.children('img').attr('data-large_image', imageSrc);
$firstProductImage
.find('.flex-control-thumbs li:first img').attr('src', imageSrc);
}
function _setProductImage(){
const $modalDesigner=jQuery('.fpd-modal-product-designer');
if($modalDesigner.length&&fpd_woo_configs.options.lightbox_update_product_image){
let tempShow=false;
if(!$modalDesigner.hasClass('fpd-show')){
tempShow=true;
$modalDesigner.addClass('fpd-show');
}
fancyProductDesigner.selectView(0);
fancyProductDesigner.currentViewInstance.fabricCanvas.resetSize();
const dataURL=fancyProductDesigner.currentViewInstance.fabricCanvas.toDataURL();
if(tempShow){
$modalDesigner.removeClass('fpd-show');
}
_updateProductImage(dataURL);
fpdImage=dataURL;
}};
$productWrapper.find('.images').on('woocommerce_gallery_init_zoom', ()=> {
if(fpdImage){
_updateProductImage(fpdImage);
}
setTimeout(()=> {
if(fpdImage){
_updateProductImage(fpdImage);
}}, 500);
});
}
if(typeof fancyProductDesigner!=='undefined'){
return fpdReady();
}
jQuery('.fpd-container').on('ready', fpdReady);
});
jQuery(document).ready(()=> {
var fpdWcLoadAjaxProduct=false,
$productWrapper=jQuery('.post-'+fpdProductId).first(),
$customizeButton=jQuery('#fpd-start-customizing-button');
$customizeButton.click((evt)=> {
if($customizeButton.hasClass('fpd-next-page')){
evt.preventDefault();
var serializedForm=jQuery('form.variations_form select').serialize();
serializedForm=serializedForm.replace(/[^=&]+=(&|$)/g,"").replace(/&$/,"");
window.open(evt.currentTarget.href+'&'+serializedForm, '_self');
}});
let $form;
if(typeof fancyProductDesigner!=='undefined'){
fancyProductDesigner.addEventListener('productCreate', ()=> {
if($form){
$form.removeClass('disabled');
$form=null;
}})
}
jQuery('[name="variation_id"]:first').parents('form:first')
.on('show_variation', (evt, variation)=> {
$form=jQuery(evt.currentTarget);
$customizeButton.css('display', 'inline-block');
if(!fpdWcLoadAjaxProduct&&variation.fpd_variation_product_id){
var fpdProductID=variation.fpd_variation_product_id;
if(typeof fpdProductCreated!=='undefined'&&fpdProductCreated){
fpdWcLoadAjaxProduct=true;
$form.addClass('disabled');
fancyProductDesigner.toggleSpinner(true, fpd_woo_configs.labels.loading_product);
var data={
action: 'fpd_load_product',
product_id: fpdProductID
};
jQuery.post(fpd_setup_configs.admin_ajax_url,
data,
(response)=> {
if(typeof response==='object'){
if(response.length==0){
alert('The product does not exists or has no views!');
fancyProductDesigner.toggleSpinner(false);
return;
}
fancyProductDesigner.loadProduct(response,
fpd_woo_configs.options.replace_initial_elements,
true
);
}else{
FPDSnackbar(fpd_woo_configs.labels.product_loading_fail);
}
fpdWcLoadAjaxProduct=false;
}, 'json');
}else{
$customizeButton.attr('href', (_, href)=> {
return href.search('fpd_product')===-1 ? href+'&fpd_product='+fpdProductID:href.replace(/fpd_product=\d+/gi, 'fpd_product='+fpdProductID);
});
}}
})
.on('reset_data', ()=> {
if($productWrapper.hasClass('fpd-variation-needed')){
$customizeButton.hide();
}});
});
window.yasrTrueFalseStringConvertion=function(e){return null!=e&&""!==e||(e=!1),"true"!==e&&"1"!==e||(e=!0),"false"!==e&&"0"!==e||(e=!1),e},window.yasrValidJson=function(e){try{const t=JSON.parse(e);if(t&&"object"==typeof t)return t}catch(e){console.error("Not a valid Json Element"),console.log(e)}return!1},window.yasrSetRaterValue=function(e,t,r=!1,i=.1,a=!0,n=!1,o=!1){let s;s=r||document.getElementById(t),e=parseInt(e),raterJs({starSize:e,showToolTip:!1,element:s,step:i,readOnly:a,rating:n,rateCallback:o})},window.raterJs=function(e){let t=!0;if(void 0===e.element||null===e.element)return void console.info("missing rating element");if(null!==e.element&&e.element.classList.contains("yasr-star-rating"))return;if(void 0!==e.showToolTip&&(t=!!e.showToolTip),void 0!==e.step&&(e.step<=0||e.step>1))throw new Error("step must be a number between 0 and 1");let r,i,a=5,n=e.starSize||16,o=e.step||1,s=e.onHover,l=e.onLeave,u=yasrTrueFalseStringConvertion(yasrWindowVar.isRtl),d=e.element;d.classList.add("yasr-star-rating");let c=document.createElement("div");c.classList.add("yasr-star-value"),c.style.backgroundSize=n+"px",d.appendChild(c),d.style.width=n*a+"px",d.style.height=n+"px",d.style.backgroundSize=n+"px";let f,v,y,m=e.rateCallback,g=!!e.readOnly,p=!1,b=e.isBusyText;if(f=void 0!==e.disableText?e.disableText:"{rating}/{maxRating}",g||(d.style.cursor="pointer"),y=void 0!==e.ratingText?e.ratingText:"{rating}/{maxRating}",e.rating)E(e.rating);else{var w=d.dataset.rating;w&&E(+w)}function h(e){if(!0===g||!0===p)return;let i;if(!0===u){let t=this.getBoundingClientRect(),r=e.pageX-t.left,a=d.offsetWidth;i=(a-r)/(a/100)}else i=e.offsetX/d.offsetWidth*100;if(i<101){if(1===o)v=Math.ceil(i/100*a);else{let e=i/100*a;for(let t=0;;t+=o)if(t>=e){v=t;break}}if(v>5&&(v=5),d.querySelector(".yasr-star-value").style.width=v/a*100+"%",t){let e=y.replace("{rating}",v);e=e.replace("{maxRating}",a),d.setAttribute("data-title",e)}"function"==typeof s&&s(v,r)}}function x(e){void 0!==r?(d.querySelector(".yasr-star-value").style.width=r/a*100+"%",d.setAttribute("data-rating",r)):(d.querySelector(".yasr-star-value").style.width="0%",d.removeAttribute("data-rating")),"function"==typeof l&&l(v,r)}function S(e){!0!==g&&!0!==p&&(void 0===m&&!1===typeof m||(p=!0,i=v,void 0===b?d.removeAttribute("data-title"):d.setAttribute("data-title",b),m.call(this,i,(function(){!1===g&&d.removeAttribute("data-title"),p=!1}))))}function T(){if(g=!0,t&&f){let e=f.replace("{rating}",r);e=e.replace("{maxRating}",a),d.setAttribute("data-title",e)}else d.removeAttribute("data-title")}function E(e){if(-1===e&&(e=void 0),"number"!=typeof e&&void 0!==e)throw new Error("Value must be a number or undefined.");e<0&&(e=0),e>5&&(e=5),r=e,d.querySelector(".yasr-star-value").style.width=e/a*100+"%",d.setAttribute("data-rating",e)}void 0===r&&(d.querySelector(".yasr-star-value").style.width="0px"),g&&T(),d.addEventListener("mousemove",h),d.addEventListener("mouseleave",x);let A={setRating:E,getRating:function(){return r},disable:T,enable:function(){g=!1,d.removeAttribute("data-title")},dispose:function(){d.removeEventListener("mousemove",h),d.removeEventListener("mouseleave",x),d.removeEventListener("click",S)}};return d.addEventListener("click",S.bind(A)),A};
(function(e,t){'object'==typeof exports&&'undefined'!=typeof module?module.exports=t():'function'==typeof define&&define.amd?define(t):e.tippy=t()})(this,function(){'use strict';function e(e){return e&&'[object Function]'==={}.toString.call(e)}function t(e,t){if(1!==e.nodeType)return[];var r=e.ownerDocument.defaultView,a=r.getComputedStyle(e,null);return t?a[t]:a}function r(e){return'HTML'===e.nodeName?e:e.parentNode||e.host}function a(e){if(!e)return document.body;switch(e.nodeName){case'HTML':case'BODY':return e.ownerDocument.body;case'#document':return e.body;}var p=t(e),o=p.overflow,i=p.overflowX,n=p.overflowY;return /(auto|scroll|overlay)/.test(o+n+i)?e:a(r(e))}function p(e){return 11===e?ht:10===e?bt:ht||bt}function o(e){if(!e)return document.documentElement;for(var r=p(10)?document.body:null,a=e.offsetParent||null;a===r&&e.nextElementSibling;)a=(e=e.nextElementSibling).offsetParent;var i=a&&a.nodeName;return i&&'BODY'!==i&&'HTML'!==i?-1!==['TH','TD','TABLE'].indexOf(a.nodeName)&&'static'===t(a,'position')?o(a):a:e?e.ownerDocument.documentElement:document.documentElement}function n(e){var t=e.nodeName;return'BODY'!==t&&('HTML'===t||o(e.firstElementChild)===e)}function s(e){return null===e.parentNode?e:s(e.parentNode)}function l(e,t){if(!e||!e.nodeType||!t||!t.nodeType)return document.documentElement;var r=e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING,a=r?e:t,p=r?t:e,i=document.createRange();i.setStart(a,0),i.setEnd(p,0);var d=i.commonAncestorContainer;if(e!==d&&t!==d||a.contains(p))return n(d)?d:o(d);var c=s(e);return c.host?l(c.host,t):l(e,s(t).host)}function d(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:'top',r='top'===t?'scrollTop':'scrollLeft',a=e.nodeName;if('BODY'===a||'HTML'===a){var p=e.ownerDocument.documentElement,o=e.ownerDocument.scrollingElement||p;return o[r]}return e[r]}function c(e,t){var r=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],a=d(t,'top'),p=d(t,'left'),o=r?-1:1;return e.top+=a*o,e.bottom+=a*o,e.left+=p*o,e.right+=p*o,e}function m(e,t){var r='x'===t?'Left':'Top',a='Left'===r?'Right':'Bottom';return parseFloat(e['border'+r+'Width'],10)+parseFloat(e['border'+a+'Width'],10)}function f(e,t,r,a){return Je(t['offset'+e],t['scroll'+e],r['client'+e],r['offset'+e],r['scroll'+e],p(10)?parseInt(r['offset'+e])+parseInt(a['margin'+('Height'===e?'Top':'Left')])+parseInt(a['margin'+('Height'===e?'Bottom':'Right')]):0)}function h(e){var t=e.body,r=e.documentElement,a=p(10)&&getComputedStyle(r);return{height:f('Height',t,r,a),width:f('Width',t,r,a)}}function b(e){return xt({},e,{right:e.left+e.width,bottom:e.top+e.height})}function u(e){var r={};try{if(p(10)){r=e.getBoundingClientRect();var a=d(e,'top'),o=d(e,'left');r.top+=a,r.left+=o,r.bottom+=a,r.right+=o}else r=e.getBoundingClientRect()}catch(t){}var i={left:r.left,top:r.top,width:r.right-r.left,height:r.bottom-r.top},n='HTML'===e.nodeName?h(e.ownerDocument):{},s=n.width||e.clientWidth||i.right-i.left,l=n.height||e.clientHeight||i.bottom-i.top,c=e.offsetWidth-s,f=e.offsetHeight-l;if(c||f){var y=t(e);c-=m(y,'x'),f-=m(y,'y'),i.width-=c,i.height-=f}return b(i)}function y(e,r){var o=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],i=p(10),n='HTML'===r.nodeName,s=u(e),l=u(r),d=a(e),m=t(r),f=parseFloat(m.borderTopWidth,10),h=parseFloat(m.borderLeftWidth,10);o&&n&&(l.top=Je(l.top,0),l.left=Je(l.left,0));var y=b({top:s.top-l.top-f,left:s.left-l.left-h,width:s.width,height:s.height});if(y.marginTop=0,y.marginLeft=0,!i&&n){var g=parseFloat(m.marginTop,10),x=parseFloat(m.marginLeft,10);y.top-=f-g,y.bottom-=f-g,y.left-=h-x,y.right-=h-x,y.marginTop=g,y.marginLeft=x}return(i&&!o?r.contains(d):r===d&&'BODY'!==d.nodeName)&&(y=c(y,r)),y}function g(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],r=e.ownerDocument.documentElement,a=y(e,r),p=Je(r.clientWidth,window.innerWidth||0),o=Je(r.clientHeight,window.innerHeight||0),i=t?0:d(r),n=t?0:d(r,'left'),s={top:i-a.top+a.marginTop,left:n-a.left+a.marginLeft,width:p,height:o};return b(s)}function x(e){var a=e.nodeName;return'BODY'!==a&&'HTML'!==a&&('fixed'===t(e,'position')||x(r(e)))}function w(e){if(!e||!e.parentElement||p())return document.documentElement;for(var r=e.parentElement;r&&'none'===t(r,'transform');)r=r.parentElement;return r||document.documentElement}function v(e,t,p,o){var i=!!(4<arguments.length&&void 0!==arguments[4])&&arguments[4],n={top:0,left:0},s=i?w(e):l(e,t);if('viewport'===o)n=g(s,i);else{var d;'scrollParent'===o?(d=a(r(t)),'BODY'===d.nodeName&&(d=e.ownerDocument.documentElement)):'window'===o?d=e.ownerDocument.documentElement:d=o;var c=y(d,s,i);if('HTML'===d.nodeName&&!x(s)){var m=h(e.ownerDocument),f=m.height,b=m.width;n.top+=c.top-c.marginTop,n.bottom=f+c.top,n.left+=c.left-c.marginLeft,n.right=b+c.left}else n=c}p=p||0;var u='number'==typeof p;return n.left+=u?p:p.left||0,n.top+=u?p:p.top||0,n.right-=u?p:p.right||0,n.bottom-=u?p:p.bottom||0,n}function k(e){var t=e.width,r=e.height;return t*r}function E(e,t,r,a,p){var o=5<arguments.length&&void 0!==arguments[5]?arguments[5]:0;if(-1===e.indexOf('auto'))return e;var i=v(r,a,o,p),n={top:{width:i.width,height:t.top-i.top},right:{width:i.right-t.right,height:i.height},bottom:{width:i.width,height:i.bottom-t.bottom},left:{width:t.left-i.left,height:i.height}},s=Object.keys(n).map(function(e){return xt({key:e},n[e],{area:k(n[e])})}).sort(function(e,t){return t.area-e.area}),l=s.filter(function(e){var t=e.width,a=e.height;return t>=r.clientWidth&&a>=r.clientHeight}),d=0<l.length?l[0].key:s[0].key,c=e.split('-')[1];return d+(c?'-'+c:'')}function O(e,t,r){var a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null,p=a?w(t):l(t,r);return y(r,p,a)}function C(e){var t=e.ownerDocument.defaultView,r=t.getComputedStyle(e),a=parseFloat(r.marginTop||0)+parseFloat(r.marginBottom||0),p=parseFloat(r.marginLeft||0)+parseFloat(r.marginRight||0),o={width:e.offsetWidth+p,height:e.offsetHeight+a};return o}function L(e){var t={left:'right',right:'left',bottom:'top',top:'bottom'};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function T(e,t,r){r=r.split('-')[0];var a=C(e),p={width:a.width,height:a.height},o=-1!==['right','left'].indexOf(r),i=o?'top':'left',n=o?'left':'top',s=o?'height':'width',l=o?'width':'height';return p[i]=t[i]+t[s]/2-a[s]/2,p[n]=r===n?t[n]-a[l]:t[L(n)],p}function S(e,t){return Array.prototype.find?e.find(t):e.filter(t)[0]}function A(e,t,r){if(Array.prototype.findIndex)return e.findIndex(function(e){return e[t]===r});var a=S(e,function(e){return e[t]===r});return e.indexOf(a)}function Y(t,r,a){var p=void 0===a?t:t.slice(0,A(t,'name',a));return p.forEach(function(t){t['function']&&console.warn('`modifier.function` is deprecated, use `modifier.fn`!');var a=t['function']||t.fn;t.enabled&&e(a)&&(r.offsets.popper=b(r.offsets.popper),r.offsets.reference=b(r.offsets.reference),r=a(r,t))}),r}function P(){if(!this.state.isDestroyed){var e={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};e.offsets.reference=O(this.state,this.popper,this.reference,this.options.positionFixed),e.placement=E(this.options.placement,e.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),e.originalPlacement=e.placement,e.positionFixed=this.options.positionFixed,e.offsets.popper=T(this.popper,e.offsets.reference,e.placement),e.offsets.popper.position=this.options.positionFixed?'fixed':'absolute',e=Y(this.modifiers,e),this.state.isCreated?this.options.onUpdate(e):(this.state.isCreated=!0,this.options.onCreate(e))}}function D(e,t){return e.some(function(e){var r=e.name,a=e.enabled;return a&&r===t})}function X(e){for(var t=[!1,'ms','Webkit','Moz','O'],r=e.charAt(0).toUpperCase()+e.slice(1),a=0;a<t.length;a++){var p=t[a],o=p?''+p+r:e;if('undefined'!=typeof document.body.style[o])return o}return null}function I(){return this.state.isDestroyed=!0,D(this.modifiers,'applyStyle')&&(this.popper.removeAttribute('x-placement'),this.popper.style.position='',this.popper.style.top='',this.popper.style.left='',this.popper.style.right='',this.popper.style.bottom='',this.popper.style.willChange='',this.popper.style[X('transform')]=''),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function N(e){var t=e.ownerDocument;return t?t.defaultView:window}function H(e,t,r,p){var o='BODY'===e.nodeName,i=o?e.ownerDocument.defaultView:e;i.addEventListener(t,r,{passive:!0}),o||H(a(i.parentNode),t,r,p),p.push(i)}function W(e,t,r,p){r.updateBound=p,N(e).addEventListener('resize',r.updateBound,{passive:!0});var o=a(e);return H(o,'scroll',r.updateBound,r.scrollParents),r.scrollElement=o,r.eventsEnabled=!0,r}function B(){this.state.eventsEnabled||(this.state=W(this.reference,this.options,this.state,this.scheduleUpdate))}function M(e,t){return N(e).removeEventListener('resize',t.updateBound),t.scrollParents.forEach(function(e){e.removeEventListener('scroll',t.updateBound)}),t.updateBound=null,t.scrollParents=[],t.scrollElement=null,t.eventsEnabled=!1,t}function R(){this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=M(this.reference,this.state))}function z(e){return''!==e&&!isNaN(parseFloat(e))&&isFinite(e)}function F(e,t){Object.keys(t).forEach(function(r){var a='';-1!==['width','height','top','right','bottom','left'].indexOf(r)&&z(t[r])&&(a='px'),e.style[r]=t[r]+a})}function _(e,t){Object.keys(t).forEach(function(r){var a=t[r];!1===a?e.removeAttribute(r):e.setAttribute(r,t[r])})}function U(e,t){var r=e.offsets,a=r.popper,p=r.reference,o=Qe,i=function(e){return e},n=o(a.width),s=o(p.width),l=-1!==['left','right'].indexOf(e.placement),d=-1!==e.placement.indexOf('-'),c=t?l||d||s%2==n%2?o:Ge:i,m=t?o:i;return{left:c(1==s%2&&1==n%2&&!d&&t?a.left-1:a.left),top:m(a.top),bottom:m(a.bottom),right:c(a.right)}}function V(e,t,r){var a=S(e,function(e){var r=e.name;return r===t}),p=!!a&&e.some(function(e){return e.name===r&&e.enabled&&e.order<a.order});if(!p){var o='`'+t+'`';console.warn('`'+r+'`'+' modifier is required by '+o+' modifier in order to work, be sure to include it before '+o+'!')}return p}function q(e){return'end'===e?'start':'start'===e?'end':e}function j(e){var t=!!(1<arguments.length&&void 0!==arguments[1])&&arguments[1],r=kt.indexOf(e),a=kt.slice(r+1).concat(kt.slice(0,r));return t?a.reverse():a}function K(e,t,r,a){var p=e.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+p[1],i=p[2];if(!o)return e;if(0===i.indexOf('%')){var n;switch(i){case'%p':n=r;break;case'%':case'%r':default:n=a;}var s=b(n);return s[t]/100*o}if('vh'===i||'vw'===i){var l;return l='vh'===i?Je(document.documentElement.clientHeight,window.innerHeight||0):Je(document.documentElement.clientWidth,window.innerWidth||0),l/100*o}return o}function G(e,t,r,a){var p=[0,0],o=-1!==['right','left'].indexOf(a),i=e.split(/(\+|\-)/).map(function(e){return e.trim()}),n=i.indexOf(S(i,function(e){return-1!==e.search(/,|\s/)}));i[n]&&-1===i[n].indexOf(',')&&console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');var s=/\s*,\s*|\s+/,l=-1===n?[i]:[i.slice(0,n).concat([i[n].split(s)[0]]),[i[n].split(s)[1]].concat(i.slice(n+1))];return l=l.map(function(e,a){var p=(1===a?!o:o)?'height':'width',i=!1;return e.reduce(function(e,t){return''===e[e.length-1]&&-1!==['+','-'].indexOf(t)?(e[e.length-1]=t,i=!0,e):i?(e[e.length-1]+=t,i=!1,e):e.concat(t)},[]).map(function(e){return K(e,p,t,r)})}),l.forEach(function(e,t){e.forEach(function(r,a){z(r)&&(p[t]+=r*('-'===e[a-1]?-1:1))})}),p}function Q(e,t){var r=t.offset,a=e.placement,p=e.offsets,o=p.popper,i=p.reference,n=a.split('-')[0],s=void 0;return s=z(+r)?[+r,0]:G(r,o,i,n),'left'===n?(o.top+=s[0],o.left-=s[1]):'right'===n?(o.top+=s[0],o.left+=s[1]):'top'===n?(o.left+=s[0],o.top-=s[1]):'bottom'===n&&(o.left+=s[0],o.top+=s[1]),e.popper=o,e}function J(e){return[].slice.call(e)}function Z(e,t){return(Lt.closest||function(e){for(var t=this;t;){if(Tt.call(t,e))return t;t=t.parentElement}}).call(e,t)}function $(e,t){for(;e;){if(t(e))return e;e=e.parentElement}}function ee(){return document.createElement('div')}function te(e,t){e[St.x&&'innerHTML']=t instanceof Element?t[St.x&&'innerHTML']:t}function re(e,t){t.content instanceof Element?(te(e,''),e.appendChild(t.content)):e[t.allowHTML?'innerHTML':'textContent']=t.content}function ae(e){return{tooltip:e.querySelector(Ct.TOOLTIP),backdrop:e.querySelector(Ct.BACKDROP),content:e.querySelector(Ct.CONTENT),arrow:e.querySelector(Ct.ARROW)||e.querySelector(Ct.ROUND_ARROW)}}function pe(e){e.setAttribute('data-inertia','')}function oe(e){e.removeAttribute('data-inertia')}function ie(e){var t=ee();return'round'===e?(t.className='tippy-roundarrow',te(t,'<svg viewBox="0 0 24 8" xmlns="http://www.w3.org/2000/svg"><path d="M3 8s2.021-.015 5.253-4.218C9.584 2.051 10.797 1.007 12 1c1.203-.007 2.416 1.035 3.761 2.782C19.012 8.005 21 8 21 8H3z"/></svg>')):t.className='tippy-arrow',t}function ne(){var e=ee();return e.className='tippy-backdrop',e.setAttribute('data-state','hidden'),e}function se(e,t){e.setAttribute('tabindex','-1'),t.setAttribute('data-interactive','')}function le(e,t){e.removeAttribute('tabindex'),t.removeAttribute('data-interactive')}function de(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+'ms')})}function ce(e,t,r){e[t+'EventListener']('transitionend',r)}function me(e){var t=e.getAttribute('x-placement');return t?t.split('-')[0]:''}function fe(e,t){e.forEach(function(e){e&&e.setAttribute('data-state',t)})}function he(e){void e.offsetHeight}function be(e,t){var r=ee();r.className='tippy-popper',r.setAttribute('role','tooltip'),r.id='tippy-'+e,r.style.zIndex=t.zIndex;var a=ee();a.className='tippy-tooltip',a.style.maxWidth=t.maxWidth+('number'==typeof t.maxWidth?'px':''),a.setAttribute('data-size',t.size),a.setAttribute('data-animation',t.animation),a.setAttribute('data-state','hidden'),t.theme.split(' ').forEach(function(e){a.classList.add(e+'-theme')});var p=ee();return p.className='tippy-content',p.setAttribute('data-state','hidden'),t.interactive&&se(r,a),t.arrow&&a.appendChild(ie(t.arrowType)),t.animateFill&&(a.appendChild(ne()),a.setAttribute('data-animatefill','')),t.inertia&&pe(a),re(p,t),a.appendChild(p),r.appendChild(a),r.addEventListener('focusout',function(t){t.relatedTarget&&r._tippy&&!$(t.relatedTarget,function(e){return e===r})&&t.relatedTarget!==r._tippy.reference&&r._tippy.props.shouldPopperHideOnBlur(t)&&r._tippy.hide()}),r}function ye(e,t,r){var a=ae(e),p=a.tooltip,o=a.content,i=a.backdrop,n=a.arrow;e.style.zIndex=r.zIndex,p.setAttribute('data-size',r.size),p.setAttribute('data-animation',r.animation),p.style.maxWidth=r.maxWidth+('number'==typeof r.maxWidth?'px':''),t.content!==r.content&&re(o,r),!t.animateFill&&r.animateFill?(p.appendChild(ne()),p.setAttribute('data-animatefill','')):t.animateFill&&!r.animateFill&&(p.removeChild(i),p.removeAttribute('data-animatefill')),!t.arrow&&r.arrow?p.appendChild(ie(r.arrowType)):t.arrow&&!r.arrow&&p.removeChild(n),t.arrow&&r.arrow&&t.arrowType!==r.arrowType&&p.replaceChild(ie(r.arrowType),n),!t.interactive&&r.interactive?se(e,p):t.interactive&&!r.interactive&&le(e,p),!t.inertia&&r.inertia?pe(p):t.inertia&&!r.inertia&&oe(p),t.theme!==r.theme&&(t.theme.split(' ').forEach(function(e){p.classList.remove(e+'-theme')}),r.theme.split(' ').forEach(function(e){p.classList.add(e+'-theme')}))}function ue(e,t){var r=e.popper,a=e.options,p=a.onCreate,o=a.onUpdate;a.onCreate=a.onUpdate=function(){he(r),t(),o(),a.onCreate=p,a.onUpdate=o}}function ge(e){J(document.querySelectorAll(Ct.POPPER)).forEach(function(t){var r=t._tippy;r&&!0===r.props.hideOnClick&&(!e||t!==e.popper)&&r.hide()})}function xe(e,t,r,a){if(!e)return!0;var p=r.clientX,o=r.clientY,i=a.interactiveBorder,n=a.distance,s=t.top-o>('top'===e?i+n:i),l=o-t.bottom>('bottom'===e?i+n:i),d=t.left-p>('left'===e?i+n:i),c=p-t.right>('right'===e?i+n:i);return s||l||d||c}function we(e,t){return-(e-t)+'px'}function ve(){At||(At=!0,ot&&document.body.classList.add('tippy-iOS'),window.performance&&document.addEventListener('mousemove',ke))}function ke(){var e=performance.now();20>e-Yt&&(At=!1,document.removeEventListener('mousemove',ke),!ot&&document.body.classList.remove('tippy-iOS')),Yt=e}function Ee(e){var t=e.target;if(!(t instanceof Element))return ge();var r=Z(t,Ct.POPPER);if(!(r&&r._tippy&&r._tippy.props.interactive)){var a=$(t,function(e){return e._tippy&&e._tippy.reference===e});if(a){var p=a._tippy,o=-1<p.props.trigger.indexOf('click');if(At||o)return ge(p);if(!0!==p.props.hideOnClick||o)return;p.clearDelayTimeouts()}ge()}}function Oe(){var e=document,t=e.activeElement;t&&t.blur&&t._tippy&&t.blur()}function Ce(){J(document.querySelectorAll(Ct.POPPER)).forEach(function(e){var t=e._tippy;t.props.livePlacement||t.popperInstance.scheduleUpdate()})}function Le(){document.addEventListener('click',Ee,!0),document.addEventListener('touchstart',ve,{passive:!0}),window.addEventListener('blur',Oe),window.addEventListener('resize',Ce),!it&&(navigator.maxTouchPoints||navigator.msMaxTouchPoints)&&document.addEventListener('pointerdown',ve)}function Te(e){return'[object Object]'==={}.toString.call(e)}function Se(e,t){return{}.hasOwnProperty.call(e,t)}function Ae(e){return!isNaN(e)&&!isNaN(parseFloat(e))}function Ye(e){if(e instanceof Element||Te(e))return[e];if(e instanceof NodeList)return J(e);if(Array.isArray(e))return e;try{return J(document.querySelectorAll(e))}catch(t){return[]}}function Pe(e,t,r){if(Array.isArray(e)){var a=e[t];return null==a?r:a}return e}function De(e){var t=window.scrollX||window.pageXOffset,r=window.scrollY||window.pageYOffset;e.focus(),scroll(t,r)}function Xe(e){setTimeout(e,1)}function Ie(e,t){var r;return function(){var a=this,p=arguments;clearTimeout(r),r=setTimeout(function(){return e.apply(a,p)},t)}}function Ne(e,t){return e&&e.modifiers&&e.modifiers[t]}function He(e){return!(e instanceof Element)||Tt.call(e,'a[href],area[href],button,details,input,textarea,select,iframe,[tabindex]')&&!e.hasAttribute('disabled')}function We(e){return Pt.reduce(function(t,r){var a=(e.getAttribute('data-tippy-'+r)||'').trim();return a?(t[r]='content'===r?a:'true'===a||'false'!==a&&(Ae(a)?+a:'['===a[0]||'{'===a[0]?JSON.parse(a):a),t):t},{})}function Be(e){var t={isVirtual:!0,attributes:e.attributes||{},setAttribute:function(t,r){e.attributes[t]=r},getAttribute:function(t){return e.attributes[t]},removeAttribute:function(t){delete e.attributes[t]},hasAttribute:function(t){return t in e.attributes},addEventListener:function(){},removeEventListener:function(){},classList:{classNames:{},add:function(t){e.classList.classNames[t]=!0},remove:function(t){delete e.classList.classNames[t]},contains:function(t){return t in e.classList.classNames}}};for(var r in t)e[r]=t[r]}function Me(e,t){var r=Dt({},t,t.performance?{}:We(e));return r.arrow&&(r.animateFill=!1),'function'==typeof r.appendTo&&(r.appendTo=t.appendTo(e)),'function'==typeof r.content&&(r.content=t.content(e)),r}function Re(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];Object.keys(e).forEach(function(e){if(!Se(t,e))throw new Error('[tippy]: `'+e+'` is not a valid option')})}function ze(e,t){return(t?e:{X:'Y',Y:'X'}[e])||''}function Fe(e,t,r,p){var o=t[0],i=t[1];if(!o&&!i)return'';var n={scale:function(){return i?r?o+', '+i:i+', '+o:''+o}(),translate:function(){return i?r?p?o+'px, '+-i+'px':o+'px, '+i+'px':p?-i+'px, '+o+'px':i+'px, '+o+'px':p?-o+'px':o+'px'}()};return n[e]}function _e(e,t){var r=e.match(new RegExp(t+'([XY])'));return r?r[1]:''}function Ue(e,t){var r=e.match(t);return r?r[1].split(',').map(function(e){return parseFloat(e,10)}):[]}function Ve(e,t){var r=me(Z(e,Ct.POPPER)),a='top'===r||'bottom'===r,p='right'===r||'bottom'===r,o={translate:{axis:_e(t,'translate'),numbers:Ue(t,Xt.translate)},scale:{axis:_e(t,'scale'),numbers:Ue(t,Xt.scale)}},i=t.replace(Xt.translate,'translate'+ze(o.translate.axis,a)+'('+Fe('translate',o.translate.numbers,a,p)+')').replace(Xt.scale,'scale'+ze(o.scale.axis,a)+'('+Fe('scale',o.scale.numbers,a,p)+')');e.style['undefined'==typeof document.body.style.transform?'webkitTransform':'transform']=i}function qe(e,t){function r(){Xe(function(){z=!1})}function a(){X=new MutationObserver(function(){q.popperInstance.update()}),X.observe(U,{childList:!0,subtree:!0,characterData:!0})}function p(e){var t=N=e,r=t.clientX,a=t.clientY;if(q.popperInstance){var p=me(q.popper),o=q.popperChildren.arrow?20:5,i='top'===p||'bottom'===p,n='left'===p||'right'===p,l=i?Je(o,r):r,d=n?Je(o,a):a;i&&l>o&&(l=Ke(r,window.innerWidth-o)),n&&d>o&&(d=Ke(a,window.innerHeight-o));var c=q.reference.getBoundingClientRect(),m=q.props.followCursor,f='horizontal'===m,h='vertical'===m;q.popperInstance.reference={getBoundingClientRect:function(){return{width:0,height:0,top:f?c.top:d,bottom:f?c.bottom:d,left:h?c.left:l,right:h?c.right:l}},clientWidth:0,clientHeight:0},q.popperInstance.scheduleUpdate(),'initial'===m&&q.state.isVisible&&s()}}function o(e){var t=Z(e.target,q.props.target);t&&!t._tippy&&(qe(t,Dt({},q.props,{target:'',showOnInit:!0})),i(e))}function i(e){if(T(),!q.state.isVisible){if(q.props.target)return o(e);if(B=!0,q.props.wait)return q.props.wait(q,e);x()&&document.addEventListener('mousemove',p);var t=Pe(q.props.delay,0,nt.delay);t?H=setTimeout(function(){A()},t):A()}}function n(){if(T(),!q.state.isVisible)return s();B=!1;var e=Pe(q.props.delay,1,nt.delay);e?W=setTimeout(function(){q.state.isVisible&&Y()},e):Y()}function s(){document.removeEventListener('mousemove',p),N=null}function l(){document.body.removeEventListener('mouseleave',n),document.removeEventListener('mousemove',F)}function d(e){!q.state.isEnabled||y(e)||(!q.state.isVisible&&(I=e),'click'===e.type&&!1!==q.props.hideOnClick&&q.state.isVisible?n():i(e))}function c(e){var t=$(e.target,function(e){return e._tippy}),r=Z(e.target,Ct.POPPER)===q.popper,a=t===q.reference;r||a||xe(me(q.popper),q.popper.getBoundingClientRect(),e,q.props)&&(l(),n())}function m(e){return y(e)?void 0:q.props.interactive?(document.body.addEventListener('mouseleave',n),void document.addEventListener('mousemove',F)):void n()}function f(e){if(e.target===q.reference){if(q.props.interactive){if(!e.relatedTarget)return;if(Z(e.relatedTarget,Ct.POPPER))return}n()}}function h(e){Z(e.target,q.props.target)&&i(e)}function b(e){Z(e.target,q.props.target)&&n()}function y(e){var t=-1<e.type.indexOf('touch'),r=it&&At&&q.props.touchHold&&!t,a=At&&!q.props.touchHold&&t;return r||a}function u(){var e=q.props.popperOptions,t=q.popperChildren,r=t.tooltip,a=t.arrow;return new Ot(q.reference,q.popper,Dt({placement:q.props.placement},e,{modifiers:Dt({},e?e.modifiers:{},{preventOverflow:Dt({boundariesElement:q.props.boundary},Ne(e,'preventOverflow')),arrow:Dt({element:a,enabled:!!a},Ne(e,'arrow')),flip:Dt({enabled:q.props.flip,padding:q.props.distance+5,behavior:q.props.flipBehavior},Ne(e,'flip')),offset:Dt({offset:q.props.offset},Ne(e,'offset'))}),onCreate:function(){r.style[me(q.popper)]=we(q.props.distance,nt.distance),a&&q.props.arrowTransform&&Ve(a,q.props.arrowTransform)},onUpdate:function(){var e=r.style;e.top='',e.bottom='',e.left='',e.right='',e[me(q.popper)]=we(q.props.distance,nt.distance),a&&q.props.arrowTransform&&Ve(a,q.props.arrowTransform)}}))}function g(e){q.popperInstance?!x()&&(q.popperInstance.scheduleUpdate(),q.props.livePlacement&&q.popperInstance.enableEventListeners()):(q.popperInstance=u(),a(),(!q.props.livePlacement||x())&&q.popperInstance.disableEventListeners()),q.popperInstance.reference=q.reference;var t=q.popperChildren.arrow;if(x()){t&&(t.style.margin='0');var r=Pe(q.props.delay,0,nt.delay);I.type&&p(r&&N?N:I)}else t&&(t.style.margin='');ue(q.popperInstance,e),q.props.appendTo.contains(q.popper)||(q.props.appendTo.appendChild(q.popper),q.props.onMount(q),q.state.isMounted=!0)}function x(){return q.props.followCursor&&!At&&'focus'!==I.type}function w(){de([q.popper],pt?0:q.props.updateDuration);(function e(){q.popperInstance&&q.popperInstance.scheduleUpdate(),q.state.isMounted?requestAnimationFrame(e):de([q.popper],0)})()}function v(e,t){E(e,function(){!q.state.isVisible&&q.props.appendTo.contains(q.popper)&&t()})}function k(e,t){E(e,t)}function E(e,t){if(0===e)return t();var r=q.popperChildren.tooltip,a=function a(p){p.target===r&&(ce(r,'remove',a),t())};ce(r,'remove',M),ce(r,'add',a),M=a}function O(e,t,r){q.reference.addEventListener(e,t),r.push({eventType:e,handler:t})}function C(){R=q.props.trigger.trim().split(' ').reduce(function(e,t){return'manual'===t?e:(q.props.target?'mouseenter'===t?(O('mouseover',h,e),O('mouseout',b,e)):'focus'===t?(O('focusin',h,e),O('focusout',b,e)):'click'===t?O(t,h,e):void 0:(O(t,d,e),q.props.touchHold&&(O('touchstart',d,e),O('touchend',m,e)),'mouseenter'===t?O('mouseleave',m,e):'focus'===t?O(pt?'focusout':'blur',f,e):void 0),e)},[])}function L(){R.forEach(function(e){var t=e.eventType,r=e.handler;q.reference.removeEventListener(t,r)})}function T(){clearTimeout(H),clearTimeout(W)}function S(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};Re(e,nt);var t=q.props,r=Me(q.reference,Dt({},q.props,e,{performance:!0}));r.performance=Se(e,'performance')?e.performance:t.performance,q.props=r,(Se(e,'trigger')||Se(e,'touchHold'))&&(L(),C()),Se(e,'interactiveDebounce')&&(l(),F=Ie(c,e.interactiveDebounce)),ye(q.popper,t,r),q.popperChildren=ae(q.popper),q.popperInstance&&st.some(function(t){return Se(e,t)})&&(q.popperInstance.destroy(),q.popperInstance=u(),!q.state.isVisible&&q.popperInstance.disableEventListeners(),q.props.followCursor&&N&&p(N))}function A(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Pe(q.props.duration,0,nt.duration[0]);return q.state.isDestroyed||!q.state.isEnabled||At&&!q.props.touch?void 0:q.reference.isVirtual||document.documentElement.contains(q.reference)?q.reference.hasAttribute('disabled')?void 0:z?void(z=!1):void(!1===q.props.onShow(q)||(q.popper.style.visibility='visible',q.state.isVisible=!0,de([q.popper,q.popperChildren.tooltip,q.popperChildren.backdrop],0),g(function(){q.state.isVisible&&(!x()&&q.popperInstance.update(),de([q.popperChildren.tooltip,q.popperChildren.backdrop,q.popperChildren.content],e),q.popperChildren.backdrop&&(q.popperChildren.content.style.transitionDelay=Qe(e/6)+'ms'),q.props.interactive&&q.reference.classList.add('tippy-active'),q.props.sticky&&w(),fe([q.popperChildren.tooltip,q.popperChildren.backdrop,q.popperChildren.content],'visible'),k(e,function(){0===q.props.updateDuration&&q.popperChildren.tooltip.classList.add('tippy-notransition'),q.props.autoFocus&&q.props.interactive&&-1<['focus','click'].indexOf(I.type)&&De(q.popper),q.reference.setAttribute('aria-'+q.props.aria,q.popper.id),q.props.onShown(q),q.state.isShown=!0}))}))):P()}function Y(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Pe(q.props.duration,1,nt.duration[1]);q.state.isDestroyed||!q.state.isEnabled||!1===q.props.onHide(q)||(0===q.props.updateDuration&&q.popperChildren.tooltip.classList.remove('tippy-notransition'),q.props.interactive&&q.reference.classList.remove('tippy-active'),q.popper.style.visibility='hidden',q.state.isVisible=!1,q.state.isShown=!1,de([q.popperChildren.tooltip,q.popperChildren.backdrop,q.popperChildren.content],e),fe([q.popperChildren.tooltip,q.popperChildren.backdrop,q.popperChildren.content],'hidden'),q.props.autoFocus&&q.props.interactive&&!z&&-1<['focus','click'].indexOf(I.type)&&('focus'===I.type&&(z=!0),De(q.reference)),v(e,function(){B||s(),q.reference.removeAttribute('aria-'+q.props.aria),q.popperInstance.disableEventListeners(),q.props.appendTo.removeChild(q.popper),q.state.isMounted=!1,q.props.onHidden(q)}))}function P(e){q.state.isDestroyed||(q.state.isMounted&&Y(0),L(),q.reference.removeEventListener('click',r),delete q.reference._tippy,q.props.target&&e&&J(q.reference.querySelectorAll(q.props.target)).forEach(function(e){return e._tippy&&e._tippy.destroy()}),q.popperInstance&&q.popperInstance.destroy(),X&&X.disconnect(),q.state.isDestroyed=!0)}var D=Me(e,t);if(!D.multiple&&e._tippy)return null;var X=null,I={},N=null,H=0,W=0,B=!1,M=function(){},R=[],z=!1,F=0<D.interactiveDebounce?Ie(c,D.interactiveDebounce):c,_=It++,U=be(_,D);U.addEventListener('mouseenter',function(e){q.props.interactive&&q.state.isVisible&&'mouseenter'===I.type&&i(e)}),U.addEventListener('mouseleave',function(e){q.props.interactive&&'mouseenter'===I.type&&0===q.props.interactiveDebounce&&xe(me(U),U.getBoundingClientRect(),e,q.props)&&n()});var V=ae(U),q={id:_,reference:e,popper:U,popperChildren:V,popperInstance:null,props:D,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},clearDelayTimeouts:T,set:S,setContent:function(e){S({content:e})},show:A,hide:Y,enable:function(){q.state.isEnabled=!0},disable:function(){q.state.isEnabled=!1},destroy:P};return C(),e.addEventListener('click',r),D.lazy||(q.popperInstance=u(),q.popperInstance.disableEventListeners()),D.showOnInit&&i(),!D.a11y||D.target||He(e)||e.setAttribute('tabindex','0'),e._tippy=q,U._tippy=q,q}function je(e,t,r){Re(t,nt),Nt||(Le(),Nt=!0);var a=Dt({},nt,t);Te(e)&&Be(e);var p=Ye(e),o=p[0],i=(r&&o?[o]:p).reduce(function(e,t){var r=t&&qe(t,a);return r&&e.push(r),e},[]),n={targets:e,props:a,instances:i,destroyAll:function(){n.instances.forEach(function(e){e.destroy()}),n.instances=[]}};return n}for(var Ke=Math.min,Ge=Math.floor,Qe=Math.round,Je=Math.max,Ze='.tippy-iOS{cursor:pointer!important}.tippy-notransition{transition:none!important}.tippy-popper{-webkit-perspective:700px;perspective:700px;z-index:9999;outline:0;transition-timing-function:cubic-bezier(.165,.84,.44,1);pointer-events:none;line-height:1.4;max-width:calc(100% - 10px)}.tippy-popper[x-placement^=top] .tippy-backdrop{border-radius:40% 40% 0 0}.tippy-popper[x-placement^=top] .tippy-roundarrow{bottom:-8px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.tippy-popper[x-placement^=top] .tippy-arrow{border-top:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;bottom:-7px;margin:0 6px;-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=top] .tippy-backdrop{-webkit-transform-origin:0 25%;transform-origin:0 25%}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-55%);transform:scale(1) translate(-50%,-55%)}.tippy-popper[x-placement^=top] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%,-45%);transform:scale(.2) translate(-50%,-45%);opacity:0}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(-20px);transform:translateY(-20px)}.tippy-popper[x-placement^=top] [data-animation=perspective]{-webkit-transform-origin:bottom;transform-origin:bottom}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=visible]{-webkit-transform:translateY(-10px) rotateX(0);transform:translateY(-10px) rotateX(0)}.tippy-popper[x-placement^=top] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) rotateX(60deg);transform:translateY(0) rotateX(60deg)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(-10px);transform:translateY(-10px)}.tippy-popper[x-placement^=top] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(-10px) scale(1);transform:translateY(-10px) scale(1)}.tippy-popper[x-placement^=top] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) scale(.5);transform:translateY(0) scale(.5)}.tippy-popper[x-placement^=bottom] .tippy-backdrop{border-radius:0 0 30% 30%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow{top:-8px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(0);transform:rotate(0)}.tippy-popper[x-placement^=bottom] .tippy-arrow{border-bottom:8px solid #333;border-right:8px solid transparent;border-left:8px solid transparent;top:-7px;margin:0 6px;-webkit-transform-origin:50% 100%;transform-origin:50% 100%}.tippy-popper[x-placement^=bottom] .tippy-backdrop{-webkit-transform-origin:0 -50%;transform-origin:0 -50%}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-45%);transform:scale(1) translate(-50%,-45%)}.tippy-popper[x-placement^=bottom] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-50%);transform:scale(.2) translate(-50%);opacity:0}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateY(20px);transform:translateY(20px)}.tippy-popper[x-placement^=bottom] [data-animation=perspective]{-webkit-transform-origin:top;transform-origin:top}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=visible]{-webkit-transform:translateY(10px) rotateX(0);transform:translateY(10px) rotateX(0)}.tippy-popper[x-placement^=bottom] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) rotateX(-60deg);transform:translateY(0) rotateX(-60deg)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateY(10px);transform:translateY(10px)}.tippy-popper[x-placement^=bottom] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateY(0);transform:translateY(0)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=visible]{-webkit-transform:translateY(10px) scale(1);transform:translateY(10px) scale(1)}.tippy-popper[x-placement^=bottom] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateY(0) scale(.5);transform:translateY(0) scale(.5)}.tippy-popper[x-placement^=left] .tippy-backdrop{border-radius:50% 0 0 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow{right:-16px;-webkit-transform-origin:33.33333333% 50%;transform-origin:33.33333333% 50%}.tippy-popper[x-placement^=left] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.tippy-popper[x-placement^=left] .tippy-arrow{border-left:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;right:-7px;margin:3px 0;-webkit-transform-origin:0 50%;transform-origin:0 50%}.tippy-popper[x-placement^=left] .tippy-backdrop{-webkit-transform-origin:50% 0;transform-origin:50% 0}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=left] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-75%,-50%);transform:scale(.2) translate(-75%,-50%);opacity:0}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(-20px);transform:translateX(-20px)}.tippy-popper[x-placement^=left] [data-animation=perspective]{-webkit-transform-origin:right;transform-origin:right}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=visible]{-webkit-transform:translateX(-10px) rotateY(0);transform:translateX(-10px) rotateY(0)}.tippy-popper[x-placement^=left] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) rotateY(-60deg);transform:translateX(0) rotateY(-60deg)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(-10px);transform:translateX(-10px)}.tippy-popper[x-placement^=left] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(-10px) scale(1);transform:translateX(-10px) scale(1)}.tippy-popper[x-placement^=left] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) scale(.5);transform:translateX(0) scale(.5)}.tippy-popper[x-placement^=right] .tippy-backdrop{border-radius:0 50% 50% 0}.tippy-popper[x-placement^=right] .tippy-roundarrow{left:-16px;-webkit-transform-origin:66.66666666% 50%;transform-origin:66.66666666% 50%}.tippy-popper[x-placement^=right] .tippy-roundarrow svg{position:absolute;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.tippy-popper[x-placement^=right] .tippy-arrow{border-right:8px solid #333;border-top:8px solid transparent;border-bottom:8px solid transparent;left:-7px;margin:3px 0;-webkit-transform-origin:100% 50%;transform-origin:100% 50%}.tippy-popper[x-placement^=right] .tippy-backdrop{-webkit-transform-origin:-50% 0;transform-origin:-50% 0}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=visible]{-webkit-transform:scale(1) translate(-50%,-50%);transform:scale(1) translate(-50%,-50%)}.tippy-popper[x-placement^=right] .tippy-backdrop[data-state=hidden]{-webkit-transform:scale(.2) translate(-25%,-50%);transform:scale(.2) translate(-25%,-50%);opacity:0}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-toward][data-state=hidden]{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.tippy-popper[x-placement^=right] [data-animation=perspective]{-webkit-transform-origin:left;transform-origin:left}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=visible]{-webkit-transform:translateX(10px) rotateY(0);transform:translateX(10px) rotateY(0)}.tippy-popper[x-placement^=right] [data-animation=perspective][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) rotateY(60deg);transform:translateX(0) rotateY(60deg)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=fade][data-state=hidden]{opacity:0;-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=visible]{-webkit-transform:translateX(10px);transform:translateX(10px)}.tippy-popper[x-placement^=right] [data-animation=shift-away][data-state=hidden]{opacity:0;-webkit-transform:translateX(0);transform:translateX(0)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=visible]{-webkit-transform:translateX(10px) scale(1);transform:translateX(10px) scale(1)}.tippy-popper[x-placement^=right] [data-animation=scale][data-state=hidden]{opacity:0;-webkit-transform:translateX(0) scale(.5);transform:translateX(0) scale(.5)}.tippy-tooltip{position:relative;color:#fff;border-radius:4px;font-size:.9rem;padding:.3rem .6rem;max-width:350px;text-align:center;will-change:transform;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:#333}.tippy-tooltip[data-size=small]{padding:.2rem .4rem;font-size:.75rem}.tippy-tooltip[data-size=large]{padding:.4rem .8rem;font-size:1rem}.tippy-tooltip[data-animatefill]{overflow:hidden;background-color:transparent}.tippy-tooltip[data-interactive],.tippy-tooltip[data-interactive] path{pointer-events:auto}.tippy-tooltip[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.53,2,.36,.85)}.tippy-tooltip[data-inertia][data-state=hidden]{transition-timing-function:ease}.tippy-arrow,.tippy-roundarrow{position:absolute;width:0;height:0}.tippy-roundarrow{width:24px;height:8px;fill:#333;pointer-events:none}.tippy-backdrop{position:absolute;will-change:transform;background-color:#333;border-radius:50%;width:calc(110% + 2rem);left:50%;top:50%;z-index:-1;transition:all cubic-bezier(.46,.1,.52,.98);-webkit-backface-visibility:hidden;backface-visibility:hidden}.tippy-backdrop:after{content:"";float:left;padding-top:100%}.tippy-backdrop+.tippy-content{transition-property:opacity;will-change:opacity}.tippy-backdrop+.tippy-content[data-state=visible]{opacity:1}.tippy-backdrop+.tippy-content[data-state=hidden]{opacity:0}',$e='3.4.0',et='undefined'!=typeof window,tt=et?navigator:{},rt=et?window:{},at=('MutationObserver'in rt),pt=/MSIE |Trident\//.test(tt.userAgent),ot=/iPhone|iPad|iPod/.test(tt.platform)&&!rt.MSStream,it=('ontouchstart'in rt),nt={a11y:!0,allowHTML:!0,animateFill:!0,animation:'shift-away',appendTo:function(){return document.body},aria:'describedby',arrow:!1,arrowTransform:'',arrowType:'sharp',autoFocus:!0,boundary:'scrollParent',content:'',delay:[0,20],distance:10,duration:[325,275],flip:!0,flipBehavior:'flip',followCursor:!1,hideOnClick:!0,inertia:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,lazy:!0,livePlacement:!0,maxWidth:'',multiple:!1,offset:0,onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},performance:!1,placement:'top',popperOptions:{},shouldPopperHideOnBlur:function(){return!0},showOnInit:!1,size:'regular',sticky:!1,target:'',theme:'dark',touch:!0,touchHold:!1,trigger:'mouseenter focus',updateDuration:200,wait:null,zIndex:9999},st=['arrow','arrowType','distance','flip','flipBehavior','offset','placement','popperOptions'],lt='undefined'!=typeof window&&'undefined'!=typeof document,dt=['Edge','Trident','Firefox'],ct=0,mt=0;mt<dt.length;mt+=1)if(lt&&0<=navigator.userAgent.indexOf(dt[mt])){ct=1;break}var i=lt&&window.Promise,ft=i?function(e){var t=!1;return function(){t||(t=!0,window.Promise.resolve().then(function(){t=!1,e()}))}}:function(e){var t=!1;return function(){t||(t=!0,setTimeout(function(){t=!1,e()},ct))}},ht=lt&&!!(window.MSInputMethodContext&&document.documentMode),bt=lt&&/MSIE 10/.test(navigator.userAgent),yt=function(e,t){if(!(e instanceof t))throw new TypeError('Cannot call a class as a function')},ut=function(){function e(e,t){for(var r,a=0;a<t.length;a++)r=t[a],r.enumerable=r.enumerable||!1,r.configurable=!0,'value'in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}return function(t,r,a){return r&&e(t.prototype,r),a&&e(t,a),t}}(),gt=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},xt=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var a in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},wt=lt&&/Firefox/i.test(navigator.userAgent),vt=['auto-start','auto','auto-end','top-start','top','top-end','right-start','right','right-end','bottom-end','bottom','bottom-start','left-end','left','left-start'],kt=vt.slice(3),Et={FLIP:'flip',CLOCKWISE:'clockwise',COUNTERCLOCKWISE:'counterclockwise'},Ot=function(){function t(r,a){var p=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};yt(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(p.update)},this.update=ft(this.update.bind(this)),this.options=xt({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=r&&r.jquery?r[0]:r,this.popper=a&&a.jquery?a[0]:a,this.options.modifiers={},Object.keys(xt({},t.Defaults.modifiers,o.modifiers)).forEach(function(e){p.options.modifiers[e]=xt({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(e){return xt({name:e},p.options.modifiers[e])}).sort(function(e,t){return e.order-t.order}),this.modifiers.forEach(function(t){t.enabled&&e(t.onLoad)&&t.onLoad(p.reference,p.popper,p.options,t,p.state)}),this.update();var i=this.options.eventsEnabled;i&&this.enableEventListeners(),this.state.eventsEnabled=i}return ut(t,[{key:'update',value:function(){return P.call(this)}},{key:'destroy',value:function(){return I.call(this)}},{key:'enableEventListeners',value:function(){return B.call(this)}},{key:'disableEventListeners',value:function(){return R.call(this)}}]),t}();Ot.Utils=('undefined'==typeof window?global:window).PopperUtils,Ot.placements=vt,Ot.Defaults={placement:'bottom',positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(e){var t=e.placement,r=t.split('-')[0],a=t.split('-')[1];if(a){var p=e.offsets,o=p.reference,i=p.popper,n=-1!==['bottom','top'].indexOf(r),s=n?'left':'top',l=n?'width':'height',d={start:gt({},s,o[s]),end:gt({},s,o[s]+o[l]-i[l])};e.offsets.popper=xt({},i,d[a])}return e}},offset:{order:200,enabled:!0,fn:Q,offset:0},preventOverflow:{order:300,enabled:!0,fn:function(e,t){var r=t.boundariesElement||o(e.instance.popper);e.instance.reference===r&&(r=o(r));var a=X('transform'),p=e.instance.popper.style,i=p.top,n=p.left,s=p[a];p.top='',p.left='',p[a]='';var l=v(e.instance.popper,e.instance.reference,t.padding,r,e.positionFixed);p.top=i,p.left=n,p[a]=s,t.boundaries=l;var d=t.priority,c=e.offsets.popper,m={primary:function(e){var r=c[e];return c[e]<l[e]&&!t.escapeWithReference&&(r=Je(c[e],l[e])),gt({},e,r)},secondary:function(e){var r='right'===e?'left':'top',a=c[r];return c[e]>l[e]&&!t.escapeWithReference&&(a=Ke(c[r],l[e]-('right'===e?c.width:c.height))),gt({},r,a)}};return d.forEach(function(e){var t=-1===['left','top'].indexOf(e)?'secondary':'primary';c=xt({},c,m[t](e))}),e.offsets.popper=c,e},priority:['left','right','top','bottom'],padding:5,boundariesElement:'scrollParent'},keepTogether:{order:400,enabled:!0,fn:function(e){var t=e.offsets,r=t.popper,a=t.reference,p=e.placement.split('-')[0],o=Ge,i=-1!==['top','bottom'].indexOf(p),n=i?'right':'bottom',s=i?'left':'top',l=i?'width':'height';return r[n]<o(a[s])&&(e.offsets.popper[s]=o(a[s])-r[l]),r[s]>o(a[n])&&(e.offsets.popper[s]=o(a[n])),e}},arrow:{order:500,enabled:!0,fn:function(e,r){var a;if(!V(e.instance.modifiers,'arrow','keepTogether'))return e;var p=r.element;if('string'==typeof p){if(p=e.instance.popper.querySelector(p),!p)return e;}else if(!e.instance.popper.contains(p))return console.warn('WARNING: `arrow.element` must be child of its popper element!'),e;var o=e.placement.split('-')[0],i=e.offsets,n=i.popper,s=i.reference,l=-1!==['left','right'].indexOf(o),d=l?'height':'width',c=l?'Top':'Left',m=c.toLowerCase(),f=l?'left':'top',h=l?'bottom':'right',y=C(p)[d];s[h]-y<n[m]&&(e.offsets.popper[m]-=n[m]-(s[h]-y)),s[m]+y>n[h]&&(e.offsets.popper[m]+=s[m]+y-n[h]),e.offsets.popper=b(e.offsets.popper);var u=s[m]+s[d]/2-y/2,g=t(e.instance.popper),x=parseFloat(g['margin'+c],10),w=parseFloat(g['border'+c+'Width'],10),v=u-e.offsets.popper[m]-x-w;return v=Je(Ke(n[d]-y,v),0),e.arrowElement=p,e.offsets.arrow=(a={},gt(a,m,Qe(v)),gt(a,f,''),a),e},element:'[x-arrow]'},flip:{order:600,enabled:!0,fn:function(e,t){if(D(e.instance.modifiers,'inner'))return e;if(e.flipped&&e.placement===e.originalPlacement)return e;var r=v(e.instance.popper,e.instance.reference,t.padding,t.boundariesElement,e.positionFixed),a=e.placement.split('-')[0],p=L(a),o=e.placement.split('-')[1]||'',i=[];switch(t.behavior){case Et.FLIP:i=[a,p];break;case Et.CLOCKWISE:i=j(a);break;case Et.COUNTERCLOCKWISE:i=j(a,!0);break;default:i=t.behavior;}return i.forEach(function(n,s){if(a!==n||i.length===s+1)return e;a=e.placement.split('-')[0],p=L(a);var l=e.offsets.popper,d=e.offsets.reference,c=Ge,m='left'===a&&c(l.right)>c(d.left)||'right'===a&&c(l.left)<c(d.right)||'top'===a&&c(l.bottom)>c(d.top)||'bottom'===a&&c(l.top)<c(d.bottom),f=c(l.left)<c(r.left),h=c(l.right)>c(r.right),b=c(l.top)<c(r.top),y=c(l.bottom)>c(r.bottom),u='left'===a&&f||'right'===a&&h||'top'===a&&b||'bottom'===a&&y,g=-1!==['top','bottom'].indexOf(a),x=!!t.flipVariations&&(g&&'start'===o&&f||g&&'end'===o&&h||!g&&'start'===o&&b||!g&&'end'===o&&y);(m||u||x)&&(e.flipped=!0,(m||u)&&(a=i[s+1]),x&&(o=q(o)),e.placement=a+(o?'-'+o:''),e.offsets.popper=xt({},e.offsets.popper,T(e.instance.popper,e.offsets.reference,e.placement)),e=Y(e.instance.modifiers,e,'flip'))}),e},behavior:'flip',padding:5,boundariesElement:'viewport'},inner:{order:700,enabled:!1,fn:function(e){var t=e.placement,r=t.split('-')[0],a=e.offsets,p=a.popper,o=a.reference,i=-1!==['left','right'].indexOf(r),n=-1===['top','left'].indexOf(r);return p[i?'left':'top']=o[r]-(n?p[i?'width':'height']:0),e.placement=L(t),e.offsets.popper=b(p),e}},hide:{order:800,enabled:!0,fn:function(e){if(!V(e.instance.modifiers,'hide','preventOverflow'))return e;var t=e.offsets.reference,r=S(e.instance.modifiers,function(e){return'preventOverflow'===e.name}).boundaries;if(t.bottom<r.top||t.left>r.right||t.top>r.bottom||t.right<r.left){if(!0===e.hide)return e;e.hide=!0,e.attributes['x-out-of-boundaries']=''}else{if(!1===e.hide)return e;e.hide=!1,e.attributes['x-out-of-boundaries']=!1}return e}},computeStyle:{order:850,enabled:!0,fn:function(e,t){var r=t.x,a=t.y,p=e.offsets.popper,i=S(e.instance.modifiers,function(e){return'applyStyle'===e.name}).gpuAcceleration;void 0!==i&&console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');var n=void 0===i?t.gpuAcceleration:i,s=o(e.instance.popper),l=u(s),d={position:p.position},c=U(e,2>window.devicePixelRatio||!wt),m='bottom'===r?'top':'bottom',f='right'===a?'left':'right',h=X('transform'),b=void 0,y=void 0;if(y='bottom'==m?'HTML'===s.nodeName?-s.clientHeight+c.bottom:-l.height+c.bottom:c.top,b='right'==f?'HTML'===s.nodeName?-s.clientWidth+c.right:-l.width+c.right:c.left,n&&h)d[h]='translate3d('+b+'px, '+y+'px, 0)',d[m]=0,d[f]=0,d.willChange='transform';else{var g='bottom'==m?-1:1,x='right'==f?-1:1;d[m]=y*g,d[f]=b*x,d.willChange=m+', '+f}var w={"x-placement":e.placement};return e.attributes=xt({},w,e.attributes),e.styles=xt({},d,e.styles),e.arrowStyles=xt({},e.offsets.arrow,e.arrowStyles),e},gpuAcceleration:!0,x:'bottom',y:'right'},applyStyle:{order:900,enabled:!0,fn:function(e){return F(e.instance.popper,e.styles),_(e.instance.popper,e.attributes),e.arrowElement&&Object.keys(e.arrowStyles).length&&F(e.arrowElement,e.arrowStyles),e},onLoad:function(e,t,r,a,p){var o=O(p,t,e,r.positionFixed),i=E(r.placement,o,t,e,r.modifiers.flip.boundariesElement,r.modifiers.flip.padding);return t.setAttribute('x-placement',i),F(t,{position:r.positionFixed?'fixed':'absolute'}),r},gpuAcceleration:void 0}}};var Ct={POPPER:'.tippy-popper',TOOLTIP:'.tippy-tooltip',CONTENT:'.tippy-content',BACKDROP:'.tippy-backdrop',ARROW:'.tippy-arrow',ROUND_ARROW:'.tippy-roundarrow'},Lt=et?Element.prototype:{},Tt=Lt.matches||Lt.matchesSelector||Lt.webkitMatchesSelector||Lt.mozMatchesSelector||Lt.msMatchesSelector,St={x:!0},At=!1,Yt=0,Pt=Object.keys(nt),Dt=Object.assign||function(e){for(var t,r=1;r<arguments.length;r++)for(var a in t=arguments[r],t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},Xt={translate:/translateX?Y?\(([^)]+)\)/,scale:/scaleX?Y?\(([^)]+)\)/},It=1,Nt=!1;je.version=$e,je.defaults=nt,je.one=function(e,t){return je(e,t,!0).instances[0]},je.setDefaults=function(e){Object.keys(e).forEach(function(t){nt[t]=e[t]})},je.disableAnimations=function(){je.setDefaults({duration:0,updateDuration:0,animateFill:!1})},je.hideAllPoppers=ge,je.useCapture=function(){};return et&&setTimeout(function(){J(document.querySelectorAll('[data-tippy]')).forEach(function(e){var t=e.getAttribute('data-tippy');t&&je(e,{content:t})})}),function(e){if(at){var t=document.createElement('style');t.type='text/css',t.textContent=e,document.head.insertBefore(t,document.head.firstChild)}}(Ze),je});
(()=>{"use strict";function t(t,a,r,n,o,i,l,d,y,u,v,c){a=parseFloat(a),n=yasrTrueFalseStringConvertion(n);const g=document.getElementById(o),m=JSON.parse(yasrWindowVar.isUserLoggedIn);s(v,!1);yasrSetRaterValue(t,o,g,1,n,a,(function(t,a){s(v,!0);let n={action:"yasr_send_visitor_rating",rating:t,post_id:r,is_singular:d};!0===m&&Object.assign(n,{nonce_visitor:l}),this.setRating(t),this.disable(),jQuery.post(yasrWindowVar.ajaxurl,n).done((function(t){if(!1===(t=yasrValidJson(t)))return s(v,!1),void e(c,"<span>Not a valid Json Element, rating can't be saved.</span>");let r,n=`yasr-vote-${t.status}`;"success"===t.status&&(e(y,t.number_of_votes),e(u,t.average_rating)),r=`<span class="yasr-small-block-bold" id="${n}"> ${t.text} </span>`,e(c,r),s(v,!1),a()})).fail((function(t,e,s,a){console.error("YASR ajax call failed. Can't save data"),console.log(t)}))}))}function e(t,e){null!==t&&(t.innerHTML=e,t.style.display="")}function s(t,s=!0){let a="";!0===s&&(a=yasrWindowVar.loaderHtml),e(t,a)}function a(t){const e=t.medium_rating;delete t.medium_rating;let s=0;for(let e=1;e<=5;e++)(1===e||t[e].n_of_votes>s)&&(s=t[e].n_of_votes);let a=Math.log(s)*Math.LOG10E+1|0,r="5%";a<=3&&(r="5%"),a>3&&a<=5&&(r="10%"),a>5&&(r="15%");let n='<div class="yasr-visitors-stats-tooltip">';n+='<span id="yasr-medium-rating-tooltip">'+e+" "+JSON.parse(yasrWindowVar.textVvStats)+"</span>",n+='<div class="yasr-progress-bars-container">';let o=JSON.parse(yasrWindowVar.starsPluralForm),i=0,l=0;for(let e=5;e>0;e--)1===e&&(o=JSON.parse(yasrWindowVar.starSingleForm)),void 0!==t[e]&&(i=t[e].progressbar,l=t[e].n_of_votes),n+=`<div class='yasr-progress-bar-row-container yasr-w3-container'>\n                               <div class='yasr-progress-bar-name'>${e} ${o}</div> \n                               <div class='yasr-single-progress-bar-container'> \n                                   <div class='yasr-w3-border'> \n                                       <div class='yasr-w3-amber' style='height:17px;width:${i}'></div> \n                                   </div>\n                               </div> \n                               <div class='yasr-progress-bar-votes-count' style="flex-basis:${r} ">${l}</div>\n                           </div>`;return n+="</div></div>",n}!function(r){if(r.length>0&&(function(a){for(let r=0;r<a.length;r++)!function(r){if(!1!==a.item(r).classList.contains("yasr-star-rating"))return;const n=a.item(r),o=n.getAttribute("data-rater-postid"),i=n.id,l=i.replace("yasr-visitor-votes-rater-",""),d=document.getElementById("yasr_visitor_votes_"+l),y=parseInt(n.getAttribute("data-rater-starsize")),u=n.getAttribute("data-rater-nonce"),v=n.getAttribute("data-issingular"),c="yasr-vv-votes-number-container-"+l,g="yasr-vv-average-container-"+l,m="yasr-vv-bottom-container-"+l,_="yasr-vv-loader-"+l,f=document.getElementById(c),p=document.getElementById(g),b=document.getElementById(m),w=document.getElementById(_);let S=n.getAttribute("data-rating"),E=n.getAttribute("data-readonly-attribute"),V=n.getAttribute("data-rater-readonly");if(null===E&&(E=!1),E=yasrTrueFalseStringConvertion(E),V=yasrTrueFalseStringConvertion(V),!0===E&&(V=!0),"yes"===yasrWindowVar.ajaxEnabled){s(w);let a={action:"yasr_load_vv",post_id:o};jQuery.get(yasrWindowVar.ajaxurl,a).done((function(a){let r,n=yasrValidJson(a);if(!1===n){let t="Not a valid Json Element";return s(w,!1),void e(d,t)}if(r=!0===E||n.yasr_visitor_votes.stars_attributes.read_only,S=n.yasr_visitor_votes.number_of_votes>0?n.yasr_visitor_votes.sum_votes/n.yasr_visitor_votes.number_of_votes:0,S=S.toFixed(1),S=parseFloat(S),t(y,S,o,r,i,l,u,v,f,p,w,b),!0!==E&&(e(f,n.yasr_visitor_votes.number_of_votes),e(p,S),!1!==n.yasr_visitor_votes.stars_attributes.span_bottom)){let t=n.yasr_visitor_votes.stars_attributes.span_bottom;e(b,t)}})).fail((function(e,s,a,r){console.info("YASR ajax call failed. Showing ratings from html"),t(y,S,o,V,i,l,u,v,f,p,w,b),!0!==E&&(b.style.display="")}))}else t(y,S,o,V,i,l,u,v,f,p,w,b)}(r)}(r),"yes"===yasrWindowVar.visitorStatsEnabled)){let t=document.getElementsByClassName("yasr-dashicons-visitor-stats");t&&function(t){let e,s,r=!1;for(let n=0;n<t.length;n++)!function(n){let o="#"+t.item(n).id,i=t.item(n).getAttribute("data-postid");if(0===n&&(e=document.getElementsByClassName("yasr-vv-text-container"),null!==e&&(s=window.getComputedStyle(e[0],null).getPropertyValue("color"))),s){document.getElementById(t.item(n).id).style.fill=s}let l={action:"yasr_stats_visitors_votes",post_id:i};"function"==typeof tippy&&tippy(o,{allowHTML:!0,content:'<span style="color: #0a0a0a">Loading...</span>',theme:"yasr",arrow:!0,arrowType:"round",onShow:function(t){o!==r&&jQuery.post(yasrWindowVar.ajaxurl,l,(function(e){if(!1!==(e=yasrValidJson(e)))return"error"===e.status?(console.error(e.text),void t.setContent(e.text)):void t.setContent(a(e));t.setContent("Error!")})).fail((function(e,s,a,r){let n="YASR ajax call failed.";console.log(e),t.setContent(n)}))},onHidden:function(){r=o}})}(n)}(t)}}(document.getElementsByClassName("yasr-rater-stars-vv"))})();