abowire
Version:
This is the official **Abowire Javascript SDK**, which makes it easy to connect to the Abowire **GraphQL API** and includes all the required dependencies you need.
17 lines (10 loc) • 927 kB
JavaScript
"use strict";(()=>{var lf=Object.create;var ka=Object.defineProperty;var df=Object.getOwnPropertyDescriptor;var of=Object.getOwnPropertyNames;var mf=Object.getPrototypeOf,sf=Object.prototype.hasOwnProperty;var uf=(n,e,i)=>e in n?ka(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i;var Ci=(n,e)=>()=>(n&&(e=n(n=0)),e);var D=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Es=(n,e)=>{for(var i in e)ka(n,i,{get:e[i],enumerable:!0})},Ls=(n,e,i,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of of(e))!sf.call(n,a)&&a!==i&&ka(n,a,{get:()=>e[a],enumerable:!(t=df(e,a))||t.enumerable});return n};var Un=(n,e,i)=>(i=n!=null?lf(mf(n)):{},Ls(e||!n||!n.__esModule?ka(i,"default",{value:n,enumerable:!0}):i,n)),cf=n=>Ls(ka({},"__esModule",{value:!0}),n);var Ae=(n,e,i)=>(uf(n,typeof e!="symbol"?e+"":e,i),i);var Us=D((va,Kl)=>{(function(n,e){typeof va=="object"&&typeof Kl=="object"?Kl.exports=e():typeof define=="function"&&define.amd?define("zoid",[],e):typeof va=="object"?va.zoid=e():n.zoid=e()})(typeof self<"u"?self:va,function(){return function(n){var e={};function i(t){if(e[t])return e[t].exports;var a=e[t]={i:t,l:!1,exports:{}};return n[t].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=n,i.c=e,i.d=function(t,a,l){i.o(t,a)||Object.defineProperty(t,a,{enumerable:!0,get:l})},i.r=function(t){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,a){if(1&a&&(t=i(t)),8&a||4&a&&typeof t=="object"&&t&&t.__esModule)return t;var l=Object.create(null);if(i.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:t}),2&a&&typeof t!="string")for(var m in t)i.d(l,m,function(y){return t[y]}.bind(null,m));return l},i.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(a,"a",a),a},i.o=function(t,a){return{}.hasOwnProperty.call(t,a)},i.p="",i(i.s=0)}([function(n,e,i){"use strict";i.r(e),i.d(e,"PopupOpenError",function(){return CS}),i.d(e,"create",function(){return jS}),i.d(e,"destroy",function(){return zS}),i.d(e,"destroyComponents",function(){return Fs}),i.d(e,"destroyAll",function(){return Ss}),i.d(e,"PROP_TYPE",function(){return Je}),i.d(e,"PROP_SERIALIZATION",function(){return dr}),i.d(e,"CONTEXT",function(){return ti}),i.d(e,"EVENT",function(){return dn});function t(r,o){return(t=Object.setPrototypeOf||function(d,s){return d.__proto__=s,d})(r,o)}function a(r,o){r.prototype=Object.create(o.prototype),r.prototype.constructor=r,t(r,o)}function l(){return(l=Object.assign||function(r){for(var o=1;o<arguments.length;o++){var d=arguments[o];for(var s in d)({}).hasOwnProperty.call(d,s)&&(r[s]=d[s])}return r}).apply(this,arguments)}function m(r){try{if(!r)return!1;if(typeof Promise<"u"&&r instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&r instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&r instanceof window.constructor)return!1;var o={}.toString;if(o){var d=o.call(r);if(d==="[object Window]"||d==="[object global]"||d==="[object DOMWindow]")return!1}if(typeof r.then=="function")return!0}catch{return!1}return!1}var y=[],p=[],g=0,b;function w(){if(!g&&b){var r=b;b=null,r.resolve()}}function W(){g+=1}function K(){g-=1,w()}var x=function(){function r(d){var s=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],d){var u,N,S=!1,T=!1,C=!1;W();try{d(function(L){C?s.resolve(L):(S=!0,u=L)},function(L){C?s.reject(L):(T=!0,N=L)})}catch(L){K(),this.reject(L);return}K(),C=!0,S?this.resolve(u):T&&this.reject(N)}}var o=r.prototype;return o.resolve=function(d){if(this.resolved||this.rejected)return this;if(m(d))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=d,this.dispatch(),this},o.reject=function(d){var s=this;if(this.resolved||this.rejected)return this;if(m(d))throw new Error("Can not reject promise with another promise");if(!d){var u=d&&typeof d.toString=="function"?d.toString():{}.toString.call(d);d=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=d,this.errorHandled||setTimeout(function(){s.errorHandled||function(N,S){if(y.indexOf(N)===-1){y.push(N),setTimeout(function(){throw N},1);for(var T=0;T<p.length;T++)p[T](N,S)}}(d,s)},1),this.dispatch(),this},o.asyncReject=function(d){return this.errorHandled=!0,this.reject(d),this},o.dispatch=function(){var d=this.resolved,s=this.rejected,u=this.handlers;if(!this.dispatching&&(d||s)){this.dispatching=!0,W();for(var N=function(E,q){return E.then(function(Y){q.resolve(Y)},function(Y){q.reject(Y)})},S=0;S<u.length;S++){var T=u[S],C=T.onSuccess,L=T.onError,V=T.promise,_=void 0;if(d)try{_=C?C(this.value):this.value}catch(E){V.reject(E);continue}else if(s){if(!L){V.reject(this.error);continue}try{_=L(this.error)}catch(E){V.reject(E);continue}}if(_ instanceof r&&(_.resolved||_.rejected)){var P=_;P.resolved?V.resolve(P.value):V.reject(P.error),P.errorHandled=!0}else m(_)?_ instanceof r&&(_.resolved||_.rejected)?_.resolved?V.resolve(_.value):V.reject(_.error):N(_,V):V.resolve(_)}u.length=0,this.dispatching=!1,K()}},o.then=function(d,s){if(d&&typeof d!="function"&&!d.call)throw new Error("Promise.then expected a function for success handler");if(s&&typeof s!="function"&&!s.call)throw new Error("Promise.then expected a function for error handler");var u=new r;return this.handlers.push({promise:u,onSuccess:d,onError:s}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(d){return this.then(void 0,d)},o.finally=function(d){if(d&&typeof d!="function"&&!d.call)throw new Error("Promise.finally expected a function");return this.then(function(s){return r.try(d).then(function(){return s})},function(s){return r.try(d).then(function(){throw s})})},o.timeout=function(d,s){var u=this;if(this.resolved||this.rejected)return this;var N=setTimeout(function(){u.resolved||u.rejected||u.reject(s||new Error("Promise timed out after "+d+"ms"))},d);return this.then(function(S){return clearTimeout(N),S})},o.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},o.lazy=function(){return this.errorHandled=!0,this},r.resolve=function(d){return d instanceof r?d:m(d)?new r(function(s,u){return d.then(s,u)}):new r().resolve(d)},r.reject=function(d){return new r().reject(d)},r.asyncReject=function(d){return new r().asyncReject(d)},r.all=function(d){var s=new r,u=d.length,N=[].slice();if(!u)return s.resolve(N),s;for(var S=function(L,V,_){return V.then(function(P){N[L]=P,(u-=1)==0&&s.resolve(N)},function(P){_.reject(P)})},T=0;T<d.length;T++){var C=d[T];if(C instanceof r){if(C.resolved){N[T]=C.value,u-=1;continue}}else if(!m(C)){N[T]=C,u-=1;continue}S(T,r.resolve(C),s)}return u===0&&s.resolve(N),s},r.hash=function(d){var s={},u=[],N=function(T){if(d.hasOwnProperty(T)){var C=d[T];m(C)?u.push(C.then(function(L){s[T]=L})):s[T]=C}};for(var S in d)N(S);return r.all(u).then(function(){return s})},r.map=function(d,s){return r.all(d.map(s))},r.onPossiblyUnhandledException=function(d){return function(s){return p.push(s),{cancel:function(){p.splice(p.indexOf(s),1)}}}(d)},r.try=function(d,s,u){if(d&&typeof d!="function"&&!d.call)throw new Error("Promise.try expected a function");var N;W();try{N=d.apply(s,u||[])}catch(S){return K(),r.reject(S)}return K(),r.resolve(N)},r.delay=function(d){return new r(function(s){setTimeout(s,d)})},r.isPromise=function(d){return!!(d&&d instanceof r)||m(d)},r.flush=function(){return function(d){var s=b=b||new d;return w(),s}(r)},r}();function ve(r){return{}.toString.call(r)==="[object RegExp]"}var ye={IFRAME:"iframe",POPUP:"popup"},Pe=`Call was rejected by callee.\r
`;function Le(r){return r===void 0&&(r=window),r.location.protocol}function Fe(r){if(r===void 0&&(r=window),r.mockDomain){var o=r.mockDomain.split("//")[0];if(o)return o}return Le(r)}function $(r){return r===void 0&&(r=window),Fe(r)==="about:"}function ee(r){if(r===void 0&&(r=window),r)try{if(r.parent&&r.parent!==r)return r.parent}catch{}}function F(r){if(r===void 0&&(r=window),r&&!ee(r))try{return r.opener}catch{}}function M(r){try{return!0}catch{}return!1}function oe(r){r===void 0&&(r=window);var o=r.location;if(!o)throw new Error("Can not read window location");var d=Le(r);if(!d)throw new Error("Can not read window protocol");if(d==="file:")return"file://";if(d==="about:"){var s=ee(r);return s&&M()?oe(s):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return d+"//"+u}function c(r){r===void 0&&(r=window);var o=oe(r);return o&&r.mockDomain&&r.mockDomain.indexOf("mock:")===0?r.mockDomain:o}function h(r){if(!function(o){try{if(o===window)return!0}catch{}try{var d=Object.getOwnPropertyDescriptor(o,"location");if(d&&d.enumerable===!1)return!1}catch{}try{if($(o)&&M())return!0}catch{}try{if(function(s){return s===void 0&&(s=window),Fe(s)==="mock:"}(o)&&M())return!0}catch{}try{if(oe(o)===oe(window))return!0}catch{}return!1}(r))return!1;try{if(r===window||$(r)&&M()||c(window)===c(r))return!0}catch{}return!1}function U(r){if(!h(r))throw new Error("Expected window to be same domain");return r}function te(r,o){if(!r||!o)return!1;var d=ee(o);return d?d===r:function(s){var u=[];try{for(;s.parent!==s;)u.push(s.parent),s=s.parent}catch{}return u}(o).indexOf(r)!==-1}function O(r){var o=[],d;try{d=r.frames}catch{d=r}var s;try{s=d.length}catch{}if(s===0)return o;if(s){for(var u=0;u<s;u++){var N=void 0;try{N=d[u]}catch{continue}o.push(N)}return o}for(var S=0;S<100;S++){var T=void 0;try{T=d[S]}catch{return o}if(!T)return o;o.push(T)}return o}function X(r){for(var o=[],d=0,s=O(r);d<s.length;d++){var u=s[d];o.push(u);for(var N=0,S=X(u);N<S.length;N++)o.push(S[N])}return o}function Ge(r){r===void 0&&(r=window);try{if(r.top)return r.top}catch{}if(ee(r)===r)return r;try{if(te(window,r)&&window.top)return window.top}catch{}try{if(te(r,window)&&window.top)return window.top}catch{}for(var o=0,d=X(r);o<d.length;o++){var s=d[o];try{if(s.top)return s.top}catch{}if(ee(s)===s)return s}}function Ye(r){var o=Ge(r);if(!o)throw new Error("Can not determine top window");var d=[].concat(X(o),[o]);return d.indexOf(r)===-1&&(d=[].concat(d,[r],X(r))),d}var an=[],Qe=[];function Se(r,o){o===void 0&&(o=!0);try{if(r===window)return!1}catch{return!0}try{if(!r)return!0}catch{return!0}try{if(r.closed)return!0}catch(u){return!u||u.message!==Pe}if(o&&h(r))try{if(r.mockclosed)return!0}catch{}try{if(!r.parent||!r.top)return!0}catch{}var d=function(u,N){for(var S=0;S<u.length;S++)try{if(u[S]===N)return S}catch{}return-1}(an,r);if(d!==-1){var s=Qe[d];if(s&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var N=u.ownerDocument;if(N&&N.documentElement&&!N.documentElement.contains(u)){for(var S=u;S.parentNode&&S.parentNode!==S;)S=S.parentNode;if(!S.host||!N.documentElement.contains(S.host))return!0}return!1}(s))return!0}return!1}function jn(r,o){for(var d=O(r),s=0;s<d.length;s++){var u=d[s];try{if(h(u)&&u.name===o&&d.indexOf(u)!==-1)return u}catch{}}try{if(d.indexOf(r.frames[o])!==-1)return r.frames[o]}catch{}try{if(d.indexOf(r[o])!==-1)return r[o]}catch{}}function k(r){return r===void 0&&(r=window),F(r=r||window)||ee(r)||void 0}function I(r,o){for(var d=0;d<r.length;d++)for(var s=r[d],u=0;u<o.length;u++)if(s===o[u])return!0;return!1}function B(r){r===void 0&&(r=window);for(var o=0,d=r;d;)(d=ee(d))&&(o+=1);return o}function J(r,o){var d=Ge(r)||r,s=Ge(o)||o;try{if(d&&s)return d===s}catch{}var u=Ye(r),N=Ye(o);if(I(u,N))return!0;var S=F(d),T=F(s);return S&&I(Ye(S),N)||T&&I(Ye(T),u),!1}function R(r,o){if(typeof r=="string"){if(typeof o=="string")return r==="*"||o===r;if(ve(o)||Array.isArray(o))return!1}return ve(r)?ve(o)?r.toString()===o.toString():!Array.isArray(o)&&!!o.match(r):!!Array.isArray(r)&&(Array.isArray(o)?JSON.stringify(r)===JSON.stringify(o):!ve(o)&&r.some(function(d){return R(d,o)}))}function ne(r){return r.match(/^(https?|mock|file):\/\//)?r.split("/").slice(0,3).join("/"):c()}function z(r,o,d,s){d===void 0&&(d=1e3),s===void 0&&(s=1/0);var u;return function N(){if(Se(r))return u&&clearTimeout(u),o();s<=0?clearTimeout(u):(s-=d,u=setTimeout(N,d))}(),{cancel:function(){u&&clearTimeout(u)}}}function j(r){try{if(r===window)return!0}catch(o){if(o&&o.message===Pe)return!0}try{if({}.toString.call(r)==="[object Window]")return!0}catch(o){if(o&&o.message===Pe)return!0}try{if(window.Window&&r instanceof window.Window)return!0}catch(o){if(o&&o.message===Pe)return!0}try{if(r&&r.self===r)return!0}catch(o){if(o&&o.message===Pe)return!0}try{if(r&&r.parent===r)return!0}catch(o){if(o&&o.message===Pe)return!0}try{if(r&&r.top===r)return!0}catch(o){if(o&&o.message===Pe)return!0}try{if(r&&r.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in r&&"self"in r&&"location"in r)return!0}catch{}return!1}function ue(r){if(h(r))return U(r).frameElement;for(var o=0,d=document.querySelectorAll("iframe");o<d.length;o++){var s=d[o];if(s&&s.contentWindow&&s.contentWindow===r)return s}}function me(r){if(function(d){return d===void 0&&(d=window),!!ee(d)}(r)){var o=ue(r);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{r.close()}catch{}}function De(r,o){for(var d=0;d<r.length;d++)try{if(r[d]===o)return d}catch{}return-1}var We=function(){function r(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var d=new WeakMap,s={};return Object.freeze(s),d.set(s,"__testvalue__"),d.get(s)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=r.prototype;return o._cleanupClosedWindows=function(){for(var d=this.weakmap,s=this.keys,u=0;u<s.length;u++){var N=s[u];if(j(N)&&Se(N)){if(d)try{d.delete(N)}catch{}s.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(d){return!j(d)},o.set=function(d,s){if(!d)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(d,s)}catch{delete this.weakmap}if(this.isSafeToReadWrite(d))try{var N=this.name,S=d[N];S&&S[0]===d?S[1]=s:Object.defineProperty(d,N,{value:[d,s],writable:!0});return}catch{}this._cleanupClosedWindows();var T=this.keys,C=this.values,L=De(T,d);L===-1?(T.push(d),C.push(s)):C[L]=s},o.get=function(d){if(!d)throw new Error("WeakMap expected key");var s=this.weakmap;if(s)try{if(s.has(d))return s.get(d)}catch{delete this.weakmap}if(this.isSafeToReadWrite(d))try{var u=d[this.name];return u&&u[0]===d?u[1]:void 0}catch{}this._cleanupClosedWindows();var N=De(this.keys,d);if(N!==-1)return this.values[N]},o.delete=function(d){if(!d)throw new Error("WeakMap expected key");var s=this.weakmap;if(s)try{s.delete(d)}catch{delete this.weakmap}if(this.isSafeToReadWrite(d))try{var u=d[this.name];u&&u[0]===d&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var N=this.keys,S=De(N,d);S!==-1&&(N.splice(S,1),this.values.splice(S,1))},o.has=function(d){if(!d)throw new Error("WeakMap expected key");var s=this.weakmap;if(s)try{if(s.has(d))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(d))try{var u=d[this.name];return!(!u||u[0]!==d)}catch{}return this._cleanupClosedWindows(),De(this.keys,d)!==-1},o.getOrSet=function(d,s){if(this.has(d))return this.get(d);var u=s();return this.set(d,u),u},r}();function Zn(r){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(r)}function Ni(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function $n(r,o,d){return($n=Ni()?Reflect.construct:function(s,u,N){var S=[null];S.push.apply(S,u);var T=new(Function.bind.apply(s,S));return N&&t(T,N.prototype),T}).apply(null,arguments)}function Ui(r){var o=typeof Map=="function"?new Map:void 0;return(Ui=function(d){if(d===null||(s=d,Function.toString.call(s).indexOf("[native code]")===-1))return d;var s;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(o!==void 0){if(o.has(d))return o.get(d);o.set(d,u)}function u(){return $n(d,arguments,Zn(this).constructor)}return u.prototype=Object.create(d.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),t(u,d)})(r)}function xl(r){var o=!1;try{(r instanceof window.Element||r!==null&&typeof r=="object"&&r.nodeType===1&&typeof r.style=="object"&&typeof r.ownerDocument=="object")&&(o=!0)}catch{}return o}function Il(r){return r.name||r.__name__||r.displayName||"anonymous"}function Pl(r,o){try{delete r.name,r.name=o}catch{}return r.__name__=r.displayName=o,r}function Dl(r){if(typeof btoa=="function")return btoa(encodeURIComponent(r).replace(/%([0-9A-F]{2})/g,function(o,d){return String.fromCharCode(parseInt(d,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(r,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}function Rn(){var r="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return r.charAt(Math.floor(Math.random()*r.length))})+"_"+Dl(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Ha;function Tl(r){try{return JSON.stringify([].slice.call(r),function(o,d){return typeof d=="function"?"memoize["+function(s){if(Ha=Ha||new We,s==null||typeof s!="object"&&typeof s!="function")throw new Error("Invalid object");var u=Ha.get(s);return u||(u=typeof s+":"+Rn(),Ha.set(s,u)),u}(d)+"]":xl(d)?{}:d})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function IS(){return{}}var Xt=0,Em=0;function Oi(r,o){o===void 0&&(o={});var d=o.thisNamespace,s=d!==void 0&&d,u=o.time,N,S,T=Xt;Xt+=1;var C=function(){for(var L=arguments.length,V=new Array(L),_=0;_<L;_++)V[_]=arguments[_];T<Em&&(N=null,S=null,T=Xt,Xt+=1);var P;P=s?(S=S||new We).getOrSet(this,IS):N=N||{};var E;try{E=Tl(V)}catch{return r.apply(this,arguments)}var q=P[E];if(q&&u&&Date.now()-q.time<u&&(delete P[E],q=null),q)return q.value;var Y=Date.now(),ie=r.apply(this,arguments);return P[E]={time:Y,value:ie},ie};return C.reset=function(){N=null,S=null},Pl(C,(o.name||Il(r))+"::memoized")}Oi.clear=function(){Em=Xt};function se(r){var o={};function d(){for(var s=arguments,u=this,N=arguments.length,S=new Array(N),T=0;T<N;T++)S[T]=arguments[T];var C=Tl(S);return o.hasOwnProperty(C)||(o[C]=x.try(function(){return r.apply(u,s)}).finally(function(){delete o[C]})),o[C]}return d.reset=function(){o={}},Pl(d,Il(r)+"::promiseMemoized")}function Sn(){}function Ka(r){var o=!1;return Pl(function(){if(!o)return o=!0,r.apply(this,arguments)},Il(r)+"::once")}function Ft(r,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!r)return"<unknown error: "+{}.toString.call(r)+">";if(typeof r=="string")return r;if(r instanceof Error){var d=r&&r.stack,s=r&&r.message;if(d&&s)return d.indexOf(s)!==-1?d:s+`
`+d;if(d)return d;if(s)return s}return r&&r.toString&&typeof r.toString=="function"?r.toString():{}.toString.call(r)}catch(u){return"Error while stringifying error: "+Ft(u,o+1)}}function Ya(r){return typeof r=="string"?r:r&&r.toString&&typeof r.toString=="function"?r.toString():{}.toString.call(r)}function Ja(r,o){if(!o)return r;if(Object.assign)return Object.assign(r,o);for(var d in o)o.hasOwnProperty(d)&&(r[d]=o[d]);return r}Oi(function(r){if(Object.values)return Object.values(r);var o=[];for(var d in r)r.hasOwnProperty(d)&&o.push(r[d]);return o});function PS(r){return r}function Zt(r,o){var d;return function s(){d=setTimeout(function(){r(),s()},o)}(),{cancel:function(){clearTimeout(d)}}}function Cl(r){return[].slice.call(r)}function Ri(r){return r!=null}function Ml(r){return{}.toString.call(r)==="[object RegExp]"}function ea(r,o,d){if(r.hasOwnProperty(o))return r[o];var s=d();return r[o]=s,s}function Xa(r){var o=[],d=!1,s,u={set:function(N,S){return d||(r[N]=S,u.register(function(){delete r[N]})),S},register:function(N){var S=Ka(function(){return N(s)});return d?N(s):o.push(S),{cancel:function(){var T=o.indexOf(S);T!==-1&&o.splice(T,1)}}},all:function(N){s=N;var S=[];for(d=!0;o.length;){var T=o.shift();S.push(T())}return x.all(S).then(Sn)}};return u}function Za(r,o){if(o==null)throw new Error("Expected "+r+" to be present");return o}var DS=function(r){a(o,r);function o(d){var s;return(s=r.call(this,d)||this).name=s.constructor.name,typeof Error.captureStackTrace=="function"?Error.captureStackTrace(function(u){if(u===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u}(s),s.constructor):s.stack=new Error(d).stack,s}return o}(Ui(Error));function Lm(){var r=document.body;if(!r)throw new Error("Body element not found");return r}function er(){return!!document.body&&document.readyState==="complete"}function Um(){return!!document.body&&document.readyState==="interactive"}function Om(r){return encodeURIComponent(r)}Oi(function(){return new x(function(r){if(er()||Um())return r();var o=setInterval(function(){if(er()||Um())return clearInterval(o),r()},10)})});function Rm(r){return function(o,d,s){s===void 0&&(s=[]);var u=o.__inline_memoize_cache__=o.__inline_memoize_cache__||{},N=Tl(s);return u.hasOwnProperty(N)?u[N]:u[N]=function(){var S={};if(!r||r.indexOf("=")===-1)return S;for(var T=0,C=r.split("&");T<C.length;T++){var L=C[T];(L=L.split("="))[0]&&L[1]&&(S[decodeURIComponent(L[0])]=decodeURIComponent(L[1]))}return S}.apply(void 0,s)}(Rm,0,[r])}function Vm(r,o){return o===void 0&&(o={}),o&&Object.keys(o).length?function(d){return d===void 0&&(d={}),Object.keys(d).filter(function(s){return typeof d[s]=="string"||typeof d[s]=="boolean"}).map(function(s){var u=d[s];if(typeof u!="string"&&typeof u!="boolean")throw new TypeError("Invalid type for query");return Om(s)+"="+Om(u.toString())}).join("&")}(l({},Rm(r),o)):r}function TS(r,o){r.appendChild(o)}function nr(r,o){return o===void 0&&(o=document),xl(r)?r:typeof r=="string"?o.querySelector(r):void 0}function qm(r){return new x(function(o,d){var s=Ya(r),u=nr(r);if(u)return o(u);if(er())return d(new Error("Document is ready and element "+s+" does not exist"));var N=setInterval(function(){if(u=nr(r))o(u),clearInterval(N);else if(er())return clearInterval(N),d(new Error("Document is ready and element "+s+" does not exist"))},10)})}var CS=function(r){a(o,r);function o(){return r.apply(this,arguments)||this}return o}(DS),ir;function $m(r){if((ir=ir||new We).has(r)){var o=ir.get(r);if(o)return o}var d=new x(function(s,u){r.addEventListener("load",function(){(function(N){if(function(){for(var S=0;S<an.length;S++){var T=!1;try{T=an[S].closed}catch{}T&&(Qe.splice(S,1),an.splice(S,1))}}(),N&&N.contentWindow)try{an.push(N.contentWindow),Qe.push(N)}catch{}})(r),s(r)}),r.addEventListener("error",function(N){r.contentWindow?s(r):u(N)})});return ir.set(r,d),d}function wl(r){return $m(r).then(function(o){if(!o.contentWindow)throw new Error("Could not find window in iframe");return o.contentWindow})}function Bm(r,o){r===void 0&&(r={});var d=r.style||{},s=function(N,S,T){N===void 0&&(N="div"),S===void 0&&(S={}),N=N.toLowerCase();var C=document.createElement(N);if(S.style&&Ja(C.style,S.style),S.class&&(C.className=S.class.join(" ")),S.id&&C.setAttribute("id",S.id),S.attributes)for(var L=0,V=Object.keys(S.attributes);L<V.length;L++){var _=V[L];C.setAttribute(_,S.attributes[_])}if(S.styleSheet&&function(P,E,q){q===void 0&&(q=window.document),P.styleSheet?P.styleSheet.cssText=E:P.appendChild(q.createTextNode(E))}(C,S.styleSheet),S.html){if(N==="iframe")throw new Error("Iframe html can not be written unless container provided and iframe in DOM");C.innerHTML=S.html}return C}("iframe",{attributes:l({allowTransparency:"true"},r.attributes||{}),style:l({backgroundColor:"transparent",border:"none"},d),html:r.html,class:r.class}),u=window.navigator.userAgent.match(/MSIE|Edge/i);return s.hasAttribute("id")||s.setAttribute("id",Rn()),$m(s),o&&function(N,S){S===void 0&&(S=document);var T=nr(N,S);if(T)return T;throw new Error("Can not find element: "+Ya(N))}(o).appendChild(s),(r.url||u)&&s.setAttribute("src",r.url||"about:blank"),s}function Gm(r,o,d){return r.addEventListener(o,d),{cancel:function(){r.removeEventListener(o,d)}}}function MS(r){r.style.setProperty("display","")}function Wm(r){r.style.setProperty("display","none","important")}function na(r){r&&r.parentNode&&r.parentNode.removeChild(r)}function ia(r){return!(r&&r.parentNode&&r.ownerDocument&&r.ownerDocument.documentElement&&r.ownerDocument.documentElement.contains(r))}function Qm(r,o,d){var s=d===void 0?{}:d,u=s.width,N=u===void 0||u,S=s.height,T=S===void 0||S,C=s.interval,L=C===void 0?100:C,V=s.win,_=V===void 0?window:V,P=r.offsetWidth,E=r.offsetHeight,q=!1;o({width:P,height:E});var Y=function(){if(!q&&function(ae){return!!(ae.offsetWidth||ae.offsetHeight||ae.getClientRects().length)}(r)){var xe=r.offsetWidth,Ce=r.offsetHeight;(N&&xe!==P||T&&Ce!==E)&&o({width:xe,height:Ce}),P=xe,E=Ce}},ie,ce;return _.addEventListener("resize",Y),_.ResizeObserver!==void 0?((ie=new _.ResizeObserver(Y)).observe(r),ce=Zt(Y,10*L)):_.MutationObserver!==void 0?((ie=new _.MutationObserver(Y)).observe(r,{attributes:!0,childList:!0,subtree:!0,characterData:!1}),ce=Zt(Y,10*L)):ce=Zt(Y,L),{cancel:function(){q=!0,ie.disconnect(),window.removeEventListener("resize",Y),ce.cancel()}}}function El(r){for(;r.parentNode;)r=r.parentNode;return r.toString()==="[object ShadowRoot]"}var tr=typeof document<"u"?document.currentScript:null,wS=Oi(function(){if(tr||(tr=function(){try{var r=function(){try{throw new Error("_")}catch(S){return S.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(r),d=o&&o[1];if(!d)return;for(var s=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();s<u.length;s++){var N=u[s];if(N.src&&N.src===d)return N}}catch{}}()))return tr;throw new Error("Can not determine current script")}),ES=Rn();Oi(function(){var r;try{r=wS()}catch{return ES}var o=r.getAttribute("data-uid");if(o&&typeof o=="string"||(o=r.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(r.src){var d=function(s){for(var u="",N=0;N<s.length;N++){var S=s[N].charCodeAt(0)*N;s[N+1]&&(S+=s[N+1].charCodeAt(0)*(N-1)),u+=String.fromCharCode(97+Math.abs(S)%26)}return u}(JSON.stringify({src:r.src,dataset:r.dataset}));o="uid_"+d.slice(d.length-30)}else o=Rn();return r.setAttribute("data-uid-auto",o),o});function jm(r){return function(o){if(typeof o=="number")return o;var d=o.match(/^([0-9]+)(px|%)$/);if(!d)throw new Error("Could not match css value from "+o);return parseInt(d[1],10)}(r)+"px"}function zm(r){return typeof r=="number"?jm(r):typeof(o=r)=="string"&&/^[0-9]+%$/.test(o)?r:jm(r);var o}function St(r){r===void 0&&(r=window);var o="__post_robot_11_0_0__";return r!==window?r[o]:r[o]=r[o]||{}}var Hm=function(){return{}};function In(r,o){return r===void 0&&(r="store"),o===void 0&&(o=Hm),ea(St(),r,function(){var d=o();return{has:function(s){return d.hasOwnProperty(s)},get:function(s,u){return d.hasOwnProperty(s)?d[s]:u},set:function(s,u){return d[s]=u,u},del:function(s){delete d[s]},getOrSet:function(s,u){return ea(d,s,u)},reset:function(){d=o()},keys:function(){return Object.keys(d)}}})}var LS=function(){};function ar(){var r=St();return r.WINDOW_WILDCARD=r.WINDOW_WILDCARD||new LS,r.WINDOW_WILDCARD}function zn(r,o){return r===void 0&&(r="store"),o===void 0&&(o=Hm),In("windowStore").getOrSet(r,function(){var d=new We,s=function(u){return d.getOrSet(u,o)};return{has:function(u){return s(u).hasOwnProperty(r)},get:function(u,N){var S=s(u);return S.hasOwnProperty(r)?S[r]:N},set:function(u,N){return s(u)[r]=N,N},del:function(u){delete s(u)[r]},getOrSet:function(u,N){return ea(s(u),r,N)}}})}function Km(){return In("instance").getOrSet("instanceID",Rn)}function Ym(r,o){var d=o.domain,s=zn("helloPromises"),u=s.get(r);u&&u.resolve({domain:d});var N=x.resolve({domain:d});return s.set(r,N),N}function Ll(r,o){return(0,o.send)(r,"postrobot_hello",{instanceID:Km()},{domain:"*",timeout:-1}).then(function(d){var s=d.origin,u=d.data.instanceID;return Ym(r,{domain:s}),{win:r,domain:s,instanceID:u}})}function Jm(r,o){var d=o.send;return zn("windowInstanceIDPromises").getOrSet(r,function(){return Ll(r,{send:d}).then(function(s){return s.instanceID})})}function Xm(r){zn("knownWindows").set(r,!0)}function Ul(r){return typeof r=="object"&&r!==null&&typeof r.__type__=="string"}function Zm(r){return r===void 0?"undefined":r===null?"null":Array.isArray(r)?"array":typeof r=="function"?"function":typeof r=="object"?r instanceof Error?"error":typeof r.then=="function"?"promise":{}.toString.call(r)==="[object RegExp]"?"regex":{}.toString.call(r)==="[object Date]"?"date":"object":typeof r=="string"?"string":typeof r=="number"?"number":typeof r=="boolean"?"boolean":void 0}function et(r,o){return{__type__:r,__val__:o}}var ei,US=((ei={}).function=function(){},ei.error=function(r){return et("error",{message:r.message,stack:r.stack,code:r.code,data:r.data})},ei.promise=function(){},ei.regex=function(r){return et("regex",r.source)},ei.date=function(r){return et("date",r.toJSON())},ei.array=function(r){return r},ei.object=function(r){return r},ei.string=function(r){return r},ei.number=function(r){return r},ei.boolean=function(r){return r},ei.null=function(r){return r},ei[void 0]=function(r){return et("undefined",r)},ei),OS={},ni,RS=((ni={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},ni.error=function(r){var o=r.stack,d=r.code,s=r.data,u=new Error(r.message);return u.code=d,s&&(u.data=s),u.stack=o+`
`+u.stack,u},ni.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},ni.regex=function(r){return new RegExp(r)},ni.date=function(r){return new Date(r)},ni.array=function(r){return r},ni.object=function(r){return r},ni.string=function(r){return r},ni.number=function(r){return r},ni.boolean=function(r){return r},ni.null=function(r){return r},ni[void 0]=function(){},ni),VS={};new x(function(r){if(window.document&&window.document.body)return r(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),r(window.document.body)},10)});function Ol(){for(var r=In("idToProxyWindow"),o=0,d=r.keys();o<d.length;o++){var s=d[o];r.get(s).shouldClean()&&r.del(s)}}function es(r,o){var d=o.send,s=o.id,u=s===void 0?Rn():s,N=r.then(function(C){if(h(C))return U(C).name}),S=r.then(function(C){if(Se(C))throw new Error("Window is closed, can not determine type");return F(C)?ye.POPUP:ye.IFRAME});N.catch(Sn),S.catch(Sn);var T=function(){return r.then(function(C){if(!Se(C))return h(C)?U(C).name:N})};return{id:u,getType:function(){return S},getInstanceID:se(function(){return r.then(function(C){return Jm(C,{send:d})})}),close:function(){return r.then(me)},getName:T,focus:function(){return r.then(function(C){C.focus()})},isClosed:function(){return r.then(function(C){return Se(C)})},setLocation:function(C,L){return L===void 0&&(L={}),r.then(function(V){var _=window.location.protocol+"//"+window.location.host,P=L.method,E=P===void 0?"get":P,q=L.body;if(C.indexOf("/")===0)C=""+_+C;else if(!C.match(/^https?:\/\//)&&C.indexOf(_)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(C));if(E==="post")return T().then(function(Y){if(!Y)throw new Error("Can not post to window without target name");(function(ie){var ce=ie.url,xe=ie.target,Ce=ie.body,ae=ie.method,he=ae===void 0?"post":ae,pe=document.createElement("form");if(pe.setAttribute("target",xe),pe.setAttribute("method",he),pe.setAttribute("action",ce),pe.style.display="none",Ce)for(var Ie=0,ge=Object.keys(Ce);Ie<ge.length;Ie++){var je,Xe=ge[Ie],Me=document.createElement("input");Me.setAttribute("name",Xe),Me.setAttribute("value",(je=Ce[Xe])==null?void 0:je.toString()),pe.appendChild(Me)}Lm().appendChild(pe),pe.submit(),Lm().removeChild(pe)})({url:C,target:Y,method:E,body:q})});if(E!=="get")throw new Error("Unsupported method: "+E);if(h(V))try{if(V.location&&typeof V.location.replace=="function"){V.location.replace(C);return}}catch{}V.location=C})},setName:function(C){return r.then(function(L){var V=h(L),_=ue(L);if(!V)throw new Error("Can not set name for cross-domain window: "+C);U(L).name=C,_&&_.setAttribute("name",C),N=x.resolve(C)})}}}var ii=function(){function r(d){var s=d.send,u=d.win,N=d.serializedWindow;this.id=void 0,this.isProxyWindow=!0,this.serializedWindow=void 0,this.actualWindow=void 0,this.actualWindowPromise=void 0,this.send=void 0,this.name=void 0,this.actualWindowPromise=new x,this.serializedWindow=N||es(this.actualWindowPromise,{send:s}),In("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:s})}var o=r.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(d){return d===ye.POPUP})},o.setLocation=function(d,s){var u=this;return this.serializedWindow.setLocation(d,s).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(d){var s=this;return this.serializedWindow.setName(d).then(function(){return s})},o.close=function(){var d=this;return this.serializedWindow.close().then(function(){return d})},o.focus=function(){var d=this,s=this.isPopup(),u=this.getName(),N=x.hash({isPopup:s,name:u}).then(function(T){var C=T.name;T.isPopup&&C&&window.open("",C,"noopener")}),S=this.serializedWindow.focus();return x.all([N,S]).then(function(){return d})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(d,s){var u=s.send;this.actualWindow=d,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=es(this.actualWindowPromise,{send:u,id:this.getID()}),zn("winToProxyWindow").set(d,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(d,s){var u=this,N=s.send;return x.try(function(){return u.actualWindow?d===u.actualWindow:x.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:Jm(d,{send:N})}).then(function(S){var T=S.proxyInstanceID===S.knownWindowInstanceID;return T&&u.setWindow(d,{send:N}),T})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Se(this.actualWindow))},o.serialize=function(){return this.serializedWindow},r.unwrap=function(d){return r.isProxyWindow(d)?d.unwrap():d},r.serialize=function(d,s){var u=s.send;return Ol(),r.toProxyWindow(d,{send:u}).serialize()},r.deserialize=function(d,s){var u=s.send;return Ol(),In("idToProxyWindow").get(d.id)||new r({serializedWindow:d,send:u})},r.isProxyWindow=function(d){return!!(d&&!j(d)&&d.isProxyWindow)},r.toProxyWindow=function(d,s){var u=s.send;if(Ol(),r.isProxyWindow(d))return d;var N=d;return zn("winToProxyWindow").get(N)||new r({win:N,send:u})},r}();function Rl(r,o,d,s,u){var N=zn("methodStore"),S=In("proxyWindowMethods");ii.isProxyWindow(s)?S.set(r,{val:o,name:d,domain:u,source:s}):(S.del(r),N.getOrSet(s,function(){return{}})[r]={domain:u,name:d,val:o,source:s})}function ns(r,o){var d=zn("methodStore"),s=In("proxyWindowMethods");return d.getOrSet(r,function(){return{}})[o]||s.get(o)}function is(r,o,d,s,u){S=(N={on:u.on,send:u.send}).on,T=N.send,In("builtinListeners").getOrSet("functionCalls",function(){return S("postrobot_method",{domain:"*"},function(V){var _=V.source,P=V.origin,E=V.data,q=E.id,Y=E.name,ie=ns(_,q);if(!ie)throw new Error("Could not find method '"+Y+"' with id: "+E.id+" in "+c(window));var ce=ie.source,xe=ie.domain,Ce=ie.val;return x.try(function(){if(!R(xe,P))throw new Error("Method '"+E.name+"' domain "+JSON.stringify(Ml(ie.domain)?ie.domain.source:ie.domain)+" does not match origin "+P+" in "+c(window));if(ii.isProxyWindow(ce))return ce.matchWindow(_,{send:T}).then(function(ae){if(!ae)throw new Error("Method call '"+E.name+"' failed - proxy window does not match source in "+c(window))})}).then(function(){return Ce.apply({source:_,origin:P},E.args)},function(ae){return x.try(function(){if(Ce.onError)return Ce.onError(ae)}).then(function(){throw ae.stack&&(ae.stack="Remote call to "+Y+"("+function(he){return he===void 0&&(he=[]),Cl(he).map(function(pe){return typeof pe=="string"?"'"+pe+"'":pe===void 0?"undefined":pe===null?"null":typeof pe=="boolean"?pe.toString():Array.isArray(pe)?"[ ... ]":typeof pe=="object"?"{ ... }":typeof pe=="function"?"() => { ... }":"<"+typeof pe+">"}).join(", ")}(E.args)+`) failed
`+ae.stack),ae})}).then(function(ae){return{result:ae,id:q,name:Y}})})});var N,S,T,C=d.__id__||Rn();r=ii.unwrap(r);var L=d.__name__||d.name||s;return typeof L=="string"&&typeof L.indexOf=="function"&&L.indexOf("anonymous::")===0&&(L=L.replace("anonymous::",s+"::")),ii.isProxyWindow(r)?(Rl(C,d,L,r,o),r.awaitWindow().then(function(V){Rl(C,d,L,V,o)})):Rl(C,d,L,r,o),et("cross_domain_function",{id:C,name:L})}function ts(r,o,d,s){var u,N=s.on,S=s.send;return function(T,C){C===void 0&&(C=OS);var L=JSON.stringify(T,function(V){var _=this[V];if(Ul(this))return _;var P=Zm(_);if(!P)return _;var E=C[P]||US[P];return E?E(_,V):_});return L===void 0?"undefined":L}(d,((u={}).promise=function(T,C){return function(L,V,_,P,E){return et("cross_domain_zalgo_promise",{then:is(L,V,function(q,Y){return _.then(q,Y)},P,{on:E.on,send:E.send})})}(r,o,T,C,{on:N,send:S})},u.function=function(T,C){return is(r,o,T,C,{on:N,send:S})},u.object=function(T){return j(T)||ii.isProxyWindow(T)?et("cross_domain_window",ii.serialize(T,{send:S})):T},u))}function as(r,o,d,s){var u,N=s.send;return function(S,T){if(T===void 0&&(T=VS),S!=="undefined")return JSON.parse(S,function(C,L){if(Ul(this))return L;var V,_;if(Ul(L)?(V=L.__type__,_=L.__val__):(V=Zm(L),_=L),!V)return _;var P=T[V]||RS[V];return P?P(_,C):_})}(d,((u={}).cross_domain_zalgo_promise=function(S){return function(T,C,L){return new x(L.then)}(0,0,S)},u.cross_domain_function=function(S){return function(T,C,L,V){var _=L.id,P=L.name,E=V.send,q=function(ie){ie===void 0&&(ie={});function ce(){var xe=arguments;return ii.toProxyWindow(T,{send:E}).awaitWindow().then(function(Ce){var ae=ns(Ce,_);if(ae&&ae.val!==ce)return ae.val.apply({source:window,origin:c()},xe);var he=[].slice.call(xe);return ie.fireAndForget?E(Ce,"postrobot_method",{id:_,name:P,args:he},{domain:C,fireAndForget:!0}):E(Ce,"postrobot_method",{id:_,name:P,args:he},{domain:C,fireAndForget:!1}).then(function(pe){return pe.data.result})}).catch(function(Ce){throw Ce})}return ce.__name__=P,ce.__origin__=C,ce.__source__=T,ce.__id__=_,ce.origin=C,ce},Y=q();return Y.fireAndForget=q({fireAndForget:!0}),Y}(r,o,S,{send:N})},u.cross_domain_window=function(S){return ii.deserialize(S,{send:N})},u))}var rr={};rr.postrobot_post_message=function(r,o,d){d.indexOf("file:")===0&&(d="*"),r.postMessage(o,d)},rr.postrobot_global=function(r,o){if(!function(s){return(s=s||window).navigator.mockUserAgent||s.navigator.userAgent}(window).match(/MSIE|rv:11|trident|edge\/12|edge\/13/i))throw new Error("Global messaging not needed for browser");if(!h(r))throw new Error("Post message through global disabled between different domain windows");if(J(window,r)!==!1)throw new Error("Can only use global to communicate between two different windows, not between frames");var d=St(r);if(!d)throw new Error("Can not find postRobot global on foreign window");d.receiveMessage({source:window,origin:c(),data:o})};function Vl(r,o,d,s){var u=s.on,N=s.send;return x.try(function(){var S=zn().getOrSet(r,function(){return{}});return S.buffer=S.buffer||[],S.buffer.push(d),S.flush=S.flush||x.flush().then(function(){if(Se(r))throw new Error("Window is closed");var T=ts(r,o,((C={}).__post_robot_11_0_0__=S.buffer||[],C),{on:u,send:N}),C;delete S.buffer;for(var L=Object.keys(rr),V=[],_=0;_<L.length;_++){var P=L[_];try{rr[P](r,T,o)}catch(E){V.push(E)}}if(V.length===L.length)throw new Error(`All post-robot messaging strategies failed:
`+V.map(function(E,q){return q+". "+Ft(E)}).join(`
`))}),S.flush.then(function(){delete S.flush})}).then(Sn)}function rs(r){return In("responseListeners").get(r)}function ls(r){In("responseListeners").del(r)}function ds(r){return In("erroredResponseListeners").has(r)}function os(r){var o=r.name,d=r.win,s=r.domain,u=zn("requestListeners");if(d==="*"&&(d=null),s==="*"&&(s=null),!o)throw new Error("Name required to get request listener");for(var N=0,S=[d,ar()];N<S.length;N++){var T=S[N];if(T){var C=u.get(T);if(C){var L=C[o];if(L){if(s&&typeof s=="string"){if(L[s])return L[s];if(L.__domain_regex__)for(var V=0,_=L.__domain_regex__;V<_.length;V++){var P=_[V],E=P.listener;if(R(P.regex,s))return E}}if(L["*"])return L["*"]}}}}}function ms(r,o){var d=o.on,s=o.send,u=In("receivedMessages");try{if(!window||window.closed||!r.source)return}catch{return}var N=r.source,S=r.origin,T=function(_,P,E,q){var Y=q.on,ie=q.send,ce;try{ce=as(P,E,_,{on:Y,send:ie})}catch{return}if(ce&&typeof ce=="object"&&ce!==null){var xe=ce.__post_robot_11_0_0__;if(Array.isArray(xe))return xe}}(r.data,N,S,{on:d,send:s});if(T){Xm(N);for(var C=function(){var _=T[L];if(u.has(_.id))return{v:void 0};if(u.set(_.id,!0),Se(N)&&!_.fireAndForget)return{v:void 0};_.origin.indexOf("file:")===0&&(S="file://");try{_.type==="postrobot_message_request"?function(P,E,q,Y){var ie=Y.on,ce=Y.send,xe=os({name:q.name,win:P,domain:E}),Ce=q.name==="postrobot_method"&&q.data&&typeof q.data.name=="string"?q.data.name+"()":q.name;function ae(he,pe,Ie){return x.flush().then(function(){if(!q.fireAndForget&&!Se(P))try{return Vl(P,E,{id:Rn(),origin:c(window),type:"postrobot_message_response",hash:q.hash,name:q.name,ack:he,data:pe,error:Ie},{on:ie,send:ce})}catch(ge){throw new Error("Send response message failed for "+Ce+" in "+c()+`
`+Ft(ge))}})}x.all([x.flush().then(function(){if(!q.fireAndForget&&!Se(P))try{return Vl(P,E,{id:Rn(),origin:c(window),type:"postrobot_message_ack",hash:q.hash,name:q.name},{on:ie,send:ce})}catch(he){throw new Error("Send ack message failed for "+Ce+" in "+c()+`
`+Ft(he))}}),x.try(function(){if(!xe)throw new Error("No handler found for post message: "+q.name+" from "+E+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return xe.handler({source:P,origin:E,data:q.data})}).then(function(he){return ae("success",he)},function(he){return ae("error",null,he)})]).then(Sn).catch(function(he){if(xe&&xe.handleError)return xe.handleError(he);throw he})}(N,S,_,{on:d,send:s}):_.type==="postrobot_message_response"?function(P,E,q){if(!ds(q.hash)){var Y=rs(q.hash);if(!Y)throw new Error("No handler found for post message response for message: "+q.name+" from "+E+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!R(Y.domain,E))throw new Error("Response origin "+E+" does not match domain "+(ie=Y.domain,Array.isArray(ie)?"("+ie.join(" | ")+")":ve(ie)?"RegExp("+ie.toString()+")":ie.toString()));var ie;if(P!==Y.win)throw new Error("Response source does not match registered window");ls(q.hash),q.ack==="error"?Y.promise.reject(q.error):q.ack==="success"&&Y.promise.resolve({source:P,origin:E,data:q.data})}}(N,S,_):_.type==="postrobot_message_ack"&&function(P,E,q){if(!ds(q.hash)){var Y=rs(q.hash);if(!Y)throw new Error("No handler found for post message ack for message: "+q.name+" from "+E+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!R(Y.domain,E))throw new Error("Ack origin "+E+" does not match domain "+Y.domain.toString());if(P!==Y.win)throw new Error("Ack source does not match registered window")}catch(ie){Y.promise.reject(ie)}Y.ack=!0}}(N,S,_)}catch(P){setTimeout(function(){throw P},0)}},L=0;L<T.length;L++){var V=C();if(typeof V=="object")return V.v}}}function Vi(r,o,d){if(!r)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(d=o,o={}),!d)throw new Error("Expected handler");var s=function u(N,S){var T=N.name,C=N.win,L=N.domain,V=zn("requestListeners");if(!T||typeof T!="string")throw new Error("Name required to add request listener");if(C&&C!=="*"&&ii.isProxyWindow(C)){var _=C.awaitWindow().then(function(je){return u({name:T,win:je,domain:L},S)});return{cancel:function(){_.then(function(je){return je.cancel()},Sn)}}}var P=C;if(Array.isArray(P)){for(var E=[],q=0,Y=P;q<Y.length;q++)E.push(u({name:T,domain:L,win:Y[q]},S));return{cancel:function(){for(var je=0;je<E.length;je++)E[je].cancel()}}}if(Array.isArray(L)){for(var ie=[],ce=0,xe=L;ce<xe.length;ce++)ie.push(u({name:T,win:P,domain:xe[ce]},S));return{cancel:function(){for(var je=0;je<ie.length;je++)ie[je].cancel()}}}var Ce=os({name:T,win:P,domain:L});P&&P!=="*"||(P=ar());var ae=(L=L||"*").toString();if(Ce)throw P&&L?new Error("Request listener already exists for "+T+" on domain "+L.toString()+" for "+(P===ar()?"wildcard":"specified")+" window"):P?new Error("Request listener already exists for "+T+" for "+(P===ar()?"wildcard":"specified")+" window"):L?new Error("Request listener already exists for "+T+" on domain "+L.toString()):new Error("Request listener already exists for "+T);var he=V.getOrSet(P,function(){return{}}),pe=ea(he,T,function(){return{}}),Ie,ge;return Ml(L)?(Ie=ea(pe,"__domain_regex__",function(){return[]})).push(ge={regex:L,listener:S}):pe[ae]=S,{cancel:function(){delete pe[ae],ge&&(Ie.splice(Ie.indexOf(ge,1)),Ie.length||delete pe.__domain_regex__),Object.keys(pe).length||delete he[T],P&&!Object.keys(he).length&&V.del(P)}}}({name:r,win:o.window,domain:o.domain||"*"},{handler:d||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){s.cancel()}}}var Fi=function r(o,d,s,u){var N=(u=u||{}).domain||"*",S=u.timeout||-1,T=u.timeout||5e3,C=u.fireAndForget||!1;return ii.toProxyWindow(o,{send:r}).awaitWindow().then(function(L){return x.try(function(){if(function(V,_,P){if(!V)throw new Error("Expected name");if(P&&typeof P!="string"&&!Array.isArray(P)&&!Ml(P))throw new TypeError("Can not send "+V+". Expected domain "+JSON.stringify(P)+" to be a string, array, or regex");if(Se(_))throw new Error("Can not send "+V+". Target window is closed")}(d,L,N),function(V,_){var P=k(_);if(P)return P===V;if(_===V||Ge(_)===_)return!1;for(var E=0,q=O(V);E<q.length;E++)if(q[E]===_)return!0;return!1}(window,L))return function(V,_,P){_===void 0&&(_=5e3),P===void 0&&(P="Window");var E=function(q){return zn("helloPromises").getOrSet(q,function(){return new x})}(V);return _!==-1&&(E=E.timeout(_,new Error(P+" did not load after "+_+"ms"))),E}(L,T)}).then(function(V){return function(_,P,E,q){var Y=q.send;return x.try(function(){return typeof P=="string"?P:x.try(function(){return E||Ll(_,{send:Y}).then(function(ie){return ie.domain})}).then(function(ie){if(!R(P,P))throw new Error("Domain "+Ya(P)+" does not match "+Ya(P));return ie})})}(L,N,(V===void 0?{}:V).domain,{send:r})}).then(function(V){var _=V,P=d==="postrobot_method"&&s&&typeof s.name=="string"?s.name+"()":d,E=new x,q=d+"_"+Rn();if(!C){var Y={name:d,win:L,domain:_,promise:E};(function(pe,Ie){In("responseListeners").set(pe,Ie)})(q,Y);var ie=zn("requestPromises").getOrSet(L,function(){return[]});ie.push(E),E.catch(function(){(function(pe){In("erroredResponseListeners").set(pe,!0)})(q),ls(q)});var ce=function(pe){return zn("knownWindows").get(pe,!1)}(L)?1e4:2e3,xe=S,Ce=ce,ae=xe,he=Zt(function(){return Se(L)?E.reject(new Error("Window closed for "+d+" before "+(Y.ack?"response":"ack"))):Y.cancelled?E.reject(new Error("Response listener was cancelled for "+d)):(Ce=Math.max(Ce-500,0),ae!==-1&&(ae=Math.max(ae-500,0)),Y.ack||Ce!==0?ae===0?E.reject(new Error("No response for postMessage "+P+" in "+c()+" in "+xe+"ms")):void 0:E.reject(new Error("No ack for postMessage "+P+" in "+c()+" in "+ce+"ms")))},500);E.finally(function(){he.cancel(),ie.splice(ie.indexOf(E,1))}).catch(Sn)}return Vl(L,_,{id:Rn(),origin:c(window),type:"postrobot_message_request",hash:q,name:d,data:s,fireAndForget:C},{on:Vi,send:r}).then(function(){return C?E.resolve():E},function(pe){throw new Error("Send request message failed for "+P+" in "+c()+`
`+Ft(pe))})})})};function ta(r){return ii.toProxyWindow(r,{send:Fi})}function aa(r){if(!h(r))throw new Error("Can not get global for window on different domain");return r.__zoid_10_3_1__||(r.__zoid_10_3_1__={}),r.__zoid_10_3_1__}function ss(r,o){try{return o(aa(r))}catch{}}function lr(r){return{get:function(){var o=this;return x.try(function(){if(o.source&&o.source!==window)throw new Error("Can not call get on proxy object from a remote window");return r})}}}function qS(r){return Dl(JSON.stringify(r))}function ql(r){var o=aa(r);return o.references=o.references||{},o.references}function us(r){var o=r.data,d=r.metaData,s=r.sender,u=r.receiver,N=r.passByReference,S=N!==void 0&&N,T=r.basic,C=T!==void 0&&T,L=ta(u.win),V=C?JSON.stringify(o):ts(L,u.domain,o,{on:Vi,send:Fi}),_=S?function(P){var E=Rn();return ql(window)[E]=P,{type:"uid",uid:E}}(V):{type:"raw",val:V};return{serializedData:qS({sender:{domain:s.domain},metaData:d,reference:_}),cleanReference:function(){P=window,(E=_).type==="uid"&&delete ql(P)[E.uid];var P,E}}}function cs(r){var o=r.sender,d=r.basic,s=d!==void 0&&d,u=function(V){return JSON.parse(function(_){if(typeof atob=="function")return decodeURIComponent([].map.call(atob(_),function(P){return"%"+("00"+P.charCodeAt(0).toString(16)).slice(-2)}).join(""));if(typeof Buffer<"u")return Buffer.from(_,"base64").toString("utf8");throw new Error("Can not find window.atob or Buffer")}(V))}(r.data),N=u.reference,S=u.metaData,T;T=typeof o.win=="function"?o.win({metaData:S}):o.win;var C;C=typeof o.domain=="function"?o.domain({metaData:S}):typeof o.domain=="string"?o.domain:u.sender.domain;var L=function(V,_){if(_.type==="raw")return _.val;if(_.type=