text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@polymer/polymer/polymer-element.js")):"function"==typeof define&&define.amd?define(["exports","@polymer/polymer/polymer-element.js"],t):t((e=e||self).BeakerBroker={},e.polymerElement_js)}(this,function(e,t){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void n(e)}u.done?t(c):Promise.resolve(c).then(r,o)}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var a=e.apply(t,n);function u(e){r(a,o,i,u,c,"next",e)}function c(e){r(a,o,i,u,c,"throw",e)}u(void 0)})}}function i(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)}}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e,t,n){return(f="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=a(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n):o.value}})(e,t,n||e)}function s(){var e,t,n=(e=["\n<style>:host {\n  display: block;\n}\n\n:host([hidden]) {\n  display: none;\n}\n</style>\n<slot></slot>"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return s=function(){return n},n}var l=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),c(this,a(r).apply(this,arguments))}var l,p,y;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(r,t.PolymerElement),l=r,p=[{key:"connectedCallback",value:function(){f(a(r.prototype),"connectedCallback",this).call(this),"undefined"===("undefined"==typeof DatArchive?"undefined":n(DatArchive))&&console.log("Beaker is not available from this site loading methodology")}},{key:"_datUrlChanged",value:function(){var e=o(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:"undefined"!==("undefined"==typeof DatArchive?"undefined":n(DatArchive))&&t&&this.set("archive",new DatArchive(t));case 1:case"end":return e.stop()}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"write",value:function(){var e=o(regeneratorRuntime.mark(function e(t,n){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.archive.writeFile(t,n);case 2:case"end":return e.stop()}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()},{key:"read",value:function(){var e=o(regeneratorRuntime.mark(function e(t,n){var r,o,i,a,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r="utf8",e.t0=n,e.next="jpeg"===e.t0?4:"jpg"===e.t0?4:"png"===e.t0?11:"base64"===e.t0?18:23;break;case 4:return r="binary",e.next=7,this.archive.readFile(t,r);case 7:return i=e.sent,a=new Blob([i],{type:"image/jpeg"}),o=URL.createObjectURL(a),e.abrupt("break",28);case 11:return r="binary",e.next=14,this.archive.readFile(t,r);case 14:return i=e.sent,a=new Blob([i],{type:"image/png"}),o=URL.createObjectURL(a),e.abrupt("break",28);case 18:return e.next=20,this.archive.readFile(t,n);case 20:return u=e.sent,o="data:image/png;base64,"+u,e.abrupt("break",28);case 23:return e.next=25,this.archive.readFile(t,n);case 25:return u=e.sent,o=u,e.abrupt("break",28);case 28:return e.next=30,o;case 30:return e.abrupt("return",e.sent);case 31:case"end":return e.stop()}},e,this)}));return function(t,n){return e.apply(this,arguments)}}()}],y=[{key:"template",get:function(){return t.html(s())}},{key:"haxProperties",get:function(){return{}}},{key:"properties",get:function(){return{archive:{type:"Object",notify:!0},datUrl:{type:"String",value:window.location.host,observer:"_datUrlChanged",notify:!0}}}},{key:"tag",get:function(){return"beaker-broker"}}],p&&i(l.prototype,p),y&&i(l,y),r}();window.customElements.define(l.tag,l),e.BeakerBroker=l,Object.defineProperty(e,"__esModule",{value:!0})});
  //# sourceMappingURL=beaker-broker.umd.js.map
  