(window.cbJsonP=window.cbJsonP||[]).push([[222],{171:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var i="chargebee-business-entity-id"},191:function(e,t,n){"use strict";var i=n(23),r=n.n(i),a=n(26),o=n.n(a),c=n(8),s=n.n(c),u=n(3),d=n.n(u),l=n(6),m=n.n(l),f=n(5),h=n(38),p=n(1),A=n(9),y=n(24),g=n(30),w=n(17),v=n(7),E=n(57),R=n(14),M=window.addEventListener?"addEventListener":"attachEvent",S=window[M],T="attachEvent"==M?"onmessage":"message",b=function(){function e(t){d()(this,e),this.windowType=t,this.listen()}return m()(e,[{key:"listen",value:function(){var e=this;S(T,(function(t){if(Object(R.a)()&&console.log("message received",t.data),"object"==s()(t.data)&&null!=t.data&&t.data.cbEvent){var n=t.data;if((n.targetWindowName==window.name||e.windowType==p.o.Host&&n.targetWindowName==v.a.HOST_NAME)&&!(e.windowType==p.o.Component&&t.origin!=f.a.getJSDomainIframeCommunication()||e.windowType==p.o.Master&&t.origin!=f.a.getJSDomainIframeCommunication()&&t.source!==window.parent)){var i=n.replyId,r=n.srcWindowName,a=n.message;a&&a.action&&(h.a.notTrue((function(){return e.windowType!=p.o.Component||n.srcWindowName==v.a.MASTER_FRAME}),Object(g.d)(y.e.receiveMessageError)),A.a.resolve(a).then((function(o){if(!(a.options&&a.options.noReply||n.srcWindowName===n.targetWindowName)){var c={replyId:i,message:o,cbEvent:!0,targetWindowName:n.srcWindowName};e.postMessage(r,c,t.origin)}})).catch((function(o){if(!(a.options&&a.options.noReply||n.srcWindowName===n.targetWindowName)){var c=new y.a(o),s={replyId:i,error:Object(w.m)(c),message:o.message,cbEvent:!0,targetWindowName:n.srcWindowName};e.postMessage(r,s,t.origin)}})))}}}))}},{key:"postMessage",value:function(e,t,n){var i=this;h.a.notTrue((function(){return i.windowType!=p.o.Component||e==v.a.MASTER_FRAME}),Object(g.d)(y.e.responseError)),h.a.notTrue((function(){return i.windowType!=p.o.Component||n==f.a.getJSDomainIframeCommunication()}),Object(g.d)(y.e.responseMismatchError)),Object(R.a)()&&console.log("response to --\x3e "+e+" "+o()(t));var r=this.getTargetWindow(e,{target_iframe_name:e,message_action:t.targetWindowName});try{Object(w.n)({targetWindow:r,message:t,targetIframeName:e,windowType:this.windowType,handlerType:p.n.Receiver})}catch(e){console.error(e)}Object(w.e)(r,t,n,p.n.Receiver)}},{key:"getTargetWindow",value:function(e,t){try{return this.windowType==p.o.Host?window.frames[e]:e&&e!=v.a.HOST_NAME?window.parent.frames[e]:window.parent}catch(e){if(this.windowType===p.o.Component||this.windowType===p.o.Master){var n=r()({},t,window.cb_site_info);E.a.error(e,n)}}}}]),e}();t.a=b},207:function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return m})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return h})),n.d(t,"k",(function(){return p})),n.d(t,"i",(function(){return A})),n.d(t,"j",(function(){return y})),n.d(t,"h",(function(){return g})),n.d(t,"g",(function(){return w})),n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return R})),n.d(t,"l",(function(){return M}));var i=n(4),r=n.n(i),a=n(8),o=n.n(a),c=n(18),s=n.n(c),u=n(171),d=n(24),l=function(e,t){return m(e,(function(){return!!window[t]}))},m=function(e,t){return new s.a((function(n,i){if(1==t())n(!0);else{var r=window.setTimeout((function(){return i(d.e.scriptLoadError)}),5e4);f(e,(function e(){1==t()?(clearTimeout(r),window.setTimeout((function(){return n(!0)}),100)):window.setTimeout(e,100)}),(function(){i(d.e.scriptLoadError)}))}}))},f=function(e,t,n){var i=document.createElement("script");i.onload=t,i.onerror=n,document.head.appendChild(i),i.src=e},h=function(e){return new s.a((function(t,n){for(var i=document.styleSheets,r=0,a=i.length;re.MAX_RETRIES){clearTimeout(o);var i=new h.a(t||e.options.errors.maxAttemptsReached);return e.triggerErrorCallback(r-1,i),n(i)}e.triggerErrorCallback(r-1,t),u()},u=(i=c()(a.a.mark((function n(){var i;return a.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,clearTimeout(o),o=setTimeout((function(){return s(e.options.errors.executionTimeout)}),e.EXEC_TIMEOUT),n.next=4,e.callable();case 4:i=n.sent,r=i,clearTimeout(o),t(r),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),s(n.t0);case 11:case"end":return n.stop()}var r}),n,e,[[0,8]])}))),function(){return i.apply(this,arguments)});u()}))),this.preparedPromise)}}]),e}();t.b=g},9:function(e,t,n){"use strict";var i=n(3),r=n.n(i),a=n(6),o=n.n(a),c=new(function(){function e(){r()(this,e),this.actionRegistry={}}return o()(e,[{key:"registerAction",value:function(e,t){this.actionRegistry[e]=t}},{key:"resolve",value:function(e){var t=this.actionRegistry[e.action];if(t&&t.handle)return t.handle(e);console.log("Unknown action: "+t)}}]),e}());t.a=c}}]); //# sourceMappingURL=222-47fdc1fc483c8d0799d4.js.map