text: var lib=webpackJsonplib([0,4],{0:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.BeaconMap=void 0;var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(1),u=i(a),c=(n(34),n(36)),l=(n(37),n(38)),d=n(42),f=n(56),h=r(f),p=n(193),y=n(202),v=r(y),_=n(203),b=[],g=new Set;t.BeaconMap=function(){function e(t,n){o(this,e),this._mapContainerId=t,this._gridConfig=n;var r=this,i=(0,d.combineReducers)({brushes:l.brushes,pins:c.pins});$.ajax({url:n.beaconPinListUrl,async:!1,dataType:"json",cache:!1,success:function(e){r._store=(0,d.createStore)(i,{brushes:void 0,pins:{pins:v.objToMap(e.pins),currentPin:{id:null,name:null,position:{x:null,y:null}}}}),r._store.subscribe(r.render.bind(r))}})}return s(e,[{key:"init",value:function(){var e=this;document.addEventListener("contextmenu",function(e){return e.preventDefault(),!1}),document.addEventListener("mousedown",function(t){b=[],g.clear(),1==t.buttons?e._store.dispatch({type:"TOGGLE_BRUSH",index:0}):2==t.buttons&&e._store.dispatch({type:"TOGGLE_BRUSH",index:1}),e._store.getState().brushes.currentBrush.activated=!0}),document.addEventListener("mouseup",function(t){e._store.getState().brushes.currentBrush.activated=!1}),document.addEventListener("dragend",function(t){e._store.getState().brushes.currentBrush.activated=!1}),this.render()}},{key:"render",value:function(){h.render(u["default"].createElement(p.Provider,{store:this._store},u["default"].createElement(_.App,{gridConfig:this._gridConfig})),document.getElementById(this._mapContainerId))}}]),e}()},34:function(e,t,n){function r(e,t,n){var r=t&&n||0,i=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){i<16&&(t[r+i++]=c[e])});i<16;)t[r+i++]=0;return t}function i(e,t){var n=t||0,r=u;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]}function o(e,t,n){var r=t&&n||0,o=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:h,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:y+1,c=a-p+(u-y)/1e4;if(c<0&&void 0===e.clockseq&&(s=s+1&16383),(c<0||a>p)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=a,y=u,h=s,a+=122192928e5;var l=(1e4*(268435455&a)+u)%4294967296;o[r++]=l>>>24&255,o[r++]=l>>>16&255,o[r++]=l>>>8&255,o[r++]=255&l;var d=a/4294967296*1e4&268435455;o[r++]=d>>>8&255,o[r++]=255&d,o[r++]=d>>>24&15|16,o[r++]=d>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var v=e.node||f,_=0;_<6;_++)o[r+_]=v[_];return t?t:i(o)}function s(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;s++)t[r+s]=o[s];return t||i(o)}for(var a=n(35),u=[],c={},l=0;l<256;l++)u[l]=(l+256).toString(16).substr(1),c[u[l]]=l;var d=a(),f=[1|d[0],d[1],d[2],d[3],d[4],d[5]],h=16383&(d[6]<<8|d[7]),p=0,y=0,v=s;v.v1=o,v.v4=s,v.parse=r,v.unparse=i,e.exports=v},35:function(e,t){(function(t){var n,r=t.crypto||t.msCrypto;if(r&&r.getRandomValues){var i=new Uint8Array(16);n=function(){return r.getRandomValues(i),i}}if(!n){var o=new Array(16);n=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}e.exports=n}).call(t,function(){return this}())},36:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pins=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=n(37);t.pins=function(e,t){var n=void 0;if("undefined"==typeof e){var o=new Map;e={pins:o,currentPin:(0,i.pin)(void 0,t)}}switch(t.type){case"TOGGLE_PIN":return n=r({},e),n.currentPin=e.pins.get(t.name),n;case"ADD_PIN":return n=r({},e),n.pins.set(t.name,(0,i.pin)(void 0,t)),n;case"SET_PIN_POSITION":return n=r({},e),n.pins.set(t.name,(0,i.pin)(void 0,t)),n;case"CLEAR_PINS":return n=r({},e),n.pins=new Map,n;case"DELETE_PIN":return n=r({},e),n.pins["delete"](t.name),n.currentPin=(0,i.pin)(void 0,t),n;default:return e}}},37:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.pin=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:null,name:null,x:null,y:null},t=arguments[1],r=void 0;switch(t.type){case"SET_PIN_POSITION":case"ADD_PIN":return r=n({},e),r.id=t.id,r.name=t.name,r.x=t.x,r.y=t.y,r;default:return e}}},38:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.brushes=void 0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=n(39),a=i(s),u=n(40),c=n(41),l=r(c);t.brushes=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{brushes:[new a["default"](l.colors[l.WALL]),new a["default"](l.colors[l.EMPTY])],currentBrush:new a["default"](l.colors[l.EMPTY])},t=arguments[1];switch(t.type){case"TOGGLE_BRUSH":var n=o({},e);return n.currentBrush=n.brushes[t.index],n.brushes=[new a["default"](l.colors[l.WALL]),new a["default"](l.colors[l.EMPTY])],n.brushes[t.index]=(0,u.brush)(n.brushes[t.index],t),n;default:return e}}},39:function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16777215,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];n(this,e),this._color=t,this._activated=r,this._toggled=i}return r(e,[{key:"color",get:function(){return this._color},set:function(e){this._color=e}},{key:"activated",get:function(){return this._activated},set:function(e){this._activated=e}},{key:"toggled",get:function(){return this._toggled},set:function(e){this._toggled=e}}]),e}();t["default"]=i},40:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0}),t.brush=void 0;var i=n(39),o=r(i);t.brush=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new o["default"],t=arguments[1];switch(t.type){case"TOGGLE_BRUSH":var n=new o["default"](e.color,e.activate,(!0));return n;default:return e}}},41:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=t.EMPTY=0,r=t.WALL=1,i=(t.PIN=2,t.PIN_COLOR=32767,t.colors=[]);i[n]=16777215,i[r]=0;var o=t.web_colors=[];o[16777215]="#fff",o[0]="#000"},42:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){}t.__esModule=!0,t.compose=t.applyMiddleware=t.bindActionCreators=t.combineReducers=t.createStore=void 0;var o=n(43),s=r(o),a=n(51),u=r(a),c=n(53),l=r(c),d=n(54),f=r(d),h=n(55),p=r(h),y=n(52),v=r(y);"string"==typeof i.name&&"isCrushed"!==i.name&&(0,v["default"])("You are currently using minified code outside of NODE_ENV === 'production'. This means that you are running a slower development build of Redux. You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify or DefinePlugin for webpack (http://stackoverflow.com/questions/30030031) to ensure you have the correct code for your production build."),t.createStore=s["default"],t.combineReducers=u["default"],t.bindActionCreators=l["default"],t.applyMiddleware=f["default"],t.compose=p["default"]},43:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){_===v&&(_=v.slice())}function o(){return y}function a(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),_.push(e),function(){if(t){t=!1,r();var n=_.indexOf(e);_.splice(n,1)}}}function l(e){if(!(0,s["default"])(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(b)throw new Error("Reducers may not dispatch actions.");try{b=!0,y=p(y,e)}finally{b=!1}for(var t=v=_,n=0;n<t.length;n++)t[n]();return e}function d(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");p=e,l({type:c.INIT})}function f(){var e,t=a;return e={subscribe:function(e){function n(){e.next&&e.next(o())}if("object"!=typeof e)throw new TypeError("Expected the observer to be an object.");n();var r=t(n);return{unsubscribe:r}}},e[u["default"]]=function(){return this},e}var h;if("function"==typeof t&&"undefined"==typeof n&&(n=t,t=void 0),"undefined"!=typeof n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(i)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var p=e,y=t,v=[],_=v,b=!1;return l({type:c.INIT}),h={dispatch:l,subscribe:a,getState:o,replaceReducer:d},h[u["default"]]=f,h}t.__esModule=!0,t.ActionTypes=void 0,t["default"]=i;var o=n(44),s=r(o),a=n(48),u=r(a),c=t.ActionTypes={INIT:"@@redux/INIT"}},44:function(e,t,n){function r(e){if(!o(e)||f.call(e)!=s)return!1;var t=i(e);if(null===t)return!0;var n=l.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==d}var i=n(45),o=n(47),s="[object Object]",a=Function.prototype,u=Object.prototype,c=a.toString,l=u.hasOwnProperty,d=c.call(Object),f=u.toString;e.exports=r},45:function(e,t,n){var r=n(46),i=r(Object.getPrototypeOf,Object);e.exports=i},46:function(e,t){function n(e,t){return function(n){return e(t(n))}}e.exports=n},47:function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},48:function(e,t,n){e.exports=n(49)},49:function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(50),o=r(i),s=void 0;"undefined"!=typeof e?s=e:"undefined"!=typeof window&&(s=window);var a=(0,o["default"])(s);t["default"]=a}).call(t,function(){return this}())},50:function(e,t){"use strict";function n(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=n},51:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=t&&t.type,r=n&&'"'+n.toString()+'"'||"an action";return"Given action "+r+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state.'}function o(e,t,n,r){var i=Object.keys(t),o=n&&n.type===u.ActionTypes.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!(0,l["default"])(e))return"The "+o+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following '+('keys: "'+i.join('", "')+'"');var s=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!r[e]});return s.forEach(function(e){r[e]=!0}),s.length>0?"Unexpected "+(s.length>1?"keys":"key")+" "+('"'+s.join('", "')+'" found in '+o+". ")+"Expected to find one of the known reducer keys instead: "+('"'+i.join('", "')+'". Unexpected keys will be ignored.'):void 0}function s(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:u.ActionTypes.INIT});if("undefined"==typeof r)throw new Error('Reducer "'+t+'" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined.');var i="@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".");if("undefined"==typeof n(void 0,{type:i}))throw new Error('Reducer "'+t+'" returned undefined when probed with a random type. '+("Don't try to handle "+u.ActionTypes.INIT+' or other actions in "redux/*" ')+"namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined.")})}function a(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var a=t[r];"undefined"==typeof e[a]&&(0,f["default"])('No reducer provided for key "'+a+'"'),"function"==typeof e[a]&&(n[a]=e[a])}var u,c=Object.keys(n),l={};try{s(n)}catch(d){u=d}return function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],t=arguments[1];if(u)throw u;var r=o(e,n,t,l);r&&(0,f["default"])(r);for(var s=!1,a={},d=0;d<c.length;d++){var h=c[d],p=n[h],y=e[h],v=p(y,t);if("undefined"==typeof v){var _=i(h,t);throw new Error(_)}a[h]=v,s=s||v!==y}return s?a:e}}t.__esModule=!0,t["default"]=a;var u=n(43),c=n(44),l=r(c),d=n(52),f=r(d)},52:function(e,t){"use strict";function n(e){"undefined"!=typeof console&&"function"==typeof console.error;try{throw new Error(e)}catch(t){}}t.__esModule=!0,t["default"]=n},53:function(e,t){"use strict";function n(e,t){return function(){return t(e.apply(void 0,arguments))}}function r(e,t){if("function"==typeof e)return n(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),i={},o=0;o<r.length;o++){var s=r[o],a=e[s];"function"==typeof a&&(i[s]=n(a,t))}return i}t.__esModule=!0,t["default"]=r},54:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r,i){var s=e(n,r,i),u=s.dispatch,c=[],l={getState:s.getState,dispatch:function(e){return u(e)}};return c=t.map(function(e){return e(l)}),u=a["default"].apply(void 0,c)(s.dispatch),o({},s,{dispatch:u})}}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t["default"]=i;var s=n(55),a=r(s)},55:function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};if(1===t.length)return t[0];var r=t[t.length-1],i=t.slice(0,-1);return function(){return i.reduceRight(function(e,t){return t(e)},r.apply(void 0,arguments))}}t.__esModule=!0,t["default"]=n},193:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.connect=t.Provider=void 0;var i=n(194),o=r(i),s=n(197),a=r(s);t.Provider=o["default"],t.connect=a["default"]},194:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(){h||(h=!0,(0,f["default"])("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions."))}t.__esModule=!0,t["default"]=void 0;var u=n(1),c=n(195),l=r(c),d=n(196),f=r(d),h=!1,p=function(e){function t(n,r){i(this,t);var s=o(this,e.call(this,n,r));return s.store=n.store,s}return s(t,e),t.prototype.getChildContext=function(){return{store:this.store}},t.prototype.render=function(){var e=this.props.children;return u.Children.only(e)},t}(u.Component);t["default"]=p,p.prototype.componentWillReceiveProps=function(e){var t=this.store,n=e.store;t!==n&&a()},p.propTypes={store:l["default"].isRequired,children:u.PropTypes.element.isRequired},p.childContextTypes={store:l["default"].isRequired}},195:function(e,t,n){"use strict";t.__esModule=!0;var r=n(1);t["default"]=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},196:function(e,t){"use strict";function n(e){"undefined"!=typeof console&&"function"==typeof console.error;try{throw new Error(e)}catch(t){}}t.__esModule=!0,t["default"]=n},197:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e){return e.displayName||e.name||"Component"}function u(e,t){try{return e.apply(t)}catch(n){return T.value=n,T}}function c(e,t,n){var r=arguments.length<=3||void 0===arguments[3]?{}:arguments[3],c=Boolean(e),f=e||x,p=void 0;p="function"==typeof t?t:t?(0,_["default"])(t):j;var v=n||M,b=r.pure,m=void 0===b||b,P=r.withRef,E=void 0!==P&&P,k=m&&v!==M,I=C++;return function(e){function t(e,t){(0,w["default"])(e)||(0,g["default"])(t+"() in "+r+" must return a plain object. "+("Instead received "+e+"."))}function n(e,n,r){var i=v(e,n,r);return t(i,"mergeProps"),i}var r="Connect("+a(e)+")",_=function(a){function h(e,t){i(this,h);var n=o(this,a.call(this,e,t));n.version=I,n.store=e.store||t.store,(0,S["default"])(n.store,'Could not find "store" in either the context or '+('props of "'+r+'". ')+"Either wrap the root component in a <Provider>, "+('or explicitly pass "store" as a prop to "'+r+'".'));var s=n.store.getState();return n.state={storeState:s},n.clearCache(),n}return s(h,a),h.prototype.shouldComponentUpdate=function(){return!m||this.haveOwnPropsChanged||this.hasStoreStateChanged},h.prototype.computeStateProps=function(e,n){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,n);var r=e.getState(),i=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(r,n):this.finalMapStateToProps(r);return t(i,"mapStateToProps"),i},h.prototype.configureFinalMapState=function(e,n){var r=f(e.getState(),n),i="function"==typeof r;return this.finalMapStateToProps=i?r:f,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,i?this.computeStateProps(e,n):(t(r,"mapStateToProps"),r)},h.prototype.computeDispatchProps=function(e,n){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,n);var r=e.dispatch,i=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(r,n):this.finalMapDispatchToProps(r);return t(i,"mapDispatchToProps"),i},h.prototype.configureFinalMapDispatch=function(e,n){var r=p(e.dispatch,n),i="function"==typeof r;return this.finalMapDispatchToProps=i?r:p,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,i?this.computeDispatchProps(e,n):(t(r,"mapDispatchToProps"),r)},h.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return(!this.stateProps||!(0,y["default"])(e,this.stateProps))&&(this.stateProps=e,!0)},h.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return(!this.dispatchProps||!(0,y["default"])(e,this.dispatchProps))&&(this.dispatchProps=e,!0)},h.prototype.updateMergedPropsIfNeeded=function(){var e=n(this.stateProps,this.dispatchProps,this.props);return!(this.mergedProps&&k&&(0,y["default"])(e,this.mergedProps))&&(this.mergedProps=e,!0)},h.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},h.prototype.trySubscribe=function(){c&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},h.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},h.prototype.componentDidMount=function(){this.trySubscribe()},h.prototype.componentWillReceiveProps=function(e){m&&(0,y["default"])(e,this.props)||(this.haveOwnPropsChanged=!0)},h.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},h.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},h.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!m||t!==e){if(m&&!this.doStatePropsDependOnOwnProps){var n=u(this.updateStatePropsIfNeeded,this);if(!n)return;n===T&&(this.statePropsPrecalculationError=T.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},h.prototype.getWrappedInstance=function(){return(0,S["default"])(E,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},h.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,i=this.statePropsPrecalculationError,o=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,i)throw i;var s=!0,a=!0;m&&o&&(s=n||t&&this.doStatePropsDependOnOwnProps,a=t&&this.doDispatchPropsDependOnOwnProps);var u=!1,c=!1;r?u=!0:s&&(u=this.updateStatePropsIfNeeded()),a&&(c=this.updateDispatchPropsIfNeeded());var f=!0;return f=!!(u||c||t)&&this.updateMergedPropsIfNeeded(),!f&&o?o:(E?this.renderedElement=(0,d.createElement)(e,l({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=(0,d.createElement)(e,this.mergedProps),this.renderedElement)},h}(d.Component);return _.displayName=r,_.WrappedComponent=e,_.contextTypes={store:h["default"]},_.propTypes={store:h["default"]},_.prototype.componentWillUpdate=function(){this.version!==I&&(this.version=I,this.trySubscribe(),this.clearCache())},(0,O["default"])(_,e)}}var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.__esModule=!0,t["default"]=c;var d=n(1),f=n(195),h=r(f),p=n(198),y=r(p),v=n(199),_=r(v),b=n(196),g=r(b),m=n(44),w=r(m),P=n(200),O=r(P),E=n(201),S=r(E),x=function(e){return{}},j=function(e){return{dispatch:e}},M=function(e,t,n){return l({},n,e,t)},T={value:null},C=0},198:function(e,t){"use strict";function n(e,t){if(e===t)return!0;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++)if(!i.call(t,n[o])||e[n[o]]!==t[n[o]])return!1;return!0}t.__esModule=!0,t["default"]=n},199:function(e,t,n){"use strict";function r(e){return function(t){return(0,i.bindActionCreators)(e,t)}}t.__esModule=!0,t["default"]=r;var i=n(42)},200:function(e,t){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0},i="function"==typeof Object.getOwnPropertySymbols;e.exports=function(e,t,o){if("string"!=typeof t){var s=Object.getOwnPropertyNames(t);i&&(s=s.concat(Object.getOwnPropertySymbols(t)));for(var a=0;a<s.length;++a)if(!(n[s[a]]||r[s[a]]||o&&o[s[a]]))try{e[s[a]]=t[s[a]]}catch(u){}}return e}},201:function(e,t,n){"use strict";var r=function(e,t,n,r,i,o,s,a){if(void 0===t)throw new Error("invariant requires an error message argument");if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,s,a],l=0;u=new Error(t.replace(/%s/g,function(){return c[l++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}};e.exports=r},202:function(e,t){"use strict";function n(e,t){var n=new Image;return n.onload=function(){e.fillPatternImage(n),e.fillPatternScaleX(e.width()/n.width),e.fillPatternScaleY(e.height()/n.height),t.draw()},n}function r(e){e.children.sort(function(e,t){return e.zIndex=e.zIndex||0,t.zIndex=t.zIndex||0,e.zIndex-t.zIndex})}function i(e){var t=Object.create(null),n=!0,r=!1,i=void 0;try{for(var o,a=e[Symbol.iterator]();!(n=(o=a.next()).done);n=!0){var u=s(o.value,2),c=u[0],l=u[1];t[c]=l}}catch(d){r=!0,i=d}finally{try{!n&&a["return"]&&a["return"]()}finally{if(r)throw i}}return t}function o(e){var t=new Map,n=!0,r=!1,i=void 0;try{for(var o,s=Object.keys(e)[Symbol.iterator]();!(n=(o=s.next()).done);n=!0){var a=o.value;t.set(a,e[a])}}catch(u){r=!0,i=u}finally{try{!n&&s["return"]&&s["return"]()}finally{if(r)throw i}}return t}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{!r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.makeImageRect=n,t.sortChildrenByZIndex=r,t.mapToObj=i,t.objToMap=o},203:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0;var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(204),l=i(c),d=n(208),f=i(d),h=n(209),p=n(1),y=r(p),v=t.App=function(e){function t(e,n){o(this,t);var r=s(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));return r._canvas=null,r._store=n.store,r}return a(t,e),u(t,[{key:"componentDidMount",value:function(){this._canvas=new l["default"](this._store,document.getElementById("canvas"),this.props.gridConfig)}},{key:"render",value:function(){var e=this._store.getState().brushes.brushes;return y.createElement("div",{className:"row-fluid"},y.createElement("div",{className:"col-md-10",id:"canvas-holder"},y.createElement("canvas",{id:"canvas"})),y.createElement("div",{className:"col-md-2"},y.createElement(h.BrushControls,{brushes:e}),y.createElement(f["default"],{canvas:this._canvas})))}}]),t}(y.Component);v.contextTypes={store:y.PropTypes.object}},204:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(205),u=i(a),c=n(41),l=r(c),d=n(206),f=r(d),h=null,p=function(){function e(t,n,r){function i(){s.render(h),requestAnimationFrame(i)}o(this,e),this._store=t,null!==h&&h.destroy(),this._width=r.width=r.width||10,this._height=r.height=r.height||10,this._dimensionX=r.dimensionX=r.dimensionX||100,this._dimensionY=r.dimensionY=r.dimensionY||100,this.beaconMapSaveUrl=r.beaconMapSaveUrl;var s=f.autoDetectRenderer(this._width*r.dimensionX,this._height*r.dimensionY,{view:n});s.plugins.interaction.moveWhenInside=!0,h=new f.Container,h.interactive=!0,this._grid=new u["default"](h,t,r),this._grid._promise.then(function(){this._grid.build()}.bind(this));var a=function(e){if(t.getState().brushes.currentBrush.activated){var n=Math.floor(e.data.global.x/this._width),r=Math.floor(e.data.global.y/this._height),i=t.getState().brushes.currentBrush.color;this._grid.drawRect({color:i,stroke:11184810,x:n*this._width,y:r*this._height,width:this._width,height:this._height}),Array.isArray(this._grid.rects[n])&&"undefined"!=typeof this._grid.rects[n][r]&&(this._grid.rects[n][r]=0===i?l.WALL:l.EMPTY)}}.bind(this);i(),this._grid._graphics.on("mousedown",a),this._grid._graphics.on("mousemove",a),this._grid._graphics.on("click",a)}return s(e,[{key:"clear",value:function(){this._grid.rects=[];for(var e=0;e<this._dimensionX;e++){this._grid.rects[e]=new Array(100);for(var t=0;t<this._dimensionY;t++)this._grid.rects[e][t]=0}this._grid.build(),this.save()}},{key:"save",value:function(){var e=JSON.stringify(this._grid.rects);$.ajax({url:this.beaconMapSaveUrl,type:"POST",data:{data:e},success:function(e){},cache:!1})}}]),e}();t["default"]=p},205:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(u){i=!0,o=u}finally{try{
  !r&&a["return"]&&a["return"]()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(206),c=i(u),l=n(207),d=r(l),f=n(41),h=i(f),p=n(202),y=i(p),v=(n(34),function(){function e(t,n,r){o(this,e),this._colors=h.colors,this._stage=t,this._width=r.width,this._height=r.height,this._dimensionX=r.dimensionX,this._dimensionY=r.dimensionY,this._beaconUrls={beaconPinSaveUrl:r.beaconPinSaveUrl,beaconPinListUrl:r.beaconPinListUrl,beaconPinDeleteUrl:r.beaconPinDeleteUrl,beaconMapGetUrl:r.beaconMapGetUrl},this._graphics=new c.Graphics,this._stage.addChild(this._graphics),this._graphics.interactive=!0,this._backgroundUrl=r.backgroundUrl,this._pins=new Map,this._store=n,this._promise=new Promise(function(e,t){c.loader.add(r.backgroundUrl).load(this.setupBackground.bind(this,e,t))}.bind(this))}return a(e,[{key:"build",value:function(){this._graphics.clear();var e=!0,t=!1,n=void 0;try{for(var r,i=this._pins[Symbol.iterator]();!(e=(r=i.next()).done);e=!0){var o=s(r.value,2),a=(o[0],o[1]);a.destroy()}}catch(u){t=!0,n=u}finally{try{!e&&i["return"]&&i["return"]()}finally{if(t)throw n}}for(var c=0;c<this._dimensionX;c++)for(var l=0;l<this._dimensionY;l++)this.drawRect({color:this._colors[this.rects[c][l]],stroke:11184810,x:c*this._width,y:l*this._height,width:this._width,height:this._height,opacity:this.rects[c][l]===h.EMPTY?.5:1});var d=this._store.getState().pins.pins,f=!0,p=!1,v=void 0;try{for(var _,b=d[Symbol.iterator]();!(f=(_=b.next()).done);f=!0){var g=s(_.value,2),m=(g[0],g[1]);this.addPin(m.x,m.y,m.id,m.name)}}catch(u){p=!0,v=u}finally{try{!f&&b["return"]&&b["return"]()}finally{if(p)throw v}}this._graphics.zIndex=1,y.sortChildrenByZIndex(this._stage)}},{key:"addPin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments[2],r=arguments[3];"undefined"!=typeof r&&(this._pins.has(r)||(this._store.dispatch({type:"ADD_PIN",id:n,name:r,x:e,y:t}),this._pins.set(r,new d["default"](e,t,n,r,this))))}},{key:"deletePin",value:function(e){this._pins.has(e)&&(this._store.dispatch({type:"DELETE_PIN",name:e}),this._pins.get(e).destroy(),this._pins["delete"](e))}},{key:"setupBackground",value:function(e,t){this._sprite=new c.Sprite(c.loader.resources[this._backgroundUrl].texture),this._sprite.width=this._width*this._dimensionX,this._sprite.height=this._height*this._dimensionY,this._sprite.x=0,this._sprite.y=0,this._stage.addChild(this._sprite),e()}},{key:"drawRect",value:function(e){this._graphics.beginFill(e.color,0),this._graphics.drawRect(e.x,e.y,e.width,e.height),this._graphics.endFill(),this._graphics.beginFill(e.color,e.opacity),this._graphics.lineStyle(1,e.stroke,1),this._graphics.drawRect(e.x,e.y,e.width,e.height),this._graphics.endFill()}},{key:"rects",get:function(){var e=this;return void 0===this._rects&&!function(){e._rects=null;var t=e;if($.ajax({url:t._beaconUrls.beaconMapGetUrl,type:"GET",dataType:"json",async:!1,success:function(e){t._rects=e}}),!Array.isArray(t._rects)){t._rects=[];for(var n=0;n<t._dimensionX;n++){t._rects[n]=new Array(t._dimensionX);for(var r=0;r<t._dimensionY;r++)t._rects[n][r]=0}}}(),this._rects},set:function(e){this._rects=e}},{key:"stage",get:function(){return this._stage}}]),e}());t["default"]=v},207:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=(n(34),n(41)),a=r(s),u=n(206),c=r(u),l=.2,d=.15,f=.27,h=.84,p="/img/blue pin.png",y=function(){function e(t,n,r,o,s){i(this,e),this._id=r,this._name=o,this._x=t,this._y=n,this._width=s._width,this._height=s._height,this._dimensionX=s._dimensionX,this._dimensionY=s._dimensionY,this._beaconPinWidth=this._width*this._dimensionX*l,this._beaconPinHeight=this._height*this._dimensionY*d,this._grid=s,this._rects=s.rects,this._stage=s._stage,this.save(t,n),this._counter=0,this._group=new c.Container,this._group.zIndex=2,this._stage.addChild(this._group),t*=this._width,n*=this._height,this._group.x=t,this._group.y=n,this._rect=new c.Graphics,e.drawRect(this._rect,{x:0,y:0,width:this._width,height:this._height,color:a.PIN_COLOR}),e.promise||(e.promise=new Promise(function(e){c.loader.add(p).load(function(){e()})})),e.promise.then(this.setup.bind(this,t,n)),this._group.interactive=!0,this._group.buttonMode=!0,this._group.on("mousedown",this.onDragStart).on("mousedown",this.onPinSelected.bind(this)).on("mouseup",this.onDragEnd()).on("mousedown",this.onPinSelected.bind(this)).on("mouseupoutside",this.onDragEnd()).on("mousemove",this.onDragMove()),this._group.addChild(this._rect)}return o(e,[{key:"save",value:function(e,t){$.ajax({url:this._grid._beaconUrls.beaconPinSaveUrl,type:"POST",data:{"BeaconPins[canvas_height]":this._height*this._dimensionX,"BeaconPins[canvas_width]":this._width*this._dimensionY,"BeaconPins[id]":this._id,"BeaconPins[name]":this._name,"BeaconPins[x]":e,"BeaconPins[y]":t}})}},{key:"setup",value:function(e,t){this._sprite=new c.Sprite(c.loader.resources[p].texture),this._beaconPinWidth=this._width*this._dimensionX*l,this._beaconPinHeight=this._height*this._dimensionY*d,this._sprite.width=this._beaconPinWidth,this._sprite.height=this._beaconPinHeight,this._sprite.x=-(this._beaconPinWidth*f),this._sprite.y=-(this._beaconPinHeight*h),this._group.addChild(this._sprite)}},{key:"onDragStart",value:function(e){this.data=e.data,this.dragging=!0}},{key:"onPinSelected",value:function(){this._grid._store.dispatch({type:"TOGGLE_PIN",name:this._name})}},{key:"onDragEnd",value:function(){var e=this;return function(t){this.dragging=!1,this.data=null;var n=t.data.getLocalPosition(this.parent),r=Math.round(n.x/e._width),i=Math.round(n.y/e._height);e._grid._store.dispatch({type:"SET_PIN_POSITION",id:e._id,name:e._name,x:r,y:i}),e.save(r,i)}}},{key:"onDragMove",value:function(){var e=this._width,t=this._height,n=this;return function(r){if(r.stopPropagation(),1==this.dragging){var i=r.data.getLocalPosition(this.parent),o=e*n._dimensionX,s=t*n._dimensionY;if(i.x>0&&i.y>0&&i.x<o&&i.y<s){var a=Math.round(i.x/e),u=Math.round(i.y/t);this.position.x=a*e,this.position.y=u*t}else i.x>=o&&(this.position.x=o-e),i.y>=s&&(this.position.y=s-t),i.x<=0&&(this.position.x=e),i.y<=0&&(this.position.y=t)}}}},{key:"destroy",value:function(){$.ajax({url:this._grid._beaconUrls.beaconPinDeleteUrl,type:"POST",data:{id:this._id}}),this._group.destroy()}},{key:"add",value:function(e,t){this.counter++}},{key:"counter",set:function(e){this._counter=e},get:function(){return this._counter}}],[{key:"drawRect",value:function(e,t){e.beginFill(t.color),e.lineStyle(1,t.stroke,1),e.drawRect(t.x,t.y,t.width,t.height),e.endFill()}}]),e}();t["default"]=y},208:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=r(u),l=(n(34),function(e){function t(e,n){return i(this,t),o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n))}return s(t,e),a(t,[{key:"render",value:function(){var e=this.context.store,t=e.getState(),n=this.props.canvas,r=t.pins.currentPin.name;return c.createElement("div",null,c.createElement("div",{className:"row"},c.createElement("div",{className:"form-group"},c.createElement("button",{className:"btn btn-default",onClick:function(){e.dispatch({type:"CLEAR_PINS"}),"undefined"!=typeof n&&null!==n&&n.clear()}.bind(this)},"Clear"),c.createElement("button",{className:"btn btn-default",onClick:function(){"undefined"!=typeof n&&null!==n&&n.save()}.bind(this)},"Save")),c.createElement("legend",null,"Manage panel"),c.createElement("div",{className:"form-group"},c.createElement("input",{id:"beacon-pin",type:"text",value:""})),c.createElement("div",{className:"form-group"},c.createElement("button",{className:"btn btn-default",id:"add-pin",onClick:function(){if("undefined"!=typeof n&&null!==n){var e=$("#beacon-pin");if(null!==e.select2("data")){var t=e.select2("data").id,r=e.select2("data").text;e.attr("value",""),e.select2("val",""),n._grid.addPin(0,0,t,r)}}}.bind(this)},"Add pin")),c.createElement("div",{className:"form-group"},null!==r?c.createElement("div",null,c.createElement("span",{className:"form-control"},r),c.createElement("button",{className:"btn btn-default",onClick:function(){"undefined"==typeof n&&null===n||n._grid.deletePin(r)}.bind(this)},"Delete pin")):"")))}}]),t}(c.Component));t["default"]=l,l.contextTypes={store:c.PropTypes.object}},209:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.BrushControls=void 0;var i=n(1),o=r(i),s=n(210);t.BrushControls=function(e){var t=e.brushes;return o.createElement("div",{className:"row",style:{marginBottom:"10px"}},"Brushes",t.map(function(e,t){return o.createElement(s.BrushControl,{key:t,index:t,brush:e})}))}},210:function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.BrushControl=void 0;var a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(1),c=r(u),l=n(41),d=r(l),f=t.BrushControl=function(e){function t(e,n){i(this,t);var r=o(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),s=n.store,a=e.index;return r._store=s,r._index=a,r}return s(t,e),a(t,[{key:"onClick",value:function(){this._store.dispatch({type:"TOGGLE_BRUSH",index:this._index})}},{key:"render",value:function(){var e=this.props.brush;return c.createElement("div",{className:"cell",style:{background:d.web_colors[e.color],border:e.toggled?"3px solid #B92626":"none"},onClick:this.onClick.bind(this)})}}]),t}(c.Component);f.contextTypes={store:c.PropTypes.object}}});
  //# sourceMappingURL=app.js.map