!function(e){function t(t){for(var n,o,i=t[0],a=t[1],u=0,s=[];u1&&void 0!==arguments[1]?arguments[1]:function(){},n=document.createElement("script");n.type="text/javascript",n.onerror=function(){t(new Error("Script failed to load"))},n.readyState?n.onreadystatechange=function(){"loaded"!==n.readyState&&"complete"!==n.readyState||(n.onreadystatechange=null,t())}:n.onload=function(){t()},n.src=e,document.getElementsByTagName("head")[0].appendChild(n)}}},function(e,t,n){"use strict";n.r(t);var r=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))},o=setTimeout;function i(e){return Boolean(e&&e.length)}function a(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],d(e,this)}function c(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(e){return void f(t.promise,e)}s(t.promise,r)}else(1===e._state?s:f)(t.promise,e._value)}))):e._deferreds.push(t)}function s(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof u)return e._state=3,e._value=t,void l(e);if("function"==typeof n)return void d((r=n,o=t,function(){r.apply(o,arguments)}),e)}e._state=1,e._value=t,l(e)}catch(t){f(e,t)}var r,o}function f(e,t){e._state=2,e._value=t,l(e)}function l(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];v(this,e),this.message=t,this.props=n,this.error=Error(this.message),this.isUserError=r,this.rollbarFingerprint=this.message},b={},w={},g={};function _(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];return e?g[this.product.name].assets:this.product.assets}},{key:"load",value:function(e,t){var n=this;return this.productIframe.ready().then((function(r){n.productIframe.injectMetadata(r,t),n.productIframe.injectAssets(r,e)})).catch((function(){return y.reject(n.loadProductError())}))}},{key:"loadProductError",value:function(){var e=this.product,t=e.name,n=e.id,r=e.features;return new m("failed to load product",{product:t,id:n,features:r})}}])&&k(t.prototype,n),r&&k(t,r),e}(),j=n(0);function S(e,t){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];return new y((function(r,o){var i=t.snippet.getParentWindow();n?(i.zEACLoaded=!0,i.$zopim?r(w.products):r(b.products)):h(new T(i,e).resolveComposeUrl()).then((function(e){var t=e.products;i.zEACLoaded=!0,r(t)})).catch((function(){return o(t.error(e))}))}))}},{key:"loadProducts",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e.map((function(e){var r=e.getProductAssets(n);return e.load(r,t.snippet.getZEQueue()).catch((function(e){return y.reject(e)}))}))}},{key:"getProductLoaders",value:function(e){var t=this.snippet.getParentWindow();return e.map((function(e){return"zopim_chat"===e.name?new O(e.id,t):new P(e,t)}))}},{key:"error",value:function(e){return new m("compose request failed",{key:e})}}])&&C(t.prototype,n),r&&C(t,r),e}();function A(e,t){for(var n=0;n