things-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d80284e066723a1146253115eb4ee3a5814bbe9
4
- data.tar.gz: 05e0d35b9548af778f6b643aff5864b4a54f92bf
3
+ metadata.gz: e37838a1cea64e1c8fee97f5f904d6f9570ed6c9
4
+ data.tar.gz: 2800cb97ce27f5b4a1ddd98fe3df26f3129bb065
5
5
  SHA512:
6
- metadata.gz: ddf9c29e5020000c62f6e1f2fd431fb819d247788bff9f41a800edd87567db4fa71c3c6e576e48dc0d8998d018c9a934d2a82634a57d23c640b067197093253b
7
- data.tar.gz: a46156e147f25d6be3773d0a6c2fe0d4a3594ea719337a61c605dda83a31baa1f3f99b51f99cefd299a3a7036efc971b184538dfd0fe587c8577605753cd5ad7
6
+ metadata.gz: 722f4f1af3b30e32d25b9ad34f4d91034ec335416aabe78046204f19a81e18174d0843ef4a84c52fbf05fedf96ed2c0cc09587a3e53cbce4d5949501cd569d52
7
+ data.tar.gz: bb51aef04b8f83b9d8911e798bdafc9fab4ce06c08fe34aea88f6183e9fa841ff26b8892f5d8eda9cc5b58d91dc330c484940775a47cc12c5dc5e3c580ed5e33
@@ -1,3 +1,3 @@
1
1
  module Things
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,4 +1,4 @@
1
- /*! Things v0.0.3 | (c) Hatio, Lab. | MIT License */
1
+ /*! Things v0.0.4 | (c) Hatio, Lab. | MIT License */
2
2
  (function webpackUniversalModuleDefinition(root, factory) {
3
3
  if(typeof exports === 'object' && typeof module === 'object')
4
4
  module.exports = factory(require("_"));
@@ -1,4 +1,4 @@
1
- /*! Things v0.0.3 | (c) Hatio, Lab. | MIT License */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("_")):"function"==typeof define&&define.amd?define(["_"],e):"object"==typeof exports?exports.things=e(require("_")):t.things=e(t._)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r,i;r=[n(1),n(2),n(3),n(4),n(5),n(6),n(7),n(8),n(9),n(10),n(11),n(12),n(13),n(14),n(15),n(16),n(17),n(18),n(19),n(20),n(21),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29)],i=function(t,e,n,r,i,o,s,a,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k,P,M,S,O,E){"use strict";var C;return C=[],{create:function(e){var n;return n=new t(e).getStage(),C.push(n),n},destroy:function(t){var e;return e=C.indexOf(t),e>-1&&C.splice(e,1),t.dispose()},stages:function(){return C},Component:e,Container:n,shape:{Barcode:r,Circle:i,Ellipse:o,ImageBox:s,Path:a,Rect:u,Ruler:c,Shape:p,Text:h,Line:l},layer:{DebugLayer:f,Layer:d,MagnifyLayer:g,RulerLayer:y,SelectionLayer:_,SlideLayer:v,WidgetLayer:m},group:{Group:x},handle:{BoundHandle:b,CircleHandle:w,Handle:k,P2PHandle:P,PathHandle:M,RotationHandle:S},stage:{Stage:O,WidgetBox:E}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(43),n(30),n(2),n(31),n(32),n(33),n(34),n(35),n(36),n(37),n(44),n(45)],i=function(t,e,n,r,i,o,s,a,u,c,p,h){"use strict";var l;return n.include({setController:function(t){return this.controller=t},getController:function(){return this.controller},getStage:function(){return this.controller.getStage()},setSpec:function(t){return this.spec=t},getSpec:function(){return this.spec},build:function(t,e){return this.controller.build(t,e||this)},require:function(t){if(!this.controller)throw new Error("controller not initialized");return this.controller.require(t)},select:function(t,e){if(!this.controller)throw new Error("controller not initialized");return this.controller.select(t,e)},abs:function(t){var e,n;return n=this.get(t)||0,e=this.getContainer(),e&&(n+=e.abs(t)||0),n},debug:function(t,e){return this.require("debug-layer").debug(t,e)}}),l=function(){function n(n){this.options=t.clone(n),this.exports={},this.exportsManager=new c(this),this.commandManager=new p,this.componentRegistry=new r,this.componentRegistry.setRegisterCallback(function(t){return this.exportsManager["import"](t.type,t.exports)},this),this.componentRegistry.setUnregisterCallback(function(t){return this.exportsManager.remove(t.type)},this),this.eventEngine=new s,this.componentFactory=new o(this.componentRegistry,this),this.stage=this.componentFactory.createModel(n),this.eventEngine.setRoot(this.stage),this.stage.event_map&&this.eventEngine.add(this.stage,this.stage.event_map(),this.stage),this.eventEngine.add(this,h,this),this.componentFactory.setupDescendant(this.stage),e.mobile||(this.mouseEvent=new a(this.stage)),this.touchEvent=new u(this.stage)}return n.prototype.setStage=function(t){return this.stage=t},n.prototype.getStage=function(){return this.stage},n.prototype.build=function(t,e){return this.componentFactory.build(t,e)},n.prototype.select=function(t,e){return i.select(t,e||this.stage)},n.prototype["import"]=function(t,e,n){return this.exportsManager["import"](t,e,n)},n.prototype.require=function(t){return this.exportsManager.require(t)},n.prototype.dispose=function(){return this.componentFactory.dispose(),this.comandManager.dispose(),this.eventEngine.dispose(),this.componentRegistry.dispose(),this.mouseEvent&&this.mouseEvent.dispose(),this.touchEvent.dispose(),this.exportsManager.dispose()},n}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(38),n(39),n(40),n(41),n(42)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(t,e){this.type=t,this.container=e}return s(i,t),i.include(e),i.include(n),i.include(r),i.prototype.getType=function(){return this.type},i.prototype.dispose=function(){return this.setContainer(null)},i.prototype.getContainer=function(){return this.container},i.prototype.setContainer=function(t){return t!==this.container?(this.container&&this.container.remove(this),this.container=t,this.container?this.container.add(this):void 0):void 0},i.prototype.moveAt=function(t){return this.getContainer()?this.container.moveChildAt(t,this):void 0},i.prototype.moveForward=function(){return this.getContainer()?this.container.moveChildForward(this):void 0},i.prototype.moveBackward=function(){return this.getContainer()?this.container.moveChildBackward(this):void 0},i.prototype.moveToFront=function(){return this.getContainer()?this.container.moveChildToFront(this):void 0},i.prototype.moveToBack=function(){return this.getContainer()?this.container.moveChildToBack(this):void 0},i}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(2),n(46)],i=function(t,e,n){"use strict";var r,i,o,a,u,c,p,h,l,f,d,g,y,_,v,m;return i=[],a=function(t,r){var i,o,s;if(i=r instanceof e,i&&(s=r.getContainer())){if(t===s)return;v(t,r)}return o=t.__components__.push(r)-1,i&&r.setContainer(t),n.add(t,t,r,o),i?(r.delegate_on(t),n.added(r,t,r,o)):void 0},v=function(t,r){var i,o;return i=r instanceof e,o=t.__components__.indexOf(r),-1!==o&&(o>-1&&t.__components__.splice(o,1),i&&r.setContainer(null),n.remove(t,t,r),r instanceof e)?(n.removed(r,t,r),r.delegate_off(t)):void 0},o=function(t){var e,n,r;if(this.__components__||(this.__components__=[]),!(t instanceof Array))return o.call(this,[t]);for(n=0,r=t.length;r>n;n++)e=t[n],a(this,e);return this},y=function(t){var e,n,r;if(!(t instanceof Array))return y.call(this,[t]);if(this.__components__){for(n=0,r=t.length;r>n;n++)e=t[n],v(this,e);return this}},_=function(){return this.remove(t.clone(this.__components__))},c=function(t){return this.__components__?this.__components__[t]:void 0},u=function(t,e){return this.__components__?this.__components__.forEach(t,e):void 0},p=function(t){return(this.__components__||i).indexOf(t)},m=function(){return(this.__components__||i).length},h=function(t,e){var n,r,i;return r=this.indexOf(e),-1!==r?(n=this.__components__.splice(0,r),i=this.__components__.splice(1),this.__components__=n.concat(i),t=Math.max(0,t),t=Math.min(t,this.__components__.length),n=this.__components__.splice(0,t),this.__components__=n.concat(e,this.__components__)):void 0},f=function(t){var e;return e=this.indexOf(t),-1!==e&&e!==this.size()-1?(this.__components__[e]=this.__components__[e+1],this.__components__[e+1]=t):void 0},l=function(t){var e;return e=this.indexOf(t),-1!==e&&0!==e?(this.__components__[e]=this.__components__[e-1],this.__components__[e-1]=t):void 0},g=function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&n!==this.size()-1?(e=this.__components__.splice(0,n),r=this.__components__.splice(1),this.__components__=e.concat(r,this.__components__)):void 0},d=function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&0!==n?(e=this.__components__.splice(0,n),r=this.__components__.splice(1),this.__components__=this.__components__.concat(e,r)):void 0},r=function(e){function n(t){n.__super__.constructor.call(this,t)}return s(n,e),n.prototype.dispose=function(){var e,r,i,o;if(this.__components__){for(e=t.clone(this.__components__),i=0,o=e.length;o>i;i++)r=e[i],r.dispose();this.__components__=null}return n.__super__.dispose.call(this)},n.prototype.add=o,n.prototype.remove=y,n.prototype.removeAll=_,n.prototype.size=m,n.prototype.getAt=c,n.prototype.indexOf=p,n.prototype.forEach=u,n.prototype.moveChildAt=h,n.prototype.moveChildForward=f,n.prototype.moveChildBackward=l,n.prototype.moveChildToFront=g,n.prototype.moveChildToBack=d,n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i,o){"use strict";var a;return a=function(e){function a(){return a.__super__.constructor.apply(this,arguments)}return s(a,e),a.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.barcode.width,this.barcode.height)},a.prototype.setup=function(){var t;return this.barcode=new Image,t=this,this.barcode.onload=function(){return t.draw()},this.barcode.src=this.makeurl()},a.prototype.shape=function(t){if(this.barcode)try{return this.get("w")?t.drawImage(this.barcode,this.get("x"),this.get("y"),this.get("w"),this.get("h")):t.drawImage(this.barcode,this.get("x"),this.get("y"))}catch(e){}},a.prototype.makeurl=function(){var t;return t="http://barcode.hatiolab.com:81/?",t+="text="+window.escape(this.get("text")),t+="&bcid="+(this.get("symbol")||"code128"),t+="&wscale="+(this.get("scale-w")||2),t+="&hscale="+(this.get("scale-h")||2),t+="&rotate="+(this.get("rotation")||"N"),this.get("alttext")?t+="&alttext="+window.escape(this.get("alttext")):this.get("includetext")&&(t+="&alttext="+window.escape(this.get("text"))),this.get("barcolor")&&"#000000"!==this.get("barcolor")&&(t+="&barcolor="+window.escape(this.get("barcolor"))),this.get("backgroundcolor")&&"#FFFFFF"!==this.get("backgroundcolor")&&(t+="&backgroundcolor="+window.escape(this.get("backgroundcolor"))),t},a.prototype.handles=function(){return["bound-handle","rotation-handle"]},a.prototype.event_map=function(){var e;return e={"(self)":{"(self)":{change:function(e,n,r){var i;return i=t.pick(r,["symbol","text","alttext","scale-h","scale-w","rotation","includetext","barcolor","backgroundcolor"]),t.isEmpty(i)?void 0:this.barcode.src=this.makeurl()(i)}}}}},a.spec={type:"barcode",containable:!1,description:"Barcode",dependencies:{"bound-handle":n,"rotation-handle":r},properties:[i,o,{symbol:{type:"string"},text:{type:"string"},alttext:{type:"string"},"scale-h":{type:"number"},"scale-w":{type:"number"},rotation:{type:"sring"},includetext:{type:"boolean"},barcolor:{type:"string"},backgroundcolor:{type:"string"}}]},a}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(11),n(23),n(58),n(59)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){return{x:this.get("cx"),y:this.get("cy")}},e.prototype.shape=function(t){return t.arc(this.get("cx"),this.get("cy"),this.get("r"),0,2*Math.PI,!1)},e.prototype.handles=function(){return["circle-handle"]},e.prototype.positions=function(){return[["cx","cy"]]},e.prototype.dockPoints=function(){var t,e,n,r,i,o;for(e=this.get("cx"),n=this.get("cy"),i=this.get("r"),r=[],t=o=0;359>=o;t=o+=45)r.push([e+Math.cos(t*Math.PI/180)*i,n-Math.sin(t*Math.PI/180)*i]);return r},e.spec={type:"circle",containable:!1,description:"Circle",dependencies:{"circle-handle":n},properties:[i,r]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.shape=function(t){var e,n,r,i,o,s,a;return s=this.get("x"),a=this.get("y"),o=this.get("w"),r=this.get("h"),e=s+o/2,n=a+r/2,i=o/2,t.save(),t.scale(1,r/o),t.arc(e,n*o/r,i,0,2*Math.PI,!1),t.restore()},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.spec={type:"ellipse",containable:!1,description:"Ellipse",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.image.width,this.image.height)},o.prototype.setup=function(){var t;return this.image=new Image,t=this,this.image.onload=function(){return t.draw()},this.image.src=this.get("src")},o.prototype.shape=function(t){return this.image?this.get("w")?t.drawImage(this.image,this.get("x"),this.get("y"),this.get("w"),this.get("h")):t.drawImage(this.image,this.get("x"),this.get("y")):void 0},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.prototype.event_map=function(){var t;return t={"(self)":{"(self)":{change:function(t,e,n){return n.hasOwnProperty("src")?this.image.src=n.src:void 0}}}}},o.spec={type:"image",containable:!1,description:"ImageBox",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i,{src:{type:"string"}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(11),n(26),n(60),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){var t,e,n,r,i,o,s;for(e=this.get("path"),n=e.length,r=0,i=0,o=0,s=e.length;s>o;o++)t=e[o],r+=t[0],i+=t[1];return{x:r/n,y:i/n}},e.prototype.shape=function(t){var e,n,r,i,o,s;for(n=this.get("path"),r=n.length,i=n[0],t.moveTo(i[0],i[1]),s=[],e=o=0;r>=0?r>o:o>r;e=r>=0?++o:--o)s.push(t.lineTo(n[e][0],n[e][1]));return s},e.prototype.handles=function(){return["path-handle"]},e.prototype.positions=function(){return"path"},e.prototype.dockPoints=function(){return this.get("path")},e.prototype.event_map=function(){},e.spec={type:"path",containable:!1,description:"Path",dependencies:{"path-handle":n},properties:[r,i]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.spec={type:"rect",containable:!1,description:"Rectangle",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58),n(61)],i=function(t,e,n,r,i,o){"use strict";var a,u;return a=3.779527559,u=function(t){function u(){return u.__super__.constructor.apply(this,arguments)}return s(u,t),u.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},u.prototype.shape=function(t){var e;return e={x:this.get("x"),y:this.get("y"),w:this.get("w"),h:this.get("h")},t.rect(e.x,e.y,e.w,e.h),"vertical"!==this.get("direction")?this.drawHorizontal(t,e):this.drawVertical(t,e)},u.prototype.handles=function(){return["bound-handle","rotation-handle"]},u.prototype.drawHorizontal=function(t,e){var n,r,i,o,s,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k;for(d=parseInt(this.get("zeropos")),l=e.x+d,o=e.x+this.get("margin")[0],s=e.x+e.w-this.get("margin")[1],n=e.y+e.h-15,r=e.y+e.h,h=e.w-d,p=Math.ceil(h/a),i=g=0,m=p-1;(m>=0?m>=g:g>=m)&&(f=l+i*a,!(f>s));i=m>=0?++g:--g)o>f||(i%10===0?(t.moveTo(f,n),t.lineTo(f,r)):i%5===0?(t.moveTo(f,n+8),t.lineTo(f,r)):(t.moveTo(f,n+11),t.lineTo(f,r)));for(c=d,u=Math.floor(c/a),i=y=1,x=u-1;(x>=1?x>=y:y>=x)&&(f=l-i*a,!(o>f));i=x>=1?++y:--y)f>s||(i%10===0?(t.moveTo(f,n),t.lineTo(f,r)):i%5===0?(t.moveTo(f,n+8),t.lineTo(f,r)):(t.moveTo(f,n+11),t.lineTo(f,r)));for(t.textAlign="left",t.textBaseline="bottom",i=_=0,b=p-1;b>=_&&(f=l+i*a,!(f>s));i=_+=10)o>f||t.fillText(""+i/10,f+2,n+10);for(k=[],i=v=10,w=u-1;w>=v&&(f=l-i*a,!(o>f));i=v+=10)f>s||k.push(t.fillText("-"+i/10,f+2,n+10));return k},u.prototype.drawVertical=function(t,e){var n,r,i,o,s,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k;for(d=parseInt(this.get("zeropos")),l=e.y+d,s=e.y+this.get("margin")[0],o=e.y+e.h-this.get("margin")[1],n=e.x+e.w-15,r=e.x+e.w,p=e.h-d,h=Math.ceil(p/a),i=g=0,m=h-1;(m>=0?m>=g:g>=m)&&(f=l+i*a,!(f>o));i=m>=0?++g:--g)s>f||(i%10===0?(t.moveTo(n,f),t.lineTo(r,f)):i%5===0?(t.moveTo(n+8,f),t.lineTo(r,f)):(t.moveTo(n+11,f),t.lineTo(r,f)));for(u=d,c=Math.floor(u/a),i=y=1,x=c-1;x>=1?x>=y:y>=x;i=x>=1?++y:--y)if(f=l-i*a,!(f>o)){if(s>f)break;i%10===0?(t.moveTo(n,f),t.lineTo(r,f)):i%5===0?(t.moveTo(n+8,f),t.lineTo(r,f)):(t.moveTo(n+11,f),t.lineTo(r,f))}for(t.textAlign="right",t.textBaseline="top",i=_=0,b=h-1;b>=_&&(f=l+i*a,!(f>o));i=_+=10)s>f||t.fillText(""+i/10,n+10,f+2);for(k=[],i=v=10,w=c-1;w>=v&&(f=l-i*a,!(s>f));i=v+=10)f>o||k.push(t.fillText("-"+i/10,n+10,f+2));return k},u.spec={type:"ruler",containable:!1,description:"Ruler",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i,o,{zeropos:{type:"number","default":0},direction:{type:"string","default":"horizontal"},margin:{type:"array","default":[0,0]}}]},u}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(2),n(47),n(42),n(48),n(57),n(58)],i=function(t,e,n,r,i,o,a){"use strict";var u;return u=function(e){function u(){return u.__super__.constructor.apply(this,arguments)}return s(u,e),u.include(n),u.include(r),u.include(i),u.prototype.handles=function(){return["bound-handle"]},u.prototype.positions=function(){return[["x","y"]]},u.prototype.move=function(e){var n,r,i,o,s,a,u,c,p;if(n=e.delta,!t.isEmpty(n)){if(s={},o=this.positions(),o instanceof Array)for(a=0,c=o.length;c>a;a++)r=o[a],n.x&&(s[r[0]]=Math.round(this.get(r[0])+n.x)),n.y&&(s[r[1]]=Math.round(this.get(r[1])+n.y));else{for(i=t.clone(this.get(o)),u=0,p=i.length;p>u;u++)r=i[u],n.x&&(r[0]+=Math.round(n.x)),n.y&&(r[1]+=Math.round(n.y));s[o]=i}return this.set(s)}},u.prototype.event_map=function(){return null},u.spec={type:"shape",containable:!1,description:"Abstract Shape",dependencies:{},properties:[o,a]},u}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(57),n(58),n(61)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype._wrap=function(t,e,n,r,i,o){var s,a,u,c,p,h,l,f,d;for(l=e.split(" "),a="",s=f=0,d=l.length;d>f;s=++f)h=l[s],c=a+h+" ",u=t.measureText(c),p=u.width,p>i&&s>0?(t.fillText(a,n,r),a=h+" ",r+=o):a=c;return t.fillText(a,n,r)},i.prototype.shape=function(t){return this._wrap(t,this.get("text"),this.get("x"),this.get("y"),this.get("w"),10),t.font=this.get("font")},i.spec={type:"text",containable:!1,description:"Text Box",dependencies:{},properties:[e,n,r,{text:{type:"string","default":""}}]},i}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(11),n(25),n(62),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){return{x:(this.get("x1")+this.get("x2"))/2,y:(this.get("y1")+this.get("y2"))/2}},e.prototype.shape=function(t){return t.moveTo(this.get("x1"),this.get("y1")),t.lineTo(this.get("x2"),this.get("y2"))},e.prototype.handles=function(){return["p2p-handle"]},e.prototype.positions=function(){return[["x1","y1"],["x2","y2"]]},e.prototype.dockPoints=function(){return[[this.get("x1"),this.get("y1")],[this.get("x2"),this.get("y2")]]},e.prototype.event_map=function(){},e.spec={type:"line",containable:!1,description:"Direct Line",dependencies:{"p2p-handle":n},properties:[r,i]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(12),n(49)],i=function(t,e,n,r){"use strict";var i,o;return o={debug:function(t,e){var n,i;return n=function(t){return function(){return t.debug_layer||(t.debug_layer?void 0:t.debug_layer=t.select("debug-layer")[0])}}(this),i=function(t){return function(){return t.debug_text||(t.debug_text?void 0:t.debug_text=t.select("text",n())[0])}}(this),i().set("text",t+":"+r(e)),n().draw()}},i=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.spec={type:"debug-layer",containable:!0,container_type:"layer",description:"Debug Layer",dependencies:{text:n},properties:[e],components:[{type:"text",name:"debug-text",attrs:{text:"",x:0,y:20,w:300,h:300,capturable:!1}}],exports:o},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(3),n(50),n(63),n(51),n(52)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.clearCanvas=function(){return this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)},e.prototype._draw=function(){var t,e,n;return t=this.canvas.getContext("2d"),t.clearRect(0,0,this.canvas.width,this.canvas.height),t.save(),e=this.get("offset-x"),n=this.get("offset-y"),t.translate(e,n),this.forEach(function(e){return e.draw(t)}),t.restore()},e.prototype.draw=function(){return this._draw()},e.prototype.shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},e.prototype.capture=function(t){var e,n,r,i,o,s,a;if(r=this.canvas.getContext("2d"),r.beginPath(),o={x:t.x-this.get("offset-x")-this.get("x"),y:t.y-this.get("offset-y")-this.get("y")},this.shape(r),this.size()>0)for(i=s=a=this.size()-1;0>=a?0>=s:s>=0;i=0>=a?++s:--s)if(n=this.getAt(i),e=n.capture(o,r))return e;return null},e.prototype.init=function(){var t;return this.pender=new i(this,this._draw),t=this.controller.options.attrs,this.canvas=document.createElement("canvas"),this.canvas.setAttribute("width",this.get("w")||t.w),this.canvas.setAttribute("height",this.get("h")||t.h),this.canvas.style.display=this.get("visible")!==!1?"block":"none",this.canvas.style.padding=0,this.canvas.style.margin=0,this.canvas.style.border=0,this.canvas.style.background="transparent",this.canvas.style.position="absolute",this.canvas.style.top=this.get("y")+"px",this.canvas.style.left=this.get("x")+"px",this.html_container=this.controller.getStage().html_container,this.html_container.appendChild(this.canvas)},e.prototype.setup=function(){return this.draw()},e.prototype.event_map=function(){return r},e.prototype.dispose=function(){return this.html_container.removeChild(this.canvas),this.controller=null,this.pender.dispose()},e.spec={type:"layer",containable:!0,container_type:"layer",description:"Abstract Layer",dependencies:{},properties:[n]},e}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(58),n(53),n(5)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.setup=function(){var t;return this.target=this.select(this.get("magnify-target"))[0],this.magnify_edge=this.select("#magnify-edge")[0],t=this.get("r"),this.set({w:2*t,h:2*t,x:this.target.canvas.width/2-t,y:this.target.canvas.height/2-t}),this.canvas.setAttribute("width",2*t),this.canvas.setAttribute("height",2*t),this.magnify_edge.set({cx:t,cy:t,r:t-5}),o.__super__.setup.call(this)},o.prototype._draw=function(){var t,e,n,r,i,o,s,a,u,c,p,h,l,f,d,g,y,_,v;return this.clearCanvas(),t=this.canvas.getContext("2d"),t.save(),t.beginPath(),c=this.get("r"),p=this.get("ratio"),t.arc(c,c,c-1,0,2*Math.PI,!1),t.clip(),t.rect(0,0,2*c,2*c),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),f=this.get("x")-this.target.get("x")+c,d=this.get("y")-this.target.get("y")+c,l=Math.round(c/p),h=l,o=f-l,s=d-h,i=2*l,r=2*h,_=0,v=0,y=2*c,g=2*c,0>o&&(_+=Math.round(-o*p),y-=_,i-=-o,o=0),0>s&&(v+=Math.round(-s*p),g-=v,r-=-s,s=0),a=this.target.canvas.width,n=o+i-a,n>0&&(i-=n,y-=Math.round(n*p)),u=this.target.canvas.height,e=s+r-u,e>0&&(r-=e,g-=Math.round(e*p)),t.drawImage(this.target.canvas,o,s,i,r,_,v,y,g),t.restore(),this.forEach(function(e){return e.draw(t)})},o.prototype.event_map=function(){return[r]},o.spec={type:"magnify-layer",containable:!0,container_type:"layer",description:"Magnify Layer",dependencies:{circle:i},properties:[e,n],components:[{type:"circle",attrs:{id:"magnify-edge",cx:100,cy:100,r:95,lineWidth:10,strokeStyle:"black",capturable:!0,draggable:!0}},{type:"circle",attrs:{id:"magnify-handle",cx:180,cy:180,r:16,lineWidth:8,strokeStyle:"black",fillStyle:"red",capturable:!0,draggable:!0}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(10),n(63)],i=function(t,e,n){"use strict";var r;return r=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.prototype.setup=function(){var t;return this.target=this.select(this.get("target"))[0],t=this.select("ruler",this),this.hori=t[0],this.vert=t[1],this.hori.set({w:this.target.canvas.width,h:20}),this.vert.set({w:20,h:this.target.canvas.height}),this.set({x:this.target.get("x"),y:this.target.get("y")}),r.__super__.setup.call(this)},r.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{"(self)":{change:this.onselfchange}}}},r.prototype.onchange=function(t,e,n){var r;return n.hasOwnProperty("offset-x")&&this.hori.set("zeropos",n["offset-x"]),n.hasOwnProperty("offset-y")&&this.vert.set("zeropos",n["offset-y"]),r=_.pick(n,["x","y","w","h"]),_.isEmpty(r)||this.set(r),this.draw()},r.prototype.onselfchange=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),this.draw()},r.spec={type:"ruler-layer",containable:!0,container_type:"layer",description:"Ruler Layer",dependencies:{ruler:e},properties:[n,{target:{type:"string"}}],components:[{type:"ruler",attrs:{direction:"horizontal",margin:[20,0],opacity:.8,x:0,y:0,zeropos:20,strokeStyle:"navy",lineWidth:1}},{type:"ruler",attrs:{direction:"vertical",margin:[20,0],opacity:.8,x:0,y:0,zeropos:20,strokeStyle:"navy",lineWidth:1}}]},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(55),n(22),n(23),n(25)],i=function(t,e,n,r,i,o){"use strict";var a,u;return u=function(t,e,n){var r,i,o;return i=t.getContainer(),i.canvas||u(i,e,!0),n?(o=t.get("rotate")||0,r=t.center(),e.translate(r.x,r.y),e.rotate(o*Math.PI/180),e.translate(-r.x,-r.y),e.translate(t.get("x"),t.get("y"))):void 0},a=function(t){function a(){return a.__super__.constructor.apply(this,arguments)}return s(a,t),a.prototype.capture=function(t){var e,n,r,i,o,s,a;if(r=this.canvas.getContext("2d"),r.beginPath(),o={x:t.x-this.get("offset-x")-this.get("x"),y:t.y-this.get("offset-y")-this.get("y")},this.shape(r),this.size()>0)for(i=s=a=this.size()-1;0>=a?0>=s:s>=0;i=0>=a?++s:--s)if(n=this.getAt(i),e=n.capture(o,r))return e;return null},a.prototype.setup=function(){var t;return this.selections=[],this.target=this.select(this.get("target"))[0],t={"offset-x":this.get("offset-x")||this.target.get("offset-x"),"offset-y":this.get("offset-y")||this.target.get("offset-y"),x:this.get("x")||this.target.get("x"),y:this.get("y")||this.target.get("y")},this.set(t),a.__super__.setup.call(this)},a.prototype._draw=function(){var t,e,n,r,i;if(this.clearCanvas(),t=this.canvas.getContext("2d"),t.save(),t.translate(this.get("offset-x"),this.get("offset-y")),t.globalAlpha=.4,this.selections.length>0){for(t.save(),this.offset&&t.translate(this.offset.x,this.offset.y),i=this.selections,n=0,r=i.length;r>n;n++)e=i[n],t.save(),u(e,t),e.draw(t),t.restore();t.restore()}return t.globalAlpha=1,this.focus&&this.forEach(function(e){return e.draw(t)}),t.restore()},a.prototype.buildHandles=function(){var t,e,n,r,i;for(r=this.focus.handles(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(this.build({type:t,attrs:{target:"#"+this.focus.get("id")}}));return i},a.prototype.setFocus=function(t){return this.focus!==t&&(this.removeAll(),this.focus=t,this.focus)?(this.buildHandles(),this.draw()):void 0},a.prototype.event_map=function(){return[n]},a.spec={type:"selection-layer",containable:!0,container_type:"layer",description:"Selection Layer",dependencies:{"bound-handle":r,"circle-handle":i,"p2p-handle":o},properties:[e,{target:{type:"string"}}]},a}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(54),n(5)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.slide_handle=this.select("#slide-handle")[0],this.slide_handle.set({cx:this.canvas.width/2-this.get("offset-x"),cy:this.canvas.height/2-this.get("offset-y")}),i.__super__.setup.call(this)},i.prototype._draw=function(){var t,e;return this.clearCanvas(),t=this.canvas.getContext("2d"),e={x:this.get("offset-x"),y:this.get("offset-y")},t.translate(e.x,e.y),t.globalAlpha=.5,this.outline_target&&(this.offset&&t.translate(this.offset.x,this.offset.y),this.outline_target.draw(t),this.offset&&t.translate(-this.offset.x,-this.offset.y)),t.globalAlpha=1,this.forEach(function(e){return e.draw(t)}),t.translate(-e.x,-e.y)},i.prototype.event_map=function(){return[n]},i.spec={type:"slide-layer",containable:!0,container_type:"layer",description:"Slide Layer",dependencies:{circle:r},properties:[e],components:[{type:"circle",attrs:{id:"slide-handle",cx:100,cy:100,r:20,lineWidth:5,strokeStyle:"red",fillStyle:"black",capturable:!0,draggable:!0}}]},i
3
- }(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(51),n(63)],i=function(t,e,n){"use strict";var r;return r=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.prototype.setup=function(){var t,e,n,i,o;for(r.__super__.setup.call(this),e=this.controller.options.widgets,o=[],n=0,i=e.length;i>n;n++)t=e[n],o.push(this.build(t,this));return o},r.prototype.event_map=function(){return[e]},r.spec={type:"widget-layer",containable:!0,container_type:"layer",description:"Widgets Layer",dependencies:{},properties:[n]},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(3),n(47),n(50),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.include(e),o.include(n),o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.prototype.positions=function(){return[["x","y"]]},o.prototype.move=function(t){var e,n,r,i,o,s;if(e=t.delta,!_.isEmpty(e)){for(r={},s=this.positions(),i=0,o=s.length;o>i;i++)n=s[i],e.x&&(r[n[0]]=Math.round(this.get(n[0])+e.x)),e.y&&(r[n[1]]=Math.round(this.get(n[1])+e.y));return this.set(r)}},o.prototype.event_map=null,o.spec={type:"group",containable:!0,container_type:"group",description:"Group",dependencies:{},properties:[r,i,{clip:{type:"boolean","default":!0}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n,r,i,o,a,u,c,p;return c=-1,a=0,n=1,o=-1,i=0,u=1,p=[[o,c],[i,c],[u,c],[o,a],[u,a],[o,n],[i,n],[u,n]],r=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r;return r=Math.round(this.target.get("w")/2),n=Math.round(this.target.get("h")/2),t=Math.round(this.target.get("x")+r),e=Math.round(this.target.get("y")+n),this.forEach(function(i){var o;return o=i.get("index"),i.set({x:t+p[o][0]*r,y:e+p[o][1]*n})})},n.prototype.setup=function(){var t,e,n,r;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],t=n=0,r=p.length;r>n;t=++n)e=p[t],this.build({type:"handle",attrs:{r:8,strokeStyle:"red",lineWidth:2,capturable:!1,fillStyle:"black",index:t,draggable:!0}});return this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i;return n=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},r=n.get("index"),i={w:this.target.get("w")+e.x*p[r][0],h:this.target.get("h")+e.y*p[r][1]},p[r][0]===o&&(i.x=this.target.get("x")+e.x),p[r][1]===c&&(i.y=this.target.get("y")+e.y),this.target.set(i),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"bound-handle",containable:!0,description:"Bound Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r;return n=this.target.get("r"),t=this.target.get("cx"),e=this.target.get("cy"),r=this.get("theta")||0,this.handle.set({x:t+Math.round(Math.cos(r)*n),y:e+Math.round(Math.sin(r)*n)})},n.prototype.setup=function(){return this.set("clip",!1),this.set("theta",0),this.target=this.select(this.get("target"))[0],this.handle=this.build({type:"handle",attrs:{r:8,index:0,strokeStyle:"red",fillStyle:"black",lineWidth:1,draggable:!0}}),this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s,a;return i=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},o=i.get("x")+e.x,s=i.get("y")+e.y,i.set({x:o,y:s}),n=o-this.target.get("cx"),r=s-this.target.get("cy"),this.set({theta:Math.atan2(r,n)}),a=Math.round(Math.sqrt(n*n+r*r)),this.target.set({r:a}),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"circle-handle",containable:!0,description:"Circle Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(2),n(48)],i=function(t,e){"use strict";var n,r;return r=function(t,e,n){var i,o,s;return o=t.getContainer(),o.canvas||r(o,e,!0),n?(s=t.get("rotate")||0,i=t.center(),e.translate(i.x,i.y),e.rotate(s*Math.PI/180),e.translate(-i.x,-i.y),e.translate(t.get("x"),t.get("y"))):void 0},n=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,t),n.include(e),n.prototype.center=function(){return{x:this.get("x"),y:this.get("y")}},n.prototype.shape=function(t){var e,n,i;return i=this.getContainer().target,t.save(),r(i,t),e=i.center(),n=i.get("rotate"),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),t.arc(this.get("x"),this.get("y"),this.get("r"),0,2*Math.PI,!1),t.restore()},n.prototype.event_map=function(){return[]},n.spec={type:"handle",containable:!1,description:"Base Handle",dependencies:{},properties:[{x:{type:"number"},y:{type:"number"},r:{type:"number"},index:{type:"string"}}]},n}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t;return t=[[this.target.get("x1"),this.target.get("y1")],[this.target.get("x2"),this.target.get("y2")]],this.forEach(function(e){var n;return n=e.get("index"),e.set({x:t[n][0],y:t[n][1]})})},n.prototype.setup=function(){var t,e;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],t=e=0;1>=e;t=++e)this.build({type:"handle",attrs:{r:8,index:t,strokeStyle:"red",fillStyle:"black",lineWidth:2,draggable:!0}});return this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s;switch(n=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},i=n.get("x")+e.x,o=n.get("y")+e.y,n.set({x:i,y:o}),r=n.get("index")){case 0:s={x1:this.target.get("x1")+e.x,y1:this.target.get("y1")+e.y};break;case 1:s={x2:this.target.get("x2")+e.x,y2:this.target.get("y2")+e.y}}return this.target.set(s),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"p2p-handle",containable:!0,description:"Point-to-Point Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(43),n(24),n(21)],i=function(t,e,n){"use strict";var r;return r=function(n){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,n),r.prototype.align=function(){var t;return t=this.target.get("path"),this.forEach(function(e){var n;return n=e.get("index"),e.set({x:t[n][0],y:t[n][1]})})},r.prototype.setup=function(){var t,e,n,r;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],e=this.target.get("path"),t=n=0,r=e.length-1;r>=0?r>=n:n>=r;t=r>=0?++n:--n)this.build({type:"handle",attrs:{r:8,index:t,strokeStyle:"red",fillStyle:"black",lineWidth:2,draggable:!0}});return this.align()},r.prototype.onchange=function(){return this.align(),this.draw()},r.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},r.prototype.ondrag=function(e){var n,r,i,o,s,a;return r=e.target,n={x:e.offsetX-this.startpos.x,y:e.offsetY-this.startpos.y},o=r.get("x")+n.x,s=r.get("y")+n.y,r.set({x:o,y:s}),i=r.get("index"),a=t.clone(this.target.get("path")),a[i][0]+=n.x,a[i][1]+=n.y,this.target.set("path",a),this.startpos={x:e.offsetX,y:e.offsetY}},r.prototype.ondragend=function(){},r.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},r.spec={type:"path-handle",containable:!0,description:"Path Handle",dependencies:{handle:e},properties:[{target:{type:"string"}}]},r}(n)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r,i,o,s,a;return s=this.target.get("x"),a=this.target.get("y"),o=this.target.get("w"),n=this.target.get("h"),i=Math.round(o/2),r=Math.round(n/2),t=Math.round(s+o/2),e=Math.round(a-20),this.handle.set({x:t,y:e})},n.prototype.setup=function(){return this.set("clip",!1),this.target=this.select(this.get("target"))[0],this.handle=this.build({type:"handle",attrs:{r:8,draggable:!0,strokeStyle:"red",fillStyle:"black",lineWidth:1}}),this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s,a,u,c,p,h;return r=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},i=r.get("index"),p=this.target.get("x"),h=this.target.get("y"),c=this.target.get("w"),n=this.target.get("h"),o=Math.round(p+c/2),s=Math.round(h+n/2),u=Math.atan2(t.offsetY-s,t.offsetX-o),u-=Math.atan2(this.startpos.y-s,this.startpos.x-o),a=this.target.get("rotate")||0,this.target.set({rotate:a+180*u/Math.PI}),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"rotation-handle",containable:!0,description:"Rotation Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(30),n(3),n(64)],i=function(t,e,n){"use strict";var r;return r=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,e),r.prototype.draw=function(){return this.forEach(function(t){return t.draw})},r.prototype.init=function(){return this.client_container=document.getElementById(this.get("container")),this.client_container.innerHTML="",this.html_container=document.createElement("div"),this.html_container.style.position="relative",this.html_container.style.display="inline-block",this.client_container.appendChild(this.html_container)},r.prototype.dispose=function(){return this.client_container.removeChild(this.html_container),this.controller.dispose()},r.prototype.capture=function(t){var e,n,r,i,o;if(this.size()>0)for(r=i=o=this.size()-1;0>=o?0>=i:i>=0;r=0>=o?++i:--i)if(n=this.getAt(r),e=n.capture(t))return e;return this},r.prototype.position=function(){return this.html_container.getBoundingClientRect?this.html_container.getBoundingClientRect():{top:0,left:0}},r.prototype.point=function(e){var n,r,i,o,s,a;return e?(i=this.position(),s=null,a=null,void 0!==e.touches?e.touches.length>0&&(o=e.touches[0],s=o.clientX-i.left,a=o.clientY-i.top):(n=0,r=0,"CANVAS"===e.target.tagName&&(n=e.target.offsetLeft,r=e.target.offsetTop),void 0!==e.offsetX?(s=e.offsetX+n,a=e.offsetY+r):"mozilla"===t.UA.browser?(s=e.layerX+n,a=e.layerY+r):void 0!==e.clientX&&i&&(s=e.clientX-i.left+n,a=e.clientY-i.top+r)),null!==s&&null!==a&&(this.point_pos={x:s,y:a}),this.point_pos):this.point_pos},r.spec={type:"stage",containable:!0,container_type:"stage",description:"Abstract Stage",dependencies:{},properties:[n]},r}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(28),n(64),n(20),n(14),n(19),n(18),n(16),n(17),n(56)],i=function(t,e,n,r,i,o,a,u,c){"use strict";var p;return p=function(t){function p(){return p.__super__.constructor.apply(this,arguments)}return s(p,t),p.prototype.event_map=function(){return[c]},p.spec={type:"widget-box",description:"Widget Drawing Box",containable:!0,container_type:"stage",dependencies:{"widget-layer":n,"debug-layer":r,"slide-layer":i,"selection-layer":o,"magnify-layer":a,"ruler-layer":u},properties:[e],components:[{type:"widget-layer",attrs:{"offset-x":-50,"offset-y":-50,x:100,y:100}},{type:"ruler-layer",attrs:{target:"widget-layer"}},{type:"selection-layer",attrs:{target:"widget-layer"}},{type:"magnify-layer",attrs:{"magnify-target":"widget-layer",fillStyle:"white",strokeStyle:"gray",r:100,ratio:2}},{type:"slide-layer",attrs:{"slide-target":"widget-layer"}},{type:"debug-layer"}]},p}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){var t;return t={version:"@@version",listenClickTap:!1,inDblClickWindow:!1,enableTrace:!1,traceArrMax:100,dblClickWindow:400,pixelRatio:void 0,dragDistance:0,angleDeg:!0,showWarnings:!0,Filters:{},isDragging:function(){var t;return t=things.DD,t?t.isDragging:!1},isDragReady:function(){var t;return t=things.DD,t?!!t.node:!1},_parseUA:function(t){var e,n,r,i;return i=t.toLowerCase(),n=/(chrome)[ \/]([\w.]+)/.exec(i)||/(webkit)[ \/]([\w.]+)/.exec(i)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(i)||/(msie) ([\w.]+)/.exec(i)||i.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(i)||[],r=!!t.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),e=!!t.match(/IEMobile/i),{browser:n[1]||"",version:n[2]||"0",mobile:r,ieMobile:e}},UA:void 0},t.UA=t._parseUA(navigator&&navigator.userAgent||""),console.log("UA",t.UA),t}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(43)],i=function(t){"use strict";var e;return e=function(){function e(){this.componentSpecs={}}return e.prototype.dispose=function(){var t,e,n,r,i;for(t=Object.keys(this.componentSpecs),i=[],n=0,r=t.length;r>n;n++)e=t[n],i.push(this.unregister(e));return i},e.prototype.setRegisterCallback=function(t,e){return this.callback_register="function"==typeof t?t.bind(e):void 0},e.prototype.setUnregisterCallback=function(t,e){return this.callback_unregister="function"==typeof t?t.bind(e):void 0},e.prototype.register=function(e){var n,r,i,o,s,a,u,c;if(!this.componentSpecs[e.spec.type]){if(e.spec.dependencies){u=e.spec.dependencies;for(i in u)n=u[i],this.register(n)}if(e.spec.properties instanceof Array){for(o={},c=e.spec.properties,s=0,a=c.length;a>s;s++)r=c[s],t.merge(o,r);e.spec.properties=o}return this.componentSpecs[e.spec.type]=e,this.callback_register?this.callback_register(e.spec):void 0}},e.prototype.unregister=function(t){var e;return(e=this.componentSpecs[t])?(delete this.componentSpecs[t],this.callback_unregister&&this.callback_unregister(e),e):void 0},e.prototype.forEach=function(t,e){var n,r,i,s;i=this.componentSpecs,s=[];for(n in i)o.call(i,n)&&(r=i[n],s.push(t.call(e,n,r)));return s},e.prototype.list=function(){return Object.keys(this.componentSpecs).map(function(t){return this.componentSpecs[t]},this)},e.prototype.get=function(e){var n;return n=this.componentSpecs[e],n?t.clone(this.componentSpecs[e]):null},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(2),n(3)],i=function(t,e){"use strict";var n,r,i,o,s,a,u;return r=function(t,e){return t.substr(1)===e.get("id")},i=function(t,e){return t.substr(1)===e.get("name")},o=function(t,e,n,r){switch(t){case"(all)":return!0;case"(self)":return n===e;case"(root)":return r===e;default:return!1}},s=function(t,e){return"all"===t||t===e.type},n=function(t,e,n,a){if("(all)"===t)return!0;switch(t.charAt(0)){case"#":return r(t,e,n,a);case".":return i(t,e,n,a);case"(":return o(t,e,n,a);default:return s(t,e,n,a)}},u=function(t,n,r,i,o,s){return t(n,r,i,o)&&s.push(r),r instanceof e&&r.forEach(function(e){return u(t,n,e,i,o,s)}),s},a=function(t,e,n){var a;return"(root)"===t?[e]:"(self)"===t?[n]:(a=function(){switch(t.charAt(0)){case"#":return r;case".":return i;case"(":return o;default:return s}}(),u(a,t,e,n,e,[]))},{select:a,match:n}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(43)],i=function(t){"use strict";var e;return e=function(){function e(t,e){this.componentRegistry=t,this.controller=e}return e.prototype.dispose=function(){return this.componentRegistry=null,this.controller=null},e.prototype.build=function(t,e){var n;return n=this.createModel(t),e&&e.add(n),this.setupDescendant(n,t.components),n.setup&&n.setup(t),n},e.prototype.createModel=function(e){var n,r,i,o,s;if(e.dependencies){s=e.dependencies;for(i in s)r=s[i],this.componentRegistry.register(r)}if(o=this.componentRegistry.get(e.type),!o)throw new Error("module ("+e.type+") is not registered yet.");return e.attrs||(e.attrs={}),e.attrs.hasOwnProperty("id")||(e.attrs.id=t.uniqueId()),n=new o(e.type).initialize(e.attrs,o.spec.properties),n.setController(this.controller),n.init&&n.init(e),n},e.prototype.setupDescendant=function(t,e){var n,r,i,o,s,a,u,c;if(r=this.componentRegistry.get(t.type),i=r.spec,i.components)for(c=i.components,o=0,a=c.length;a>o;o++)n=c[o],this.build(n,t);if(e)for(s=0,u=e.length;u>s;s++)n=e[s],this.build(n,t);return t},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(43),n(66),n(32)],i=function(t,e,n){"use strict";var r;return r=function(){function r(t){this.eventMaps=[],this.setRoot(t)}return r.prototype.setRoot=function(t){return this.root=t},r.prototype.stop=function(){var t,e,n,r,i;for(r=this.eventMaps,i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(t.eventPump.stop());return i},r.prototype.add=function(t,r,i){var s,a,u,c,p,h,l,f,d,g,y;if(this.root){if(!(r instanceof Array))return void this.add(t,[r],i);for(y=[],d=0,g=r.length;g>d;d++)a=r[d],y.push(function(){var r;r=[];for(c in a)if(o.call(a,c)){if(u=a[c],0===c.indexOf("?")){if(f=c.substr(1),l=t.get(f),!l){console.log("EventEngine#add","variable "+c+" is not evaluated on listener");continue}c=l}h=n.select(c,this.root,t),r.push(function(){var n,r,o;for(o=[],n=0,r=h.length;r>n;n++)p=h[n],s=new e(p),s.on(t,u),s.start(i),o.push(this.eventMaps.push({eventPump:s,listener:t,handlerMap:a,target:p}));return o}.call(this))}return r}.call(this));return y}},r.prototype.remove=function(e,n){var r,i,o,s,a,u;for(o=t.clone(this.eventMaps),u=[],r=s=0,a=o.length;a>s;r=++s)i=o[r],i.listener!==e||n&&i.handlerMap!==n?u.push(void 0):(this.eventMaps.splice(r,1),u.push(i.eventPump.dispose()));return u},r.prototype.clear=function(){var e,n,r,i;for(n=t.clone(this.eventMaps),r=0,i=n.length;i>r;r++)e=n[r],e.eventPump.dispose();return this.eventMaps=[]},r.prototype.dispose=function(){return this.stop(),this.clear()},r}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(67),n(68)],i=function(t,e){"use strict";var n,r,i,o,s,a,u;return i=function(n){var r;return r=this.stage.point(n),this.captured=this.stage.capture(r),this.click_target=this.captured,t.draggable=!0,e.mousedown(this.captured,n,r),n.preventDefault?n.preventDefault():void 0},u=function(n){var r,i,o;return i=this.stage.point(n),this.captured=this.stage.capture(i),r=!1,this.listening_dbl_click?(r=!0,this.listening_dbl_click=!1):this.listening_dbl_click=!0,o=this,setTimeout(function(){return o.listening_dbl_click=!1},500),this.captured&&!t.dragging&&(e.mouseup(this.captured,n,i),this.click_target&&this.captured===this.click_target&&(e.click(this.captured,n,i),r&&(e.doubleclick(this.captured,n,i),this.listening_dbl_click=!1))),this.click_target=null,n.preventDefault?n.preventDefault():void 0},a=function(n){var r,i,o,s,a;if("undefined"==typeof n.webkitMovementX&&"undefined"==typeof n.webkitMovementY||0!==n.webkitMovementY||0!==n.webkitMovementX){if(a=this.stage.point(n),i=this.captured,this.captured=this.stage.capture(a),!t.dragging&&(this.captured&&e.mousemove(this.captured,n,a),this.captured!==i)){if(o=[this.captured],this.captured)for(;r=(r||this.captured).getContainer();)o.unshift(r);if(s=[i],i)for(;r=(r||i).getContainer();)s.unshift(r);for(;s[0]===o[0];)s.shift(),o.shift();for(;r=s.pop();)e.mouseout(r,n,a);for(;r=o.shift();)e.mouseover(r,n,a)}return t.draggable&&this.captured&&t.drag(this.captured,n,a),n.preventDefault?n.preventDefault():void 0}},s=function(t){var n,r,i;if(!this.dragging){if(this.captured){for(i=this.stage.point(t),n=this.captured,r=[this.captured];n=n.getContainer();)r.unshift(n);for(;n=r.pop();)e.mouseout(n,t,i)}return this.captured=null}},o=function(){},r=function(t){var n;return t.preventDefault(),n=this.stage.point(t),this.captured=this.stage.capture(n),e.contextmenu(this.captured,t,n)},n=function(){function t(t){this.stage=t,this.onmousemove=a.bind(this),this.onmouseleave=s.bind(this),this.onmouseenter=o.bind(this),this.onmouseup=u.bind(this),this.onmousedown=i.bind(this),this.oncontextmenu=r.bind(this),this.stage.html_container.addEventListener("mousemove",this.onmousemove),this.stage.html_container.addEventListener("mouseleave",this.onmouseleave),this.stage.html_container.addEventListener("mouseenter",this.onmouseenter),this.stage.html_container.addEventListener("mouseup",this.onmouseup),this.stage.html_container.addEventListener("mousedown",this.onmousedown),this.stage.html_container.addEventListener("contextmenu",this.oncontextmenu)}return t.prototype.dispose=function(){return this.stage.html_container.removeEventListener("mousemove",this.onmousemove),this.stage.html_container.removeEventListener("mouseleave",this.onmouseleave),this.stage.html_container.removeEventListener("mouseenter",this.onmouseenter),this.stage.html_container.removeEventListener("mouseup",this.onmouseup),this.stage.html_container.removeEventListener("mousedown",this.onmousedown),this.stage.html_container.removeEventListener("contextmenu",this.oncontextmenu)},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(68),n(67)],i=function(t,e){"use strict";var n,r,i,o;return o=function(e){var n,r,i;return n=this.stage.point(e),i=this.stage.capture(n),this.tap_target=i,r=this,this.longtouch_triggered=!1,this.longtouch_timer=setTimeout(function(){return r.longtouch_timer=null,i&&t.longtouch(i,e,n),r.longtouch_triggered=!0},500),t.touchstart(i,e,n),e.preventDefault?e.preventDefault():void 0},r=function(n){var r,i,o,s;return i=this.stage.point(n),s=this.stage.capture(i),this.longtouch_timer&&(clearTimeout(this.longtouch_timer),this.longtouch_timer=null),r=!1,this.listening_dbl_click?(r=!0,this.listening_dbl_click=!1):this.listening_dbl_click=!0,o=this,setTimeout(function(){return o.listening_dbl_click=!1},500),s&&!e.dragging&&(t.touchend(s,n,i),this.tap_target&&s===this.tap_target&&(t.tap(s,n,i),r&&(t.doubletap(s,n,i),this.listening_dbl_click=!1))),this.tap_target=null,n.preventDefault?n.preventDefault():void 0},i=function(n){var r,i;if(r=this.stage.point(n),this.longtouch_timer&&e.dragging)clearTimeout(this.longtouch_timer),this.longtouch_timer=null;else if(this.longtouch_triggered)return void(n.preventDefault&&n.preventDefault());return i=this.stage.capture(r),!e.dragging&&i&&(t.touchmove(i,n,r),n.preventDefault&&n.preventDefault()),e.drag(i,n,r),n.preventDefault?n.preventDefault():void 0},n=function(){function t(t){this.stage=t,this.ontouchstart=o.bind(this),this.ontouchmove=i.bind(this),this.ontouchend=r.bind(this),this.stage.html_container.addEventListener("touchstart",this.ontouchstart),this.stage.html_container.addEventListener("touchmove",this.ontouchmove),this.stage.html_container.addEventListener("touchend",this.ontouchend)}return t.prototype.dispose=function(){return this.stage.html_container.removeEventListener("touchstart",this.ontouchstart),this.stage.html_container.removeEventListener("touchmove",this.ontouchmove),this.stage.html_container.removeEventListener("touchend",this.ontouchend)},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(){function t(t){this.binder=t,this.exports={}}return t.prototype.dispose=function(){var t,e,n,r,i;for(e=Object.keys(this.exports),i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(this.remove(t));return i},t.prototype["import"]=function(t,e,n){var r,i,o;if(e){o={};for(r in e)i=e[r],o[r]=i instanceof Function?i.bind(n||this.binder):i;return this.exports[t]=o}},t.prototype.remove=function(t){return delete this.exports[t]},t.prototype.require=function(t){return this.exports[t]},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=[],n=function(){"use strict";var t,e;return e=["extended","included"],t=function(){function t(){}return t.extend=function(t){var n,i,o;for(n in t)i=t[n],r.call(e,n)<0&&(console.log(n,i),this[n]=i);return null!=(o=t.extended)&&o.apply(this),this},t.include=function(t){var n,i,o;for(n in t)i=t[n],r.call(e,n)<0&&(this.prototype[n]=i);return null!=(o=t.included)&&o.apply(this),this},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(43)],i=function(t){"use strict";var e;return e={silentSet:function(e,n){var r,i,s,a;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return i={},i[e]=n,this.silentSet(i);this.attrs||(this.attrs={}),i=e,r={},s=t.clone(this.attrs),t.assign(this.attrs,i),a=this.attrs;for(e in a)o.call(a,e)&&(n=a[e],n!==s[e]?r[e]=n:delete s[e]);return this},set:function(e,n){var r,i,s,a;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return i={},i[e]=n,this.set(i);this.attrs||(this.attrs={}),i=e,r={},s=t.clone(this.attrs),t.assign(this.attrs,i),a=this.attrs;for(e in a)o.call(a,e)&&(n=a[e],n!==s[e]?r[e]=n:delete s[e]);return 0!==Object.keys(r).length&&this.trigger("change",this,s,r),this},get:function(t){var e;if(this.attrs&&this.attrs.hasOwnProperty(t))return this.attrs[t];if(this.property_spec)return e=this.property_spec[t],e?e["default"]:void 0},getAll:function(){return this.attrs?t.clone(this.attrs):{}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={initialize:function(t,e){return this.attrs=t,this.property_spec=e,this},dispose:function(){}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(43),n(69)],i=function(t,e){"use strict";var n,r,i,o,s,a,u,c;n={on:function(t,e,n){var r;return o(this,"on",t,[e,n])&&e?(this._listeners||(this._listeners={}),r=this._listeners[t]||(this._listeners[t]=[]),r.push({callback:e,context:n,ctx:n||this}),this):this},once:function(e,n,r){var i,s;return o(this,"once",e,[n,r])&&n?(s=this,i=t.once(function(){return s.off(e,i),n.apply(this,arguments)}),i._callback=n,this.on(e,i,r)):this},off:function(t,e,n){var r,i,s,a,u,c,p,h,l,f;if(!this._listeners||!o(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._listeners=void 0,this;for(u=t?[t]:Object.keys(this._listeners),s=p=0,l=u.length;l>p;s=++p)if(t=u[s],i=this._listeners[t]){if(this._listeners[t]=c=[],e||n)for(a=h=0,f=i.length;f>h;a=++h)r=i[a],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&c.push(r);c.length||delete this._listeners[t]}return this},delegate_on:function(t){return this._delegators||(this._delegators=new e.List),this._delegators.append(t),this},delegate_off:function(t){return this._delegators?(this._delegators.remove(t),this):this},delegate:function(){var t,e,n;return this._delegators&&this._delegators.size()>0&&r(this._delegators,arguments),this._listeners?(t=arguments[arguments.length-1],t.deliverer=this,e=this._listeners[t.name],n=this._listeners.all,e&&c(e,arguments),n&&c(n,arguments),this):this},trigger:function(t){var e,n,i;return e=[].slice.call(arguments,1),e.push({origin:this,name:t,deliverer:this}),this._delegators&&this._delegators.size()>0&&r(this._delegators,e),this._listeners&&o(this,"trigger",t,e)?(n=this._listeners[t],i=this._listeners.all,n&&c(n,e),i&&c(i,e),this):this},stopListening:function(e,n,r){var i,o,s;if(o=this._listeningTo,!o)return this;s=!n&&!r,r||"object"!=typeof n||(r=this),e&&((o={})[e._listenId]=e);for(i in o)e=o[i],e.off(n,r,this),(s||t.isEmpty(e._events))&&delete this._listeningTo[i];return this}},i=/\s+/,o=function(t,e,n,r){var o,s,a,u,c;if(!n)return!0;if("object"==typeof n){for(o in n)a=n[o],t[e].apply(t,[o,a].concat(r));return!1}if(i.test(n)){for(s=n.split(i),u=0,c=s.length;c>u;u++)a=s[u],t[e].apply(t,[a].concat(r));return!1}return!0},c=function(t,e){var n,r,i,o;for(o=[],r=0,i=t.length;i>r;r++)n=t[r],o.push(n.callback.apply(n.ctx,e));return o},r=function(t,e){return t.forEach(function(t){return n.delegate.apply(t,e)})},a={listenTo:"on",listenToOnce:"once"};for(u in a)s=a[u],n[u]=function(e,n,r){var i,o;return o=this._listeningTo||(this._listeningTo={}),i=e._listenId||(e._listenId=t.uniqueId("l")),o[i]=e,r||"object"!=typeof n||(r=this),e[s](n,r,this),this};return n}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={serialize:function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},deserialize:function(){}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(65)],i=function(t){"use strict";return t}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(70)],i=function(t){"use strict";var e;return e=function(){function e(){this.reset()}return e.prototype.dispose=function(){return this.reset()},e.prototype.execute=function(e){return!e instanceof t?void 0:(e.execute(),this.exq.push(e),this.uxq=[])},e.prototype.undo=function(){var t;return t=this.exq.pop(),t?(t.unexecute(),this.uxq.push(t)):void 0},e.prototype.redo=function(){var t;return t=this.uxq.pop(),t?(t.execute(),this.exq.push(t)):void 0
4
- },e.prototype.undoable=function(){return this.exq.length>0},e.prototype.redoable=function(){return this.uxq.length>0},e.prototype.reset=function(){return this.exq=[],this.uxq=[]},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e;return t=function(t,e){var n;if(e.event_map)return n=e.event_map(),this.eventEngine.add(e,n,e)},e=function(t,e){return this.eventEngine.remove(e)},{"(root)":{"(all)":{add:t,remove:e}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n,r;return t=function(t,e,n,r){return t.trigger("add",e,n,r)},e=function(t,e,n,r){return t.trigger("added",e,n,r)},n=function(t,e,n){return t.trigger("remove",e,n)},r=function(t,e,n){return t.trigger("removed",e,n)},{add:t,added:e,remove:n,removed:r}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={dockType:function(){},dockPoints:function(){var t,e,n,r;return n=this.get("x"),r=this.get("y"),e=this.get("w"),t=this.get("h"),[[n,r],[n+e,r],[n,r+t],[n+e,r+t]]}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={center:function(){return{x:this.get("x")+this.get("w")/2,y:this.get("y")+this.get("h")/2}},shape:function(){},capture_shape:function(t){return this.shape(t)},draw:function(t){var e,n;return t?(t.beginPath(),n=this.get("rotate")||0,e=this.center(),t.save(),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),this.shape(t),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),this.get("strokeStyle")&&(t.lineWidth=this.get("lineWidth"),t.strokeStyle=this.get("strokeStyle"),t.stroke()),t.restore()):this.getContainer().draw()},capture:function(t,e){var n,r,i;return e.beginPath(),i=this.get("rotate")||0,n=this.center(),e.save(),e.translate(n.x,n.y),e.rotate(i*Math.PI/180),e.translate(-n.x,-n.y),this.capture_shape(e),this.get("strokeStyle")&&(e.lineWidth=this.get("lineWidth")),r=!!this.get("strokeStyle")&&e.isPointInStroke(t.x,t.y)||!!this.get("fillStyle")&&e.isPointInPath(t.x,t.y),e.restore(),r?this:null}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(t,e,n){var r,i,o,s,a,u,c;if(e>2)return t;if("number"==typeof e||(e=0),"boolean"==typeof n||(n=!1),a=!1,c=function(t){var e,n,r,i;for(n="",e=r=0,i=t-1;i>=0?i>=r:r>=i;e=i>=0?++r:--r)return n+=" "},u="","undefined"==typeof t)u+="undefined";else if("boolean"==typeof t||"number"==typeof t)u+=t.toString();else if("string"==typeof t)u+='"'+t+'"';else if(null===t)u+="null";else if(t instanceof Array)if(t.length>0){n&&(a=!0),r="";for(o in t)i=t[o],r+=pp(i,e+1)+",\n"+c(e+1);r=r.replace(/,\n\s*$/,"").replace(/^\s*/,""),u+="[ "+r+"\n"+c(e)+"]"}else u+="[]";else if("object"==typeof t)if(Object.keys(t).length>0){n&&(a=!0),r="";for(s in t)r+=c(e+1)+s.toString()+": "+pp(t[s],e+2,!0)+",\n";r=r.replace(/,\n\s*$/,"").replace(/^\s*/,""),u+="{ "+r+"\n"+c(e)+"}"}else u+="{}";else u+=t.toString();return(a?"\n"+c(e):"")+u}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={center:function(){return{x:this.get("x")+this.get("w")/2,y:this.get("y")+this.get("h")/2}},shape:function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},draw:function(t){var e,n;return t?(t.beginPath(),n=this.get("rotate")||0,e=this.center(),t.save(),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),this.shape(t),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),this.get("strokeStyle")&&(t.lineWidth=this.get("lineWidth"),t.strokeStyle=this.get("strokeStyle"),t.stroke()),this.get("clip")&&t.clip(),t.translate(this.get("x"),this.get("y")),this.forEach(function(e){return e.draw(t)}),t.restore()):this.getContainer().draw()},capture:function(t,e){var n,r,i,o,s,a,u,c;if(e.beginPath(),r=this.center(),a=(this.get("rotate")||0)*Math.PI/180,e.save(),e.translate(r.x,r.y),e.rotate(a),e.translate(-r.x,-r.y),this.shape(e),e.lineWidth=this.get("lineWidth"),n=null,s=e.isPointInPath(t.x,t.y)||!!this.get("strokeStyle")&&e.isPointInStroke(t.x,t.y),(!this.get("clip")||s)&&this.size()>0)for(e.translate(this.get("x"),this.get("y")),o=u=c=this.size()-1;(0>=c?0>=u:u>=0)&&(i=this.getAt(o),!(n=i.capture(t,e)));o=0>=c?++u:--u);return e.restore(),n?n:this.get("capturable")===!1?null:s?this:null}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(){return this.draw()},{"(self)":{"(all)":{added:t,removed:t,change:t}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n,r=function(t,e){return function(){return t.apply(e,arguments)}};e=[],n=function(){"use strict";var t,e;return e=1,t=function(){function t(t,e){this.context=t,this.fn=e,this.dispose=r(this.dispose,this),this.flag=!1}return t.prototype.pend=function(){return this.flag?void 0:(this.flag=!0,setTimeout(function(t){return function(){return t.pended()}}(this),e))},t.prototype.pended=function(){return this.flag=!1,this.fn.call(this.context)},t.prototype.dispose=function(){return this.context=null,this.fn=null},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(43)],i=function(){"use strict";var t,e,n,r;return e={ondragstart:function(t){return this.handle_last_position={x:t.offsetX,y:t.offsetY}},ondrag:function(t){var e,n,r,i;return e={x:t.offsetX-this.handle_last_position.x,y:t.offsetY-this.handle_last_position.y},n=this.get("x")+e.x,r=this.get("y")+e.y,i={x:n,y:r},this.set(i),this.handle_last_position={x:t.offsetX,y:t.offsetY},this.draw()},ondragend:function(){return this.handle_last_position=null}},t={ondragstart:function(t){return this.edge_last_position={x:t.offsetX,y:t.offsetY},this.last_ratio=this.get("ratio")},ondrag:function(t){var e,n;return e=t.offsetY-this.edge_last_position.y,n=Math.min(Math.max(this.last_ratio+e/20,.5),4),this.set("ratio",n),this.draw()},ondragend:function(){return this.edge_last_position=null}},r=function(){return this.draw()},n=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),n.hasOwnProperty("r")?(this.set({w:2*n.r,h:2*n.r}),this.canvas.setAttribute("width",2*n.r),this.canvas.setAttribute("height",2*n.r)):void 0},{"?magnify-target":{"(all)":{change:r}},"(self)":{"(self)":{change:n},"#magnify-handle":{dragstart:e.ondragstart,drag:e.ondrag,dragend:e.ondragend},"#magnify-edge":{dragstart:t.ondragstart,drag:t.ondrag,dragend:t.ondragend}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n;return n=function(t){return this.slide_last_position={x:t.offsetX,y:t.offsetY}},t=function(t){var e,n;return e={x:t.offsetX-this.slide_last_position.x,y:t.offsetY-this.slide_last_position.y},this.slide_target=this.slide_target||this.select(this.get("slide-target"))[0],n={x:this.slide_target.get("offset-x"),y:this.slide_target.get("offset-y")},this.slide_target.set({"offset-x":n.x+e.x,"offset-y":n.y+e.y}),this.slide_handle.move({delta:e}),this.slide_last_position={x:t.offsetX,y:t.offsetY},this.draw()},e=function(){return this.slide_last_position=null,this.slide_handle.set({cx:this.canvas.width/2-this.get("offset-x"),cy:this.canvas.height/2-this.get("offset-y")}),this.draw()},{"(self)":{"#slide-handle":{dragstart:n,drag:t,dragend:e}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(43)],i=function(t){"use strict";var e,n,r,i,o,s,a,u,c;return c=function(e,n){return t.contains(e,n)?t.pull(e,n):e.unshift(n),e},a=function(e,n){return t.contains(e,n)?e:[n]},u=function(e,n){return t.contains(e,n)?e:(e.unshift(n),e)},o=function(t){return this.selections=t.origin.shiftKey?u(this.selections,t.target):a(this.selections,t.target),this.setFocus(this.selections[0]),this.draglast_position={x:t.offsetX,y:t.offsetY}},r=function(t){return this.offset={x:t.offsetX-this.draglast_position.x,y:t.offsetY-this.draglast_position.y},this.draw()},i=function(){var t,e,n,r;for(r=this.selections,e=0,n=r.length;n>e;e++)t=r[e],t.move&&t.move({delta:this.offset});return this.offset=null,this.draw()},n=function(t){return this.selections=t.origin.shiftKey?c(this.selections,t.target):a(this.selections,t.target),this.setFocus(this.selections[0]),this.draw()},e=function(e,n,r){var i;return i=t.pick(r,["offset-x","offset-y","x","y"]),t.isEmpty(i)?void 0:this.set(i)},s=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),this.draw()},{"?target":{"(all)":{click:n,tap:n,dragstart:o,drag:r,dragend:i},"?target":{change:e}},"(self)":{"(self)":{change:s}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(43),n(71)],i=function(t,e){"use strict";var n;return n=function(t){return e.show({x:t.origin.pageX,y:t.origin.pageY})},{"(root)":{"(all)":{contextmenu:n,longtouch:n}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={x:{type:"number","default":0},y:{type:"number","default":0},w:{type:"number"},h:{type:"number"},rotate:{type:"number","default":0}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={lineWidth:{type:"number"},fillStyle:{type:"string"},strokeStyle:{type:"string"},alpha:{type:"number"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={cx:{type:"number","default":0},cy:{type:"number","default":0},r:{type:"number","default":100}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={path:{type:"array"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={font:{type:"string","default":"normal 10px verdana"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={x1:{type:"number","default":0},y1:{type:"number","default":0},x2:{type:"number","default":100},y2:{type:"number","default":100}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(43),n(57)],i=function(t,e){"use strict";return t.merge({},e,{alpha:{type:"number","default":100},"offset-x":{type:"number","default":0},"offset-y":{type:"number","default":0}})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(43),n(57)],i=function(t,e){"use strict";return t.merge({},e,{alpha:{type:"number","default":100}})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(e){e.exports=t},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(43),n(32)],i=function(t,e){"use strict";var n,r,i;return r=function(t,n,r,i,s){var a,u,c,p,h;h=[];for(p in r)o.call(r,p)&&(a=r[p],e.match(p,i.origin,n,t)&&h.push(function(){var t;t=[];for(u in a)o.call(a,u)&&(c=a[u],u===i.name&&(i.listener=n,t.push(c.apply(this,s))));return t}.call(this)));return h},i=function(){var t,e,n,i,o,s,a,u;for(t=arguments,e=t[t.length-1],n=this.eventPump,a=n.listeners,u=[],o=0,s=a.length;s>o;o++)i=a[o],u.push(r.call(this.context,n.deliverer,i.listener,i.clonedHandlers,e,t));return u},n=function(){function t(t){this.setDeliverer(t),this.listeners=[]}return t.prototype.setDeliverer=function(t){return this.deliverer=t},t.prototype.start=function(t){return this.deliverer.on("all",i,{context:t||null,eventPump:this})},t.prototype.stop=function(){return this.deliverer.off("all",i)},t.prototype.on=function(t,e){var n,r,i,o,s,a,u,c;for(n=_.clone(e),o=Object.keys(n),u=0,c=o.length;c>u;u++)i=o[u],0===i.indexOf("?")&&(r=n[i],a=i.substr(1),s=t.get(a),delete n[i],s?n[s]=r:console.log("EventPump#on","variable "+i+" is not evaluated on listener"));return this.listeners.push({listener:t,handlers:e,clonedHandlers:n})},t.prototype.off=function(t,e){var n,r,i,o,s,a;for(s=this.listeners,a=[],n=i=0,o=s.length;o>i;n=++i)r=s[n],a.push(r.listener!==t||e&&r.handlers!==e?void 0:this.listeners.splice(n,1));return a},t.prototype.clear=function(){return this.listeners=[]},t.prototype.dispose=function(){return this.stop(),this.clear()},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(68)],i=function(t){var e,n,r;return r=function(){},n=function(n){var r,i;return e.dragging=!1,i=e.target,i&&(r=i.getStage().point(n),t.dragend(e.target,n,r)),delete e.target,e.cleanup()},e={draggable:!1,dragging:!1,target:null,drag_end_target:null,start_point:null,last_point:null,cutoff:4,cleanup:function(){return this.target=null,this.drag_end_target=null,this.start_point=null,this.last_point=null,this.dragging=!1,this.draggable=!1},drag:function(e,n,r){var i;if(this.start_point||(this.start_point=r),!this.dragging&&e.get("draggable")){if(void 0!==n.touches&&(i=Math.max(Math.abs(r.x-this.start_point.x),Math.abs(r.y-this.start_point.y)),i<this.cutoff))return;this.dragging=!0,this.target=e,t.dragstart(e,n,this.start_point)}return this.dragging?(this.last_point=r,t.drag(this.target,n,r)):void 0}},document.addEventListener("mouseup",r,!0),document.addEventListener("touchend",r,!0),document.addEventListener("mouseup",n,!1),document.addEventListener("touchend",n,!1),e}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(43)],i=function(t){"use strict";var e,n,r;return r=function(t,e,n,r){var i,o;return r||(o=t.getStage(),r=o.point(n)),i={origin:n,type:e,target:t,offsetX:r.x,offsetY:r.y},t.trigger(i.type,i)},e=function(t){return function(e,n,i){return r(e,t,n,i)}},n=["mousemove","mousedown","mouseup","click","doubleclick","contextmenu","mouseover","mouseout","dragstart","drag","dragend","touchstart","touchmove","touchend","longtouch","tap","doubletap"],t.reduce(n,function(t,n){return t[n]=e(n),t},{})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n,r={}.hasOwnProperty;e=[],n=function(){"use strict";var t,e,n,i,o;return i={insertAt:function(t,e){return this.__collection__?(t=this.__collection__.indexOf(e),-1===this.__collection__.indexOf(e)&&this.__collection__.splice(t,0,e),this):this},append:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.push(t),this},prepend:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.unshift(t),this},remove:function(t){var e;return this.__collection__?(e=this.__collection__.indexOf(t),e>-1&&this.__collection__.splice(e,1),this):this},getAt:function(t){return this.__collection__?this.__collection__[t]:void 0},forEach:function(t,e){return this.__collection__?this.__collection__.forEach(t,e):this},indexOf:function(t){return(this.__collection__||[]).indexOf(t)},size:function(){return(this.__collection__||[]).length},clear:function(){return this.__collection__=[]},moveForward:function(t){var e;return e=this.indexOf(t),-1!==e&&0!==e?(this.__collection__[e]=this.__collection__[e-1],this.__collection__[e-1]=t):void 0},moveBackward:function(t){var e;return e=this.indexOf(t),-1!==e&&e!==this.size()-1?(this.__collection__[e]=this.__collection__[e+1],this.__collection__[e+1]=t):void 0},moveToHead:function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&0!==n?(e=this.__collection__.splice(0,n),r=this.__collection__.splice(1),this.__collection__=this.__collection__.concat(e,r)):void 0},moveToTail:function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&n!==this.size()-1?(e=this.__collection__.splice(0,n),r=this.__collection__.splice(1),this.__collection__=e.concat(r,this.__collection__)):void 0}},o={push:function(){throw new Error("Not Implemented Yet")},pop:function(){throw new Error("Not Implemented Yet")}},e=function(){},e.prototype=i,n=function(){},n.prototype=o,t={List:e,Stack:n,withList:function(){var t,e,n;n=[];for(t in i)r.call(i,t)&&(e=i[t],n.push(this[t]=e));return n},withStack:function(){var t,e,n;n=[];for(t in o)r.call(o,t)&&(e=o[t],n.push(this[t]=e));return n}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(43)],i=function(t){"use strict";var e;return e=function(){function e(e){this.params=t.clone(e)}return e.prototype.execute=function(){},e.prototype.unexecute=function(){},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n,r,i,o;return o='<ul id="context-menu" class="things-context-menu"> <li><a href="http://cooking.hatiolab.com/">Cooking</a></li> <li><a href="http://www.naver.com">Naver</a></li> </ul>',t=document.createElement("div"),t.style.position="absolute",t.style.display="inline-block",t.style.zIndex=1e3,document.body.appendChild(t),t.innerHTML=o,e=document.getElementById("context-menu"),n=function(){return document.removeEventListener("click",n),document.removeEventListener("touchstart",n),setTimeout(r,100)},i=function(r){return t.style.top=r.y+"px",t.style.left=r.x+"px",e.style.display="block",document.addEventListener("click",n),document.addEventListener("touchstart",n)},r=function(){return e.style.display="none"},{show:i,hide:r}}.apply(null,e),!(void 0!==n&&(t.exports=n))}])});
1
+ /*! Things v0.0.4 | (c) Hatio, Lab. | MIT License */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("_")):"function"==typeof define&&define.amd?define(["_"],e):"object"==typeof exports?exports.things=e(require("_")):t.things=e(t._)}(this,function(t){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){var r,i;r=[n(1),n(2),n(3),n(4),n(5),n(6),n(7),n(8),n(9),n(10),n(11),n(12),n(13),n(14),n(15),n(16),n(17),n(18),n(19),n(20),n(21),n(22),n(23),n(24),n(25),n(26),n(27),n(28),n(29)],i=function(t,e,n,r,i,o,s,a,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k,P,M,S,O,E){"use strict";var C;return C=[],{create:function(e){var n;return n=new t(e).getStage(),C.push(n),n},destroy:function(t){var e;return e=C.indexOf(t),e>-1&&C.splice(e,1),t.dispose()},stages:function(){return C},Component:e,Container:n,shape:{Barcode:r,Circle:i,Ellipse:o,ImageBox:s,Path:a,Rect:u,Ruler:c,Shape:p,Text:h,Line:l},layer:{DebugLayer:f,Layer:d,MagnifyLayer:g,RulerLayer:y,SelectionLayer:_,SlideLayer:v,WidgetLayer:m},group:{Group:x},handle:{BoundHandle:b,CircleHandle:w,Handle:k,P2PHandle:P,PathHandle:M,RotationHandle:S},stage:{Stage:O,WidgetBox:E}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(39),n(30),n(2),n(31),n(32),n(33),n(34),n(35),n(36),n(37),n(40),n(41)],i=function(t,e,n,r,i,o,s,a,u,c,p,h){"use strict";var l;return n.include({setController:function(t){return this.controller=t},getController:function(){return this.controller},getStage:function(){return this.controller.getStage()},setSpec:function(t){return this.spec=t},getSpec:function(){return this.spec},build:function(t,e){return this.controller.build(t,e||this)},require:function(t){if(!this.controller)throw new Error("controller not initialized");return this.controller.require(t)},select:function(t,e){if(!this.controller)throw new Error("controller not initialized");return this.controller.select(t,e)},abs:function(t){var e,n;return n=this.get(t)||0,e=this.getContainer(),e&&(n+=e.abs(t)||0),n},debug:function(t,e){return this.require("debug-layer").debug(t,e)}}),l=function(){function n(n){this.options=t.clone(n),this.exports={},this.exportsManager=new c(this),this.commandManager=new p,this.componentRegistry=new r,this.componentRegistry.setRegisterCallback(function(t){return this.exportsManager["import"](t.type,t.exports)},this),this.componentRegistry.setUnregisterCallback(function(t){return this.exportsManager.remove(t.type)},this),this.eventEngine=new s,this.componentFactory=new o(this.componentRegistry,this),this.stage=this.componentFactory.createModel(n),this.eventEngine.setRoot(this.stage),this.stage.event_map&&this.eventEngine.add(this.stage,this.stage.event_map(),this.stage),this.eventEngine.add(this,h,this),this.componentFactory.setupDescendant(this.stage),e.mobile||(this.mouseEvent=new a(this.stage)),this.touchEvent=new u(this.stage)}return n.prototype.setStage=function(t){return this.stage=t},n.prototype.getStage=function(){return this.stage},n.prototype.build=function(t,e){return this.componentFactory.build(t,e)},n.prototype.select=function(t,e){return i.select(t,e||this.stage)},n.prototype["import"]=function(t,e,n){return this.exportsManager["import"](t,e,n)},n.prototype.require=function(t){return this.exportsManager.require(t)},n.prototype.dispose=function(){return this.componentFactory.dispose(),this.comandManager.dispose(),this.eventEngine.dispose(),this.componentRegistry.dispose(),this.mouseEvent&&this.mouseEvent.dispose(),this.touchEvent.dispose(),this.exportsManager.dispose()},n}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(38),n(42),n(43),n(44),n(45)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(t,e){this.type=t,this.container=e}return s(i,t),i.include(e),i.include(n),i.include(r),i.prototype.getType=function(){return this.type},i.prototype.dispose=function(){return this.setContainer(null)},i.prototype.getContainer=function(){return this.container},i.prototype.setContainer=function(t){return t!==this.container?(this.container&&this.container.remove(this),this.container=t,this.container?this.container.add(this):void 0):void 0},i.prototype.moveAt=function(t){return this.getContainer()?this.container.moveChildAt(t,this):void 0},i.prototype.moveForward=function(){return this.getContainer()?this.container.moveChildForward(this):void 0},i.prototype.moveBackward=function(){return this.getContainer()?this.container.moveChildBackward(this):void 0},i.prototype.moveToFront=function(){return this.getContainer()?this.container.moveChildToFront(this):void 0},i.prototype.moveToBack=function(){return this.getContainer()?this.container.moveChildToBack(this):void 0},i}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(2),n(46)],i=function(t,e,n){"use strict";var r,i,o,a,u,c,p,h,l,f,d,g,y,_,v,m;return i=[],a=function(t,r){var i,o,s;if(i=r instanceof e,i&&(s=r.getContainer())){if(t===s)return;v(t,r)}return o=t.__components__.push(r)-1,i&&r.setContainer(t),n.add(t,t,r,o),i?(r.delegate_on(t),n.added(r,t,r,o)):void 0},v=function(t,r){var i,o;return i=r instanceof e,o=t.__components__.indexOf(r),-1!==o&&(o>-1&&t.__components__.splice(o,1),i&&r.setContainer(null),n.remove(t,t,r),r instanceof e)?(n.removed(r,t,r),r.delegate_off(t)):void 0},o=function(t){var e,n,r;if(this.__components__||(this.__components__=[]),!(t instanceof Array))return o.call(this,[t]);for(n=0,r=t.length;r>n;n++)e=t[n],a(this,e);return this},y=function(t){var e,n,r;if(!(t instanceof Array))return y.call(this,[t]);if(this.__components__){for(n=0,r=t.length;r>n;n++)e=t[n],v(this,e);return this}},_=function(){return this.remove(t.clone(this.__components__))},c=function(t){return this.__components__?this.__components__[t]:void 0},u=function(t,e){return this.__components__?this.__components__.forEach(t,e):void 0},p=function(t){return(this.__components__||i).indexOf(t)},m=function(){return(this.__components__||i).length},h=function(t,e){var n,r,i;return r=this.indexOf(e),-1!==r?(n=this.__components__.splice(0,r),i=this.__components__.splice(1),this.__components__=n.concat(i),t=Math.max(0,t),t=Math.min(t,this.__components__.length),n=this.__components__.splice(0,t),this.__components__=n.concat(e,this.__components__)):void 0},f=function(t){var e;return e=this.indexOf(t),-1!==e&&e!==this.size()-1?(this.__components__[e]=this.__components__[e+1],this.__components__[e+1]=t):void 0},l=function(t){var e;return e=this.indexOf(t),-1!==e&&0!==e?(this.__components__[e]=this.__components__[e-1],this.__components__[e-1]=t):void 0},g=function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&n!==this.size()-1?(e=this.__components__.splice(0,n),r=this.__components__.splice(1),this.__components__=e.concat(r,this.__components__)):void 0},d=function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&0!==n?(e=this.__components__.splice(0,n),r=this.__components__.splice(1),this.__components__=this.__components__.concat(e,r)):void 0},r=function(e){function n(t){n.__super__.constructor.call(this,t)}return s(n,e),n.prototype.dispose=function(){var e,r,i,o;if(this.__components__){for(e=t.clone(this.__components__),i=0,o=e.length;o>i;i++)r=e[i],r.dispose();this.__components__=null}return n.__super__.dispose.call(this)},n.prototype.add=o,n.prototype.remove=y,n.prototype.removeAll=_,n.prototype.size=m,n.prototype.getAt=c,n.prototype.indexOf=p,n.prototype.forEach=u,n.prototype.moveChildAt=h,n.prototype.moveChildForward=f,n.prototype.moveChildBackward=l,n.prototype.moveChildToFront=g,n.prototype.moveChildToBack=d,n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i,o){"use strict";var a;return a=function(e){function a(){return a.__super__.constructor.apply(this,arguments)}return s(a,e),a.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.barcode.width,this.barcode.height)},a.prototype.setup=function(){var t;return this.barcode=new Image,t=this,this.barcode.onload=function(){return t.draw()},this.barcode.src=this.makeurl()},a.prototype.shape=function(t){if(this.barcode)try{return this.get("w")?t.drawImage(this.barcode,this.get("x"),this.get("y"),this.get("w"),this.get("h")):t.drawImage(this.barcode,this.get("x"),this.get("y"))}catch(e){}},a.prototype.makeurl=function(){var t;return t="http://barcode.hatiolab.com:81/?",t+="text="+window.escape(this.get("text")),t+="&bcid="+(this.get("symbol")||"code128"),t+="&wscale="+(this.get("scale-w")||2),t+="&hscale="+(this.get("scale-h")||2),t+="&rotate="+(this.get("rotation")||"N"),this.get("alttext")?t+="&alttext="+window.escape(this.get("alttext")):this.get("includetext")&&(t+="&alttext="+window.escape(this.get("text"))),this.get("barcolor")&&"#000000"!==this.get("barcolor")&&(t+="&barcolor="+window.escape(this.get("barcolor"))),this.get("backgroundcolor")&&"#FFFFFF"!==this.get("backgroundcolor")&&(t+="&backgroundcolor="+window.escape(this.get("backgroundcolor"))),t},a.prototype.handles=function(){return["bound-handle","rotation-handle"]},a.prototype.event_map=function(){var e;return e={"(self)":{"(self)":{change:function(e,n,r){var i;return i=t.pick(r,["symbol","text","alttext","scale-h","scale-w","rotation","includetext","barcolor","backgroundcolor"]),t.isEmpty(i)?void 0:this.barcode.src=this.makeurl()(i)}}}}},a.spec={type:"barcode",containable:!1,description:"Barcode",dependencies:{"bound-handle":n,"rotation-handle":r},properties:[i,o,{symbol:{type:"string"},text:{type:"string"},alttext:{type:"string"},"scale-h":{type:"number"},"scale-w":{type:"number"},rotation:{type:"sring"},includetext:{type:"boolean"},barcolor:{type:"string"},backgroundcolor:{type:"string"}}]},a}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(11),n(23),n(58),n(59)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){return{x:this.get("cx"),y:this.get("cy")}},e.prototype.shape=function(t){return t.arc(this.get("cx"),this.get("cy"),this.get("r"),0,2*Math.PI,!1)},e.prototype.handles=function(){return["circle-handle"]},e.prototype.positions=function(){return[["cx","cy"]]},e.prototype.dockPoints=function(){var t,e,n,r,i,o;for(e=this.get("cx"),n=this.get("cy"),i=this.get("r"),r=[],t=o=0;359>=o;t=o+=45)r.push([e+Math.cos(t*Math.PI/180)*i,n-Math.sin(t*Math.PI/180)*i]);return r},e.spec={type:"circle",containable:!1,description:"Circle",dependencies:{"circle-handle":n},properties:[i,r]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.shape=function(t){var e,n,r,i,o,s,a;return s=this.get("x"),a=this.get("y"),o=this.get("w"),r=this.get("h"),e=s+o/2,n=a+r/2,i=o/2,t.save(),t.scale(1,r/o),t.arc(e,n*o/r,i,0,2*Math.PI,!1),t.restore()},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.spec={type:"ellipse",containable:!1,description:"Ellipse",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.image.width,this.image.height)},o.prototype.setup=function(){var t;return this.image=new Image,t=this,this.image.onload=function(){return t.draw()},this.image.src=this.get("src")},o.prototype.shape=function(t){return this.image?this.get("w")?t.drawImage(this.image,this.get("x"),this.get("y"),this.get("w"),this.get("h")):t.drawImage(this.image,this.get("x"),this.get("y")):void 0},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.prototype.event_map=function(){var t;return t={"(self)":{"(self)":{change:function(t,e,n){return n.hasOwnProperty("src")?this.image.src=n.src:void 0}}}}},o.spec={type:"image",containable:!1,description:"ImageBox",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i,{src:{type:"string"}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(11),n(26),n(60),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){var t,e,n,r,i,o,s;for(e=this.get("path"),n=e.length,r=0,i=0,o=0,s=e.length;s>o;o++)t=e[o],r+=t[0],i+=t[1];return{x:r/n,y:i/n}},e.prototype.shape=function(t){var e,n,r,i,o,s;for(n=this.get("path"),r=n.length,i=n[0],t.moveTo(i[0],i[1]),s=[],e=o=0;r>=0?r>o:o>r;e=r>=0?++o:--o)s.push(t.lineTo(n[e][0],n[e][1]));return s},e.prototype.handles=function(){return["path-handle"]},e.prototype.positions=function(){return"path"},e.prototype.dockPoints=function(){return this.get("path")},e.prototype.event_map=function(){},e.spec={type:"path",containable:!1,description:"Path",dependencies:{"path-handle":n},properties:[r,i]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.spec={type:"rect",containable:!1,description:"Rectangle",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(22),n(27),n(57),n(58),n(61)],i=function(t,e,n,r,i,o){"use strict";var a,u;return a=3.779527559,u=function(t){function u(){return u.__super__.constructor.apply(this,arguments)}return s(u,t),u.prototype.capture_shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},u.prototype.shape=function(t){var e;return e={x:this.get("x"),y:this.get("y"),w:this.get("w"),h:this.get("h")},t.rect(e.x,e.y,e.w,e.h),"vertical"!==this.get("direction")?this.drawHorizontal(t,e):this.drawVertical(t,e)},u.prototype.handles=function(){return["bound-handle","rotation-handle"]},u.prototype.drawHorizontal=function(t,e){var n,r,i,o,s,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k;for(d=parseInt(this.get("zeropos")),l=e.x+d,o=e.x+this.get("margin")[0],s=e.x+e.w-this.get("margin")[1],n=e.y+e.h-15,r=e.y+e.h,h=e.w-d,p=Math.ceil(h/a),i=g=0,m=p-1;(m>=0?m>=g:g>=m)&&(f=l+i*a,!(f>s));i=m>=0?++g:--g)o>f||(i%10===0?(t.moveTo(f,n),t.lineTo(f,r)):i%5===0?(t.moveTo(f,n+8),t.lineTo(f,r)):(t.moveTo(f,n+11),t.lineTo(f,r)));for(c=d,u=Math.floor(c/a),i=y=1,x=u-1;(x>=1?x>=y:y>=x)&&(f=l-i*a,!(o>f));i=x>=1?++y:--y)f>s||(i%10===0?(t.moveTo(f,n),t.lineTo(f,r)):i%5===0?(t.moveTo(f,n+8),t.lineTo(f,r)):(t.moveTo(f,n+11),t.lineTo(f,r)));for(t.textAlign="left",t.textBaseline="bottom",i=_=0,b=p-1;b>=_&&(f=l+i*a,!(f>s));i=_+=10)o>f||t.fillText(""+i/10,f+2,n+10);for(k=[],i=v=10,w=u-1;w>=v&&(f=l-i*a,!(o>f));i=v+=10)f>s||k.push(t.fillText("-"+i/10,f+2,n+10));return k},u.prototype.drawVertical=function(t,e){var n,r,i,o,s,u,c,p,h,l,f,d,g,y,_,v,m,x,b,w,k;for(d=parseInt(this.get("zeropos")),l=e.y+d,s=e.y+this.get("margin")[0],o=e.y+e.h-this.get("margin")[1],n=e.x+e.w-15,r=e.x+e.w,p=e.h-d,h=Math.ceil(p/a),i=g=0,m=h-1;(m>=0?m>=g:g>=m)&&(f=l+i*a,!(f>o));i=m>=0?++g:--g)s>f||(i%10===0?(t.moveTo(n,f),t.lineTo(r,f)):i%5===0?(t.moveTo(n+8,f),t.lineTo(r,f)):(t.moveTo(n+11,f),t.lineTo(r,f)));for(u=d,c=Math.floor(u/a),i=y=1,x=c-1;x>=1?x>=y:y>=x;i=x>=1?++y:--y)if(f=l-i*a,!(f>o)){if(s>f)break;i%10===0?(t.moveTo(n,f),t.lineTo(r,f)):i%5===0?(t.moveTo(n+8,f),t.lineTo(r,f)):(t.moveTo(n+11,f),t.lineTo(r,f))}for(t.textAlign="right",t.textBaseline="top",i=_=0,b=h-1;b>=_&&(f=l+i*a,!(f>o));i=_+=10)s>f||t.fillText(""+i/10,n+10,f+2);for(k=[],i=v=10,w=c-1;w>=v&&(f=l-i*a,!(s>f));i=v+=10)f>o||k.push(t.fillText("-"+i/10,n+10,f+2));return k},u.spec={type:"ruler",containable:!1,description:"Ruler",dependencies:{"bound-handle":e,"rotation-handle":n},properties:[r,i,o,{zeropos:{type:"number","default":0},direction:{type:"string","default":"horizontal"},margin:{type:"array","default":[0,0]}}]},u}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(2),n(47),n(45),n(48),n(57),n(58)],i=function(t,e,n,r,i,o,a){"use strict";var u;return u=function(e){function u(){return u.__super__.constructor.apply(this,arguments)}return s(u,e),u.include(n),u.include(r),u.include(i),u.prototype.handles=function(){return["bound-handle"]},u.prototype.positions=function(){return[["x","y"]]},u.prototype.move=function(e){var n,r,i,o,s,a,u,c,p;if(n=e.delta,!t.isEmpty(n)){if(s={},o=this.positions(),o instanceof Array)for(a=0,c=o.length;c>a;a++)r=o[a],n.x&&(s[r[0]]=Math.round(this.get(r[0])+n.x)),n.y&&(s[r[1]]=Math.round(this.get(r[1])+n.y));else{for(i=t.clone(this.get(o)),u=0,p=i.length;p>u;u++)r=i[u],n.x&&(r[0]+=Math.round(n.x)),n.y&&(r[1]+=Math.round(n.y));s[o]=i}return this.set(s)}},u.prototype.event_map=function(){return null},u.spec={type:"shape",containable:!1,description:"Abstract Shape",dependencies:{},properties:[o,a]},u}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(11),n(57),n(58),n(61)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype._wrap=function(t,e,n,r,i,o){var s,a,u,c,p,h,l,f,d;for(l=e.split(" "),a="",s=f=0,d=l.length;d>f;s=++f)h=l[s],c=a+h+" ",u=t.measureText(c),p=u.width,p>i&&s>0?(t.fillText(a,n,r),a=h+" ",r+=o):a=c;return t.fillText(a,n,r)},i.prototype.shape=function(t){return this._wrap(t,this.get("text"),this.get("x"),this.get("y"),this.get("w"),10),t.font=this.get("font")},i.spec={type:"text",containable:!1,description:"Text Box",dependencies:{},properties:[e,n,r,{text:{type:"string","default":""}}]},i}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(11),n(25),n(62),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.center=function(){return{x:(this.get("x1")+this.get("x2"))/2,y:(this.get("y1")+this.get("y2"))/2}},e.prototype.shape=function(t){return t.moveTo(this.get("x1"),this.get("y1")),t.lineTo(this.get("x2"),this.get("y2"))},e.prototype.handles=function(){return["p2p-handle"]},e.prototype.positions=function(){return[["x1","y1"],["x2","y2"]]},e.prototype.dockPoints=function(){return[[this.get("x1"),this.get("y1")],[this.get("x2"),this.get("y2")]]},e.prototype.event_map=function(){},e.spec={type:"line",containable:!1,description:"Direct Line",dependencies:{"p2p-handle":n},properties:[r,i]},e}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(12),n(49)],i=function(t,e,n,r){"use strict";var i,o;return o={debug:function(t,e){var n,i;return n=function(t){return function(){return t.debug_layer||(t.debug_layer?void 0:t.debug_layer=t.select("debug-layer")[0])}}(this),i=function(t){return function(){return t.debug_text||(t.debug_text?void 0:t.debug_text=t.select("text",n())[0])}}(this),i().set("text",t+":"+r(e)),n().draw()}},i=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.spec={type:"debug-layer",containable:!0,container_type:"layer",description:"Debug Layer",dependencies:{text:n},properties:[e],components:[{type:"text",name:"debug-text",attrs:{text:"",x:0,y:20,w:300,h:300,capturable:!1}}],exports:o},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(3),n(50),n(63),n(51),n(52)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function e(){return e.__super__.constructor.apply(this,arguments)}return s(e,t),e.prototype.clearCanvas=function(){return this.canvas.getContext("2d").clearRect(0,0,this.canvas.width,this.canvas.height)},e.prototype._draw=function(){var t,e,n;return t=this.canvas.getContext("2d"),t.clearRect(0,0,this.canvas.width,this.canvas.height),t.save(),e=this.get("offset-x"),n=this.get("offset-y"),t.translate(e,n),this.forEach(function(e){return e.draw(t)}),t.restore()},e.prototype.draw=function(){return this._draw()},e.prototype.shape=function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},e.prototype.capture=function(t){var e,n,r,i,o,s,a;if(r=this.canvas.getContext("2d"),r.beginPath(),o={x:t.x-this.get("offset-x")-this.get("x"),y:t.y-this.get("offset-y")-this.get("y")},this.shape(r),this.size()>0)for(i=s=a=this.size()-1;0>=a?0>=s:s>=0;i=0>=a?++s:--s)if(n=this.getAt(i),e=n.capture(o,r))return e;return null},e.prototype.init=function(){var t;return this.pender=new i(this,this._draw),t=this.controller.options.attrs,this.canvas=document.createElement("canvas"),this.canvas.setAttribute("width",this.get("w")||t.w),this.canvas.setAttribute("height",this.get("h")||t.h),this.canvas.style.display=this.get("visible")!==!1?"block":"none",this.canvas.style.padding=0,this.canvas.style.margin=0,this.canvas.style.border=0,this.canvas.style.background="transparent",this.canvas.style.position="absolute",this.canvas.style.top=this.get("y")+"px",this.canvas.style.left=this.get("x")+"px",this.html_container=this.controller.getStage().html_container,this.html_container.appendChild(this.canvas)},e.prototype.setup=function(){return this.draw()},e.prototype.event_map=function(){return r},e.prototype.dispose=function(){return this.html_container.removeChild(this.canvas),this.controller=null,this.pender.dispose()},e.spec={type:"layer",containable:!0,container_type:"layer",description:"Abstract Layer",dependencies:{},properties:[n]},e}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(58),n(53),n(5)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.prototype.setup=function(){var t;return this.target=this.select(this.get("magnify-target"))[0],this.magnify_edge=this.select("#magnify-edge")[0],t=this.get("r"),this.set({w:2*t,h:2*t,x:this.target.canvas.width/2-t,y:this.target.canvas.height/2-t}),this.canvas.setAttribute("width",2*t),this.canvas.setAttribute("height",2*t),this.magnify_edge.set({cx:t,cy:t,r:t-5}),o.__super__.setup.call(this)},o.prototype._draw=function(){var t,e,n,r,i,o,s,a,u,c,p,h,l,f,d,g,y,_,v;return this.clearCanvas(),t=this.canvas.getContext("2d"),t.save(),t.beginPath(),c=this.get("r"),p=this.get("ratio"),t.arc(c,c,c-1,0,2*Math.PI,!1),t.clip(),t.rect(0,0,2*c,2*c),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),f=this.get("x")-this.target.get("x")+c,d=this.get("y")-this.target.get("y")+c,l=Math.round(c/p),h=l,o=f-l,s=d-h,i=2*l,r=2*h,_=0,v=0,y=2*c,g=2*c,0>o&&(_+=Math.round(-o*p),y-=_,i-=-o,o=0),0>s&&(v+=Math.round(-s*p),g-=v,r-=-s,s=0),a=this.target.canvas.width,n=o+i-a,n>0&&(i-=n,y-=Math.round(n*p)),u=this.target.canvas.height,e=s+r-u,e>0&&(r-=e,g-=Math.round(e*p)),t.drawImage(this.target.canvas,o,s,i,r,_,v,y,g),t.restore(),this.forEach(function(e){return e.draw(t)})},o.prototype.event_map=function(){return[r]},o.spec={type:"magnify-layer",containable:!0,container_type:"layer",description:"Magnify Layer",dependencies:{circle:i},properties:[e,n],components:[{type:"circle",attrs:{id:"magnify-edge",cx:100,cy:100,r:95,lineWidth:10,strokeStyle:"black",capturable:!0,draggable:!0}},{type:"circle",attrs:{id:"magnify-handle",cx:180,cy:180,r:16,lineWidth:8,strokeStyle:"black",fillStyle:"red",capturable:!0,draggable:!0}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(10),n(63)],i=function(t,e,n){"use strict";var r;return r=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.prototype.setup=function(){var t;return this.target=this.select(this.get("target"))[0],t=this.select("ruler",this),this.hori=t[0],this.vert=t[1],this.hori.set({w:this.target.canvas.width,h:20}),this.vert.set({w:20,h:this.target.canvas.height}),this.set({x:this.target.get("x"),y:this.target.get("y")}),r.__super__.setup.call(this)},r.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{"(self)":{change:this.onselfchange}}}},r.prototype.onchange=function(t,e,n){var r;return n.hasOwnProperty("offset-x")&&this.hori.set("zeropos",n["offset-x"]),n.hasOwnProperty("offset-y")&&this.vert.set("zeropos",n["offset-y"]),r=_.pick(n,["x","y","w","h"]),_.isEmpty(r)||this.set(r),this.draw()},r.prototype.onselfchange=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),this.draw()},r.spec={type:"ruler-layer",containable:!0,container_type:"layer",description:"Ruler Layer",dependencies:{ruler:e},properties:[n,{target:{type:"string"}}],components:[{type:"ruler",attrs:{direction:"horizontal",margin:[20,0],opacity:.8,x:0,y:0,zeropos:20,strokeStyle:"navy",lineWidth:1}},{type:"ruler",attrs:{direction:"vertical",margin:[20,0],opacity:.8,x:0,y:0,zeropos:20,strokeStyle:"navy",lineWidth:1}}]},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(54),n(22),n(23),n(25)],i=function(t,e,n,r,i,o){"use strict";var a,u;return u=function(t,e,n){var r,i,o;return i=t.getContainer(),i.canvas||u(i,e,!0),n?(o=t.get("rotate")||0,r=t.center(),e.translate(r.x,r.y),e.rotate(o*Math.PI/180),e.translate(-r.x,-r.y),e.translate(t.get("x"),t.get("y"))):void 0},a=function(t){function a(){return a.__super__.constructor.apply(this,arguments)}return s(a,t),a.prototype.capture=function(t){var e,n,r,i,o,s,a;if(r=this.canvas.getContext("2d"),r.beginPath(),o={x:t.x-this.get("offset-x")-this.get("x"),y:t.y-this.get("offset-y")-this.get("y")},this.shape(r),this.size()>0)for(i=s=a=this.size()-1;0>=a?0>=s:s>=0;i=0>=a?++s:--s)if(n=this.getAt(i),e=n.capture(o,r))return e;return null},a.prototype.setup=function(){var t;return this.selections=[],this.target=this.select(this.get("target"))[0],t={"offset-x":this.get("offset-x")||this.target.get("offset-x"),"offset-y":this.get("offset-y")||this.target.get("offset-y"),x:this.get("x")||this.target.get("x"),y:this.get("y")||this.target.get("y")},this.set(t),a.__super__.setup.call(this)},a.prototype._draw=function(){var t,e,n,r,i;if(this.clearCanvas(),t=this.canvas.getContext("2d"),t.save(),t.translate(this.get("offset-x"),this.get("offset-y")),t.globalAlpha=.4,this.selections.length>0){for(t.save(),this.offset&&t.translate(this.offset.x,this.offset.y),i=this.selections,n=0,r=i.length;r>n;n++)e=i[n],t.save(),u(e,t),e.draw(t),t.restore();t.restore()}return t.globalAlpha=1,this.focus&&this.forEach(function(e){return e.draw(t)}),t.restore()},a.prototype.buildHandles=function(){var t,e,n,r,i;for(r=this.focus.handles(),i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(this.build({type:t,attrs:{target:"#"+this.focus.get("id")}}));return i},a.prototype.setFocus=function(t){return this.focus!==t&&(this.removeAll(),this.focus=t,this.focus)?(this.buildHandles(),this.draw()):void 0},a.prototype.event_map=function(){return[n]},a.spec={type:"selection-layer",containable:!0,container_type:"layer",description:"Selection Layer",dependencies:{"bound-handle":r,"circle-handle":i,"p2p-handle":o},properties:[e,{target:{type:"string"}}]},a}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(63),n(55),n(5)],i=function(t,e,n,r){"use strict";var i;return i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return s(i,t),i.prototype.setup=function(){return this.slide_handle=this.select("#slide-handle")[0],this.slide_handle.set({cx:this.canvas.width/2-this.get("offset-x"),cy:this.canvas.height/2-this.get("offset-y")}),i.__super__.setup.call(this)},i.prototype._draw=function(){var t,e;return this.clearCanvas(),t=this.canvas.getContext("2d"),e={x:this.get("offset-x"),y:this.get("offset-y")},t.translate(e.x,e.y),t.globalAlpha=.5,this.outline_target&&(this.offset&&t.translate(this.offset.x,this.offset.y),this.outline_target.draw(t),this.offset&&t.translate(-this.offset.x,-this.offset.y)),t.globalAlpha=1,this.forEach(function(e){return e.draw(t)}),t.translate(-e.x,-e.y)},i.prototype.event_map=function(){return[n]},i.spec={type:"slide-layer",containable:!0,container_type:"layer",description:"Slide Layer",dependencies:{circle:r},properties:[e],components:[{type:"circle",attrs:{id:"slide-handle",cx:100,cy:100,r:20,lineWidth:5,strokeStyle:"red",fillStyle:"black",capturable:!0,draggable:!0}}]},i
3
+ }(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(15),n(51),n(63)],i=function(t,e,n){"use strict";var r;return r=function(t){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,t),r.prototype.setup=function(){var t,e,n,i,o;for(r.__super__.setup.call(this),e=this.controller.options.widgets,o=[],n=0,i=e.length;i>n;n++)t=e[n],o.push(this.build(t,this));return o},r.prototype.event_map=function(){return[e]},r.spec={type:"widget-layer",containable:!0,container_type:"layer",description:"Widgets Layer",dependencies:{},properties:[n]},r}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(3),n(47),n(50),n(57),n(58)],i=function(t,e,n,r,i){"use strict";var o;return o=function(t){function o(){return o.__super__.constructor.apply(this,arguments)}return s(o,t),o.include(e),o.include(n),o.prototype.handles=function(){return["bound-handle","rotation-handle"]},o.prototype.positions=function(){return[["x","y"]]},o.prototype.move=function(t){var e,n,r,i,o,s;if(e=t.delta,!_.isEmpty(e)){for(r={},s=this.positions(),i=0,o=s.length;o>i;i++)n=s[i],e.x&&(r[n[0]]=Math.round(this.get(n[0])+e.x)),e.y&&(r[n[1]]=Math.round(this.get(n[1])+e.y));return this.set(r)}},o.prototype.event_map=null,o.spec={type:"group",containable:!0,container_type:"group",description:"Group",dependencies:{},properties:[r,i,{clip:{type:"boolean","default":!0}}]},o}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n,r,i,o,a,u,c,p;return c=-1,a=0,n=1,o=-1,i=0,u=1,p=[[o,c],[i,c],[u,c],[o,a],[u,a],[o,n],[i,n],[u,n]],r=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r;return r=Math.round(this.target.get("w")/2),n=Math.round(this.target.get("h")/2),t=Math.round(this.target.get("x")+r),e=Math.round(this.target.get("y")+n),this.forEach(function(i){var o;return o=i.get("index"),i.set({x:t+p[o][0]*r,y:e+p[o][1]*n})})},n.prototype.setup=function(){var t,e,n,r;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],t=n=0,r=p.length;r>n;t=++n)e=p[t],this.build({type:"handle",attrs:{r:8,strokeStyle:"red",lineWidth:2,capturable:!1,fillStyle:"black",index:t,draggable:!0}});return this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i;return n=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},r=n.get("index"),i={w:this.target.get("w")+e.x*p[r][0],h:this.target.get("h")+e.y*p[r][1]},p[r][0]===o&&(i.x=this.target.get("x")+e.x),p[r][1]===c&&(i.y=this.target.get("y")+e.y),this.target.set(i),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"bound-handle",containable:!0,description:"Bound Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r;return n=this.target.get("r"),t=this.target.get("cx"),e=this.target.get("cy"),r=this.get("theta")||0,this.handle.set({x:t+Math.round(Math.cos(r)*n),y:e+Math.round(Math.sin(r)*n)})},n.prototype.setup=function(){return this.set("clip",!1),this.set("theta",0),this.target=this.select(this.get("target"))[0],this.handle=this.build({type:"handle",attrs:{r:8,index:0,strokeStyle:"red",fillStyle:"black",lineWidth:1,draggable:!0}}),this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s,a;return i=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},o=i.get("x")+e.x,s=i.get("y")+e.y,i.set({x:o,y:s}),n=o-this.target.get("cx"),r=s-this.target.get("cy"),this.set({theta:Math.atan2(r,n)}),a=Math.round(Math.sqrt(n*n+r*r)),this.target.set({r:a}),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"circle-handle",containable:!0,description:"Circle Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(2),n(48)],i=function(t,e){"use strict";var n,r;return r=function(t,e,n){var i,o,s;return o=t.getContainer(),o.canvas||r(o,e,!0),n?(s=t.get("rotate")||0,i=t.center(),e.translate(i.x,i.y),e.rotate(s*Math.PI/180),e.translate(-i.x,-i.y),e.translate(t.get("x"),t.get("y"))):void 0},n=function(t){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,t),n.include(e),n.prototype.center=function(){return{x:this.get("x"),y:this.get("y")}},n.prototype.shape=function(t){var e,n,i;return i=this.getContainer().target,t.save(),r(i,t),e=i.center(),n=i.get("rotate"),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),t.arc(this.get("x"),this.get("y"),this.get("r"),0,2*Math.PI,!1),t.restore()},n.prototype.event_map=function(){return[]},n.spec={type:"handle",containable:!1,description:"Base Handle",dependencies:{},properties:[{x:{type:"number"},y:{type:"number"},r:{type:"number"},index:{type:"string"}}]},n}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t;return t=[[this.target.get("x1"),this.target.get("y1")],[this.target.get("x2"),this.target.get("y2")]],this.forEach(function(e){var n;return n=e.get("index"),e.set({x:t[n][0],y:t[n][1]})})},n.prototype.setup=function(){var t,e;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],t=e=0;1>=e;t=++e)this.build({type:"handle",attrs:{r:8,index:t,strokeStyle:"red",fillStyle:"black",lineWidth:2,draggable:!0}});return this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s;switch(n=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},i=n.get("x")+e.x,o=n.get("y")+e.y,n.set({x:i,y:o}),r=n.get("index")){case 0:s={x1:this.target.get("x1")+e.x,y1:this.target.get("y1")+e.y};break;case 1:s={x2:this.target.get("x2")+e.x,y2:this.target.get("y2")+e.y}}return this.target.set(s),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"p2p-handle",containable:!0,description:"Point-to-Point Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(39),n(24),n(21)],i=function(t,e,n){"use strict";var r;return r=function(n){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,n),r.prototype.align=function(){var t;return t=this.target.get("path"),this.forEach(function(e){var n;return n=e.get("index"),e.set({x:t[n][0],y:t[n][1]})})},r.prototype.setup=function(){var t,e,n,r;for(this.set("clip",!1),this.target=this.select(this.get("target"))[0],e=this.target.get("path"),t=n=0,r=e.length-1;r>=0?r>=n:n>=r;t=r>=0?++n:--n)this.build({type:"handle",attrs:{r:8,index:t,strokeStyle:"red",fillStyle:"black",lineWidth:2,draggable:!0}});return this.align()},r.prototype.onchange=function(){return this.align(),this.draw()},r.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},r.prototype.ondrag=function(e){var n,r,i,o,s,a;return r=e.target,n={x:e.offsetX-this.startpos.x,y:e.offsetY-this.startpos.y},o=r.get("x")+n.x,s=r.get("y")+n.y,r.set({x:o,y:s}),i=r.get("index"),a=t.clone(this.target.get("path")),a[i][0]+=n.x,a[i][1]+=n.y,this.target.set("path",a),this.startpos={x:e.offsetX,y:e.offsetY}},r.prototype.ondragend=function(){},r.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},r.spec={type:"path-handle",containable:!0,description:"Path Handle",dependencies:{handle:e},properties:[{target:{type:"string"}}]},r}(n)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(24),n(21)],i=function(t,e){"use strict";var n;return n=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return s(n,e),n.prototype.align=function(){var t,e,n,r,i,o,s,a;return s=this.target.get("x"),a=this.target.get("y"),o=this.target.get("w"),n=this.target.get("h"),i=Math.round(o/2),r=Math.round(n/2),t=Math.round(s+o/2),e=Math.round(a-20),this.handle.set({x:t,y:e})},n.prototype.setup=function(){return this.set("clip",!1),this.target=this.select(this.get("target"))[0],this.handle=this.build({type:"handle",attrs:{r:8,draggable:!0,strokeStyle:"red",fillStyle:"black",lineWidth:1}}),this.align()},n.prototype.onchange=function(){return this.align(),this.draw()},n.prototype.ondragstart=function(t){return this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondrag=function(t){var e,n,r,i,o,s,a,u,c,p,h;return r=t.target,e={x:t.offsetX-this.startpos.x,y:t.offsetY-this.startpos.y},i=r.get("index"),p=this.target.get("x"),h=this.target.get("y"),c=this.target.get("w"),n=this.target.get("h"),o=Math.round(p+c/2),s=Math.round(h+n/2),u=Math.atan2(t.offsetY-s,t.offsetX-o),u-=Math.atan2(this.startpos.y-s,this.startpos.x-o),a=this.target.get("rotate")||0,this.target.set({rotate:a+180*u/Math.PI}),this.startpos={x:t.offsetX,y:t.offsetY}},n.prototype.ondragend=function(){},n.prototype.event_map=function(){return{"?target":{"?target":{change:this.onchange}},"(self)":{handle:{dragstart:this.ondragstart,drag:this.ondrag,dragend:this.ondragend}}}},n.spec={type:"rotation-handle",containable:!0,description:"Rotation Handle",dependencies:{handle:t},properties:[{target:{type:"string"}}]},n}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(30),n(3),n(64)],i=function(t,e,n){"use strict";var r;return r=function(e){function r(){return r.__super__.constructor.apply(this,arguments)}return s(r,e),r.prototype.draw=function(){return this.forEach(function(t){return t.draw})},r.prototype.init=function(){return this.client_container=document.getElementById(this.get("container")),this.client_container.innerHTML="",this.html_container=document.createElement("div"),this.html_container.style.position="relative",this.html_container.style.display="inline-block",this.client_container.appendChild(this.html_container)},r.prototype.dispose=function(){return this.client_container.removeChild(this.html_container),this.controller.dispose()},r.prototype.capture=function(t){var e,n,r,i,o;if(this.size()>0)for(r=i=o=this.size()-1;0>=o?0>=i:i>=0;r=0>=o?++i:--i)if(n=this.getAt(r),e=n.capture(t))return e;return this},r.prototype.position=function(){return this.html_container.getBoundingClientRect?this.html_container.getBoundingClientRect():{top:0,left:0}},r.prototype.point=function(e){var n,r,i,o,s,a;return e?(i=this.position(),s=null,a=null,void 0!==e.touches?e.touches.length>0&&(o=e.touches[0],s=o.clientX-i.left,a=o.clientY-i.top):(n=0,r=0,"CANVAS"===e.target.tagName&&(n=e.target.offsetLeft,r=e.target.offsetTop),void 0!==e.offsetX?(s=e.offsetX+n,a=e.offsetY+r):"mozilla"===t.UA.browser?(s=e.layerX+n,a=e.layerY+r):void 0!==e.clientX&&i&&(s=e.clientX-i.left+n,a=e.clientY-i.top+r)),null!==s&&null!==a&&(this.point_pos={x:s,y:a}),this.point_pos):this.point_pos},r.spec={type:"stage",containable:!0,container_type:"stage",description:"Abstract Stage",dependencies:{},properties:[n]},r}(e)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty,s=function(t,e){function n(){this.constructor=t}for(var r in e)o.call(e,r)&&(t[r]=e[r]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};r=[n(28),n(64),n(20),n(14),n(19),n(18),n(16),n(17),n(56)],i=function(t,e,n,r,i,o,a,u,c){"use strict";var p;return p=function(t){function p(){return p.__super__.constructor.apply(this,arguments)}return s(p,t),p.prototype.event_map=function(){return[c]},p.spec={type:"widget-box",description:"Widget Drawing Box",containable:!0,container_type:"stage",dependencies:{"widget-layer":n,"debug-layer":r,"slide-layer":i,"selection-layer":o,"magnify-layer":a,"ruler-layer":u},properties:[e],components:[{type:"widget-layer",attrs:{"offset-x":-50,"offset-y":-50,x:100,y:100}},{type:"ruler-layer",attrs:{target:"widget-layer"}},{type:"selection-layer",attrs:{target:"widget-layer"}},{type:"magnify-layer",attrs:{"magnify-target":"widget-layer",fillStyle:"white",strokeStyle:"gray",r:100,ratio:2}},{type:"slide-layer",attrs:{"slide-target":"widget-layer"}},{type:"debug-layer"}]},p}(t)}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){var t;return t={version:"@@version",listenClickTap:!1,inDblClickWindow:!1,enableTrace:!1,traceArrMax:100,dblClickWindow:400,pixelRatio:void 0,dragDistance:0,angleDeg:!0,showWarnings:!0,Filters:{},isDragging:function(){var t;return t=things.DD,t?t.isDragging:!1},isDragReady:function(){var t;return t=things.DD,t?!!t.node:!1},_parseUA:function(t){var e,n,r,i;return i=t.toLowerCase(),n=/(chrome)[ \/]([\w.]+)/.exec(i)||/(webkit)[ \/]([\w.]+)/.exec(i)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(i)||/(msie) ([\w.]+)/.exec(i)||i.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(i)||[],r=!!t.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i),e=!!t.match(/IEMobile/i),{browser:n[1]||"",version:n[2]||"0",mobile:r,ieMobile:e}},UA:void 0},t.UA=t._parseUA(navigator&&navigator.userAgent||""),console.log("UA",t.UA),t}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(39)],i=function(t){"use strict";var e;return e=function(){function e(){this.componentSpecs={}}return e.prototype.dispose=function(){var t,e,n,r,i;for(t=Object.keys(this.componentSpecs),i=[],n=0,r=t.length;r>n;n++)e=t[n],i.push(this.unregister(e));return i},e.prototype.setRegisterCallback=function(t,e){return this.callback_register="function"==typeof t?t.bind(e):void 0},e.prototype.setUnregisterCallback=function(t,e){return this.callback_unregister="function"==typeof t?t.bind(e):void 0},e.prototype.register=function(e){var n,r,i,o,s,a,u,c;if(!this.componentSpecs[e.spec.type]){if(e.spec.dependencies){u=e.spec.dependencies;for(i in u)n=u[i],this.register(n)}if(e.spec.properties instanceof Array){for(o={},c=e.spec.properties,s=0,a=c.length;a>s;s++)r=c[s],t.merge(o,r);e.spec.properties=o}return this.componentSpecs[e.spec.type]=e,this.callback_register?this.callback_register(e.spec):void 0}},e.prototype.unregister=function(t){var e;return(e=this.componentSpecs[t])?(delete this.componentSpecs[t],this.callback_unregister&&this.callback_unregister(e),e):void 0},e.prototype.forEach=function(t,e){var n,r,i,s;i=this.componentSpecs,s=[];for(n in i)o.call(i,n)&&(r=i[n],s.push(t.call(e,n,r)));return s},e.prototype.list=function(){return Object.keys(this.componentSpecs).map(function(t){return this.componentSpecs[t]},this)},e.prototype.get=function(e){var n;return n=this.componentSpecs[e],n?t.clone(this.componentSpecs[e]):null},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(2),n(3)],i=function(t,e){"use strict";var n,r,i,o,s,a,u;return r=function(t,e){return t.substr(1)===e.get("id")},i=function(t,e){return t.substr(1)===e.get("name")},o=function(t,e,n,r){switch(t){case"(all)":return!0;case"(self)":return n===e;case"(root)":return r===e;default:return!1}},s=function(t,e){return"all"===t||t===e.type},n=function(t,e,n,a){if("(all)"===t)return!0;switch(t.charAt(0)){case"#":return r(t,e,n,a);case".":return i(t,e,n,a);case"(":return o(t,e,n,a);default:return s(t,e,n,a)}},u=function(t,n,r,i,o,s){return t(n,r,i,o)&&s.push(r),r instanceof e&&r.forEach(function(e){return u(t,n,e,i,o,s)}),s},a=function(t,e,n){var a;return"(root)"===t?[e]:"(self)"===t?[n]:(a=function(){switch(t.charAt(0)){case"#":return r;case".":return i;case"(":return o;default:return s}}(),u(a,t,e,n,e,[]))},{select:a,match:n}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(39)],i=function(t){"use strict";var e;return e=function(){function e(t,e){this.componentRegistry=t,this.controller=e}return e.prototype.dispose=function(){return this.componentRegistry=null,this.controller=null},e.prototype.build=function(t,e){var n;return n=this.createModel(t),e&&e.add(n),this.setupDescendant(n,t.components),n.setup&&n.setup(t),n},e.prototype.createModel=function(e){var n,r,i,o,s;if(e.dependencies){s=e.dependencies;for(i in s)r=s[i],this.componentRegistry.register(r)}if(o=this.componentRegistry.get(e.type),!o)throw new Error("module ("+e.type+") is not registered yet.");return e.attrs||(e.attrs={}),e.attrs.hasOwnProperty("id")||(e.attrs.id=t.uniqueId()),n=new o(e.type).initialize(e.attrs,o.spec.properties),n.setController(this.controller),n.init&&n.init(e),n},e.prototype.setupDescendant=function(t,e){var n,r,i,o,s,a,u,c;if(r=this.componentRegistry.get(t.type),i=r.spec,i.components)for(c=i.components,o=0,a=c.length;a>o;o++)n=c[o],this.build(n,t);if(e)for(s=0,u=e.length;u>s;s++)n=e[s],this.build(n,t);return t},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(39),n(66),n(32)],i=function(t,e,n){"use strict";var r;return r=function(){function r(t){this.eventMaps=[],this.setRoot(t)}return r.prototype.setRoot=function(t){return this.root=t},r.prototype.stop=function(){var t,e,n,r,i;for(r=this.eventMaps,i=[],e=0,n=r.length;n>e;e++)t=r[e],i.push(t.eventPump.stop());return i},r.prototype.add=function(t,r,i){var s,a,u,c,p,h,l,f,d,g,y;if(this.root){if(!(r instanceof Array))return void this.add(t,[r],i);for(y=[],d=0,g=r.length;g>d;d++)a=r[d],y.push(function(){var r;r=[];for(c in a)if(o.call(a,c)){if(u=a[c],0===c.indexOf("?")){if(f=c.substr(1),l=t.get(f),!l){console.log("EventEngine#add","variable "+c+" is not evaluated on listener");continue}c=l}h=n.select(c,this.root,t),r.push(function(){var n,r,o;for(o=[],n=0,r=h.length;r>n;n++)p=h[n],s=new e(p),s.on(t,u),s.start(i),o.push(this.eventMaps.push({eventPump:s,listener:t,handlerMap:a,target:p}));return o}.call(this))}return r}.call(this));return y}},r.prototype.remove=function(e,n){var r,i,o,s,a,u;for(o=t.clone(this.eventMaps),u=[],r=s=0,a=o.length;a>s;r=++s)i=o[r],i.listener!==e||n&&i.handlerMap!==n?u.push(void 0):(this.eventMaps.splice(r,1),u.push(i.eventPump.dispose()));return u},r.prototype.clear=function(){var e,n,r,i;for(n=t.clone(this.eventMaps),r=0,i=n.length;i>r;r++)e=n[r],e.eventPump.dispose();return this.eventMaps=[]},r.prototype.dispose=function(){return this.stop(),this.clear()},r}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(67),n(68)],i=function(t,e){"use strict";var n,r,i,o,s,a,u;return i=function(n){var r;return r=this.stage.point(n),this.captured=this.stage.capture(r),this.click_target=this.captured,t.draggable=!0,e.mousedown(this.captured,n,r),n.preventDefault?n.preventDefault():void 0},u=function(n){var r,i,o;return i=this.stage.point(n),this.captured=this.stage.capture(i),r=!1,this.listening_dbl_click?(r=!0,this.listening_dbl_click=!1):this.listening_dbl_click=!0,o=this,setTimeout(function(){return o.listening_dbl_click=!1},500),this.captured&&!t.dragging&&(e.mouseup(this.captured,n,i),this.click_target&&this.captured===this.click_target&&(e.click(this.captured,n,i),r&&(e.doubleclick(this.captured,n,i),this.listening_dbl_click=!1))),this.click_target=null,n.preventDefault?n.preventDefault():void 0},a=function(n){var r,i,o,s,a;if("undefined"==typeof n.webkitMovementX&&"undefined"==typeof n.webkitMovementY||0!==n.webkitMovementY||0!==n.webkitMovementX){if(a=this.stage.point(n),i=this.captured,this.captured=this.stage.capture(a),!t.dragging&&(this.captured&&e.mousemove(this.captured,n,a),this.captured!==i)){if(o=[this.captured],this.captured)for(;r=(r||this.captured).getContainer();)o.unshift(r);if(s=[i],i)for(;r=(r||i).getContainer();)s.unshift(r);for(;s[0]===o[0];)s.shift(),o.shift();for(;r=s.pop();)e.mouseout(r,n,a);for(;r=o.shift();)e.mouseover(r,n,a)}return t.draggable&&this.captured&&t.drag(this.captured,n,a),n.preventDefault?n.preventDefault():void 0}},s=function(t){var n,r,i;if(!this.dragging){if(this.captured){for(i=this.stage.point(t),n=this.captured,r=[this.captured];n=n.getContainer();)r.unshift(n);for(;n=r.pop();)e.mouseout(n,t,i)}return this.captured=null}},o=function(){},r=function(t){var n;return t.preventDefault(),n=this.stage.point(t),this.captured=this.stage.capture(n),e.contextmenu(this.captured,t,n)},n=function(){function t(t){this.stage=t,this.onmousemove=a.bind(this),this.onmouseleave=s.bind(this),this.onmouseenter=o.bind(this),this.onmouseup=u.bind(this),this.onmousedown=i.bind(this),this.oncontextmenu=r.bind(this),this.stage.html_container.addEventListener("mousemove",this.onmousemove),this.stage.html_container.addEventListener("mouseleave",this.onmouseleave),this.stage.html_container.addEventListener("mouseenter",this.onmouseenter),this.stage.html_container.addEventListener("mouseup",this.onmouseup),this.stage.html_container.addEventListener("mousedown",this.onmousedown),this.stage.html_container.addEventListener("contextmenu",this.oncontextmenu)}return t.prototype.dispose=function(){return this.stage.html_container.removeEventListener("mousemove",this.onmousemove),this.stage.html_container.removeEventListener("mouseleave",this.onmouseleave),this.stage.html_container.removeEventListener("mouseenter",this.onmouseenter),this.stage.html_container.removeEventListener("mouseup",this.onmouseup),this.stage.html_container.removeEventListener("mousedown",this.onmousedown),this.stage.html_container.removeEventListener("contextmenu",this.oncontextmenu)},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(68),n(67)],i=function(t,e){"use strict";var n,r,i,o;return o=function(e){var n,r,i;return n=this.stage.point(e),i=this.stage.capture(n),this.tap_target=i,r=this,this.longtouch_triggered=!1,this.longtouch_timer=setTimeout(function(){return r.longtouch_timer=null,i&&t.longtouch(i,e,n),r.longtouch_triggered=!0},500),t.touchstart(i,e,n),e.preventDefault?e.preventDefault():void 0},r=function(n){var r,i,o,s;return i=this.stage.point(n),s=this.stage.capture(i),this.longtouch_timer&&(clearTimeout(this.longtouch_timer),this.longtouch_timer=null),r=!1,this.listening_dbl_click?(r=!0,this.listening_dbl_click=!1):this.listening_dbl_click=!0,o=this,setTimeout(function(){return o.listening_dbl_click=!1},500),s&&!e.dragging&&(t.touchend(s,n,i),this.tap_target&&s===this.tap_target&&(t.tap(s,n,i),r&&(t.doubletap(s,n,i),this.listening_dbl_click=!1))),this.tap_target=null,n.preventDefault?n.preventDefault():void 0},i=function(n){var r,i;if(r=this.stage.point(n),this.longtouch_timer&&e.dragging)clearTimeout(this.longtouch_timer),this.longtouch_timer=null;else if(this.longtouch_triggered)return void(n.preventDefault&&n.preventDefault());return i=this.stage.capture(r),!e.dragging&&i&&(t.touchmove(i,n,r),n.preventDefault&&n.preventDefault()),e.drag(i,n,r),n.preventDefault?n.preventDefault():void 0},n=function(){function t(t){this.stage=t,this.ontouchstart=o.bind(this),this.ontouchmove=i.bind(this),this.ontouchend=r.bind(this),this.stage.html_container.addEventListener("touchstart",this.ontouchstart),this.stage.html_container.addEventListener("touchmove",this.ontouchmove),this.stage.html_container.addEventListener("touchend",this.ontouchend)}return t.prototype.dispose=function(){return this.stage.html_container.removeEventListener("touchstart",this.ontouchstart),this.stage.html_container.removeEventListener("touchmove",this.ontouchmove),this.stage.html_container.removeEventListener("touchend",this.ontouchend)},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(){function t(t){this.binder=t,this.exports={}}return t.prototype.dispose=function(){var t,e,n,r,i;for(e=Object.keys(this.exports),i=[],n=0,r=e.length;r>n;n++)t=e[n],i.push(this.remove(t));return i},t.prototype["import"]=function(t,e,n){var r,i,o;if(e){o={};for(r in e)i=e[r],o[r]=i instanceof Function?i.bind(n||this.binder):i;return this.exports[t]=o}},t.prototype.remove=function(t){return delete this.exports[t]},t.prototype.require=function(t){return this.exports[t]},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n,r=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};e=[],n=function(){"use strict";var t,e;return e=["extended","included"],t=function(){function t(){}return t.extend=function(t){var n,i,o;for(n in t)i=t[n],r.call(e,n)<0&&(console.log(n,i),this[n]=i);return null!=(o=t.extended)&&o.apply(this),this},t.include=function(t){var n,i,o;for(n in t)i=t[n],r.call(e,n)<0&&(this.prototype[n]=i);return null!=(o=t.included)&&o.apply(this),this},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(65)],i=function(t){"use strict";return t}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(70)],i=function(t){"use strict";var e;return e=function(){function e(){this.reset()}return e.prototype.dispose=function(){return this.reset()},e.prototype.execute=function(e){return!e instanceof t?void 0:(e.execute(),this.exq.push(e),this.uxq=[])},e.prototype.undo=function(){var t;return t=this.exq.pop(),t?(t.unexecute(),this.uxq.push(t)):void 0},e.prototype.redo=function(){var t;return t=this.uxq.pop(),t?(t.execute(),this.exq.push(t)):void 0},e.prototype.undoable=function(){return this.exq.length>0},e.prototype.redoable=function(){return this.uxq.length>0},e.prototype.reset=function(){return this.exq=[],this.uxq=[]},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e;return t=function(t,e){var n;if(e.event_map)return n=e.event_map(),this.eventEngine.add(e,n,e)},e=function(t,e){return this.eventEngine.remove(e)},{"(root)":{"(all)":{add:t,remove:e}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(39)],i=function(t){"use strict";var e;return e={silentSet:function(e,n){var r,i,s,a;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return i={},i[e]=n,this.silentSet(i);this.attrs||(this.attrs={}),i=e,r={},s=t.clone(this.attrs),t.assign(this.attrs,i),a=this.attrs;for(e in a)o.call(a,e)&&(n=a[e],n!==s[e]?r[e]=n:delete s[e]);return this},set:function(e,n){var r,i,s,a;if(!e)return this;if(arguments.length>1&&"string"==typeof arguments[0])return i={},i[e]=n,this.set(i);this.attrs||(this.attrs={}),i=e,r={},s=t.clone(this.attrs),t.assign(this.attrs,i),a=this.attrs;for(e in a)o.call(a,e)&&(n=a[e],n!==s[e]?r[e]=n:delete s[e]);return 0!==Object.keys(r).length&&this.trigger("change",this,s,r),this},get:function(t){var e;if(this.attrs&&this.attrs.hasOwnProperty(t))return this.attrs[t];if(this.property_spec)return e=this.property_spec[t],e?e["default"]:void 0},getAll:function(){return this.attrs?t.clone(this.attrs):{}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={initialize:function(t,e){return this.attrs=t,this.property_spec=e,this},dispose:function(){}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(39),n(69)],i=function(t,e){"use strict";var n,r,i,o,s,a,u,c;n={on:function(t,e,n){var r;return o(this,"on",t,[e,n])&&e?(this._listeners||(this._listeners={}),r=this._listeners[t]||(this._listeners[t]=[]),r.push({callback:e,context:n,ctx:n||this}),this):this},once:function(e,n,r){var i,s;return o(this,"once",e,[n,r])&&n?(s=this,i=t.once(function(){return s.off(e,i),n.apply(this,arguments)}),i._callback=n,this.on(e,i,r)):this},off:function(t,e,n){var r,i,s,a,u,c,p,h,l,f;if(!this._listeners||!o(this,"off",t,[e,n]))return this;if(!t&&!e&&!n)return this._listeners=void 0,this;for(u=t?[t]:Object.keys(this._listeners),s=p=0,l=u.length;l>p;s=++p)if(t=u[s],i=this._listeners[t]){if(this._listeners[t]=c=[],e||n)for(a=h=0,f=i.length;f>h;a=++h)r=i[a],(e&&e!==r.callback&&e!==r.callback._callback||n&&n!==r.context)&&c.push(r);c.length||delete this._listeners[t]}return this},delegate_on:function(t){return this._delegators||(this._delegators=new e.List),this._delegators.append(t),this},delegate_off:function(t){return this._delegators?(this._delegators.remove(t),this):this},delegate:function(){var t,e,n;return this._delegators&&this._delegators.size()>0&&r(this._delegators,arguments),this._listeners?(t=arguments[arguments.length-1],t.deliverer=this,e=this._listeners[t.name],n=this._listeners.all,e&&c(e,arguments),n&&c(n,arguments),this):this},trigger:function(t){var e,n,i;return e=[].slice.call(arguments,1),e.push({origin:this,name:t,deliverer:this}),this._delegators&&this._delegators.size()>0&&r(this._delegators,e),this._listeners&&o(this,"trigger",t,e)?(n=this._listeners[t],i=this._listeners.all,n&&c(n,e),i&&c(i,e),this):this},stopListening:function(e,n,r){var i,o,s;if(o=this._listeningTo,!o)return this;s=!n&&!r,r||"object"!=typeof n||(r=this),e&&((o={})[e._listenId]=e);for(i in o)e=o[i],e.off(n,r,this),(s||t.isEmpty(e._events))&&delete this._listeningTo[i];return this}},i=/\s+/,o=function(t,e,n,r){var o,s,a,u,c;if(!n)return!0;if("object"==typeof n){for(o in n)a=n[o],t[e].apply(t,[o,a].concat(r));return!1}if(i.test(n)){for(s=n.split(i),u=0,c=s.length;c>u;u++)a=s[u],t[e].apply(t,[a].concat(r));return!1}return!0},c=function(t,e){var n,r,i,o;for(o=[],r=0,i=t.length;i>r;r++)n=t[r],o.push(n.callback.apply(n.ctx,e));return o},r=function(t,e){return t.forEach(function(t){return n.delegate.apply(t,e)
4
+ })},a={listenTo:"on",listenToOnce:"once"};for(u in a)s=a[u],n[u]=function(e,n,r){var i,o;return o=this._listeningTo||(this._listeningTo={}),i=e._listenId||(e._listenId=t.uniqueId("l")),o[i]=e,r||"object"!=typeof n||(r=this),e[s](n,r,this),this};return n}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={serialize:function(){return["type: "+this.name,"id: "+this.id,"props: "+JSON.stringify(this.attrs)].join(",")},deserialize:function(){}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n,r;return t=function(t,e,n,r){return t.trigger("add",e,n,r)},e=function(t,e,n,r){return t.trigger("added",e,n,r)},n=function(t,e,n){return t.trigger("remove",e,n)},r=function(t,e,n){return t.trigger("removed",e,n)},{add:t,added:e,remove:n,removed:r}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={dockType:function(){},dockPoints:function(){var t,e,n,r;return n=this.get("x"),r=this.get("y"),e=this.get("w"),t=this.get("h"),[[n,r],[n+e,r],[n,r+t],[n+e,r+t]]}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={center:function(){return{x:this.get("x")+this.get("w")/2,y:this.get("y")+this.get("h")/2}},shape:function(){},capture_shape:function(t){return this.shape(t)},draw:function(t){var e,n;return t?(t.beginPath(),n=this.get("rotate")||0,e=this.center(),t.save(),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),this.shape(t),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),this.get("strokeStyle")&&(t.lineWidth=this.get("lineWidth"),t.strokeStyle=this.get("strokeStyle"),t.stroke()),t.restore()):this.getContainer().draw()},capture:function(t,e){var n,r,i;return e.beginPath(),i=this.get("rotate")||0,n=this.center(),e.save(),e.translate(n.x,n.y),e.rotate(i*Math.PI/180),e.translate(-n.x,-n.y),this.capture_shape(e),this.get("strokeStyle")&&(e.lineWidth=this.get("lineWidth")),r=!!this.get("strokeStyle")&&e.isPointInStroke(t.x,t.y)||!!this.get("fillStyle")&&e.isPointInPath(t.x,t.y),e.restore(),r?this:null}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(t,e,n){var r,i,o,s,a,u,c;if(e>2)return t;if("number"==typeof e||(e=0),"boolean"==typeof n||(n=!1),a=!1,c=function(t){var e,n,r,i;for(n="",e=r=0,i=t-1;i>=0?i>=r:r>=i;e=i>=0?++r:--r)return n+=" "},u="","undefined"==typeof t)u+="undefined";else if("boolean"==typeof t||"number"==typeof t)u+=t.toString();else if("string"==typeof t)u+='"'+t+'"';else if(null===t)u+="null";else if(t instanceof Array)if(t.length>0){n&&(a=!0),r="";for(o in t)i=t[o],r+=pp(i,e+1)+",\n"+c(e+1);r=r.replace(/,\n\s*$/,"").replace(/^\s*/,""),u+="[ "+r+"\n"+c(e)+"]"}else u+="[]";else if("object"==typeof t)if(Object.keys(t).length>0){n&&(a=!0),r="";for(s in t)r+=c(e+1)+s.toString()+": "+pp(t[s],e+2,!0)+",\n";r=r.replace(/,\n\s*$/,"").replace(/^\s*/,""),u+="{ "+r+"\n"+c(e)+"}"}else u+="{}";else u+=t.toString();return(a?"\n"+c(e):"")+u}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={center:function(){return{x:this.get("x")+this.get("w")/2,y:this.get("y")+this.get("h")/2}},shape:function(t){return t.rect(this.get("x"),this.get("y"),this.get("w"),this.get("h"))},draw:function(t){var e,n;return t?(t.beginPath(),n=this.get("rotate")||0,e=this.center(),t.save(),t.translate(e.x,e.y),t.rotate(n*Math.PI/180),t.translate(-e.x,-e.y),this.shape(t),this.get("fillStyle")&&(t.fillStyle=this.get("fillStyle"),t.fill()),this.get("strokeStyle")&&(t.lineWidth=this.get("lineWidth"),t.strokeStyle=this.get("strokeStyle"),t.stroke()),this.get("clip")&&t.clip(),t.translate(this.get("x"),this.get("y")),this.forEach(function(e){return e.draw(t)}),t.restore()):this.getContainer().draw()},capture:function(t,e){var n,r,i,o,s,a,u,c;if(e.beginPath(),r=this.center(),a=(this.get("rotate")||0)*Math.PI/180,e.save(),e.translate(r.x,r.y),e.rotate(a),e.translate(-r.x,-r.y),this.shape(e),e.lineWidth=this.get("lineWidth"),n=null,s=e.isPointInPath(t.x,t.y)||!!this.get("strokeStyle")&&e.isPointInStroke(t.x,t.y),(!this.get("clip")||s)&&this.size()>0)for(e.translate(this.get("x"),this.get("y")),o=u=c=this.size()-1;(0>=c?0>=u:u>=0)&&(i=this.getAt(o),!(n=i.capture(t,e)));o=0>=c?++u:--u);return e.restore(),n?n:this.get("capturable")===!1?null:s?this:null}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t=function(){return this.draw()},{"(self)":{"(all)":{added:t,removed:t,change:t}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n,r=function(t,e){return function(){return t.apply(e,arguments)}};e=[],n=function(){"use strict";var t,e;return e=1,t=function(){function t(t,e){this.context=t,this.fn=e,this.dispose=r(this.dispose,this),this.flag=!1}return t.prototype.pend=function(){return this.flag?void 0:(this.flag=!0,setTimeout(function(t){return function(){return t.pended()}}(this),e))},t.prototype.pended=function(){return this.flag=!1,this.fn.call(this.context)},t.prototype.dispose=function(){return this.context=null,this.fn=null},t}()}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(39)],i=function(){"use strict";var t,e,n,r;return e={ondragstart:function(t){return this.handle_last_position={x:t.offsetX,y:t.offsetY}},ondrag:function(t){var e,n,r,i;return e={x:t.offsetX-this.handle_last_position.x,y:t.offsetY-this.handle_last_position.y},n=this.get("x")+e.x,r=this.get("y")+e.y,i={x:n,y:r},this.set(i),this.handle_last_position={x:t.offsetX,y:t.offsetY},this.draw()},ondragend:function(){return this.handle_last_position=null}},t={ondragstart:function(t){return this.edge_last_position={x:t.offsetX,y:t.offsetY},this.last_ratio=this.get("ratio")},ondrag:function(t){var e,n;return e=t.offsetY-this.edge_last_position.y,n=Math.min(Math.max(this.last_ratio+e/20,.5),4),this.set("ratio",n),this.draw()},ondragend:function(){return this.edge_last_position=null}},r=function(){return this.draw()},n=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),n.hasOwnProperty("r")?(this.set({w:2*n.r,h:2*n.r}),this.canvas.setAttribute("width",2*n.r),this.canvas.setAttribute("height",2*n.r)):void 0},{"?magnify-target":{"(all)":{change:r}},"(self)":{"(self)":{change:n},"#magnify-handle":{dragstart:e.ondragstart,drag:e.ondrag,dragend:e.ondragend},"#magnify-edge":{dragstart:t.ondragstart,drag:t.ondrag,dragend:t.ondragend}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(39)],i=function(t){"use strict";var e,n,r,i,o,s,a,u,c;return c=function(e,n){return t.contains(e,n)?t.pull(e,n):e.unshift(n),e},a=function(e,n){return t.contains(e,n)?e:[n]},u=function(e,n){return t.contains(e,n)?e:(e.unshift(n),e)},o=function(t){return this.selections=t.origin.shiftKey?u(this.selections,t.target):a(this.selections,t.target),this.setFocus(this.selections[0]),this.draglast_position={x:t.offsetX,y:t.offsetY}},r=function(t){return this.offset={x:t.offsetX-this.draglast_position.x,y:t.offsetY-this.draglast_position.y},this.draw()},i=function(){var t,e,n,r;for(r=this.selections,e=0,n=r.length;n>e;e++)t=r[e],t.move&&t.move({delta:this.offset});return this.offset=null,this.draw()},n=function(t){return this.selections=t.origin.shiftKey?c(this.selections,t.target):a(this.selections,t.target),this.setFocus(this.selections[0]),this.draw()},e=function(e,n,r){var i;return i=t.pick(r,["offset-x","offset-y","x","y"]),t.isEmpty(i)?void 0:this.set(i)},s=function(t,e,n){return n.hasOwnProperty("x")&&(this.canvas.style.left=n.x+"px"),n.hasOwnProperty("y")&&(this.canvas.style.top=n.y+"px"),this.draw()},{"?target":{"(all)":{click:n,tap:n,dragstart:o,drag:r,dragend:i},"?target":{change:e}},"(self)":{"(self)":{change:s}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n;return n=function(t){return this.slide_last_position={x:t.offsetX,y:t.offsetY}},t=function(t){var e,n;return e={x:t.offsetX-this.slide_last_position.x,y:t.offsetY-this.slide_last_position.y},this.slide_target=this.slide_target||this.select(this.get("slide-target"))[0],n={x:this.slide_target.get("offset-x"),y:this.slide_target.get("offset-y")},this.slide_target.set({"offset-x":n.x+e.x,"offset-y":n.y+e.y}),this.slide_handle.move({delta:e}),this.slide_last_position={x:t.offsetX,y:t.offsetY},this.draw()},e=function(){return this.slide_last_position=null,this.slide_handle.set({cx:this.canvas.width/2-this.get("offset-x"),cy:this.canvas.height/2-this.get("offset-y")}),this.draw()},{"(self)":{"#slide-handle":{dragstart:n,drag:t,dragend:e}}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(39),n(71)],i=function(t,e){"use strict";var n;return n=function(t){return e.show({x:t.origin.pageX,y:t.origin.pageY})},{"(root)":{"(all)":{contextmenu:n,longtouch:n}}}}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={x:{type:"number","default":0},y:{type:"number","default":0},w:{type:"number"},h:{type:"number"},rotate:{type:"number","default":0}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={lineWidth:{type:"number"},fillStyle:{type:"string"},strokeStyle:{type:"string"},alpha:{type:"number"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={cx:{type:"number","default":0},cy:{type:"number","default":0},r:{type:"number","default":100}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={path:{type:"array"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={font:{type:"string","default":"normal 10px verdana"}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t){var e,n;e=[],n=function(){"use strict";var t;return t={x1:{type:"number","default":0},y1:{type:"number","default":0},x2:{type:"number","default":100},y2:{type:"number","default":100}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(39),n(57)],i=function(t,e){"use strict";return t.merge({},e,{alpha:{type:"number","default":100},"offset-x":{type:"number","default":0},"offset-y":{type:"number","default":0}})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(39),n(57)],i=function(t,e){"use strict";return t.merge({},e,{alpha:{type:"number","default":100}})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(e){e.exports=t},function(t,e,n){var r,i,o={}.hasOwnProperty;r=[n(39),n(32)],i=function(t,e){"use strict";var n,r,i;return r=function(t,n,r,i,s){var a,u,c,p,h;h=[];for(p in r)o.call(r,p)&&(a=r[p],e.match(p,i.origin,n,t)&&h.push(function(){var t;t=[];for(u in a)o.call(a,u)&&(c=a[u],u===i.name&&(i.listener=n,t.push(c.apply(this,s))));return t}.call(this)));return h},i=function(){var t,e,n,i,o,s,a,u;for(t=arguments,e=t[t.length-1],n=this.eventPump,a=n.listeners,u=[],o=0,s=a.length;s>o;o++)i=a[o],u.push(r.call(this.context,n.deliverer,i.listener,i.clonedHandlers,e,t));return u},n=function(){function t(t){this.setDeliverer(t),this.listeners=[]}return t.prototype.setDeliverer=function(t){return this.deliverer=t},t.prototype.start=function(t){return this.deliverer.on("all",i,{context:t||null,eventPump:this})},t.prototype.stop=function(){return this.deliverer.off("all",i)},t.prototype.on=function(t,e){var n,r,i,o,s,a,u,c;for(n=_.clone(e),o=Object.keys(n),u=0,c=o.length;c>u;u++)i=o[u],0===i.indexOf("?")&&(r=n[i],a=i.substr(1),s=t.get(a),delete n[i],s?n[s]=r:console.log("EventPump#on","variable "+i+" is not evaluated on listener"));return this.listeners.push({listener:t,handlers:e,clonedHandlers:n})},t.prototype.off=function(t,e){var n,r,i,o,s,a;for(s=this.listeners,a=[],n=i=0,o=s.length;o>i;n=++i)r=s[n],a.push(r.listener!==t||e&&r.handlers!==e?void 0:this.listeners.splice(n,1));return a},t.prototype.clear=function(){return this.listeners=[]},t.prototype.dispose=function(){return this.stop(),this.clear()},t}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(68)],i=function(t){var e,n,r;return r=function(){},n=function(n){var r,i;return e.dragging=!1,i=e.target,i&&(r=i.getStage().point(n),t.dragend(e.target,n,r)),delete e.target,e.cleanup()},e={draggable:!1,dragging:!1,target:null,drag_end_target:null,start_point:null,last_point:null,cutoff:4,cleanup:function(){return this.target=null,this.drag_end_target=null,this.start_point=null,this.last_point=null,this.dragging=!1,this.draggable=!1},drag:function(e,n,r){var i;if(this.start_point||(this.start_point=r),!this.dragging&&e.get("draggable")){if(void 0!==n.touches&&(i=Math.max(Math.abs(r.x-this.start_point.x),Math.abs(r.y-this.start_point.y)),i<this.cutoff))return;this.dragging=!0,this.target=e,t.dragstart(e,n,this.start_point)}return this.dragging?(this.last_point=r,t.drag(this.target,n,r)):void 0}},document.addEventListener("mouseup",r,!0),document.addEventListener("touchend",r,!0),document.addEventListener("mouseup",n,!1),document.addEventListener("touchend",n,!1),e}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t,e,n){var r,i;r=[n(39)],i=function(t){"use strict";var e,n,r;return r=function(t,e,n,r){var i,o;return r||(o=t.getStage(),r=o.point(n)),i={origin:n,type:e,target:t,offsetX:r.x,offsetY:r.y},t.trigger(i.type,i)},e=function(t){return function(e,n,i){return r(e,t,n,i)}},n=["mousemove","mousedown","mouseup","click","doubleclick","contextmenu","mouseover","mouseout","dragstart","drag","dragend","touchstart","touchmove","touchend","longtouch","tap","doubletap"],t.reduce(n,function(t,n){return t[n]=e(n),t},{})}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n,r={}.hasOwnProperty;e=[],n=function(){"use strict";var t,e,n,i,o;return i={insertAt:function(t,e){return this.__collection__?(t=this.__collection__.indexOf(e),-1===this.__collection__.indexOf(e)&&this.__collection__.splice(t,0,e),this):this},append:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.push(t),this},prepend:function(t){return this.__collection__||(this.__collection__=[]),-1===this.__collection__.indexOf(t)&&this.__collection__.unshift(t),this},remove:function(t){var e;return this.__collection__?(e=this.__collection__.indexOf(t),e>-1&&this.__collection__.splice(e,1),this):this},getAt:function(t){return this.__collection__?this.__collection__[t]:void 0},forEach:function(t,e){return this.__collection__?this.__collection__.forEach(t,e):this},indexOf:function(t){return(this.__collection__||[]).indexOf(t)},size:function(){return(this.__collection__||[]).length},clear:function(){return this.__collection__=[]},moveForward:function(t){var e;return e=this.indexOf(t),-1!==e&&0!==e?(this.__collection__[e]=this.__collection__[e-1],this.__collection__[e-1]=t):void 0},moveBackward:function(t){var e;return e=this.indexOf(t),-1!==e&&e!==this.size()-1?(this.__collection__[e]=this.__collection__[e+1],this.__collection__[e+1]=t):void 0},moveToHead:function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&0!==n?(e=this.__collection__.splice(0,n),r=this.__collection__.splice(1),this.__collection__=this.__collection__.concat(e,r)):void 0},moveToTail:function(t){var e,n,r;return n=this.indexOf(t),-1!==n&&n!==this.size()-1?(e=this.__collection__.splice(0,n),r=this.__collection__.splice(1),this.__collection__=e.concat(r,this.__collection__)):void 0}},o={push:function(){throw new Error("Not Implemented Yet")},pop:function(){throw new Error("Not Implemented Yet")}},e=function(){},e.prototype=i,n=function(){},n.prototype=o,t={List:e,Stack:n,withList:function(){var t,e,n;n=[];for(t in i)r.call(i,t)&&(e=i[t],n.push(this[t]=e));return n},withStack:function(){var t,e,n;n=[];for(t in o)r.call(o,t)&&(e=o[t],n.push(this[t]=e));return n}}}.apply(null,e),!(void 0!==n&&(t.exports=n))},function(t,e,n){var r,i;r=[n(39)],i=function(t){"use strict";var e;return e=function(){function e(e){this.params=t.clone(e)}return e.prototype.execute=function(){},e.prototype.unexecute=function(){},e}()}.apply(null,r),!(void 0!==i&&(t.exports=i))},function(t){var e,n;e=[],n=function(){"use strict";var t,e,n,r,i,o;return o='<ul id="context-menu" class="things-context-menu"> <li><a href="http://cooking.hatiolab.com/">Cooking</a></li> <li><a href="http://www.naver.com">Naver</a></li> </ul>',t=document.createElement("div"),t.style.position="absolute",t.style.display="inline-block",t.style.zIndex=1e3,document.body.appendChild(t),t.innerHTML=o,e=document.getElementById("context-menu"),n=function(){return document.removeEventListener("click",n),document.removeEventListener("touchstart",n),setTimeout(r,100)},i=function(r){return t.style.top=r.y+"px",t.style.left=r.x+"px",e.style.display="block",document.addEventListener("click",n),document.addEventListener("touchstart",n)},r=function(){return e.style.display="none"},{show:i,hide:r}}.apply(null,e),!(void 0!==n&&(t.exports=n))}])});
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: things-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hearty, Oh