1!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("FilmbotHall",[],e):"object"==typeof exports?exports.FilmbotHall=e():t.FilmbotHall=e()}(window,function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,i){t.exports=i(1)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},r=function(){function t(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)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),o=i(2),s=function(t){return t&&t.__esModule?t:{default:t}}(i(12)),a=i(13);function l(t){if(Array.isArray(t)){for(var e=0,i=Array(t.length);e<t.length;e++)i[e]=t[e];return i}return Array.from(t)}i(14),window.Swal=s.default;var c=function(){function t(e,i,n,r,s){var a=e.sections,c=function(t,e){var i={};for(var n in t)e.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i}(e,["sections"]);!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=n,this.defaultOptions=c,this.defaultShapeParams={fill:"transparent",width:c.seat_size.width,height:c.seat_size.height,strokeWidth:2,selectable:!1,hasControls:!1,hasRotatingPoint:!1,stroke:n.stroke},this.sections=a,this.canvas=new o.fabric.Canvas(n.selector,{backgroundColor:n.canvasBg,width:n.canvasWidth,height:n.canvasHeight,selection:!1,renderOnAddRemove:!1,allowTouchScrolling:!0}),o.fabric.Object.prototype.objectCaching=!1,this.mapIcons={},this.selectedData=Array.isArray(i)?[].concat(l(i)):[],this.forceAvailable=Array.isArray(r)?[].concat(l(r)):[],this.forceDisabled=Array.isArray(s)?[].concat(l(s)):[],this.initialCanvasWidth=null,this.canvasContentWidth=null,this.canvasContentHeight=null,this.lastCanvasWidth=null,this.lastContentWidth=null,this.lastPosY=0,this.calculateInitialCanvasSize=this.calculateInitialCanvasSize.bind(this),this.handleResize=this.handleResize.bind(this),this.isAvailable=this.isAvailable.bind(this),this.setupEvents(),window.addEventListener("resize",this.handleResize)}return r(t,[{key:"destroy",value:function(){this.canvas.dispose(),window.removeEventListener("resize",this.handleResize)}},{key:"setupEvents",value:function(){var t=this.canvas,e=this.options,i=e.selectionLimit,n=void 0===i?5:i,r=e.onDeselect,o=e.onSelect,a=e.fill,l=this.selectSeat,c=this.selectedData,h=this.isAvailable;t.on("mouse:down",function(t){var e=t.e;this.lastPosY=e.screenY||e.touches[0].screenY}),t.on("mouse:up",function(e){var i=e.target,u=e.e;if(u.cancelable&&(u.preventDefault(),u.stopPropagation()),i){var d=u.screenY||u.changedTouches[0].screenY,f=Math.abs(d-this.lastPosY);this.lastPosY=0;var g=i.seatData;if(h(g)){if(i.selected&&f<10)return i.set({fill:"transparent",selected:!1}),"wheelchair"===i.seatData.extra?i.item(2).set("fill","transparent"):"companion"===i.seatData.extra&&i.item(1).set("fill","transparent"),void(r&&(c=c.filter(function(t){return t!==i.seatData.seat_address}),r(c)));if(!(c.length>=n)){var p={deltaY:f,target:i,onSelect:o,fill:a,seatData:g,selectedData:c,canvas:t};i.seatData.confirm_message?s.default.fire({text:i.seatData.confirm_message,showCancelButton:!0,confirmButtonText:"I Accept",confirmButtonColor:""}).then(function(t){t.value&&l(p)}):l(p)}}}})}},{key:"selectSeat",value:function(t){var e=t.deltaY,i=t.target,n=t.onSelect,r=t.fill,o=t.seatData,s=t.selectedData,a=t.canvas;e<10&&(i.set({fill:r,selected:!0}),"wheelchair"===i.seatData.extra?i.item(2).set("fill",r):"companion"===i.seatData.extra&&i.item(1).set("fill",r),n&&(s.push(o.seat_address),n(s))),a.renderAll()}},{key:"handleResize",value:function(){var t=document.querySelector(".hall-wrapper").clientWidth,e=document.querySelector(".hall-container").clientWidth,i=1;t<this.initialCanvasWidth&&e>this.lastContentWidth&&(i=(e>this.initialCanvasWidth?this.initialCanvasWidth:e)/this.lastContentWidth);t<this.lastCanvasWidth&&(i=t/this.lastCanvasWidth),this.zoomCanvas(i),this.lastCanvasWidth=document.querySelector(".hall-wrapper").clientWidth,this.lastContentWidth=document.querySelector(".hall-container").clientWidth}},{key:"zoomCanvas",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.canvas;
1if(e&&(i.setHeight(i.getHeight()*t),i.setWidth(i.getWidth()*t)),i.backgroundImage){var n=i.backgroundImage;n.width=n.width*t,n.height=n.height*t}var r=i.getObjects();for(var o in r){var s=r[o].scaleX,a=r[o].scaleY,l=r[o].left,c=r[o].top;r[o].scaleX=s*t,r[o].scaleY=a*t,r[o].left=l*t,r[o].top=c*t,r[o].setCoords()}i.renderAll(),i.calcOffset()}},{key:"addIconToCanvas",value:function(t,e,i){var n=this.options,r=n.disabledColor,o=n.fill,s=n.stroke;"wheelchair"===e.extra?this.isAvailable(e)?(t.item(0).set("fill",o),t.item(0).set("stroke",s),t.item(1).set("fill",o),t.item(1).set("stroke",s),t.item(2).set("stroke",s),i&&t.item(2).set("fill",o)):(t.item(2).set("fill",r),t.item(2).set("stroke",r)):"companion"===e.extra&&(this.isAvailable(e)?(t.item(0).set("fill",o),t.item(0).set("stroke",s),t.item(1).set("stroke",s),i&&t.item(1).set("fill",o)):(t.item(1).set("fill",r),t.item(1).set("stroke",r))),this.canvas.add(t)}},{key:"getWheelchairIcon",value:function(t){switch(t){case"circle":return a.wheelchairCircle;case"square":return a.wheelchairSquare;case"loveseat-left":return a.wheelchairLoveseatLeft;case"loveseat-right":return a.wheelchairLoveseatRight;default:return a.wheelchairSquare}}},{key:"getCompanionIcon",value:function(t){switch(t){case"circle":return a.companionCircle;case"square":return a.companionSquare;case"loveseat-left":return a.companionLoveseatLeft;case"loveseat-right":return a.companionLoveseatRight;default:return a.companionSquare}}},{key:"getSimpleShapeIcon",value:function(t,e){switch(t){case"circle":return new o.fabric.Circle(n({},e,{radius:this.defaultOptions.seat_size.width/2}));case"square":return new o.fabric.Rect(e);case"loveseat-left":return new o.fabric.Path("M20.91,20.91V1H8.74A7.7,7.7,0,0,0,1,8.74v4.43a7.7,7.7,0,0,0,7.74,7.74Z",e);case"loveseat-right":return new o.fabric.Path("M1,21V1H13.23A7.74,7.74,0,0,1,21,8.78v4.45A7.74,7.74,0,0,1,13.23,21Z",e);default:return new o.fabric.Rect(e)}}},{key:"generateSeat",value:function(t,e){var i=this,r=n({},this.defaultShapeParams,t),s=t.seatData,a=t.selected,l=(s.extra?s.extra:"")+e,c=this;if(this.mapIcons.hasOwnProperty(l))this.mapIcons[l].clone(function(t){t.set(r),c.addIconToCanvas(t,s,a)});else if(s.extra){var h=null;switch(s.extra){case"wheelchair":h=this.getWheelchairIcon(e);break;case"companion":h=this.getCompanionIcon(e)}o.fabric.loadSVGFromString(h,function(t){var e=o.fabric.util.groupSVGElements(t,r);i.mapIcons[l]=e,i.addIconToCanvas(e,s,a)})}else{var u=this.getSimpleShapeIcon(e,r);this.mapIcons[l]=u,this.addIconToCanvas(u,s,a)}}},{key:"calculateSeatOffsetX",value:function(t,e){var i=this.defaultOptions.seat_size.width,n=this.calculateSeatPadX(t);return 0===e?n:i+n}},{key:"calculateSeatPadX",value:function(t){var e=this.defaultOptions.seat_spacing.left;return t&&t.spacing&&t.spacing.hasOwnProperty("left")&&(e=t.spacing.left),e}},{key:"calculateRowPadY",value:function(t){var e=this.defaultOptions.row_spacing.top;return t.spacing&&t.spacing.hasOwnProperty("top")&&(e=t.spacing.top),e}},{key:"calculateSeatOffsetY",value:function(t){return this.defaultOptions.seat_size.height+this.calculateRowPadY(t)}},{key:"calculateSectionOffsetY",value:function(t){var e=this.defaultOptions.section_spacing.top;return t.spacing&&t.spacing.hasOwnProperty("top")&&(e=t.spacing.top),e}},{key:"calculateSectionOffsetX",value:function(t){var e=this.defaultOptions.section_spacing.left;return t.spacing&&t.spacing.hasOwnProperty("left")&&(e=t.spacing.left),e}},{key:"calculateInitialCanvasSize",value:function(){var t,e=this.canvasContentWidth,i=this.canvas,n=this.canvasContentHeight,r=this.options.canvasWidth,o=document.querySelector(".hall-wrapper").clientWidth;this.initialCanvasWidth=e,t=e>(r=e>o&&r>o?o:e)?r/e:e/r,i.setHeight(n*t),i.setWidth(r),this.zoomCanvas(t,!1),this.lastCanvasWidth=document.querySelector(".hall-wrapper").clientWidth,this.lastContentWidth=document.querySelector(".hall-container").clientWidth,this.canvas.renderAll(),this.canvas.calcOffset()}},{key:"generateStaticHTML",value:function(){var t=document.querySelector(".hall-container");t.insertAdjacentHTML("afterBegin",a.hallHeaderHtml),this.options.hideBackLabel||t.insertAdjacentHTML("beforeEnd",a.hallFooterHtml)}},{key:"generateDynamicLegend",value:function(){var t=this.defaultOptions.legend;if(t){var e=document.querySelector(".hall-legend");t.forEach(function(t){var i='\n <div class="hall-legend-item">
1\n <span class="hall-legend-icon hall-legend-'+t.seat_type+'"></span>\n '+t.title+"\n </div>\n ";e.insertAdjacentHTML("beforeEnd",i)})}}},{key:"generateDynamicDescription",value:function(){var t=this.defaultOptions.description;t&&(document.querySelector(".hall-description").innerHTML=t)}},{key:"isForceAvailable",value:function(t){var e=t.seat_address;return this.forceAvailable.includes(e)}},{key:"isForceDisabled",value:function(t){var e=t.seat_address;return this.forceDisabled.includes(e)}},{key:"isAvailable",value:function(t){return!!this.isForceAvailable(t)||!this.isForceDisabled(t)&&!(t.data&&t.data.hasOwnProperty("available")&&!1===t.data.available)}},{key:"isSelected",value:function(t){return!!t.seat_address&&(!!this.isForceAvailable(t)||!this.isForceDisabled(t)&&this.selectedData.includes(t.seat_address))}},{key:"render",value:function(){var t=this,e=this.defaultOptions.seat_size,i=e.width,n=e.height;this.generateStaticHTML(),this.generateDynamicLegend(),this.generateDynamicDescription();var r=this.sections,o=this.options,s=o.fill,a=o.disabledColor,l=o.stroke,c=0,h=0,u=[],d=[];document.body.style.setProperty("--stroke",l),document.body.style.setProperty("--fill",s),document.body.style.setProperty("--disabledColor",a);for(var f=0;f<r.length;f++){var g=r[f];if(!g.disabled){var p=r[f].rows,m=0,v=this.calculateSectionOffsetX(g),w=this.calculateSectionOffsetY(g);v>c&&(c=v),w>h&&(h=w),u[v]=[],d[w]=[];for(var y=0;y<p.length;y++){var b=p[y];m+=this.calculateSeatOffsetY(b);for(var x=0,_=0;_<b.seats.length;_++){var C=b.seats[_];if(x+=this.calculateSeatOffsetX(C,_),"no-seat"!==C.seat_type){var S=this.isAvailable(C);this.generateSeat({top:w+m,left:v+x,hoverCursor:S?"pointer":"not-allowed",fill:S?this.isSelected(C)?s:"transparent":a,stroke:S?s:a,seatData:C,selected:this.isSelected(C)},C.seat_type)}u[v].push(x),d[w].push(m)}}}}this.canvasContentWidth=c+Math.max.apply(Math,u[c])+i+Math.min.apply(Math,u[c]),this.canvasContentHeight=h+Math.max.apply(Math,d[h])+n+Math.min.apply(Math,d[h]),u=[],d=[],setTimeout(function(){t.calculateInitialCanvasSize(),document.querySelector(".hall-wrapper").style.visibility="visible"},0)}}]),t}();e.default=c},function(t,e,i){(function(t){ 2 /*! Fabric.js Copyright 2008-2015, Printio (Juriy Zaytsev, Maxim Chernyak) */ 3 var n=n||{version:"2.3.3"};if(e.fabric=n,"undefined"!=typeof document&&"undefined"!=typeof window?(n.document=document,n.window=window):(n.document=i(8).jsdom(decodeURIComponent("%3C!DOCTYPE%20html%3E%3Chtml%3E%3Chead%3E%3C%2Fhead%3E%3Cbody%3E%3C%2Fbody%3E%3C%2Fhtml%3E"),{features:{FetchExternalResources:["img"]}}),n.jsdomImplForWrapper=i(9).implForWrapper,n.nodeCanvas=i(10).Canvas,n.window=n.document.defaultView,DOMParser=i(11).DOMParser),n.isTouchSupported="ontouchstart"in n.window,n.isLikelyNode=void 0!==t&&"undefined"==typeof window,n.SHARED_ATTRIBUTES=["display","transform","fill","fill-opacity","fill-rule","opacity","stroke","stroke-dasharray","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","id","paint-order","instantiated_by_use"],n.DPI=96,n.reNum="(?:[-+]?(?:\\d+|\\d*\\.\\d+)(?:e[-+]?\\d+)?)",n.fontPaths={},n.iMatrix=[1,0,0,1,0,0],n.canvasModule="canvas",n.perfLimitSizeTotal=2097152,n.maxCacheSideLimit=4096,n.minCacheSideLimit=256,n.charWidthsCache={},n.textureSize=2048,n.enableGLFiltering=!0,n.devicePixelRatio=n.window.devicePixelRatio||n.window.webkitDevicePixelRatio||n.window.mozDevicePixelRatio||1,n.browserShadowBlurConstant=1,n.initFilterBackend=function(){return n.enableGLFiltering&&n.isWebglSupported&&n.isWebglSupported(n.textureSize)?(console.log("max texture size: "+n.maxTextureSize),new n.WebglFilterBackend({tileSize:n.textureSize})):n.Canvas2dFilterBackend?new n.Canvas2dFilterBackend:void 0},"undefined"!=typeof document&&"undefined"!=typeof window&&(window.fabric=n),void 0===r)var r={};if(function(t){"use strict";t.modifyEventListener=!1,t.modifySelectors=!1,t.configure=function(e){isFinite(e.modifyEventListener)&&(t.modifyEventListener=e.modifyEventListener),isFinite(e.modifySelectors)&&(t.modifySelectors=e.modifySelectors),!1===g&&t.modifyEventListener&&p(),!1===m&&t.modifySelectors&&v()},t.add=function(t,e,n,r){return i(t,e,n,r,"add")},t.remove=function(t,e,n,r){return i(t,e,n,r,"remove")},t.returnFalse=function(t){return!1},t.stop=function(t){t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0,t.cancelBubbleCount=0)},t.prevent=function(t){t&&(t.preventDefault?t.preventDefault():t.preventManipulation?t.preventManipulation():t.returnValue=!1)},t.cancel=function(e){t.stop(e),t.prevent(e)},t.blur=function(){var t=document.activeElement;if(t){var e=document.activeElement.nodeName;"INPUT"!==e&&"TEXTAREA"!==e&&"true"!==t.contentEditable||t.blur&&t.blur()}},t.getEventSupport=function(t,e){if("string"==typeof t&&(e=t,t=window),(e="on"+e)in t)return!0;
3if(t.setAttribute||(t=document.createElement("div")),t.setAttribute&&t.removeAttribute){t.setAttribute(e,"");var i="function"==typeof t[e];return void 0!==t[e]&&(t[e]=null),t.removeAttribute(e),i}};var e=function(t){if(!t||"object"!=typeof t)return t;var i=new t.constructor;for(var n in t)t[n]&&"object"==typeof t[n]?i[n]=e(t[n]):i[n]=t[n];return i},i=function(s,a,h,g,p,m){if(g=g||{},"[object Object]"===String(s)){var v=s;if(s=v.target,delete v.target,!v.type||!v.listener){for(var w in v){var y=v[w];"function"!=typeof y&&(g[w]=y)}var b={};for(var x in v){w=x.split(",");var _=v[x],C={};for(var S in g)C[S]=g[S];if("function"==typeof _)h=_;else{if("function"!=typeof _.listener)continue;h=_.listener;for(var S in _)"function"!=typeof _[S]&&(C[S]=_[S])}for(var T=0;T<w.length;T++)b[x]=r.add(s,w[T],h,C,p)}return b}for(var x in a=v.type,delete v.type,h=v.listener,delete v.listener,v)g[x]=v[x]}if(s&&a&&h){if("string"==typeof s&&"ready"===a){if(!window.eventjs_stallOnReady){var O=(new Date).getTime(),k=g.timeout,E=g.interval||1e3/60,A=window.setInterval(function(){(new Date).getTime()-O>k&&window.clearInterval(A),document.querySelector(s)&&(window.clearInterval(A),setTimeout(h,1))},E);return}a="load",s=window}if("string"==typeof s){if(0===(s=document.querySelectorAll(s)).length)return o("Missing target on listener!",arguments);1===s.length&&(s=s[0])}var P,D={};if(s.length>0&&s!==window){for(var M=0,j=s.length;M<j;M++)(P=i(s[M],a,h,e(g),p))&&(D[M]=P);return n(D)}if("string"==typeof a&&(-1!==(a=a.toLowerCase()).indexOf(" ")?a=a.split(" "):-1!==a.indexOf(",")&&(a=a.split(","))),"string"!=typeof a){if("number"==typeof a.length)for(var L=0,F=a.length;L<F;L++)(P=i(s,a[L],h,e(g),p))&&(D[a[L]]=P);else for(var x in a)(P="function"==typeof a[x]?i(s,x,a[x],e(g),p):i(s,x,a[x].listener,e(a[x]),p))&&(D[x]=P);return n(D)}if(0===a.indexOf("on")&&(a=a.substr(2)),"object"!=typeof s)return o("Target is not defined!",arguments);if("function"!=typeof h)return o("Listener is not a function!",arguments);var I=g.useCapture||!1,B=u(s)+"."+u(h)+"."+(I?1:0);if(t.Gesture&&t.Gesture._gestureHandlers[a]){if(B=a+B,"remove"===p){if(!c[B])return;c[B].remove(),delete c[B]}else if("add"===p){if(c[B])return c[B].add(),c[B];if(g.useCall&&!t.modifyEventListener){var R=h;h=function(t,e){for(var i in e)t[i]=e[i];return R.call(s,t)}}g.gesture=a,g.target=s,g.listener=h,g.fromOverwrite=m,c[B]=t.proxy[a](g)}return c[B]}var Y,X=l(a);for(T=0;T<X.length;T++)if(Y=(a=X[T])+"."+B,"remove"===p){if(!c[Y])continue;s[f](a,h,I),delete c[Y]}else if("add"===p){if(c[Y])return c[Y];s[d](a,h,I),c[Y]={id:Y,type:a,target:s,listener:h,remove:function(){for(var e=0;e<X.length;e++)t.remove(s,X[e],h,g)}}}return c[Y]}},n=function(t){return{remove:function(){for(var e in t)t[e].remove()},add:function(){for(var e in t)t[e].add()}}},o=function(t,e){"undefined"!=typeof console&&void 0!==console.error&&console.error(t,e)},s={msPointer:["MSPointerDown","MSPointerMove","MSPointerUp"],touch:["touchstart","touchmove","touchend"],mouse:["mousedown","mousemove","mouseup"]},a={MSPointerDown:0,MSPointerMove:1,MSPointerUp:2,touchstart:0,touchmove:1,touchend:2,mousedown:0,mousemove:1,mouseup:2},l=(t.supports={},window.navigator.msPointerEnabled&&(t.supports.msPointer=!0),t.getEventSupport("touchstart")&&(t.supports.touch=!0),t.getEventSupport("mousedown")&&(t.supports.mouse=!0),function(e){var i=document.addEventListener?"":"on",n=a[e];if(isFinite(n)){var r=[];for(var o in t.supports)r.push(i+s[o][n]);return r}return[i+e]}),c={},h=0,u=function(t){return t===window?"#window":t===document?"#document":(t.uniqueID||(t.uniqueID="e"+h++),t.uniqueID)},d=document.addEventListener?"addEventListener":"attachEvent",f=document.removeEventListener?"removeEventListener":"detachEvent";t.createPointerEvent=function(e,i,n){var r=i.gesture,o=i.target,s=e.changedTouches||t.proxy.getCoords(e);if(s.length){var a=s[0];i.pointers=n?[]:s,i.pageX=a.pageX,i.pageY=a.pageY,i.x=i.pageX,i.y=i.pageY}var l=document.createEvent("Event");for(var c in l.initEvent(r,!0,!0),l.originalEvent=e,i)"target"!==c&&(l[c]=i[c]);var h=l.type;t.Gesture&&t.Gesture._gestureHandlers[h]&&i.oldListener.call(o,l,i,!1)};var g=!1,p=function(){if(window.HTMLElement){var e=function(e){var n=function(n){var r=n+"EventListener",o=e[r];e[r]=function(e,r,s){if(t.Gesture&&t.Gesture._gestureHandlers[e]){var a=s;"object"==typeof s?a.useCall=!0:a={useCall:!0,useCapture:s},i(this,e,r,a,n,!0)}else for(var c=l(e),h=0;h<c.length;h++)o.call(this,c[h],r,s)}};n("add"),n("remove")};navigator.userAgent.match(/Firefox/)?(e(HTMLDivElement.prototype),e(HTMLCanvasElement.prototype)):e(HTMLElement.prototype),e(document),e(window)}},m=!1,v=function(){var t=NodeList.prototype;
3t.removeEventListener=function(t,e,i){for(var n=0,r=this.length;n<r;n++)this[n].removeEventListener(t,e,i)},t.addEventListener=function(t,e,i){for(var n=0,r=this.length;n<r;n++)this[n].addEventListener(t,e,i)}}}(r),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";t.pointerSetup=function(t,e){t.target=t.target||window,t.doc=t.target.ownerDocument||t.target,t.minFingers=t.minFingers||t.fingers||1,t.maxFingers=t.maxFingers||t.fingers||1/0,t.position=t.position||"relative",delete t.fingers,(e=e||{}).enabled=!0,e.gesture=t.gesture,e.target=t.target,e.env=t.env,r.modifyEventListener&&t.fromOverwrite&&(t.oldListener=t.listener,t.listener=r.createPointerEvent);var i=0,n=0===e.gesture.indexOf("pointer")&&r.modifyEventListener?"pointer":"mouse";return t.oldListener&&(e.oldListener=t.oldListener),e.listener=t.listener,e.proxy=function(i){e.defaultListener=t.listener,t.listener=i,i(t.event,e)},e.add=function(){!0!==e.enabled&&(t.onPointerDown&&r.add(t.target,n+"down",t.onPointerDown),t.onPointerMove&&r.add(t.doc,n+"move",t.onPointerMove),t.onPointerUp&&r.add(t.doc,n+"up",t.onPointerUp),e.enabled=!0)},e.remove=function(){!1!==e.enabled&&(t.onPointerDown&&r.remove(t.target,n+"down",t.onPointerDown),t.onPointerMove&&r.remove(t.doc,n+"move",t.onPointerMove),t.onPointerUp&&r.remove(t.doc,n+"up",t.onPointerUp),e.reset(),e.enabled=!1)},e.pause=function(e){!t.onPointerMove||e&&!e.move||r.remove(t.doc,n+"move",t.onPointerMove),!t.onPointerUp||e&&!e.up||r.remove(t.doc,n+"up",t.onPointerUp),i=t.fingers,t.fingers=0},e.resume=function(e){!t.onPointerMove||e&&!e.move||r.add(t.doc,n+"move",t.onPointerMove),!t.onPointerUp||e&&!e.up||r.add(t.doc,n+"up",t.onPointerUp),t.fingers=i},e.reset=function(){t.tracker={},t.fingers=0},e};var e=r.supports;r.isMouse=!!e.mouse,r.isMSPointer=!!e.touch,r.isTouch=!!e.msPointer,t.pointerStart=function(e,i,n){var o=(e.type||"mousedown").toUpperCase();0===o.indexOf("MOUSE")?(r.isMouse=!0,r.isTouch=!1,r.isMSPointer=!1):0===o.indexOf("TOUCH")?(r.isMouse=!1,r.isTouch=!0,r.isMSPointer=!1):0===o.indexOf("MSPOINTER")&&(r.isMouse=!1,r.isTouch=!1,r.isMSPointer=!0);var s=function(t,e){var i=n.bbox,r=l[e]={};switch(n.position){case"absolute":r.offsetX=0,r.offsetY=0;break;case"differenceFromLast":case"difference":r.offsetX=t.pageX,r.offsetY=t.pageY;break;case"move":r.offsetX=t.pageX-i.x1,r.offsetY=t.pageY-i.y1;break;default:r.offsetX=i.x1-i.scrollLeft,r.offsetY=i.y1-i.scrollTop}var o=t.pageX-r.offsetX,s=t.pageY-r.offsetY;r.rotation=0,r.scale=1,r.startTime=r.moveTime=(new Date).getTime(),r.move={x:o,y:s},r.start={x:o,y:s},n.fingers++};n.event=e,i.defaultListener&&(n.listener=i.defaultListener,delete i.defaultListener);for(var a=!n.fingers,l=n.tracker,c=e.changedTouches||t.getCoords(e),h=c.length,u=0;u<h;u++){var d=c[u],f=d.identifier||1/0;if(n.fingers){if(n.fingers>=n.maxFingers){var g=[];for(var f in n.tracker)g.push(f);return i.identifier=g.join(","),a}for(var p in l){if(l[p].up){delete l[p],s(d,f),n.cancel=!0;break}0}if(l[f])continue;s(d,f)}else l=n.tracker={},i.bbox=n.bbox=t.getBoundingBox(n.target),n.fingers=0,n.cancel=!1,s(d,f)}g=[];for(var f in n.tracker)g.push(f);return i.identifier=g.join(","),a},t.pointerEnd=function(t,e,i,n){for(var r=t.touches||[],o=r.length,s={},a=0;a<o;a++){s[(l=r[a].identifier)||1/0]=!0}for(var l in i.tracker){var c=i.tracker[l];s[l]||c.up||(n&&n({pageX:c.pageX,pageY:c.pageY,changedTouches:[{pageX:c.pageX,pageY:c.pageY,identifier:"Infinity"===l?1/0:l}]},"up"),c.up=!0,i.fingers--)}if(0!==i.fingers)return!1;var h=[];for(var l in i.gestureFingers=0,i.tracker)i.gestureFingers++,h.push(l);return e.identifier=h.join(","),!0},t.getCoords=function(e){return void 0!==e.pageX?t.getCoords=function(t){return Array({type:"mouse",x:t.pageX,y:t.pageY,pageX:t.pageX,pageY:t.pageY,identifier:t.pointerId||1/0})}:t.getCoords=function(t){var e=document.documentElement;return t=t||window.event,Array({type:"mouse",x:t.clientX+e.scrollLeft,y:t.clientY+e.scrollTop,pageX:t.clientX+e.scrollLeft,pageY:t.clientY+e.scrollTop,identifier:1/0})},t.getCoords(e)},t.getCoord=function(e){if("ontouchstart"in window){var i=0,n=0;t.getCoord=function(t){var e=t.changedTouches;return e&&e.length?{x:i=e[0].pageX,y:n=e[0].pageY}:{x:i,y:n}}}else void 0!==e.pageX&&void 0!==e.pageY?t.getCoord=function(t){return{x:t.pageX,y:t.pageY}}:t.getCoord=function(t){var e=document.documentElement;return{x:(t=t||window.event).clientX+e.scrollLeft,y:t.clientY+e.scrollTop}};return t.getCoord(e)};var i=function(t,e){var i=parseFloat(t.getPropertyValue(e),10);return isFinite(i)?i:0};return t.getBoundingBox=function(t){t!==window&&t!==document||(t=document.body);var e={},n=t.getBoundingClientRect();if(e.width=n.width,e.height=n.height,e.x1=n.left,e.y1=n.top,e.scaleX=n.width/t.offsetWidth||1,e.scaleY=n.height/t.offsetHeight||1,e.scrollLeft=0,e.scrollTop=0,!1===("border-box"===(c=window.getComputedStyle(t)).getPropertyValue("box-sizing"))){var r=i(c,"border-left-width"),o=i(c,"border-right-width"),s=i(c,"border-bottom-width"),a=i(c,"border-top-width");e.border=[r,o,a,s],e.x1+=r,e.y1+=a,e.width-=o+r,e.height-=s+a}e.x2=e.x1+e.width,e.y2=e.y1+e.height;for(var l="fixed"===(h=c.getPropertyValue("position"))?t:t.parentNode;null!==l&&l!==document.body&&void 0!==l.scrollTop;){var c,h;if("absolute"===(h=(c=window.getComputedStyle(l)).getPropertyValue("position")));else{if("fixed"===h){e.scrollTop-=l.parentNode.scrollTop,e.scrollLeft-=l.parentNode.scrollLeft;break}e.scrollLeft+=l.scrollLeft,e.scrollTop+=l.scrollTop}l=l.parentNode}return e.scrollBodyLeft=void 0!==window.pageXOffset?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft,e.scrollBodyTop=void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop,e.scrollLeft-=e.scrollBodyLeft,e.scrollTop-=e.scrollBodyTop,e},function(){var e,i=navigator.userAgent.toLowerCase(),n=-1!==i.indexOf("macintosh");e=n&&-1!==i.indexOf("khtml")?{91:!0,93:!0}:n&&-1!==i.indexOf("firefox")?{224:!0}:{17:!0},(t.metaTrackerReset=function(){r.fnKey=t.fnKey=!1,r.metaKey=t.metaKey=!1,r.escKey=t.escKey=!1,r.ctrlKey=t.ctrlKey=!1,r.shiftKey=t.shiftKey=!1,r.altKey=t.altKey=!1}
3)(),t.metaTracker=function(i){var n="keydown"===i.type;27===i.keyCode&&(r.escKey=t.escKey=n),e[i.keyCode]&&(r.metaKey=t.metaKey=n),r.ctrlKey=t.ctrlKey=i.ctrlKey,r.shiftKey=t.shiftKey=i.shiftKey,r.altKey=t.altKey=i.altKey}}(),t}(r.proxy),void 0===r)r={};if(r.MutationObserver=function(){var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,e=!t&&function(){var t=document.createElement("p"),e=!1,i=function(){e=!0};if(t.addEventListener)t.addEventListener("DOMAttrModified",i,!1);else{if(!t.attachEvent)return!1;t.attachEvent("onDOMAttrModified",i)}return t.setAttribute("id","target"),e}();return function(i,n){if(t){new t(function(t){t.forEach(function(t){n.call(t.target,t.attributeName)})}).observe(i,{subtree:!1,attributes:!0})}else e?r.add(i,"DOMAttrModified",function(t){n.call(i,t.attrName)}):"onpropertychange"in document.body&&r.add(i,"propertychange",function(t){n.call(i,window.event.propertyName)})}}(),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.click=function(e){e.gesture=e.gesture||"click",e.maxFingers=e.maxFingers||e.fingers||1,e.onPointerDown=function(n){t.pointerStart(n,i,e)&&r.add(e.target,"mouseup",e.onPointerUp)},e.onPointerUp=function(n){if(t.pointerEnd(n,i,e)){r.remove(e.target,"mouseup",e.onPointerUp);var o=(n.changedTouches||t.getCoords(n))[0],s=e.bbox,a=t.getBoundingBox(e.target),l=o.pageY-a.scrollBodyTop,c=o.pageX-a.scrollBodyLeft;if(c>s.x1&&l>s.y1&&c<s.x2&&l<s.y2&&s.scrollTop===a.scrollTop){for(var h in e.tracker)break;var u=e.tracker[h];i.x=u.start.x,i.y=u.start.y,e.listener(n,i)}}};var i=t.pointerSetup(e);return i.state="click",r.add(e.target,"mousedown",e.onPointerDown),i},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.click=t.click,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.dbltap=t.dblclick=function(e){e.gesture=e.gesture||"dbltap",e.maxFingers=e.maxFingers||e.fingers||1;var i,n,o,s,a;e.onPointerDown=function(c){var h=c.changedTouches||t.getCoords(c);i&&!n?(a=h[0],n=(new Date).getTime()-i):(s=h[0],i=(new Date).getTime(),n=0,clearTimeout(o),o=setTimeout(function(){i=0},700)),t.pointerStart(c,l,e)&&(r.add(e.target,"mousemove",e.onPointerMove).listener(c),r.add(e.target,"mouseup",e.onPointerUp))},e.onPointerMove=function(l){if(i&&!n){var c=l.changedTouches||t.getCoords(l);a=c[0]}var h=e.bbox,u=a.pageX-h.x1,d=a.pageY-h.y1;u>0&&u<h.width&&d>0&&d<h.height&&Math.abs(a.pageX-s.pageX)<=25&&Math.abs(a.pageY-s.pageY)<=25||(r.remove(e.target,"mousemove",e.onPointerMove),clearTimeout(o),i=n=0)},e.onPointerUp=function(s){if(t.pointerEnd(s,l,e)&&(r.remove(e.target,"mousemove",e.onPointerMove),r.remove(e.target,"mouseup",e.onPointerUp)),i&&n){if(n<=700){for(var a in l.state=e.gesture,e.tracker)break;var c=e.tracker[a];l.x=c.start.x,l.y=c.start.y,e.listener(s,l)}clearTimeout(o),i=n=0}};var l=t.pointerSetup(e);return l.state="dblclick",r.add(e.target,"mousedown",e.onPointerDown),l},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.dbltap=t.dbltap,r.Gesture._gestureHandlers.dblclick=t.dblclick,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.dragElement=function(e,i){t.drag({event:i,target:e,position:"move",listener:function(t,i){e.style.left=i.x+"px",e.style.top=i.y+"px",r.prevent(t)}})},t.drag=function(e){e.gesture="drag",e.onPointerDown=function(n){t.pointerStart(n,i,e)&&(e.monitor||(r.add(e.doc,"mousemove",e.onPointerMove),r.add(e.doc,"mouseup",e.onPointerUp))),e.onPointerMove(n,"down")},e.onPointerMove=function(n,r){if(!e.tracker)return e.onPointerDown(n);e.bbox;for(var o=n.changedTouches||t.getCoords(n),s=o.length,a=0;a<s;a++){var l=o[a],c=l.identifier||1/0,h=e.tracker[c];h&&(h.pageX=l.pageX,h.pageY=l.pageY,i.state=r||"move",i.identifier=c,i.start=h.start,i.fingers=e.fingers,"differenceFromLast"===e.position?(i.x=h.pageX-h.offsetX,i.y=h.pageY-h.offsetY,h.offsetX=h.pageX,h.offsetY=h.pageY):(i.x=h.pageX-h.offsetX,i.y=h.pageY-h.offsetY),e.listener(n,i))}},e.onPointerUp=function(n){t.pointerEnd(n,i,e,e.onPointerMove)&&(e.monitor||(r.remove(e.doc,"mousemove",e.onPointerMove),r.remove(e.doc,"mouseup",e.onPointerUp)))};var i=t.pointerSetup(e);return e.event?e.onPointerDown(e.event):(r.add(e.target,"mousedown",e.onPointerDown),e.monitor&&(r.add(e.doc,"mousemove",e.onPointerMove),r.add(e.doc,"mouseup",e.onPointerUp))),i},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.drag=t.drag,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";var e=Math.PI/180,i=function(t,e){var i=0,n=0,r=0;for(var o in e){var s=e[o];s.up||(i+=s.move.x,n+=s.move.y,r++)}return t.x=i/=r,t.y=n/=r,t};return t.gesture=function(n){n.gesture=n.gesture||"gesture",n.minFingers=n.minFingers||n.fingers||2,n.onPointerDown=function(e){var s=n.fingers;if(t.pointerStart(e,o,n)&&(r.add(n.doc,"mousemove",n.onPointerMove),r.add(n.doc,"mouseup",n.onPointerUp)),n.fingers===n.minFingers&&s!==n.fingers){o.fingers=n.minFingers,o.scale=1,o.rotation=0,o.state="start";var a="";for(var l in n.tracker)a+=l;o.identifier=parseInt(a),i(o,n.tracker),n.listener(e,o)}},n.onPointerMove=function(r,s){for(var a=n.bbox,l=n.tracker,c=(d=r.changedTouches||t.getCoords(r)).length,h=0;h<c;h++){var u=l[p=(m=d[h]).identifier||1/0];u&&(u.move.x=m.pageX-a.x1,u.move.y=m.pageY-a.y1)}if(!(n.fingers<n.minFingers)){var d=[],f=0,g=0;for(var p in i(o,l),l){var m;if(!(m=l[p]).up){var v=m.start;if(!v.distance){var w=v.x-o.x,y=v.y-o.y;v.distance=Math.sqrt(w*w+y*y),v.angle=Math.atan2(w,y)/e}w=m.move.x-o.x,y=m.move.y-o.y;f+=Math.sqrt(w*w+y*y)/v.distance;var b=Math.atan2(w,y)/e,x=(v.angle-b+360)%360-180;m.DEG2=m.DEG1,m.DEG1=x>0?x:-x,void 0!==m.DEG2&&(x>0?m.rotation+=m.DEG1-m.DEG2:m.rotation-=m.DEG1-m.DEG2,g+=m.rotation),d.push(m.move)}}o.touches=d,o.fingers=n.fingers,o.scale=f/n.fingers,o.rotation=g/n.fingers,o.state="change",n.listener(r,o)}},n.onPointerUp=function(e){var i=n.fingers;t.pointerEnd(e,o,n)&&(r.remove(n.doc,"mousemove",n.onPointerMove),r.remove(n.doc,"mouseup",n.onPointerUp)),i===n.minFingers&&n.fingers<n.minFingers&&(o.fingers=n.fingers,o.state="end",n.listener(e,o))};var o=t.pointerSetup(n);return r.add(n.target,"mousedown",n.onPointerDown),o},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.gesture=t.gesture,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.pointerdown=t.pointermove=t.pointerup=function(e){if(e.gesture=e.gesture||"pointer",!e.target.isPointerEmitter){var i=!0;e.onPointerDown=function(t){i=!1,n.gesture="pointerdown",e.listener(t,n)},e.onPointerMove=function(t){n.gesture="pointermove",e.listener(t,n,i)},e.onPointerUp=function(t){i=!0,n.gesture="pointerup",e.listener(t,n,!0)};var n=t.pointerSetup(e);return r.add(e.target,"mousedown",e.onPointerDown),r.add(e.target,"mousemove",e.onPointerMove),r.add(e.doc,"mouseup",e.onPointerUp),e.target.isPointerEmitter=!0,n}},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.pointerdown=t.pointerdown,r.Gesture._gestureHandlers.pointermove=t.pointermove,r.Gesture._gestureHandlers.pointerup=t.pointerup,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.shake=function(t){var e={gesture:"devicemotion",acceleration:{},accelerationIncludingGravity:{},target:t.target,listener:t.listener,remove:function(){window.removeEventListener("devicemotion",o,!1)}},i=(new Date).getTime(),n={x:0,y:0,z:0},r={x:{count:0,value:0},y:{count:0,value:0},z:{count:0,value:0}},o=function(o){var s=o.accelerationIncludingGravity;if(n.x=.8*n.x+(1-.8)*s.x,n.y=.8*n.y+(1-.8)*s.y,n.z=.8*n.z+(1-.8)*s.z,e.accelerationIncludingGravity=n,e.acceleration.x=s.x-n.x,e.acceleration.y=s.y-n.y,e.acceleration.z=s.z-n.z,"devicemotion"!==t.gesture)for(var a=(new Date).getTime(),l=0,c="xyz".length;l<c;l++){var h="xyz"[l],u=e.acceleration[h],d=r[h],f=Math.abs(u);if(!(a-i<1e3)&&f>4){var g=a*u/f,p=Math.abs(g+d.value);d.value&&p<200?(d.value=g,d.count++,3===d.count&&(t.listener(o,e),i=a,d.value=0,d.count=0)):(d.value=g,d.count=1)}}else t.listener(o,e)};if(window.addEventListener)return window.addEventListener("devicemotion",o,!1),e},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.shake=t.shake,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";var e=Math.PI/180;return t.swipe=function(i){i.snap=i.snap||90,i.threshold=i.threshold||1,i.gesture=i.gesture||"swipe",i.onPointerDown=function(e){t.pointerStart(e,n,i)&&(r.add(i.doc,"mousemove",i.onPointerMove).listener(e),r.add(i.doc,"mouseup",i.onPointerUp))},i.onPointerMove=function(e){for(var n=e.changedTouches||t.getCoords(e),r=n.length,o=0;o<r;o++){var s=n[o],a=s.identifier||1/0,l=i.tracker[a];l&&(l.move.x=s.pageX,l.move.y=s.pageY,l.moveTime=(new Date).getTime())}}
3,i.onPointerUp=function(o){if(t.pointerEnd(o,n,i)){var s,a;r.remove(i.doc,"mousemove",i.onPointerMove),r.remove(i.doc,"mouseup",i.onPointerUp);var l={x:0,y:0},c=0,h=0,u=0;for(var d in i.tracker){var f=i.tracker[d],g=f.move.x-f.start.x,p=f.move.y-f.start.y;c+=f.move.x,h+=f.move.y,l.x+=f.start.x,l.y+=f.start.y,u++;var m=Math.sqrt(g*g+p*p),v=f.moveTime-f.startTime,w=Math.atan2(g,p)/e+180,y=v?m/v:0;if(void 0===a)a=w,s=y;else{if(!(Math.abs(w-a)<=20))return;a=(a+w)/2,s=(s+y)/2}}var b=i.gestureFingers;i.minFingers<=b&&i.maxFingers>=b&&s>i.threshold&&(l.x/=u,l.y/=u,n.start=l,n.x=c/u,n.y=h/u,n.angle=-(((a/i.snap+.5>>0)*i.snap||360)-360),n.velocity=s,n.fingers=b,n.state="swipe",i.listener(o,n))}};var n=t.pointerSetup(i);return r.add(i.target,"mousedown",i.onPointerDown),n},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.swipe=t.swipe,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.longpress=function(e){return e.gesture="longpress",t.tap(e)},t.tap=function(e){var i,n;e.delay=e.delay||500,e.timeout=e.timeout||250,e.driftDeviance=e.driftDeviance||10,e.gesture=e.gesture||"tap",e.onPointerDown=function(s){if(t.pointerStart(s,o,e)){if(i=(new Date).getTime(),r.add(e.doc,"mousemove",e.onPointerMove).listener(s),r.add(e.doc,"mouseup",e.onPointerUp),"longpress"!==e.gesture)return;n=setTimeout(function(){if(!(s.cancelBubble&&++s.cancelBubbleCount>1)){var t=0;for(var i in e.tracker){var n=e.tracker[i];if(!0===n.end)return;if(e.cancel)return;t++}e.minFingers<=t&&e.maxFingers>=t&&(o.state="start",o.fingers=t,o.x=n.start.x,o.y=n.start.y,e.listener(s,o))}},e.delay)}},e.onPointerMove=function(i){for(var n=e.bbox,o=i.changedTouches||t.getCoords(i),s=o.length,a=0;a<s;a++){var l=o[a],c=l.identifier||1/0,h=e.tracker[c];if(h){var u=l.pageX-n.x1,d=l.pageY-n.y1,f=u-h.start.x,g=d-h.start.y,p=Math.sqrt(f*f+g*g);if(!(u>0&&u<n.width&&d>0&&d<n.height&&p<=e.driftDeviance))return r.remove(e.doc,"mousemove",e.onPointerMove),void(e.cancel=!0)}}},e.onPointerUp=function(s){if(t.pointerEnd(s,o,e)){if(clearTimeout(n),r.remove(e.doc,"mousemove",e.onPointerMove),r.remove(e.doc,"mouseup",e.onPointerUp),s.cancelBubble&&++s.cancelBubbleCount>1)return;if("longpress"===e.gesture)return void("start"===o.state&&(o.state="end",e.listener(s,o)));if(e.cancel)return;if((new Date).getTime()-i>e.timeout)return;var a=e.gestureFingers;e.minFingers<=a&&e.maxFingers>=a&&(o.state="tap",o.fingers=e.gestureFingers,e.listener(s,o))}};var o=t.pointerSetup(e);return r.add(e.target,"mousedown",e.onPointerDown),o},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.tap=t.tap,r.Gesture._gestureHandlers.longpress=t.longpress,t}(r.proxy),void 0===r)r={};if(void 0===r.proxy&&(r.proxy={}),r.proxy=function(t){"use strict";return t.wheelPreventElasticBounce=function(t){t&&("string"==typeof t&&(t=document.querySelector(t)),r.add(t,"wheel",function(t,e){e.preventElasticBounce(),r.stop(t)}))},t.wheel=function(t){var e,i=t.timeout||150,n=0,o={gesture:"wheel",state:"start",wheelDelta:0,target:t.target,listener:t.listener,preventElasticBounce:function(t){var e=this.target,i=e.scrollTop;i+e.offsetHeight===e.scrollHeight&&this.wheelDelta<=0?r.cancel(t):0===i&&this.wheelDelta>=0&&r.cancel(t),r.stop(t)},add:function(){t.target[a](c,s,!1)},remove:function(){t.target[l](c,s,!1)}},s=function(r){r=r||window.event,o.state=n++?"change":"start",o.wheelDelta=r.detail?-20*r.detail:r.wheelDelta,t.listener(r,o),clearTimeout(e),e=setTimeout(function(){n=0,o.state="end",o.wheelDelta=0,t.listener(r,o)},i)},a=document.addEventListener?"addEventListener":"attachEvent",l=document.removeEventListener?"removeEventListener":"detachEvent",c=r.getEventSupport("mousewheel")?"mousewheel":"DOMMouseScroll";return t.target[a](c,s,!1),o},r.Gesture=r.Gesture||{},r.Gesture._gestureHandlers=r.Gesture._gestureHandlers||{},r.Gesture._gestureHandlers.wheel=t.wheel,t}(r.proxy),void 0===o)var o={};function s(t,e){var i=t.canvas,n=e.targetCanvas,r=n.getContext("2d");r.translate(0,n.height),r.scale(1,-1);var o=i.height-n.height;r.drawImage(i,0,o,n.width,n.height,0,0,n.width,n.height)}function a(t,e){var i=e.targetCanvas.getContext("2d"),n=e.destinationWidth,r=e.destinationHeight,o=n*r*4,s=new Uint8Array(this.imageBuffer,0,o),a=new Uint8ClampedArray(this.imageBuffer,0,o);t.readPixels(0,0,n,r,t.RGBA,t.UNSIGNED_BYTE,s);var l=new ImageData(a,n,r);i.putImageData(l,0,0)}void 0===o.proxy&&(o.proxy={}),o.proxy=function(t){"use strict";return t.orientation=function(t){var e={gesture:"orientationchange",previous:null,current:window.orientation,target:t.target,listener:t.listener,remove:function(){window.removeEventListener("orientationchange",i,!1)}},i=function(i){e.previous=e.current,e.current=window.orientation,null===e.previous||e.previous==e.current||t.listener(i,e)};return window.DeviceOrientationEvent&&window.addEventListener("orientationchange",i,!1),e},o.Gesture=o.Gesture||{},o.Gesture._gestureHandlers=o.Gesture._gestureHandlers||{},o.Gesture._gestureHandlers.orientation=t.orientation,t}(o.proxy),function(){function t(t,e){if(this.__eventListeners[t]){var i=this.__eventListeners[t];e?i[i.indexOf(e)]=!1:n.util.array.fill(i,!1)}}function e(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}function i(e,i){if(this.__eventListeners){if(0===arguments.length)for(e in this.__eventListeners)t.call(this,e);else if(1===arguments.length&&"object"==typeof arguments[0])for(var n in e)t.call(this,n,e[n]);else t.call(this,e,i);return this}}function r(t,e){if(this.__eventListeners){var i=this.__eventListeners[t];if(i){for(var n=0,r=i.length;n<r;n++)i[n]&&i[n].call(this,e||{});return this.__eventListeners[t]=i.filter(function(t){return!1!==t}),this}}}n.Observable={observe:e,stopObserving:i,fire:r,on:e,off:i,trigger:r}}(),n.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}
vendor: 4,133 bytes, line 3
3,insertAt:function(t,e,i){var n=this.getObjects();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.getObjects(),i=!1,n=0,r=arguments.length;n<r;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,r=i.length;n<r;n++)t.call(e,i[n],n,i);return this},getObjects:function(t){return void 0===t?this._objects:this._objects.filter(function(e){return e.type===t})},item:function(t){return this.getObjects()[t]},isEmpty:function(){return 0===this.getObjects().length},size:function(){return this.getObjects().length},contains:function(t){return this.getObjects().indexOf(t)>-1},complexity:function(){return this.getObjects().reduce(function(t,e){return t+=e.complexity?e.complexity():0},0)}},n.CommonMethods={_setOptions:function(t){for(var e in t)this.set(e,t[e])},_initGradient:function(t,e){!t||!t.colorStops||t instanceof n.Gradient||this.set(e,new n.Gradient(t))},_initPattern:function(t,e,i){!t||!t.source||t instanceof n.Pattern?i&&i():this.set(e,new n.Pattern(t,i))},_initClipping:function(t){if(t.clipTo&&"string"==typeof t.clipTo){var e=n.util.getFunctionBody(t.clipTo);void 0!==e&&(this.clipTo=new Function("ctx",e))}},_setObject:function(t){for(var e in t)this._set(e,t[e])},set:function(t,e){return"object"==typeof t?this._setObject(t):"function"==typeof e&&"clipTo"!==t?this._set(t,e(this.get(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]}},function(t){var e=Math.sqrt,i=Math.atan2,r=Math.pow,o=Math.abs,s=Math.PI/180,a=Math.PI/2;n.util={cos:function(t){if(0===t)return 1;switch(t<0&&(t=-t),t/a){case 1:case 3:return 0;case 2:return-1}return Math.cos(t)},sin:function(t){if(0===t)return 0;var e=1;switch(t<0&&(e=-1),t/a){case 1:return e;case 2:return 0;case 3:return-e}return Math.sin(t)},removeFromArray:function(t,e){var i=t.indexOf(e);return-1!==i&&t.splice(i,1),t},getRandomInt:function(t,e){return Math.floor(Math.random()*(e-t+1))+t},degreesToRadians:function(t){return t*s},radiansToDegrees:function(t){return t/s},rotatePoint:function(t,e,i){t.subtractEquals(e);var r=n.util.rotateVector(t,i);return new n.Point(r.x,r.y).addEquals(e)},rotateVector:function(t,e){var i=n.util.sin(e),r=n.util.cos(e);return{x:t.x*r-t.y*i,y:t.x*i+t.y*r}},transformPoint:function(t,e,i){return i?new n.Point(e[0]*t.x+e[2]*t.y,e[1]*t.x+e[3]*t.y):new n.Point(e[0]*t.x+e[2]*t.y+e[4],e[1]*t.x+e[3]*t.y+e[5])},makeBoundingBoxFromPoints:function(t){var e=[t[0].x,t[1].x,t[2].x,t[3].x],i=n.util.array.min(e),r=n.util.array.max(e)-i,o=[t[0].y,t[1].y,t[2].y,t[3].y],s=n.util.array.min(o);return{left:i,top:s,width:r,height:n.util.array.max(o)-s}},invertTransform:function(t){var e=1/(t[0]*t[3]-t[1]*t[2]),i=[e*t[3],-e*t[1],-e*t[2],e*t[0]],r=n.util.transformPoint({x:t[4],y:t[5]},i,!0);return i[4]=-r.x,i[5]=-r.y,i},toFixed:function(t,e){return parseFloat(Number(t).toFixed(e))},parseUnit:function(t,e){var i=/\D{0,2}$/.exec(t),r=parseFloat(t);switch(e||(e=n.Text.DEFAULT_SVG_FONT_SIZE),i[0]){case"mm":return r*n.DPI/25.4;case"cm":return r*n.DPI/2.54;case"in":return r*n.DPI;case"pt":return r*n.DPI/72;case"pc":return r*n.DPI/72*12;case"em":return r*e;default:return r}},falseFunction:function(){return!1},getKlass:function(t,e){return t=n.util.string.camelize(t.charAt(0).toUpperCase()+t.slice(1)),n.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(e){if(!e)return n;var i,r=e.split("."),o=r.length,s=t||n.window;for(i=0;i<o;++i)s=s[r[i]];return s}
vendor: 5,273 bytes, line 3
3,loadImage:function(t,e,i,r){if(t){var o=n.util.createImage(),s=function(){e&&e.call(i,o),o=o.onload=o.onerror=null};o.onload=s,o.onerror=function(){n.log("Error loading "+o.src),e&&e.call(i,null,!0),o=o.onload=o.onerror=null},0!==t.indexOf("data")&&r&&(o.crossOrigin=r),"data:image/svg"===t.substring(0,14)&&(o.onload=null,n.util.loadImageInDom(o,s)),o.src=t}else e&&e.call(i,t)},loadImageInDom:function(t,e){var i=n.document.createElement("div");i.style.width=i.style.height="1px",i.style.left=i.style.top="-100%",i.style.position="absolute",i.appendChild(t),n.document.querySelector("body").appendChild(i),t.onload=function(){e(),i.parentNode.removeChild(i),i=null}},enlivenObjects:function(t,e,i,r){function o(){++a===l&&e&&e(s)}var s=[],a=0,l=(t=t||[]).length;l?t.forEach(function(t,e){t&&t.type?n.util.getKlass(t.type,i).fromObject(t,function(i,n){n||(s[e]=i),r&&r(t,i,n),o()}):o()}):e&&e(s)},enlivenPatterns:function(t,e){function i(){++o===s&&e&&e(r)}var r=[],o=0,s=(t=t||[]).length;s?t.forEach(function(t,e){t&&t.source?new n.Pattern(t,function(t){r[e]=t,i()}):(r[e]=t,i())}):e&&e(r)},groupSVGElements:function(t,e,i){var r;return 1===t.length?t[0]:(e&&(e.width&&e.height?e.centerPoint={x:e.width/2,y:e.height/2}:(delete e.width,delete e.height)),r=new n.Group(t,e),void 0!==i&&(r.sourcePath=i),r)},populateWithProperties:function(t,e,i){if(i&&"[object Array]"===Object.prototype.toString.call(i))for(var n=0,r=i.length;n<r;n++)i[n]in t&&(e[i[n]]=t[i[n]])},drawDashedLine:function(t,n,r,o,s,a){var l=o-n,c=s-r,h=e(l*l+c*c),u=i(c,l),d=a.length,f=0,g=!0;for(t.save(),t.translate(n,r),t.moveTo(0,0),t.rotate(u),n=0;h>n;)(n+=a[f++%d])>h&&(n=h),t[g?"lineTo":"moveTo"](n,0),g=!g;t.restore()},createCanvasElement:function(){return n.document.createElement("canvas")},createImage:function(){return n.document.createElement("img")},clipContext:function(t,e){e.save(),e.beginPath(),t.clipTo(e),e.clip()},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 n=i(t[1],t[0]),o=r(t[0],2)+r(t[1],2),a=e(o),l=(t[0]*t[3]-t[2]*t[1])/a,c=i(t[0]*t[2]+t[1]*t[3],o);return{angle:n/s,scaleX:a,scaleY:l,skewX:c/s,skewY:0,translateX:t[4],translateY:t[5]}},customTransformMatrix:function(t,e,i){var r=[1,0,o(Math.tan(i*s)),1],a=[o(t),0,0,o(e)];return n.util.multiplyTransformMatrices(a,r,!0)},resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.flipX=!1,t.flipY=!1,t.rotate(0)},getFunctionBody:function(t){return(String(t).match(/function[^{]*\{([\s\S]*)\}/)||{})[1]},isTransparent:function(t,e,i,n){n>0&&(e>n?e-=n:e=0,i>n?i-=n:i=0);var r,o=!0,s=t.getImageData(e,i,2*n||1,2*n||1),a=s.data.length;for(r=3;r<a&&!1!==(o=s.data[r]<=0);r+=4);return s=null,o},parsePreserveAspectRatioAttribute:function(t){var e,i="meet",n=t.split(" ");return n&&n.length&&("meet"!==(i=n.pop())&&"slice"!==i?(e=i,i="meet"):n.length&&(e=n.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())?n.charWidthsCache[t]&&delete n.charWidthsCache[t]:n.charWidthsCache={}},limitDimsByArea:function(t,e){var i=Math.sqrt(e*t),n=Math.floor(e/i);return{x:Math.floor(i),y:n}},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)}}}(e),function(){var t={},e={},i={},r=Array.prototype.join;function o(e,i,o,l,c,h,u){var d=r.call(arguments);if(t[d])return t[d];var f=Math.PI,g=u*f/180,p=n.util.sin(g),m=n.util.cos(g),v=0,w=0,y=-m*e*.5-p*i*.5,b=-m*i*.5+p*e*.5,x=(o=Math.abs(o))*o,_=(l=Math.abs(l))*l,C=b*b,S=y*y,T=x*_-x*C-_*S,O=0;if(T<0){var k=Math.sqrt(1-T/(x*_));o*=k,l*=k}else O=(c===h?-1:1)*Math.sqrt(T/(x*C+_*S));var E=O*o*b/l,A=-O*l*y/o,P=m*E-p*A+.5*e,D=p*E+m*A+.5*i,M=a(1,0,(y-E)/o,(b-A)/l),j=a((y-E)/o,(b-A)/l,(-y-E)/o,(-b-A)/l);0===h&&j>0?j-=2*f:1===h&&j<0&&(j+=2*f);for(var L=Math.ceil(Math.abs(j/f*2)),F=[],I=j/L,B=8/3*Math.sin(I/4)*Math.sin(I/4)/Math.sin(I/2),R=M+I,Y=0;Y<L;Y++)F[Y]=s(M,R,m,p,o,l,P,D,B,v,w),v=F[Y][4],w=F[Y][5],M=R,R+=I;return t[d]=F,F}function s(t,i,o,s,a,l,c,h,u,d,f){var g=r.call(arguments);if(e[g])return e[g];var p=n.util.cos(t),m=n.util.sin(t),v=n.util.cos(i),w=n.util.sin(i),y=o*a*v-s*l*w+c,b=s*a*v+o*l*w+h,x=d+u*(-o*a*m-s*l*p),_=f+u*(-s*a*m+o*l*p),C=y+u*(o*a*w+s*l*v),S=b+u*(s*a*w-o*l*v);return e[g]=[x,_,C,S,y,b],e[g]}function a(t,e,i,n){var r=Math.atan2(e,t),o=Math.atan2(n,i);return o>=r?o-r:2*Math.PI-(r-o)}function l(t,e,n,o,s,a,l,c){var h=r.call(arguments);if(i[h])return i[h];var u,d,f,g,p,m,v,w,y=Math.sqrt,b=Math.min,x=Math.max,_=Math.abs,C=[],S=[[],[]];d=6*t-12*n+6*s,u=-3*t+9*n-9*s+3*l,f=3*n-3*t;for(var T=0;T<2;++T)if(T>0&&(d=6*e-12*o+6*a,u=-3*e+9*o-9*a+3*c,f=3*o-3*e),_(u)<1e-12){if(_(d)<1e-12)continue;0<(g=-f/d)&&g<1&&C.push(g)}else(v=d*d-4*f*u)<0||(0<(p=(-d+(w=y(v)))/(2*u))&&p<1&&C.push(p),0<(m=(-d-w)/(2*u))&&m<1&&C.push(m));for(var O,k,E,A=C.length,P=A;A--;)O=(E=1-(g=C[A]))*E*E*t+3*E*E*g*n+3*E*g*g*s+g*g*g*l,S[0][A]=O,k=E*E*E*e+3*E*E*g*o+3*E*g*g*a+g*g*g*c,S[1][A]=k;S[0][P]=t,S[1][P]=e,S[0][P+1]=l,S[1][P+1]=c;
3var D=[{x:b.apply(null,S[0]),y:b.apply(null,S[1])},{x:x.apply(null,S[0]),y:x.apply(null,S[1])}];return i[h]=D,D}n.util.drawArc=function(t,e,i,n){for(var r=n[0],s=n[1],a=n[2],l=n[3],c=n[4],h=[[],[],[],[]],u=o(n[5]-e,n[6]-i,r,s,l,c,a),d=0,f=u.length;d<f;d++)h[d][0]=u[d][0]+e,h[d][1]=u[d][1]+i,h[d][2]=u[d][2]+e,h[d][3]=u[d][3]+i,h[d][4]=u[d][4]+e,h[d][5]=u[d][5]+i,t.bezierCurveTo.apply(t,h[d])},n.util.getBoundsOfArc=function(t,e,i,n,r,s,a,c,h){for(var u,d=0,f=0,g=[],p=o(c-t,h-e,i,n,s,a,r),m=0,v=p.length;m<v;m++)u=l(d,f,p[m][0],p[m][1],p[m][2],p[m][3],p[m][4],p[m][5]),g.push({x:u[0].x+t,y:u[0].y+e}),g.push({x:u[1].x+t,y:u[1].y+e}),d=p[m][4],f=p[m][5];return g},n.util.getBoundsOfCurve=l}(),function(){var t=Array.prototype.slice;function e(t,e,i){if(t&&0!==t.length){var n=t.length-1,r=e?t[n][e]:t[n];if(e)for(;n--;)i(t[n][e],r)&&(r=t[n][e]);else for(;n--;)i(t[n],r)&&(r=t[n]);return r}}n.util.array={fill:function(t,e){for(var i=t.length;i--;)t[i]=e;return t},invoke:function(e,i){for(var n=t.call(arguments,2),r=[],o=0,s=e.length;o<s;o++)r[o]=n.length?e[o][i].apply(e[o],n):e[o][i].call(e[o]);return r},min:function(t,i){return e(t,i,function(t,e){return t<e})},max:function(t,i){return e(t,i,function(t,e){return t>=e})}}}(),function(){function t(e,i,r){if(r)if(!n.isLikelyNode&&i instanceof Element)e=i;else if(i instanceof Array){e=[];for(var o=0,s=i.length;o<s;o++)e[o]=t({},i[o],r)}else if(i&&"object"==typeof i)for(var a in i)i.hasOwnProperty(a)&&(e[a]=t({},i[a],r));else e=i;else for(var a in i)e[a]=i[a];return e}n.util.object={extend:t,clone:function(e,i){return t({},e,i)}},n.util.object.extend(n.util,n.Observable)}(),function(){function t(t,e){var i=t.charCodeAt(e);if(isNaN(i))return"";if(i<55296||i>57343)return t.charAt(e);if(55296<=i&&i<=56319){if(t.length<=e+1)throw"High surrogate without following low surrogate";var n=t.charCodeAt(e+1);if(56320>n||n>57343)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";var r=t.charCodeAt(e-1);if(55296>r||r>56319)throw"Low surrogate without preceding high surrogate";return!1}n.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,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")},graphemeSplit:function(e){var i,n=0,r=[];for(n=0;n<e.length;n++)!1!==(i=t(e,n))&&r.push(i);return r}}}(),function(){var t=Array.prototype.slice,e=function(){},i=function(){for(var t in{toString:1})if("toString"===t)return!1;return!0}(),r=function(t,e,n){for(var r in e)r in t.prototype&&"function"==typeof t.prototype[r]&&(e[r]+"").indexOf("callSuper")>-1?t.prototype[r]=function(t){return function(){var i=this.constructor.superclass;this.constructor.superclass=n;var r=e[t].apply(this,arguments);if(this.constructor.superclass=i,"initialize"!==t)return r}}(r):t.prototype[r]=e[r],i&&(e.toString!==Object.prototype.toString&&(t.prototype.toString=e.toString),e.valueOf!==Object.prototype.valueOf&&(t.prototype.valueOf=e.valueOf))};function o(){}function s(e){for(var i=null,n=this;n.constructor.superclass;){var r=n.constructor.superclass.prototype[e];if(n[e]!==r){i=r;break}n=n.constructor.superclass.prototype}return i?arguments.length>1?i.apply(this,t.call(arguments,1)):i.call(this):console.log("tried to callSuper "+e+", method not found in prototype chain",this)}n.util.createClass=function(){var i=null,n=t.call(arguments,0);function a(){this.initialize.apply(this,arguments)}"function"==typeof n[0]&&(i=n.shift()),a.superclass=i,a.subclasses=[],i&&(o.prototype=i.prototype,a.prototype=new o,i.subclasses.push(a));for(var l=0,c=n.length;l<c;l++)r(a,n[l],i);return a.prototype.initialize||(a.prototype.initialize=e),a.prototype.constructor=a,a.prototype.callSuper=s,a}}(),function(){var t="unknown";function e(t){var e,i,n=Array.prototype.slice.call(arguments,1),r=n.length;for(i=0;i<r;i++)if(e=typeof t[n[i]],!/^(?:function|object|unknown)$/.test(e))return!1;return!0}var i,r,o=function(){var t=0;return function(e){return e.__uniqueID||(e.__uniqueID="uniqueID__"+t++)}}();function s(t,e){return{handler:e,wrappedHandler:function(t,e){return function(r){e.call(i(t),r||n.window.event)}}(t,e)}}!function(){var t={};i=function(e){return t[e]},r=function(e,i){t[e]=i}}();var a,l,c=e(n.document.documentElement,"addEventListener","removeEventListener")&&e(n.window,"addEventListener","removeEventListener"),h=e(n.document.documentElement,"attachEvent","detachEvent")&&e(n.window,"attachEvent","detachEvent"),u={},d={};
vendor: 8,375 bytes, line 3
3c?(a=function(t,e,i,n){t&&t.addEventListener(e,i,!h&&n)},l=function(t,e,i,n){t&&t.removeEventListener(e,i,!h&&n)}):h?(a=function(t,e,i){if(t){var n=o(t);r(n,t),u[n]||(u[n]={}),u[n][e]||(u[n][e]=[]);var a=s(n,i);u[n][e].push(a),t.attachEvent("on"+e,a.wrappedHandler)}},l=function(t,e,i){if(t){var n,r=o(t);if(u[r]&&u[r][e])for(var s=0,a=u[r][e].length;s<a;s++)(n=u[r][e][s])&&n.handler===i&&(t.detachEvent("on"+e,n.wrappedHandler),u[r][e][s]=null)}}):(a=function(t,e,i){if(t){var r=o(t);if(d[r]||(d[r]={}),!d[r][e]){d[r][e]=[];var s=t["on"+e];s&&d[r][e].push(s),t["on"+e]=function(t,e){return function(i){if(d[t]&&d[t][e])for(var r=d[t][e],o=0,s=r.length;o<s;o++)r[o].call(this,i||n.window.event)}}(r,e)}d[r][e].push(i)}},l=function(t,e,i){if(t){var n=o(t);if(d[n]&&d[n][e])for(var r=d[n][e],s=0,a=r.length;s<a;s++)r[s]===i&&r.splice(s,1)}}),n.util.addListener=a,n.util.removeListener=l;var f=function(t){return t.clientX},g=function(t){return t.clientY};function p(t,e,i){var n,r=t["touchend"===t.type?"changedTouches":"touches"];return r&&r[0]&&(n=r[0][i]),void 0===n&&(n=t[i]),n}n.isTouchSupported&&(f=function(t){return p(t,0,"clientX")},g=function(t){return p(t,0,"clientY")}),n.util.getPointer=function(e){e||(e=n.window.event);var i=e.target||(typeof e.srcElement!==t?e.srcElement:null),r=n.util.getScrollLeftTop(i);return{x:f(e)+r.left,y:g(e)+r.top}}}(),function(){var t=n.document.createElement("div"),e="string"==typeof t.style.opacity,i="string"==typeof t.style.filter,r=/alpha\s*\(\s*opacity\s*=\s*([^\)]+)\)/,o=function(t){return t};e?o=function(t,e){return t.style.opacity=e,t}:i&&(o=function(t,e){var i=t.style;return t.currentStyle&&!t.currentStyle.hasLayout&&(i.zoom=1),r.test(i.filter)?(e=e>=.9999?"":"alpha(opacity="+100*e+")",i.filter=i.filter.replace(r,e)):i.filter+=" alpha(opacity="+100*e+")",t}),n.util.setStyle=function(t,e){var i=t.style;if(!i)return t;if("string"==typeof e)return t.style.cssText+=";"+e,e.indexOf("opacity")>-1?o(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]):t;for(var n in e)"opacity"===n?o(t,e[n]):i["float"===n||"cssFloat"===n?void 0===i.styleFloat?"cssFloat":"styleFloat":n]=e[n];return t}}(),function(){var t=Array.prototype.slice;var e,i,r=function(e){return t.call(e,0)};try{e=r(n.document.childNodes)instanceof Array}catch(t){}function o(t,e){var i=n.document.createElement(t);for(var r in e)"class"===r?i.className=e[r]:"for"===r?i.htmlFor=e[r]:i.setAttribute(r,e[r]);return i}function s(t){for(var e=0,i=0,r=n.document.documentElement,o=n.document.body||{scrollLeft:0,scrollTop:0};t&&(t.parentNode||t.host)&&((t=t.parentNode||t.host)===n.document?(e=o.scrollLeft||r.scrollLeft||0,i=o.scrollTop||r.scrollTop||0):(e+=t.scrollLeft||0,i+=t.scrollTop||0),1!==t.nodeType||"fixed"!==t.style.position););return{left:e,top:i}}e||(r=function(t){for(var e=new Array(t.length),i=t.length;i--;)e[i]=t[i];return e}),i=n.document.defaultView&&n.document.defaultView.getComputedStyle?function(t,e){var i=n.document.defaultView.getComputedStyle(t,null);return i?i[e]:void 0}:function(t,e){var i=t.style[e];return!i&&t.currentStyle&&(i=t.currentStyle[e]),i},function(){var t=n.document.documentElement.style,e="userSelect"in t?"userSelect":"MozUserSelect"in t?"MozUserSelect":"WebkitUserSelect"in t?"WebkitUserSelect":"KhtmlUserSelect"in t?"KhtmlUserSelect":"";n.util.makeElementUnselectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=n.util.falseFunction),e?t.style[e]="none":"string"==typeof t.unselectable&&(t.unselectable="on"),t},n.util.makeElementSelectable=function(t){return void 0!==t.onselectstart&&(t.onselectstart=null),e?t.style[e]="":"string"==typeof t.unselectable&&(t.unselectable=""),t}}(),function(){n.util.getScript=function(t,e){var i=n.document.getElementsByTagName("head")[0],r=n.document.createElement("script"),o=!0;r.onload=r.onreadystatechange=function(t){if(o){if("string"==typeof this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)return;o=!1,e(t||n.window.event),r=r.onload=r.onreadystatechange=null}},r.src=t,i.appendChild(r)}}(),n.util.getById=function(t){return"string"==typeof t?n.document.getElementById(t):t},n.util.toArray=r,n.util.makeElement=o,n.util.addClass=function(t,e){t&&-1===(" "+t.className+" ").indexOf(" "+e+" ")&&(t.className+=(t.className?" ":"")+e)},n.util.wrapElement=function(t,e,i){return"string"==typeof e&&(e=o(e,i)),t.parentNode&&t.parentNode.replaceChild(e,t),e.appendChild(t),e},n.util.getScrollLeftTop=s,n.util.getElementOffset=function(t){var e,n,r=t&&t.ownerDocument,o={left:0,top:0},a={left:0,top:0},l={borderLeftWidth:"left",borderTopWidth:"top",paddingLeft:"left",paddingTop:"top"};if(!r)return a;for(var c in l)a[l[c]]+=parseInt(i(t,c),10)||0;return e=r.documentElement,void 0!==t.getBoundingClientRect&&(o=t.getBoundingClientRect()),n=s(t),{left:o.left+n.left-(e.clientLeft||0)+a.left,top:o.top+n.top-(e.clientTop||0)+a.top}},n.util.getElementStyle=i,n.util.getNodeCanvas=function(t){var e=n.jsdomImplForWrapper(t);return e._canvas||e._image}}(),function(){var t=function(){for(var t=[function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml2.XMLHTTP.3.0")},function(){return new XMLHttpRequest}],e=t.length;e--;)try{if(t[e]())return t[e]}catch(t){}}();function e(){}n.util.request=function(i,n){n||(n={});var r=n.method?n.method.toUpperCase():"GET",o=n.onComplete||function(){},s=t(),a=n.body||n.parameters;return s.onreadystatechange=function(){4===s.readyState&&(o(s),s.onreadystatechange=e)},"GET"===r&&(a=null,"string"==typeof n.parameters&&(i=function(t,e){return t+(/\?/.test(t)?"&":"?")+e}(i,n.parameters))),s.open(r,i,!0),"POST"!==r&&"PUT"!==r||s.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),s.send(a),s}}(),n.log=function(){},n.warn=function(){},"undefined"!=typeof console&&["log","warn"].forEach(function(t){void 0!==console[t]&&"function"==typeof console[t].apply&&(n[t]=function(){return console[t].apply(console,arguments)})}),function(){function t(){return!1}var e=n.window.requestAnimationFrame||n.window.webkitRequestAnimationFrame||n.window.mozRequestAnimationFrame||n.window.oRequestAnimationFrame||n.window.msRequestAnimationFrame||function(t){return n.window.setTimeout(t,1e3/60)},i=n.window.cancelAnimationFrame||n.window.clearTimeout;function r(){return e.apply(n.window,arguments)}n.util.animate=function(e){r(function(i){e||(e={});var n,o=i||+new Date,s=e.duration||500,a=o+s,l=e.onChange||t,c=e.abort||t,h=e.onComplete||t,u=e.easing||function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},d="startValue"in e?e.startValue:0,f="endValue"in e?e.endValue:100,g=e.byValue||f-d;e.onStart&&e.onStart(),function t(i){if(c())h(f,1,1);else{var p=(n=i||+new Date)>a?s:n-o,m=p/s,v=u(p,d,g,s),w=Math.abs((v-d)/g);l(v,w,m),n>a?e.onComplete&&e.onComplete():r(t)}}(o)})},n.util.requestAnimFrame=r,n.util.cancelAnimFrame=function(){return i.apply(n.window,arguments)}}(),function(){n.util.animateColor=function(t,e,i,r){var o=new n.Color(t).getSource(),s=new n.Color(e).getSource();r=r||{},n.util.animate(n.util.object.extend(r,{duration:i||500,startValue:o,endValue:s,byValue:s,easing:function(t,e,i,n){return function(t,e,i){var n="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);return n+=","+(t&&e?parseFloat(t[3]+i*(e[3]-t[3])):1),n+=")"}(e,i,r.colorEasing?r.colorEasing(t,n):1-Math.cos(t/n*(Math.PI/2)))}}))}}(),function(){function t(t,e,i,n){return t<Math.abs(e)?(t=e,n=i/4):n=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 e(t,e,i){return t.a*Math.pow(2,10*(e-=1))*Math.sin((e*i-t.s)*(2*Math.PI)/t.p)}function i(t,e,i,n){return i-r(n-t,0,i,n)+e}function r(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}n.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}
vendor: 4,221 bytes, line 3
3,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(i,n,r,o){var s=0;return 0===i?n:1==(i/=o)?n+r:(s||(s=.3*o),-e(t(r,r,s,1.70158),i,o)+n)},easeOutElastic:function(e,i,n,r){var o=0,s=n;if(0===e)return i;if(1==(e/=r))return i+n;o||(o=.3*r);var a=t(s,n,o,1.70158);return a.a*Math.pow(2,-10*e)*Math.sin((e*r-a.s)*(2*Math.PI)/a.p)+a.c+i},easeInOutElastic:function(i,n,r,o){var s=0,a=r;if(0===i)return n;if(2==(i/=o/2))return n+r;s||(s=o*(.3*1.5));var l=t(a,r,s,1.70158);return i<1?-.5*e(l,i,o)+n:l.a*Math.pow(2,-10*(i-=1))*Math.sin((i*o-l.s)*(2*Math.PI)/l.p)*.5+l.c+n},easeInBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e},easeOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeInBounce:i,easeOutBounce:r,easeInOutBounce:function(t,e,n,o){return t<o/2?.5*i(2*t,0,n,o)+e:.5*r(2*t-o,0,n,o)+.5*n+e}}}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.parseUnit,s=e.util.multiplyTransformMatrices,a={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-linecap":"strokeLineCap","stroke-linejoin":"strokeLineJoin","stroke-miterlimit":"strokeMiterLimit","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","text-decoration":"textDecoration","text-anchor":"textAnchor",opacity:"opacity"},l={stroke:"strokeOpacity",fill:"fillOpacity"};function c(t){return t in a?a[t]:t}function h(t,i,n,r){var a,l="[object Array]"===Object.prototype.toString.call(i);if("fill"!==t&&"stroke"!==t||"none"!==i)if("strokeDashArray"===t)i="none"===i?null:i.replace(/,/g," ").split(/\s+/).map(function(t){return parseFloat(t)});else if("transformMatrix"===t)i=n&&n.transformMatrix?s(n.transformMatrix,e.parseTransformAttribute(i)):e.parseTransformAttribute(i);else if("visible"===t)i="none"!==i&&"hidden"!==i,n&&!1===n.visible&&(i=!1);else if("opacity"===t)i=parseFloat(i),n&&void 0!==n.opacity&&(i*=n.opacity);else if("textAnchor"===t)i="start"===i?"left":"end"===i?"right":"center";else if("charSpacing"===t)a=o(i,r)/r*1e3;else if("paintFirst"===t){var c=i.indexOf("fill"),h=i.indexOf("stroke");i="fill";c>-1&&h>-1&&h<c?i="stroke":-1===c&&h>-1&&(i="stroke")}else a=l?i.map(o):o(i,r);else i="";return!l&&isNaN(a)?i:a}function u(t){return new RegExp("^("+t.join("|")+")\\b","i")}function d(t,e){var i,n,r,o,s=[];for(r=0,o=e.length;r<o;r++)i=e[r],n=t.getElementsByTagName(i),s=s.concat(Array.prototype.slice.call(n));return s}function f(t,e){var i,n=!0;return(i=g(t,e.pop()))&&e.length&&(n=function(t,e){var i,n=!0;for(;t.parentNode&&1===t.parentNode.nodeType&&e.length;)n&&(i=e.pop()),t=t.parentNode,n=g(t,i);return 0===e.length}(t,e)),i&&n&&0===e.length}
vendor: 4,905 bytes, line 3
3function g(t,e){var i,n,r=t.nodeName,o=t.getAttribute("class"),s=t.getAttribute("id");if(i=new RegExp("^"+r,"i"),e=e.replace(i,""),s&&e.length&&(i=new RegExp("#"+s+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"")),o&&e.length)for(n=(o=o.split(" ")).length;n--;)i=new RegExp("\\."+o[n]+"(?![a-zA-Z\\-]+)","i"),e=e.replace(i,"");return 0===e.length}function p(t,e){var i;if(t.getElementById&&(i=t.getElementById(e)),i)return i;var n,r,o,s=t.getElementsByTagName("*");for(r=0,o=s.length;r<o;r++)if(e===(n=s[r]).getAttribute("id"))return n}e.svgValidTagNamesRegEx=u(["path","circle","polygon","polyline","ellipse","rect","line","image","text","linearGradient","radialGradient","stop"]),e.svgViewBoxElementsRegEx=u(["symbol","image","marker","pattern","view","svg"]),e.svgInvalidAncestorsRegEx=u(["pattern","defs","symbol","metadata","clipPath","mask","desc"]),e.svgValidParentsRegEx=u(["symbol","g","a","svg"]),e.cssRules={},e.gradientDefs={},e.parseTransformAttribute=function(){function t(t,i,n){t[n]=Math.tan(e.util.degreesToRadians(i[0]))}var i=[1,0,0,1,0,0],n=e.reNum,r="(?:\\s+,?\\s*|,\\s*)",o="(?:"+("(?:(matrix)\\s*\\(\\s*("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")"+r+"("+n+")\\s*\\))")+"|"+("(?:(translate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(scale)\\s*\\(\\s*("+n+")(?:"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(rotate)\\s*\\(\\s*("+n+")(?:"+r+"("+n+")"+r+"("+n+"))?\\s*\\))")+"|"+("(?:(skewX)\\s*\\(\\s*("+n+")\\s*\\))")+"|"+("(?:(skewY)\\s*\\(\\s*("+n+")\\s*\\))")+")",s=new RegExp("^\\s*(?:"+("(?:"+o+"(?:"+r+"*"+o+")*)")+"?)\\s*$"),a=new RegExp(o,"g");return function(n){var r=i.concat(),l=[];if(!n||n&&!s.test(n))return r;n.replace(a,function(n){var s=new RegExp(o).exec(n).filter(function(t){return!!t}),a=s[1],c=s.slice(2).map(parseFloat);switch(a){case"translate":!function(t,e){t[4]=e[0],2===e.length&&(t[5]=e[1])}(r,c);break;case"rotate":c[0]=e.util.degreesToRadians(c[0]),function(t,i){var n=e.util.cos(i[0]),r=e.util.sin(i[0]),o=0,s=0;3===i.length&&(o=i[1],s=i[2]),t[0]=n,t[1]=r,t[2]=-r,t[3]=n,t[4]=o-(n*o-r*s),t[5]=s-(r*o+n*s)}(r,c);break;case"scale":!function(t,e){var i=e[0],n=2===e.length?e[1]:e[0];t[0]=i,t[3]=n}(r,c);break;case"skewX":t(r,c,2);break;case"skewY":t(r,c,1);break;case"matrix":r=c}l.push(r.concat()),r=i.concat()});for(var c=l[0];l.length>1;)l.shift(),c=e.util.multiplyTransformMatrices(c,l[0]);return c}}();var m=new RegExp("^\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*,?\\s*("+e.reNum+"+)\\s*$");function v(t){var i,n,r,s,a,l,c=t.getAttribute("viewBox"),h=1,u=1,d=t.getAttribute("width"),f=t.getAttribute("height"),g=t.getAttribute("x")||0,p=t.getAttribute("y")||0,v=t.getAttribute("preserveAspectRatio")||"",w=!c||!e.svgViewBoxElementsRegEx.test(t.nodeName)||!(c=c.match(m)),y=!d||!f||"100%"===d||"100%"===f,b=w&&y,x={},_="",C=0,S=0;if(x.width=0,x.height=0,x.toBeParsed=b,b)return x;if(w)return x.width=o(d),x.height=o(f),x;if(i=-parseFloat(c[1]),n=-parseFloat(c[2]),r=parseFloat(c[3]),s=parseFloat(c[4]),y?(x.width=r,x.height=s):(x.width=o(d),x.height=o(f),h=x.width/r,u=x.height/s),"none"!==(v=e.util.parsePreserveAspectRatioAttribute(v)).alignX&&("meet"===v.meetOrSlice&&(u=h=h>u?u:h),"slice"===v.meetOrSlice&&(u=h=h>u?h:u),C=x.width-r*h,S=x.height-s*h,"Mid"===v.alignX&&(C/=2),"Mid"===v.alignY&&(S/=2),"Min"===v.alignX&&(C=0),"Min"===v.alignY&&(S=0)),1===h&&1===u&&0===i&&0===n&&0===g&&0===p)return x;if((g||p)&&(_=" translate("+o(g)+" "+o(p)+") "),a=_+" matrix("+h+" 0 0 "+u+" "+(i*h+C)+" "+(n*u+S)+") ","svg"===t.nodeName){for(l=t.ownerDocument.createElement("g");t.firstChild;)l.appendChild(t.firstChild);t.appendChild(l)}else a=(l=t).getAttribute("transform")+a;return l.setAttribute("transform",a),x}e.parseSVGDocument=function(t,i,r,o){if(t){!function(t){for(var e=d(t,["use","svg:use"]),i=0;e.length&&i<e.length;){var n,r,o,s,a=e[i],l=a.getAttribute("xlink:href").substr(1),c=a.getAttribute("x")||0,h=a.getAttribute("y")||0,u=p(t,l).cloneNode(!0),f=(u.getAttribute("transform")||"")+" translate("+c+", "+h+")",g=e.length;if(v(u),/^svg$/i.test(u.nodeName)){var m=u.ownerDocument.createElement("g");for(r=0,s=(o=u.attributes).length;r<s;r++)n=o.item(r),m.setAttribute(n.nodeName,n.nodeValue);for(;u.firstChild;)m.appendChild(u.firstChild);u=m}for(r=0,s=(o=a.attributes).length;r<s;r++)"x"!==(n=o.item(r)).nodeName&&"y"!==n.nodeName&&"xlink:href"!==n.nodeName&&("transform"===n.nodeName?f=n.nodeValue+" "+f:u.setAttribute(n.nodeName,n.nodeValue));u.setAttribute("transform",f),u.setAttribute("instantiated_by_use","1"),u.removeAttribute("id"),a.parentNode.replaceChild(u,a),e.length===g&&i++}}(t);var s,a,l=e.Object.__uid++,c=v(t),h=e.util.toArray(t.getElementsByTagName("*"));if(c.crossOrigin=o&&o.crossOrigin,c.svgUid=l,0===h.length&&e.isLikelyNode){var u=[];for(s=0,a=(h=t.selectNodes('//*[name(.)!="svg"]')).length;s<a;s++)u[s]=h[s];h=u}var f=h.filter(function(t){return v(t),e.svgValidTagNamesRegEx.test(t.no
vendor: 18,289 bytes, line 3
3deName.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!0;return!1}(t,e.svgInvalidAncestorsRegEx)});!f||f&&!f.length?i&&i([],{}):(e.gradientDefs[l]=e.getGradientDefs(t),e.cssRules[l]=e.getCSSRules(t),e.parseElements(f,function(t,e){i&&i(t,c,e,h)},n(c),r,o))}};var w=new RegExp("(normal|italic)?\\s*(normal|small-caps)?\\s*(normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900)?\\s*("+e.reNum+"(?:px|cm|mm|em|pt|pc|in)*)(?:\\/(normal|"+e.reNum+"))?\\s+(.*)");i(e,{parseFontDeclaration:function(t,e){var i=t.match(w);if(i){var n=i[1],r=i[3],s=i[4],a=i[5],l=i[6];n&&(e.fontStyle=n),r&&(e.fontWeight=isNaN(parseFloat(r))?r:parseFloat(r)),s&&(e.fontSize=o(s)),l&&(e.fontFamily=l),a&&(e.lineHeight="normal"===a?1:a)}},getGradientDefs:function(t){var e,i,n,r=d(t,["linearGradient","radialGradient","svg:linearGradient","svg:radialGradient"]),o=0,s={},a={};for(o=r.length;o--;)n=(e=r[o]).getAttribute("xlink:href"),i=e.getAttribute("id"),n&&(a[i]=n.substr(1)),s[i]=e;for(i in a){var l=s[a[i]].cloneNode(!0);for(e=s[i];l.firstChild;)e.appendChild(l.firstChild)}return s},parseAttributes:function(t,n,o){if(t){var s,a,u={};void 0===o&&(o=t.getAttribute("svgUid")),t.parentNode&&e.svgValidParentsRegEx.test(t.parentNode.nodeName)&&(u=e.parseAttributes(t.parentNode,n,o)),a=u&&u.fontSize||t.getAttribute("font-size")||e.Text.DEFAULT_SVG_FONT_SIZE;var d=n.reduce(function(e,i){return(s=t.getAttribute(i))&&(e[i]=s),e},{});d=i(d,i(function(t,i){var n={};for(var r in e.cssRules[i])if(f(t,r.split(" ")))for(var o in e.cssRules[i][r])n[o]=e.cssRules[i][r][o];return n}(t,o),e.parseStyleAttribute(t)));var g,p,m={};for(var v in d)p=h(g=c(v),d[v],u,a),m[g]=p;m&&m.font&&e.parseFontDeclaration(m.font,m);var w=i(u,m);return e.svgValidParentsRegEx.test(t.nodeName)?w:function(t){for(var i in l)if(void 0!==t[l[i]]&&""!==t[i]){if(void 0===t[i]){if(!e.Object.prototype[i])continue;t[i]=e.Object.prototype[i]}if(0!==t[i].indexOf("url(")){var n=new e.Color(t[i]);t[i]=n.setAlpha(r(n.getAlpha()*t[l[i]],2)).toRgba()}}return t}(w)}},parseElements:function(t,i,n,r,o){new e.ElementsParser(t,i,n,r,o).parse()},parseStyleAttribute:function(t){var e={},i=t.getAttribute("style");return i?("string"==typeof i?function(t,e){var i,n;t.replace(/;\s*$/,"").split(";").forEach(function(t){var r=t.split(":");i=r[0].trim().toLowerCase(),n=r[1].trim(),e[i]=n})}(i,e):function(t,e){var i,n;for(var r in t)void 0!==t[r]&&(i=r.toLowerCase(),n=t[r],e[i]=n)}(i,e),e):e},parsePointsAttribute:function(t){if(!t)return null;var e,i,n=[];for(e=0,i=(t=(t=t.replace(/,/g," ").trim()).split(/\s+/)).length;e<i;e+=2)n.push({x:parseFloat(t[e]),y:parseFloat(t[e+1])});return n},getCSSRules:function(t){var i,n,r=t.getElementsByTagName("style"),o={};for(i=0,n=r.length;i<n;i++){var s=r[i].textContent||r[i].text;""!==(s=s.replace(/\/\*[\s\S]*?\*\//g,"")).trim()&&s.match(/[^{]*\{[\s\S]*?\}/g).map(function(t){return t.trim()}).forEach(function(t){var r=t.match(/([\s\S]*?)\s*\{([^}]*)\}/),s={},a=r[2].trim().replace(/;$/,"").split(/\s*;\s*/);for(i=0,n=a.length;i<n;i++){var l=a[i].split(/\s*:\s*/),c=l[0],h=l[1];s[c]=h}(t=r[1]).split(",").forEach(function(t){""!==(t=t.replace(/^svg/i,"").trim())&&(o[t]?e.util.object.extend(o[t],s):o[t]=e.util.object.clone(s))})})}return o},loadSVGFromURL:function(t,i,n,r){t=t.replace(/^\n\s*/,"").trim(),new e.util.request(t,{method:"get",onComplete:function(t){var o=t.responseXML;o&&!o.documentElement&&e.window.ActiveXObject&&t.responseText&&((o=new ActiveXObject("Microsoft.XMLDOM")).async="false",o.loadXML(t.responseText.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i,"")));o&&o.documentElement||i&&i(null);e.parseSVGDocument(o.documentElement,function(t,e,n,r){i&&i(t,e,n,r)},n,r)}})},loadSVGFromString:function(t,i,n,r){var o;if(t=t.trim(),"undefined"!=typeof DOMParser){var s=new DOMParser;s&&s.parseFromString&&(o=s.parseFromString(t,"text/xml"))}else e.window.ActiveXObject&&((o=new ActiveXObject("Microsoft.XMLDOM")).async="false",o.loadXML(t.replace(/<!DOCTYPE[\s\S]*?(\[[\s\S]*\])*?>/i,"")));e.parseSVGDocument(o.documentElement,function(t,e,n,r){i(t,e,n,r)},n,r)}})}(e),n.ElementsParser=function(t,e,i,n,r){this.elements=t,this.callback=e,this.options=i,this.reviver=n,this.svgUid=i&&i.svgUid||0,this.parsingOptions=r,this.regexUrl=/^url\(['"]?#([^'"]+)['"]?\)/g},n.ElementsParser.prototype.parse=function(){this.instances=new Array(this.elements.length),this.numElements=this.elements.length,this.createObjects()},n.ElementsParser.prototype.createObjects=function(){for(var t=0,e=this.elements.length;t<e;t++)this.elements[t].setAttribute("svgUid",this.svgUid),function(t,e){setTimeout(function(){t.createObject(t.elements[e],e)},0)}(this,t)},n.ElementsParser.prototype.createObject=function(t,e){var i=n[n.util.string.capitalize(t.tagName.replace("svg:",""))];if(i&&i.fromElement)try{this._createObject(i,t,e)}catch(t){n.log(t)}else this.checkIfDone()},n.ElementsParser.prototype._createObject=function(t,e,i){t.fromElement(e,this.createCallback(i,e),this.options)},n.ElementsParser.prototype.createCallback=function(t,e){var i=this;return function(r){var o;i.resolveGradient(r,"fill"),i.resolveGradient(r,"stroke"),r instanceof n.Image&&(o=r.parsePreserveAspectRatioAttribute(e)),r._removeTransformMatrix(o),i.reviver&&i.reviver(e,r),i.instances[t]=r,i.checkIfDone()}},n.ElementsParser.prototype.resolveGradient=function(t,e){var i=t[e];if(/^url\(/.test(i)){var r=this.regexUrl.exec(i)[1];this.regexUrl.lastIndex=0,n.gradientDefs[this.svgUid][r]&&t.set(e,n.Gradient.fromElement(n.gradientDefs[this.svgUid][r],t))}},n.ElementsParser.prototype.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";var e=t.fabric||(t.fabric={});function i(t,e){this.x=t,this.y=e}e.Point?e.warn("fabric.Point is already defined"):(e.Point=i,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,i=this.y-t.y;return Math.sqrt(e*e+i*i)},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)}})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){this.status=t,this.points=[]}e.Intersection?e.warn("fabric.Intersection is already defined"):(e.Intersection=i,e.Intersection.prototype={constructor:i,appendPoint:function(t){return this.points.push(t),this},appendPoints:function(t){return this.points=this.points.concat(t),this}},e.Intersection.intersectLineLine=function(t,n,r,o){var s,a=(o.x-r.x)*(t.y-r.y)-(o.y-r.y)*(t.x-r.x),l=(n.x-t.x)*(t.y-r.y)-(n.y-t.y)*(t.x-r.x),c=(o.y-r.y)*(n.x-t.x)-(o.x-r.x)*(n.y-t.y);if(0!==c){var h=a/c,u=l/c;0<=h&&h<=1&&0<=u&&u<=1?(s=new i("Intersection")).appendPoint(new e.Point(t.x+h*(n.x-t.x),t.y+h*(n.y-t.y))):s=new i}else s=new i(0===a||0===l?"Coincident":"Parallel");return s},e.Intersection.intersectLinePolygon=function(t,e,n){var r,o,s,a,l=new i,c=n.length;for(a=0;a<c;a++)r=n[a],o=n[(a+1)%c],s=i.intersectLineLine(t,e,r,o),l.appendPoints(s.points);return l.points.length>0&&(l.status="Intersection"),l},e.Intersection.intersectPolygonPolygon=function(t,e){var n,r=new i,o=t.length;for(n=0;n<o;n++){var s=t[n],a=t[(n+1)%o],l=i.intersectLinePolygon(s,a,e);r.appendPoints(l.points)}return r.points.length>0&&(r.status="Intersection"),r},e.Intersection.intersectPolygonRectangle=function(t,n,r){var o=n.min(r),s=n.max(r),a=new e.Point(s.x,o.y),l=new e.Point(o.x,s.y),c=i.intersectLinePolygon(o,a,t),h=i.intersectLinePolygon(a,s,t),u=i.intersectLinePolygon(s,l,t),d=i.intersectLinePolygon(l,o,t),f=new i;return f.appendPoints(c.points),f.appendPoints(h.points),f.appendPoints(u.points),f.appendPoints(d.points),f.points.length>0&&(f.status="Intersection"),f})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});function i(t){t?this._tryParsingColor(t):this.setSource([0,0,0,1])}function n(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}e.Color?e.warn("fabric.Color is already defined."):(e.Color=i,e.Color.prototype={_tryParsingColor:function(t){var e;t in i.colorNameMap&&(t=i.colorNameMap[t]),"transparent"===t&&(e=[255,255,255,0]),e||(e=i.sourceFromHex(t)),e||(e=i.sourceFromRgb(t)),e||(e=i.sourceFromHsl(t)),e||(e=[0,0,0,1]),e&&this.setSource(e)},_rgbToHsl:function(t,i,n){t/=255,i/=255,n/=255;var r,o,s,a=e.util.array.max([t,i,n]),l=e.util.array.min([t,i,n]);if(s=(a+l)/2,a===l)r=o=0;else{var c=a-l;switch(o=s>.5?c/(2-a-l):c/(a+l),a){case t:r=(i-n)/c+(i<n?6:0);break;case i:r=(n-t)/c+2;break;case n:r=(t-i)/c+4}r/=6}return[Math.round(360*r),Math.round(100*o),Math.round(100*s)]},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(),e=this._rgbToHsl(t[0],t[1],t[2]);return"hsl("+e[0]+","+e[1]+"%,"+e[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,e,i,n=this.getSource();return t=1===(t=n[0].toString(16)).length?"0"+t:t,e=1===(e=n[1].toString(16)).length?"0"+e:e,i=1===(i=n[2].toString(16)).length?"0"+i:i,t.toUpperCase()+e.toUpperCase()+i.toUpperCase()},toHexa:function(){var t,e=this.getSource();return t=1===(t=(t=Math.round(255*e[3])).toString(16)).length?"0"+t:t,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),i=t[3];return this.setSource([e,e,e,i]),this},toBlackWhite:function(t){var e=this.getSource(),i=(.3*e[0]+.59*e[1]+.11*e[2]).toFixed(0),n=e[3];return t=t||127,i=Number(i)<Number(t)?0:255,this.setSource([i,i,i,n]),this},overlayWith:function(t){t instanceof i||(t=new i(t));var e,n=[],r=this.getAlpha(),o=this.getSource(),s=t.getSource();for(e=0;e<3;e++)n.push(Math.round(.5*o[e]+.5*s[e]));return n[3]=r,this.setSource(n),this}},e.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,e.Color.reHSLa=/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i,e.Color.reHex=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,e.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"},e.Color.fromRgb=function(t){return i.fromSource(i.sourceFromRgb(t))},e.Color.sourceFromRgb=function(t){var e=t.match(i.reRGBa);if(e){var n=parseInt(e[1],10)/(/%$/.test(e[1])?100:1)*(/%$/.test(e[1])?255:1),r=parseInt(e[2],10)/(/%$/.test(e[2])?100:1)*(/%$/.test(e[2])?255:1),o=parseInt(e[3],10)/(/%$/.test(e[3])?100:1)*(/%$/.test(e[3])?255:1);return[parseInt(n,10),parseInt(r,10),parseInt(o,10),e[4]?parseFloat(e[4]):1]}},e.Color.fromRgba=i.fromRgb,e.Color.fromHsl=function(t){return i.fromSource(i.sourceFromHsl(t))},e.Color.sourceFromHsl=function(t){var e=t.match(i.reHSLa);if(e){var r,o,s,a=(parseFloat(e[1])%360+360)%360/360,l=parseFloat(e[2])/(/%$/.test(e[2])?100:1),c=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(0===l)r=o=s=c;else{var h=c<=.5?c*(l+1):c+l-c*l,u=2*c-h;r=n(u,h,a+1/3),o=n(u,h,a),s=n(u,h,a-1/3)}return[Math.round(255*r),Math.round(255*o),Math.round(255*s),e[4]?parseFloat(e[4]):1]}},e.Color.fromHsla=i.fromHsl,e.Color.fromHex=function(t){return i.fromSource(i.sourceFromHex(t))},e.Color.sourceFromHex=function(t){if(t.match(i.reHex)){var e=t.slice(t.indexOf("#")+1),n=3===e.length||4===e.length,r=8===e.length||4===e.length,o=n?e.charAt(0)+e.charAt(0):e.substring(0,2),s=n?e.charAt(1)+e.charAt(1):e.substring(2,4),a=n?e.charAt(2)+e.charAt(2):e.substring(4,6),l=r?n?e.charAt(3)+e.charAt(3):e.substring(6,8):"FF";return[parseInt(o,16),parseInt(s,16),parseInt(a,16),parseFloat((parseInt(l,16)/255).toFixed(2))]}},e.Color.fromSource=function(t){var e=new i;return e.setSource(t),e})}(e),function(){function t(t){var e,i,r,o,s=t.getAttribute("style"),a=t.getAttribute("offset")||0;if(a=(a=parseFloat(a)/(/%$/.test(a)?100:1))<0?0:a>1?1:a,s){var l=s.split(/\s*;\s*/);for(""===l[l.length-1]&&l.pop(),o=l.length;o--;){var c=l[o].split(/\s*:\s*/),h=c[0].trim(),u=c[1].trim();"stop-color"===h?e=u:"stop-opacity"===h&&(r=u)}}return e||(e=t.getAttribute("stop-color")||"rgb(0,0,0)"),r||(r=t.getAttribute("stop-opacity")),i=(e=new n.Color(e)).getAlpha(),r=isNaN(parseFloat(r))?1:parseFloat(r),r*=i,{offset:a,color:e.toRgb(),opacity:r}}var e=n.util.object.clone;function i(t,e,i){var n,r=0,o=1,s="";for(var a in e)"Infinity"===e[a]?e[a]=1:"-Infinity"===e[a]&&(e[a]=0),n=parseFloat(e[a],10),o="string"==typeof e[a]&&/^(\d+\.\d+)%|(\d+)%$/.test(e[a])?.01:1,"x1"===a||"x2"===a||"r2"===a?(o*="objectBoundingBox"===i?t.width:1,r="objectBoundingBox"===i&&t.left||0):"y1"!==a&&"y2"!==a||(o*="objectBoundingBox"===i?t.height:1,r="objectBoundingBox"===i&&t.top||0),e[a]=n*o+r;if("ellipse"===t.type&&null!==e.r2&&"objectBoundingBox"===i&&t.rx!==t.ry){var l=t.ry/t.rx;s=" scale(1, "+l+")",e.y1&&(e.y1/=l),e.y2&&(e.y2/=l)}return s}n.Gradient=n.util.createClass({offsetX:0,offsetY:0,initialize:function(t){t||(t={});var e={};this.id=n.Object.__uid++,this.type=t.type||"linear",e={x1:t.coords.x1||0,y1:t.coords.y1||0,x2:t.coords.x2||0,y2:t.coords.y2||0},"radial"===this.type&&(e.r1=t.coords.r1||0,e.r2=t.coords.r2||0),this.coords=e,this.colorStops=t.colorStops.slice(),t.gradientTransform&&(this.gradientTransform=t.gradientTransform),this.offsetX=t.offsetX||this.offsetX,this.offsetY=t.offsetY||this.offsetY},addColorStop:function(t){for(var e in t){var i=new n.Color(t[e]);this.colorStops.push({offset:parseFloat(e),color:i.toRgb(),opacity:i.getAlpha()})}return this}
3,toObject:function(t){var e={type:this.type,coords:this.coords,colorStops:this.colorStops,offsetX:this.offsetX,offsetY:this.offsetY,gradientTransform:this.gradientTransform?this.gradientTransform.concat():this.gradientTransform};return n.util.populateWithProperties(this,e,t),e},toSVG:function(t){var i,n,r,o,s=e(this.coords,!0),a=e(this.colorStops,!0),l=s.r1>s.r2,c=t.width/2,h=t.height/2;for(var u in a.sort(function(t,e){return t.offset-e.offset}),"path"===t.type&&(c-=t.pathOffset.x,h-=t.pathOffset.y),s)"x1"===u||"x2"===u?s[u]+=this.offsetX-c:"y1"!==u&&"y2"!==u||(s[u]+=this.offsetY-h);if(o='id="SVGID_'+this.id+'" gradientUnits="userSpaceOnUse"',this.gradientTransform&&(o+=' gradientTransform="matrix('+this.gradientTransform.join(" ")+')" '),"linear"===this.type?r=["<linearGradient ",o,' x1="',s.x1,'" y1="',s.y1,'" x2="',s.x2,'" y2="',s.y2,'">\n']:"radial"===this.type&&(r=["<radialGradient ",o,' cx="',l?s.x1:s.x2,'" cy="',l?s.y1:s.y2,'" r="',l?s.r1:s.r2,'" fx="',l?s.x2:s.x1,'" fy="',l?s.y2:s.y1,'">\n']),"radial"===this.type){if(l)for((a=a.concat()).reverse(),i=0,n=a.length;i<n;i++)a[i].offset=1-a[i].offset;var d=Math.min(s.r1,s.r2);if(d>0){var f=d/Math.max(s.r1,s.r2);for(i=0,n=a.length;i<n;i++)a[i].offset+=f*(1-a[i].offset)}}for(i=0,n=a.length;i<n;i++){var g=a[i];r.push("<stop ",'offset="',100*g.offset+"%",'" style="stop-color:',g.color,void 0!==g.opacity?";stop-opacity: "+g.opacity:";",'"/>\n')}return r.push("linear"===this.type?"</linearGradient>\n":"</radialGradient>\n"),r.join("")},toLive:function(t){var e,i,r,o=n.util.object.clone(this.coords);if(this.type){for("linear"===this.type?e=t.createLinearGradient(o.x1,o.y1,o.x2,o.y2):"radial"===this.type&&(e=t.createRadialGradient(o.x1,o.y1,o.r1,o.x2,o.y2,o.r2)),i=0,r=this.colorStops.length;i<r;i++){var s=this.colorStops[i].color,a=this.colorStops[i].opacity,l=this.colorStops[i].offset;void 0!==a&&(s=new n.Color(s).setAlpha(a).toRgba()),e.addColorStop(l,s)}return e}}}),n.util.object.extend(n.Gradient,{fromElement:function(e,r){var o,s,a,l,c=e.getElementsByTagName("stop"),h=e.getAttribute("gradientUnits")||"objectBoundingBox",u=e.getAttribute("gradientTransform"),d=[];for("linear"===(o="linearGradient"===e.nodeName||"LINEARGRADIENT"===e.nodeName?"linear":"radial")?s=function(t){return{x1:t.getAttribute("x1")||0,y1:t.getAttribute("y1")||0,x2:t.getAttribute("x2")||"100%",y2:t.getAttribute("y2")||0}}(e):"radial"===o&&(s=function(t){return{x1:t.getAttribute("fx")||t.getAttribute("cx")||"50%",y1:t.getAttribute("fy")||t.getAttribute("cy")||"50%",r1:0,x2:t.getAttribute("cx")||"50%",y2:t.getAttribute("cy")||"50%",r2:t.getAttribute("r")||"50%"}}(e)),l=c.length;l--;)d.push(t(c[l]));a=i(r,s,h);var f=new n.Gradient({type:o,coords:s,colorStops:d,offsetX:-r.left,offsetY:-r.top});return(u||""!==a)&&(f.gradientTransform=n.parseTransformAttribute((u||"")+a)),f},forObject:function(t,e){return e||(e={}),i(t,e.coords,"userSpaceOnUse"),new n.Gradient(e)}})}(),function(){"use strict";var t=n.util.toFixed;n.Pattern=n.util.createClass({repeat:"repeat",offsetX:0,offsetY:0,crossOrigin:"",patternTransform:null,initialize:function(t,e){if(t||(t={}),this.id=n.Object.__uid++,this.setOptions(t),!t.source||t.source&&"string"!=typeof t.source)e&&e(this);else if(void 0!==n.util.getFunctionBody(t.source))this.source=new Function(n.util.getFunctionBody(t.source)),e&&e(this);else{var i=this;this.source=n.util.createImage(),n.util.loadImage(t.source,function(t){i.source=t,e&&e(i)},null,this.crossOrigin)}},toObject:function(e){var i,r,o=n.Object.NUM_FRACTION_DIGITS;return"function"==typeof this.source?i=String(this.source):"string"==typeof this.source.src?i=this.source.src:"object"==typeof this.source&&this.source.toDataURL&&(i=this.source.toDataURL()),r={type:"pattern",source:i,repeat:this.repeat,crossOrigin:this.crossOrigin,offsetX:t(this.offsetX,o),offsetY:t(this.offsetY,o),patternTransform:this.patternTransform?this.patternTransform.concat():null},n.util.populateWithProperties(this,r,e),r},toSVG:function(t){var e="function"==typeof this.source?this.source():this.source,i=e.width/t.width,n=e.height/t.height,r=this.offsetX/t.width,o=this.offsetY/t.height,s="";return"repeat-x"!==this.repeat&&"no-repeat"!==this.repeat||(n=1),"repeat-y"!==this.repeat&&"no-repeat"!==this.repeat||(i=1),e.src?s=e.src:e.toDataURL&&(s=e.toDataURL()),'<pattern id="SVGID_'+this.id+'" x="'+r+'" y="'+o+'" width="'+i+'" height="'+n+'">\n<image x="0" y="0" width="'+e.width+'" height="'+e.height+'" xlink:href="'+s+'"></image>\n</pattern>\n'},setOptions:function(t){for(var e in t)this[e]=t[e]},toLive:function(t){var e="function"==typeof this.source?this.source():this.source;if(!e)return"";if(void 0!==e.src){if(!e.complete)return"";
vendor: 8,641 bytes, line 3
3if(0===e.naturalWidth||0===e.naturalHeight)return""}return t.createPattern(e,this.repeat)}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.toFixed;e.Shadow?e.warn("fabric.Shadow is already defined."):(e.Shadow=e.util.createClass({color:"rgb(0,0,0)",blur:0,offsetX:0,offsetY:0,affectStroke:!1,includeDefaultValues:!0,initialize:function(t){for(var i in"string"==typeof t&&(t=this._parseShadow(t)),t)this[i]=t[i];this.id=e.Object.__uid++},_parseShadow:function(t){var i=t.trim(),n=e.Shadow.reOffsetsAndBlur.exec(i)||[];return{color:(i.replace(e.Shadow.reOffsetsAndBlur,"")||"rgb(0,0,0)").trim(),offsetX:parseInt(n[1],10)||0,offsetY:parseInt(n[2],10)||0,blur:parseInt(n[3],10)||0}},toString:function(){return[this.offsetX,this.offsetY,this.blur,this.color].join("px ")},toSVG:function(t){var n=40,r=40,o=e.Object.NUM_FRACTION_DIGITS,s=e.util.rotateVector({x:this.offsetX,y:this.offsetY},e.util.degreesToRadians(-t.angle)),a=new e.Color(this.color);return t.width&&t.height&&(n=100*i((Math.abs(s.x)+this.blur)/t.width,o)+20,r=100*i((Math.abs(s.y)+this.blur)/t.height,o)+20),t.flipX&&(s.x*=-1),t.flipY&&(s.y*=-1),'<filter id="SVGID_'+this.id+'" y="-'+r+'%" height="'+(100+2*r)+'%" x="-'+n+'%" width="'+(100+2*n)+'%" >\n\t<feGaussianBlur in="SourceAlpha" stdDeviation="'+i(this.blur?this.blur/2:0,o)+'"></feGaussianBlur>\n\t<feOffset dx="'+i(s.x,o)+'" dy="'+i(s.y,o)+'" result="oBlur" ></feOffset>\n\t<feFlood flood-color="'+a.toRgb()+'" flood-opacity="'+a.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(){if(this.includeDefaultValues)return{color:this.color,blur:this.blur,offsetX:this.offsetX,offsetY:this.offsetY,affectStroke:this.affectStroke};var t={},i=e.Shadow.prototype;return["color","blur","offsetX","offsetY","affectStroke"].forEach(function(e){this[e]!==i[e]&&(t[e]=this[e])},this),t}}),e.Shadow.reOffsetsAndBlur=/(?:\s|^)(-?\d+(?:px)?(?:\s?|$))?(-?\d+(?:px)?(?:\s?|$))?(\d+(?:px)?)?(?:\s?|$)(?:$|\s)/)}(e),function(){"use strict";if(n.StaticCanvas)n.warn("fabric.StaticCanvas is already defined.");else{var t=n.util.object.extend,e=n.util.getElementOffset,i=n.util.removeFromArray,r=n.util.toFixed,o=n.util.transformPoint,s=n.util.invertTransform,a=new Error("Could not initialize `canvas` element");n.StaticCanvas=n.util.createClass(n.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,clipTo:null,controlsAboveOverlay:!1,allowTouchScrolling:!1,imageSmoothingEnabled:!0,viewportTransform:n.iMatrix.concat(),backgroundVpt:!0,overlayVpt:!0,onBeforeScaleRotate:function(){},enableRetinaScaling:!0,vptCoords:{},skipOffscreen:!0,_initStatic:function(t,e){var i=this.requestRenderAllBound;this._objects=[],this._createLowerCanvas(t),this._initOptions(e),this._setImageSmoothing(),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!==n.devicePixelRatio&&this.enableRetinaScaling},getRetinaScaling:function(){return this._isRetinaScaling()?n.devicePixelRatio:1},_initRetinaScaling:function(){this._isRetinaScaling()&&(this.lowerCanvasEl.setAttribute("width",this.width*n.devicePixelRatio),this.lowerCanvasEl.setAttribute("height",this.height*n.devicePixelRatio),this.contextContainer.scale(n.devicePixelRatio,n.devicePixelRatio))},calcOffset:function(){return this._offset=e(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)},_setImageSmoothing:function(){var t=this.getContext();t.imageSmoothingEnabled=t.imageSmoothingEnabled||t.webkitImageSmoothingEnabled||t.mozImageSmoothingEnabled||t.msImageSmoothingEnabled||t.oImageSmoothingEnabled,t.imageSmoothingEnabled=this.imageSmoothingEnabled},__setBgOverlayImage:function(t,e,i,r){return"string"==typeof e?n.util.loadImage(e,function(e){e&&(this[t]=new n.Image(e,r)),i&&i(e)},this,r&&r.crossOrigin):(r&&e.setOptions(r),this[t]=e,i&&i(e)),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.util.createCanvasElement();if(!t)throw a;if(t.style||(t.style={}),void 0===t.getContext)throw a;return t},_initOptions:function(t){this._setOptions(t),this.width=this.width||parseInt(this.lowerCanvasEl.width,10)||0,this.height=this.height||parseInt(this.lowerCanvasEl.height,10)||0,this.lowerCanvasEl.style&&(this.lowerCanvasEl.width=this.width,this.lowerCanvasEl.height=this.height,this.lowerCanvasEl.style.width=this.width+"px",this.lowerCanvasEl.style.height=this.height+"px",this.viewportTransform=this.viewportTransform.slice())},_createLowerCanvas:function(t){t&&t.getContext?this.lowerCanvasEl=t:this.lowerCanvasEl=n.util.getById(t)||this._createCanvasElement(),n.util.addClass(this.lowerCanvasEl,"lower-canvas"),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;for(var 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._initRetinaScaling(),this._setImageSmoothing(),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,r=this._activeObject;for(this.viewportTransform=t,i=0,n=this._objects.length;i<n;i++)(e=this._objects[i]).group||e.setCoords(!1,!0);return r&&"activeSelection"===r.type&&r.setCoords(!1,!0),this.calcViewportBoundaries(),this.renderOnAddRemove&&this.requestRenderAll(),this},zoomToPoint:function(t,e){var i=t,n=this.viewportTransform.slice(0);t=o(t,s(this.viewportTransform)),n[0]=e,n[3]=e;var r=o(t,n);return n[4]+=i.x-r.x,n[5]+=i.y-r.y,this.setViewportTransform(n)},setZoom:function(t){return this.zoomToPoint(new n.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 n.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._objects.length=0,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=n.util.requestAnimFrame
vendor: 4,182 bytes, line 3
3(this.renderAndResetBound)),this},calcViewportBoundaries:function(){var t={},e=this.width,i=this.height,r=s(this.viewportTransform);return t.tl=o({x:0,y:0},r),t.br=o({x:e,y:i},r),t.tr=new n.Point(t.br.x,t.tl.y),t.bl=new n.Point(t.tl.x,t.br.y),this.vptCoords=t,t},renderCanvas:function(t,e){var i=this.viewportTransform;this.isRendering&&(n.util.cancelAnimFrame(this.isRendering),this.isRendering=0),this.calcViewportBoundaries(),this.clearContext(t),this.fire("before:render"),this.clipTo&&n.util.clipContext(this,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),this.clipTo&&t.restore(),this._renderOverlay(t),this.controlsAboveOverlay&&this.interactive&&this.drawControls(t),this.fire("after:render")},_renderObjects:function(t,e){var i,n;for(i=0,n=e.length;i<n;++i)e[i]&&e[i].render(t)},_renderBackgroundOrOverlay:function(t,e){var i,n=this[e+"Color"];n&&(t.fillStyle=n.toLive?n.toLive(t,this):n,t.fillRect(n.offsetX||0,n.offsetY||0,this.width,this.height)),(n=this[e+"Image"])&&(this[e+"Vpt"]&&(i=this.viewportTransform,t.save(),t.transform(i[0],i[1],i[2],i[3],i[4],i[5])),n.render(t),this[e+"Vpt"]&&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}},centerObjectH:function(t){return this._centerObject(t,new n.Point(this.getCenter().left,t.getCenterPoint().y))},centerObjectV:function(t){return this._centerObject(t,new n.Point(t.getCenterPoint().x,this.getCenter().top))},centerObject:function(t){var e=this.getCenter();return this._centerObject(t,new n.Point(e.left,e.top))},viewportCenterObject:function(t){var e=this.getVpCenter();return this._centerObject(t,e)},viewportCenterObjectH:function(t){var e=this.getVpCenter();return this._centerObject(t,new n.Point(e.x,t.getCenterPoint().y)),this},viewportCenterObjectV:function(t){var e=this.getVpCenter();return this._centerObject(t,new n.Point(t.getCenterPoint().x,e.y))},getVpCenter:function(){var t=this.getCenter(),e=s(this.viewportTransform);return o({x:t.left,y:t.top},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(e,i){var r={version:n.version,objects:this._toObjects(e,i)};return t(r,this.__serializeBgOverlay(e,i)),n.util.populateWithProperties(this,r,i),r},_toObjects:function(t,e){return this.getObjects().filter(function(t){return!t.excludeFromExport}).map(function(i){return this._toObject(i,t,e)},this)},_toObject:function(t,e,i){var n;this.includeDefaultValues||(n=t.includeDefaultValues,t.includeDefaultValues=!1);var r=t[e](i);return this.includeDefaultValues||(t.includeDefaultValues=n),r},__serializeBgOverlay:function(t,e){var i={},n=this.backgroundImage,r=this.overlayImage;return this.backgroundColor&&(i.background=this.backgroundColor.toObject?this.backgroundColor.toObject(e):this.backgroundColor),this.overlayColor&&(i.overlay=this.overlayColor.toObject?this.overlayColor.toObject(e):this.overlayColor),n&&!n.excludeFromExport&&(i.backgroundImage=this._toObject(n,t,e)),r&&!r.excludeFromExport&&(i.overlayImage=this._toObject(r,t,e)),i},svgViewportTransformation:!0,toSVG:function(t,e){t||(t={});var i=[];return this._setSVGPreamble(i,t),this._setSVGHeader(i,t),this._setSVGBgOverlayColor(i,"backgroundColor"),this._setSVGBgOverlayImage(i,"backgroundImage",e),this._setSVGObjects(i,e),this._setSVGBgOverlayColor(i,"overlayColor"),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')}
vendor: 4,422 bytes, line 3
3,_setSVGHeader:function(t,e){var i,o=e.width||this.width,s=e.height||this.height,a='viewBox="0 0 '+this.width+" "+this.height+'" ',l=n.Object.NUM_FRACTION_DIGITS;e.viewBox?a='viewBox="'+e.viewBox.x+" "+e.viewBox.y+" "+e.viewBox.width+" "+e.viewBox.height+'" ':this.svgViewportTransformation&&(i=this.viewportTransform,a='viewBox="'+r(-i[4]/i[0],l)+" "+r(-i[5]/i[3],l)+" "+r(this.width/i[0],l)+" "+r(this.height/i[3],l)+'" '),t.push("<svg ",'xmlns="http://www.w3.org/2000/svg" ','xmlns:xlink="http://www.w3.org/1999/xlink" ','version="1.1" ','width="',o,'" ','height="',s,'" ',a,'xml:space="preserve">\n',"<desc>Created with Fabric.js ",n.version,"</desc>\n","<defs>\n",this.createSVGFontFacesMarkup(),this.createSVGRefElementsMarkup(),"</defs>\n")},createSVGRefElementsMarkup:function(){var t=this;return["backgroundColor","overlayColor"].map(function(e){var i=t[e];if(i&&i.toLive)return i.toSVG(t,!1)}).join("")},createSVGFontFacesMarkup:function(){var t,e,i,r,o,s,a,l,c="",h={},u=n.fontPaths,d=this.getObjects();for(a=0,l=d.length;a<l;a++)if(e=(t=d[a]).fontFamily,-1!==t.type.indexOf("text")&&!h[e]&&u[e]&&(h[e]=!0,t.styles))for(o in i=t.styles)for(s in r=i[o])!h[e=r[s].fontFamily]&&u[e]&&(h[e]=!0);for(var f in h)c+=["\t\t@font-face {\n","\t\t\tfont-family: '",f,"';\n","\t\t\tsrc: url('",u[f],"');\n","\t\t}\n"].join("");return c&&(c=['\t<style type="text/css">',"<![CDATA[\n",c,"]]>","</style>\n"].join("")),c},_setSVGObjects:function(t,e){var i,n,r,o=this.getObjects();for(n=0,r=o.length;n<r;n++)(i=o[n]).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].toSVG&&t.push(this[e].toSVG(i))},_setSVGBgOverlayColor:function(t,e){var i=this[e],n=this.viewportTransform,r=this.width/n[0],o=this.height/n[3];if(i)if(i.toLive){var s=i.repeat;t.push('<rect transform="translate(',r/2,",",o/2,')"',' x="',i.offsetX-r/2,'" y="',i.offsetY-o/2,'" ','width="',"repeat-y"===s||"no-repeat"===s?i.source.width:r,'" height="',"repeat-x"===s||"no-repeat"===s?i.source.height:o,'" fill="url(#SVGID_'+i.id+')"',"></rect>\n")}else t.push('<rect x="0" y="0" width="100%" height="100%" ','fill="',this[e],'"',"></rect>\n")},sendToBack:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(e=(r=o._objects).length;e--;)n=r[e],i(this._objects,n),this._objects.unshift(n);else i(this._objects,t),this._objects.unshift(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},bringToFront:function(t){if(!t)return this;var e,n,r,o=this._activeObject;if(t===o&&"activeSelection"===t.type)for(r=o._objects,e=0;e<r.length;e++)n=r[e],i(this._objects,n),this._objects.push(n);else i(this._objects,t),this._objects.push(t);return this.renderOnAddRemove&&this.requestRenderAll(),this},sendBackwards:function(t,e){if(!t)return this;var n,r,o,s,a,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(a=l._objects,n=0;n<a.length;n++)r=a[n],(o=this._objects.indexOf(r))>0+c&&(s=o-1,i(this._objects,r),this._objects.splice(s,0,r)),c++;else 0!==(o=this._objects.indexOf(t))&&(s=this._findNewLowerIndex(t,o,e),i(this._objects,t),this._objects.splice(s,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewLowerIndex:function(t,e,i){var n,r;if(i)for(n=e,r=e-1;r>=0;--r){if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e-1;return n},bringForward:function(t,e){if(!t)return this;var n,r,o,s,a,l=this._activeObject,c=0;if(t===l&&"activeSelection"===t.type)for(n=(a=l._objects).length;n--;)r=a[n],(o=this._objects.indexOf(r))<this._objects.length-1-c&&(s=o+1,i(this._objects,r),this._objects.splice(s,0,r)),c++;else(o=this._objects.indexOf(t))!==this._objects.length-1&&(s=this._findNewUpperIndex(t,o,e),i(this._objects,t),this._objects.splice(s,0,t));return this.renderOnAddRemove&&this.requestRenderAll(),this},_findNewUpperIndex:function(t,e,i){var n,r,o;if(i)for(n=e,r=e+1,o=this._objects.length;r<o;++r){if(t.intersectsWithObject(this._objects[r])||t.isContainedWithinObject(this._objects[r])||this._objects[r].isContainedWithinObject(t)){n=r;break}}else n=e+1;return n},moveTo:function(t,e){return i(this._objects,t),this._objects.splice(e,0,t),this.renderOnAddRemove&&this.requestRenderAll()},dispose:function(){return this.isRendering&&(n.util.cancelAnimFrame
3(this.isRendering),this.isRendering=0),this.forEachObject(function(t){t.dispose&&t.dispose()}),this._objects=[],this.backgroundImage=null,this.overlayImage=null,this._iTextInstances=null,this.lowerCanvasEl=null,this.contextContainer=null,this},toString:function(){return"#<fabric.Canvas ("+this.complexity()+"): { objects: "+this.getObjects().length+" }>"}}),t(n.StaticCanvas.prototype,n.Observable),t(n.StaticCanvas.prototype,n.Collection),t(n.StaticCanvas.prototype,n.DataURLExporter),t(n.StaticCanvas,{EMPTY_JSON:'{"objects": [], "background": "white"}',supports:function(t){var e=n.util.createCanvasElement();if(!e||!e.getContext)return null;var i=e.getContext("2d");if(!i)return null;switch(t){case"getImageData":return void 0!==i.getImageData;case"setLineDash":return void 0!==i.setLineDash;case"toDataURL":return void 0!==e.toDataURL;case"toDataURLWithQuality":try{return e.toDataURL("image/jpeg",0),!0}catch(t){}return!1;default:return null}}}),n.StaticCanvas.prototype.toJSON=n.StaticCanvas.prototype.toObject,n.isLikelyNode&&(n.StaticCanvas.prototype.createPNGStream=function(){var t=n.util.getNodeCanvas(this.lowerCanvasEl);return t&&t.createPNGStream()},n.StaticCanvas.prototype.createJPEGStream=function(t){var e=n.util.getNodeCanvas(this.lowerCanvasEl);return e&&e.createJPEGStream(t)})}}(),n.BaseBrush=n.util.createClass({color:"rgb(0, 0, 0)",width:1,shadow:null,strokeLineCap:"round",strokeLineJoin:"round",strokeMiterLimit:10,strokeDashArray:null,setShadow:function(t){return this.shadow=new n.Shadow(t),this},_setBrushStyles:function(){var t=this.canvas.contextTop;t.strokeStyle=this.color,t.lineWidth=this.width,t.lineCap=this.strokeLineCap,t.miterLimit=this.strokeMiterLimit,t.lineJoin=this.strokeLineJoin,n.StaticCanvas.supports("setLineDash")&&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(){if(this.shadow){var t=this.canvas.contextTop,e=this.canvas.getZoom();t.shadowColor=this.shadow.color,t.shadowBlur=this.shadow.blur*e,t.shadowOffsetX=this.shadow.offsetX*e,t.shadowOffsetY=this.shadow.offsetY*e}},_resetShadow:function(){var t=this.canvas.contextTop;t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0}}),n.PencilBrush=n.util.createClass(n.BaseBrush,{initialize:function(t){this.canvas=t,this._points=[]},_drawSegment:function(t,e,i){var n=e.midPointFrom(i);return t.quadraticCurveTo(e.x,e.y,n.x,n.y),n},onMouseDown:function(t){this._prepareForDrawing(t),this._captureDrawingPath(t),this._render()},onMouseMove:function(t){if(this._captureDrawingPath(t)&&this._points.length>1)if(this.needsFullRender)this.canvas.clearContext(this.canvas.contextTop),this._render();else{var e=this._points,i=e.length,n=this.canvas.contextTop;this._saveAndTransform(n),this.oldEnd&&(n.beginPath(),n.moveTo(this.oldEnd.x,this.oldEnd.y)),this.oldEnd=this._drawSegment(n,e[i-2],e[i-1],!0),n.stroke(),n.restore()}},onMouseUp:function(){this.oldEnd=void 0,this._finalizeAndAddPath()},_prepareForDrawing:function(t){var e=new n.Point(t.x,t.y);this._reset(),this._addPoint(e),this.canvas.contextTop.moveTo(e.x,e.y)},_addPoint:function(t){return!(this._points.length>1&&t.eq(this._points[this._points.length-1])||(this._points.push(t),0))},_reset:function(){this._points.length=0,this._setBrushStyles();var t=new n.Color(this.color);this.needsFullRender=t.getAlpha()<1,this._setShadow()},_captureDrawingPath:function(t){var e=new n.Point(t.x,t.y);return this._addPoint(e)},_render:function(){var t,e,i=this.canvas.contextTop,r=this._points[0],o=this._points[1];if(this._saveAndTransform(i),i.beginPath(),2===this._points.length&&r.x===o.x&&r.y===o.y){var s=this.width/1e3;r=new n.Point(r.x,r.y),o=new n.Point(o.x,o.y),r.x-=s,o.x+=s}for(i.moveTo(r.x,r.y),t=1,e=this._points.length;t<e;t++)this._drawSegment(i,r,o),r=this._points[t],o=this._points[t+1];i.lineTo(r.x,r.y),i.stroke(),i.restore()},convertPointsToSVGPath:function(t){var e,i=[],r=this.width/1e3,o=new n.Point(t[0].x,t[0].y),s=new n.Point(t[1].x,t[1].y),a=t.length,l=1,c=1,h=a>2;for(h&&(l=t[2].x<s.x?-1:t[2].x===s.x?0:1,c=t[2].y<s.y?-1:t[2].y===s.y?0:1),i.push("M ",o.x-l*r," ",o.y-c*r," "),e=1;e<a;e++){if(!o.eq(s)){var u=o.midPointFrom(s);i.push("Q ",o.x," ",o.y," ",u.x," ",u.y," ")}o=t[e],e+1<t.length&&(s=t[e+1])}return h&&(l=o.x>t[e-2].x?1:o.x===t[e-2].x?0:-1,c=o.y>t[e-2].y?1:o.y===t[e-2].y?0:-1),i.push("L ",o.x+l*r," ",o.y+c*r),i},createPath:function(t){var e=new n.Path(t,{fill:null,stroke:this.color,strokeWidth:this.width,strokeLineCap:this.strokeLineCap,strokeMiterLimit:this.strokeMiterLimit,strokeLineJoin:this.strokeLineJoin,strokeDashArray:this.strokeDashArray}),i=new n.Point(e.left+e.width/2,e.top+e.height/2);return i=e.translateToGivenOrigin(i,"center","center",e.originX,e.originY),e.top=i.y,e.left=i.x,this.shadow&&(this.shadow.affectStroke=!0,e.setShadow(this.shadow)),e},_finalizeAndAddPath:function(){this.canvas.contextTop.closePath();var t=this.convertPointsToSVGPath(this._points).join("");if("M 0 0 Q 0 0 0 0 L 0 0"!==t){var e=this.createPath(t);this.canvas.clearContext(this.canvas.contextTop),this.canvas.add(e),this.canvas.renderAll(),e.setCoords(),this._resetShadow(),this.canvas.fire("path:created",{path:e})}else this.canvas.requestRenderAll()}}),n.CircleBrush=n.util.createClass(n.BaseBrush,{width:10,initialize:function(t){this.canvas=t,this.points=[]},drawDot:function(t){var e=this.addPoint(t),i=this.canvas.contextTop;this._saveAndTransform(i),i.fillStyle=e.fill,i.beginPath(),i.arc(e.x,e.y,e.radius,0,2*Math.PI,!1),i.closePath(),i.fill(),i.restore(
vendor: 4,138 bytes, line 3
3)},onMouseDown:function(t){this.points.length=0,this.canvas.clearContext(this.canvas.contextTop),this._setShadow(),this.drawDot(t)},_render:function(){var t,e,i,n=this.canvas.contextTop,r=this.points;for(this._saveAndTransform(n),t=0,e=r.length;t<e;t++)i=r[t],n.fillStyle=i.fill,n.beginPath(),n.arc(i.x,i.y,i.radius,0,2*Math.PI,!1),n.closePath(),n.fill();n.restore()},onMouseMove:function(t){this.drawDot(t)},onMouseUp:function(){var t,e,i=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;var r=[];for(t=0,e=this.points.length;t<e;t++){var o=this.points[t],s=new n.Circle({radius:o.radius,left:o.x,top:o.y,originX:"center",originY:"center",fill:o.fill});this.shadow&&s.setShadow(this.shadow),r.push(s)}var a=new n.Group(r,{originX:"center",originY:"center"});a.canvas=this.canvas,this.canvas.add(a),this.canvas.fire("path:created",{path:a}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=i,this.canvas.requestRenderAll()},addPoint:function(t){var e=new n.Point(t.x,t.y),i=n.util.getRandomInt(Math.max(0,this.width-20),this.width+20)/2,r=new n.Color(this.color).setAlpha(n.util.getRandomInt(0,100)/100).toRgba();return e.radius=i,e.fill=r,this.points.push(e),e}}),n.SprayBrush=n.util.createClass(n.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){this.addSprayChunk(t),this.render(this.sprayChunkPoints)},onMouseUp:function(){var t=this.canvas.renderOnAddRemove;this.canvas.renderOnAddRemove=!1;for(var e=[],i=0,r=this.sprayChunks.length;i<r;i++)for(var o=this.sprayChunks[i],s=0,a=o.length;s<a;s++){var l=new n.Rect({width:o[s].width,height:o[s].width,left:o[s].x+1,top:o[s].y+1,originX:"center",originY:"center",fill:this.color});e.push(l)}this.optimizeOverlapping&&(e=this._getOptimizedRects(e));var c=new n.Group(e,{originX:"center",originY:"center"});this.shadow&&c.setShadow(this.shadow),this.canvas.add(c),this.canvas.fire("path:created",{path:c}),this.canvas.clearContext(this.canvas.contextTop),this._resetShadow(),this.canvas.renderOnAddRemove=t,this.canvas.requestRenderAll()},_getOptimizedRects:function(t){var e,i,n,r={};for(i=0,n=t.length;i<n;i++)r[e=t[i].left+""+t[i].top]||(r[e]=t[i]);var o=[];for(e in r)o.push(r[e]);return o},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 r=t[e];void 0!==r.opacity&&(n.globalAlpha=r.opacity),n.fillRect(r.x,r.y,r.width,r.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=[];var e,i,r,o,s=this.width/2;for(o=0;o<this.density;o++){e=n.util.getRandomInt(t.x-s,t.x+s),i=n.util.getRandomInt(t.y-s,t.y+s),r=this.dotWidthVariance?n.util.getRandomInt(Math.max(1,this.dotWidth-this.dotWidthVariance),this.dotWidth+this.dotWidthVariance):this.dotWidth;var a=new n.Point(e,i);a.width=r,this.randomOpacity&&(a.opacity=n.util.getRandomInt(0,100)/100),this.sprayChunkPoints.push(a)}this.sprayChunks.push(this.sprayChunkPoints)}}),n.PatternBrush=n.util.createClass(n.PencilBrush,{getPatternSrc:function(){var t=n.document.createElement("canvas"),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(){return this.canvas.contextTop.createPattern(this.source||this.getPatternSrc(),"repeat")},_setBrushStyles:function(){this.callSuper("_setBrushStyles"),this.canvas.contextTop.strokeStyle=this.getPattern()},createPath:function(t){var e=this.callSuper("createPath",t),i=e._getLeftTopCoords().scalarAdd(e.strokeWidth/2);
3return e.stroke=new n.Pattern({source:this.source||this.getPatternSrcFunction(),offsetX:-i.x,offsetY:-i.y}),e}}),function(){var t=n.util.getPointer,e=n.util.degreesToRadians,i=n.util.radiansToDegrees,r=Math.atan2,o=Math.abs,s=n.StaticCanvas.supports("setLineDash");for(var a in n.Canvas=n.util.createClass(n.StaticCanvas,{initialize:function(t,e){e||(e={}),this.renderAndResetBound=this.renderAndReset.bind(this),this._initStatic(t,e),this._initInteractive(),this._createCacheCanvas()},uniScaleTransform:!1,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",rotationCursor:"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,_initInteractive:function(){this._currentTransform=null,this._groupSelector=null,this._initWrapperElement(),this._createUpperCanvas(),this._initEventListeners(),this._initRetinaScaling(),this.freeDrawingBrush=n.PencilBrush&&new n.PencilBrush(this),this.calcOffset()},_chooseObjectsToRender:function(){var t,e,i,n=this.getActiveObjects();if(n.length>0&&!this.preserveObjectStacking){e=[],i=[];for(var r=0,o=this._objects.length;r<o;r++)t=this._objects[r],-1===n.indexOf(t)?e.push(t):i.push(t);n.length>1&&(this._activeObject._objects=i),e.push.apply(e,i)}else e=this._objects;return e},renderAll:function(){!this.contextTopDirty||this._groupSelector||this.isDrawingMode||(this.clearContext(this.contextTop),this.contextTopDirty=!1),this.hasLostContext&&this.renderTopLayer(this.contextTop);var t=this.contextContainer;return this.renderCanvas(t,this._chooseObjectsToRender()),this},renderTopLayer:function(t){this.isDrawingMode&&this._isCurrentlyDrawing&&this.freeDrawingBrush&&this.freeDrawingBrush._render(),this.selection&&this._groupSelector&&this._drawSelection(t)},renderTop:function(){var t=this.contextTop;return this.clearContext(t),this.renderTopLayer(t),this.fire("after:render"),this.contextTopDirty=!0,this},_resetCurrentTransform:function(){var t=this._currentTransform;t.target.set({scaleX:t.original.scaleX,scaleY:t.original.scaleY,skewX:t.original.skewX,skewY:t.original.skewY,left:t.original.left,top:t.original.top}),this._shouldCenterTransform(t.target)?("center"!==t.originX&&("right"===t.originX?t.mouseXSign=-1:t.mouseXSign=1),"center"!==t.originY&&("bottom"===t.originY?t.mouseYSign=-1:t.mouseYSign=1),t.originX="center",t.originY="center"):(t.originX=t.original.originX,t.originY=t.original.originY)},containsPoint:function(t,e,i){var n,r=i||this.getPointer(t,!0);return n=e.group&&e.group===this._activeObject&&"activeSelection"===e.group.type?this._normalizePointer(e.group,r):{x:r.x,y:r.y},e.containsPoint(n)||e._findTargetCorner(r)},_normalizePointer:function(t,e){var i=t.calcTransformMatrix(),r=n.util.invertTransform(i),o=this.restorePointerVpt(e);return n.util.transformPoint(o,r)},isTargetTransparent:function(t,e,i){if(t.shouldCache()&&t._cacheCanvas){var r=this._normalizePointer(t,{x:e,y:i}),o=t.cacheTranslationX+r.x*t.zoomX,s=t.cacheTranslationY+r.y*t.zoomY;return n.util.isTransparent(t._cacheContext,o,s,this.targetFindTolerance)}var a=this.contextCache,l=t.selectionBackgroundColor,c=this.viewportTransform;return t.selectionBackgroundColor="",this.clearContext(a),a.save(),a.transform(c[0],c[1],c[2],c[3],c[4],c[5]),t.render(a),a.restore(),t===this._activeObject&&t._renderControls(a,{hasBorders:!1,transparentCorners:!1},{hasBorders:!1}),t.selectionBackgroundColor=l,n.util.isTransparent(a,e,i,this.targetFindTolerance)},_isSelectionKeyPressed:function(t){return"[object Array]"===Object.prototype.toString.call(this.selectionKey)?!!this.selectionKey.find(function(e){return!0===t[e]}):t[this.selectionKey]},_shouldClearSelection:function(t,e){var i=this.getActiveObjects(),n=this._activeObject;return!e||e&&n&&i.length>1&&-1===i.indexOf(e)&&n!==e&&!this._isSelectionKeyPressed(t)||e&&!e.evented||e&&!e.selectable&&n&&n!==e},_shouldCenterTransform:function(t){if(t){var e,i=this._currentTransform;return"scale"===i.action||"scaleX"===i.action||"scaleY"===i.action?e=this.centeredScaling||t.centeredScaling:"rotate"===i.action&&(e=this.centeredRotation||t.centeredRotation),e?!i.altKey:i.altKey}},_getOriginFromCorner:function(t,e){var i={x:t.originX,y:t.originY};return"ml"===e||"tl"===e||"bl"===e?i.x="right":"mr"!==e&&"tr"!==e&&"br"!==e||(i.x="left"),"tl"===e||"mt"===e||"tr"===e?i.y="bottom":"bl"!==e&&"mb"!==e&&"br"!==e||(i.y="top"),i}
vendor: 6,587 bytes, line 3
3,_getActionFromCorner:function(t,e,i){if(!e)return"drag";switch(e){case"mtr":return"rotate";case"ml":case"mr":return i[this.altActionKey]?"skewY":"scaleX";case"mt":case"mb":return i[this.altActionKey]?"skewX":"scaleY";default:return"scale"}},_setupCurrentTransform:function(t,i){if(i){var n=this.getPointer(t),r=i._findTargetCorner(this.getPointer(t,!0)),o=this._getActionFromCorner(i,r,t),s=this._getOriginFromCorner(i,r);this._currentTransform={target:i,action:o,corner:r,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,offsetX:n.x-i.left,offsetY:n.y-i.top,originX:s.x,originY:s.y,ex:n.x,ey:n.y,lastX:n.x,lastY:n.y,theta:e(i.angle),width:i.width*i.scaleX,mouseXSign:1,mouseYSign:1,shiftKey:t.shiftKey,altKey:t[this.centeredKey]},this._currentTransform.original={left:i.left,top:i.top,scaleX:i.scaleX,scaleY:i.scaleY,skewX:i.skewX,skewY:i.skewY,originX:s.x,originY:s.y},this._resetCurrentTransform(),this._beforeTransform(t)}},_translateObject:function(t,e){var i=this._currentTransform,n=i.target,r=t-i.offsetX,o=e-i.offsetY,s=!n.get("lockMovementX")&&n.left!==r,a=!n.get("lockMovementY")&&n.top!==o;return s&&n.set("left",r),a&&n.set("top",o),s||a},_changeSkewTransformOrigin:function(t,e,i){var n="originX",r={0:"center"},o=e.target.skewX,s="left",a="right",l="mt"===e.corner||"ml"===e.corner?1:-1,c=1;t=t>0?1:-1,"y"===i&&(o=e.target.skewY,s="top",a="bottom",n="originY"),r[-1]=s,r[1]=a,e.target.flipX&&(c*=-1),e.target.flipY&&(c*=-1),0===o?(e.skewSign=-l*t*c,e[n]=r[-t]):(o=o>0?1:-1,e.skewSign=o,e[n]=r[o*l*c])},_skewObject:function(t,e,i){var r,o=this._currentTransform,s=o.target,a=s.get("lockSkewingX"),l=s.get("lockSkewingY");if(a&&"x"===i||l&&"y"===i)return!1;var c,h,u=s.getCenterPoint(),d=s.toLocalPoint(new n.Point(t,e),"center","center")[i],f=s.toLocalPoint(new n.Point(o.lastX,o.lastY),"center","center")[i],g=s._getTransformedDimensions();return this._changeSkewTransformOrigin(d-f,o,i),c=s.toLocalPoint(new n.Point(t,e),o.originX,o.originY)[i],h=s.translateToOriginPoint(u,o.originX,o.originY),r=this._setObjectSkew(c,o,i,g),o.lastX=t,o.lastY=e,s.setPositionByOrigin(h,o.originX,o.originY),r},_setObjectSkew:function(t,e,i,r){var o,s,a,l,c,h,u,d,f,g,p=e.target,m=e.skewSign;return"x"===i?(c="y",h="Y",u="X",f=0,g=p.skewY):(c="x",h="X",u="Y",f=p.skewX,g=0),l=p._getTransformedDimensions(f,g),(d=2*Math.abs(t)-l[i])<=2?o=0:(o=m*Math.atan(d/p["scale"+u]/(l[c]/p["scale"+h])),o=n.util.radiansToDegrees(o)),s=p["skew"+u]!==o,p.set("skew"+u,o),0!==p["skew"+h]&&(a=p._getTransformedDimensions(),o=r[c]/a[c]*p["scale"+h],p.set("scale"+h,o)),s},_scaleObject:function(t,e,i){var r=this._currentTransform,o=r.target,s=o.lockScalingX,a=o.lockScalingY,l=o.lockScalingFlip;if(s&&a)return!1;var c,h=o.translateToOriginPoint(o.getCenterPoint(),r.originX,r.originY),u=o.toLocalPoint(new n.Point(t,e),r.originX,r.originY),d=o._getTransformedDimensions();return this._setLocalMouse(u,r),c=this._setObjectScale(u,r,s,a,i,l,d),o.setPositionByOrigin(h,r.originX,r.originY),c},_setObjectScale:function(t,e,i,n,r,o,s){var a,l,c,h,u=e.target,d=!1,f=!1,g=!1;return c=t.x*u.scaleX/s.x,h=t.y*u.scaleY/s.y,a=u.scaleX!==c,l=u.scaleY!==h,o&&c<=0&&c<u.scaleX&&(d=!0,t.x=0),o&&h<=0&&h<u.scaleY&&(f=!0,t.y=0),"equally"!==r||i||n?r?"x"!==r||u.get("lockUniScaling")?"y"!==r||u.get("lockUniScaling")||f||n||u.set("scaleY",h)&&(g=g||l):d||i||u.set("scaleX",c)&&(g=g||a):(d||i||u.set("scaleX",c)&&(g=g||a),f||n||u.set("scaleY",h)&&(g=g||l)):g=this._scaleObjectEqually(t,u,e,s),e.newScaleX=c,e.newScaleY=h,d||f||this._flipObject(e,r),g},_scaleObjectEqually:function(t,e,i,n){var r,o=t.y+t.x,s=n.y*i.original.scaleY/e.scaleY+n.x*i.original.scaleX/e.scaleX,a=t.x<0?-1:1,l=t.y<0?-1:1;return i.newScaleX=a*Math.abs(i.original.scaleX*o/s),i.newScaleY=l*Math.abs(i.original.scaleY*o/s),r=i.newScaleX!==e.scaleX||i.newScaleY!==e.scaleY,e.set("scaleX",i.newScaleX),e.set("scaleY",i.newScaleY),r},_flipObject:function(t,e){t.newScaleX<0&&"y"!==e&&("left"===t.originX?t.originX="right":"right"===t.originX&&(t.originX="left")),t.newScaleY<0&&"x"!==e&&("top"===t.originY?t.originY="bottom":"bottom"===t.originY&&(t.originY="top"))},_setLocalMouse:function(t,e){var i=e.target,n=this.getZoom(),r=i.padding/n;"right"===e.originX?t.x*=-1:"center"===e.originX&&(t.x*=2*e.mouseXSign,t.x<0&&(e.mouseXSign=-e.mouseXSign)),"bottom"===e.originY?t.y*=-1:"center"===e.originY&&(t.y*=2*e.mouseYSign,t.y<0&&(e.mouseYSign=-e.mouseYSign)),o(t.x)>r?t.x<0?t.x+=r:t.x-=r:t.x=0,o(t.y)>r?t.y<0?t.y+=r:t.y-=r:t.y=0},_rotateObject:function(t,e){var n=this._currentTransform,o=n.target,s=o.translateToOriginPoint(o.getCenterPoint(),n.originX,n.originY);if(o.lockRotation)return!1;var a=r(n.ey-s.y,n.ex-s.x),l=r(e-s.y,t-s.x),c=i(l-a+n.theta),h=!0;if(o.snapAngle>0){var u=o.snapAngle,d=o.snapThreshold||u,f=Math.ceil(c/u)*u,g=Math.floor(c/u)*u;Math.abs(c-g)<d?c=g:Math.abs(c-f)<d&&(c=f)}return c<0&&(c=360+c),c%=360,o.angle===c?h=!1:(o.angle=c,o.setPositionByOrigin(s,n.originX,n.originY)),h},setCursor:function(t){this.upperCanvasEl.style.cursor=t},_resetObjectTransform:function(t){t.scaleX=1,t.scaleY=1,t.skewX=0,t.skewY=0,t.rotate(0)},_drawSelection:function(t){var e=this._groupSelector,i=e.left,r=e.top,a=o(i),l=o(r);if(this.selectionColor&&(t.fillStyle=this.selectionColor,t.fillRect(e.ex-(i>0?0:-i),e.ey-(r>0?0:-r),a,l)),this.selectionLineWidth&&this.selectionBorderColor)if(t.lineWidth=this.selectionLineWidth,t.strokeStyle=this.selectionBorderColor,this.selectionDashArray.length>1&&!s){var c=e.ex+.5-(i>0?0:a),h=e.ey+.5-(r>0?0:l);t.beginPath(),n.util.drawDashedLine(t,c,h,c+a,h,this.selectionDashArray),n.util.drawDashedLine(t,c,h+l-1,c+a,h+l-1,this.selectionDashArray),n.util.drawDashedLine(t,c,h,c,h+l,this.selectionDashArray),n.util.drawDashedLine(t,c+a-1,h,c+a-1,h+l,this.selectionDashArray),t.closePath(),t.stroke()}else n.Object.prototype._setLineDash.call(this,t,this.selectionDashArray),t.strokeRect(e.ex+.5-(i>0?0:a),e.ey+.5-(r>0?0:l),a,l)},findTarget:function(t,e){if(!this.skipTargetFind){var i,n,r=this.getPointer(t,!0),o=this._activeObject,s=this.getActiveObjects();if(this.targets=[],s.length>1&&!e&&o===this._searchPossibleTargets([o],r))return o;if(1===s.length&&o._findTargetCorner(r))return o;if(1===s.length&&o===this._searchPossibleTargets([o],r)){if(!this.preserveObjectStacking)return o;i=o,n=this.targets,this.targets=[]}var a=this._searchPossibleTargets(this._objects,r);return t[this.altSelectionKey]&&a&&i&&a!==i&&(a=i,this.targets=n),a}},_checkTarget:function(t,e){if(e&&e.visible&&e.evented&&this.containsPoint(null,e,t)){if(!this.perPixelTargetFind&&!e.perPixelTargetFind||e.isEditing)return!0;
3if(!this.isTargetTransparent(e,t.x,t.y))return!0}},_searchPossibleTargets:function(t,e){for(var i,r,o,s=t.length;s--;)if(this._checkTarget(e,t[s])){(i=t[s]).subTargetCheck&&i instanceof n.Group&&(r=this._normalizePointer(i,e),(o=this._searchPossibleTargets(i._objects,r))&&this.targets.push(o));break}return i},restorePointerVpt:function(t){return n.util.transformPoint(t,n.util.invertTransform(this.viewportTransform))},getPointer:function(e,i){if(this._absolutePointer&&!i)return this._absolutePointer;if(this._pointer&&i)return this._pointer;var n,r=t(e),o=this.upperCanvasEl,s=o.getBoundingClientRect(),a=s.width||0,l=s.height||0;return a&&l||("top"in s&&"bottom"in s&&(l=Math.abs(s.top-s.bottom)),"right"in s&&"left"in s&&(a=Math.abs(s.right-s.left))),this.calcOffset(),r.x=r.x-this._offset.left,r.y=r.y-this._offset.top,i||(r=this.restorePointerVpt(r)),n=0===a||0===l?{width:1,height:1}:{width:o.width/a,height:o.height/l},{x:r.x*n.width,y:r.y*n.height}},_createUpperCanvas:function(){var t=this.lowerCanvasEl.className.replace(/\s*lower-canvas\s*/,"");this.upperCanvasEl?this.upperCanvasEl.className="":this.upperCanvasEl=this._createCanvasElement(),n.util.addClass(this.upperCanvasEl,"upper-canvas "+t),this.wrapperEl.appendChild(this.upperCanvasEl),this._copyCanvasStyle(this.lowerCanvasEl,this.upperCanvasEl),this._applyCanvasStyle(this.upperCanvasEl),this.contextTop=this.upperCanvasEl.getContext("2d")},_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=n.util.wrapElement(this.lowerCanvasEl,"div",{class:this.containerClass}),n.util.setStyle(this.wrapperEl,{width:this.width+"px",height:this.height+"px",position:"relative"}),n.util.makeElementUnselectable(this.wrapperEl)},_applyCanvasStyle:function(t){var e=this.width||t.width,i=this.height||t.height;n.util.setStyle(t,{position:"absolute",width:e+"px",height:i+"px",left:0,top:0,"touch-action":this.allowTouchScrolling?"manipulation":"none"}),t.width=e,t.height=i,n.util.makeElementUnselectable(t)},_copyCanvasStyle:function(t,e){e.style.cssText=t.style.cssText},getSelectionContext:function(){return this.contextTop}
3,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")),this._hoveredTarget===t&&(this._hoveredTarget=null),this.callSuper("_onObjectRemoved",t)},_fireSelectionEvents:function(t,e){var i=!1,n=this.getActiveObjects(),r=[],o=[],s={e:e};t.forEach(function(t){-1===n.indexOf(t)&&(i=!0,t.fire("deselected",s),o.push(t))}),n.forEach(function(e){-1===t.indexOf(e)&&(i=!0,e.fire("selected",s),r.push(e))}),t.length>0&&n.length>0?(s.selected=r,s.deselected=o,s.updated=r[0]||o[0],s.target=this._activeObject,i&&this.fire("selection:updated",s)):n.length>0?(1===n.length&&(s.target=r[0],this.fire("object:selected",s)),s.selected=r,s.target=this._activeObject,this.fire("selection:created",s)):t.length>0&&(s.deselected=o,this.fire("selection:cleared",s))},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();return e.length&&this.fire("before:selection:cleared",{target:e[0],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.upperCanvasEl=null,this.cacheCanvasEl=null,this.contextCache=null,this.contextTop=null,t.parentNode&&t.parentNode.replaceChild(this.lowerCanvasEl,this.wrapperEl),delete this.wrapperEl,n.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),r=this.callSuper("_toObject",t,e,i);return this._unwindGroupTransformOnObject(t,n),r},_realizeGroupTransformOnObject:function(t){if(t.group&&"activeSelection"===t.group.type&&this._activeObject===t.group){var e={};return["angle","flipX","flipY","left","scaleX","scaleY","skewX","skewY","top"].forEach(function(i){e[i]=t[i]}),this._activeObject.realizeTransform(t),e}return 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(),n.StaticCanvas.prototype.setViewportTransform.call(this,t)}}),n.StaticCanvas)"prototype"!==a&&(n.Canvas[a]=n.StaticCanvas[a]);n.isTouchSupported&&(n.Canvas.prototype._setCursorFromEvent=function(){})}(),function(){var t={mt:0,tr:1,mr:2,br:3,mb:4,bl:5,ml:6,tl:7},e=n.util.addListener,i=n.util.removeListener,o={passive:!1};function s(t,e){return"which"in t?t.which===e:t.button===e-1}n.util.object.extend(n.Canvas.prototype,{cursorMap:["n-resize","ne-resize","e-resize","se-resize","s-resize","sw-resize","w-resize","nw-resize"],_initEventListeners:function(){this.removeListeners(),this._bindEvents(),this.addOrRemove(e,"add")},addOrRemove:function(t,e){t(n.window,"resize",this._onResize),t(this.upperCanvasEl,"mousedown",this._onMouseDown),t(this.upperCanvasEl,"mousemove",this._onMouseMove,o),t(this.upperCanvasEl,"mouseout",this._onMouseOut),t(this.upperCanvasEl,"mouseenter",this._onMouseEnter),t(this.upperCanvasEl,"wheel",this._onMouseWheel),t(this.upperCanvasEl,"contextmenu",this._onContextMenu),t(this.upperCanvasEl,"dblclick",this._onDoubleClick),t(this.upperCanvasEl,"touchstart",this._onMouseDown,o),t(this.upperCanvasEl,"touchmove",this._onMouseMove,o),t(this.upperCanvasEl,"dragover",this._onDragOver),t(this.upperCanvasEl,"dragenter",this._onDragEnter),t(this.upperCanvasEl,"dragleave",this._onDragLeave),t(this.upperCanvasEl,"drop",this._onDrop),void 0!==r&&e in r&&(r[e](this.upperCanvasEl,"gesture",this._onGesture),r[e](this.upperCanvasEl,"drag",this._onDrag),r[e](this.upperCanvasEl,"orientation",this._onOrientationChange),r[e](this.upperCanvasEl,"shake",this._onShake),r[e](this.upperCanvasEl,"longpress",this._onLongPress))},removeListeners:function(){this.addOrRemove(i,"remove"),i(n.document,"mouseup",this._onMouseUp),i(n.document,"touchend",this._onMouseUp,o),i(n.document,"mousemove",this._onMouseMove,o),i(n.document,"touchmove",this._onMouseMove,o)},_bindEvents:function(){this.eventsBound||(this._onMouseDown=this._onMouseDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),this._onMouseUp=this._onMouseUp.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._simpleEventHandler.bind(this,"drop"),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(t){var e=this._hoveredTarget;this.fire("mouse:out",{target:e,e:t}),this._hoveredTarget=null,e&&e.fire("mouseout",{e:t}
3),this._iTextInstances&&this._iTextInstances.forEach(function(t){t.isEditing&&t.hiddenTextarea.focus()})},_onMouseEnter:function(t){this.findTarget(t)||(this.fire("mouse:over",{target:null,e:t}),this._hoveredTarget=null)},_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)},_onContextMenu:function(t){return this.stopContextMenu&&(t.stopPropagation(),t.preventDefault()),!1},_onDoubleClick:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"dblclick"),this._resetTransformEventData(t)},_onMouseDown:function(t){this.__onMouseDown(t),this._resetTransformEventData(),e(n.document,"touchend",this._onMouseUp,o),e(n.document,"touchmove",this._onMouseMove,o),i(this.upperCanvasEl,"mousemove",this._onMouseMove,o),i(this.upperCanvasEl,"touchmove",this._onMouseMove,o),"touchstart"===t.type?i(this.upperCanvasEl,"mousedown",this._onMouseDown):(e(n.document,"mouseup",this._onMouseUp),e(n.document,"mousemove",this._onMouseMove,o))},_onMouseUp:function(t){if(this.__onMouseUp(t),this._resetTransformEventData(),i(n.document,"mouseup",this._onMouseUp),i(n.document,"touchend",this._onMouseUp,o),i(n.document,"mousemove",this._onMouseMove,o),i(n.document,"touchmove",this._onMouseMove,o),e(this.upperCanvasEl,"mousemove",this._onMouseMove,o),e(this.upperCanvasEl,"touchmove",this._onMouseMove,o),"touchend"===t.type){var r=this;setTimeout(function(){e(r.upperCanvasEl,"mousedown",r._onMouseDown)},400)}},_onMouseMove:function(t){!this.allowTouchScrolling&&t.preventDefault&&t.preventDefault(),this.__onMouseMove(t)},_onResize:function(){this.calcOffset()},_shouldRender:function(t,e){var i=this._activeObject;return(!i||!i.isEditing||t!==i)&&!!(t&&(t.isMoving||t!==i)||!t&&i||!t&&!i&&!this._groupSelector||e&&this._previousPointer&&this.selection&&(e.x!==this._previousPointer.x||e.y!==this._previousPointer.y))},__onMouseUp:function(t){var e,i=this._currentTransform,n=this._groupSelector,r=!n||0===n.left&&0===n.top;if(this._cacheTransformEventData(t),e=this._target,this._handleEvent(t,"up:before"),s(t,3))this.fireRightClick&&this._handleEvent(t,"up",3,r);else{if(s(t,2))return this.fireMiddleClick&&this._handleEvent(t,"up",2,r),void this._resetTransformEventData();if(this.isDrawingMode&&this._isCurrentlyDrawing)this._onMouseUpInDrawingMode(t);else{i&&this._finalizeCurrentTransform(t);var o=this._shouldRender(e,this._absolutePointer);!e&&r||this._maybeGroupObjects(t),e&&(e.isMoving=!1),this._setCursorFromEvent(t,e),this._handleEvent(t,"up",1,r),this._groupSelector=null,this._currentTransform=null,e&&(e.__corner=0),o&&this.requestRenderAll()}}},_simpleEventHandler:function(t,e){var i=this.findTarget(e),n=this.targets,r={e:e,target:i,subTargets:n};if(this.fire(t,r),i&&i.fire(t,r),!n)return i;for(var o=0;o<n.length;o++)n[o].fire(t,r);return i},_handleEvent:function(t,e,i,n){var r=this._target,o=this.targets||[],s={e:t,target:r,subTargets:o,button:i||1,isClick:n||!1,pointer:this._pointer,absolutePointer:this._absolutePointer,transform:this._currentTransform};this.fire("mouse:"+e,s),r&&r.fire("mouse"+e,s);for(var a=0;a<o.length;a++)o[a].fire("mouse"+e,s)},_finalizeCurrentTransform:function(t){var e,i=this._currentTransform,n=i.target,r={e:t,target:n,transform:i};n._scaling&&(n._scaling=!1),n.setCoords(),(i.actionPerformed||this.stateful&&n.hasStateChanged())&&(i.actionPerformed&&(e=this._addEventOptions(r,i),this._fire(e,r)),this._fire("modified",r))},_addEventOptions:function(t,e){var i,n;switch(e.action){case"scaleX":i="scaled",n="x";break;case"scaleY":i="scaled",n="y";break;case"skewX":i="skewed",n="x";break;case"skewY":i="skewed",n="y";break;case"scale":i="scaled",n="equally";break;case"rotate":i="rotated";break;case"drag":i="moved"}return t.by=n,i},_onMouseDownInDrawingMode:function(t){this._isCurrentlyDrawing=!0,this.getActiveObject()&&this.discardActiveObject(t).requestRenderAll(),this.clipTo&&n.util.clipContext(this,this.contextTop);var e=this.getPointer(t);this.freeDrawingBrush.onMouseDown(e),this._handleEvent(t,"down")},_onMouseMoveInDrawingMode:function(t){if(this._isCurrentlyDrawing){var e=this.getPointer(t);this.freeDrawingBrush.onMouseMove(e)}this.setCursor(this.freeDrawingCursor),this._handleEvent(t,"move")},_onMouseUpInDrawingMode:function(t){this._isCurrentlyDrawing=!1,this.clipTo&&this.contextTop.restore(
3),this.freeDrawingBrush.onMouseUp(),this._handleEvent(t,"up")},__onMouseDown:function(t){this._cacheTransformEventData(t),this._handleEvent(t,"down:before");var e=this._target;if(s(t,3))this.fireRightClick&&this._handleEvent(t,"down",3);else if(s(t,2))this.fireMiddleClick&&this._handleEvent(t,"down",2);else if(this.isDrawingMode)this._onMouseDownInDrawingMode(t);else if(!this._currentTransform){var i=this._pointer;this._previousPointer=i;var n=this._shouldRender(e,i),r=this._shouldGroup(t,e);this._shouldClearSelection(t,e)?this.discardActiveObject(t):r&&(this._handleGrouping(t,e),e=this._activeObject),!this.selection||e&&(e.selectable||e.isEditing||e===this._activeObject)||(this._groupSelector={ex:i.x,ey:i.y,top:0,left:0}),e&&(e.selectable&&this.setActiveObject(e,t),e!==this._activeObject||!e.__corner&&r||this._setupCurrentTransform(t,e)),this._handleEvent(t,"down"),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}),e.corner&&this.onBeforeScaleRotate(e.target)},__onMouseMove:function(t){var e,i;if(this._handleEvent(t,"move:before"),this._cacheTransformEventData(t),this.isDrawingMode)this._onMouseMoveInDrawingMode(t);else if(!(void 0!==t.touches&&t.touches.length>1)){var n=this._groupSelector;n?(i=this._pointer,n.left=i.x-n.ex,n.top=i.y-n.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){this.fireSynteticInOutEvents(t,e,{targetName:"_hoveredTarget",canvasEvtOut:"mouse:out",evtOut:"mouseout",canvasEvtIn:"mouse:over",evtIn:"mouseover"})},_fireEnterLeaveEvents:function(t,e){this.fireSynteticInOutEvents(t,e,{targetName:"_draggedoverTarget",evtOut:"dragleave",evtIn:"dragenter"})},fireSynteticInOutEvents:function(t,e,i){var n,r,o,s=this[i.targetName],a=s!==t,l=i.canvasEvtIn,c=i.canvasEvtOut;a&&(n={e:e,target:t,previousTarget:s},r={e:e,target:s,nextTarget:t},this[i.targetName]=t),o=t&&a,s&&a&&(c&&this.fire(c,r),s.fire(i.evtOut,r)),o&&(l&&this.fire(l,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.target.isMoving=!0,i.shiftKey=t.shiftKey,i.altKey=t[this.centeredKey],this._beforeScaleTransform(t,i),this._performTransformAction(t,i,e),i.actionPerformed&&this.requestRenderAll()},_performTransformAction:function(t,e,i){var n=i.x,r=i.y,o=e.action,s=!1,a={target:e.target,e:t,transform:e,pointer:i};"rotate"===o?(s=this._rotateObject(n,r))&&this._fire("rotating",a):"scale"===o?(s=this._onScale(t,e,n,r))&&this._fire("scaling",a):"scaleX"===o?(s=this._scaleObject(n,r,"x"))&&this._fire("scaling",a):"scaleY"===o?(s=this._scaleObject(n,r,"y"))&&this._fire("scaling",a):"skewX"===o?(s=this._skewObject(n,r,"x"))&&this._fire("skewing",a):"skewY"===o?(s=this._skewObject(n,r,"y"))&&this._fire("skewing",a):(s=this._translateObject(n,r))&&(this._fire("moving",a),this.setCursor(a.target.moveCursor||this.moveCursor)),e.actionPerformed=e.actionPerformed||s},_fire:function(t,e){this.fire("object:"+t,e),e.target.fire(t,e)},_beforeScaleTransform:function(t,e){if("scale"===e.action||"scaleX"===e.action||"scaleY"===e.action){var i=this._shouldCenterTransform(e.target);(i&&("center"!==e.originX||"center"!==e.originY)||!i&&"center"===e.originX&&"center"===e.originY)&&(this._resetCurrentTransform(),e.reset=!0)}},_onScale:function(t,e,i,n){return this._isUniscalePossible(t,e.target)?(e.currentAction="scale",this._scaleObject(i,n)):(e.reset||"scale"!==e.currentAction||this._resetCurrentTransform(),e.currentAction="scaleEqually",this._scaleObject(i,n,"equally"))},_isUniscalePossible:function(t,e){return(t[this.uniScaleKey]||this.uniScaleTransform)&&!e.get("lockUniScaling")},_setCursorFromEvent:function(t,e){if(!e)return this.setCursor(this.defaultCursor),!1;
3var i=e.hoverCursor||this.hoverCursor,n=this._activeObject&&"activeSelection"===this._activeObject.type?this._activeObject:null,r=(!n||!n.contains(e))&&e._findTargetCorner(this.getPointer(t,!0));r?this.setCursor(this.getCornerCursor(r,e,t)):this.setCursor(i)},getCornerCursor:function(e,i,n){return this.actionIsDisabled(e,i,n)?this.notAllowedCursor:e in t?this._getRotatedCornerCursor(e,i,n):"mtr"===e&&i.hasRotatingPoint?this.rotationCursor:this.defaultCursor},actionIsDisabled:function(t,e,i){return"mt"===t||"mb"===t?i[this.altActionKey]?e.lockSkewingX:e.lockScalingY:"ml"===t||"mr"===t?i[this.altActionKey]?e.lockSkewingY:e.lockScalingX:"mtr"===t?e.lockRotation:this._isUniscalePossible(i,e)?e.lockScalingX&&e.lockScalingY:e.lockScalingX||e.lockScalingY},_getRotatedCornerCursor:function(e,i,n){var r=Math.round(i.angle%360/45);return r<0&&(r+=8),r+=t[e],n[this.altActionKey]&&t[e]%2==0&&(r+=2),r%=8,this.cursorMap[r]}})}(),function(){var t=Math.min,e=Math.max;n.util.object.extend(n.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)},_handleGrouping:function(t,e){var i=this._activeObject;i.__corner||(e!==i||(e=this.findTarget(t,!0)))&&(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,1===i.size()&&this._setActiveObject(i.item(0),e)):(i.addWithUpdate(t),this._hoveredTarget=i),this._fireSelectionEvents(n,e)},_createActiveSelection:function(t,e){var i=this.getActiveObjects(),n=this._createGroup(t);this._hoveredTarget=n,this._setActiveObject(n,e),this._fireSelectionEvents(i,e)},_createGroup:function(t){var e=this.getObjects(),i=e.indexOf(this._activeObject)<e.indexOf(t)?[this._activeObject,t]:[t,this._activeObject];return this._activeObject.isEditing&&this._activeObject.exitEditing(),new n.ActiveSelection(i,{canvas:this})},_groupSelectedObjects:function(t){var e,i=this._collectObjects();1===i.length?this.setActiveObject(i[0],t):i.length>1&&(e=new n.ActiveSelection(i.reverse(),{canvas:this}),this.setActiveObject(e,t))},_collectObjects:function(){for(var i,r=[],o=this._groupSelector.ex,s=this._groupSelector.ey,a=o+this._groupSelector.left,l=s+this._groupSelector.top,c=new n.Point(t(o,a),t(s,l)),h=new n.Point(e(o,a),e(s,l)),u=!this.selectionFullyContained,d=o===a&&s===l,f=this._objects.length;f--&&!((i=this._objects[f])&&i.selectable&&i.visible&&(u&&i.intersectsWithRect(c,h)||i.isContainedWithinRect(c,h)||u&&i.containsPoint(c)||u&&i.containsPoint(h))&&(r.push(i),d)););return r},_maybeGroupObjects:function(t){this.selection&&this._groupSelector&&this._groupSelectedObjects(t),this.setCursor(this.defaultCursor),this._groupSelector=null}})}(),function(){var t=n.StaticCanvas.supports("toDataURLWithQuality");n.util.object.extend(n.StaticCanvas.prototype,{toDataURL:function(t){t||(t={});var e=t.format||"png",i=t.quality||1,n=(t.multiplier||1)*(t.enableRetinaScaling?1:1/this.getRetinaScaling()),r={left:t.left||0,top:t.top||0,width:t.width||0,height:t.height||0};return this.__toDataURLWithMultiplier(e,i,r,n)},__toDataURLWithMultiplier:function(t,e,i,n){var r=this.width,o=this.height,s=(i.width||this.width)*n,a=(i.height||this.height)*n,l=this.getZoom()*n,c=this.viewportTransform,h=[l,0,0,l,(c[4]-i.left)*n,(c[5]-i.top)*n],u=this.interactive,d=this.skipOffscreen,f=r!==s||o!==a;this.viewportTransform=h,this.skipOffscreen=!1,this.interactive=!1,f&&this.setDimensions({width:s,height:a},{backstoreOnly:!0}),this.renderAll();var g=this.__toDataURL(t,e,i);return this.interactive=u,this.skipOffscreen=d,this.viewportTransform=c,f&&this.setDimensions({width:r,height:o},{backstoreOnly:!0}),this.renderAll(),g},__toDataURL:function(e,i){var n=this.contextContainer.canvas;return"jpg"===e&&(e="jpeg"),t?n.toDataURL("image/"+e,i):n.toDataURL("image/"+e)}})}(),n.util.object.extend(n.StaticCanvas.prototype,{loadFromDatalessJSON:function(t,e,i){return this.loadFromJSON(t,e,i)}
3,loadFromJSON:function(t,e,i){if(t){var r="string"==typeof t?JSON.parse(t):n.util.object.clone(t),o=this,s=this.renderOnAddRemove;return this.renderOnAddRemove=!1,this._enlivenObjects(r.objects,function(t){o.clear(),o._setBgOverlay(r,function(){t.forEach(function(t,e){o.insertAt(t,e)}),o.renderOnAddRemove=s,delete r.objects,delete r.backgroundImage,delete r.overlayImage,delete r.background,delete r.overlay,o._setOptions(r),o.renderAll(),e&&e()})},i),this}},_setBgOverlay:function(t,e){var i={backgroundColor:!1,overlayColor:!1,backgroundImage:!1,overlayImage:!1};if(t.backgroundImage||t.overlayImage||t.background||t.overlay){var n=function(){i.backgroundImage&&i.overlayImage&&i.backgroundColor&&i.overlayColor&&e&&e()};this.__setBgOverlay("backgroundImage",t.backgroundImage,i,n),this.__setBgOverlay("overlayImage",t.overlayImage,i,n),this.__setBgOverlay("backgroundColor",t.background,i,n),this.__setBgOverlay("overlayColor",t.overlay,i,n)}else e&&e()},__setBgOverlay:function(t,e,i,r){var o=this;if(!e)return i[t]=!0,void(r&&r());"backgroundImage"===t||"overlayImage"===t?n.util.enlivenObjects([e],function(e){o[t]=e[0],i[t]=!0,r&&r()}):this["set"+n.util.string.capitalize(t,!0)](e,function(){i[t]=!0,r&&r()})},_enlivenObjects:function(t,e,i){t&&0!==t.length?n.util.enlivenObjects(t,function(t){e&&e(t)},null,i):e&&e([])},_toDataURL:function(t,e){this.clone(function(i){e(i.toDataURL(t))})},_toDataURLWithMultiplier:function(t,e,i){this.clone(function(n){i(n.toDataURLWithMultiplier(t,e))})},clone:function(t,e){var i=JSON.stringify(this.toJSON(e));this.cloneWithoutData(function(e){e.loadFromJSON(i,function(){t&&t(e)})})},cloneWithoutData:function(t){var e=n.document.createElement("canvas");e.width=this.width,e.height=this.height;var i=new n.Canvas(e);i.clipTo=this.clipTo,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(){var t=n.util.degreesToRadians,e=n.util.radiansToDegrees;n.util.object.extend(n.Canvas.prototype,{__onTransformGesture:function(t,e){if(!this.isDrawingMode&&t.touches&&2===t.touches.length&&"gesture"===e.gesture){var i=this.findTarget(t);void 0!==i&&(this.__gesturesParams={e:t,self:e,target:i},this.__gesturesRenderer()),this.fire("touch:gesture",{target:i,e:t,self:e})}},__gesturesParams:null,__gesturesRenderer:function(){if(null!==this.__gesturesParams&&null!==this._currentTransform){var t=this.__gesturesParams.self,e=this._currentTransform,i=this.__gesturesParams.e;e.action="scale",e.originX=e.originY="center",this._scaleObjectBy(t.scale,i),0!==t.rotation&&(e.action="rotate",this._rotateObjectByAngle(t.rotation,i)),this.requestRenderAll(),e.action="drag"}},__onDrag:function(t,e){this.fire("touch:drag",{e:t,self:e})},__onOrientationChange:function(t,e){this.fire("touch:orientation",{e:t,self:e})},__onShake:function(t,e){this.fire("touch:shake",{e:t,self:e})},__onLongPress:function(t,e){this.fire("touch:longpress",{e:t,self:e})},_scaleObjectBy:function(t,e){var i=this._currentTransform,r=i.target,o=r.get("lockScalingX"),s=r.get("lockScalingY");if(!o||!s){r._scaling=!0;var a=r.translateToOriginPoint(r.getCenterPoint(),i.originX,i.originY),l=r._getTransformedDimensions();this._setObjectScale(new n.Point(i.scaleX*l.x*t/r.scaleX,i.scaleY*l.y*t/r.scaleY),i,o,s,null,r.get("lockScalingFlip"),l),r.setPositionByOrigin(a,i.originX,i.originY),this._fire("scaling",r,e)}},_rotateObjectByAngle:function(i,n){var r=this._currentTransform;r.target.get("lockRotation")||(r.target.rotate(e(t(i)+r.theta)),this._fire("rotating",r.target,n))}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r=e.util.toFixed,o=e.util.string.capitalize,s=e.util.degreesToRadians,a=e.StaticCanvas.supports("setLineDash"),l=!e.isLikelyNode;e.Object||(e.Object=e.util.createClass(e.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,transparentCorners:!0,hoverCurs
3or:null,moveCursor:null,padding:0,borderColor:"rgba(102,153,255,0.75)",borderDashArray:null,cornerColor:"rgba(102,153,255,0.5)",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,strokeLineCap:"butt",strokeLineJoin:"miter",strokeMiterLimit:4,shadow:null,borderOpacityWhenMoving:.4,borderScaleFactor:1,transformMatrix:null,minScaleLimit:0,selectable:!0,evented:!0,visible:!0,hasControls:!0,hasBorders:!0,hasRotatingPoint:!0,rotatingPointOffset:40,perPixelTargetFind:!1,includeDefaultValues:!0,clipTo:null,lockMovementX:!1,lockMovementY:!1,lockRotation:!1,lockScalingX:!1,lockScalingY:!1,lockUniScaling:!1,lockSkewingX:!1,lockSkewingY:!1,lockScalingFlip:!1,excludeFromExport:!1,objectCaching:l,statefullCache:!1,noScaleCache:!0,dirty:!0,__corner:0,paintFirst:"fill",stateProperties:"top left width height scaleX scaleY flipX flipY originX originY transformMatrix stroke strokeWidth strokeDashArray strokeLineCap strokeLineJoin strokeMiterLimit angle opacity fill globalCompositeOperation shadow clipTo visible backgroundColor skewX skewY fillRule paintFirst".split(" "),cacheProperties:"fill stroke strokeWidth strokeDashArray width height paintFirst strokeLineCap strokeLineJoin strokeMiterLimit backgroundColor".split(" "),initialize:function(t){t&&this.setOptions(t)},_createCacheCanvas:function(){this._cacheProperties={},this._cacheCanvas=e.document.createElement("canvas"),this._cacheContext=this._cacheCanvas.getContext("2d"),this._updateCacheCanvas(),this.dirty=!0},_limitCacheSize:function(t){var i=e.perfLimitSizeTotal,n=t.width,r=t.height,o=e.maxCacheSideLimit,s=e.minCacheSideLimit;if(n<=o&&r<=o&&n*r<=i)return n<s&&(t.width=s),r<s&&(t.height=s),t;var a=n/r,l=e.util.limitDimsByArea(a,i),c=e.util.capValue,h=c(s,l.x,o),u=c(s,l.y,o);return n>h&&(t.zoomX/=n/h,t.width=h,t.capped=!0),r>u&&(t.zoomY/=r/u,t.height=u,t.capped=!0),t},_getCacheCanvasDimensions:function(){var t=this.canvas&&this.canvas.getZoom()||1,i=this.getObjectScaling(),n=this.canvas&&this.canvas._isRetinaScaling()?e.devicePixelRatio:1,r=this._getNonTransformedDimensions(),o=i.scaleX*t*n,s=i.scaleY*t*n;return{width:r.x*o+2,height:r.y*s+2,zoomX:o,zoomY:s,x:r.x,y:r.y}},_updateCacheCanvas:function(){if(this.noScaleCache&&this.canvas&&this.canvas._currentTransform){var t=this.canvas._currentTransform.target,i=this.canvas._currentTransform.action;if(this===t&&i.slice&&"scale"===i.slice(0,5))return!1}var n,r,o=this._cacheCanvas,s=this._limitCacheSize(this._getCacheCanvasDimensions()),a=e.minCacheSideLimit,l=s.width,c=s.height,h=s.zoomX,u=s.zoomY,d=l!==this.cacheWidth||c!==this.cacheHeight,f=this.zoomX!==h||this.zoomY!==u,g=d||f,p=0,m=0,v=!1;if(d){var w=this._cacheCanvas.width,y=this._cacheCanvas.height,b=l>w||c>y;v=b||(l<.9*w||c<.9*y)&&w>a&&y>a,b&&!s.capped&&(l>a||c>a)&&(p=.1*l,m=.1*c)}return!!g&&(v?(o.width=Math.ceil(l+p),o.height=Math.ceil(c+m)):(this._cacheContext.setTransform(1,0,0,1,0,0),this._cacheContext.clearRect(0,0,o.width,o.height)),n=s.x*h/2,r=s.y*u/2,this.cacheTranslationX=Math.round(o.width/2-n)+n,this.cacheTranslationY=Math.round(o.height/2-r)+r,this.cacheWidth=l,this.cacheHeight=c,this._cacheContext.translate(this.cacheTranslationX,this.cacheTranslationY),this._cacheContext.scale(h,u),this.zoomX=h,this.zoomY=u,!0)},setOptions:function(t){this._setOptions(t),this._initGradient(t.fill,"fill"),this._initGradient(t.stroke,"stroke"),this._initClipping(t),this._initPattern(t.fill,"fill"),this._initPattern(t.stroke,"stroke")},transform:function(t){var e;e=this.group&&!this.group._transformDone?this.calcTransformMatrix():this.calcOwnMatrix(),t.transform(e[0],e[1],e[2],e[3],e[4],e[5])},toObject:function(t){var i=e.Object.NUM_FRACTION_DIGITS,n={type:this.type,version:e.version,originX:this.originX,originY:this.originY,left:r(this.left,i),top:r(this.top,i),width:r(this.width,i),height:r(this.height,i),fill:this.fill&&this.fill.toObject?this.fill.toObject():this.fill,stroke:this.stroke&&this.stroke.toObject?this.stroke.toObject():this.stroke,strokeWidth:r(this.strokeWidth,i),strokeDashArray:this.strokeDashArray?this.strokeDashArray.concat():this.strokeDashArray,strokeLineCap:this.strokeLineCap,strokeLineJoin:this.strokeLineJoin,strokeMiterLimit:r(this.strokeMiterLimit,i),scaleX:r(this.scaleX,i),scaleY:r(this.scaleY,i),angle:r(this.angle,i),flipX:this.flipX,flipY:this.flipY,opacity:r(this.opacity,i),shadow:this.shadow&&this.shadow.toObject?this.shadow.toObject():this.shadow,visible:this.visible,clipTo:this.clipTo&&String(this.clipTo),backgroundColor:this.backgroundColor,fillRule:this.fillRule,paintFirst:this.paintFirst,globalCompositeOperation:this.globalCompositeOperation,transformMatrix:this.transformMatrix?this.transformMatrix.concat():null,
3skewX:r(this.skewX,i),skewY:r(this.skewY,i)};return e.util.populateWithProperties(this,n,t),this.includeDefaultValues||(n=this._removeDefaultValues(n)),n},toDatalessObject:function(t){return this.toObject(t)},_removeDefaultValues:function(t){var i=e.util.getKlass(t.type).prototype;return i.stateProperties.forEach(function(e){t[e]===i[e]&&delete t[e],"[object Array]"===Object.prototype.toString.call(t[e])&&"[object Array]"===Object.prototype.toString.call(i[e])&&0===t[e].length&&0===i[e].length&&delete t[e]}),t},toString:function(){return"#<fabric."+o(this.type)+">"},getObjectScaling:function(){var t=this.scaleX,e=this.scaleY;if(this.group){var i=this.group.getObjectScaling();t*=i.scaleX,e*=i.scaleY}return{scaleX:t,scaleY:e}},getObjectOpacity:function(){var t=this.opacity;return this.group&&(t*=this.group.getObjectOpacity()),t},_set:function(t,i){var n="scaleX"===t||"scaleY"===t,r=this[t]!==i,o=!1;return n&&(i=this._constrainScale(i)),"scaleX"===t&&i<0?(this.flipX=!this.flipX,i*=-1):"scaleY"===t&&i<0?(this.flipY=!this.flipY,i*=-1):"shadow"!==t||!i||i instanceof e.Shadow?"dirty"===t&&this.group&&this.group.set("dirty",i):i=new e.Shadow(i),this[t]=i,r&&(o=this.group&&this.group.isOnACache(),this.cacheProperties.indexOf(t)>-1?(this.dirty=!0,o&&this.group.set("dirty",!0)):o&&this.stateProperties.indexOf(t)>-1&&this.group.set("dirty",!0)),this},setOnGroup:function(){},getViewportTransform:function(){return this.canvas&&this.canvas.viewportTransform?this.canvas.viewportTransform:e.iMatrix.concat()},isNotVisible:function(){return 0===this.opacity||0===this.width&&0===this.height||!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.transformMatrix&&t.transform.apply(t,this.transformMatrix),this.clipTo&&e.util.clipContext(this,t),this.shouldCache()?(this._cacheCanvas||this._createCacheCanvas(),this.isCacheDirty()&&(this.statefullCache&&this.saveState({propertySet:"cacheProperties"}),this.drawObject(this._cacheContext),this.dirty=!1),this.drawCacheOnCanvas(t)):(this._removeCacheCanvas(),this.dirty=!1,this.drawObject(t),this.objectCaching&&this.statefullCache&&this.saveState({propertySet:"cacheProperties"})),this.clipTo&&t.restore(),t.restore())},_removeCacheCanvas:function(){this._cacheCanvas=null,this.cacheWidth=0,this.cacheHeight=0},needsItsOwnCache:function(){return"stroke"===this.paintFirst&&"object"==typeof this.shadow},shouldCache:function(){return this.ownCaching=this.objectCaching&&(!this.group||this.needsItsOwnCache()||!this.group.isOnACache()),this.ownCaching},willDrawShadow:function(){return!!this.shadow&&(0!==this.shadow.offsetX||0!==this.shadow.offsetY)},drawObject:function(t){this._renderBackground(t),this._setStrokeStyles(t,this),this._setFillStyles(t,this),this._render(t)},drawCacheOnCanvas:function(t){t.scale(1/this.zoomX,1/this.zoomY),t.drawImage(this._cacheCanvas,-this.cacheTranslationX,-this.cacheTranslationY)},isCacheDirty:function(t){if(this.isNotVisible())return!1;if(this._cacheCanvas&&!t&&this._updateCacheCanvas())return!0;if(this.dirty||this.statefullCache&&this.hasStateChanged("cacheProperties")){if(this._cacheCanvas&&!t){var e=this.cacheWidth/this.zoomX,i=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-e/2,-i/2,e,i)}return!0}return!1},_renderBackground:function(t){if(this.backgroundColor){var 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){e.stroke&&(t.lineWidth=e.strokeWidth,t.lineCap=e.strokeLineCap,t.lineJoin=e.strokeLineJoin,t.miterLimit=e.strokeMiterLimit,t.strokeStyle=e.stroke.toLive?e.stroke.toLive(t,this):e.stroke)},_setFillStyles:function(t,e){e.fill&&(t.fillStyle=e.fill.toLive?e.fill.toLive(t,this):e.fill)},_setLineDash:function(t,e,i){e&&(1&e.length&&e.push.apply(e,e),a?t.setLineDash(e):i&&i(t))},_renderControls:function(t,i){var n,r,o,a=this.getViewportTransform(),l=this.calcTransformMatrix();r=void 0!==(i=i||{}).hasBorders?i.hasBorders:this.hasBorders,o=void 0!==i.hasControls?i.hasControls:this.hasControls,l=e.util.multiplyTransformMatrices(a,l),n=e.util.qrDecompose(l),t.save(),t.translate(n.translateX,n.translateY),t.lineWidth=1*this.borderScaleFactor,this.group||(t.globalAlpha=this.isMoving?this.borderOpacityWhenMoving:1),i.forActiveSelection?(t.rotate(s(n.angle)),r&&this.drawBordersInGroup(t,n,i)):(t.rotate(s(this.angle)),r&&this.drawBorders(t,i)),o&&this.drawControls(t,i),t.restore(
3)},_setShadow:function(t){if(this.shadow){var i=this.canvas&&this.canvas.viewportTransform[0]||1,n=this.canvas&&this.canvas.viewportTransform[3]||1,r=this.getObjectScaling();this.canvas&&this.canvas._isRetinaScaling()&&(i*=e.devicePixelRatio,n*=e.devicePixelRatio),t.shadowColor=this.shadow.color,t.shadowBlur=this.shadow.blur*e.browserShadowBlurConstant*(i+n)*(r.scaleX+r.scaleY)/4,t.shadowOffsetX=this.shadow.offsetX*i*r.scaleX,t.shadowOffsetY=this.shadow.offsetY*n*r.scaleY}},_removeShadow:function(t){this.shadow&&(t.shadowColor="",t.shadowBlur=t.shadowOffsetX=t.shadowOffsetY=0)},_applyPatternGradientTransform:function(t,e){if(!e||!e.toLive)return{offsetX:0,offsetY:0};var i=e.gradientTransform||e.patternTransform,n=-this.width/2+e.offsetX||0,r=-this.height/2+e.offsetY||0;return t.translate(n,r),i&&t.transform(i[0],i[1],i[2],i[3],i[4],i[5]),{offsetX:n,offsetY:r}},_renderPaintInOrder:function(t){"stroke"===this.paintFirst?(this._renderStroke(t),this._renderFill(t)):(this._renderFill(t),this._renderStroke(t))},_renderFill:function(t){this.fill&&(t.save(),this._applyPatternGradientTransform(t,this.fill),"evenodd"===this.fillRule?t.fill("evenodd"):t.fill(),t.restore())},_renderStroke:function(t){this.stroke&&0!==this.strokeWidth&&(this.shadow&&!this.shadow.affectStroke&&this._removeShadow(t),t.save(),this._setLineDash(t,this.strokeDashArray,this._renderDashedStroke),this._applyPatternGradientTransform(t,this.stroke),t.stroke(),t.restore())},_findCenterFromElement:function(){return{x:this.left+this.width/2,y:this.top+this.height/2}},_assignTransformMatrixProps:function(){if(this.transformMatrix){var t=e.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 i=this._findCenterFromElement();this.transformMatrix&&(this._assignTransformMatrixProps(),i=e.util.transformPoint(i,this.transformMatrix)),this.transformMatrix=null,t&&(this.scaleX*=t.scaleX,this.scaleY*=t.scaleY,this.cropX=t.cropX,this.cropY=t.cropY,i.x+=t.offsetLeft,i.y+=t.offsetTop,this.width=t.width,this.height=t.height),this.setPositionByOrigin(i,"center","center")},clone:function(t,i){var n=this.toObject(i);this.constructor.fromObject?this.constructor.fromObject(n,t):e.Object._fromObject("Object",n,t)},cloneAsImage:function(t,i){var n=this.toDataURL(i);return e.util.loadImage(n,function(i){t&&t(new e.Image(i))}),this},toDataURL:function(t){t||(t={});var i=e.util.createCanvasElement(),n=this.getBoundingRect();i.width=n.width,i.height=n.height,e.util.wrapElement(i,"div");var r=new e.StaticCanvas(i,{enableRetinaScaling:t.enableRetinaScaling,renderOnAddRemove:!1,skipOffscreen:!1});"jpg"===t.format&&(t.format="jpeg"),"jpeg"===t.format&&(r.backgroundColor="#fff");var o={left:this.left,top:this.top};this.setPositionByOrigin(new e.Point(r.width/2,r.height/2),"center","center");var s=this.canvas;r.add(this);var a=r.toDataURL(t);return this.set(o).setCoords(),this.canvas=s,r._objects=[],r.dispose(),r=null,a},isType:function(t){return this.type===t},complexity:function(){return 1},toJSON:function(t){return this.toObject(t)},setGradient:function(t,i){i||(i={});var n={colorStops:[]};return n.type=i.type||(i.r1||i.r2?"radial":"linear"),n.coords={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},(i.r1||i.r2)&&(n.coords.r1=i.r1,n.coords.r2=i.r2),n.gradientTransform=i.gradientTransform,e.Gradient.prototype.addColorStop.call(n,i.colorStops),this.set(t,e.Gradient.forObject(this,n))},setPatternFill:function(t){return this.set("fill",new e.Pattern(t))},setShadow:function(t){return this.set("shadow",t?new e.Shadow(t):null)},setColor:function(t){return this.set("fill",t),this},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,i){i=i||this.canvas.getPointer(t);
vendor: 4,079 bytes, line 3
3var n=new e.Point(i.x,i.y),r=this._getLeftTopCoords();return this.angle&&(n=e.util.rotatePoint(n,r,s(-this.angle))),{x:n.x-r.x,y:n.y-r.y}},_setupCompositeOperation:function(t){this.globalCompositeOperation&&(t.globalCompositeOperation=this.globalCompositeOperation)}}),e.util.createAccessors&&e.util.createAccessors(e.Object),i(e.Object.prototype,e.Observable),e.Object.NUM_FRACTION_DIGITS=2,e.Object._fromObject=function(t,i,r,o){var s=e[t];i=n(i,!0),e.util.enlivenPatterns([i.fill,i.stroke],function(t){void 0!==t[0]&&(i.fill=t[0]),void 0!==t[1]&&(i.stroke=t[1]);var e=o?new s(i[o],i):new s(i);r&&r(e)})},e.Object.__uid=0)}(e),function(){var t=n.util.degreesToRadians,e={left:-.5,center:0,right:.5},i={top:-.5,center:0,bottom:.5};n.util.object.extend(n.Object.prototype,{translateToGivenOrigin:function(t,r,o,s,a){var l,c,h,u=t.x,d=t.y;return"string"==typeof r?r=e[r]:r-=.5,"string"==typeof s?s=e[s]:s-=.5,l=s-r,"string"==typeof o?o=i[o]:o-=.5,"string"==typeof a?a=i[a]:a-=.5,c=a-o,(l||c)&&(h=this._getTransformedDimensions(),u=t.x+l*h.x,d=t.y+c*h.y),new n.Point(u,d)},translateToCenterPoint:function(e,i,r){var o=this.translateToGivenOrigin(e,i,r,"center","center");return this.angle?n.util.rotatePoint(o,e,t(this.angle)):o},translateToOriginPoint:function(e,i,r){var o=this.translateToGivenOrigin(e,"center","center",i,r);return this.angle?n.util.rotatePoint(o,e,t(this.angle)):o},getCenterPoint:function(){var t=new n.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(e,i,r){var o,s,a=this.getCenterPoint();return o=void 0!==i&&void 0!==r?this.translateToGivenOrigin(a,"center","center",i,r):new n.Point(this.left,this.top),s=new n.Point(e.x,e.y),this.angle&&(s=n.util.rotatePoint(s,a,-t(this.angle))),s.subtractEquals(o)},setPositionByOrigin:function(t,e,i){var n=this.translateToCenterPoint(t,e,i),r=this.translateToOriginPoint(n,this.originX,this.originY);this.set("left",r.x),this.set("top",r.y)},adjustPosition:function(i){var r,o,s=t(this.angle),a=this.getScaledWidth(),l=n.util.cos(s)*a,c=n.util.sin(s)*a;r="string"==typeof this.originX?e[this.originX]:this.originX-.5,o="string"==typeof i?e[i]:i-.5,this.left+=l*(o-r),this.top+=c*(o-r),this.setCoords(),this.originX=i},_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")}})}(),function(){var t=n.util.degreesToRadians,e=n.util.multiplyTransformMatrices,i=n.util.transformPoint;n.util.object.extend(n.Object.prototype,{oCoords:null,aCoords:null,ownMatrixCache:null,matrixCache:null,getCoords:function(t,e){this.oCoords||this.setCoords();var i=t?this.aCoords:this.oCoords;return function(t){return[new n.Point(t.tl.x,t.tl.y),new n.Point(t.tr.x,t.tr.y),new n.Point(t.br.x,t.br.y),new n.Point(t.bl.x,t.bl.y)]}(e?this.calcCoords(t):i)},intersectsWithRect:function(t,e,i,r){var o=this.getCoords(i,r);return"Intersection"===n.Intersection.intersectPolygonRectangle(o,t,e).status},intersectsWithObject:function(t,e,i){return"Intersection"===n.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),r=0,o=t._getImageLines(i?t.calcCoords(e):e?t.aCoords:t.oCoords);r<4;r++)if(!t.containsPoint(n[r],o))return!1;return!0},isContainedWithinRect:function(t,e,i,n){var r=this.getBoundingRect(i,n);return r.left>=t.x&&r.left+r.width<=e.x&&r.top>=t.y&&r.top+r.height<=e.y}
3,containsPoint:function(t,e,i,n){e=e||this._getImageLines(n?this.calcCoords(i):i?this.aCoords:this.oCoords);var r=this._findCrossPoints(t,e);return 0!==r&&r%2==1},isOnScreen:function(t){if(!this.canvas)return!1;for(var e,i=this.canvas.vptCoords.tl,n=this.canvas.vptCoords.br,r=this.getCoords(!0,t),o=0;o<4;o++)if((e=r[o]).x<=n.x&&e.x>=i.x&&e.y<=n.y&&e.y>=i.y)return!0;return!!this.intersectsWithRect(i,n,!0,t)||this._containsCenterOfCanvas(i,n,t)},_containsCenterOfCanvas:function(t,e,i){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2};return!!this.containsPoint(n,null,!0,i)},isPartiallyOnScreen:function(t){if(!this.canvas)return!1;var e=this.canvas.vptCoords.tl,i=this.canvas.vptCoords.br;return!!this.intersectsWithRect(e,i,!0,t)||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,r,o,s=0;for(var a in e)if(!((o=e[a]).o.y<t.y&&o.d.y<t.y||o.o.y>=t.y&&o.d.y>=t.y||(o.o.x===o.d.x&&o.o.x>=t.x?r=o.o.x:(i=0,n=(o.d.y-o.o.y)/(o.d.x-o.o.x),r=-(t.y-i*t.x-(o.o.y-n*o.o.x))/(i-n)),r>=t.x&&(s+=1),2!==s)))break;return s},getBoundingRect:function(t,e){var i=this.getCoords(t,e);return n.util.makeBoundingBoxFromPoints(i)},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){var i=this.getBoundingRect(e).width/this.getScaledWidth();return this.scale(t/this.width/i)},scaleToHeight:function(t,e){var i=this.getBoundingRect(e).height/this.getScaledHeight();return this.scale(t/this.height/i)},calcCoords:function(r){var o=this._calcRotateMatrix(),s=this._calcTranslateMatrix(),a=e(s,o),l=this.getViewportTransform(),c=r?a:e(l,a),h=this._getTransformedDimensions(),u=h.x/2,d=h.y/2,f=i({x:-u,y:-d},c),g=i({x:u,y:-d},c),p=i({x:-u,y:d},c),m=i({x:u,y:d},c);if(!r){var v=this.padding,w=t(this.angle),y=n.util.cos(w),b=n.util.sin(w),x=y*v,_=b*v,C=x+_,S=x-_;v&&(f.x-=S,f.y-=C,g.x+=C,g.y-=S,p.x-=C,p.y+=S,m.x+=S,m.y+=C);var T=new n.Point((f.x+p.x)/2,(f.y+p.y)/2),O=new n.Point((g.x+f.x)/2,(g.y+f.y)/2),k=new n.Point((m.x+g.x)/2,(m.y+g.y)/2),E=new n.Point((m.x+p.x)/2,(m.y+p.y)/2),A=new n.Point(O.x+b*this.rotatingPointOffset,O.y-y*this.rotatingPointOffset)}var P={tl:f,tr:g,br:m,bl:p};return r||(P.ml=T,P.mt=O,P.mr=k,P.mb=E,P.mtr=A),P},setCoords:function(t,e){return this.oCoords=this.calcCoords(t),e||(this.aCoords=this.calcCoords(!0)),t||this._setCornerCoords&&this._setCornerCoords(),this},_calcRotateMatrix:function(){if(this.angle){var e=t(this.angle),i=n.util.cos(e),r=n.util.sin(e);return[i,r,-r,i,0,0]}return n.iMatrix.concat()},_calcTranslateMatrix:function(){var t=this.getCenterPoint();return[1,0,0,1,t.x,t.y]},transformMatrixKey:function(t){var e="";return!t&&this.group&&(e=this.group.transformMatrixKey(t)+"_"),e+this.top+"_"+this.left+"_"+this.scaleX+"_"+this.scaleY+"_"+this.skewX+"_"+this.skewY+"_"+this.angle+"_"+this.originX+"_"+this.originY+"_"+this.width+"_"+this.height+"_"+this.strokeWidth+this.flipX+this.flipY},calcTransformMatrix:function(t){if(t)return this.calcOwnMatrix();var i=this.transformMatrixKey(),n=this.matrixCache||(this.matrixCache={});if(n.key===i)return n.value;var r=this.calcOwnMatrix();return this.group&&(r=e(this.group.calcTransformMatrix(),r)),n.key=i,n.value=r,r},calcOwnMatrix:function(){var t=this.transformMatrixKey(!0),i=this.ownMatrixCache||(this.ownMatrixCache={});if(i.key===t)return i.value;var n,r=this._calcTranslateMatrix(),o=this._calcDimensionsTransformMatrix(this.skewX,this.skewY,!0);return this.angle&&(n=this._calcRotateMatrix(),r=e(r,n)),r=e(r,o),i.key=t,i.value=r,r},_calcDimensionsTransformMatrix:function(i,n,r){var o,s=[this.scaleX*(r&&this.flipX?-1:1),0,0,this.scaleY*(r&&this.flipY?-1:1),0,0];return i&&(o=[1,0,Math.tan(t(i)),1],s=e(s,o,!0)),n&&(o=[1,Math.tan(t(n)),0,1],s=e(s,o,!0)),s},_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=this._getNonTransformedDimensions();if(0===t&&0===e)return{x:i.x*this.scaleX,y:i.y*this.scaleY};var r,o,s=i.x/2,a=i.y/2,l=[{x:-s,y:-a},{x:s,y:-a},{x:-s,y:a},{x:s,y:a}],c=this._calcDimensionsTransformMatrix(t,e,!1);for(r=0;r<l.length;r++)l[r]=n.util.transformPoint(l[r],c);return{x:(o=n.util.makeBoundingBoxFromPoints(l)).width,y:o.height}},_calculateCurrentDimensions:function(){var t=this.getViewportTransform(),e=this._getTransformedDimensions();return n.util.transformPoint(e,t,!0).scalarAdd(2*this.padding)}})}(),n.util.object.extend(n.Object.prototype,{sendToBack:function(){return this.group?n.StaticCanvas.prototype.sendToBack.call(this.group,this):this.canvas.sendToBack(this),this},bringToFront:function(){return this.group?n.StaticCanvas.prototype.bringToFront.call(this.group,this):this.canvas.bringToFront(this),this},sendBackwards:function(t){return this.group?n.StaticCanvas.prototype.sendBackwards.call(this.group,this,t):this.canvas.sendBackwards(this,t),this},bringForward:function(t){return this.group?n.StaticCanvas.prototype.bringForward.call(this.group,this,t):this.canvas.bringForward(this,t),this},moveTo:function(t){return this.group&&"activeSelection"!==this.group.type?n.StaticCanvas.prototype.moveTo.call(this.group,this,t):this.canvas.moveTo(this,t),this}}),function(){function t(t,e){if(e){if(e.toLive)return t+": url(#SVGID_"+e.id+"); ";var i=new n.Color(e),r=t+": "+i.toRgb()+"; ",o=i.getAlpha();return 1!==o&&(r+=t+"-opacity: "+o.toString()+"; "),r}return t+": none; "}var e=n.util.toFixed;n.util.object.extend(n.Object.prototype,{getSvgStyles:function(e){var i=this.fillRule,n=this.strokeWidth?this.strokeWidth:"0",r=this.strokeDashArray?this.strokeDashArray.join(" "):"none",o=this.strokeLineCap?this.strokeLineCap:"butt",s=this.strokeLineJoin?this.strokeLineJoin:"miter",a=this.strokeMiterLimit?this.strokeMiterLimit:"4",l=void 0!==this.opacity?this.opacity:"1",c=this.visible?"":" visibility: hidden;",h=e?"":this.getSvgFilter(),u=t("fill",this.fill);return[t("stroke",this.stroke),"stroke-width: ",n,"; ","stroke-dasharray: ",r,"; ","stroke-linecap: ",o,"; ","stroke-linejoin: ",s,"; ","stroke-miterlimit: ",a,"; ",u,"fill-rule: ",i,";
3 ","opacity: ",l,";",h,c].join("")},getSvgSpanStyles:function(e,i){var n=e.fontFamily?"font-family: "+(-1===e.fontFamily.indexOf("'")&&-1===e.fontFamily.indexOf('"')?"'"+e.fontFamily+"'":e.fontFamily)+"; ":"",r=e.strokeWidth?"stroke-width: "+e.strokeWidth+"; ":"",o=(n=n,e.fontSize?"font-size: "+e.fontSize+"px; ":""),s=e.fontStyle?"font-style: "+e.fontStyle+"; ":"",a=e.fontWeight?"font-weight: "+e.fontWeight+"; ":"",l=e.fill?t("fill",e.fill):"",c=e.stroke?t("stroke",e.stroke):"",h=this.getSvgTextDecoration(e),u=e.deltaY?"baseline-shift: "+-e.deltaY+"; ":"";return h&&(h="text-decoration: "+h+"; "),[c,r,n,o,s,a,h,l,u,i?"white-space: pre; ":""].join("")},getSvgTextDecoration:function(t){return"overline"in t||"underline"in t||"linethrough"in t?(t.overline?"overline ":"")+(t.underline?"underline ":"")+(t.linethrough?"line-through ":""):""},getSvgFilter:function(){return this.shadow?"filter: url(#SVGID_"+this.shadow.id+");":""},getSvgId:function(){return this.id?'id="'+this.id+'" ':""},getSvgTransform:function(){var t=this.angle,i=this.skewX%360,r=this.skewY%360,o=this.getCenterPoint(),s=n.Object.NUM_FRACTION_DIGITS,a="translate("+e(o.x,s)+" "+e(o.y,s)+")",l=0!==t?" rotate("+e(t,s)+")":"",c=1===this.scaleX&&1===this.scaleY?"":" scale("+e(this.scaleX,s)+" "+e(this.scaleY,s)+")",h=0!==i?" skewX("+e(i,s)+")":"",u=0!==r?" skewY("+e(r,s)+")":"";return[a,l,c,this.flipX?" matrix(-1 0 0 1 0 0) ":"",this.flipY?" matrix(1 0 0 -1 0 0)":"",h,u].join("")},getSvgTransformMatrix:function(){return this.transformMatrix?" matrix("+this.transformMatrix.join(" ")+") ":""},_setSVGBg:function(t){if(this.backgroundColor){var i=n.Object.NUM_FRACTION_DIGITS;t.push("\t\t<rect ",this._getFillAttributes(this.backgroundColor),' x="',e(-this.width/2,i),'" y="',e(-this.height/2,i),'" width="',e(this.width,i),'" height="',e(this.height,i),'"></rect>\n')}},_createBaseSVGMarkup:function(){var t=[];return this.fill&&this.fill.toLive&&t.push(this.fill.toSVG(this,!1)),this.stroke&&this.stroke.toLive&&t.push(this.stroke.toSVG(this,!1)),this.shadow&&t.push(this.shadow.toSVG(this)),t},addPaintOrder:function(){return"fill"!==this.paintFirst?' paint-order="'+this.paintFirst+'" ':""}})}(),function(){var t=n.util.object.extend;function e(e,i,n){var r={};n.forEach(function(t){r[t]=e[t]}),t(e[i],r,!0)}n.util.object.extend(n.Object.prototype,{hasStateChanged:function(t){var e="_"+(t=t||"stateProperties");return Object.keys(this[e]).length<this[t].length||!function t(e,i,n){if(e===i)return!0;if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(var r=0,o=e.length;r<o;r++)if(!t(e[r],i[r]))return!1;return!0}if(e&&"object"==typeof e){var s,a=Object.keys(e);if(!i||"object"!=typeof i||!n&&a.length!==Object.keys(i).length)return!1;for(r=0,o=a.length;r<o;r++)if(!t(e[s=a[r]],i[s]))return!1;return!0}}(this[e],this,!0)},saveState:function(t){var i=t&&t.propertySet||"stateProperties",n="_"+i;return this[n]?(e(this,n,this[i]),t&&t.stateProperties&&e(this,n,t.stateProperties),this):this.setupState(t)},setupState:function(t){var e=(t=t||{}).propertySet||"stateProperties";return t.propertySet=e,this["_"+e]={},this.saveState(t),this}})}(),function(){var t=n.util.degreesToRadians;n.util.object.extend(n.Object.prototype,{_controlsVisibility:null,_findTargetCorner:function(t){if(!this.hasControls||this.group||!this.canvas||this.canvas._activeObject!==this)return!1;var e,i,n=t.x,r=t.y;for(var o in this.__corner=0,this.oCoords)if(this.isControlVisible(o)&&("mtr"!==o||this.hasRotatingPoint)&&(!this.get("lockUniScaling")||"mt"!==o&&"mr"!==o&&"mb"!==o&&"ml"!==o)&&(i=this._getImageLines(this.oCoords[o].corner),0!==(e=this._findCrossPoints({x:n,y:r},i))&&e%2==1))return this.__corner=o,o;return!1},_setCornerCoords:function(){var e,i,r=this.oCoords,o=t(45-this.angle),s=.707106*this.cornerSize,a=s*n.util.cos(o),l=s*n.util.sin(o);for(var c in r)e=r[c].x,i=r[c].y,r[c].corner={tl:{x:e-l,y:i-a},tr:{x:e+a,y:i-l},bl:{x:e-a,y:i+l},br:{x:e+l,y:i+a}}},drawSelectionBackground:function(e){if(!this.selectionBackgroundColor||this.canvas&&!this.canvas.interactive||this.canvas&&this.canvas._activeObject!==this)return this;e.save();var i=this.getCenterPoint(),n=this._calculateCurrentDimensions(),r=this.canvas.viewportTransform;return e.translate(i.x,i.y),e.scale(1/r[0],1/r[3]),e.rotate(t(this.angle)),e.fillStyle=this.selectionBackgroun
3dColor,e.fillRect(-n.x/2,-n.y/2,n.x,n.y),e.restore(),this},drawBorders:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=1/this.borderScaleFactor,r=i.x+n,o=i.y+n,s=void 0!==e.hasRotatingPoint?e.hasRotatingPoint:this.hasRotatingPoint,a=void 0!==e.hasControls?e.hasControls:this.hasControls,l=void 0!==e.rotatingPointOffset?e.rotatingPointOffset:this.rotatingPointOffset;if(t.save(),t.strokeStyle=e.borderColor||this.borderColor,this._setLineDash(t,e.borderDashArray||this.borderDashArray,null),t.strokeRect(-r/2,-o/2,r,o),s&&this.isControlVisible("mtr")&&a){var c=-o/2;t.beginPath(),t.moveTo(0,c),t.lineTo(0,c-l),t.stroke()}return t.restore(),this},drawBordersInGroup:function(t,e,i){i=i||{};var r=this._getNonTransformedDimensions(),o=n.util.customTransformMatrix(e.scaleX,e.scaleY,e.skewX),s=n.util.transformPoint(r,o),a=1/this.borderScaleFactor,l=s.x+a,c=s.y+a;return t.save(),this._setLineDash(t,i.borderDashArray||this.borderDashArray,null),t.strokeStyle=i.borderColor||this.borderColor,t.strokeRect(-l/2,-c/2,l,c),t.restore(),this},drawControls:function(t,e){e=e||{};var i=this._calculateCurrentDimensions(),n=i.x,r=i.y,o=e.cornerSize||this.cornerSize,s=-(n+o)/2,a=-(r+o)/2,l=void 0!==e.transparentCorners?e.transparentCorners:this.transparentCorners,c=void 0!==e.hasRotatingPoint?e.hasRotatingPoint:this.hasRotatingPoint,h=l?"stroke":"fill";return t.save(),t.strokeStyle=t.fillStyle=e.cornerColor||this.cornerColor,this.transparentCorners||(t.strokeStyle=e.cornerStrokeColor||this.cornerStrokeColor),this._setLineDash(t,e.cornerDashArray||this.cornerDashArray,null),this._drawControl("tl",t,h,s,a,e),this._drawControl("tr",t,h,s+n,a,e),this._drawControl("bl",t,h,s,a+r,e),this._drawControl("br",t,h,s+n,a+r,e),this.get("lockUniScaling")||(this._drawControl("mt",t,h,s+n/2,a,e),this._drawControl("mb",t,h,s+n/2,a+r,e),this._drawControl("mr",t,h,s+n,a+r/2,e),this._drawControl("ml",t,h,s,a+r/2,e)),c&&this._drawControl("mtr",t,h,s+n/2,a-this.rotatingPointOffset,e),t.restore(),this},_drawControl:function(t,e,i,n,r,o){if(o=o||{},this.isControlVisible(t)){var s=this.cornerSize,a=!this.transparentCorners&&this.cornerStrokeColor;switch(o.cornerStyle||this.cornerStyle){case"circle":e.beginPath(),e.arc(n+s/2,r+s/2,s/2,0,2*Math.PI,!1),e[i](),a&&e.stroke();break;default:this.transparentCorners||e.clearRect(n,r,s,s),e[i+"Rect"](n,r,s,s),a&&e.strokeRect(n,r,s,s)}}},isControlVisible:function(t){return this._getControlsVisibility()[t]},setControlVisible:function(t,e){return this._getControlsVisibility()[t]=e,this},setControlsVisibility:function(t){for(var e in t||(t={}),t)this.setControlVisible(e,t[e]);return this},_getControlsVisibility:function(){return this._controlsVisibility||(this._controlsVisibility={tl:!0,tr:!0,br:!0,bl:!0,ml:!0,mt:!0,mr:!0,mb:!0,mtr:!0}),this._controlsVisibility},onDeselect:function(){},onSelect:function(){}})}(),n.util.object.extend(n.StaticCanvas.prototype,{FX_DURATION:500,fxCenterObjectH:function(t,e){var i=function(){},r=(e=e||{}).onComplete||i,o=e.onChange||i,s=this;return n.util.animate({startValue:t.left,endValue:this.getCenter().left,duration:this.FX_DURATION,onChange:function(e){t.set("left",e),s.requestRenderAll(),o()},onComplete:function(){t.setCoords(),r()}}),this},fxCenterObjectV:function(t,e){var i=function(){},r=(e=e||{}).onComplete||i,o=e.onChange||i,s=this;return n.util.animate({startValue:t.top,endValue:this.getCenter().top,duration:this.FX_DURATION,onChange:function(e){t.set("top",e),s.requestRenderAll(),o()},onComplete:function(){t.setCoords(),r()}}),this},fxRemove:function(t,e){var i=function(){},r=(e=e||{}).onComplete||i,o=e.onChange||i,s=this;return n.util.animate({startValue:t.opacity,endValue:0,duration:this.FX_DURATION,onChange:function(e){t.set("opacity",e),s.requestRenderAll(),o()},onComplete:function(){s.remove(t),r()}}),this}}),n.util.object.extend(n.Object.prototype,{animate:function(){if(arguments[0]&&"object"==typeof arguments[0]){var t,e,i=[];for(t in arguments[0])i.push(t);for(var n=0,r=i.length;n<r;n++)t=i[n],e=n!==r-1,this._animate(t,arguments[0][t],arguments[1],e)}else this._animate.apply(this,arguments);return this}
vendor: 9,820 bytes, line 3
3,_animate:function(t,e,i,r){var o,s=this;e=e.toString(),i=i?n.util.object.clone(i):{},~t.indexOf(".")&&(o=t.split("."));var a=o?this.get(o[0])[o[1]]:this.get(t);"from"in i||(i.from=a),e=~e.indexOf("=")?a+parseFloat(e.replace("=","")):parseFloat(e),n.util.animate({startValue:i.from,endValue:e,byValue:i.by,easing:i.easing,duration:i.duration,abort:i.abort&&function(){return i.abort.call(s)},onChange:function(e,n,a){o?s[o[0]][o[1]]=e:s.set(t,e),r||i.onChange&&i.onChange(e,n,a)},onComplete:function(t,e,n){r||(s.setCoords(),i.onComplete&&i.onComplete(t,e,n))}})}}),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.object.clone,r={x1:1,x2:1,y1:1,y2:1},o=e.StaticCanvas.supports("setLineDash");function s(t,e){var i=t.origin,n=t.axis1,r=t.axis2,o=t.dimension,s=e.nearest,a=e.center,l=e.farthest;return function(){switch(this.get(i)){case s:return Math.min(this.get(n),this.get(r));case a:return Math.min(this.get(n),this.get(r))+.5*this.get(o);case l:return Math.max(this.get(n),this.get(r))}}}e.Line?e.warn("fabric.Line is already defined"):(e.Line=e.util.createClass(e.Object,{type:"line",x1:0,y1:0,x2:0,y2:0,cacheProperties:e.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!==r[t]&&this._setWidthHeight(),this},_getLeftToOriginX:s({origin:"originX",axis1:"x1",axis2:"x2",dimension:"width"},{nearest:"left",center:"center",farthest:"right"}),_getTopToOriginY:s({origin:"originY",axis1:"y1",axis2:"y2",dimension:"height"},{nearest:"top",center:"center",farthest:"bottom"}),_render:function(t){if(t.beginPath(),!this.strokeDashArray||this.strokeDashArray&&o){var e=this.calcLinePoints();t.moveTo(e.x1,e.y1),t.lineTo(e.x2,e.y2)}t.lineWidth=this.strokeWidth;var i=t.strokeStyle;t.strokeStyle=this.stroke||t.fillStyle,this.stroke&&this._renderStroke(t),t.strokeStyle=i},_renderDashedStroke:function(t){var i=this.calcLinePoints();t.beginPath(),e.util.drawDashedLine(t,i.x1,i.y1,i.x2,i.y2,this.strokeDashArray),t.closePath()},_findCenterFromElement:function(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}},toObject:function(t){return i(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(t){var e=this._createBaseSVGMarkup(),i=this.calcLinePoints();return e.push("<line ",this.getSvgId(),'x1="',i.x1,'" y1="',i.y1,'" x2="',i.x2,'" y2="',i.y2,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'"/>\n'),t?t(e.join("")):e.join("")}}),e.Line.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x1 y1 x2 y2".split(" ")),e.Line.fromElement=function(t,n,r){r=r||{};var o=e.parseAttributes(t,e.Line.ATTRIBUTE_NAMES),s=[o.x1||0,o.y1||0,o.x2||0,o.y2||0];n(new e.Line(s,i(o,r)))},e.Line.fromObject=function(t,i){var r=n(t,!0);r.points=[t.x1,t.y1,t.x2,t.y2],e.Object._fromObject("Line",r,function(t){delete t.points,i&&i(t)},"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.PI;e.Circle?e.warn("fabric.Circle is already defined."):(e.Circle=e.util.createClass(e.Object,{type:"circle",radius:0,startAngle:0,endAngle:2*i,cacheProperties:e.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(t){var n=this._createBaseSVGMarkup(),r=(this.endAngle-this.startAngle)%(2*i);if(0===r)n.push("<circle ",this.getSvgId(),'cx="0" cy="0" ','r="',this.radius,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform()," ",this.getSvgTransformMatrix(),'"',this.addPaintOrder(),"/>\n");else{var o=e.util.cos(this.startAngle)*this.radius,s=e.util.sin(this.startAngle)*this.radius,a=e.util.cos(this.endAngle)*this.radius,l=e.util.sin(this.endAngle)*this.radius,c=r>i?"1":"0";n.push('<path d="M '+o+" "+s," A "+this.radius+" "+this.radius," 0 ",+c+" 1"," "+a+" "+l,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform()," ",this.getSvgTransformMatrix(),'"',this.addPaintOrder(),'"/>\n')}return t?t(n.join("")):n.join("")},_render:function(t){t.beginPath(),t.arc(0,0,this.radius,this.startAngle,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)}}),e.Circle.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy r".split(" ")),e.Circle.fromElement=function(t,i){var n=e.parseAttributes(t,e.Circle.ATTRIBUTE_NAMES);if(!function(t){return"radius"in t&&t.radius>=0}(n))throw new Error("value of `r` attribute is required and can not be negative");n.left=(n.left||0)-n.radius,n.top=(n.top||0)-n.radius,i(new e.Circle(n))},e.Circle.fromObject=function(t,i){return e.Object._fromObject("Circle",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Triangle?e.warn("fabric.Triangle is already defined"):(e.Triangle=e.util.createClass(e.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)},_renderDashedStroke:function(t){var i=this.width/2,n=this.height/2;t.beginPath(),e.util.drawDashedLine(t,-i,n,0,-n,this.strokeDashArray),e.util.drawDashedLine(t,0,-n,i,n,this.strokeDashArray),e.util.drawDashedLine(t,i,n,-i,n,this.strokeDashArray),t.closePath()},toSVG:function(t){var e=this._createBaseSVGMarkup(),i=this.width/2,n=this.height/2,r=[-i+" "+n,"0 "+-n,i+" "+n].join(",");return e.push("<polygon ",this.getSvgId(),'points="',r,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform(),'"',this.addPaintOrder(),"/>"),t?t(e.join("")):e.join("")}}),e.Triangle.fromObject=function(t,i){return e.Object._fromObject("Triangle",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=2*Math.PI;e.Ellipse?e.warn("fabric.Ellipse is already defined."):(e.Ellipse=e.util.createClass(e.Object,{type:"ellipse",rx:0,ry:0,cacheProperties:e.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(t){var e=this._createBaseSVGMarkup();return e.push("<ellipse ",this.getSvgId(),'cx="0" cy="0" ','rx="',this.rx,'" ry="',this.ry,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'"',this.addPaintOrder(),"/>\n"),t?t(e.join("")):e.join("")},_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,i,!1),t.restore(),this._renderPaintInOrder(t)}}),e.Ellipse.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("cx cy rx ry".split(" ")),e.Ellipse.fromElement=function(t,i){var n=e.parseAttributes(t,e.Ellipse.ATTRIBUTE_NAMES);n.left=(n.left||0)-n.rx,n.top=(n.top||0)-n.ry,i(new e.Ellipse(n))},e.Ellipse.fromObject=function(t,i){return e.Object._fromObject("Ellipse",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Rect?e.warn("fabric.Rect is already defined"):(e.Rect=e.util.createClass(e.Object,{stateProperties:e.Object.prototype.stateProperties.concat("rx","ry"),type:"rect",rx:0,ry:0,cacheProperties:e.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){if(1!==this.width||1!==this.height){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,r=this.height,o=-this.width/2,s=-this.height/2,a=0!==e||0!==i,l=.4477152502;t.beginPath(),t.moveTo(o+e,s),t.lineTo(o+n-e,s),a&&t.bezierCurveTo(o+n-l*e,s,o+n,s+l*i,o+n,s+i),t.lineTo(o+n,s+r-i),a&&t.bezierCurveTo(o+n,s+r-l*i,o+n-l*e,s+r,o+n-e,s+r),t.lineTo(o+e,s+r),a&&t.bezierCurveTo(o+l*e,s+r,o,s+r-l*i,o,s+r-i),t.lineTo(o,s+i),a&&t.bezierCurveTo(o,s+l*i,o+l*e,s,o+e,s),t.closePath(),this._renderPaintInOrder(t)}else t.fillRect(-.5,-.5,1,1)},_renderDashedStroke:function(t){var i=-this.width/2,n=-this.height/2,r=this.width,o=this.height;t.beginPath(),e.util.drawDashedLine(t,i,n,i+r,n,this.strokeDashArray),e.util.drawDashedLine(t,i+r,n,i+r,n+o,this.strokeDashArray),e.util.drawDashedLine(t,i+r,n+o,i,n+o,this.strokeDashArray),e.util.drawDashedLine(t,i,n+o,i,n,this.strokeDashArray),t.closePath()},toObject:function(t){return this.callSuper("toObject",["rx","ry"].concat(t))},toSVG:function(t){var e=this._createBaseSVGMarkup(),i=-this.width/2,n=-this.height/2;
3return e.push("<rect ",this.getSvgId(),'x="',i,'" y="',n,'" rx="',this.get("rx"),'" ry="',this.get("ry"),'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'"',this.addPaintOrder(),"/>\n"),t?t(e.join("")):e.join("")}}),e.Rect.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y rx ry width height".split(" ")),e.Rect.fromElement=function(t,n,r){if(!t)return n(null);r=r||{};var o=e.parseAttributes(t,e.Rect.ATTRIBUTE_NAMES);o.left=o.left||0,o.top=o.top||0;var s=new e.Rect(i(r?e.util.object.clone(r):{},o));s.visible=s.visible&&s.width>0&&s.height>0,n(s)},e.Rect.fromObject=function(t,i){return e.Object._fromObject("Rect",t,i)})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max,o=e.util.toFixed;e.Polyline?e.warn("fabric.Polyline is already defined"):(e.Polyline=e.util.createClass(e.Object,{type:"polyline",points:null,cacheProperties:e.Object.prototype.cacheProperties.concat("points"),initialize:function(t,e){e=e||{},this.points=t||[],this.callSuper("initialize",e);var i=this._calcDimensions();void 0===e.left&&(this.left=i.left),void 0===e.top&&(this.top=i.top),this.width=i.width,this.height=i.height,this.pathOffset={x:i.left+this.width/2,y:i.top+this.height/2}},_calcDimensions:function(){var t=this.points,e=n(t,"x")||0,i=n(t,"y")||0;return{left:e,top:i,width:(r(t,"x")||0)-e,height:(r(t,"y")||0)-i}},toObject:function(t){return i(this.callSuper("toObject",t),{points:this.points.concat()})},toSVG:function(t){for(var i=[],n=this.pathOffset.x,r=this.pathOffset.y,s=this._createBaseSVGMarkup(),a=e.Object.NUM_FRACTION_DIGITS,l=0,c=this.points.length;l<c;l++)i.push(o(this.points[l].x-n,a),",",o(this.points[l].y-r,a)," ");return s.push("<",this.type," ",this.getSvgId(),'points="',i.join(""),'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform()," ",this.getSvgTransformMatrix(),'"',this.addPaintOrder(),"/>\n"),t?t(s.join("")):s.join("")},commonRender:function(t){var e,i=this.points.length,n=this.pathOffset.x,r=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-r);for(var o=0;o<i;o++)e=this.points[o],t.lineTo(e.x-n,e.y-r);return!0},_render:function(t){this.commonRender(t)&&this._renderPaintInOrder(t)},_renderDashedStroke:function(t){var i,n;t.beginPath();for(var r=0,o=this.points.length;r<o;r++)i=this.points[r],n=this.points[r+1]||i,e.util.drawDashedLine(t,i.x,i.y,n.x,n.y,this.strokeDashArray)},complexity:function(){return this.get("points").length}}),e.Polyline.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polyline.fromElement=function(t,i,n){if(!t)return i(null);n||(n={});var r=e.parsePointsAttribute(t.getAttribute("points")),o=e.parseAttributes(t,e.Polyline.ATTRIBUTE_NAMES);i(new e.Polyline(r,e.util.object.extend(o,n)))},e.Polyline.fromObject=function(t,i){return e.Object._fromObject("Polyline",t,i,"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend;e.Polygon?e.warn("fabric.Polygon is already defined"):(e.Polygon=e.util.createClass(e.Polyline,{type:"polygon",_render:function(t){this.commonRender(t)&&(t.closePath(),this._renderPaintInOrder(t))},_renderDashedStroke:function(t){this.callSuper("_renderDashedStroke",t),t.closePath()}}),e.Polygon.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(),e.Polygon.fromElement=function(t,n,r){if(!t)return n(null);r||(r={});var o=e.parsePointsAttribute(t.getAttribute("points")),s=e.parseAttributes(t,e.Polygon.ATTRIBUTE_NAMES);n(new e.Polygon(o,i(s,r)))},e.Polygon.fromObject=function(t,i){return e.Object._fromObject("Polygon",t,i,"points")})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.array.min,n=e.util.array.max,r=e.util.object.extend,o=Object.prototype.toString,s=e.util.drawArc,a={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7},l={m:"l",M:"L"};e.Path?e.warn("fabric.Path is already defined"):(e.Path=e.util.createClass(e.Object,{type:"path",path:null,cacheProperties:e.Object.prototype.cacheProperties.concat("path","fillRule"),stateProperties:e.Object.prototype.stateProperties.concat("path"),initialize:function(t,e){e=e||{},this.callSuper("initialize",e),t||(t=[]);var i="[object Array]"===o.call(t);this.path=i?t:t.match&&t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi),this.path&&(i||(this.path=this._parsePath()),this._setPositionDimensions(e))},_setPositionDimensions:function(t){var e=this._parseDimensions();this.width=e.width,this.height=e.height,void 0===t.left&&(this.left=e.left),void 0===t.top&&(this.top=e.top),this.pathOffset=this.pathOffset||{x:e.left+this.width/2,y:e.top+this.height/2}},_renderPathCommands:function(t){var e,i,n,r=null,o=0,a=0,l=0,c=0,h=0,u=0,d=-this.pathOffset.x,f=-this.pathOffset.
vendor: 1,915 bytes, line 3
3y;t.beginPath();for(var g=0,p=this.path.length;g<p;++g){switch((e=this.path[g])[0]){case"l":l+=e[1],c+=e[2],t.lineTo(l+d,c+f);break;case"L":l=e[1],c=e[2],t.lineTo(l+d,c+f);break;case"h":l+=e[1],t.lineTo(l+d,c+f);break;case"H":l=e[1],t.lineTo(l+d,c+f);break;case"v":c+=e[1],t.lineTo(l+d,c+f);break;case"V":c=e[1],t.lineTo(l+d,c+f);break;case"m":o=l+=e[1],a=c+=e[2],t.moveTo(l+d,c+f);break;case"M":o=l=e[1],a=c=e[2],t.moveTo(l+d,c+f);break;case"c":i=l+e[5],n=c+e[6],h=l+e[3],u=c+e[4],t.bezierCurveTo(l+e[1]+d,c+e[2]+f,h+d,u+f,i+d,n+f),l=i,c=n;break;case"C":l=e[5],c=e[6],h=e[3],u=e[4],t.bezierCurveTo(e[1]+d,e[2]+f,h+d,u+f,l+d,c+f);break;case"s":i=l+e[3],n=c+e[4],null===r[0].match(/[CcSs]/)?(h=l,u=c):(h=2*l-h,u=2*c-u),t.bezierCurveTo(h+d,u+f,l+e[1]+d,c+e[2]+f,i+d,n+f),h=l+e[1],u=c+e[2],l=i,c=n;break;case"S":i=e[3],n=e[4],null===r[0].match(/[CcSs]/)?(h=l,u=c):(h=2*l-h,u=2*c-u),t.bezierCurveTo(h+d,u+f,e[1]+d,e[2]+f,i+d,n+f),l=i,c=n,h=e[1],u=e[2];break;case"q":i=l+e[3],n=c+e[4],h=l+e[1],u=c+e[2],t.quadraticCurveTo(h+d,u+f,i+d,n+f),l=i,c=n;break;case"Q":i=e[3],n=e[4],t.quadraticCurveTo(e[1]+d,e[2]+f,i+d,n+f),l=i,c=n,h=e[1],u=e[2];break;case"t":i=l+e[1],n=c+e[2],null===r[0].match(/[QqTt]/)?(h=l,u=c):(h=2*l-h,u=2*c-u),t.quadraticCurveTo(h+d,u+f,i+d,n+f),l=i,c=n;break;case"T":i=e[1],n=e[2],null===r[0].match(/[QqTt]/)?(h=l,u=c):(h=2*l-h,u=2*c-u),t.quadraticCurveTo(h+d,u+f,i+d,n+f),l=i,c=n;break;case"a":s(t,l+d,c+f,[e[1],e[2],e[3],e[4],e[5],e[6]+l+d,e[7]+c+f]),l+=e[6],c+=e[7];break;case"A":s(t,l+d,c+f,[e[1],e[2],e[3],e[4],e[5],e[6]+d,e[7]+f]),l=e[6],c=e[7];break;case"z":case"Z":l=o,c=a,t.closePath()}r=e}},_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 r(this.callSuper("toObject",t),{path:this.path.map(function(t){return t.slice()}
3),top:this.top,left:this.left})},toDatalessObject:function(t){var e=this.toObject(["sourcePath"].concat(t));return e.sourcePath&&delete e.path,e},toSVG:function(t){for(var e,i=[],n=this._createBaseSVGMarkup(),r=0,o=this.path.length;r<o;r++)i.push(this.path[r].join(" "));var s=i.join(" ");return e=" translate("+-this.pathOffset.x+", "+-this.pathOffset.y+") ",n.push("<path ",this.getSvgId(),'d="',s,'" style="',this.getSvgStyles(),'" transform="',this.getSvgTransform(),e,this.getSvgTransformMatrix(),'" stroke-linecap="round" ',this.addPaintOrder(),"/>\n"),t?t(n.join("")):n.join("")},complexity:function(){return this.path.length},_parsePath:function(){for(var t,e,i,n,r,o=[],s=[],c=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi,h=0,u=this.path.length;h<u;h++){for(n=(t=this.path[h]).slice(1).trim(),s.length=0;i=c.exec(n);)s.push(i[0]);r=[t.charAt(0)];for(var d=0,f=s.length;d<f;d++)e=parseFloat(s[d]),isNaN(e)||r.push(e);var g=r[0],p=a[g.toLowerCase()],m=l[g]||g;if(r.length-1>p)for(var v=1,w=r.length;v<w;v+=p)o.push([g].concat(r.slice(v,v+p))),g=m;else o.push(r)}return o},_parseDimensions:function(){for(var t,r,o,s,a=[],l=[],c=null,h=0,u=0,d=0,f=0,g=0,p=0,m=0,v=this.path.length;m<v;++m){switch((t=this.path[m])[0]){case"l":d+=t[1],f+=t[2],s=[];break;case"L":d=t[1],f=t[2],s=[];break;case"h":d+=t[1],s=[];break;case"H":d=t[1],s=[];break;case"v":f+=t[1],s=[];break;case"V":f=t[1],s=[];break;case"m":h=d+=t[1],u=f+=t[2],s=[];break;case"M":h=d=t[1],u=f=t[2],s=[];break;case"c":r=d+t[5],o=f+t[6],g=d+t[3],p=f+t[4],s=e.util.getBoundsOfCurve(d,f,d+t[1],f+t[2],g,p,r,o),d=r,f=o;break;case"C":g=t[3],p=t[4],s=e.util.getBoundsOfCurve(d,f,t[1],t[2],g,p,t[5],t[6]),d=t[5],f=t[6];break;case"s":r=d+t[3],o=f+t[4],null===c[0].match(/[CcSs]/)?(g=d,p=f):(g=2*d-g,p=2*f-p),s=e.util.getBoundsOfCurve(d,f,g,p,d+t[1],f+t[2],r,o),g=d+t[1],p=f+t[2],d=r,f=o;break;case"S":r=t[3],o=t[4],null===c[0].match(/[CcSs]/)?(g=d,p=f):(g=2*d-g,p=2*f-p),s=e.util.getBoundsOfCurve(d,f,g,p,t[1],t[2],r,o),d=r,f=o,g=t[1],p=t[2];break;case"q":r=d+t[3],o=f+t[4],g=d+t[1],p=f+t[2],s=e.util.getBoundsOfCurve(d,f,g,p,g,p,r,o),d=r,f=o;break;case"Q":g=t[1],p=t[2],s=e.util.getBoundsOfCurve(d,f,g,p,g,p,t[3],t[4]),d=t[3],f=t[4];break;case"t":r=d+t[1],o=f+t[2],null===c[0].match(/[QqTt]/)?(g=d,p=f):(g=2*d-g,p=2*f-p),s=e.util.getBoundsOfCurve(d,f,g,p,g,p,r,o),d=r,f=o;break;case"T":r=t[1],o=t[2],null===c[0].match(/[QqTt]/)?(g=d,p=f):(g=2*d-g,p=2*f-p),s=e.util.getBoundsOfCurve(d,f,g,p,g,p,r,o),d=r,f=o;break;case"a":s=e.util.getBoundsOfArc(d,f,t[1],t[2],t[3],t[4],t[5],t[6]+d,t[7]+f),d+=t[6],f+=t[7];break;case"A":s=e.util.getBoundsOfArc(d,f,t[1],t[2],t[3],t[4],t[5],t[6],t[7]),d=t[6],f=t[7];break;case"z":case"Z":d=h,f=u}c=t,s.forEach(function(t){a.push(t.x),l.push(t.y)}),a.push(d),l.push(f)}var w=i(a)||0,y=i(l)||0;return{left:w,top:y,width:(n(a)||0)-w,height:(n(l)||0)-y}}}),e.Path.fromObject=function(t,i){if("string"==typeof t.sourcePath){var n=t.sourcePath;e.loadSVGFromURL(n,function(e){var n=e[0];n.setOptions(t),i&&i(n)})}else e.Object._fromObject("Path",t,i,"path")},e.Path.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat(["d"]),e.Path.fromElement=function(t,i,n){var o=e.parseAttributes(t,e.Path.ATTRIBUTE_NAMES);i(new e.Path(o.d,r(o,n)))})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.util.array.min,r=e.util.array.max;e.Group||(e.Group=e.util.createClass(e.Object,e.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;if(e.originX&&(this.originX=e.originX),e.originY&&(this.originY=e.originY),i)this._updateObjectsACoords();else{var r=e&&e.centerPoint;r||this._calcBounds(),this._updateObjectsCoords(r),delete e.centerPoint,this.callSuper("initialize",e)}this.setCoords()},_updateObjectsACoords:function(){for(var t=this._objects.length;t--;)this._objects[t].setCoords(!0,!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,!0)},toString:function(){return"#<fabric.Group: ("+this.complexity()+")>"},addWithUpdate:function(t){return this._restoreObjectsState(),e.util.resetObjectTransform(this),t&&(this._objects.push(t),t.group=this,t._set("canvas",this.canvas)),this._calcBounds(),this._updateObjectsCoords(),this.setCoords(),this.dirty=!0,this},removeWithUpdate:function(t){return this._restoreObjectsState(),e.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.length;i--;)this._objects[i]._set(t,e);this.callSuper("_set",t,e)},toObject:function(t){var e=this.getObjects().map(function(e){var i=e.includeDefaultValues;e.includeDefaultValues=e.group.includeDefaultValues;var n=e.toObject(t);return e.includeDefaultValues=i,n});return i(this.callSuper("toObject",t),{objects:e})},toDatalessObject:function(t){var e,n=this.sourcePath;return e=n||this.getObjects().map(function(e){var i=e.includeDefaultValues;e.includeDefaultValues=e.group.includeDefaultValues;var n=e.toDatalessObject(t);return e.includeDefaultValues=i,n}),i(this.callSuper("toDatalessObject",t),{objects:e})},render:function(t){this._transformDone=!0,this.callSuper("render",t),this._transformDone=!1},shouldCache:function(){var t=this.objectCaching&&(!this.group||this.needsItsOwnCache()||!this.group.isOnACache());if(this.ownCaching=t,t)for(var e=0,i=this._objects.length;e<i;e++)if(this._objects[e].willDrawShadow())return this.ownCaching=!1,!1;return t},willDrawShadow:function(){if(this.shadow)return this.callSuper("willDrawShadow");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)},isCacheDirty:function(){if(this.callSuper("isCacheDirty"))return!0;
3if(!this.statefullCache)return!1;for(var t=0,e=this._objects.length;t<e;t++)if(this._objects[t].isCacheDirty(!0)){if(this._cacheCanvas){var i=this.cacheWidth/this.zoomX,n=this.cacheHeight/this.zoomY;this._cacheContext.clearRect(-i/2,-n/2,i,n)}return!0}return!1},_restoreObjectsState:function(){return this._objects.forEach(this._restoreObjectState,this),this},realizeTransform:function(t){var i=t.calcTransformMatrix(),n=e.util.qrDecompose(i),r=new e.Point(n.translateX,n.translateY);return t.flipX=!1,t.flipY=!1,t.set("scaleX",n.scaleX),t.set("scaleY",n.scaleY),t.skewX=n.skewX,t.skewY=n.skewY,t.angle=n.angle,t.setPositionByOrigin(r,"center","center"),t},_restoreObjectState:function(t){return this.realizeTransform(t),t.setCoords(),delete t.group,this},destroy:function(){return this._objects.forEach(function(t){t.set("dirty",!0)}),this._restoreObjectsState()},toActiveSelection:function(){if(this.canvas){var t=this._objects,i=this.canvas;this._objects=[];var n=this.toObject();delete n.objects;var r=new e.ActiveSelection([]);return r.set(n),r.type="activeSelection",i.remove(this),t.forEach(function(t){t.group=r,t.dirty=!0,i.add(t)}),r.canvas=i,r._objects=t,i._activeObject=r,r.setCoords(),r}},ungroupOnCanvas:function(){return this._restoreObjectsState()},setObjectsCoords:function(){return this.forEachObject(function(t){t.setCoords(!0,!0)}),this},_calcBounds:function(t){for(var e,i,n,r=[],o=[],s=["tr","br","bl","tl"],a=0,l=this._objects.length,c=s.length;a<l;++a)for((e=this._objects[a]).setCoords(!0),n=0;n<c;n++)i=s[n],r.push(e.oCoords[i].x),o.push(e.oCoords[i].y);this.set(this._getBounds(r,o,t))},_getBounds:function(t,i,o){var s=new e.Point(n(t),n(i)),a=new e.Point(r(t),r(i)),l={width:a.x-s.x||0,height:a.y-s.y||0};return o||(l.left=s.x||0,l.top=s.y||0,"center"===this.originX&&(l.left+=l.width/2),"right"===this.originX&&(l.left+=l.width),"center"===this.originY&&(l.top+=l.height/2),"bottom"===this.originY&&(l.top+=l.height)),l},toSVG:function(t){var e=this._createBaseSVGMarkup();e.push("<g ",this.getSvgId(),'transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'" style="',this.getSvgFilter(),'">\n');for(var i=0,n=this._objects.length;i<n;i++)e.push("\t",this._objects[i].toSVG(t));return e.push("</g>\n"),t?t(e.join("")):e.join("")}}),e.Group.fromObject=function(t,i){e.util.enlivenObjects(t.objects,function(n){var r=e.util.object.clone(t,!0);delete r.objects,i&&i(new e.Group(n,r,!0))})})}(e),function(t){"use strict";var e=t.fabric||(t.fabric={});e.ActiveSelection||(e.ActiveSelection=e.util.createClass(e.Group,{type:"activeSelection",initialize:function(t,i){i=i||{},this._objects=t||[];for(var n=this._objects.length;n--;)this._objects[n].group=this;i.originX&&(this.originX=i.originX),i.originY&&(this.originY=i.originY),this._calcBounds(),this._updateObjectsCoords(),e.Object.prototype.initialize.call(this,i),this.setCoords()},toGroup:function(){var t=this._objects;this._objects=[];var i=this.toObject(),n=new e.Group([]);if(delete i.objects,n.set(i),n.type="group",t.forEach(function(t){t.group=n,t.canvas.remove(t)}),n._objects=t,!this.canvas)return n;var r=this.canvas;return r.add(n),r._activeObject=n,n.setCoords(),n},onDeselect:function(){return this.destroy(),!1},toString:function(){return"#<fabric.ActiveSelection: ("+this.complexity()+")>"},_set:function(t,i){var n=this._objects.length;if("canvas"===t)for(;n--;)this._objects[n].set(t,i);if(this.useSetOnGroup)for(;n--;)this._objects[n].setOnGroup(t,i);e.Object.prototype._set.call(this,t,i)},shouldCache:function(){return!1},willDrawShadow:function(){if(this.shadow)return this.callSuper("willDrawShadow");for(var t=0,e=this._objects.length;t<e;t++)if(this._objects[t].willDrawShadow())return!0;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),void 0===i.hasRotatingPoint&&(i.hasRotatingPoint=!1),i.forActiveSelection=!0;for(var n=0,r=this._objects.length;n<r;n++)this._objects[n]._renderControls(t,i);
3t.restore()}}),e.ActiveSelection.fromObject=function(t,i){e.util.enlivenObjects(t.objects,function(n){delete t.objects,i&&i(new e.ActiveSelection(n,t,!0))})})}(e),function(t){"use strict";var e=n.util.object.extend;t.fabric||(t.fabric={}),t.fabric.Image?n.warn("fabric.Image is already defined."):(n.Image=n.util.createClass(n.Object,{type:"image",crossOrigin:"",strokeWidth:0,_lastScaleX:1,_lastScaleY:1,_filterScalingX:1,_filterScalingY:1,minimumScaleTrigger:.5,stateProperties:n.Object.prototype.stateProperties.concat("cropX","cropY"),objectCaching:!1,cacheKey:"",cropX:0,cropY:0,initialize:function(t,e){e||(e={}),this.filters=[],this.cacheKey="texture"+n.Object.__uid++,this.callSuper("initialize",e),this._initElement(t,e)},getElement:function(){return this._element},setElement:function(t,e){var i=n.filterBackend;return i&&i.evictCachesForKey&&(i.evictCachesForKey(this.cacheKey),i.evictCachesForKey(this.cacheKey+"_filtered")),this._element=t,this._originalElement=t,this._initConfig(e),this.resizeFilter&&this.applyResizeFilters(),0!==this.filters.length&&this.applyFilters(),this},dispose:function(){var t=n.filterBackend;t&&t.evictCachesForKey&&(t.evictCachesForKey(this.cacheKey),t.evictCachesForKey(this.cacheKey+"_filtered")),this._originalElement=void 0,this._element=void 0,this._filteredEl=void 0},setCrossOrigin:function(t){return this.crossOrigin=t,this._element.crossOrigin=t,this},getOriginalSize:function(){var t=this.getElement();return{width:t.width,height:t.height}},_stroke:function(t){if(this.stroke&&0!==this.strokeWidth){var 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()}},_renderDashedStroke:function(t){var e=-this.width/2,i=-this.height/2,r=this.width,o=this.height;t.save(),this._setStrokeStyles(t,this),t.beginPath(),n.util.drawDashedLine(t,e,i,e+r,i,this.strokeDashArray),n.util.drawDashedLine(t,e+r,i,e+r,i+o,this.strokeDashArray),n.util.drawDashedLine(t,e+r,i+o,e,i+o,this.strokeDashArray),n.util.drawDashedLine(t,e,i+o,e,i,this.strokeDashArray),t.closePath(),t.restore()},toObject:function(t){var i=[];this.filters.forEach(function(t){t&&i.push(t.toObject())});var n=e(this.callSuper("toObject",["crossOrigin","cropX","cropY"].concat(t)),{src:this.getSrc(),filters:i});return this.resizeFilter&&(n.resizeFilter=this.resizeFilter.toObject()),n},hasCrop:function(){return this.cropX||this.cropY||this.width<this._element.width||this.height<this._element.height},toSVG:function(t){var e=this._createBaseSVGMarkup(),i=-this.width/2,r=-this.height/2,o="";if(this.hasCrop()){var s=n.Object.__uid++;e.push('<clipPath id="imageCrop_'+s+'">\n','\t<rect x="'+i+'" y="'+r+'" width="'+this.width+'" height="'+this.height+'" />\n',"</clipPath>\n"),o=' clip-path="url(#imageCrop_'+s+')" '}e.push('<g transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'">\n');var a=["\t<image ",this.getSvgId(),'xlink:href="',this.getSvgSrc(!0),'" x="',i-this.cropX,'" y="',r-this.cropY,'" style="',this.getSvgStyles(),'" width="',this._element.width||this._element.naturalWidth,'" height="',this._element.height||this._element.height,'"',o,"></image>\n"];if("fill"===this.paintFirst&&Array.prototype.push.apply(e,a),this.stroke||this.strokeDashArray){var l=this.fill;this.fill=null,e.push("\t<rect ",'x="',i,'" y="',r,'" width="',this.width,'" height="',this.height,'" style="',this.getSvgStyles(),'"/>\n'),this.fill=l}return"fill"!==this.paintFirst&&Array.prototype.push.apply(e,a),e.push("</g>\n"),t?t(e.join("")):e.join("")},getSrc:function(t){var e=t?this._element:this._originalElement;return e?e.toDataURL?e.toDataURL():e.src:this.src||""},setSrc:function(t,e,i){return n.util.loadImage(t,function(t){this.setElement(t,i),this._setWidthHeight(),e(this)},this,i&&i.crossOrigin),this},toString:function(){return'#<fabric.Image: { src: "'+this.getSrc()+'" }>'},applyResizeFilters:function(){var t=this.resizeFilter,e=this.canvas?this.canvas.getRetinaScaling():1,i=this.minimumScaleTrigger,r=this.scaleX*e,o=this.scaleY*e,s=this._filteredEl||this._originalElement;if(this.group&&this.set("dirty",!0),!t||r>i&&o>i)return this._element=s,this._filterScalingX=1,void(this._filterScalingY=1);n.filterBackend||(n.filterBackend=n.initFilterBackend());var a=n.util.createCanvasElement(),l=this._filteredEl?this.cacheKey:this.cacheKey+"_filtered",c=s.width,h=s.height;a.width=c,a.height=h,this._element=a,t.scaleX=r,t.scaleY=o,n.filterBackend.applyFilters([t],s,c,h,this._element,l),this._filterScalingX=a.width/this._originalElement.width,this._filterScalingY=a.height/this._originalElement.height},applyFilters:function(t){if(t=(t=t||this.filters||[]).filter(function(t){return t}),this.group&&this.set("dirty",!0),0===t.length)return this._element=this._originalElement,this._filteredEl=null,this._filterScalingX=1,this._filterScalingY=1,this;
3var e=this._originalElement,i=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(this._element===this._originalElement){var o=n.util.createCanvasElement();o.width=i,o.height=r,this._element=o,this._filteredEl=o}else this._element.getContext("2d").clearRect(0,0,i,r);return n.filterBackend||(n.filterBackend=n.initFilterBackend()),n.filterBackend.applyFilters(t,this._originalElement,i,r,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){!1===this.isMoving&&this.resizeFilter&&this._needsResize()&&(this._lastScaleX=this.scaleX,this._lastScaleY=this.scaleY,this.applyResizeFilters()),this._stroke(t),this._renderPaintInOrder(t)},_renderFill:function(t){var e=this.width,i=this.height,n=e*this._filterScalingX,r=i*this._filterScalingY,o=-e/2,s=-i/2,a=this._element;a&&t.drawImage(a,this.cropX*this._filterScalingX,this.cropY*this._filterScalingY,n,r,o,s,e,i)},_needsResize:function(){return this.scaleX!==this._lastScaleX||this.scaleY!==this._lastScaleY},_resetWidthHeight:function(){var t=this.getElement();this.set("width",t.width),this.set("height",t.height)},_initElement:function(t,e){this.setElement(n.util.getById(t),e),n.util.addClass(this.getElement(),n.Image.CSS_CANVAS)},_initConfig:function(t){t||(t={}),this.setOptions(t),this._setWidthHeight(t),this._element&&this.crossOrigin&&(this._element.crossOrigin=this.crossOrigin)},_initFilters:function(t,e){t&&t.length?n.util.enlivenObjects(t,function(t){e&&e(t)},"fabric.Image.filters"):e&&e()},_setWidthHeight:function(t){this.width=t&&"width"in t?t.width:this.getElement()&&this.getElement().width||0,this.height=t&&"height"in t?t.height:this.getElement()&&this.getElement().height||0},parsePreserveAspectRatioAttribute:function(){var t,e=n.util.parsePreserveAspectRatioAttribute(this.preserveAspectRatio||""),i=this._element.width,r=this._element.height,o=1,s=1,a=0,l=0,c=0,h=0,u=this.width,d=this.height,f={width:u,height:d};return!e||"none"===e.alignX&&"none"===e.alignY?(o=u/i,s=d/r):("meet"===e.meetOrSlice&&(t=(u-i*(o=s=n.util.findScaleToFit(this._element,f)))/2,"Min"===e.alignX&&(a=-t),"Max"===e.alignX&&(a=t),t=(d-r*s)/2,"Min"===e.alignY&&(l=-t),"Max"===e.alignY&&(l=t)),"slice"===e.meetOrSlice&&(t=i-u/(o=s=n.util.findScaleToCover(this._element,f)),"Mid"===e.alignX&&(c=t/2),"Max"===e.alignX&&(c=t),t=r-d/s,"Mid"===e.alignY&&(h=t/2),"Max"===e.alignY&&(h=t),i=u/o,r=d/s)),{width:i,height:r,scaleX:o,scaleY:s,offsetLeft:a,offsetTop:l,cropX:c,cropY:h}}}),n.Image.CSS_CANVAS="canvas-img",n.Image.prototype.getSvgSrc=n.Image.prototype.getSrc,n.Image.fromObject=function(t,e){var i=n.util.object.clone(t);n.util.loadImage(i.src,function(t,r){r?e&&e(null,r):n.Image.prototype._initFilters.call(i,i.filters,function(r){i.filters=r||[],n.Image.prototype._initFilters.call(i,[i.resizeFilter],function(r){i.resizeFilter=r[0];var o=new n.Image(t,i);e(o)})})},null,i.crossOrigin)},n.Image.fromURL=function(t,e,i){n.util.loadImage(t,function(t){e&&e(new n.Image(t,i))},null,i&&i.crossOrigin)},n.Image.ATTRIBUTE_NAMES=n.SHARED_ATTRIBUTES.concat("x y width height preserveAspectRatio xlink:href crossOrigin".split(" ")),n.Image.fromElement=function(t,i,r){var o=n.parseAttributes(t,n.Image.ATTRIBUTE_NAMES);n.Image.fromURL(o["xlink:href"],i,e(r?n.util.object.clone(r):{},o))})}(e),n.util.object.extend(n.Object.prototype,{_getAngleValueForStraighten:function(){var t=this.angle%360;return t>0?90*Math.round((t-1)/90):90*Math.round(t/90)},straighten:function(){return this.rotate(this._getAngleValueForStraighten()),this},fxStraighten:function(t){var e=function(){},i=(t=t||{}).onComplete||e,r=t.onChange||e,o=this;return n.util.animate({startValue:this.get("angle"),endValue:this._getAngleValueForStraighten(),duration:this.FX_DURATION,onChange:function(t){o.rotate(t),r()},onComplete:function(){o.setCoords(),i()}}),this}}),n.util.object.extend(n.StaticCanvas.prototype,{straightenObject:function(t){return t.straighten(),this.requestRenderAll(),this}
vendor: 9,256 bytes, line 3
3,fxStraightenObject:function(t){return t.fxStraighten({onChange:this.requestRenderAllBound}),this}}),function(){"use strict";function t(t,e){var i="precision "+e+" float;\nvoid main(){}",n=t.createShader(t.FRAGMENT_SHADER);return t.shaderSource(n,i),t.compileShader(n),!!t.getShaderParameter(n,t.COMPILE_STATUS)}function e(t){t&&t.tileSize&&(this.tileSize=t.tileSize),this.setupGLContext(this.tileSize,this.tileSize),this.captureGPUInfo()}n.isWebglSupported=function(e){if(n.isLikelyNode)return!1;e=e||n.WebglFilterBackend.prototype.tileSize;var i=document.createElement("canvas"),r=i.getContext("webgl")||i.getContext("experimental-webgl"),o=!1;if(r){n.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),o=n.maxTextureSize>=e;for(var s=["highp","mediump","lowp"],a=0;a<3;a++)if(t(r,s[a])){n.webGlPrecision=s[a];break}}return this.isSupported=o,o},n.WebglFilterBackend=e,e.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,r=void 0!==window.performance;try{new ImageData(1,1),i=!0}catch(t){i=!1}var o="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof Uint8ClampedArray;if(r&&i&&o&&l){var c,h,u=n.util.createCanvasElement(),d=new ArrayBuffer(t*e*4),f={imageBuffer:d,destinationWidth:t,destinationHeight:e,targetCanvas:u};u.width=t,u.height=e,c=window.performance.now(),s.call(f,this.gl,f),h=window.performance.now()-c,c=window.performance.now(),a.call(f,this.gl,f),h>window.performance.now()-c?(this.imageBuffer=d,this.copyGLTo2D=a):this.copyGLTo2D=s}},createWebGLCanvas:function(t,e){var i=n.util.createCanvasElement();i.width=t,i.height=e;var r={alpha:!0,premultipliedAlpha:!1,depth:!1,stencil:!1,antialias:!1},o=i.getContext("webgl",r);o||(o=i.getContext("experimental-webgl",r)),o&&(o.clearColor(0,0,0,0),this.canvas=i,this.gl=o)},applyFilters:function(t,e,i,n,r,o){var s,a=this.gl;o&&(s=this.getCachedTexture(o,e));var l={originalWidth:e.width||e.originalWidth,originalHeight:e.height||e.originalHeight,sourceWidth:i,sourceHeight:n,destinationWidth:i,destinationHeight:n,context:a,sourceTexture:this.createTexture(a,i,n,!s&&e),targetTexture:this.createTexture(a,i,n),originalTexture:s||this.createTexture(a,i,n,!s&&e),passes:t.length,webgl:!0,aPosition:this.aPosition,programCache:this.programCache,pass:0,filterBackend:this,targetCanvas:r},c=a.createFramebuffer();return a.bindFramebuffer(a.FRAMEBUFFER,c),t.forEach(function(t){t&&t.applyTo(l)}),function(t){var e=t.targetCanvas,i=e.width,n=e.height,r=t.destinationWidth,o=t.destinationHeight;i===r&&n===o||(e.width=r,e.height=o)}(l),this.copyGLTo2D(a,l),a.bindTexture(a.TEXTURE_2D,null),a.deleteTexture(l.sourceTexture),a.deleteTexture(l.targetTexture),a.deleteFramebuffer(c),r.getContext("2d").setTransform(1,0,0,1,0,0),l},applyFiltersDebug:function(t,e,i,n,r,o){var s=this.gl,a=this.applyFilters(t,e,i,n,r,o),l=s.getError();if(l!==s.NO_ERROR){var c=this.glErrorToString(s,l),h=new Error("WebGL Error "+c);throw h.glErrorCode=l,h}return a},glErrorToString:function(t,e){if(!t)return"Context undefined for error code: "+e;if("number"!=typeof e)return"Error code is not a number";switch(e){case t.NO_ERROR:return"NO_ERROR";case t.INVALID_ENUM:return"INVALID_ENUM";case t.INVALID_VALUE:return"INVALID_VALUE";case t.INVALID_OPERATION:return"INVALID_OPERATION";case t.INVALID_FRAMEBUFFER_OPERATION:return"INVALID_FRAMEBUFFER_OPERATION";case t.OUT_OF_MEMORY:return"OUT_OF_MEMORY";case t.CONTEXT_LOST_WEBGL:return"CONTEXT_LOST_WEBGL";default:return"UNKNOWN_ERROR"}},dispose:function(){this.canvas&&(this.canvas=null,this.gl=null),this.clearWebGLCaches()},clearWebGLCaches:function(){this.programCache={},this.textureCache={}},createTexture:function(t,e,i,n){var r=t.createTexture();return t.bindTexture(t.TEXTURE_2D,r),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,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){if(this.textureCache[t])return this.textureCache[t];var i=this.createTexture(this.gl,e.width,e.height,e);return this.textureCache[t]=i,i},evictCachesForKey:function(t){this.textureCache[t]&&(this.gl.deleteTexture(this.textureCache[t]),delete this.textureCache[t])},copyGLTo2D:s,captureGPUInfo:function(){if(this.gpuInfo)return this.gpuInfo;var t=this.gl,e=t.getExtension("WEBGL_debug_renderer_info"),i={renderer:"",vendor:""};if(e){var n=t.getParameter(e.UNMASKED_RENDERER_WEBGL),r=t.getParameter(e.UNMASKED_VENDOR_WEBGL);n&&(i.renderer=n.toLowerCase()),r&&(i.vendor=r.toLowerCase())}return this.gpuInfo=i,i}}}(),function(){"use strict";var t=function(){};function e(){}n.Canvas2dFilterBackend=e,e.prototype={evictCachesForKey:t,dispose:t,clearWebGLCaches:t,resources:{},applyFilters:function(t,e,i,n,r){var o=r.getContext("2d");o.drawImage(e,0,0,i,n);var s={sourceWidth:i,sourceHeight:n,imageData:o.getImageData(0,0,i,n),originalEl:e,originalImageData:o.getImageData(0,0,i,n),canvasEl:r,ctx:o,filterBackend:this};return t.forEach(function(t){t.applyTo(s)}),s.imageData.width===i&&s.imageData.height===n||(r.width=s.imageData.width,r.height=s.imageData.height),o.putImageData(s.imageData,0,0),s}}}(),n.Image.filters=n.Image.filters||{},n.Image.filters.BaseFilter=n.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"!==n.webGlPrecision&&(e=e.replace(/precision highp float/g,"precision "+n.webGlPrecision+" float"));var r=t.createShader(t.VERTEX_SHADER);if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error("Vertex shader compile error for "+this.type+": "+t.getShaderInfoLog(r));var o=t.createShader(t.FRAGMENT_SHADER);if(t.shaderSource(o,e),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS))throw new Error("Fragment shader compile error for "+this.type+": "+t.getShaderInfoLog(o));var s=t.createProgram();if(t.attachShader(s,r),t.attachShader(s,o),t.linkProgram(s),!t.getProgramParameter(s,t.LINK_STATUS))throw new Error('Shader link error for "${this.type}" '+t.getProgramInfoLog(s));var a=this.getAttributeLocations(t,s),l=this.getUniformLocations(t,s)||{};return l.uStepW=t.getUniformLocation(s,"uStepW"),l.uStepH=t.getUniformLocation(s,"uStepH"),{program:s,attributeLocations:a,uniformLocations:l}},getAttributeLocations:function(t,e){return{aPosition:t.getAttribLocation(e,"aPosition")}},getUniformLocations:function(){return{}},sendAttributeData:function(t,e,i){var n=e.aPosition,r=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n),t.vertexAttribPointer(n,2,t.FLOAT,!1,0,0),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW)},_setupFrameBuffer:function(t){var e,i,n=t.context;t.passes>1?(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(){return!1},applyTo:function(t){if(t.webgl){if(t.passes>1&&this.isNeutralState(t))return;this._setupFrameBuffer(t),this.applyToWebGL(t),this._swapTextures(t)}else this.isNeutralState()||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){if(!t.helpLayer){var e=document.createElement("canvas");
vendor: 18,561 bytes, line 3
3e.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()}}),n.Image.filters.BaseFilter.fromObject=function(t,e){var i=new n.Image.filters[t.type](t);return e&&e(i),i},function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.ColorMatrix=n(i.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)},isNeutralState:function(){for(var t=i.ColorMatrix,e=20;e--;)if(this.matrix[e]!==t.prototype.matrix[e])return!1;return!0},applyTo2d:function(t){var e,i,n,r,o,s=t.imageData.data,a=s.length,l=this.matrix,c=this.colorsOnly;for(o=0;o<a;o+=4)e=s[o],i=s[o+1],n=s[o+2],c?(s[o]=e*l[0]+i*l[1]+n*l[2]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+255*l[14]):(r=s[o+3],s[o]=e*l[0]+i*l[1]+n*l[2]+r*l[3]+255*l[4],s[o+1]=e*l[5]+i*l[6]+n*l[7]+r*l[8]+255*l[9],s[o+2]=e*l[10]+i*l[11]+n*l[12]+r*l[13]+255*l[14],s[o+3]=e*l[15]+i*l[16]+n*l[17]+r*l[18]+255*l[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]],r=[i[4],i[9],i[14],i[19]];t.uniformMatrix4fv(e.uColorMatrix,!1,n),t.uniform4fv(e.uConstants,r)}}),e.Image.filters.ColorMatrix.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Brightness=n(i.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){var e,i=t.imageData.data,n=i.length,r=Math.round(255*this.brightness);for(e=0;e<n;e+=4)i[e]=i[e]+r,i[e+1]=i[e+1]+r,i[e+2]=i[e+2]+r}},getUniformLocations:function(t,e){return{uBrightness:t.getUniformLocation(e,"uBrightness")}},sendUniformData:function(t,e){t.uniform1f(e.uBrightness,this.brightness)}}),e.Image.filters.Brightness.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Convolute=r(n.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),i=this.type+"_"+e+"_"+(this.opaque?1:0),n=this.fragmentSource[i];return t.programCache.hasOwnProperty(i)||(t.programCache[i]=this.createProgram(t.context,n)),t.programCache[i]},applyTo2d:function(t){var e,i,n,r,o,s,a,l,c,h,u,d,f,g=t.imageData,p=g.data,m=this.matrix,v=Math.round(Math.sqrt(m.length)),w=Math.floor(v/2),y=g.width,b=g.height,x=t.ctx.createImageData(y,b),_=x.data,C=this.opaque?1:0;for(u=0;u<b;u++)for(h=0;h<y;h++){for(o=4*(u*y+h),e=0,i=0,n=0,r=0,f=0;f<v;f++)for(d=0;d<v;d++)s=h+d-w,(a=u+f-w)<0||a>b||s<0||s>y||(l=4*(a*y+s),c=m[f*v+d],e+=p[l]*c,i+=p[l+1]*c,n+=p[l+2]*c,C||(r+=p[l+3]*c));_[o]=e,_[o+1]=i,_[o+2]=n,_[o+3]=C?p[o+3]:r}t.imageData=x},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 i(this.callSuper("toObject"),{opaque:this.opaque,matrix:this.matrix})}}),e.Image.filters.Convolute.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Grayscale=n(i.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){var e,i,n=t.imageData.data,r=n.length,o=this.mode;for(e=0;e<r;e+=4)"average"===o?i=(n[e]+n[e+1]+n[e+2])/3:"lightness"===o?i=(Math.min(n[e],n[e+1],n[e+2])+Math.max(n[e],n[e+1],n[e+2]))/2:"luminosity"===o&&(i=.21*n[e]+.72*n[e+1]+.07*n[e+2]),n[e]=i,n[e+1]=i,n[e+2]=i},retrieveShader:function(t){var e=this.type+"_"+this.mode;if(!t.programCache.hasOwnProperty(e)){var i=this.fragmentSource[this.mode];t.programCache[e]=this.createProgram(t.context,i)}return t.programCache[e]},getUniformLocations:function(t,e){return{uMode:t.getUniformLocation(e,"uMode")}},sendUniformData:function(t,e){t.uniform1i(e.uMode,1)}}),e.Image.filters.Grayscale.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Invert=n(i.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){if(this.invert){var e,i=t.imageData.data,n=i.length;for(e=0;e<n;e+=4)i[e]=255-i[e],i[e+1]=255-i[e+1],i[e+2]=255-i[e+2]}},getUniformLocations:function(t,e){return{uInvert:t.getUniformLocation(e,"uInvert")}},sendUniformData:function(t,e){t.uniform1i(e.uInvert,this.invert)}}),e.Image.filters.Invert.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.Noise=r(n.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){var e,i,n=t.imageData.data,r=n.length,o=this.noise;for(e=0,r=n.length;e<r;e+=4)i=(.5-Math.random())*o,n[e]+=i,n[e+1]+=i,n[e+2]+=i}},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 i(this.callSuper("toObject"),{noise:this.noise})}}),e.Image.filters.Noise.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Pixelate=n(i.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){if(1!==this.blocksize){var e,i,n,r,o,s,a,l,c,h,u,d=t.imageData,f=d.data,g=d.height,p=d.width;for(i=0;i<g;i+=this.blocksize)for(n=0;n<p;n+=this.blocksize)for(r=f[e=4*i*p+4*n],o=f[e+1],s=f[e+2],a=f[e+3],h=Math.min(i+this.blocksize,g),u=Math.min(n+this.blocksize,p),l=i;l<h;l++)for(c=n;c<u;c++)f[e=4*l*p+4*c]=r,f[e+1]=o,f[e+2]=s,f[e+3]=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)}}),e.Image.filters.Pixelate.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.extend,n=e.Image.filters,r=e.util.createClass;n.RemoveColor=r(n.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){var i,n,r,o,s=t.imageData.data,a=255*this.distance,l=new e.Color(this.color).getSource(),c=[l[0]-a,l[1]-a,l[2]-a],h=[l[0]+a,l[1]+a,l[2]+a];for(i=0;i<s.length;i+=4)n=s[i],r=s[i+1],o=s[i+2],n>c[0]&&r>c[1]&&o>c[2]&&n<h[0]&&r<h[1]&&o<h[2]&&(s[i+3]=0)},getUniformLocations:function(t,e){return{uLow:t.getUniformLocation(e,"uLow"),uHigh:t.getUniformLocation(e,"uHigh")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource(),r=parseFloat(this.distance),o=[0+n[0]/255-r,0+n[1]/255-r,0+n[2]/255-r,1],s=[n[0]/255+r,n[1]/255+r,n[2]/255+r,1];t.uniform4fv(i.uLow,o),t.uniform4fv(i.uHigh,s)},toObject:function(){return i(this.callSuper("toObject"),{color:this.color,distance:this.distance})}}),e.Image.filters.RemoveColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.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(var o in r)i[o]=n(i.ColorMatrix,{type:o,matrix:r[o],mainParameter:!1,colorsOnly:!0}),e.Image.filters[o].fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendColor=n(i.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){var i,n,r,o,s,a,l,c=t.imageData.data,h=c.length,u=1-this.alpha;i=(l=new e.Color(this.color).getSource())[0]*this.alpha,n=l[1]*this.alpha,r=l[2]*this.alpha;for(var d=0;d<h;d+=4)switch(o=c[d],s=c[d+1],a=c[d+2],this.mode){case"multiply":c[d]=o*i/255,c[d+1]=s*n/255,c[d+2]=a*r/255;break;case"screen":c[d]=255-(255-o)*(255-i)/255,c[d+1]=255-(255-s)*(255-n)/255,c[d+2]=255-(255-a)*(255-r)/255;break;case"add":c[d]=o+i,c[d+1]=s+n,c[d+2]=a+r;break;case"diff":case"difference":c[d]=Math.abs(o-i),c[d+1]=Math.abs(s-n),c[d+2]=Math.abs(a-r);break;case"subtract":c[d]=o-i,c[d+1]=s-n,c[d+2]=a-r;break;case"darken":c[d]=Math.min(o,i),c[d+1]=Math.min(s,n),c[d+2]=Math.min(a,r);break;case"lighten":c[d]=Math.max(o,i),c[d+1]=Math.max(s,n),c[d+2]=Math.max(a,r);break;case"overlay":c[d]=i<128?2*o*i/255:255-2*(255-o)*(255-i)/255,c[d+1]=n<128?2*s*n/255:255-2*(255-s)*(255-n)/255,c[d+2]=r<128?2*a*r/255:255-2*(255-a)*(255-r)/255;break;case"exclusion":c[d]=i+o-2*i*o/255,c[d+1]=n+s-2*n*s/255,c[d+2]=r+a-2*r*a/255;break;case"tint":c[d]=i+o*u,c[d+1]=n+s*u,c[d+2]=r+a*u
vendor: 2,204 bytes, line 3
3}},getUniformLocations:function(t,e){return{uColor:t.getUniformLocation(e,"uColor")}},sendUniformData:function(t,i){var n=new e.Color(this.color).getSource();n[0]=this.alpha*n[0]/255,n[1]=this.alpha*n[1]/255,n[2]=this.alpha*n[2]/255,n[3]=this.alpha,t.uniform4fv(i.uColor,n)},toObject:function(){return{type:this.type,color:this.color,mode:this.mode,alpha:this.alpha}}}),e.Image.filters.BlendColor.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric,i=e.Image.filters,n=e.util.createClass;i.BlendImage=n(i.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
vendor: 5,420 bytes, line 3
3e,i,n,r,o,s,a,l,c,h,u,d=t.imageData,f=t.filterBackend.resources,g=d.data,p=g.length,m=t.imageData.width,v=t.imageData.height,w=this.image;f.blendImage||(f.blendImage=document.createElement("canvas")),(c=f.blendImage).width===m&&c.height===v||(c.width=m,c.height=v),(h=c.getContext("2d")).setTransform(w.scaleX,0,0,w.scaleY,w.left,w.top),h.drawImage(w._element,0,0,m,v),u=h.getImageData(0,0,m,v).data;for(var y=0;y<p;y+=4)switch(o=g[y],s=g[y+1],a=g[y+2],l=g[y+3],e=u[y],i=u[y+1],n=u[y+2],r=u[y+3],this.mode){case"multiply":g[y]=o*e/255,g[y+1]=s*i/255,g[y+2]=a*n/255,g[y+3]=l*r/255;break;case"mask":g[y+3]=r}},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}}}),e.Image.filters.BlendImage.fromObject=function(t,i){e.Image.fromObject(t.image,function(n){var r=e.util.object.clone(t);r.image=n,i(new e.Image.filters.BlendImage(r))})}}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=Math.pow,n=Math.floor,r=Math.sqrt,o=Math.abs,s=Math.round,a=Math.sin,l=Math.ceil,c=e.Image.filters,h=e.util.createClass;c.Resize=h(c.BaseFilter,{type:"Resize",resizeType:"hermite",scaleX:0,scaleY:0,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;if(!t.programCache.hasOwnProperty(i)){var n=this.generateShader(e);t.programCache[i]=this.createProgram(t.context,n)}return 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),r=1;r<=i;r++)n[r-1]=t(r*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+="uniform float uTaps["+t+"];\n",i+="void main() {\n",i+=" vec4 color = texture2D(uTexture, vTexCoord);\n",i+=" float sum = 1.0;\n",e.forEach(function(t,e){i+=" color += texture2D(uTexture, vTexCoord + "+t+") * uTaps["+e+"];\n",i+=" color += texture2D(uTexture, vTexCoord - "+t+") * uTaps["+e+"];\n",i+=" sum += 2.0 * uTaps["+e+"];\n"}),i+=" gl_FragColor = color / sum;\n",i+="}"},fragmentSourceTOP:"precision highp float;\nuniform sampler2D uTexture;\nuniform vec2 uDelta;\nvarying vec2 vTexCoord;\n",applyTo:function(t){if(t.webgl){if(t.passes>1&&this.isNeutralState(t))return;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}else this.isNeutralState(t)||this.applyTo2d(t)},isNeutralState:function(t){var e=t.scaleX||this.scaleX,i=t.scaleY||this.scaleY;return 1===e&&1===i},lanczosCreate:function(t){return function(e){if(e>=t||e<=-t)return 0;if(e<1.1920929e-7&&e>-1.1920929e-7)return 1;var i=(e*=Math.PI)/t;return a(e)/e*a(i)/i}},applyTo2d:function(t){var e=t.imageData,i=this.scaleX,n=this.scaleY;this.rcpScaleX=1/i,this.rcpScaleY=1/n;var r,o=e.width,a=e.height,l=s(o*i),c=s(a*n);"sliceHack"===this.resizeType?r=this.sliceByTwo(t,o,a,l,c):"hermite"===this.resizeType?r=this.hermiteFastResize(t,o,a,l,c):"bilinear"===this.resizeType?r=this.bilinearFiltering(t,o,a,l,c):"lanczos"===this.resizeType&&(r=this.lanczosResize(t,o,a,l,c)),t.imageData=r},sliceByTwo:function(t,i,r,o,s){var a,l,c=t.imageData,h=!1,u=!1,d=.5*i,f=.5*r,g=e.filterBackend.resources,p=0,m=0,v=i,w=0;for(g.sliceByTwo||(g.sliceByTwo=document.createElement("canvas")),((a=g.sliceByTwo).width<1.5*i||a.height<r)&&(a.width=1.5*i,a.height=r),(l=a.getContext("2d")).clearRect(0,0,1.5*i,r),l.putImageData(c,0,0),o=n(o),s=n(s);!h||!u;)i=d,r=f,o<n(.5*d)?d=n(.5*d):(d=o,h=!0),s<n(.5*f)?f=n(.5*f):(f=s,u=!0),l.drawImage(a,p,m,i,r,v,w,d,f),p=v,m=w,w+=f;return l.getImageData(p,m,o,s)},lanczosResize:function(t,e,s,a,c){var h=t.imageData.data,u=t.ctx.createImageData(a,c),d=u.data,f=this.lanczosCreate(this.lanczosLobes),g=this.rcpScaleX,p=this.rcpScaleY,m=2/this.rcpScaleX,v=2/this.rcpScaleY,w=l(g*this.lanczosLobes/2),y=l(p*this.lanczosLobes/2),b={},x={},_={};return function t(l){var C,S,T,O,k,E,A,P,D,M,j;for(x.x=(l+.5)*g,_.x=n(x.x),C=0;C<c;C++){for(x.y=(C+.5)*p,_.y=n(x.y),k=0,E=0,A=0,P=0,D=0,S=_.x-w;S<=_.x+w;S++)if(!(S<0||S>=e)){M=n(1e3*o(S-x.x)),b[M]||(b[M]={});for(var L=_.y-y;L<=_.y+y;L++)L<0||L>=s||(j=n(1e3*o(L-x.y)),b[M][j]||(b[M][j]=f(r(i(M*m,2)+i(j*v,2))/1e3)),(T=b[M][j])>0&&(k+=T,E+=T*h[O=4*(L*e+S)],A+=T*h[O+1],P+=T*h[O+2],D+=T*h[O+3]))}d[O=4*(C*a+l)]=E/k,d[O+1]=A/k,d[O+2]=P/k,d[O+3]=D/k}return++l<a?t(l):u}(0)}
vendor: 4,133 bytes, line 3
3,bilinearFiltering:function(t,e,i,r,o){var s,a,l,c,h,u,d,f,g,p=0,m=this.rcpScaleX,v=this.rcpScaleY,w=4*(e-1),y=t.imageData.data,b=t.ctx.createImageData(r,o),x=b.data;for(l=0;l<o;l++)for(c=0;c<r;c++)for(h=m*c-(s=n(m*c)),u=v*l-(a=n(v*l)),g=4*(a*e+s),d=0;d<4;d++)f=y[g+d]*(1-h)*(1-u)+y[g+4+d]*h*(1-u)+y[g+w+d]*u*(1-h)+y[g+w+4+d]*h*u,x[p++]=f;return b},hermiteFastResize:function(t,e,i,s,a){for(var c=this.rcpScaleX,h=this.rcpScaleY,u=l(c/2),d=l(h/2),f=t.imageData.data,g=t.ctx.createImageData(s,a),p=g.data,m=0;m<a;m++)for(var v=0;v<s;v++){for(var w=4*(v+m*s),y=0,b=0,x=0,_=0,C=0,S=0,T=0,O=(m+.5)*h,k=n(m*h);k<(m+1)*h;k++)for(var E=o(O-(k+.5))/d,A=(v+.5)*c,P=E*E,D=n(v*c);D<(v+1)*c;D++){var M=o(A-(D+.5))/u,j=r(P+M*M);j>1&&j<-1||(y=2*j*j*j-3*j*j+1)>0&&(T+=y*f[(M=4*(D+k*e))+3],x+=y,f[M+3]<255&&(y=y*f[M+3]/250),_+=y*f[M],C+=y*f[M+1],S+=y*f[M+2],b+=y)}p[w]=_/b,p[w+1]=C/b,p[w+2]=S/b,p[w+3]=T/x}return g},toObject:function(){return{type:this.type,scaleX:this.scaleX,scaleY:this.scaleY,resizeType:this.resizeType,lanczosLobes:this.lanczosLobes}}}),e.Image.filters.Resize.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Contrast=n(i.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){var e,i=t.imageData.data,n=i.length,r=Math.floor(255*this.contrast),o=259*(r+255)/(255*(259-r));for(e=0;e<n;e+=4)i[e]=o*(i[e]-128)+128,i[e+1]=o*(i[e+1]-128)+128,i[e+2]=o*(i[e+2]-128)+128}},getUniformLocations:function(t,e){return{uContrast:t.getUniformLocation(e,"uContrast")}},sendUniformData:function(t,e){t.uniform1f(e.uContrast,this.contrast)}}),e.Image.filters.Contrast.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Saturation=n(i.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){var e,i,n=t.imageData.data,r=n.length,o=-this.saturation;for(e=0;e<r;e+=4)i=Math.max(n[e],n[e+1],n[e+2]),n[e]+=i!==n[e]?(i-n[e])*o:0,n[e+1]+=i!==n[e+1]?(i-n[e+1])*o:0,n[e+2]+=i!==n[e+2]?(i-n[e+2])*o:0}},getUniformLocations:function(t,e){return{uSaturation:t.getUniformLocation(e,"uSaturation")}},sendUniformData:function(t,e){t.uniform1f(e.uSaturation,-this.saturation)}}),e.Image.filters.Saturation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Blur=n(i.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.sourceW
vendor: 4,888 bytes, line 3
3idth/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 i,n,r=t.filterBackend.resources,o=t.imageData.width,s=t.imageData.height;r.blurLayer1||(r.blurLayer1=e.util.createCanvasElement(),r.blurLayer2=e.util.createCanvasElement()),i=r.blurLayer1,n=r.blurLayer2,i.width===o&&i.height===s||(n.width=i.width=o,n.height=i.height=s);var a,l,c,h,u=i.getContext("2d"),d=n.getContext("2d"),f=.06*this.blur*.5;for(u.putImageData(t.imageData,0,0),d.clearRect(0,0,o,s),h=-15;h<=15;h++)a=(Math.random()-.5)/4,c=f*(l=h/15)*o+a,d.globalAlpha=1-Math.abs(l),d.drawImage(i,c,a),u.drawImage(n,0,0),d.globalAlpha=1,d.clearRect(0,0,n.width,n.height);for(h=-15;h<=15;h++)a=(Math.random()-.5)/4,c=f*(l=h/15)*s+a,d.globalAlpha=1-Math.abs(l),d.drawImage(i,a,c),u.drawImage(n,0,0),d.globalAlpha=1,d.clearRect(0,0,n.width,n.height);t.ctx.drawImage(i,0,0);var g=t.ctx.getImageData(0,0,i.width,i.height);return u.globalAlpha=1,u.clearRect(0,0,i.width,i.height),g},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,e=1,i=[0,0];return this.horizontal?this.aspectRatio>1&&(e=1/this.aspectRatio):this.aspectRatio<1&&(e=this.aspectRatio),t=e*this.blur*.12,this.horizontal?i[0]=t:i[1]=t,i}}),i.Blur.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Gamma=n(i.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",applyTo2d:function(t){var e,i=t.imageData.data,n=this.gamma,r=i.length,o=1/n[0],s=1/n[1],a=1/n[2];for(this.rVals||(this.rVals=new Uint8Array(256),this.gVals=new Uint8Array(256),this.bVals=new Uint8Array(256)),e=0,r=256;e<r;e++)this.rVals[e]=255*Math.pow(e/255,o),this.gVals[e]=255*Math.pow(e/255,s),this.bVals[e]=255*Math.pow(e/255,a);for(e=0,r=i.length;e<r;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)}}),e.Image.filters.Gamma.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.Composed=n(i.BaseFilter,{type:"Composed",subFilters:[],initialize:function(t){this.callSuper("initialize",t),this.subFilters=this.subFilters.slice(0)},applyTo:function(t){t.passes+=this.subFilters.length-1,this.subFilters.forEach(function(e){e.applyTo(t)})},toObject:function(){return e.util.object.extend(this.callSuper("toObject"),{subFilters:this.subFilters.map(function(t){return t.toObject()})})}}),e.Image.filters.Composed.fromObject=function(t,i){var n=(t.subFilters||[]).map(function(t){return new e.Image.filters[t.type](t)}),r=new e.Image.filters.Composed({subFilters:n});return i&&i(r),r}}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.Image.filters,n=e.util.createClass;i.HueRotation=n(i.ColorMatrix,{type:"HueRotation",rotation:0,mainParameter:"rotation",calculateMatrix:function(){var t=this.rotation*Math.PI,i=e.util.cos(t),n=e.util.sin(t),r=Math.sqrt(1/3)*n,o=1-i;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]=i+o/3,this.matrix[1]=1/3*o-r,this.matrix[2]=1/3*o+r,this.matrix[5]=1/3*o+r,this.matrix[6]=i+1/3*o,this.matrix[7]=1/3*o-r,this.matrix[10]=1/3*o-r,this.matrix[11]=1/3*o+r,this.matrix[12]=i+1/3*o},applyTo:function(t){this.calculateMatrix(),e.Image.filters.BaseFilter.prototype.applyTo.call(this,t)}}),e.Image.filters.HueRotation.fromObject=e.Image.filters.BaseFilter.fromObject}(e),function(t){"use strict";var e=t.fabric||(t.fabric={}),i=e.util.object.clone;e.Text?e.warn("fabric.Text is already defined"):(e.Text=e.util.createClass(e.Object,{_dimensionAffectingProps:["fontSize","fontWeight","fontFamily","fontStyle","lineHeight","text","charSpacing","textAlign","styles"],_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}
vendor: 4,292 bytes, line 3
3,textBackgroundColor:"",stateProperties:e.Object.prototype.stateProperties.concat("fontFamily","fontWeight","fontSize","text","underline","overline","linethrough","textAlign","fontStyle","lineHeight","textBackgroundColor","charSpacing","styles"),cacheProperties:e.Object.prototype.cacheProperties.concat("fontFamily","fontWeight","fontSize","text","underline","overline","linethrough","textAlign","fontStyle","lineHeight","textBackgroundColor","charSpacing","styles"),stroke:null,shadow:null,_fontSizeFraction:.222,offsets:{underline:.1,linethrough:-.315,overline:-.88},_fontSizeMult:1.13,charSpacing:0,styles:null,_measuringContext:null,deltaY:0,_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.__skipDimension=!1,this.initDimensions(),this.setCoords(),this.setupState({propertySet:"_dimensionAffectingProps"})},getMeasuringContext:function(){return e._measuringContext||(e._measuringContext=this.canvas&&this.canvas.contextCache||e.util.createCanvasElement().getContext("2d")),e._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.width=this.calcTextWidth()||this.cursorWidth||this.MIN_TEXT_WIDTH,-1!==this.textAlign.indexOf("justify")&&this.enlargeSpaces(),this.height=this.calcTextHeight(),this.saveState({propertySet:"_dimensionAffectingProps"}))},enlargeSpaces:function(){for(var t,e,i,n,r,o,s,a=0,l=this._textLines.length;a<l;a++)if(("justify"===this.textAlign||a!==l-1&&!this.isEndOfWrapping(a))&&(n=0,r=this._textLines[a],(e=this.getLineWidth(a))<this.width&&(s=this.textLines[a].match(this._reSpacesAndTabs)))){i=s.length,t=(this.width-e)/i;for(var c=0,h=r.length;c<=h;c++)o=this.__charBounds[a][c],this._reSpaceAndTab.test(r[c])?(o.width+=t,o.kernedWidth+=t,o.left+=n,n+=t):o.left+=n}},isEndOfWrapping:function(t){return t===this._textLines.length-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){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){t.textBaseline="alphabetic",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);n>t&&(t=n)}return t},_renderTextLine:function(t,e,i,n,r,o){this._renderChars(t,e,i,n,r,o)},_renderTextLinesBackground:function(t){if(this.textBackgroundColor||this.styleHas("textBackgroundColor")){for(var e,i,n,r,o,s,a=0,l=t.fillStyle,c=this._getLeftOffset(),h=this._getTopOffset(),u=0,d=0,f=0,g=this._textLines.length;f<g;f++)if(e=this.getHeightOfLine(f),this.textBackgroundColor||this.styleHas("textBackgroundColor",f)){n=this._textLines[f],i=this._getLineLeftOffset(f),d=0,u=0,r=this.getValueOfPropertyAt(f,0,"textBackgroundColor");for(var p=0,m=n.length;p<m;p++)o=this.__charBounds[f][p],(s=this.getValueOfPropertyAt(f,p,"textBackgroundColor"))!==r?(t.fillStyle=r,r&&t.fillRect(c+i+u,h+a,d,e/this.lineHeight),u=o.left,d=o.width,r=s):d+=o.kernedWidth;s&&(t.fillStyle=s,t.fillRect(c+i+u,h+a,d,e/this.lineHeight)),a+=e}else a+=e;t.fillStyle=l,this._removeShadow(t)}},getFontCache:function(t){var i=t.fontFamily.toLowerCase();e.charWidthsCache[i]||(e.charWidthsCache[i]={});var n=e.charWidthsCache[i],r=t.fontStyle.toLowerCase()+"_"+(t.fontWeight+"").toLowerCase();return n[r]||(n[r]={}),n[r]}
vendor: 4,112 bytes, line 3
3,_applyCharStyles:function(t,e,i,n,r){this._setFillStyles(e,r),this._setStrokeStyles(e,r),e.font=this._getFontDeclaration(r)},_measureChar:function(t,e,i,n){var r,o,s,a,l=this.getFontCache(e),c=i+t,h=this._getFontDeclaration(e)===this._getFontDeclaration(n),u=e.fontSize/this.CACHE_FONT_SIZE;if(i&&void 0!==l[i]&&(s=l[i]),void 0!==l[t]&&(a=r=l[t]),h&&void 0!==l[c]&&(a=(o=l[c])-s),void 0===r||void 0===s||void 0===o){var d=this.getMeasuringContext();this._setTextStyles(d,e,!0)}return void 0===r&&(a=r=d.measureText(t).width,l[t]=r),void 0===s&&h&&i&&(s=d.measureText(i).width,l[i]=s),h&&void 0===o&&(o=d.measureText(c).width,l[c]=o,a=o-s),{width:r*u,kernedWidth:a*u}},getHeightOfChar:function(t,e){return this.getValueOfPropertyAt(t,e,"fontSize")},measureLine:function(t){var e=this._measureLine(t);return 0!==this.charSpacing&&(e.width-=this._getWidthOfCharSpacing()),e.width<0&&(e.width=0),e},_measureLine:function(t){var e,i,n,r,o=0,s=this._textLines[t],a=new Array(s.length);for(this.__charBounds[t]=a,e=0;e<s.length;e++)i=s[e],r=this._getGraphemeBox(i,t,e,n),a[e]=r,o+=r.kernedWidth,n=i;return a[e]={left:r?r.left+r.width:0,width:0,kernedWidth:0,height:this.fontSize},{width:o,numOfSpaces:0}},_getGraphemeBox:function(t,e,i,n,r){var o,s=this.getCompleteStyleDeclaration(e,i),a=n?this.getCompleteStyleDeclaration(e,i-1):{},l=this._measureChar(t,s,n,a),c=l.kernedWidth,h=l.width;0!==this.charSpacing&&(h+=o=this._getWidthOfCharSpacing(),c+=o);var u={width:h,left:0,height:s.fontSize,kernedWidth:c,deltaY:s.deltaY};if(i>0&&!r){var d=this.__charBounds[e][i-1];u.left=d.left+d.width+l.kernedWidth-l.width}return u},getHeightOfLine:function(t){if(this.__lineHeights[t])return this.__lineHeights[t];for(var e=this._textLines[t],i=this.getHeightOfChar(t,0),n=1,r=e.length;n<r;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-this.width/2},_getTopOffset:function(){return-this.height/2},_renderTextCommon:function(t,e){t.save();for(var i=0,n=this._getLeftOffset(),r=this._getTopOffset(),o=this._applyPatternGradientTransform(t,"fillText"===e?this.fill:this.stroke),s=0,a=this._textLines.length;s<a;s++){var l=this.getHeightOfLine(s),c=l/this.lineHeight,h=this._getLineLeftOffset(s);this._renderTextLine(e,t,this._textLines[s],n+h-o.offsetX,r+i+c-o.offsetY,s),i+=l}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,r,o){var s,a,l,c,h=this.getHeightOfLine(o),u=-1!==this.textAlign.indexOf("justify"),d="",f=0,g=!u&&0===this.charSpacing&&this.isEmptyStyles(o);if(e.save(),r-=h*this._fontSizeFraction/this.lineHeight,g)return this._renderChar(t,e,o,0,this.textLines[o],n,r,h),void e.restore();for(var p=0,m=i.length-1;p<=m;p++)c=p===m||this.charSpacing,d+=i[p],l=this.__charBounds[o][p],0===f?(n+=l.kernedWidth-l.width,f+=l.width):f+=l.kernedWidth,u&&!c&&this._reSpaceAndTab.test(i[p])&&(c=!0),c||(s=s||this.getCompleteStyleDeclaration(o,p),a=this.getCompleteStyleDeclaration(o,p+1),c=this._hasStyleChanged(s,a)),c&&(this._renderChar(t,e,o,p,d,n,r,h),d="",s=a,n+=f,f=0);e.restore()},_renderChar:function(t,e,i,n,r,o,s){var a=this._getStyleDeclaration(i,n),l=this.getCompleteStyleDeclaration(i,n),c="fillText"===t&&l.fill,h="strokeText"===t&&l.stroke&&l.strokeWidth;(h||c)&&(a&&e.save(),this._applyCharStyles(t,e,i,n,l),a&&a.textBackgroundColor&&this._removeShadow(e),a&&a.deltaY&&(s+=a.deltaY),c&&e.fillText(r,o,s),h&&e.strokeText(r,o,s),a&&e.restore())},setSuperscript:function(t,e){return this._setScript(t,e,this.superscript)},setSubscript:function(t,e){return this._setScript(t,e,this.subscript)}
vendor: 9,658 bytes, line 3
3,_setScript:function(t,e,i){var n=this.get2DCursorLocation(t,!0),r=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"fontSize"),o=this.getValueOfPropertyAt(n.lineIndex,n.charIndex,"deltaY"),s={fontSize:r*i.size,deltaY:o+r*i.baseline};return this.setSelectionStyles(s,t,e),this},_hasStyleChanged:function(t,e){return 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.deltaY!==e.deltaY},_hasStyleChangedForSvg:function(t,e){return this._hasStyleChanged(t,e)||t.overline!==e.overline||t.underline!==e.underline||t.linethrough!==e.linethrough},_getLineLeftOffset:function(t){var e=this.getLineWidth(t);return"center"===this.textAlign?(this.width-e)/2:"right"===this.textAlign?this.width-e:"justify-center"===this.textAlign&&this.isEndOfWrapping(t)?(this.width-e)/2:"justify-right"===this.textAlign&&this.isEndOfWrapping(t)?this.width-e:0},_clearCache:function(){this.__lineWidths=[],this.__lineHeights=[],this.__charBounds=[]},_shouldClearDimensionCache:function(){var t=this._forceClearCache;return t||(t=this.hasStateChanged("_dimensionAffectingProps")),t&&(this.dirty=!0,this._forceClearCache=!1),t},getLineWidth:function(t){return this.__lineWidths[t]?this.__lineWidths[t]:(e=""===this._textLines[t]?0:this.measureLine(t).width,this.__lineWidths[t]=e,e);var e},_getWidthOfCharSpacing:function(){return 0!==this.charSpacing?this.fontSize*this.charSpacing/1e3:0},getValueOfPropertyAt:function(t,e,i){var n=this._getStyleDeclaration(t,e);return n&&void 0!==n[i]?n[i]:this[i]},_renderTextDecoration:function(t,e){if(this[e]||this.styleHas(e)){for(var i,n,r,o,s,a,l,c,h,u,d,f,g,p,m,v,w=this._getLeftOffset(),y=this._getTopOffset(),b=this._getWidthOfCharSpacing(),x=0,_=this._textLines.length;x<_;x++)if(i=this.getHeightOfLine(x),this[e]||this.styleHas(e,x)){l=this._textLines[x],p=i/this.lineHeight,o=this._getLineLeftOffset(x),u=0,d=0,c=this.getValueOfPropertyAt(x,0,e),v=this.getValueOfPropertyAt(x,0,"fill"),h=y+p*(1-this._fontSizeFraction),n=this.getHeightOfChar(x,0),s=this.getValueOfPropertyAt(x,0,"deltaY");for(var C=0,S=l.length;C<S;C++)f=this.__charBounds[x][C],g=this.getValueOfPropertyAt(x,C,e),m=this.getValueOfPropertyAt(x,C,"fill"),r=this.getHeightOfChar(x,C),a=this.getValueOfPropertyAt(x,C,"deltaY"),(g!==c||m!==v||r!==n||a!==s)&&d>0?(t.fillStyle=v,c&&v&&t.fillRect(w+o+u,h+this.offsets[e]*n+s,d,this.fontSize/15),u=f.left,d=f.width,c=g,v=m,n=r,s=a):d+=f.kernedWidth;t.fillStyle=m,g&&m&&t.fillRect(w+o+u,h+this.offsets[e]*n+s,d-b,this.fontSize/15),y+=i}else y+=i;this._removeShadow(t)}},_getFontDeclaration:function(t,i){var n=t||this,r=this.fontFamily,o=e.Text.genericFonts.indexOf(r.toLowerCase())>-1,s=void 0===r||r.indexOf("'")>-1||r.indexOf('"')>-1||o?n.fontFamily:'"'+n.fontFamily+'"';return[e.isLikelyNode?n.fontWeight:n.fontStyle,e.isLikelyNode?n.fontStyle:n.fontWeight,i?this.CACHE_FONT_SIZE+"px":n.fontSize+"px",s].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 i=t.split(this._reNewline),n=new Array(i.length),r=["\n"],o=[],s=0;s<i.length;s++)n[s]=e.util.string.graphemeSplit(i[s]),o=o.concat(n[s],r);return o.pop(),{_unwrappedLines:n,lines:i,graphemeText:o,graphemeLines:n}},toObject:function(t){var e=["text","fontSize","fontWeight","fontFamily","fontStyle","lineHeight","underline","overline","linethrough","textAlign","textBackgroundColor","charSpacing"].concat(t),n=this.callSuper("toObject",e);return n.styles=i(this.styles,!0),n},set:function(t,e){this.callSuper("set",t,e);var i=!1;if("object"==typeof t)for(var n in t)i=i||-1!==this._dimensionAffectingProps.indexOf(n);else i=-1!==this._dimensionAffectingProps.indexOf(t);return i&&(this.initDimensions(),this.setCoords()),this},complexity:function(){return 1}}),e.Text.ATTRIBUTE_NAMES=e.SHARED_ATTRIBUTES.concat("x y dx dy font-family font-style font-weight font-size letter-spacing text-decoration text-anchor".split(" ")),e.Text.DEFAULT_SVG_FONT_SIZE=16,e.Text.fromElement=function(t,n,r){if(!t)return n(null);var o=e.parseAttributes(t,e.Text.ATTRIBUTE_NAMES),s=o.textAnchor||"left";if((r=e.util.object.extend(r?i(r):{},o)).top=r.top||0,r.left=r.left||0,o.textDecoration){var a=o.textDecoration;-1!==a.indexOf("underline")&&(r.underline=!0),-1!==a.indexOf("overline")&&(r.overline=!0),-1!==a.indexOf("line-through")&&(r.linethrough=!0),delete r.textDecoration}"dx"in o&&(r.left+=o.dx),"dy"in o&&(r.top+=o.dy),"fontSize"in r||(r.fontSize=e.Text.DEFAULT_SVG_FONT_SIZE);var l="";"textContent"in t?l=t.textContent:"firstChild"in t&&null!==t.firstChild&&"data"in t.firstChild&&null!==t.firstChild.data&&(l=t.firstChild.data),l=l.replace(/^\s+|\s+$|\n+/g,"").replace(/\s+/g," ");var c=r.strokeWidth;r.strokeWidth=0;var h=new e.Text(l,r),u=h.getScaledHeight()/h.height,d=((h.height+h.strokeWidth)*h.lineHeight-h.height)*u,f=h.getScaledHeight()+d,g=0;"center"===s&&(g=h.getScaledWidth()/2),"right"===s&&(g=h.getScaledWidth()),h.set({left:h.left-g,top:h.top-(f-h.fontSize*(.07+h._fontSizeFraction))/h.lineHeight,strokeWidth:void 0!==c?c:1}),n(h)},e.Text.fromObject=function(t,i){return e.Object._fromObject("Text",t,i,"text")},e.Text.genericFonts=["sans-serif","serif","cursive","fantasy","monospace"],e.util.createAccessors&&e.util.createAccessors(e.Text))}(e),n.util.object.extend(n.Text.prototype,{isEmptyStyles:function(t){if(!this.styles)return!0;if(void 0!==t&&!this.styles[t])return!0;var e=void 0===t?this.styles:{line:this.styles[t]};for(var i in e)for(var n in e[i])for(var r in e[i][n])return!1;return!0},styleHas:function(t,e){if(!this.styles||!t||""===t)return!1;if(void 0!==e&&!this.styles[e])return!1;var i=void 0===e?this.styles:{line:this.styles[e]};for(var n in i)for(var r in i[n])if(void 0!==i[n][r][t])return!0;return!1},cleanStyle:function(t){if(!this.styles||!t||""===t)return!1;var e,i,n=this.styles,r=0,o=!0,s=0;for(var a in n){for(var l in e=0,n[a]){var c;r++,(c=n[a][l]).hasOwnProperty(t)?(i?c[t]!==i&&(o=!1):i=c[t],c[t]===this[t]&&delete c[t]):o=!1,0!==Object.keys(c).length?e++:delete n[a][l]}0===e&&delete n[a]}for(var h=0;h<this._textLines.length;h++)s+=this._textLines[h].length;o&&r===s&&(this[t]=i,this.removeStyle(t))},removeStyle:function(t){if(this.styles&&t&&""!==t){var e,i,n,r=this.styles;for(i in r){for(n in e=r[i])delete e[n][t],0===Object.keys(e[n]).length&&delete e[n];0===Object.keys(e).length&&delete r[i]}}},_extendStyles:function(t,e){var i=this.get2DCursorLocation(t);this._getLineStyle(i.lineIndex)||this._setLineStyle(i.lineIndex,{}),this._getStyleDeclaration(i.lineIndex,i.charIndex)||this._setStyleDeclaration(i.lineIndex,i.charIndex,{}),n.util.object.extend(this._getStyleDeclaration(i.lineIndex,i.charIndex),e)},get2DCursorLocation:function(t,e){void 0===t&&(t=this.selectionStart);for(var i=e?this._unwrappedTextLines:this._textLines,n=i.length,r=0;r<n;r++){if(t<=i[r].length)return{lineIndex:r,charIndex:t};t-=i[r].length+1}return{lineIndex:r-1,charIndex:i[r-1].length<t?i[r-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=[],r=t;r<e;r++)n.push(this.getStyleAtPosition(r,i));return n},getStyleAtPosition:function(t,e){var i=this.get2DCursorLocation(t);return(e?this.getCompleteStyleDeclaration(i.lineIndex,i.charIndex):this._getStyleDeclaration(i.lineIndex,i.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){var i=this.styles&&this.styles[t];return i?i[e]:null},getCompleteStyleDeclaration:function(t,e){for(var i,n=this._getStyleDeclaration(t,e)||{},r={},o=0;o<this._styleProperties.length;o++)r[i=this._styleProperties[o]]=void 0===n[i]?this[i]:n[i];return r},_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,e){this.styles[t]=e},_deleteLineStyle:function(t){delete this.styles[t]}}),function(){function t(t){t.textDecoration&&(t.textDecoration.indexOf("underline")>-1&&(t.underline=!0),t.textDecoration.indexOf("line-through")>-1&&(t.linethrough=!0),t.textDecoration.indexOf("overline")>-1&&(t.overline=!0),delete t.textDecoration)}n.IText=n.util.createClass(n.Text,n.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:"#333",cursorDelay:1e3,cursorDuration:600,caching:!0,_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.cursorOffsetCac
vendor: 14,718 bytes, line 3
3he={},this.renderCursorOrSelection()},_render:function(t){this.callSuper("_render",t)},clearContextTop:function(t){if(this.isEditing&&this.canvas&&this.canvas.contextTop){var 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.transformMatrix&&e.transform.apply(e,this.transformMatrix),this._clearTextArea(e),t||e.restore()}},renderCursorOrSelection:function(){if(this.isEditing&&this.canvas){var t,e=this._getCursorBoundaries();this.canvas&&this.canvas.contextTop?(t=this.canvas.contextTop,this.clearContextTop(!0)):(t=this.canvas.contextContainer).save(),this.selectionStart===this.selectionEnd?this.renderCursor(e,t):this.renderSelection(e,t),t.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(),n=this._getCursorBoundariesOffsets(t);return{left:e,top:i,leftOffset:n.left,topOffset:n.top}},_getCursorBoundariesOffsets:function(t){if(this.cursorOffsetCache&&"top"in this.cursorOffsetCache)return this.cursorOffsetCache;var e,i,n,r,o=0,s=0,a=this.get2DCursorLocation(t);n=a.charIndex,i=a.lineIndex;for(var l=0;l<i;l++)o+=this.getHeightOfLine(l);e=this._getLineLeftOffset(i);var c=this.__charBounds[i][n];return c&&(s=c.left),0!==this.charSpacing&&n===this._textLines[i].length&&(s-=this._getWidthOfCharSpacing()),r={top:o,left:e+(s>0?s:0)},this.cursorOffsetCache=r,this.cursorOffsetCache},renderCursor:function(t,e){var i=this.get2DCursorLocation(),n=i.lineIndex,r=i.charIndex>0?i.charIndex-1:0,o=this.getValueOfPropertyAt(n,r,"fontSize"),s=this.scaleX*this.canvas.getZoom(),a=this.cursorWidth/s,l=t.topOffset,c=this.getValueOfPropertyAt(n,r,"deltaY");l+=(1-this._fontSizeFraction)*this.getHeightOfLine(n)/this.lineHeight-o*(1-this._fontSizeFraction),this.inCompositionMode&&this.renderSelection(t,e),e.fillStyle=this.getValueOfPropertyAt(n,r,"fill"),e.globalAlpha=this.__isMousedown?1:this._currentCursorOpacity,e.fillRect(t.left+t.leftOffset-a/2,l+t.top+c,a,o)},renderSelection:function(t,e){for(var i=this.inCompositionMode?this.hiddenTextarea.selectionStart:this.selectionStart,n=this.inCompositionMode?this.hiddenTextarea.selectionEnd:this.selectionEnd,r=-1!==this.textAlign.indexOf("justify"),o=this.get2DCursorLocation(i),s=this.get2DCursorLocation(n),a=o.lineIndex,l=s.lineIndex,c=o.charIndex<0?0:o.charIndex,h=s.charIndex<0?0:s.charIndex,u=a;u<=l;u++){var d,f=this._getLineLeftOffset(u)||0,g=this.getHeightOfLine(u),p=0,m=0;if(u===a&&(p=this.__charBounds[a][c].left),u>=a&&u<l)m=r&&!this.isEndOfWrapping(u)?this.width:this.getLineWidth(u)||5;else if(u===l)if(0===h)m=this.__charBounds[l][h].left;else{var v=this._getWidthOfCharSpacing();m=this.__charBounds[l][h-1].left+this.__charBounds[l][h-1].width-v}d=g,(this.lineHeight<1||u===l&&this.lineHeight>1)&&(g/=this.lineHeight),this.inCompositionMode?(e.fillStyle=this.compositionColor||"black",e.fillRect(t.left+f+p,t.top+t.topOffset+g,m-p,1)):(e.fillStyle=this.selectionColor,e.fillRect(t.left+f+p,t.top+t.topOffset,m-p,g)),t.topOffset+=d}},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=t.charIndex>0?t.charIndex-1:0;return{l:t.lineIndex,c:e}}}),n.IText.fromObject=function(e,i){if(t(e),e.styles)for(var r in e.styles)for(var o in e.styles[r])t(e.styles[r][o]);n.Object._fromObject("IText",e,i,"text")}}(),function(){var t=n.util.object.clone;n.util.object.extend(n.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 t=this;this.on("added",function(){var e=t.canvas;e&&(e._hasITextHandlers||(e._hasITextHandlers=!0,t._initCanvasHandlers(e)),e._iTextInstances=e._iTextInstances||[],e._iTextInstances.push(t))})},initRemovedHandler:function(){var t=this;this.on("removed",function(){var e=t.canvas;e&&(e._iTextInstances=e._iTextInstances||[],n.util.removeFromArray(e._iTextInstances,t),0===e._iTextInstances.length&&(e._hasITextHandlers=!1,t._removeCanvasHandlers(e)))})},_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 r;return r={isAborted:!1,abort:function(){this.isAborted=!0}},t.animate("_currentCursorOpacity",e,{duration:i,onComplete:function(){r.isAborted||t[n]()},onChange:function(){t.canvas&&t.selectionStart===t.selectionEnd&&t.renderCursorOrSelection()},abort:function(){return r.isAborted}}),r},_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,i=t?0:this.cursorDelay;this.abortCursorAnimation(),this._currentCursorOpacity=1,this._cursorTimeout2=setTimeout(function(){e._tick()},i)},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])&&i>-1;)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])&&i>-1;)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._reSpace.test(this.text.charAt(t))?t-1:t,n=this.text.charAt(i),r=/[ \n\.,;!\?\-]/;!r.test(n)&&i>0&&i<this.text.length;)i+=e,n=this.text.charAt(i);return r.test(n)&&"\n"!==n&&(i+=1===e?0:1),i},selectWord:function(t){t=t||this.selectionStart;var e=this.searchWordBoundary(t,-1),i=this.searchWordBoundary(t,1);this.selectionStart=e,this.selectionEnd=i,this._fireSelectionChanged(),this._updateTextarea(),this.renderCursorOrSelection()},selectLine:function(t){t=t||this.selectionStart;var e=this.findLineBoundaryLeft(t),i=this.findLineBoundaryRight(t);return this.selectionStart=e,this.selectionEnd=i,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):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){if(this.__isMousedown&&this.isEditing){var e=this.getSelectionStartFromPointer(t.e),i=this.selectionStart,n=this.selectionEnd;(e===this.__selectionStartOnMouseDown&&i!==n||i!==e&&n!==e)&&(e>this.__selectionStartOnMouseDown?(this.selectionStart=this.__selectionStartOnMouseDown,this.selectionEnd=e):(this.selectionStart=e,this.selectionEnd=this.__selectionStartOnMouseDown),this.selectionStart===i&&this.selectionEnd===n||(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 r=i.slice(0,t),o=n.util.string.graphemeSplit(r).length;if(t===e)return{selectionStart:o,selectionEnd:o};var s=i.slice(t,e);return{selectionStart:o,selectionEnd:o+n.util.string.graphemeSplit(s).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(){if(this.cursorOffsetCache={},this.hiddenTextarea){if(!this.inCompositionMode){var t=this.fromGraphemeToStringSelection(this.selectionStart,this.selectionEnd,this._text);this.hiddenTextarea.selectionStart=t.selectionStart,this.hiddenTextarea.selectionEnd=t.selectionEnd}this.updateTextareaPosition()}},updateFromTextArea:function(){if(this.hiddenTextarea){this.cursorOffsetCache={},this.text=this.hiddenTextarea.value,this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords());var 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(){if(this.selectionStart===this.selectionEnd){var t=this._calcTextareaPosition();this.hiddenTextarea.style.left=t.left,this.hiddenTextarea.style.top=t.top}},_calcTextareaPosition:function(){if(!this.canvas)return{x:1,y:1};var t=this.inCompositionMode?this.compositionStart:this.selectionStart,e=this._getCursorBoundaries(t),i=this.get2DCursorLocation(t),r=i.lineIndex,o=i.charIndex,s=this.getValueOfPropertyAt(r,o,"fontSize")*this.lineHeight,a=e.leftOffset,l=this.calcTransformMatrix(),c={x:e.left+a,y:e.top+e.topOffset+s},h=this.canvas.upperCanvasEl,u=h.width,d=h.height,f=u-s,g=d-s,p=h.clientWidth/u,m=h.clientHeight/d;return c=n.util.transformPoint(c,l),(c=n.util.transformPoint(c,this.canvas.viewportTransform)).x*=p,c.y*=m,c.x<0&&(c.x=0),c.x>f&&(c.x=f),c.y<0&&(c.y=0),c.y>g&&(c.y=g),c.x+=this.canvas._offset.left,c.y+=this.canvas._offset.top,{left:c.x+"px",top:c.y+"px",fontSize:s+"px",charHeight:s}},_saveEditingProps:function(){this._savedProps={hasControls:this.hasControls,borderColor:this.borderColor,lockMovementX:this.lockMovementX,lockMovementY:this.lockMovementY,hoverCursor:this.hoverCursor,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.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;return this.selected=!1,this.isEditing=!1,this.selectable=!0,this.selectionEnd=this.selectionStart,this.hiddenTextarea&&(this.hiddenTextarea.blur&&this.hiddenTextarea.blur(),this.canvas&&this.hiddenTextarea.parentNode.removeChild(this.hiddenTextarea),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 i,n,r=this.get2DCursorLocation(t,!0),o=this.get2DCursorLocation(e,!0),s=r.lineIndex,a=r.charIndex,l=o.lineIndex,c=o.charIndex;if(s!==l){if(this.styles[s])for(i=a;i<this._unwrappedTextLines[s].length;i++)delete this.styles[s][i];if(this.styles[l])for(i=c;i<this._unwrappedTextLines[l].length;i++)(n=this.styles[l][i])&&(this.styles[s]||(this.styles[s]={}),this.styles[s][a+i-c]=n);for(i=s+1;i<=l;i++)delete this.styles[i];this.shiftLineStyles(l,s-l)}else if(this.styles[s]){n=this.styles[s];var h,u,d=c-a;for(i=a;i<c;i++)delete n[i];for(u in this.styles[s])(h=parseInt(u,10))>=c&&(n[h-d]=n[u],delete n[u])}},shiftLineStyles:function(e,i){var n=t(this.styles);for(var r in this.styles){var o=parseInt(r,10);o>e&&(this.styles[o+i]=n[o],n[o-i]||delete this.styles[o])}},restartCursorIfNeeded:function(){this._currentTickState&&!this._currentTickState.isAborted&&this._currentTickCompleteState&&!this._currentTickCompleteState.isAborted||this.initDelayedCursor()},insertNewlineStyleObject:function(e,i,n,r){var o,s={},a=!1;for(var l in n||(n=1),this.shiftLineStyles(e,n),this.styles[e]&&(o=this.styles[e][0===i?i:i-1]),this.styles[e]){var c=parseInt(l,10);c>=i&&(a=!0,s[c-i]=this.styles[e][l],delete this.styles[e][l])}for(a?this.styles[e+n]=s:delete this.styles[e+n];n>1;)n--,r&&r[n]?this.styles[e+n]={0:t(r[n])}:o?this.styles[e+n]={0:t(o)}:delete this.styles[e+n];this._forceClearCache=!0},insertCharStyleObject:function(e,i,n,r){this.styles||(this.styles={});var o=this.styles[e],s=o?t(o):{};for(var a in n||(n=1),s){var l=parseInt(a,10);l>=i&&(o[l+n]=s[l],s[l-n]||delete o[l])}if(this._forceClearCache=!0,r)for(;n--;)Object.keys(r[n]).length&&(this.styles[e]||(this.styles[e]={}),this.styles[e][i+n]=t(r[n]));else if(o)for(var c=o[i?i-1:1];c&&n--;)this.styles[e][i+n]=t(c)}
vendor: 4,538 bytes, line 3
3,insertNewStyleBlock:function(t,e,i){for(var n=this.get2DCursorLocation(e,!0),r=[0],o=0,s=0;s<t.length;s++)"\n"===t[s]?r[++o]=0:r[o]++;r[0]>0&&(this.insertCharStyleObject(n.lineIndex,n.charIndex,r[0],i),i=i&&i.slice(r[0]+1)),o&&this.insertNewlineStyleObject(n.lineIndex,n.charIndex+r[0],o);for(s=1;s<o;s++)r[s]>0?this.insertCharStyleObject(n.lineIndex+s,0,r[s],i):i&&(this.styles[n.lineIndex+s][0]=i[0]),i=i&&i.slice(r[s]+1);r[s]>0&&this.insertCharStyleObject(n.lineIndex+s,0,r[s],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):i>t&&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)}})}(),n.util.object.extend(n.IText.prototype,{initDoubleClickSimulation:function(){this.__lastClickTime=+new Date,this.__lastLastClickTime=+new Date,this.__lastPointer={},this.on("mousedown",this.onMouseDown)},onMouseDown:function(t){if(this.canvas){this.__newClickTime=+new Date;var 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()},initClicks:function(){this.on("mousedblclick",function(t){this.selectWord(this.getSelectionStartFromPointer(t.e))}),this.on("tripleclick",function(t){this.selectLine(this.getSelectionStartFromPointer(t.e))})},_mouseDownHandler:function(t){!this.canvas||!this.editable||t.e.button&&1!==t.e.button||(this.__isMousedown=!0,this.selected&&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===this.canvas._activeObject&&(this.selected=!0)},initMousedownHandler:function(){this.on("mousedown",this._mouseDownHandler),this.on("mousedown:before",this._mouseDownHandlerBefore)},initMouseupHandler:function(){this.on("mouseup",this.mouseUpHandler)},mouseUpHandler:function(t){this.__isMousedown=!1,!this.editable||t.transform&&t.transform.actionPerformed||t.e.button&&1!==t.e.button||(this.__lastSelected&&!this.__corner&&(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,r=0,o=0,s=0,a=0,l=this._textLines.length;a<l&&r<=e.y;a++)r+=this.getHeightOfLine(a)*this.scaleY,s=a,a>0&&(o+=this._textLines[a-1].length+1);n=this._getLineLeftOffset(s)*this.scaleX;for(var c=0,h=this._textLines[s].length;c<h&&(i=n,(n+=this.__charBounds[s][c].kernedWidth*this.scaleX)<=e.x);c++)o++;return this._getNewSelectionStartFromOffset(e,i,n,o,h)},_getNewSelectionStartFromOffset:function(t,e,i,n,r){var o=t.x-e,s=i-t.x,a=n+(s>o||s<0?0:1);return this.flipX&&(a=r-a),a>this._text.length&&(a=this._text.length),a}}),n.util.object.extend(n.IText.prototype,{initHiddenTextarea:function(){this.hiddenTextarea=n.document.createElement("textarea"),this.hiddenTextarea.setAttribute("autocapitalize","off"),this.hiddenTextarea.setAttribute("autocorrect","off"),this.hiddenTextarea.setAttribute("autocomplete","off"),this.hiddenTextarea.setAttribute("spellcheck","fal
3se"),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; line-height: 1px; paddingï½°top: "+t.fontSize+";",n.document.body.appendChild(this.hiddenTextarea),n.util.addListener(this.hiddenTextarea,"keydown",this.onKeyDown.bind(this)),n.util.addListener(this.hiddenTextarea,"keyup",this.onKeyUp.bind(this)),n.util.addListener(this.hiddenTextarea,"input",this.onInput.bind(this)),n.util.addListener(this.hiddenTextarea,"copy",this.copy.bind(this)),n.util.addListener(this.hiddenTextarea,"cut",this.copy.bind(this)),n.util.addListener(this.hiddenTextarea,"paste",this.paste.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionstart",this.onCompositionStart.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionupdate",this.onCompositionUpdate.bind(this)),n.util.addListener(this.hiddenTextarea,"compositionend",this.onCompositionEnd.bind(this)),!this._clickHandlerInitialized&&this.canvas&&(n.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"},ctrlKeysMapUp:{67:"copy",88:"cut"},ctrlKeysMapDown:{65:"selectAll"},onClick:function(){this.hiddenTextarea&&this.hiddenTextarea.focus()},onKeyDown:function(t){if(this.isEditing&&!this.inCompositionMode){if(t.keyCode in this.keysMap)this[this.keysMap[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(),t.keyCode>=33&&t.keyCode<=40?(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=this.fromPaste;if(this.fromPaste=!1,t&&t.stopPropagation(),this.isEditing){var i,r,o=this._splitTextIntoLines(this.hiddenTextarea.value).graphemeText,s=this._text.length,a=o.length,l=a-s;if(""===this.hiddenTextarea.value)return this.styles={},this.updateFromTextArea(),this.fire("changed"),void(this.canvas&&(this.canvas.fire("text:changed",{target:this}),this.canvas.requestRenderAll()));var c=this.fromStringToGraphemeSelection(this.hiddenTextarea.selectionStart,this.hiddenTextarea.selectionEnd,this.hiddenTextarea.value),h=this.selectionStart>c.selectionStart;this.selectionStart!==this.selectionEnd?(i=this._text.slice(this.selectionStart,this.selectionEnd),l+=this.selectionEnd-this.selectionStart):a<s&&(i=h?this._text.slice(this.selectionEnd+l,this.selectionEnd):this._text.slice(this.selectionStart,this.selectionStart-l)),r=o.slice(c.selectionEnd-l,c.selectionEnd),i&&i.length&&(this.selectionStart!==this.selectionEnd?this.removeStyleFromTo(this.selectionStart,this.selectionEnd):h?this.removeStyleFromTo(this.selectionEnd-i.length,this.selectionEnd):this.removeStyleFromTo(this.selectionEnd,this.selectionEnd+i.length)),r.length&&(e&&r.join("")===n.copiedText?this.insertNewStyleBlock(r,this.selectionStart,n.copiedTextStyle):this.insertNewStyleBlock(r,this.selectionStart)),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&&(n.copiedText=this.getSelectedText(),n.copiedTextStyle=this.getSelectionStyles(this.selectionStart,this.selectionEnd,!0),this._copyDone=!0)},paste:function(){this.fromPaste=!0},_getClipboardData:function(t){return t&&t.clipboardData||n.window.clipboardData},_getWidthBeforeCursor:function(t,e){var i,n=this._getLineLeftOffset(t);return e>0&&(n+=(i=this.__charBounds[t][e-1]).left+i.width),n},getDownCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(r===this._textLines.length-1||t.metaKey||34===t.keyCode)return this._text.length-i;var o=n.charIndex,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r+1,s);return this._textLines[r].slice(o).length+a+2},_getSelectionForOffset:function(t,e){return t.shiftKey&&this.selectionStart!==this.selectionEnd&&e?this.selectionEnd:this.selectionStart},getUpCursorOffset:function(t,e){var i=this._getSelectionForOffset(t,e),n=this.get2DCursorLocation(i),r=n.lineIndex;if(0===r||t.metaKey||33===t.keyCode)return-i;var o=n.charIndex,s=this._getWidthBeforeCursor(r,o),a=this._getIndexOnLine(r-1,s),l=this._textLines[r].slice(0,o);return-this._textLines[r-1].length+a-l.length},_getIndexOnLine:function(t,e){for(var i,n,r=this._textLines[t],o=this._getLineLeftOffset(t),s=0,a=0,l=r.length;a<l;a++)if((o+=i=this.__charBounds[t][a].width)>e){n=!0;var c=o-i,h=o,u=Math.abs(c-e);s=Math.abs(h-e)<u?a:a-1;break}return n||(s=r.length-1),s},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){var i=this["get"+t+"CursorOffset"](e,"right"===this._selectionDirection);e.shiftKey?this.moveCursorWithShift(i):this.moveCursorWithoutShift(i),0!==i&&(this.setSelectionInBoundaries(),this.abortCursorAnimation(),this._currentCursorOpacity=1,this.initDelayedCursor(),this._fireSelectionChanged(),this._updateTextarea())}
vendor: 4,060 bytes, line 3
3,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!==typeof 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){var i="moveCursor"+t+"With";this._currentCursorOpacity=1,e.shiftKey?i+="Shift":i+="outShift",this[i](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){void 0===e&&(e=t+1),this.removeStyleFromTo(t,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,r){void 0===r&&(r=i),r>i&&this.removeStyleFromTo(i,r);var o=n.util.string.graphemeSplit(t);this.insertNewStyleBlock(o,i,e),this._text=[].concat(this._text.slice(0,i),o,this._text.slice(r)),this.text=this._text.join(""),this.set("dirty",!0),this._shouldClearDimensionCache()&&(this.initDimensions(),this.setCoords()),this._removeExtraneousStyles()}}),function(){var t=n.util.toFixed,e=/ +/g;n.util.object.extend(n.Text.prototype,{toSVG:function(t){var e=this._createBaseSVGMarkup(),i=this._getSVGLeftTopOffsets(),n=this._getSVGTextAndBg(i.textTop,i.textLeft);return this._wrapSVGTextAndBg(e,n),t?t(e.join("")):e.join("")},_getSVGLeftTopOffsets:function(){return{textLeft:-this.width/2,textTop:-this.height/2,lineTop:this.getHeightOfLine(0)}},_wrapSVGTextAndBg:function(t,e){var i=this.getSvgFilter(),n=""===i?"":' style="'+i+'"',r=this.getSvgTextDecoration(this);t.push("\t<g ",this.getSvgId(),'transform="',this.getSvgTransform(),this.getSvgTransformMatrix(),'"',n,">\n",e.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+'" ':"",r?'text-decoration="'+r+'" ':"",'style="',this.getSvgStyles(!0),'"',this.addPaintOrder()," >",e.textSpans.join(""),"</text>\n","\t</g>\n")},_getSVGTextAndBg:function(t,e){var i,n=[],r=[],o=t;this._setSVGBg(r);for(var s=0,a=this._textLines.length;s<a;
vendor: 4,501 bytes, line 3
3s++)i=this._getLineLeftOffset(s),(this.textBackgroundColor||this.styleHas("textBackgroundColor",s))&&this._setSVGTextLineBg(r,s,e+i,o),this._setSVGTextLineText(n,s,e+i,o),o+=this.getHeightOfLine(s);return{textSpans:n,textBgRects:r}},_createTextCharSpan:function(i,r,o,s){var a=i!==i.trim()||i.match(e),l=this.getSvgSpanStyles(r,a),c=l?'style="'+l+'"':"",h=r.deltaY,u="",d=n.Object.NUM_FRACTION_DIGITS;return h&&(u=' dy="'+t(h,d)+'" '),['<tspan x="',t(o,d),'" y="',t(s,d),'" ',u,c,">",n.util.string.escapeXml(i),"</tspan>"].join("")},_setSVGTextLineText:function(t,e,i,n){var r,o,s,a,l,c=this.getHeightOfLine(e),h=-1!==this.textAlign.indexOf("justify"),u="",d=0,f=this._textLines[e];n+=c*(1-this._fontSizeFraction)/this.lineHeight;for(var g=0,p=f.length-1;g<=p;g++)l=g===p||this.charSpacing,u+=f[g],s=this.__charBounds[e][g],0===d?(i+=s.kernedWidth-s.width,d+=s.width):d+=s.kernedWidth,h&&!l&&this._reSpaceAndTab.test(f[g])&&(l=!0),l||(r=r||this.getCompleteStyleDeclaration(e,g),o=this.getCompleteStyleDeclaration(e,g+1),l=this._hasStyleChangedForSvg(r,o)),l&&(a=this._getStyleDeclaration(e,g)||{},t.push(this._createTextCharSpan(u,a,i,n)),u="",r=o,i+=d,d=0)},_pushTextBgRect:function(e,i,r,o,s,a){var l=n.Object.NUM_FRACTION_DIGITS;e.push("\t\t<rect ",this._getFillAttributes(i),' x="',t(r,l),'" y="',t(o,l),'" width="',t(s,l),'" height="',t(a,l),'"></rect>\n')},_setSVGTextLineBg:function(t,e,i,n){for(var r,o,s=this._textLines[e],a=this.getHeightOfLine(e)/this.lineHeight,l=0,c=0,h=this.getValueOfPropertyAt(e,0,"textBackgroundColor"),u=0,d=s.length;u<d;u++)r=this.__charBounds[e][u],(o=this.getValueOfPropertyAt(e,u,"textBackgroundColor"))!==h?(h&&this._pushTextBgRect(t,h,i+c,n,l,a),c=r.left,l=r.width,h=o):l+=r.kernedWidth;o&&this._pushTextBgRect(t,o,i+c,n,l,a)},_getFillAttributes:function(t){var e=t&&"string"==typeof t?new n.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 n.Object.prototype.getSvgStyles.call(this,t)+" white-space: pre;"}})}(),function(t){"use strict";var e=t.fabric||(t.fabric={});e.Textbox=e.util.createClass(e.IText,e.Observable,{type:"textbox",minWidth:20,dynamicMinWidth:2,__cachedLines:null,lockScalingFlip:!0,noScaleCache:!1,_dimensionAffectingProps:e.Text.prototype._dimensionAffectingProps.concat("width"),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,r={},o=0;o<t.graphemeLines.length;o++)"\n"===t.graphemeText[n]&&o>0?(i=0,n++,e++):this._reSpaceAndTab.test(t.graphemeText[n])&&o>0&&(i++,n++),r[o]={line:e,offset:i},n+=t.graphemeLines[o].length,i+=t.graphemeLines[o].length;return r},styleHas:function(t,i){if(this._styleMap&&!this.isWrapping){var n=this._styleMap[i];n&&(i=n.line)}return e.Text.prototype.styleHas.call(this,t,i)},isEmptyStyles:function(t){var e,i,n=0,r=!1,o=this._styleMap[t],s=this._styleMap[t+1];for(var a in o&&(t=o.line,n=o.offset),s&&(r=s.line===t,e=s.offset),i=void 0===t?this.styles:{line:this.styles[t]})for(var l in i[a])if(l>=n&&(!r||l<e))for(var c in i[a][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){var e=this._styleMap[t];return this.styles[e.line]},_setLineStyle:function(t,e){var i=this._styleMap[t];this.styles[i.line]=e},_deleteLineStyle:function(t){var e=this._styleMap[t];delete this.styles[e.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}
3,_measureWord:function(t,e,i){var n,r=0;i=i||0;for(var o=0,s=t.length;o<s;o++){r+=this._getGraphemeBox(t[o],e,o+i,n,!0).kernedWidth,n=t[o]}return r},_wrapLine:function(t,i,n,r){var o=0,s=[],a=[],l=t.split(this._reSpaceAndTab),c="",h=0,u=0,d=0,f=0,g=!0,p=this._getWidthOfCharSpacing();n-=r=r||0;for(var m=0;m<l.length;m++)c=e.util.string.graphemeSplit(l[m]),u=this._measureWord(c,i,h),h+=c.length,(o+=d+u-p)>=n&&!g?(s.push(a),a=[],o=u,g=!0):o+=p,g||a.push(" "),a=a.concat(c),d=this._measureWord([" "],i,h),h++,g=!1,u>f&&(f=u);return m&&s.push(a),f+r>this.dynamicMinWidth&&(this.dynamicMinWidth=f-p+r),s},isEndOfWrapping:function(t){return!this._styleMap[t+1]||this._styleMap[t+1].line!==this._styleMap[t].line},_splitTextIntoLines:function(t){for(var i=e.Text.prototype._splitTextIntoLines.call(this,t),n=this._wrapText(i.lines,this.width),r=new Array(n.length),o=0;o<n.length;o++)r[o]=n[o].join("");return i.lines=r,i.graphemeLines=n,i},getMinWidth:function(){return Math.max(this.minWidth,this.dynamicMinWidth)},toObject:function(t){return this.callSuper("toObject",["minWidth"].concat(t))}}),e.Textbox.fromObject=function(t,i){return e.Object._fromObject("Textbox",t,i,"text")}}(e),function(){var t=n.Canvas.prototype._setObjectScale;n.Canvas.prototype._setObjectScale=function(e,i,r,o,s,a,l){var c=i.target;if(!("x"===s&&c instanceof n.Textbox))return t.call(n.Canvas.prototype,e,i,r,o,s,a,l);var h=c._getTransformedDimensions().x,u=c.width*(e.x/h);return u>=c.getMinWidth()?(c.set("width",u),!0):void 0},n.util.object.extend(n.Textbox.prototype,{_removeExtraneousStyles:function(){for(var t in this._styleMap)this._textLines[t]||delete this.styles[this._styleMap[t].line]}})}()}).call(this,i(3).Buffer)},function(t,e,i){"use strict";(function(t){ 4 /*! 5 * The buffer module from node.js, for the browser. 6 * 7 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 8 * @license MIT 9 */ 10 var n=i(5),r=i(6),o=i(7);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return u(this,t)}return c(this,t,e,i)}function c(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=d(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(e,i),r=(t=a(t,n)).write(e,i);r!==n&&(t=t.slice(0,r));return t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|f(e.length);return 0===(t=a(t,i)).length?t:(e.copy(t,0,0,i),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||function(t){return t!=t}(e.length)?a(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function u(t,e){if(h(e),t=a(t,e<0?0:0|f(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function d(t,e){var i=e.length<0?0:0|f(e.length);t=a(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function f(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function g(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&
vendor: 5,715 bytes, line 10
10(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return X(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return U(t).length;default:if(n)return X(t).length;e=(""+e).toLowerCase(),n=!0}}function p(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function m(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:v(t,e,i,n,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):v(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function v(t,e,i,n,r){var o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,l/=2,i/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var h=-1;for(o=i;o<a;o++)if(c(t,o)===c(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(i+l>a&&(i=a-l),o=i;o>=0;o--){for(var u=!0,d=0;d<l;d++)if(c(t,o+d)!==c(e,d)){u=!1;break}if(u)return o}return-1}function w(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[i+s]=a}return s}function y(t,e,i,n){return z(X(e,t.length-i),t,i,n)}function b(t,e,i,n){return z(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function x(t,e,i,n){return b(t,e,i,n)}function _(t,e,i,n){return z(U(e),t,i,n)}function C(t,e,i,n){return z(function(t,e){for(var i,n,r,o=[],s=0;s<t.length&&!((e-=2)<0);++s)i=t.charCodeAt(s),n=i>>8,r=i%256,o.push(r),o.push(n);return o}(e,t.length-i),t,i,n)}function S(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function T(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,s,a,l,c=t[r],h=null,u=c>239?4:c>223?3:c>191?2:1;if(r+u<=i)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(o=t[r+1]))&&(l=(31&c)<<6|63&o)>127&&(h=l);break;case 3:o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&(l=(15&c)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=O));return i}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return c(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return function(t,e,i,n){return h(e),e<=0?a(t,e):void 0!==i?"string"==typeof n?a(t,e).fill(i,n):a(t,e).fill(i):a(t,e)}(null,t,e,i)},l.allocUnsafe=function(t){return u(null,t)},l.allocUnsafeSlow=function(t){return u(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var s=t[i];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)p(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)p(this,e,e+3),p(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)p(this,e,e+7),p(this,e+1,e+6),p(this,e+2,e+5),p(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;
vendor: 4,264 bytes, line 10
10return 0===t?"":0===arguments.length?T(this,0,t):function(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return A(this,e,i);case"utf8":case"utf-8":return T(this,e,i);case"ascii":return k(this,e,i);case"latin1":case"binary":return E(this,e,i);case"base64":return S(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,n>>>=0,r>>>=0,this===t)return 0;for(var o=r-n,s=i-e,a=Math.min(o,s),c=this.slice(n,r),h=t.slice(e,i),u=0;u<a;++u)if(c[u]!==h[u]){o=c[u],s=h[u];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return w(this,t,e,i);case"utf8":case"utf-8":return y(this,t,e,i);case"ascii":return b(this,t,e,i);case"latin1":case"binary":return x(this,t,e,i);case"base64":return _(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function k(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function E(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function A(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=Y(t[o]);return r}function P(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function D(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,i,n,r,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function j(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function L(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function F(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function I(t,e,i,n,o){return o||F(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function B(t,e,i,n,o){return o||F(t,0,i,8),r.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var r=e-t;i=new l(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i}
vendor: 4,171 bytes, line 10
10,l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||D(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||D(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},l.prototype.readUInt8=function(t,e){return e||D(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||D(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||D(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||D(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||D(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||D(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||D(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||D(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||D(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||D(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||D(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||M(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||M(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):L(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);M(this,t,e,i,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o<i&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);M(this,t,e,i,r-1,-r)}var o=i-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>
vendor: 4,097 bytes, line 10
108,this[e+1]=255&t):j(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):L(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):L(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return I(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return I(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return B(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return B(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var s=l.isBuffer(t)?t:X(new l(t,n).toString()),a=s.length;for(o=0;o<i-e;++o)this[o+e]=s[o%a]}return this};var R=/[^+\/0-9A-Za-z-_]/g;function Y(t){return t<16?"0"+t.toString(16):t.toString(16)}function X(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],s=0;s<n;++s){if((i=t.charCodeAt(s))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function U(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(4))},function(t,e){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,e,i){"use strict";e.byteLength=function(t){var e=c(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){for(var e,i=c(t),n=i[0],s=i[1],a=new o(function(t,e,i){return 3*(e+i)/4-i}(0,n,s)),l=0,h=s>0?n-4:n,u=0;u<h;u+=4)e=r[t.charCodeAt(u)]<<18|r[t.charCodeAt(u+1)]<<12|r[t.charCodeAt(u+2)]<<6|r[t.charCodeAt(u+3)],a[l++]=e>>16&255,a[l++]=e>>8&255,a[l++]=255&e;2===s&&(e=r[t.charCodeAt(u)]<<2|r[t.charCodeAt(u+1)]>>4,a[l++]=255&e);1===s&&(e=r[t.charCodeAt(u)]<<10|r[t.charCodeAt(u+1)]<<4|r[t.charCodeAt(u+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e);return a},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],s=0,a=i-r;s<a;s+=16383)o.push(u(t,s,s+16383>a?a:s+16383));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>
1010]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a<l;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function h(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function u(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),r.push(h(n));return r.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,h=-7,u=i?r-1:0,d=i?-1:1,f=t[e+u];for(u+=d,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+u],u+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+u],u+=d,h-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var s,a,l,c=8*o-r-1,h=(1<<c)-1,u=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,g=n?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=h?(a=0,s=h):s+u>=1?(a=(e*l-1)*Math.pow(2,r),s+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),s=0));r>=8;t[i+f]=255&a,f+=g,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[i+f]=255&s,f+=g,s/=256,c-=8);t[i+f-g]|=128*p}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,i){t.exports=function(){"use strict";function t(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}function e(e,i){return e.get(t(e,i))}function i(t,e,i){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,i)}const n={},r=t=>new Promise(e=>{if(!t)return e();const i=window.scrollX,r=window.scrollY;n.restoreFocusTimeout=setTimeout(()=>{n.previousActiveElement instanceof HTMLElement?(n.previousActiveElement.focus(),n.previousActiveElement=null):document.body&&document.body.focus(),e()},100),window.scrollTo(i,r)}),o=["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","draggable","dragging"].reduce((t,e)=>(t[e]="swal2-"+e,t),{}),s=["success","warning","info","question","error"].reduce((t,e)=>(t[e]="swal2-"+e,t),{}),a=t=>t.charAt(0).toUpperCase()+t.slice(1),l=t=>{console.warn(`SweetAlert2: ${"object"==typeof t?t.join(" "):t}`)},c=t=>{console.error(`SweetAlert2: ${t}`)},h=[],u=(t,e=null)=>{(t=>{h.includes(t)||(h.push(t),l(t))})(`"${t}" is deprecated and will be removed in the next major release.${e?` Use "${e}" instead.`:""}`)},d=t=>"function"==typeof t?t():t,f=t=>t&&"function"==typeof t.toPromise,g=t=>f(t)?t.toPromise():Promise.resolve(t),p=t=>t&&Promise.resolve(t)===t,m=()=>document.body.querySelector(`.${o.container}`),v=t=>{const e=m();return e?e.querySelector(t):null},w=t=>v(`.${t}`),y=()=>w(o.popup),b=()=>w(o.icon),x=()=>w(o.title),_=()=>w(o["html-container"]),C=()=>w(o.image),S=()=>w(o["progress-steps"]),T=()=>w(o["validation-message"]),O=()=>v(`.${o.actions} .${o.confirm}`),k=()=>v(`.${o.actions} .${o.cancel}`),E=()=>v(`.${o.actions} .${o.deny}`),A=()=>v(`.${o.loader}`),P=()=>w(o.actions),D=()=>w(o.footer),M=()=>w(o["timer-progress-bar"]),j=()=>w(o.close),L=()=>{const t=y();if(!t)return[];
10const e=t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),i=Array.from(e).sort((t,e)=>{const i=parseInt(t.getAttribute("tabindex")||"0"),n=parseInt(e.getAttribute("tabindex")||"0");return i>n?1:i<n?-1:0}),n=t.querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n'),r=Array.from(n).filter(t=>"-1"!==t.getAttribute("tabindex"));return[...new Set(i.concat(r))].filter(t=>J(t))},F=()=>R(document.body,o.shown)&&!R(document.body,o["toast-shown"])&&!R(document.body,o["no-backdrop"]),I=()=>{const t=y();return!!t&&R(t,o.toast)},B=(t,e)=>{if(t.textContent="",e){const i=new DOMParser,n=i.parseFromString(e,"text/html"),r=n.querySelector("head");r&&Array.from(r.childNodes).forEach(e=>{t.appendChild(e)});const o=n.querySelector("body");o&&Array.from(o.childNodes).forEach(e=>{e instanceof HTMLVideoElement||e instanceof HTMLAudioElement?t.appendChild(e.cloneNode(!0)):t.appendChild(e)})}},R=(t,e)=>{if(!e)return!1;const i=e.split(/\s+/);for(let e=0;e<i.length;e++)if(!t.classList.contains(i[e]))return!1;return!0},Y=(t,e,i)=>{if(((t,e)=>{Array.from(t.classList).forEach(i=>{Object.values(o).includes(i)||Object.values(s).includes(i)||Object.values(e.showClass||{}).includes(i)||t.classList.remove(i)})})(t,e),!e.customClass)return;const n=e.customClass[i];n&&("string"==typeof n||n.forEach?H(t,n):l(`Invalid type of customClass.${i}! Expected string or iterable object, got "${typeof n}"`))},X=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(`.${o.popup} > .${o[e]}`);case"checkbox":return t.querySelector(`.${o.popup} > .${o.checkbox} input`);case"radio":return t.querySelector(`.${o.popup} > .${o.radio} input:checked`)||t.querySelector(`.${o.popup} > .${o.radio} input:first-child`);case"range":return t.querySelector(`.${o.popup} > .${o.range} input`);default:return t.querySelector(`.${o.popup} > .${o.input}`)}},U=t=>{if(t.focus(),"file"!==t.type){const e=t.value;t.value="",t.value=e}},z=(t,e,i)=>{t&&e&&("string"==typeof e&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(e=>{Array.isArray(t)?t.forEach(t=>{i?t.classList.add(e):t.classList.remove(e)}):i?t.classList.add(e):t.classList.remove(e)}))},H=(t,e)=>{z(t,e,!0)},W=(t,e)=>{z(t,e,!1)},G=(t,e)=>{const i=Array.from(t.children);for(let t=0;t<i.length;t++){const n=i[t];if(n instanceof HTMLElement&&R(n,e))return n}},V=(t,e,i)=>{i===`${parseInt(i)}`&&(i=parseInt(i)),i||0===parseInt(i)?t.style.setProperty(e,"number"==typeof i?`${i}px`:i):t.style.removeProperty(e)},N=(t,e="flex")=>{t&&(t.style.display=e)},q=t=>{t&&(t.style.display="none")},$=(t,e="block")=>{t&&new MutationObserver(()=>{Z(t,t.innerHTML,e)}).observe(t,{childList:!0,subtree:!0})},K=(t,e,i,n)=>{const r=t.querySelector(e);r&&r.style.setProperty(i,n)},Z=(t,e,i="flex")=>{e?N(t,i):q(t)},J=t=>!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),Q=t=>!!(t.scrollHeight>t.clientHeight),tt=t=>{const e=window.getComputedStyle(t),i=parseFloat(e.getPropertyValue("animation-duration")||"0"),n=parseFloat(e.getPropertyValue("transition-duration")||"0");return i>0||n>0},et=(t,e=!1)=>{const i=M();i&&J(i)&&(e&&(i.style.transition="none",i.style.width="100%"),setTimeout(()=>{i.style.transition=`width ${t/1e3}s linear`,i.style.width="0%"},10))},it=`\n <div aria-labelledby="${o.title}" aria-describedby="${o["html-container"]}" class="${o.popup}" tabindex="-1">\n <button type="button" class="${o.close}"></button>\n <ul class="${o["progress-steps"]}"></ul>\n <div class="${o.icon}"></div>\n <img class="${o.image}" />\n <h2 class="${o.title}" id="${o.title}"></h2>\n <div class="${o["html-container"]}" id="${o["html-container"]}"></div>\n <input class="${o.input}" id="${o.input}" />\n <input type="file" class="${o.file}" />\n <div class="${o.range}">\n <input type="range" />\n <output></output>\n </div>\n <select class="${o.select}" id="${o.select}"></select>\n <div class="${o.radio}"></div>\n <label class="${o.checkbox}">\n <input type="checkbox" id="${o.checkbox}" />\n <span class="${o.label}"></span>\n </label>\n <textarea class="${o.textarea}" id="${o.textarea}"></textarea>\n <div class="${o["validation-message"]}" id="${o["validation-message"]}"></div>\n <div class="${o.actions}">\n <div class="${o.loader}"></div>\n <button type="button" class="${o.confirm}"></button>\n <button type="button" class="${o.deny}"></button>\n <button type="button" class="${o.cancel}"></button>\n </div>\n <div class="${o.footer}"></div>\n <div class="${o["timer-progress-bar-container"]}">\n <div class="${o["timer-progress-bar"]}"></div>\n </div>\n </div>\n`.replace(/(^|\n)\s*/g,""),nt=()=>{n.currentInstance.resetValidationMessage()},rt=t=>{const e=(()=>{const t=m();return!!t&&(t.remove(),W([document.documentElement,document.body],[o["no-backdrop"],o["toast-shown"],o["has-column"]]),!0)})();if("undefined"==typeof window||"undefined"==typeof document)return void c("SweetAlert2 requires document to initialize");const i=document.createElement("div");i.className=o.container,e&&H(i,o["no-transition"]),B(i,it),i.dataset.swal2Theme=t.theme;const n=(t=>"string"==typeof t?document.querySelector(t):t)(t.target);n.appendChild(i),t.topLayer&&(i.setAttribute("popover",""),i.showPopover()),(t=>{const e=y();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")})(t),(t=>{"rtl"===window.getComputedStyle(t).direction&&H(m(),o.rtl)})(n),(()=>{const t=y(),e=G(t,o.input),i=G(t,o.file),n=t.querySelector(`.${o.range} input`),r=t.querySelector(`.${o.range} output`),s=G(t,o.select),a=t.querySelector(`.${o.checkbox} input`),l=G(t,o.textarea);e.oninput=nt,i.onchange=nt,s.onchange=nt,a.onchange=nt,l.oninput=nt,n.onin
10put=(()=>{nt(),r.value=n.value}),n.onchange=(()=>{nt(),r.value=n.value})})()},ot=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):"object"==typeof t?st(t,e):t&&B(e,t)},st=(t,e)=>{t.jquery?at(e,t):B(e,t.toString())},at=(t,e)=>{if(t.textContent="",0 in e)for(let i=0;i in e;i++)t.appendChild(e[i].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},lt=(t,e)=>{const i=P(),n=A();i&&n&&(e.showConfirmButton||e.showDenyButton||e.showCancelButton?N(i):q(i),Y(i,e,"actions"),function(t,e,i){const n=O(),r=E(),s=k();n&&r&&s&&(ht(n,"confirm",i),ht(r,"deny",i),ht(s,"cancel",i),function(t,e,i,n){n.buttonsStyling?(H([t,e,i],o.styled),n.confirmButtonColor&&t.style.setProperty("--swal2-confirm-button-background-color",n.confirmButtonColor),n.denyButtonColor&&e.style.setProperty("--swal2-deny-button-background-color",n.denyButtonColor),n.cancelButtonColor&&i.style.setProperty("--swal2-cancel-button-background-color",n.cancelButtonColor),ct(t),ct(e),ct(i)):W([t,e,i],o.styled)}(n,r,s,i),i.reverseButtons&&(i.toast?(t.insertBefore(s,n),t.insertBefore(r,n)):(t.
10insertBefore(s,e),t.insertBefore(r,e),t.insertBefore(n,e))))}(i,n,e),B(n,e.loaderHtml||""),Y(n,e,"loader"))};function ct(t){const e=window.getComputedStyle(t);if(e.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const i=e.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");t.style.setProperty("--swal2-action-button-focus-box-shadow",e.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${i}`))}function ht(t,e,i){const n=a(e);Z(t,i[`show${n}Button`],"inline-block"),B(t,i[`${e}ButtonText`]||""),t.setAttribute("aria-label",i[`${e}ButtonAriaLabel`]||""),t.className=o[e],Y(t,i,`${e}Button`)}const ut=(t,e)=>{const i=m();i&&(function(t,e){"string"==typeof e?t.style.background=e:e||H([document.documentElement,document.body],o["no-backdrop"])}(i,e.backdrop),function(t,e){e&&(e in o?H(t,o[e]):(l('The "position" parameter is not valid, defaulting to "center"'),H(t,o.center)))}(i,e.position),function(t,e){e&&H(t,o[`grow-${e}`])}(i,e.grow),Y(i,e,"container"))};var dt={innerParams:new WeakMap,domCache:new WeakMap};const ft=["input","file","range","select","radio","checkbox","textarea"],gt=t=>{if(!t.input)return;if(!xt[t.input])return void c(`Unexpected type of input! Expected ${Object.keys(xt).join(" | ")}, got "${t.input}"`);const e=yt(t.input);if(!e)return;const i=xt[t.input](e,t);N(e),t.inputAutoFocus&&setTimeout(()=>{U(i)})},pt=(t,e)=>{const i=y();if(!i)return;const n=X(i,t);if(n){(t=>{for(let e=0;e<t.attributes.length;e++){const i=t.attributes[e].name;["id","type","value","style"].includes(i)||t.removeAttribute(i)}})(n);for(const t in e)n.setAttribute(t,e[t])}},mt=t=>{if(!t.input)return;const e=yt(t.input);e&&Y(e,t,"input")},vt=(t,e)=>{!t.placeholder&&e.inputPlaceholder&&(t.placeholder=e.inputPlaceholder)},wt=(t,e,i)=>{if(i.inputLabel){const n=document.createElement("label"),r=o["input-label"];n.setAttribute("for",t.id),n.className=r,"object"==typeof i.customClass&&H(n,i.customClass.inputLabel),n.innerText=i.inputLabel,e.insertAdjacentElement("beforebegin",n)}},yt=t=>{const e=y();if(e)return G(e,o[t]||o.input)},bt=(t,e)=>{["string","number"].includes(typeof e)?t.value=`${e}`:p(e)||l(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`)},xt={};xt.text=xt.email=xt.password=xt.number=xt.tel=xt.url=xt.search=xt.date=xt["datetime-local"]=xt.time=xt.week=xt.month=((t,e)=>(bt(t,e.inputValue),wt(t,t,e),vt(t,e),t.type=e.input,t)),xt.file=((t,e)=>(wt(t,t,e),vt(t,e),t)),xt.range=((t,e)=>{const i=t.querySelector("input"),n=t.querySelector("output");return bt(i,e.inputValue),i.type=e.input,bt(n,e.inputValue),wt(i,t,e),t}),xt.select=((t,e)=>{if(t.textContent="",e.inputPlaceholder){const i=document.createElement("option");B(i,e.inputPlaceholder),i.value="",i.disabled=!0,i.selected=!0,t.appendChild(i)}return wt(t,t,e),t}),xt.radio=(t=>(t.textContent="",t)),xt.checkbox=((t,e)=>{const i=X(y(),"checkbox");i.value="1",i.checked=Boolean(e.inputValue);const n=t.querySelector("span");return B(n,e.inputPlaceholder||e.inputLabel),i}),xt.textarea=((t,e)=>(bt(t,e.inputValue),vt(t,e),wt(t,t,e),setTimeout(()=>{if("MutationObserver"in window){const i=parseInt(window.getComputedStyle(y()).width),n=()=>
vendor: 4,452 bytes, line 10
10{if(!document.body.contains(t))return;const n=t.offsetWidth+(t=>parseInt(window.getComputedStyle(t).marginLeft)+parseInt(window.getComputedStyle(t).marginRight))(t);n>i?y().style.width=`${n}px`:V(y(),"width",e.width)};new MutationObserver(n).observe(t,{attributes:!0,attributeFilter:["style"]})}}),t));const _t=(t,e)=>{const i=_();i&&($(i),Y(i,e,"htmlContainer"),e.html?(ot(e.html,i),N(i,"block")):e.text?(i.textContent=e.text,N(i,"block")):q(i),((t,e)=>{const i=y();if(!i)return;const n=dt.innerParams.get(t),r=!n||e.input!==n.input;ft.forEach(t=>{const n=G(i,o[t]);n&&(pt(t,e.inputAttributes),n.className=o[t],r&&q(n))}),e.input&&(r&>(e),mt(e))})(t,e))},Ct=(t,e)=>{for(const[i,n]of Object.entries(s))e.icon!==i&&W(t,n);H(t,e.icon&&s[e.icon]),Ot(t,e),St(),Y(t,e,"icon")},St=()=>{const t=y();if(!t)return;const e=window.getComputedStyle(t).getPropertyValue("background-color"),i=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let t=0;t<i.length;t++)i[t].style.backgroundColor=e},Tt=(t,e)=>{if(!e.icon&&!e.iconHtml)return;let i=t.innerHTML,n="";if(e.iconHtml)n=kt(e.iconHtml);else if("success"===e.icon)n=(t=>`\n ${t.animation?'<div class="swal2-success-circular-line-left"></div>':""}\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div>\n ${t.animation?'<div class="swal2-success-fix"></div>':""}\n ${t.animation?'<div class="swal2-success-circular-line-right"></div>':""}\n`)(e),i=i.replace(/ style=".*?"/g,"");else if("error"===e.icon)n='\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n';else if(e.icon){const t={question:"?",warning:"!",info:"i"};n=kt(t[e.icon])}i.trim()!==n.trim()&&B(t,n)},Ot=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const i of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])K(t,i,"background-color",e.iconColor);K(t,".swal2-success-ring","border-color",e.iconColor)}},kt=t=>`<div class="${o["icon-content"]}">${t}</div>`;let Et=!1,At=0,Pt=0,Dt=0,Mt=0;const jt=t=>{const e=y();if(t.target===e||b().contains(t.target)){Et=!0;const i=It(t);At=i.clientX,Pt=i.clientY,Dt=parseInt(e.style.insetInlineStart)||0,Mt=parseInt(e.style.insetBlockStart)||0,H(e,"swal2-dragging")}},Lt=t=>{const e=y();if(Et){let{clientX:i,clientY:n}=It(t);e.style.insetInlineStart=`${Dt+(i-At)}px`,e.style.insetBlockStart=`${Mt+(n-Pt)}px`}},Ft=()=>{const t=y();Et=!1,W(t,"swal2-dragging")},It=t=>{let e=0,i=0;return t.type.startsWith("mouse")?(e=t.clientX,i=t.clientY):t.type.startsWith("touch")&&(e=t.touches[0].clientX,i=t.touches[0].clientY),{clientX:e,clientY:i}},Bt=(t,e)=>{const i=m(),n=y();if(i&&n){if(e.toast){V(i,"width",e.width),n.style.width="100%";const t=A();t&&n.insertBefore(t,b())}else V(n,"width",e.width);V(n,"padding",e.padding),e.color&&(n.style.color=e.color),e.background&&(n.style.background=e.background),q(T()),Rt(n,e),e.draggable&&!e.toast?(H(n,o.draggable),(t=>{t.addEventListener("mousedown",jt),document.body.addEventListener("mousemove",Lt),t.addEventListener("mouseup",Ft),t.addEventListener("touchstart",jt),document.body.addEventListener("touchmove",Lt),t.addEventListener("touchend",Ft)})(n)):(W(n,o.draggable),(t=>{t.removeEventListener("mousedown",jt),document.body.removeEventListener("mousemove",Lt),t.removeEventListener("mouseup",Ft),t.removeEventListener("touchstart",jt),document.body.removeEventListener("touchmove",Lt),t.removeEventListener("touchend",Ft)})(n))}},Rt=(t,e)=>{const i=e.showClass||{};t.className=`${o.popup} ${J(t)?i.popup:""}`,e.toast?(H([document.documentElement,document.body],o["toast-shown"]),H(t,o.toast)):H(t,o.modal),Y(t,e,"popup"),"string"==typeof e.customClass&&H(t,e.customClass),e.icon&&H(t,o[`icon-${e.icon}`])},Yt=t=>{const e=document.createElement("li");return H(e,o["progress-step"]),B(e,t),e},Xt=t=>{const e=document.createElement("li");return H(e,o["progress-step-line"]),t.progressStepsDistance&&V(e,"width",t.progressStepsDistance),e},Ut=(t,e)=>{Bt(0,e),ut(0,e),((t,e)=>{const i=S();if(!i)return;const{progressSteps:n,currentProgressStep:r}=e;n&&0!==n.length&&void 0!==r?(N(i),i.textContent="",r>=n.length&&l("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),n.forEac
10h((t,s)=>{const a=Yt(t);if(i.appendChild(a),s===r&&H(a,o["active-progress-step"]),s!==n.length-1){const t=Xt(e);i.appendChild(t)}})):q(i)})(0,e),((t,e)=>{const i=dt.innerParams.get(t),n=b();if(n){if(i&&e.icon===i.icon)return Tt(n,e),void Ct(n,e);if(e.icon||e.iconHtml)return e.icon&&-1===Object.keys(s).indexOf(e.icon)?(c(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`),void q(n)):(N(n),Tt(n,e),Ct(n,e),H(n,e.showClass&&e.showClass.icon),void window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",St));q(n)}})(t,e),((t,e)=>{const i=C();i&&(e.imageUrl?(N(i,""),i.setAttribute("src",e.imageUrl),i.setAttribute("alt",e.imageAlt||""),V(i,"width",e.imageWidth),V(i,"height",e.imageHeight),i.className=o.image,Y(i,e,"image")):q(i))})(0,e),((t,e)=>{const i=x();i&&($(i),Z(i,e.title||e.titleText,"block"),e.title&&ot(e.title,i),e.titleText&&(i.innerText=e.titleText),Y(i,e,"title"))})(0,e),((t,e)=>{const i=j();i&&(B(i,e.closeButtonHtml||""),Y(i,e,"closeButton"),Z(i,e.showCloseButton),i.setAttribute("aria-label",e.closeButtonAriaLabel||""))})(0,e),_t(t,e),lt(0,e),((t,e)=>{const i=D();i&&($(i),Z(i,e.footer,"block"),e.footer&&ot(e.footer,i),Y(i,e,"footer"))})(0,e);const i=y();"function"==typeof e.didRender&&i&&e.didRender(i),n.eventEmitter.emit("didRender",i)},zt=()=>{var t;return null===(t=O())||void 0===t?void 0:t.click()},Ht=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Wt=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Gt=(t,e)=>{var i;const n=L();if(n.length)return-2===(t+=e)&&(t=n.length-1),t===n.length?t=0:-1===t&&(t=n.length-1),void n[t].focus();null===(i=y())||void 0===i||i.focus()},Vt=["ArrowRight","ArrowDown"],Nt=["ArrowLeft","ArrowUp"],qt=(t,e,i)=>{t&&(e.isComposing||229===e.keyCode||(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?$t(e,t):"Tab"===e.key?Kt(e):[...Vt,...Nt].includes(e.key)?Zt(e.key):"Escape"===e.key&&Jt(e,t,i)))},$t=(t,e)=>{if(!d(e.allowEnterKey))return;const i=X(y(),e.input);if(t.target&&i&&t.target instanceof HTMLElement&&t.target.outerHTML===i.outerHTML){if(["textarea","file"].includes(e.input))return;zt(),t.preventDefault()}},Kt=t=>{const e=t.target,i=L();let n=-1;for(let t=0;t<i.length;t++)if(e===i[t]){n=t;break}t.shiftKey?Gt(n,-1):Gt(n,1),t.stopPropagation(),t.preventDefault()},Zt=t=>{const e=P(),i=O(),n=E(),r=k();if(!(e&&i&&n&&r))return;const o=[i,n,r];if(document.activeElement instanceof HTMLElement&&!o.includes(document.activeElement))return;const s=Vt.includes(t)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let t=0;t<e.children.length;t++){if(!(a=a[s]))return;if(a instanceof HTMLButtonElement&&J(a))break}a instanceof HTMLButtonElement&&a.focus()}},Jt=(t,e,i)=>{t.preventDefault(),d(e.allowEscapeKey)&&i(Ht.esc)};var Qt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const te=()=>{const t=Array.from(document.body.children);t.forEach(t=>{t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")||""),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},ee="undefined"!=typeof window&&!!window.GestureEvent,ie=()=>{const t=m();if(!t)return;let e;t.ontouchstart=(t=>{e=ne(t)}),t.ontouchmove=(t=>{e&&(t.preventDefault(),t.stopPropagation())})},ne=t=>{const e=t.target,i=m(),n=_();return!(!i||!n||re(t)||oe(t)||e!==i&&(Q(i)||!(e instanceof HTMLElement)||((t,e)=>{let i=t;for(;i&&i!==e;){if(Q(i))return!0;i=i.parentElement}return!1})(e,n)||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||Q(n)&&n.contains(e)))},re=t=>t.touches&&t.touches.length&&"stylus"===t.touches[0].touchType,oe=t=>t.touches&&t.touches.length>1,se=()=>{if(R(document.body,o.iosfix)){const t=parseInt(document.body.style.top,10);W(document.body,o.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}};let ae=null;const le=t=>{null===ae&&(document.body.scrollHeight>window.innerHeight||"scroll"===t)&&(ae=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${ae+(()=>{const t=document.createElement("div");t.className=o["scrollbar-measure"],document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e})()}px`)},ce=()=>{null!==ae&&(document.body.style.paddingRight=`${ae}px`,ae=null)};function he(t,e,i,s){I()?we(t,s):(r(i).then(()=>we(t,s)),Wt(n)),ee?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),F()&&(ce(),se(),te()),W([document.documentElement,document.body],[o.shown,o["height-auto"],o["no-backdrop"],o["toast-shown"]])}function ue(t){t=pe(t);
vendor: 4,475 bytes, line 10
10const e=Qt.swalPromiseResolve.get(this),i=de(this);this.isAwaitingPromise?t.isDismissed||(ge(this),e(t)):i&&e(t)}const de=t=>{const e=y();if(!e)return!1;const i=dt.innerParams.get(t);if(!i||R(e,i.hideClass.popup))return!1;W(e,i.showClass.popup),H(e,i.hideClass.popup);const n=m();return W(n,i.showClass.backdrop),H(n,i.hideClass.backdrop),me(t,e,i),!0};function fe(t){const e=Qt.swalPromiseReject.get(this);ge(this),e&&e(t)}const ge=t=>{t.isAwaitingPromise&&(delete t.isAwaitingPromise,dt.innerParams.get(t)||t._destroy())},pe=t=>void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),me=(t,e,i)=>{var r;const o=m(),s=tt(e);"function"==typeof i.willClose&&i.willClose(e),null===(r=n.eventEmitter)||void 0===r||r.emit("willClose",e),s?ve(t,e,o,i.returnFocus,i.didClose):he(t,o,i.returnFocus,i.didClose)},ve=(t,e,i,r,o)=>{n.swalCloseEventFinishedCallback=he.bind(null,t,i,r,o);const s=function(t){var i;t.target===e&&(null===(i=n.swalCloseEventFinishedCallback)||void 0===i||i.call(n),delete n.swalCloseEventFinishedCallback,e.removeEventListener("animationend",s),e.removeEventListener("transitionend",s))};e.addEventListener("animationend",s),e.addEventListener("transitionend",s)},we=(t,e)=>{setTimeout(()=>{var i;"function"==typeof e&&e.bind(t.params)(),null===(i=n.eventEmitter)||void 0===i||i.emit("didClose"),t._destroy&&t._destroy()})},ye=t=>{let e=y();if(e||new Ki,!(e=y()))return;const i=A();I()?q(b()):be(e,t),N(i),e.setAttribute("data-loading","true"),e.setAttribute("aria-busy","true"),e.focus()},be=(t,e)=>{const i=P(),n=A();i&&n&&(!e&&J(O())&&(e=O()),N(i),e&&(q(e),n.setAttribute("data-button-to-replace",e.className),i.insertBefore(n,e)),H([t,i],o.loading))},xe=t=>t.checked?1:0,_e=t=>t.checked?t.value:null,Ce=t=>t.files&&t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null,Se=(t,e)=>{const i=y();if(!i)return;const n=t=>{"select"===e.input?function(t,e,i){const n=G(t,o.select);if(!n)return;const r=(t,e,n)=>{const r=document.createElement("option");r.value=n,B(r,e),r.selected=ke(n,i.inputValue),t.appendChild(r)};e.forEach(t=>{const e=t[0],i=t[1];if(Array.isArray(i)){const t=document.createElement("optgroup");t.label=e,t.disabled=!1,n.appendChild(t),i.forEach(e=>r(t,e[1],e[0]))}else r(n,i,e)}),n.focus()}(i,Oe(t),e):"radio"===e.input&&function(t,e,i){const n=G(t,o.radio);if(!n)return;e.forEach(t=>{const e=t[0],r=t[1],s=document.createElement("input"),a=document.createElement("label");s.type="radio",s.name=o.radio,s.value=e,ke(e,i.inputValue)&&(s.checked=!0);const l=document.createElement("span");B(l,r),l.className=o.label,a.appendChild(s),a.appendChild(l),n.appendChild(a)});const r=n.querySelectorAll("input");r.length&&r[0].focus()}(i,Oe(t),e)};f(e.inputOptions)||p(e.inputOptions)?(ye(O()),g(e.inputOptions).then(e=>{t.hideLoading(),n(e)})):"object"==typeof e.inputOptions?n(e.inputOptions):c(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},Te=(t,e)=>{const i=t.getInput();i&&(q(i),g(e.inputValue).then(n=>{i.value="number"===e.input?`${parseFloat(n)||0}`:`${n}`,N(i),i.focus(),t.hideLoading()}).catch(e=>{c(`Error in inputValue promise: ${e}`),i.value="",N(i),i.focus(),t.hideLoading()}))},Oe=t=>{const e=[];return t instanceof Map?t.forEach((t,i)=>{let n=t;"object"==typeof n&&(n=Oe(n)),e.push([i,n])}):Object.keys(t).forEach(i=>{let n=t[i];"object"==typeof n&&(n=Oe(n)),e.push([i,n])}),e},ke=(t,e)=>!!e&&e.toString()===t.toString(),Ee=(t,e)=>{const i=dt.innerParams.get(t);if(!i.input)return void c(`The "input" parameter is needed to be set when using returnInputValueOn${a(e)}`);const n=t.getInput(),r=((t,e)=>{const i=t.getInput();if(!i)return null;switch(e.input){case"checkbox":return xe(i);case"radio":return _e(i);case"file":return Ce(i);default:return e.inputAutoTrim?i.value.trim():i.value}})(t,i);i.inputValidator?Ae(t,r,e):n&&!n.checkValidity()?(t.enableButtons(),t.showValidationMessage(i.validationMessage||n.validationMessage)):"deny"===e?Pe(t,r):je(t,r)},Ae=(t,e,i)=>{const n=dt.innerParams.get(t);t.disableInput();const r=Promise.resolve().then(()=>g(n.inputValidator(e,n.validationMessage)));r.then(n=>{t.enableButtons(),t.enableInput(),n?t.showValidationMessage(n):"deny"===i?Pe(t,e):je(t,e)})},Pe=(t,e)=>{const i=dt.innerParams.get(t||void 0);if(i.showLoaderOnDeny&&ye(E()),i.preDeny){t.isAwaitingPromise=!0;const n=Promise.resolve().then(()=>g(i.preDeny(e,i.validationMessage)));n.then(i=>
vendor: 3,821 bytes, line 10
10{!1===i?(t.hideLoading(),ge(t)):t.close({isDenied:!0,value:void 0===i?e:i})}).catch(e=>Me(t||void 0,e))}else t.close({isDenied:!0,value:e})},De=(t,e)=>{t.close({isConfirmed:!0,value:e})},Me=(t,e)=>{t.rejectPromise(e)},je=(t,e)=>{const i=dt.innerParams.get(t||void 0);if(i.showLoaderOnConfirm&&ye(),i.preConfirm){t.resetValidationMessage(),t.isAwaitingPromise=!0;const n=Promise.resolve().then(()=>g(i.preConfirm(e,i.validationMessage)));n.then(i=>{J(T())||!1===i?(t.hideLoading(),ge(t)):De(t,void 0===i?e:i)}).catch(e=>Me(t||void 0,e))}else De(t,e)};function Le(){const t=dt.innerParams.get(this);if(!t)return;const e=dt.domCache.get(this);q(e.loader),I()?t.icon&&N(b()):Fe(e),W([e.popup,e.actions],o.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const Fe=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?N(e[0],"inline-block"):J(O())||J(E())||J(k())||q(t.actions)};function Ie(){const t=dt.innerParams.get(this),e=dt.domCache.get(this);return e?X(e.popup,t.input):null}function Be(t,e,i){const n=dt.domCache.get(t);e.forEach(t=>{n[t].disabled=i})}function Re(t,e){const i=y();if(i&&t)if("radio"===t.type){const t=i.querySelectorAll(`[name="${o.radio}"]`);for(let i=0;i<t.length;i++)t[i].disabled=e}else t.disabled=e}function Ye(){Be(this,["confirmButton","denyButton","cancelButton"],!1)}function Xe(){Be(this,["confirmButton","denyButton","cancelButton"],!0)}function Ue(){Re(this.getInput(),!1)}function ze(){Re(this.getInput(),!0)}function He(t){const e=dt.domCache.get(this),i=dt.innerParams.get(this);B(e.validationMessage,t),e.validationMessage.className=o["validation-message"],i.customClass&&i.customClass.validationMessage&&H(e.validationMessage,i.customClass.validationMessage),N(e.validationMessage);const n=this.getInput();n&&(n.setAttribute("aria-invalid","true"),n.setAttribute("aria-describedby",o["validation-message"]),U(n),H(n,o.inputerror))}function We(){const t=dt.domCache.get(this);t.validationMessage&&q(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),W(e,o.inputerror))}const Ge={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
10:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},Ve=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","draggable","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","theme","willClose"],Ne={allowEnterKey:void 0},qe=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],$e=t=>Object.prototype.hasOwnProperty.call(Ge,t),Ke=t=>-1!==Ve.indexOf(t),Ze=t=>Ne[t],Je=t=>{$e(t)||l(`Unknown parameter "${t}"`)},Qe=t=>{qe.includes(t)&&l(`The parameter "${t}" is incompatible with toasts`)},ti=t=>{const e=Ze(t);e&&u(t,e)},ei=t=>{!1===t.backdrop&&t.allowOutsideClick&&l('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t.theme&&!["light","dark","auto","minimal","borderless","bootstrap-4","bootstrap-4-light","bootstrap-4-dark","bootstrap-5","bootstrap-5-light","bootstrap-5-dark","material-ui","material-ui-light","material-ui-dark","embed-iframe","bulma","bulma-light","bulma-dark"].includes(t.theme)&&l(`Invalid theme "${t.theme}"`);for(const e in t)Je(e),t.toast&&Qe(e),ti(e)};function ii(t){const e=m(),i=y(),n=dt.innerParams.get(this);if(!i||R(i,n.hideClass.popup))return void l("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=ni(t),o=Object.assign({},n,r);ei(o),e.dataset.swal2Theme=o.theme,Ut(this,o),dt.innerParams.set(this,o),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const ni=t=>{const e={};return Object.keys(t).forEach(i=>{Ke(i)?e[i]=t[i]:l(`Invalid parameter to update: ${i}`)}),e};function ri(){const t=dt.domCache.get(this),e=dt.innerParams.get(this);e?(t.popup&&n.swalCloseEventFinishedCallback&&(n.swalCloseEventFinishedCallback(),delete n.swalCloseEventFinishedCallback),"function"==typeof e.didDestroy&&e.didDestroy(),n.eventEmitter.emit("didDestroy"),oi(this)):si(this)}const oi=t=>{si(t),delete t.params,delete n.keydownHandler,delete n.keydownTarget,delete n.currentInstance},si=t=>{t.isAwaitingPromise?(ai(dt,t),t.isAwaitingPromise=!0):(ai(Qt,t),ai(dt,t),delete t.isAwaitingPromise,delete t.disableButtons,delete t.enableButtons,delete t.getInput,delete t.disableInput,delete t.enableInput,delete t.hideLoading,delete t.disableLoading,delete t.showValidationMessage,delete t.resetValidationMessage,delete t.close,delete t.closePopup,delete t.closeModal,delete t.closeToast,delete t.rejectPromise,delete t.update,delete t._destroy)},ai=(t,e)=>{for(const i in t)t[i].delete(e)};var li=Object.freeze({__proto__:null,_destroy:ri,close:ue,closeModal:ue,closePopup:ue,closeToast:ue,disableButtons:Xe,disableInput:ze,disableLoading:Le,enableButtons:Ye,enableInput:Ue,getInput:Ie,handleAwaitingPromise:ge,hideLoading:Le,rejectPromise:fe,resetValidationMessage:We,showValidationMessage:He,update:ii});const ci=(t,e,i)=>{e.popup.onclick=(()=>{t&&(hi(t)||t.timer||t.input)||i(Ht.close)})},hi=t=>!!(t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton);let ui=!1;const di=t=>{t.popup.onmousedown=(()=>{t.container.onmouseup=function(e){t.container.onmouseup=(()=>{}),e.target===t.container&&(ui=!0)}})},fi=t=>{t.container.onmousedown=(e=>{e.target===t.container&&e.preventDefault(),t.popup.onmouseup=function(e){t.popup.onmouseup=(()=>{}),(e.target===t.popup||e.target instanceof HTMLElement&&t.popup.contains(e.target))&&(ui=!0)}})},gi=(t,e,i)=>{e.container.onclick=(n=>{ui?ui=!1:n.target===e.container&&d(t.allowOutsideClick)&&i(Ht.backdrop)})},pi=t=>t instanceof Element||(t=>"object"==typeof t&&t.jquery)(t),mi=()=>
vendor: 4,834 bytes, line 10
10{if(n.timeout)return(()=>{const t=M();if(!t)return;const e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const i=parseInt(window.getComputedStyle(t).width),n=e/i*100;t.style.width=`${n}%`})(),n.timeout.stop()},vi=()=>{if(n.timeout){const t=n.timeout.start();return et(t),t}};let wi=!1;const yi={},bi=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const t in yi){const i=e.getAttribute(t);if(i)return void yi[t].fire({template:i})}};n.eventEmitter=new class{constructor(){this.events={}}_getHandlersByEventName(t){return void 0===this.events[t]&&(this.events[t]=[]),this.events[t]}on(t,e){const i=this._getHandlersByEventName(t);i.includes(e)||i.push(e)}once(t,e){const i=(...n)=>{this.removeListener(t,i),e.apply(this,n)};this.on(t,i)}emit(t,...e){this._getHandlersByEventName(t).forEach(t=>{try{t.apply(this,e)}catch(t){console.error(t)}})}removeListener(t,e){const i=this._getHandlersByEventName(t),n=i.indexOf(e);n>-1&&i.splice(n,1)}removeAllListeners(t){void 0!==this.events[t]&&(this.events[t].length=0)}reset(){this.events={}}};var xi=Object.freeze({__proto__:null,argsToParams:t=>{const e={};return"object"!=typeof t[0]||pi(t[0])?["title","html","icon"].forEach((i,n)=>{const r=t[n];"string"==typeof r||pi(r)?e[i]=r:void 0!==r&&c(`Unexpected type of ${i}! Expected "string" or "Element", got ${typeof r}`)}):Object.assign(e,t[0]),e},bindClickHandler:function(t="data-swal-template"){yi[t]=this,wi||(document.body.addEventListener("click",bi),wi=!0)},clickCancel:()=>{var t;return null===(t=k())||void 0===t?void 0:t.click()},clickConfirm:zt,clickDeny:()=>{var t;return null===(t=E())||void 0===t?void 0:t.click()},enableLoading:ye,fire:function(...t){return new this(...t)},getActions:P,getCancelButton:k,getCloseButton:j,getConfirmButton:O,getContainer:m,getDenyButton:E,getFocusableElements:L,getFooter:D,getHtmlContainer:_,getIcon:b,getIconContent:()=>w(o["icon-content"]),getImage:C,getInputLabel:()=>w(o["input-label"]),getLoader:A,getPopup:y,getProgressSteps:S,getTimerLeft:()=>n.timeout&&n.timeout.getTimerLeft(),getTimerProgressBar:M,getTitle:x,getValidationMessage:T,increaseTimer:t=>{if(n.timeout){const e=n.timeout.increase(t);return et(e,!0),e}},isDeprecatedParameter:Ze,isLoading:()=>{const t=y();return!!t&&t.hasAttribute("data-loading")},isTimerRunning:()=>!(!n.timeout||!n.timeout.isRunning()),isUpdatableParameter:Ke,isValidParameter:$e,isVisible:()=>J(y()),mixin:function(t){return class extends(this){_main(e,i){return super._main(e,Object.assign({},t,i))}}},off:(t,e)=>{t?e?n.eventEmitter.removeListener(t,e):n.eventEmitter.removeAllListeners(t):n.eventEmitter.reset()},on:(t,e)=>{n.eventEmitter.on(t,e)},once:(t,e)=>{n.eventEmitter.once(t,e)},resumeTimer:vi,showLoading:ye,stopTimer:mi,toggleTimer:()=>{const t=n.timeout;return t&&(t.running?mi():vi())}});const _i=["swal-title","swal-html","swal-footer"],Ci=t=>{const e={},i=Array.from(t.querySelectorAll("swal-param"));return i.forEach(t=>{Di(t,["name","value"]);const i=t.getAttribute("name"),n=t.getAttribute("value");i&&n&&(e[i]="boolean"==typeof Ge[i]?"false"!==n:"object"==typeof Ge[i]?JSON.parse(n):n)}),e},Si=t=>{const e={},i=Array.from(t.querySelectorAll("swal-function-param"));return i.forEach(t=>{const i=t.getAttribute("name"),n=t.getAttribute("value");i&&n&&(e[i]=new Function(`return ${n}`)())}),e},Ti=t=>{const e={},i=Array.from(t.querySelectorAll("swal-button"));return i.forEach(t=>{Di(t,["type","color","aria-label"]);const i=t.getAttribute("type");i&&["confirm","cancel","deny"].includes(i)&&(e[`${i}ButtonText`]=t.innerHTML,e[`show${a(i)}Button`]=!0,t.hasAttribute("color")&&(e[`${i}ButtonColor`]=t.getAttribute("color")),t.hasAttribute("aria-label")&&(e[`${i}ButtonAriaLabel`]=t.getAttribute("aria-label")))}),e},Oi=t=>{const e={},i=t.querySelector("swal-image");return i&&(Di(i,["src","width","height","alt"]),i.hasAttribute("src")&&(e.imageUrl=i.getAttribute("src")||void 0),i.hasAttribute("width")&&(e.imageWidth=i.getAttribute("width")||void 0),i.hasAttribute("height")&&(e.imageHeight=i.getAttribute("height")||void 0),i.hasAttribute("alt")&&(e.imageAlt=i.getAttribute("alt")||void 0)),e},ki=t=>{const e={},i=t.querySelector("swal-icon");return i&&(Di(i,["type","color"]),i.hasAttribute("type")&&(e.icon=i.getAttribute("type")),i.hasAttribute("color")&&(e.iconColor=i.getAttribute("color")),e.iconHtml=i.innerHTML),e},Ei=t=>{const e={},i=t.querySelector("swal-input");i&&(Di(i,["type","label","placeholder","value"]),e.input=i.getAttribute("type")||"text",i.hasAttribute("label")&&(e.inputLabel=i.getAttribute("label")),i.hasAttribute("placeholder")&&(e.inputPlaceholder=i.getAttribute("placeholder")),i.hasAttribute("value")&&(e.inputValue=i.getAttribute("value")));const n=Array.from(t.querySelectorAll("swal-input-option"));return n.length&&(e.inputOptions={}
10,n.forEach(t=>{Di(t,["value"]);const i=t.getAttribute("value");if(!i)return;const n=t.innerHTML;e.inputOptions[i]=n})),e},Ai=(t,e)=>{const i={};for(const n in e){const r=e[n],o=t.querySelector(r);o&&(Di(o,[]),i[r.replace(/^swal-/,"")]=o.innerHTML.trim())}return i},Pi=t=>{const e=_i.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(t.children).forEach(t=>{const i=t.tagName.toLowerCase();e.includes(i)||l(`Unrecognized element <${i}>`)})},Di=(t,e)=>{Array.from(t.attributes).forEach(i=>{-1===e.indexOf(i.name)&&l([`Unrecognized attribute "${i.name}" on <${t.tagName.toLowerCase()}>.`,`${e.length?`Allowed attributes are: ${e.join(", ")}`:"To set the value, use HTML within the element."}`])})},Mi=t=>{const e=m(),i=y();"function"==typeof t.willOpen&&t.willOpen(i),n.eventEmitter.emit("willOpen",i);const r=window.getComputedStyle(document.body),s=r.overflowY;Ii(e,i,t),setTimeout(()=>{Li(e,i)},10),F()&&(Fi(e,t.scrollbarPadding,s),(()=>{const t=m();Array.from(document.body.children).forEach(e=>{e.contains(t)||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))})})()),I()||n.previousActiveElement||(n.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout(()=>t.didOpen(i)),n.eventEmitter.emit("didOpen",i),W(e,o["no-transition"])},ji=t=>{const e=y();if(t.target!==e)return;const i=m();e.removeEventListener("animationend",ji),e.removeEventListener("transitionend",ji),i.style.overflowY="auto"},Li=(t,e)=>{tt(e)?(t.style.overflowY="hidden",e.addEventListener("animationend",ji),e.addEventListener("transitionend",ji)):t.style.overflowY="auto"},Fi=(t,e,i)=>{(()=>{if(ee&&!R(document.body,o.iosfix)){const t=document.body.scrollTop;document.body.style.top=`${-1*t}px`,H(document.body,o.iosfix),ie()}})(),e&&"hidden"!==i&&le(i),setTimeout(()=>{t.scrollTop=0})},Ii=(t,e,i)=>{H(t,i.showClass.backdrop),i.animation?(e.style.setProperty("opacity","0","important"),N(e,"grid"),setTimeout(()=>{H(e,i.showClass.popup),e.style.removeProperty("opacity")},10)):N(e,"grid"),H([document.documentElement,document.body],o.shown),i.heightAuto&&i.backdrop&&!i.toast&&H([document.documentElement,document.body],o["height-auto"])};var Bi={email:(t,e)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address"),url:(t,e)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")};function Ri(t){!function(t){t.inputValidator||("email"===t.input&&(t.inputValidator=Bi.email),"url"===t.input&&(t.inputValidator=Bi.url))}(t),t.showLoaderOnConfirm&&!t.preConfirm&&l("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(t){(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(l('Target parameter is not valid, defaulting to "body"'),t.target="body")}(t),"string"==typeof t.title&&(t.title=t.title.split("\n").join("<br />")),rt(t)}let Yi;var Xi=new WeakMap;class Ui{constructor(...e){if(i(this,Xi,void 0),"undefined"==typeof window)return;Yi=this;const n=Object.freeze(this.constructor.argsToParams(e));this.params=n,this.isAwaitingPromise=!1,function(e,i,n){e.set(t(e,i),n)}(Xi,this,this._main(Yi.params))}_main(t,e={}){if(ei(Object.assign({},e,t)),n.currentInstance){const t=Qt.swalPromiseResolve.get(n.currentInstance),{isAwaitingPromise:e}=n.currentInstance;n.currentInstance._destroy(),e||t({isDismissed:!0}),F()&&te()}n.currentInstance=Yi;const i=Hi(t,e);Ri(i),Object.freeze(i),n.timeout&&(n.timeout.stop(),delete n.timeout),clearTimeout(n.restoreFocusTimeout);const r=Wi(Yi);return Ut(Yi,i),dt.innerParams.set(Yi,i),zi(Yi,r,i)}then(t){return e(Xi,this).then(t)}finally(t){return e(Xi,this).finally(t)}}const zi=(t,e,i)=>new Promise((r,o)=>{const s=e=>{t.close({isDismissed:!0,dismiss:e})};Qt.swalPromiseResolve.set(t,r),Qt.swalPromiseReject.set(t,o),e.confirmButton.onclick=(()=>{(t=>{const e=dt.innerParams.get(t);t.disableButtons(),e.input?Ee(t,"confirm"):je(t,!0)})(t)}),e.denyButton.onclick=(()=>{(t=>{const e=dt.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?Ee(t,"deny"):Pe(t,!1)})(t)}),e.cancelButton.onclick=(()=>{((t,e)=>{t.disableButtons(),e(Ht.cancel)})(t,s)}),e.closeButton.onclick=(()=>{s(Ht.close)}),((t,e,i)=>
vendor: 3,806 bytes, line 10
10{t.toast?ci(t,e,i):(di(e),fi(e),gi(t,e,i))})(i,e,s),((t,e,i)=>{Wt(t),e.toast||(t.keydownHandler=(t=>qt(e,t,i)),t.keydownTarget=e.keydownListenerCapture?window:y(),t.keydownListenerCapture=e.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(n,i,s),((t,e)=>{"select"===e.input||"radio"===e.input?Se(t,e):["text","email","number","tel","textarea"].some(t=>t===e.input)&&(f(e.inputValue)||p(e.inputValue))&&(ye(O()),Te(t,e))})(t,i),Mi(i),Gi(n,i,s),Vi(e,i),setTimeout(()=>{e.container.scrollTop=0})}),Hi=(t,e)=>{const i=(t=>{const e="string"==typeof t.template?document.querySelector(t.template):t.template;if(!e)return{};const i=e.content;return Pi(i),Object.assign(Ci(i),Si(i),Ti(i),Oi(i),ki(i),Ei(i),Ai(i,_i))})(t),n=Object.assign({},Ge,e,i,t);return n.showClass=Object.assign({},Ge.showClass,n.showClass),n.hideClass=Object.assign({},Ge.hideClass,n.hideClass),!1===n.animation&&(n.showClass={backdrop:"swal2-noanimation"},n.hideClass={}),n},Wi=t=>{const e={popup:y(),container:m(),actions:P(),confirmButton:O(),denyButton:E(),cancelButton:k(),loader:A(),closeButton:j(),validationMessage:T(),progressSteps:S()};return dt.domCache.set(t,e),e},Gi=(t,e,i)=>{const n=M();q(n),e.timer&&(t.timeout=new class{constructor(t,e){this.callback=t,this.remaining=e,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(t){const e=this.running;return e&&this.stop(),this.remaining+=t,e&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}(()=>{i("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(N(n),Y(n,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&et(e.timer)})))},Vi=(t,e)=>{if(!e.toast)return d(e.allowEnterKey)?void(Ni(t)||qi(t,e)||Gt(-1,1)):(u("allowEnterKey"),void $i())},Ni=t=>{const e=Array.from(t.popup.querySelectorAll("[autofocus]"));for(const t of e)if(t instanceof HTMLElement&&J(t))return t.focus(),!0;return!1},qi=(t,e)=>e.focusDeny&&J(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&J(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!J(t.confirmButton)||(t.confirmButton.focus(),0)),$i=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};Ui.prototype.disableButtons=Xe,Ui.prototype.enableButtons=Ye,Ui.prototype.getInput=Ie,Ui.prototype.disableInput=ze,Ui.prototype.enableInput=Ue,Ui.prototype.hideLoading=Le,Ui.prototype.disableLoading=Le,Ui.prototype.showValidationMessage=He,Ui.prototype.resetValidationMessage=We,Ui.prototype.close=ue,Ui.prototype.closePopup=ue,Ui.prototype.closeModal=ue,Ui.prototype.closeToast=ue,Ui.prototype.rejectPromise=fe,Ui.prototype.update=ii,Ui.prototype._destroy=ri,Object.assign(Ui,xi),Object.keys(li).forEach(t=>{Ui[t]=function(...e){return Yi&&Yi[t]?Yi[t](...e):null}}),Ui.DismissReason=Ht,Ui.version="11.26.0";const Ki=Ui;return Ki.default=Ki,Ki}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(t,e){var i=t.createElement("style");if(t.getElementsByTagName("head")[0].appendChild(i),i.styleSheet)i.styleSheet.disabled||(i.styleSheet.cssText=e);else try{i.innerHTML=e}catch(t){i.innerText=e}}(document,':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.1
vendor: 11,906 bytes, line 10
10s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);
vendor: 5,100 bytes, line 10
10box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;
vendor: 13,481 bytes, line 10
10box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}')
10},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.wheelchairCircle='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path d="M12.19,14.19A2.78,2.78,0,0,1,9.72,15.7a2.68,2.68,0,0,1-2-.83,2.72,2.72,0,0,1-.82-2,2.78,2.78,0,0,1,.46-1.53,2.72,2.72,0,0,1,1.21-1L8.5,9.5a3.61,3.61,0,0,0-2.36,3.39,3.55,3.55,0,0,0,.48,1.81A3.5,3.5,0,0,0,7.93,16a3.4,3.4,0,0,0,1.79.49,3.43,3.43,0,0,0,2.11-.7A3.56,3.56,0,0,0,13.14,14l-.64-1.28a2.63,2.63,0,0,1-.31,1.48Z" fill="#1df646"/>\n <path d="M16.76,13l-1.31.59L14,10.88a.4.4,0,0,0-.38-.21h-3l-.1-.77h2.68V9.14H10.36l-.24-1.73a1,1,0,0,0,.79-.25.88.88,0,0,0,.34-.7.89.89,0,0,0-.31-.68,1.14,1.14,0,0,0-1.38-.09.88.88,0,0,0-.38.49.55.55,0,0,0,0,.25l.63,4.67a.45.45,0,0,0,.14.24.48.48,0,0,0,.28.1h3.12l1.57,2.85a.4.4,0,0,0,.38.21.43.43,0,0,0,.19,0l1.69-.77Z" fill="#1df646"/>\n </g>\n <circle cx="11" cy="11" r="10" stroke="#1DF646" stroke-width="2"/>\n </g>\n </svg>\n ',e.wheelchairSquare='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path d="M11.56,13.76a2.73,2.73,0,0,1-1,1.1,2.63,2.63,0,0,1-1.45.41A2.78,2.78,0,0,1,6.3,12.46a2.79,2.79,0,0,1,.45-1.53A2.69,2.69,0,0,1,8,9.9l-.1-.83A3.46,3.46,0,0,0,6.15,10.4,3.62,3.62,0,0,0,6,14.27a3.68,3.68,0,0,0,1.31,1.32,3.57,3.57,0,0,0,3.9-.21,3.58,3.58,0,0,0,1.31-1.82l-.63-1.28a2.75,2.75,0,0,1-.31,1.49Z" fill="#1df646"/>\n <path d="M16.12,12.58l-1.31.6-1.5-2.73a.4.4,0,0,0-.38-.21h-3l-.1-.76h2.68V8.71H9.72L9.48,7a1,1,0,0,0,.79-.24A.9.9,0,0,0,10.61,6a.85.85,0,0,0-.31-.67,1.08,1.08,0,0,0-.74-.29,1.17,1.17,0,0,0-.64.19.9.9,0,0,0-.38.5A.69.69,0,0,0,8.5,6l.64,4.66a.33.33,0,0,0,.14.24.4.4,0,0,0,.28.1h3.11l1.58,2.86a.38.38,0,0,0,.37.2.31.31,0,0,0,.19,0l1.69-.76Z" fill="#1df646"/>\n </g>\n <rect width="20" height="20" stroke="#1DF646" stroke-width="2"/>\n </g>\n </svg>\n ',e.wheelchairLoveseatLeft='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path d="M12.61,14.21a2.66,2.66,0,0,1-1,1.1,2.3,2.3,0,0,1-1.4.4,3,3,0,0,1-2-.8,2.79,2.79,0,0,1-.8-2,2.46,2.46,0,0,1,.5-1.5,2.34,2.34,0,0,1,1.2-1l-.2-.9a3.71,3.71,0,0,0-1.7,1.3,3.14,3.14,0,0,0-.7,2.1,3.45,3.45,0,0,0,.5,1.8A4,4,0,0,0,8.31,16a3.45,3.45,0,0,0,1.8.5,3.14,3.14,0,0,0,2.1-.7,3.38,3.38,0,0,0,1.3-1.8l-.6-1.3a4,4,0,0,1-.3,1.5Z" fill="#1df646"/>\n <path d="M17.11,13l-1.3.6-1.5-2.7a.52.52,0,0,0-.4-.2h-3l-.1-.8h2.7v-.8h-2.8l-.2-1.7a1.88,1.88,0,0,0,.8-.2,1.08,1.08,0,0,0,.3-.7.91.91,0,0,0-.3-.7,1.08,1.08,0,0,0-.7-.3,1.45,1.45,0,0,0-.7.2,1,1,0,0,0-.4.5v.3l.6,4.7a.35.35,0,0,0,.1.2.37.37,0,0,0,.3.1h3.1l1.6,2.9a.52.52,0,0,0,.4.2h.2l1.7-.8Z" fill="#1df646"/>\n </g>\n\t <path d="M20.91,20.91V1H8.74A7.7,7.7,0,0,0,1,8.74v4.43a7.7,7.7,0,0,0,7.74,7.74Z" stroke="#1DF646" stroke-width="2" />\n </g>\n </svg>\n ',e.wheelchairLoveseatRight='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n<g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n\t\t<path d="M11.63,14.23a2.66,2.66,0,0,1-1,1.1,2.3,2.3,0,0,1-1.4.4,3,3,0,0,1-2-.8,2.79,2.79,0,0,1-.8-2,2.46,2.46,0,0,1,.5-1.5,2.34,2.34,0,0,1,1.2-1l-.2-.9a3.71,3.71,0,0,0-1.7,1.3,3.14,3.14,0,0,0-.7,2.1,3.45,3.45,0,0,0,.5,1.8A4,4,0,0,0,7.33,16a3.45,3.45,0,0,0,1.8.5,3.14,3.14,0,0,0,2.1-.7,3.38,3.38,0,0,0,1.3-1.8l-.6-1.3a4,4,0,0,1-.3,1.5Z" fill="#1df646"/>\n <path d="M16.13,13l-1.3.6-1.5-2.7a.52.52,0,0,0-.4-.2h-3l-.1-.8h2.7v-.8H9.73l-.2-1.7a1.88,1.88,0,0,0,.8-.2,1.08,1.08,0,0,0,.3-.7.91.91,0,0,0-.3-.7,1.08,1.08,0,0,0-.7-.3,1.45,1.45,0,0,0-.7.2,1,1,0,0,0-.4.5v.3l.6,4.7a.35.35,0,0,0,.1.2.37.37,0,0,0,.3.1h3.1l1.6,2.9a.52.52,0,0,0,.4.2h.2l1.7-.8Z" fill="#1df646"/>\n\t</g>\n\t<path d="M1,21V1H13.23A7.74,7.74,0,0,1,21,8.78v4.45A7.74,7.74,0,0,1,13.23,21Z" stroke="#1DF646" stroke-width="2"/>\n</g>\n</svg>\n ',e.companionCircle='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path d="M13,9a2,2,0,0,0-.45-.52A2.33,2.33,0,0,0,12,8.12,2.18,2.18,0,0,0,11.23,8a2.35,2.35,0,0,0-1.17.26A2.25,2.25,0,0,0,9.28,9a3.12,3.12,0,0,0-.44,1,5.08,5.08,0,0,0-.14,1.18,4.81,4.81,0,0,0,.14,1.14,3,3,0,0,0,.44,1,2.22,2.22,0,0,0,.78.71,2.35,2.35,0,0,0,1.17.27,1.89,1.89,0,0,0,1.46-.57,2.71,2.71,0,0,0,.64-1.51h2a4.83,4.83,0,0,1-.4,1.57,3.91,3.91,0,0,1-.86,1.2,3.6,3.6,0,0,1-1.25.75,4.66,4.66,0,0,1-1.57.26,4.73,4.73,0,0,1-1.92-.37,4.18,4.18,0,0,1-1.44-1A4.31,4.31,0,0,1,7,13.07a5.51,5.51,0,0,1-.32-1.89A5.75,5.75,0,0,1,7,9.25,4.49,4.49,0,0,1,7.87,7.7a4,4,0,0,1,1.44-1,4.73,4.73,0,0,1,1.92-.38,4.63,4.63,0,0,1,1.45.22,4.06,4.06,0,0,1,1.22.64,3.77,3.77,0,0,1,.89,1,3.81,3.81,0,0,1,.44,1.43h-2A1.59,1.59,0,0,0,13,9Z" style="fill: #1df646"/>\n </g>\n <circle cx="11" cy="11" r="10" stroke="#1DF646" stroke-width="2"/>\n </g>\n </svg>\n ',e.companionSquare='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path fill="#1df646" d="M12,7.84a2.17,2.17,0,0,0-.45-.51A2.36,2.36,0,0,0,10.93,7a2.18,2.18,0,0,0-.72-.12A2.35,2.35,0,0,0,9,7.13a2.13,2.13,0,0,0-.78.71,3.12,3.12,0,0,0-.44,1,5.17,5.17,0,0,0-.14,1.19,4.73,4.73,0,0,0,.14,1.13,3.11,3.11,0,0,0,.44,1,2.32,2.32,0,0,0,.78.71,2.47,2.47,0,0,0,1.17.26,1.89,1.89,0,0,0,1.46-.57,2.65,2.65,0,0,0,.64-1.51h2a4.65,4.65,0,0,1-.41,1.58,3.64,3.64,0,0,1-2.1,1.95,4.66,4.66,0,0,1-1.57.26,4.9,4.9,0,0,1-1.92-.37,4.08,4.08,0,0,1-1.44-1A4.36,4.36,0,0,1,6,11.94a5.6,5.6,0,0,1-.32-1.89A5.7,5.7,0,0,1,6,8.12a4.45,4.45,0,0,1,.89-1.56,4.1,4.1,0,0,1,1.44-1,4.73,4.73,0,0,1,1.92-.38,4.63,4.63,0,0,1,1.45.23A3.85,3.85,0,0,1,12.88,6a3.5,3.5,0,0,1,.89,1,3.75,3.75,0,0,1,.44,1.43h-2A1.63,1.63,0,0,0,12,7.84Z" />\n </g>\n <rect width="20" height="20" stroke="#1DF646" stroke-width="2"/>\n </g>\n </svg>\n ',e.companionLoveseatLeft='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n <g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n <path d="M13,8.84a2.17,2.17,0,0,0-.45-.51A2.21,2.21,0,0,0,12,8a2.18,2.18,0,0,0-.72-.12,2.35,2.35,0,0,0-1.17.27,2.13,2.13,0,0,0-.78.71,3.35,3.35,0,0,0-.44,1,5.17,5.17,0,0,0-.13,1.19,4.72,4.72,0,0,0,.13,1.13,3.34,3.34,0,0,0,.44,1,2.32,2.32,0,0,0,.78.71,2.47,2.47,0,0,0,1.17.26,1.89,1.89,0,0,0,1.46-.57,2.65,2.65,0,0,0,.65-1.51h2a4.65,4.65,0,0,1-.4,1.58,3.82,3.82,0,0,1-.86,1.19,3.68,3.68,0,0,1-1.25.76,4.62,4.62,0,0,1-1.57.26,4.9,4.9,0,0,1-1.92-.37,4.13,4.13,0,0,1-1.43-1A4.54,4.54,0,0,1,7,12.94a5.59,5.59,0,0,1-.31-1.89A5.7,5.7,0,0,1,7,9.12a4.63,4.63,0,0,1,.9-1.56,4.16,4.16,0,0,1,1.43-1,4.73,4.73,0,0,1,1.92-.38,4.63,4.63,0,0,1,1.45.23A3.85,3.85,0,0,1,13.91,7a3.36,3.36,0,0,1,.89,1.05,3.58,3.58,0,0,1,.44,1.43h-2A1.65,1.65,0,0,0,13,8.84Z" fill="#1df646"/>\n </g>\n\t <path d="M20.91,20.91V1H8.74A7.7,7.7,0,0,0,1,8.74v4.43a7.7,7.7,0,0,0,7.74,7.74Z" stroke="#1DF646" stroke-width="2" />\n </g>\n </svg>\n ',e.companionLoveseatRight='\n <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22">\n<g fill="none" fill-rule="evenodd">\n <g fill="#1DF646" fill-rule="nonzero">\n\t\t<path d="M13,8.84a2.22,2.22,0,0,0-.46-.51A2,2,0,0,0,12,8a2,2,0,0,0-.73-.13,2.35,2.35,0,0,0-1.17.27,2.32,2.32,0,0,0-.78.71,3.07,3.07,0,0,0-.43,1,5.08,5.08,0,0,0-.14,1.18,4.81,4.81,0,0,0,.14,1.14,3,3,0,0,0,.43,1,2.22,2.22,0,0,0,.78.71,2.35,2.35,0,0,0,1.17.27,1.87,1.87,0,0,0,1.47-.58,2.65,2.65,0,0,0,.64-1.5h2a4.84,4.84,0,0,1-.41,1.57,3.72,3.72,0,0,1-2.1,1.95,4.67,4.67,0,0,1-1.58.26,4.65,4.65,0,0,1-1.91-.37,4.18,4.18,0,0,1-1.44-1A4.69,4.69,0,0,1,7,12.94a5.59,5.59,0,0,1-.31-1.89A5.74,5.74,0,0,1,7,9.12a4.73,4.73,0,0,1,.9-1.56,4.23,4.23,0,0,1,1.44-1,4.65,4.65,0,0,1,1.91-.37,4.54,4.54,0,0,1,1.45.22A4.11,4.11,0,0,1,13.92,7a3.65,3.65,0,0,1,.89,1.05,3.75,3.75,0,0,1,.44,1.43h-2A1.63,1.63,0,0,0,13,8.84Z" fill="#1df646"/>\n\t</g>\n\t<path d="M1,21V1H13.23A7.74,7.74,0,0,1,21,8.78v4.45A7.74,7.74,0,0,1,13.23,21Z" stroke="#1DF646" stroke-width="2"/>\n</g>\n</svg>\n ',e.hallHeaderHtml='\n <div class="hall-header">\n <div class="hall-legend" tabindex="0">\n <div class="hall-legend-item">
10\n <span class="hall-legend-icon hall-legend-available"></span>\n Available\n </div>\n <div class="hall-legend-item">\n <span class="hall-legend-icon hall-legend-unavailable"></span>\n Unavailable\n </div>\n <div class="hall-legend-item">\n <span class="hall-legend-icon hall-legend-selected"></span>\n Selected\n </div>\n </div>\n <div class="hall-description" tabindex="0"></div>\n <div class="hall-screen-wrap">\n <div class="hall-screen"></div>\n <span class="hall-label">Front of theater</span>\n </div>\n </div>\n ',e.hallFooterHtml='\n <div class="hall-footer">\n <span class="hall-label">Back of theater</span>\n </div>\n '},function(t,e){}]).default});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.