@pitcher/js-api 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/js-api.umd.min.js CHANGED
@@ -1,18 +1,18 @@
1
- (function(_,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(_=typeof globalThis<"u"?globalThis:_||self,Ee(_.pitcher={}))})(this,function(_){"use strict";function Ee(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Lr(e={}){return this.API.request("open",e)}function zr(){return this.API.request("get_env")}function Ur(e){return this.API.request("update_my_user",e)}function Fr(){return this.API.request("get_languages")}function qr(e){return _.highLevelApi.API.request("get_events",e)}function Hr(e){return _.highLevelApi.API.request("create_event",e)}function Gr(e){return _.highLevelApi.API.request("update_event",e)}function Br(e){return _.highLevelApi.API.request("delete_event",e)}function Vr(e){return this.API.request("get_canvases",e)}function Zr(e){return this.API.request("create_canvas",e)}function Yr(e){return this.API.request("delete_canvas",e)}function Jr(e){return this.API.request("update_canvas",e)}function Kr(e){return this.API.request("get_canvas",e)}function Qr(e){return this.API.request("share_canvas",e)}function kr(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function Xr(e){return this.API.request("download_file",e)}function eo(e){return this.API.request("get_app_config",e)}function to(e){return this.API.request("get_file",e)}function no(e){return this.API.request("delete_file",e)}function ro(e){return this.API.request("create_file",e)}function oo(){return this.API.request("select_device_file")}function io(e){return this.API.request("search",e)}function ao(e){return this.API.request("get_users",e)}function uo(e){return this.API.request("getService",e)}function so(e){return this.API.request("refresh_service_token",e)}function co(){return this.API.request("get_connections")}function fo(e){return this.API.request("connection_login",e)}function lo(e){return this.API.request("connection_logout",e)}function ho(e){return this.API.request("fetch_document_info",e)}function go(e){return this.API.request("render_page_as_image",e)}function po(e){return this.API.request("toast",e)}function vo(e){return _.highLevelApi.API.request("query",e)}function wo(e={id:"root"}){return this.API.request("get_folder",e)}function yo(e){return this.API.request("create_folder",e)}function mo(e){return this.API.request("update_folder",e)}function bo(e){return this.API.request("delete_folder",e)}function _o(e){return this.API.request("move_folder_items",e)}function Eo(e){return this.API.request("get_favorites",e)}function Ao(e){return this.API.request("create_favorite",e)}function So(e){return this.API.request("delete_favorite",e)}function Po(e){return e.type||(e.type="native"),_.highLevelApi.API.request("notify",e)}function To(e){return _.highLevelApi.API.request("track",e)}function xo(e){return this.API.request("get_instance_metadata_templates",e)}function Oo(){return this.API.request("trigger_non_files_sync")}const Io=Object.freeze(Object.defineProperty({__proto__:null,connectionLogin:fo,connectionLogout:lo,createCanvas:Zr,createEvent:Hr,createFavorite:Ao,createFile:ro,createFolder:yo,deleteCanvas:Yr,deleteEvent:Br,deleteFavorite:So,deleteFile:no,deleteFolder:bo,downloadFile:Xr,fetchDocumentInfo:ho,getAppConfig:eo,getCanvas:Kr,getCanvases:Vr,getConnections:co,getEnv:zr,getEvents:qr,getFavorites:Eo,getFile:to,getFiles:kr,getFolder:wo,getInstanceMetadataTemplates:xo,getLanguages:Fr,getService:uo,getUsers:ao,moveFolderItems:_o,notify:Po,open:Lr,query:vo,refreshServiceToken:so,renderPageAsImage:go,search:io,selectDeviceFile:oo,shareCanvas:Qr,toast:po,track:To,triggerNonFilesSync:Oo,updateCanvas:Jr,updateEvent:Gr,updateFolder:mo,updateMyUser:Ur},Symbol.toStringTag,{value:"Module"}));class Pt{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Le;const jo=new Uint8Array(16);function Co(){if(!Le&&(Le=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Le))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Le(jo)}const z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function Wo(e,r=0){return z[e[r+0]]+z[e[r+1]]+z[e[r+2]]+z[e[r+3]]+"-"+z[e[r+4]]+z[e[r+5]]+"-"+z[e[r+6]]+z[e[r+7]]+"-"+z[e[r+8]]+z[e[r+9]]+"-"+z[e[r+10]]+z[e[r+11]]+z[e[r+12]]+z[e[r+13]]+z[e[r+14]]+z[e[r+15]]}const Tt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function xt(e,r,a){if(Tt.randomUUID&&!r&&!e)return Tt.randomUUID();e=e||{};const s=e.random||(e.rng||Co)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return Wo(s)}var Ot=typeof global=="object"&&global&&global.Object===Object&&global,Do=typeof self=="object"&&self&&self.Object===Object&&self,J=Ot||Do||Function("return this")(),ne=J.Symbol,It=Object.prototype,Ro=It.hasOwnProperty,$o=It.toString,Ae=ne?ne.toStringTag:void 0;function Mo(e){var r=Ro.call(e,Ae),a=e[Ae];try{e[Ae]=void 0;var s=!0}catch{}var h=$o.call(e);return s&&(r?e[Ae]=a:delete e[Ae]),h}var No=Object.prototype,Lo=No.toString;function zo(e){return Lo.call(e)}var Uo="[object Null]",Fo="[object Undefined]",jt=ne?ne.toStringTag:void 0;function pe(e){return e==null?e===void 0?Fo:Uo:jt&&jt in Object(e)?Mo(e):zo(e)}function ve(e){return e!=null&&typeof e=="object"}var qo="[object Symbol]";function Ho(e){return typeof e=="symbol"||ve(e)&&pe(e)==qo}function Go(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var ze=Array.isArray,Bo=1/0,Ct=ne?ne.prototype:void 0,Wt=Ct?Ct.toString:void 0;function Dt(e){if(typeof e=="string")return e;if(ze(e))return Go(e,Dt)+"";if(Ho(e))return Wt?Wt.call(e):"";var r=e+"";return r=="0"&&1/e==-Bo?"-0":r}function Se(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Vo="[object AsyncFunction]",Zo="[object Function]",Yo="[object GeneratorFunction]",Jo="[object Proxy]";function Rt(e){if(!Se(e))return!1;var r=pe(e);return r==Zo||r==Yo||r==Vo||r==Jo}var Ke=J["__core-js_shared__"],$t=function(){var e=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ko(e){return!!$t&&$t in e}var Qo=Function.prototype,ko=Qo.toString;function ie(e){if(e!=null){try{return ko.call(e)}catch{}try{return e+""}catch{}}return""}var Xo=/[\\^$.*+?()[\]{}|]/g,ei=/^\[object .+?Constructor\]$/,ti=Function.prototype,ni=Object.prototype,ri=ti.toString,oi=ni.hasOwnProperty,ii=RegExp("^"+ri.call(oi).replace(Xo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ai(e){if(!Se(e)||Ko(e))return!1;var r=Rt(e)?ii:ei;return r.test(ie(e))}function ui(e,r){return e?.[r]}function ae(e,r){var a=ui(e,r);return ai(a)?a:void 0}var Qe=ae(J,"WeakMap"),Mt=Object.create,si=function(){function e(){}return function(r){if(!Se(r))return{};if(Mt)return Mt(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function ci(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var Nt=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch{}}();function fi(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var di=9007199254740991,li=/^(?:0|[1-9]\d*)$/;function hi(e,r){var a=typeof e;return r=r??di,!!r&&(a=="number"||a!="symbol"&&li.test(e))&&e>-1&&e%1==0&&e<r}function Lt(e,r,a){r=="__proto__"&&Nt?Nt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function zt(e,r){return e===r||e!==e&&r!==r}var gi=Object.prototype,pi=gi.hasOwnProperty;function Ut(e,r,a){var s=e[r];(!(pi.call(e,r)&&zt(s,a))||a===void 0&&!(r in e))&&Lt(e,r,a)}function Ue(e,r,a,s){var h=!a;a||(a={});for(var y=-1,b=r.length;++y<b;){var P=r[y],W=s?s(a[P],e[P],P,a,e):void 0;W===void 0&&(W=e[P]),h?Lt(a,P,W):Ut(a,P,W)}return a}var vi=9007199254740991;function Ft(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vi}function qt(e){return e!=null&&Ft(e.length)&&!Rt(e)}var wi=Object.prototype;function ke(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||wi;return e===a}function yi(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var mi="[object Arguments]";function Ht(e){return ve(e)&&pe(e)==mi}var Gt=Object.prototype,bi=Gt.hasOwnProperty,_i=Gt.propertyIsEnumerable,Ei=Ht(function(){return arguments}())?Ht:function(e){return ve(e)&&bi.call(e,"callee")&&!_i.call(e,"callee")};function Ai(){return!1}var Bt=typeof _=="object"&&_&&!_.nodeType&&_,Vt=Bt&&typeof module=="object"&&module&&!module.nodeType&&module,Si=Vt&&Vt.exports===Bt,Zt=Si?J.Buffer:void 0,Pi=Zt?Zt.isBuffer:void 0,Yt=Pi||Ai,Ti="[object Arguments]",xi="[object Array]",Oi="[object Boolean]",Ii="[object Date]",ji="[object Error]",Ci="[object Function]",Wi="[object Map]",Di="[object Number]",Ri="[object Object]",$i="[object RegExp]",Mi="[object Set]",Ni="[object String]",Li="[object WeakMap]",zi="[object ArrayBuffer]",Ui="[object DataView]",Fi="[object Float32Array]",qi="[object Float64Array]",Hi="[object Int8Array]",Gi="[object Int16Array]",Bi="[object Int32Array]",Vi="[object Uint8Array]",Zi="[object Uint8ClampedArray]",Yi="[object Uint16Array]",Ji="[object Uint32Array]",C={};C[Fi]=C[qi]=C[Hi]=C[Gi]=C[Bi]=C[Vi]=C[Zi]=C[Yi]=C[Ji]=!0,C[Ti]=C[xi]=C[zi]=C[Oi]=C[Ui]=C[Ii]=C[ji]=C[Ci]=C[Wi]=C[Di]=C[Ri]=C[$i]=C[Mi]=C[Ni]=C[Li]=!1;function Ki(e){return ve(e)&&Ft(e.length)&&!!C[pe(e)]}function Xe(e){return function(r){return e(r)}}var Jt=typeof _=="object"&&_&&!_.nodeType&&_,Pe=Jt&&typeof module=="object"&&module&&!module.nodeType&&module,Qi=Pe&&Pe.exports===Jt,et=Qi&&Ot.process,we=function(){try{var e=Pe&&Pe.require&&Pe.require("util").types;return e||et&&et.binding&&et.binding("util")}catch{}}(),Kt=we&&we.isTypedArray,ki=Kt?Xe(Kt):Ki,Xi=Object.prototype,ea=Xi.hasOwnProperty;function Qt(e,r){var a=ze(e),s=!a&&Ei(e),h=!a&&!s&&Yt(e),y=!a&&!s&&!h&&ki(e),b=a||s||h||y,P=b?yi(e.length,String):[],W=P.length;for(var U in e)(r||ea.call(e,U))&&!(b&&(U=="length"||h&&(U=="offset"||U=="parent")||y&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||hi(U,W)))&&P.push(U);return P}function kt(e,r){return function(a){return e(r(a))}}var ta=kt(Object.keys,Object),na=Object.prototype,ra=na.hasOwnProperty;function oa(e){if(!ke(e))return ta(e);var r=[];for(var a in Object(e))ra.call(e,a)&&a!="constructor"&&r.push(a);return r}function tt(e){return qt(e)?Qt(e):oa(e)}function ia(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var aa=Object.prototype,ua=aa.hasOwnProperty;function sa(e){if(!Se(e))return ia(e);var r=ke(e),a=[];for(var s in e)s=="constructor"&&(r||!ua.call(e,s))||a.push(s);return a}function nt(e){return qt(e)?Qt(e,!0):sa(e)}var Te=ae(Object,"create");function ca(){this.__data__=Te?Te(null):{},this.size=0}function fa(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var da="__lodash_hash_undefined__",la=Object.prototype,ha=la.hasOwnProperty;function ga(e){var r=this.__data__;if(Te){var a=r[e];return a===da?void 0:a}return ha.call(r,e)?r[e]:void 0}var pa=Object.prototype,va=pa.hasOwnProperty;function wa(e){var r=this.__data__;return Te?r[e]!==void 0:va.call(r,e)}var ya="__lodash_hash_undefined__";function ma(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Te&&r===void 0?ya:r,this}function ue(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ue.prototype.clear=ca,ue.prototype.delete=fa,ue.prototype.get=ga,ue.prototype.has=wa,ue.prototype.set=ma;function ba(){this.__data__=[],this.size=0}function Fe(e,r){for(var a=e.length;a--;)if(zt(e[a][0],r))return a;return-1}var _a=Array.prototype,Ea=_a.splice;function Aa(e){var r=this.__data__,a=Fe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Ea.call(r,a,1),--this.size,!0}function Sa(e){var r=this.__data__,a=Fe(r,e);return a<0?void 0:r[a][1]}function Pa(e){return Fe(this.__data__,e)>-1}function Ta(e,r){var a=this.__data__,s=Fe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function ee(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ee.prototype.clear=ba,ee.prototype.delete=Aa,ee.prototype.get=Sa,ee.prototype.has=Pa,ee.prototype.set=Ta;var xe=ae(J,"Map");function xa(){this.size=0,this.__data__={hash:new ue,map:new(xe||ee),string:new ue}}function Oa(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function qe(e,r){var a=e.__data__;return Oa(r)?a[typeof r=="string"?"string":"hash"]:a.map}function Ia(e){var r=qe(this,e).delete(e);return this.size-=r?1:0,r}function ja(e){return qe(this,e).get(e)}function Ca(e){return qe(this,e).has(e)}function Wa(e,r){var a=qe(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function ye(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ye.prototype.clear=xa,ye.prototype.delete=Ia,ye.prototype.get=ja,ye.prototype.has=Ca,ye.prototype.set=Wa;function He(e){return e==null?"":Dt(e)}function Xt(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var Da=kt(Object.getPrototypeOf,Object);const en=Da;function Ra(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function $a(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Ra(e,r,a)}var Ma="\\ud800-\\udfff",Na="\\u0300-\\u036f",La="\\ufe20-\\ufe2f",za="\\u20d0-\\u20ff",Ua=Na+La+za,Fa="\\ufe0e\\ufe0f",qa="\\u200d",Ha=RegExp("["+qa+Ma+Ua+Fa+"]");function tn(e){return Ha.test(e)}function Ga(e){return e.split("")}var nn="\\ud800-\\udfff",Ba="\\u0300-\\u036f",Va="\\ufe20-\\ufe2f",Za="\\u20d0-\\u20ff",Ya=Ba+Va+Za,Ja="\\ufe0e\\ufe0f",Ka="["+nn+"]",rt="["+Ya+"]",ot="\\ud83c[\\udffb-\\udfff]",Qa="(?:"+rt+"|"+ot+")",rn="[^"+nn+"]",on="(?:\\ud83c[\\udde6-\\uddff]){2}",an="[\\ud800-\\udbff][\\udc00-\\udfff]",ka="\\u200d",un=Qa+"?",sn="["+Ja+"]?",Xa="(?:"+ka+"(?:"+[rn,on,an].join("|")+")"+sn+un+")*",eu=sn+un+Xa,tu="(?:"+[rn+rt+"?",rt,on,an,Ka].join("|")+")",nu=RegExp(ot+"(?="+ot+")|"+tu+eu,"g");function ru(e){return e.match(nu)||[]}function ou(e){return tn(e)?ru(e):Ga(e)}function iu(e){return function(r){r=He(r);var a=tn(r)?ou(r):void 0,s=a?a[0]:r.charAt(0),h=a?$a(a,1).join(""):r.slice(1);return s[e]()+h}}var au=iu("toUpperCase");function uu(e){return au(He(e).toLowerCase())}function su(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function cu(e){return function(r){return e?.[r]}}var fu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},du=cu(fu);const lu=du;var hu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,gu="\\u0300-\\u036f",pu="\\ufe20-\\ufe2f",vu="\\u20d0-\\u20ff",wu=gu+pu+vu,yu="["+wu+"]",mu=RegExp(yu,"g");function bu(e){return e=He(e),e&&e.replace(hu,lu).replace(mu,"")}var _u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Eu(e){return e.match(_u)||[]}var Au=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Su(e){return Au.test(e)}var cn="\\ud800-\\udfff",Pu="\\u0300-\\u036f",Tu="\\ufe20-\\ufe2f",xu="\\u20d0-\\u20ff",Ou=Pu+Tu+xu,fn="\\u2700-\\u27bf",dn="a-z\\xdf-\\xf6\\xf8-\\xff",Iu="\\xac\\xb1\\xd7\\xf7",ju="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Cu="\\u2000-\\u206f",Wu=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ln="A-Z\\xc0-\\xd6\\xd8-\\xde",Du="\\ufe0e\\ufe0f",hn=Iu+ju+Cu+Wu,gn="['’]",pn="["+hn+"]",Ru="["+Ou+"]",vn="\\d+",$u="["+fn+"]",wn="["+dn+"]",yn="[^"+cn+hn+vn+fn+dn+ln+"]",Mu="\\ud83c[\\udffb-\\udfff]",Nu="(?:"+Ru+"|"+Mu+")",Lu="[^"+cn+"]",mn="(?:\\ud83c[\\udde6-\\uddff]){2}",bn="[\\ud800-\\udbff][\\udc00-\\udfff]",me="["+ln+"]",zu="\\u200d",_n="(?:"+wn+"|"+yn+")",Uu="(?:"+me+"|"+yn+")",En="(?:"+gn+"(?:d|ll|m|re|s|t|ve))?",An="(?:"+gn+"(?:D|LL|M|RE|S|T|VE))?",Sn=Nu+"?",Pn="["+Du+"]?",Fu="(?:"+zu+"(?:"+[Lu,mn,bn].join("|")+")"+Pn+Sn+")*",qu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gu=Pn+Sn+Fu,Bu="(?:"+[$u,mn,bn].join("|")+")"+Gu,Vu=RegExp([me+"?"+wn+"+"+En+"(?="+[pn,me,"$"].join("|")+")",Uu+"+"+An+"(?="+[pn,me+_n,"$"].join("|")+")",me+"?"+_n+"+"+En,me+"+"+An,Hu,qu,vn,Bu].join("|"),"g");function Zu(e){return e.match(Vu)||[]}function Yu(e,r,a){return e=He(e),r=a?void 0:r,r===void 0?Su(e)?Zu(e):Eu(e):e.match(r)||[]}var Ju="['’]",Ku=RegExp(Ju,"g");function Tn(e){return function(r){return su(Yu(bu(r).replace(Ku,"")),e,"")}}var Qu=Tn(function(e,r,a){return r=r.toLowerCase(),e+(a?uu(r):r)});const ku=Qu;function Xu(){this.__data__=new ee,this.size=0}function es(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function ts(e){return this.__data__.get(e)}function ns(e){return this.__data__.has(e)}var rs=200;function os(e,r){var a=this.__data__;if(a instanceof ee){var s=a.__data__;if(!xe||s.length<rs-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new ye(s)}return a.set(e,r),this.size=a.size,this}function be(e){var r=this.__data__=new ee(e);this.size=r.size}be.prototype.clear=Xu,be.prototype.delete=es,be.prototype.get=ts,be.prototype.has=ns,be.prototype.set=os;function is(e,r){return e&&Ue(r,tt(r),e)}function as(e,r){return e&&Ue(r,nt(r),e)}var xn=typeof _=="object"&&_&&!_.nodeType&&_,On=xn&&typeof module=="object"&&module&&!module.nodeType&&module,us=On&&On.exports===xn,In=us?J.Buffer:void 0,jn=In?In.allocUnsafe:void 0;function ss(e,r){if(r)return e.slice();var a=e.length,s=jn?jn(a):new e.constructor(a);return e.copy(s),s}function cs(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var b=e[a];r(b,a,e)&&(y[h++]=b)}return y}function Cn(){return[]}var fs=Object.prototype,ds=fs.propertyIsEnumerable,Wn=Object.getOwnPropertySymbols,it=Wn?function(e){return e==null?[]:(e=Object(e),cs(Wn(e),function(r){return ds.call(e,r)}))}:Cn;function ls(e,r){return Ue(e,it(e),r)}var hs=Object.getOwnPropertySymbols,Dn=hs?function(e){for(var r=[];e;)Xt(r,it(e)),e=en(e);return r}:Cn;function gs(e,r){return Ue(e,Dn(e),r)}function Rn(e,r,a){var s=r(e);return ze(e)?s:Xt(s,a(e))}function ps(e){return Rn(e,tt,it)}function vs(e){return Rn(e,nt,Dn)}var at=ae(J,"DataView"),ut=ae(J,"Promise"),st=ae(J,"Set"),$n="[object Map]",ws="[object Object]",Mn="[object Promise]",Nn="[object Set]",Ln="[object WeakMap]",zn="[object DataView]",ys=ie(at),ms=ie(xe),bs=ie(ut),_s=ie(st),Es=ie(Qe),se=pe;(at&&se(new at(new ArrayBuffer(1)))!=zn||xe&&se(new xe)!=$n||ut&&se(ut.resolve())!=Mn||st&&se(new st)!=Nn||Qe&&se(new Qe)!=Ln)&&(se=function(e){var r=pe(e),a=r==ws?e.constructor:void 0,s=a?ie(a):"";if(s)switch(s){case ys:return zn;case ms:return $n;case bs:return Mn;case _s:return Nn;case Es:return Ln}return r});const ct=se;var As=Object.prototype,Ss=As.hasOwnProperty;function Ps(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&Ss.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Un=J.Uint8Array;function ft(e){var r=new e.constructor(e.byteLength);return new Un(r).set(new Un(e)),r}function Ts(e,r){var a=r?ft(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var xs=/\w*$/;function Os(e){var r=new e.constructor(e.source,xs.exec(e));return r.lastIndex=e.lastIndex,r}var Fn=ne?ne.prototype:void 0,qn=Fn?Fn.valueOf:void 0;function Is(e){return qn?Object(qn.call(e)):{}}function js(e,r){var a=r?ft(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Cs="[object Boolean]",Ws="[object Date]",Ds="[object Map]",Rs="[object Number]",$s="[object RegExp]",Ms="[object Set]",Ns="[object String]",Ls="[object Symbol]",zs="[object ArrayBuffer]",Us="[object DataView]",Fs="[object Float32Array]",qs="[object Float64Array]",Hs="[object Int8Array]",Gs="[object Int16Array]",Bs="[object Int32Array]",Vs="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Ys="[object Uint16Array]",Js="[object Uint32Array]";function Ks(e,r,a){var s=e.constructor;switch(r){case zs:return ft(e);case Cs:case Ws:return new s(+e);case Us:return Ts(e,a);case Fs:case qs:case Hs:case Gs:case Bs:case Vs:case Zs:case Ys:case Js:return js(e,a);case Ds:return new s;case Rs:case Ns:return new s(e);case $s:return Os(e);case Ms:return new s;case Ls:return Is(e)}}function Qs(e){return typeof e.constructor=="function"&&!ke(e)?si(en(e)):{}}var ks="[object Map]";function Xs(e){return ve(e)&&ct(e)==ks}var Hn=we&&we.isMap,ec=Hn?Xe(Hn):Xs,tc="[object Set]";function nc(e){return ve(e)&&ct(e)==tc}var Gn=we&&we.isSet,rc=Gn?Xe(Gn):nc,oc=1,ic=2,ac=4,Bn="[object Arguments]",uc="[object Array]",sc="[object Boolean]",cc="[object Date]",fc="[object Error]",Vn="[object Function]",dc="[object GeneratorFunction]",lc="[object Map]",hc="[object Number]",Zn="[object Object]",gc="[object RegExp]",pc="[object Set]",vc="[object String]",wc="[object Symbol]",yc="[object WeakMap]",mc="[object ArrayBuffer]",bc="[object DataView]",_c="[object Float32Array]",Ec="[object Float64Array]",Ac="[object Int8Array]",Sc="[object Int16Array]",Pc="[object Int32Array]",Tc="[object Uint8Array]",xc="[object Uint8ClampedArray]",Oc="[object Uint16Array]",Ic="[object Uint32Array]",O={};O[Bn]=O[uc]=O[mc]=O[bc]=O[sc]=O[cc]=O[_c]=O[Ec]=O[Ac]=O[Sc]=O[Pc]=O[lc]=O[hc]=O[Zn]=O[gc]=O[pc]=O[vc]=O[wc]=O[Tc]=O[xc]=O[Oc]=O[Ic]=!0,O[fc]=O[Vn]=O[yc]=!1;function Ge(e,r,a,s,h,y){var b,P=r&oc,W=r&ic,U=r&ac;if(a&&(b=h?a(e,s,h,y):a(e)),b!==void 0)return b;if(!Se(e))return e;var K=ze(e);if(K){if(b=Ps(e),!P)return ci(e,b)}else{var te=ct(e),fe=te==Vn||te==dc;if(Yt(e))return ss(e,P);if(te==Zn||te==Bn||fe&&!h){if(b=W||fe?{}:Qs(e),!P)return W?gs(e,as(b,e)):ls(e,is(b,e))}else{if(!O[te])return h?e:{};b=Ks(e,te,P)}}y||(y=new be);var de=y.get(e);if(de)return de;y.set(e,b),rc(e)?e.forEach(function(H){b.add(Ge(H,r,a,H,e,y))}):ec(e)&&e.forEach(function(H,k){b.set(k,Ge(H,r,a,k,e,y))});var F=U?W?vs:ps:W?nt:tt,Q=K?void 0:F(e);return fi(Q||e,function(H,k){Q&&(k=H,H=e[k]),Ut(b,k,Ge(H,r,a,k,e,y))}),b}var jc=1,Cc=4;function Wc(e){return Ge(e,jc|Cc)}var Dc=Tn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});const Rc=Dc;class $c extends Error{}function Mc(e,r){if(!e)throw new $c(r)}const Yn=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],Jn=["context","overrides","filters","metadata","style","hidden"],Oe=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>Oe(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:ku(h),b=a.includes(h)?e[h]:Oe(e[h],r,a);return{...s,[y]:b}},{}):e,dt=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>dt(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:Rc(h),b=a.includes(h)?e[h]:dt(e[h],r,a);return{...s,[y]:b}},{}):e;function lt(e,r=[],a=!1){if(a)return!0;if(!e||!e.origin)return!1;const h=(r.length>0?r:[window.location.origin]).includes(e.origin);return h||console.warn(`The message origin ${e.origin} is not the same as the current origin ${window.location.origin}. Bailing...`),h}class Nc extends Pt{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",a=>{lt(a)&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?(Mc(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Oe(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=xt(),b=W=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,W),W.response.status==="ok")s(this.options.casing==="camel"?Oe(W.response.body):W.response.body);else if(W.response.status==="error")h(this.options.casing==="camel"?Oe(W.response.body):W.response.body);else throw new Error("unsupported response status")},P=Wc(dt(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:P??{},callback:b},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:P}},"*")})}}function Lc(e){const r=new Nc(e),a=new Pt;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...Io,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}const zc="UI_MESSAGE",Kn={UI_SELECT_CONTENT:"ui_select_content"},Uc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Fc(e={}){return(await(await Promise.resolve().then(()=>ur)).send(window.parent,Kn.UI_SELECT_CONTENT,e)).data}async function qc(e,r){return(await Promise.resolve().then(()=>ur)).on(e,h=>r(h.data)).cancel}const Hc=Object.freeze(Object.defineProperty({__proto__:null,on:qc,ui_select_content:Fc},Symbol.toStringTag,{value:"Module"})),Qn="ADMIN_MESSAGE",Gc={ENV_CHANGED:"env_changed"},ht={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},kn={GET_ENV:"get_env"};function Bc(e,r,a={timeout:1e4}){return new Promise((s,h)=>{if(typeof window>"u"){h(new Error("This function cannot be run on the server side."));return}const y=xt(),b=P=>{lt(P)&&P.data.type===ht.ADMIN_RESPONSE&&P.data.id===y&&(window.removeEventListener("message",b),s(P.data.body))};window.addEventListener("message",b),window.parent.postMessage({type:ht.ADMIN_REQUEST,id:y,body:{type:e,data:r??{}}},"*"),a.timeout&&setTimeout(()=>{window.removeEventListener("message",b),h(new Error(`Admin did not respond in the timeframe of ${a.timeout}ms. Check the handler on the Admin side.`))},a.timeout)})}const ce={};function Vc(e,r){ce[e]||(ce[e]=[]),ce[e]?.push(r)}function Zc(e,r){ce[e]&&(ce[e]=ce[e]?.filter(a=>a!==r))}typeof window<"u"&&window.addEventListener("message",function(r){if(!lt(r)||r.data.type!==Qn)return;const a=ce[r.data.body.type];a&&a.forEach(s=>s(r.data.body.data))});function Yc(){return Bc(kn.GET_ENV)}const Jc=Object.freeze(Object.defineProperty({__proto__:null,get_env:Yc},Symbol.toStringTag,{value:"Module"})),Kc="PITCHER_EVENT";var Xn=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(Xn||{}),er=(e=>(e.OK="ok",e.ERROR="error",e))(er||{}),tr=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e))(tr||{}),nr=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(nr||{}),rr=(e=>(e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(rr||{});_.highLevelApi=void 0;function Qc(e){return _.highLevelApi||(_.highLevelApi=Lc(e)),_.highLevelApi}function kc(){return Hc}const Xc={...Jc,on:Vc,off:Zc};function ef(){return Xc}var tf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var or={exports:{}},ir={exports:{}};(function(e,r){(function(a,s){e.exports=s()})(typeof self<"u"?self:tf,function(){return function(a){var s={};function h(y){if(s[y])return s[y].exports;var b=s[y]={i:y,l:!1,exports:{}};return a[y].call(b.exports,b,b.exports,h),b.l=!0,b.exports}return h.m=a,h.c=s,h.d=function(y,b,P){h.o(y,b)||Object.defineProperty(y,b,{enumerable:!0,get:P})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,b){if(1&b&&(y=h(y)),8&b||4&b&&typeof y=="object"&&y&&y.__esModule)return y;var P=Object.create(null);if(h.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:y}),2&b&&typeof y!="string")for(var W in y)h.d(P,W,function(U){return y[U]}.bind(null,W));return P},h.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(b,"a",b),b},h.o=function(y,b){return{}.hasOwnProperty.call(y,b)},h.p="",h(h.s=0)}([function(a,s,h){h.r(s),h.d(s,"Promise",function(){return x}),h.d(s,"TYPES",function(){return Tf}),h.d(s,"ProxyWindow",function(){return V}),h.d(s,"setup",function(){return Nr}),h.d(s,"destroy",function(){return Pf}),h.d(s,"serializeMessage",function(){return _f}),h.d(s,"deserializeMessage",function(){return Ef}),h.d(s,"createProxyWindow",function(){return Af}),h.d(s,"toProxyWindow",function(){return Sf}),h.d(s,"on",function(){return re}),h.d(s,"once",function(){return bf}),h.d(s,"send",function(){return oe}),h.d(s,"markWindowKnown",function(){return Pr}),h.d(s,"cleanUpWindow",function(){return xf}),h.d(s,"bridge",function(){});function y(t){return{}.toString.call(t)==="[object RegExp]"}var b=`Call was rejected by callee.\r
2
- `;function P(t){return t===void 0&&(t=window),t.location.protocol}function W(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return P(t)}function U(t){return t===void 0&&(t=window),W(t)==="about:"}function K(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function te(t){if(t===void 0&&(t=window),t&&!K(t))try{return t.opener}catch{}}function fe(t){try{return!0}catch{}return!1}function de(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=P(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=K(t);return i&&fe()?de(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function F(t){t===void 0&&(t=window);var o=de(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function Q(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(U(o)&&fe())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),W(i)==="mock:"}(o)&&fe())return!0}catch{}try{if(de(o)===de(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||U(t)&&fe()||F(window)===F(t))return!0}catch{}return!1}function H(t){if(!Q(t))throw new Error("Expected window to be same domain");return t}function k(t,o){if(!t||!o)return!1;var n=K(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function sr(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var g=void 0;try{g=n[f]}catch{return o}if(!g)return o;o.push(g)}return o}var of=[],af=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==b}if(o&&Q(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(of,t);if(n!==-1){var i=af[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function cr(t){return t===void 0&&(t=window),te(t=t||window)||K(t)||void 0}function _e(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return _e(n,o)}))}function Be(t){try{if(t===window)return!0}catch(o){if(o&&o.message===b)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===b)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function fr(t){if(Q(t))return H(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function uf(t){if(function(n){return n===void 0&&(n=window),!!K(n)}(t)){var o=fr(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function le(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var dr=[],Ie=[],gt=0,je;function lr(){if(!gt&&je){var t=je;je=null,t.resolve()}}function pt(){gt+=1}function Ce(){gt-=1,lr()}var x=function(){function t(n){var i=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=[],n){var u,c,f=!1,g=!1,l=!1;pt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(g=!0,c=d)})}catch(d){Ce(),this.reject(d);return}Ce(),l=!0,f?this.resolve(u):g&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(le(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(le(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(dr.indexOf(c)===-1){dr.push(c),setTimeout(function(){throw c},1);for(var g=0;g<Ie.length;g++)Ie[g](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,pt();for(var c=function(m,S){return m.then(function(E){S.resolve(E)},function(E){S.reject(E)})},f=0;f<u.length;f++){var g=u[f],l=g.onSuccess,d=g.onError,w=g.promise,p=void 0;if(n)try{p=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{p=d(this.error)}catch(m){w.reject(m);continue}}if(p instanceof t&&(p.resolved||p.rejected)){var v=p;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else le(p)?p instanceof t&&(p.resolved||p.rejected)?p.resolved?w.resolve(p.value):w.reject(p.error):c(p,w):w.resolve(p)}u.length=0,this.dispatching=!1,Ce()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},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},t.resolve=function(n){return n instanceof t?n:le(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,p){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){p.reject(v)})},g=0;g<n.length;g++){var l=n[g];if(l instanceof t){if(l.resolved){c[g]=l.value,u-=1;continue}}else if(!le(l)){c[g]=l,u-=1;continue}f(g,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(g){if(n.hasOwnProperty(g)){var l=n[g];le(l)?u.push(l.then(function(d){i[g]=d})):i[g]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return Ie.push(i),{cancel:function(){Ie.splice(Ie.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;pt();try{c=n.apply(i,u||[])}catch(f){return Ce(),t.reject(f)}return Ce(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||le(n)},t.flush=function(){return function(n){var i=je=je||new n;return lr(),i}(t)},t}();function Ve(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var vt=function(){function t(){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 n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Be(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Be(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var g=this.keys,l=this.values,d=Ve(g,n);d===-1?(g.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Ve(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Ve(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Ve(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function hr(t){return t.name||t.__name__||t.displayName||"anonymous"}function gr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function X(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Ze;function pr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(Ze=Ze||new vt,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=Ze.get(i);return u||(u=typeof i+":"+X(),Ze.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function sf(){return{}}var We=0,vr=0;function De(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,g=We;We+=1;var l=function(){for(var d=arguments.length,w=new Array(d),p=0;p<d;p++)w[p]=arguments[p];g<vr&&(c=null,f=null,g=We,We+=1);var v;v=i?(f=f||new vt).getOrSet(this,sf):c=c||{};var m;try{m=pr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var E=Date.now(),A=t.apply(this,arguments);return v[m]={time:E,value:A},A};return l.reset=function(){c=null,f=null},gr(l,(o.name||hr(t))+"::memoized")}De.clear=function(){vr=We};function cf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),g=0;g<c;g++)f[g]=arguments[g];var l=pr(f);return o.hasOwnProperty(l)||(o[l]=x.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},gr(n,hr(t)+"::promiseMemoized")}function he(){}function Re(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
3
- `+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "+Re(u,o+1)}}function wr(t){return typeof t=="string"?t:t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}De(function(t){if(Object.values)return Object.values(t);var o=[];for(var n in t)t.hasOwnProperty(n)&&o.push(t[n]);return o});function wt(t){return{}.toString.call(t)==="[object RegExp]"}function $e(t,o,n){if(t.hasOwnProperty(o))return t[o];var i=n();return t[o]=i,i}function yr(){var t=document.body;if(!t)throw new Error("Body element not found");return t}function mr(){return!!document.body&&document.readyState==="complete"}function br(){return!!document.body&&document.readyState==="interactive"}De(function(){return new x(function(t){if(mr()||br())return t();var o=setInterval(function(){if(mr()||br())return clearInterval(o),t()},10)})});var Ye=typeof document<"u"?document.currentScript:null,ff=De(function(){if(Ye||(Ye=function(){try{var t=function(){try{throw new Error("_")}catch(f){return f.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(t),n=o&&o[1];if(!n)return;for(var i=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();i<u.length;i++){var c=u[i];if(c.src&&c.src===n)return c}}catch{}}()))return Ye;throw new Error("Can not determine current script")}),df=X();De(function(){var t;try{t=ff()}catch{return df}var o=t.getAttribute("data-uid");if(o&&typeof o=="string"||(o=t.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(t.src){var n=function(i){for(var u="",c=0;c<i.length;c++){var f=i[c].charCodeAt(0)*c;i[c+1]&&(f+=i[c+1].charCodeAt(0)*(c-1)),u+=String.fromCharCode(97+Math.abs(f)%26)}return u}(JSON.stringify({src:t.src,dataset:t.dataset}));o="uid_"+n.slice(n.length-30)}else o=X();return t.setAttribute("data-uid-auto",o),o});function Me(t){t===void 0&&(t=window);var o="__post_robot_10_0_46__";return t!==window?t[o]:t[o]=t[o]||{}}var _r=function(){return{}};function N(t,o){return t===void 0&&(t="store"),o===void 0&&(o=_r),$e(Me(),t,function(){var n=o();return{has:function(i){return n.hasOwnProperty(i)},get:function(i,u){return n.hasOwnProperty(i)?n[i]:u},set:function(i,u){return n[i]=u,u},del:function(i){delete n[i]},getOrSet:function(i,u){return $e(n,i,u)},reset:function(){n=o()},keys:function(){return Object.keys(n)}}})}var lf=function(){};function Je(){var t=Me();return t.WINDOW_WILDCARD=t.WINDOW_WILDCARD||new lf,t.WINDOW_WILDCARD}function q(t,o){return t===void 0&&(t="store"),o===void 0&&(o=_r),N("windowStore").getOrSet(t,function(){var n=new vt,i=function(u){return n.getOrSet(u,o)};return{has:function(u){return i(u).hasOwnProperty(t)},get:function(u,c){var f=i(u);return f.hasOwnProperty(t)?f[t]:c},set:function(u,c){return i(u)[t]=c,c},del:function(u){delete i(u)[t]},getOrSet:function(u,c){return $e(i(u),t,c)}}})}function Er(){return N("instance").getOrSet("instanceID",X)}function Ar(t,o){var n=o.domain,i=q("helloPromises"),u=i.get(t);u&&u.resolve({domain:n});var c=x.resolve({domain:n});return i.set(t,c),c}function yt(t,o){return(0,o.send)(t,"postrobot_hello",{instanceID:Er()},{domain:"*",timeout:-1}).then(function(n){var i=n.origin,u=n.data.instanceID;return Ar(t,{domain:i}),{win:t,domain:i,instanceID:u}})}function Sr(t,o){var n=o.send;return q("windowInstanceIDPromises").getOrSet(t,function(){return yt(t,{send:n}).then(function(i){return i.instanceID})})}function Pr(t){q("knownWindows").set(t,!0)}function mt(t){return typeof t=="object"&&t!==null&&typeof t.__type__=="string"}function Tr(t){return t===void 0?"undefined":t===null?"null":Array.isArray(t)?"array":typeof t=="function"?"function":typeof t=="object"?t instanceof Error?"error":typeof t.then=="function"?"promise":{}.toString.call(t)==="[object RegExp]"?"regex":{}.toString.call(t)==="[object Date]"?"date":"object":typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":void 0}function ge(t,o){return{__type__:t,__val__:o}}var G,hf=((G={}).function=function(){},G.error=function(t){return ge("error",{message:t.message,stack:t.stack,code:t.code,data:t.data})},G.promise=function(){},G.regex=function(t){return ge("regex",t.source)},G.date=function(t){return ge("date",t.toJSON())},G.array=function(t){return t},G.object=function(t){return t},G.string=function(t){return t},G.number=function(t){return t},G.boolean=function(t){return t},G.null=function(t){return t},G[void 0]=function(t){return ge("undefined",t)},G),gf={},B,pf=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(t){var o=t.stack,n=t.code,i=t.data,u=new Error(t.message);return u.code=n,i&&(u.data=i),u.stack=o+`
1
+ (function(_,Ee){typeof exports=="object"&&typeof module<"u"?Ee(exports):typeof define=="function"&&define.amd?define(["exports"],Ee):(_=typeof globalThis<"u"?globalThis:_||self,Ee(_.pitcher={}))})(this,function(_){"use strict";function Ee(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const h in s)if(h!=="default"&&!(h in e)){const y=Object.getOwnPropertyDescriptor(s,h);y&&Object.defineProperty(e,h,y.get?y:{enumerable:!0,get:()=>s[h]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Lr(e={}){return this.API.request("open",e)}function zr(){return this.API.request("get_env")}function Ur(e){return this.API.request("update_my_user",e)}function Fr(){return this.API.request("get_languages")}function qr(e){return _.highLevelApi.API.request("get_events",e)}function Hr(e){return _.highLevelApi.API.request("create_event",e)}function Gr(e){return _.highLevelApi.API.request("update_event",e)}function Br(e){return _.highLevelApi.API.request("delete_event",e)}function Vr(e){return this.API.request("get_canvases",e)}function Zr(e){return this.API.request("create_canvas",e)}function Yr(e){return this.API.request("delete_canvas",e)}function Jr(e){return this.API.request("update_canvas",e)}function Kr(e){return this.API.request("get_canvas",e)}function Qr(e){return this.API.request("share_canvas",e)}function kr(e){const r={...e};return r.type&&(r.type=Array.isArray(r.type)?r.type:[r.type]),r.content_type&&(r.content_type=Array.isArray(r.content_type)?r.content_type:[r.content_type]),this.API.request("get_files",r)}function Xr(e){return this.API.request("download_file",e)}function eo(e){return this.API.request("get_app_config",e)}function to(e){return this.API.request("get_file",e)}function no(e){return this.API.request("delete_file",e)}function ro(e){return this.API.request("create_file",e)}function oo(){return this.API.request("select_device_file")}function io(e){return this.API.request("search",e)}function ao(e){return this.API.request("get_users",e)}function uo(e){return this.API.request("getService",e)}function so(e){return this.API.request("refresh_service_token",e)}function co(){return this.API.request("get_connections")}function fo(e){return this.API.request("connection_login",e)}function lo(e){return this.API.request("connection_logout",e)}function ho(e){return this.API.request("fetch_document_info",e)}function po(e){return this.API.request("render_page_as_image",e)}function go(e){return this.API.request("toast",e)}function vo(e){return _.highLevelApi.API.request("query",e)}function wo(e={id:"root"}){return this.API.request("get_folder",e)}function yo(e){return this.API.request("create_folder",e)}function mo(e){return this.API.request("update_folder",e)}function bo(e){return this.API.request("delete_folder",e)}function _o(e){return this.API.request("move_folder_items",e)}function Eo(e){return this.API.request("get_favorites",e)}function Ao(e){return this.API.request("create_favorite",e)}function So(e){return this.API.request("delete_favorite",e)}function Po(e){return e.type||(e.type="native"),_.highLevelApi.API.request("notify",e)}function To(e){return _.highLevelApi.API.request("track",e)}function xo(e){return this.API.request("get_instance_metadata_templates",e)}function Oo(){return this.API.request("trigger_non_files_sync")}const Io=Object.freeze(Object.defineProperty({__proto__:null,connectionLogin:fo,connectionLogout:lo,createCanvas:Zr,createEvent:Hr,createFavorite:Ao,createFile:ro,createFolder:yo,deleteCanvas:Yr,deleteEvent:Br,deleteFavorite:So,deleteFile:no,deleteFolder:bo,downloadFile:Xr,fetchDocumentInfo:ho,getAppConfig:eo,getCanvas:Kr,getCanvases:Vr,getConnections:co,getEnv:zr,getEvents:qr,getFavorites:Eo,getFile:to,getFiles:kr,getFolder:wo,getInstanceMetadataTemplates:xo,getLanguages:Fr,getService:uo,getUsers:ao,moveFolderItems:_o,notify:Po,open:Lr,query:vo,refreshServiceToken:so,renderPageAsImage:po,search:io,selectDeviceFile:oo,shareCanvas:Qr,toast:go,track:To,triggerNonFilesSync:Oo,updateCanvas:Jr,updateEvent:Gr,updateFolder:mo,updateMyUser:Ur},Symbol.toStringTag,{value:"Module"}));class Pt{listeners={};on(r,a){this.listeners[r]=(this.listeners[r]??[]).concat(a)}off(r,a){this.listeners[r]=(this.listeners[r]??[]).filter(s=>s!==a)}emit(r,a){(this.listeners[r]??[]).forEach(s=>s(a))}}let Le;const jo=new Uint8Array(16);function Co(){if(!Le&&(Le=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Le))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Le(jo)}const z=[];for(let e=0;e<256;++e)z.push((e+256).toString(16).slice(1));function Wo(e,r=0){return z[e[r+0]]+z[e[r+1]]+z[e[r+2]]+z[e[r+3]]+"-"+z[e[r+4]]+z[e[r+5]]+"-"+z[e[r+6]]+z[e[r+7]]+"-"+z[e[r+8]]+z[e[r+9]]+"-"+z[e[r+10]]+z[e[r+11]]+z[e[r+12]]+z[e[r+13]]+z[e[r+14]]+z[e[r+15]]}const Tt={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function xt(e,r,a){if(Tt.randomUUID&&!r&&!e)return Tt.randomUUID();e=e||{};const s=e.random||(e.rng||Co)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,r){a=a||0;for(let h=0;h<16;++h)r[a+h]=s[h];return r}return Wo(s)}var Ot=typeof global=="object"&&global&&global.Object===Object&&global,Do=typeof self=="object"&&self&&self.Object===Object&&self,J=Ot||Do||Function("return this")(),ne=J.Symbol,It=Object.prototype,Ro=It.hasOwnProperty,Mo=It.toString,Ae=ne?ne.toStringTag:void 0;function $o(e){var r=Ro.call(e,Ae),a=e[Ae];try{e[Ae]=void 0;var s=!0}catch{}var h=Mo.call(e);return s&&(r?e[Ae]=a:delete e[Ae]),h}var No=Object.prototype,Lo=No.toString;function zo(e){return Lo.call(e)}var Uo="[object Null]",Fo="[object Undefined]",jt=ne?ne.toStringTag:void 0;function ge(e){return e==null?e===void 0?Fo:Uo:jt&&jt in Object(e)?$o(e):zo(e)}function ve(e){return e!=null&&typeof e=="object"}var qo="[object Symbol]";function Ho(e){return typeof e=="symbol"||ve(e)&&ge(e)==qo}function Go(e,r){for(var a=-1,s=e==null?0:e.length,h=Array(s);++a<s;)h[a]=r(e[a],a,e);return h}var ze=Array.isArray,Bo=1/0,Ct=ne?ne.prototype:void 0,Wt=Ct?Ct.toString:void 0;function Dt(e){if(typeof e=="string")return e;if(ze(e))return Go(e,Dt)+"";if(Ho(e))return Wt?Wt.call(e):"";var r=e+"";return r=="0"&&1/e==-Bo?"-0":r}function Se(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Vo="[object AsyncFunction]",Zo="[object Function]",Yo="[object GeneratorFunction]",Jo="[object Proxy]";function Rt(e){if(!Se(e))return!1;var r=ge(e);return r==Zo||r==Yo||r==Vo||r==Jo}var Ke=J["__core-js_shared__"],Mt=function(){var e=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ko(e){return!!Mt&&Mt in e}var Qo=Function.prototype,ko=Qo.toString;function ie(e){if(e!=null){try{return ko.call(e)}catch{}try{return e+""}catch{}}return""}var Xo=/[\\^$.*+?()[\]{}|]/g,ei=/^\[object .+?Constructor\]$/,ti=Function.prototype,ni=Object.prototype,ri=ti.toString,oi=ni.hasOwnProperty,ii=RegExp("^"+ri.call(oi).replace(Xo,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ai(e){if(!Se(e)||Ko(e))return!1;var r=Rt(e)?ii:ei;return r.test(ie(e))}function ui(e,r){return e?.[r]}function ae(e,r){var a=ui(e,r);return ai(a)?a:void 0}var Qe=ae(J,"WeakMap"),$t=Object.create,si=function(){function e(){}return function(r){if(!Se(r))return{};if($t)return $t(r);e.prototype=r;var a=new e;return e.prototype=void 0,a}}();function ci(e,r){var a=-1,s=e.length;for(r||(r=Array(s));++a<s;)r[a]=e[a];return r}var Nt=function(){try{var e=ae(Object,"defineProperty");return e({},"",{}),e}catch{}}();function fi(e,r){for(var a=-1,s=e==null?0:e.length;++a<s&&r(e[a],a,e)!==!1;);return e}var di=9007199254740991,li=/^(?:0|[1-9]\d*)$/;function hi(e,r){var a=typeof e;return r=r??di,!!r&&(a=="number"||a!="symbol"&&li.test(e))&&e>-1&&e%1==0&&e<r}function Lt(e,r,a){r=="__proto__"&&Nt?Nt(e,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[r]=a}function zt(e,r){return e===r||e!==e&&r!==r}var pi=Object.prototype,gi=pi.hasOwnProperty;function Ut(e,r,a){var s=e[r];(!(gi.call(e,r)&&zt(s,a))||a===void 0&&!(r in e))&&Lt(e,r,a)}function Ue(e,r,a,s){var h=!a;a||(a={});for(var y=-1,b=r.length;++y<b;){var P=r[y],W=s?s(a[P],e[P],P,a,e):void 0;W===void 0&&(W=e[P]),h?Lt(a,P,W):Ut(a,P,W)}return a}var vi=9007199254740991;function Ft(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=vi}function qt(e){return e!=null&&Ft(e.length)&&!Rt(e)}var wi=Object.prototype;function ke(e){var r=e&&e.constructor,a=typeof r=="function"&&r.prototype||wi;return e===a}function yi(e,r){for(var a=-1,s=Array(e);++a<e;)s[a]=r(a);return s}var mi="[object Arguments]";function Ht(e){return ve(e)&&ge(e)==mi}var Gt=Object.prototype,bi=Gt.hasOwnProperty,_i=Gt.propertyIsEnumerable,Ei=Ht(function(){return arguments}())?Ht:function(e){return ve(e)&&bi.call(e,"callee")&&!_i.call(e,"callee")};function Ai(){return!1}var Bt=typeof _=="object"&&_&&!_.nodeType&&_,Vt=Bt&&typeof module=="object"&&module&&!module.nodeType&&module,Si=Vt&&Vt.exports===Bt,Zt=Si?J.Buffer:void 0,Pi=Zt?Zt.isBuffer:void 0,Yt=Pi||Ai,Ti="[object Arguments]",xi="[object Array]",Oi="[object Boolean]",Ii="[object Date]",ji="[object Error]",Ci="[object Function]",Wi="[object Map]",Di="[object Number]",Ri="[object Object]",Mi="[object RegExp]",$i="[object Set]",Ni="[object String]",Li="[object WeakMap]",zi="[object ArrayBuffer]",Ui="[object DataView]",Fi="[object Float32Array]",qi="[object Float64Array]",Hi="[object Int8Array]",Gi="[object Int16Array]",Bi="[object Int32Array]",Vi="[object Uint8Array]",Zi="[object Uint8ClampedArray]",Yi="[object Uint16Array]",Ji="[object Uint32Array]",C={};C[Fi]=C[qi]=C[Hi]=C[Gi]=C[Bi]=C[Vi]=C[Zi]=C[Yi]=C[Ji]=!0,C[Ti]=C[xi]=C[zi]=C[Oi]=C[Ui]=C[Ii]=C[ji]=C[Ci]=C[Wi]=C[Di]=C[Ri]=C[Mi]=C[$i]=C[Ni]=C[Li]=!1;function Ki(e){return ve(e)&&Ft(e.length)&&!!C[ge(e)]}function Xe(e){return function(r){return e(r)}}var Jt=typeof _=="object"&&_&&!_.nodeType&&_,Pe=Jt&&typeof module=="object"&&module&&!module.nodeType&&module,Qi=Pe&&Pe.exports===Jt,et=Qi&&Ot.process,we=function(){try{var e=Pe&&Pe.require&&Pe.require("util").types;return e||et&&et.binding&&et.binding("util")}catch{}}(),Kt=we&&we.isTypedArray,ki=Kt?Xe(Kt):Ki,Xi=Object.prototype,ea=Xi.hasOwnProperty;function Qt(e,r){var a=ze(e),s=!a&&Ei(e),h=!a&&!s&&Yt(e),y=!a&&!s&&!h&&ki(e),b=a||s||h||y,P=b?yi(e.length,String):[],W=P.length;for(var U in e)(r||ea.call(e,U))&&!(b&&(U=="length"||h&&(U=="offset"||U=="parent")||y&&(U=="buffer"||U=="byteLength"||U=="byteOffset")||hi(U,W)))&&P.push(U);return P}function kt(e,r){return function(a){return e(r(a))}}var ta=kt(Object.keys,Object),na=Object.prototype,ra=na.hasOwnProperty;function oa(e){if(!ke(e))return ta(e);var r=[];for(var a in Object(e))ra.call(e,a)&&a!="constructor"&&r.push(a);return r}function tt(e){return qt(e)?Qt(e):oa(e)}function ia(e){var r=[];if(e!=null)for(var a in Object(e))r.push(a);return r}var aa=Object.prototype,ua=aa.hasOwnProperty;function sa(e){if(!Se(e))return ia(e);var r=ke(e),a=[];for(var s in e)s=="constructor"&&(r||!ua.call(e,s))||a.push(s);return a}function nt(e){return qt(e)?Qt(e,!0):sa(e)}var Te=ae(Object,"create");function ca(){this.__data__=Te?Te(null):{},this.size=0}function fa(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var da="__lodash_hash_undefined__",la=Object.prototype,ha=la.hasOwnProperty;function pa(e){var r=this.__data__;if(Te){var a=r[e];return a===da?void 0:a}return ha.call(r,e)?r[e]:void 0}var ga=Object.prototype,va=ga.hasOwnProperty;function wa(e){var r=this.__data__;return Te?r[e]!==void 0:va.call(r,e)}var ya="__lodash_hash_undefined__";function ma(e,r){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=Te&&r===void 0?ya:r,this}function ue(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ue.prototype.clear=ca,ue.prototype.delete=fa,ue.prototype.get=pa,ue.prototype.has=wa,ue.prototype.set=ma;function ba(){this.__data__=[],this.size=0}function Fe(e,r){for(var a=e.length;a--;)if(zt(e[a][0],r))return a;return-1}var _a=Array.prototype,Ea=_a.splice;function Aa(e){var r=this.__data__,a=Fe(r,e);if(a<0)return!1;var s=r.length-1;return a==s?r.pop():Ea.call(r,a,1),--this.size,!0}function Sa(e){var r=this.__data__,a=Fe(r,e);return a<0?void 0:r[a][1]}function Pa(e){return Fe(this.__data__,e)>-1}function Ta(e,r){var a=this.__data__,s=Fe(a,e);return s<0?(++this.size,a.push([e,r])):a[s][1]=r,this}function ee(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ee.prototype.clear=ba,ee.prototype.delete=Aa,ee.prototype.get=Sa,ee.prototype.has=Pa,ee.prototype.set=Ta;var xe=ae(J,"Map");function xa(){this.size=0,this.__data__={hash:new ue,map:new(xe||ee),string:new ue}}function Oa(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}function qe(e,r){var a=e.__data__;return Oa(r)?a[typeof r=="string"?"string":"hash"]:a.map}function Ia(e){var r=qe(this,e).delete(e);return this.size-=r?1:0,r}function ja(e){return qe(this,e).get(e)}function Ca(e){return qe(this,e).has(e)}function Wa(e,r){var a=qe(this,e),s=a.size;return a.set(e,r),this.size+=a.size==s?0:1,this}function ye(e){var r=-1,a=e==null?0:e.length;for(this.clear();++r<a;){var s=e[r];this.set(s[0],s[1])}}ye.prototype.clear=xa,ye.prototype.delete=Ia,ye.prototype.get=ja,ye.prototype.has=Ca,ye.prototype.set=Wa;function He(e){return e==null?"":Dt(e)}function Xt(e,r){for(var a=-1,s=r.length,h=e.length;++a<s;)e[h+a]=r[a];return e}var Da=kt(Object.getPrototypeOf,Object);const en=Da;function Ra(e,r,a){var s=-1,h=e.length;r<0&&(r=-r>h?0:h+r),a=a>h?h:a,a<0&&(a+=h),h=r>a?0:a-r>>>0,r>>>=0;for(var y=Array(h);++s<h;)y[s]=e[s+r];return y}function Ma(e,r,a){var s=e.length;return a=a===void 0?s:a,!r&&a>=s?e:Ra(e,r,a)}var $a="\\ud800-\\udfff",Na="\\u0300-\\u036f",La="\\ufe20-\\ufe2f",za="\\u20d0-\\u20ff",Ua=Na+La+za,Fa="\\ufe0e\\ufe0f",qa="\\u200d",Ha=RegExp("["+qa+$a+Ua+Fa+"]");function tn(e){return Ha.test(e)}function Ga(e){return e.split("")}var nn="\\ud800-\\udfff",Ba="\\u0300-\\u036f",Va="\\ufe20-\\ufe2f",Za="\\u20d0-\\u20ff",Ya=Ba+Va+Za,Ja="\\ufe0e\\ufe0f",Ka="["+nn+"]",rt="["+Ya+"]",ot="\\ud83c[\\udffb-\\udfff]",Qa="(?:"+rt+"|"+ot+")",rn="[^"+nn+"]",on="(?:\\ud83c[\\udde6-\\uddff]){2}",an="[\\ud800-\\udbff][\\udc00-\\udfff]",ka="\\u200d",un=Qa+"?",sn="["+Ja+"]?",Xa="(?:"+ka+"(?:"+[rn,on,an].join("|")+")"+sn+un+")*",eu=sn+un+Xa,tu="(?:"+[rn+rt+"?",rt,on,an,Ka].join("|")+")",nu=RegExp(ot+"(?="+ot+")|"+tu+eu,"g");function ru(e){return e.match(nu)||[]}function ou(e){return tn(e)?ru(e):Ga(e)}function iu(e){return function(r){r=He(r);var a=tn(r)?ou(r):void 0,s=a?a[0]:r.charAt(0),h=a?Ma(a,1).join(""):r.slice(1);return s[e]()+h}}var au=iu("toUpperCase");function uu(e){return au(He(e).toLowerCase())}function su(e,r,a,s){var h=-1,y=e==null?0:e.length;for(s&&y&&(a=e[++h]);++h<y;)a=r(a,e[h],h,e);return a}function cu(e){return function(r){return e?.[r]}}var fu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},du=cu(fu);const lu=du;var hu=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pu="\\u0300-\\u036f",gu="\\ufe20-\\ufe2f",vu="\\u20d0-\\u20ff",wu=pu+gu+vu,yu="["+wu+"]",mu=RegExp(yu,"g");function bu(e){return e=He(e),e&&e.replace(hu,lu).replace(mu,"")}var _u=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Eu(e){return e.match(_u)||[]}var Au=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Su(e){return Au.test(e)}var cn="\\ud800-\\udfff",Pu="\\u0300-\\u036f",Tu="\\ufe20-\\ufe2f",xu="\\u20d0-\\u20ff",Ou=Pu+Tu+xu,fn="\\u2700-\\u27bf",dn="a-z\\xdf-\\xf6\\xf8-\\xff",Iu="\\xac\\xb1\\xd7\\xf7",ju="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Cu="\\u2000-\\u206f",Wu=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ln="A-Z\\xc0-\\xd6\\xd8-\\xde",Du="\\ufe0e\\ufe0f",hn=Iu+ju+Cu+Wu,pn="['’]",gn="["+hn+"]",Ru="["+Ou+"]",vn="\\d+",Mu="["+fn+"]",wn="["+dn+"]",yn="[^"+cn+hn+vn+fn+dn+ln+"]",$u="\\ud83c[\\udffb-\\udfff]",Nu="(?:"+Ru+"|"+$u+")",Lu="[^"+cn+"]",mn="(?:\\ud83c[\\udde6-\\uddff]){2}",bn="[\\ud800-\\udbff][\\udc00-\\udfff]",me="["+ln+"]",zu="\\u200d",_n="(?:"+wn+"|"+yn+")",Uu="(?:"+me+"|"+yn+")",En="(?:"+pn+"(?:d|ll|m|re|s|t|ve))?",An="(?:"+pn+"(?:D|LL|M|RE|S|T|VE))?",Sn=Nu+"?",Pn="["+Du+"]?",Fu="(?:"+zu+"(?:"+[Lu,mn,bn].join("|")+")"+Pn+Sn+")*",qu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gu=Pn+Sn+Fu,Bu="(?:"+[Mu,mn,bn].join("|")+")"+Gu,Vu=RegExp([me+"?"+wn+"+"+En+"(?="+[gn,me,"$"].join("|")+")",Uu+"+"+An+"(?="+[gn,me+_n,"$"].join("|")+")",me+"?"+_n+"+"+En,me+"+"+An,Hu,qu,vn,Bu].join("|"),"g");function Zu(e){return e.match(Vu)||[]}function Yu(e,r,a){return e=He(e),r=a?void 0:r,r===void 0?Su(e)?Zu(e):Eu(e):e.match(r)||[]}var Ju="['’]",Ku=RegExp(Ju,"g");function Tn(e){return function(r){return su(Yu(bu(r).replace(Ku,"")),e,"")}}var Qu=Tn(function(e,r,a){return r=r.toLowerCase(),e+(a?uu(r):r)});const ku=Qu;function Xu(){this.__data__=new ee,this.size=0}function es(e){var r=this.__data__,a=r.delete(e);return this.size=r.size,a}function ts(e){return this.__data__.get(e)}function ns(e){return this.__data__.has(e)}var rs=200;function os(e,r){var a=this.__data__;if(a instanceof ee){var s=a.__data__;if(!xe||s.length<rs-1)return s.push([e,r]),this.size=++a.size,this;a=this.__data__=new ye(s)}return a.set(e,r),this.size=a.size,this}function be(e){var r=this.__data__=new ee(e);this.size=r.size}be.prototype.clear=Xu,be.prototype.delete=es,be.prototype.get=ts,be.prototype.has=ns,be.prototype.set=os;function is(e,r){return e&&Ue(r,tt(r),e)}function as(e,r){return e&&Ue(r,nt(r),e)}var xn=typeof _=="object"&&_&&!_.nodeType&&_,On=xn&&typeof module=="object"&&module&&!module.nodeType&&module,us=On&&On.exports===xn,In=us?J.Buffer:void 0,jn=In?In.allocUnsafe:void 0;function ss(e,r){if(r)return e.slice();var a=e.length,s=jn?jn(a):new e.constructor(a);return e.copy(s),s}function cs(e,r){for(var a=-1,s=e==null?0:e.length,h=0,y=[];++a<s;){var b=e[a];r(b,a,e)&&(y[h++]=b)}return y}function Cn(){return[]}var fs=Object.prototype,ds=fs.propertyIsEnumerable,Wn=Object.getOwnPropertySymbols,it=Wn?function(e){return e==null?[]:(e=Object(e),cs(Wn(e),function(r){return ds.call(e,r)}))}:Cn;function ls(e,r){return Ue(e,it(e),r)}var hs=Object.getOwnPropertySymbols,Dn=hs?function(e){for(var r=[];e;)Xt(r,it(e)),e=en(e);return r}:Cn;function ps(e,r){return Ue(e,Dn(e),r)}function Rn(e,r,a){var s=r(e);return ze(e)?s:Xt(s,a(e))}function gs(e){return Rn(e,tt,it)}function vs(e){return Rn(e,nt,Dn)}var at=ae(J,"DataView"),ut=ae(J,"Promise"),st=ae(J,"Set"),Mn="[object Map]",ws="[object Object]",$n="[object Promise]",Nn="[object Set]",Ln="[object WeakMap]",zn="[object DataView]",ys=ie(at),ms=ie(xe),bs=ie(ut),_s=ie(st),Es=ie(Qe),se=ge;(at&&se(new at(new ArrayBuffer(1)))!=zn||xe&&se(new xe)!=Mn||ut&&se(ut.resolve())!=$n||st&&se(new st)!=Nn||Qe&&se(new Qe)!=Ln)&&(se=function(e){var r=ge(e),a=r==ws?e.constructor:void 0,s=a?ie(a):"";if(s)switch(s){case ys:return zn;case ms:return Mn;case bs:return $n;case _s:return Nn;case Es:return Ln}return r});const ct=se;var As=Object.prototype,Ss=As.hasOwnProperty;function Ps(e){var r=e.length,a=new e.constructor(r);return r&&typeof e[0]=="string"&&Ss.call(e,"index")&&(a.index=e.index,a.input=e.input),a}var Un=J.Uint8Array;function ft(e){var r=new e.constructor(e.byteLength);return new Un(r).set(new Un(e)),r}function Ts(e,r){var a=r?ft(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.byteLength)}var xs=/\w*$/;function Os(e){var r=new e.constructor(e.source,xs.exec(e));return r.lastIndex=e.lastIndex,r}var Fn=ne?ne.prototype:void 0,qn=Fn?Fn.valueOf:void 0;function Is(e){return qn?Object(qn.call(e)):{}}function js(e,r){var a=r?ft(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}var Cs="[object Boolean]",Ws="[object Date]",Ds="[object Map]",Rs="[object Number]",Ms="[object RegExp]",$s="[object Set]",Ns="[object String]",Ls="[object Symbol]",zs="[object ArrayBuffer]",Us="[object DataView]",Fs="[object Float32Array]",qs="[object Float64Array]",Hs="[object Int8Array]",Gs="[object Int16Array]",Bs="[object Int32Array]",Vs="[object Uint8Array]",Zs="[object Uint8ClampedArray]",Ys="[object Uint16Array]",Js="[object Uint32Array]";function Ks(e,r,a){var s=e.constructor;switch(r){case zs:return ft(e);case Cs:case Ws:return new s(+e);case Us:return Ts(e,a);case Fs:case qs:case Hs:case Gs:case Bs:case Vs:case Zs:case Ys:case Js:return js(e,a);case Ds:return new s;case Rs:case Ns:return new s(e);case Ms:return Os(e);case $s:return new s;case Ls:return Is(e)}}function Qs(e){return typeof e.constructor=="function"&&!ke(e)?si(en(e)):{}}var ks="[object Map]";function Xs(e){return ve(e)&&ct(e)==ks}var Hn=we&&we.isMap,ec=Hn?Xe(Hn):Xs,tc="[object Set]";function nc(e){return ve(e)&&ct(e)==tc}var Gn=we&&we.isSet,rc=Gn?Xe(Gn):nc,oc=1,ic=2,ac=4,Bn="[object Arguments]",uc="[object Array]",sc="[object Boolean]",cc="[object Date]",fc="[object Error]",Vn="[object Function]",dc="[object GeneratorFunction]",lc="[object Map]",hc="[object Number]",Zn="[object Object]",pc="[object RegExp]",gc="[object Set]",vc="[object String]",wc="[object Symbol]",yc="[object WeakMap]",mc="[object ArrayBuffer]",bc="[object DataView]",_c="[object Float32Array]",Ec="[object Float64Array]",Ac="[object Int8Array]",Sc="[object Int16Array]",Pc="[object Int32Array]",Tc="[object Uint8Array]",xc="[object Uint8ClampedArray]",Oc="[object Uint16Array]",Ic="[object Uint32Array]",O={};O[Bn]=O[uc]=O[mc]=O[bc]=O[sc]=O[cc]=O[_c]=O[Ec]=O[Ac]=O[Sc]=O[Pc]=O[lc]=O[hc]=O[Zn]=O[pc]=O[gc]=O[vc]=O[wc]=O[Tc]=O[xc]=O[Oc]=O[Ic]=!0,O[fc]=O[Vn]=O[yc]=!1;function Ge(e,r,a,s,h,y){var b,P=r&oc,W=r&ic,U=r&ac;if(a&&(b=h?a(e,s,h,y):a(e)),b!==void 0)return b;if(!Se(e))return e;var K=ze(e);if(K){if(b=Ps(e),!P)return ci(e,b)}else{var te=ct(e),fe=te==Vn||te==dc;if(Yt(e))return ss(e,P);if(te==Zn||te==Bn||fe&&!h){if(b=W||fe?{}:Qs(e),!P)return W?ps(e,as(b,e)):ls(e,is(b,e))}else{if(!O[te])return h?e:{};b=Ks(e,te,P)}}y||(y=new be);var de=y.get(e);if(de)return de;y.set(e,b),rc(e)?e.forEach(function(H){b.add(Ge(H,r,a,H,e,y))}):ec(e)&&e.forEach(function(H,k){b.set(k,Ge(H,r,a,k,e,y))});var F=U?W?vs:gs:W?nt:tt,Q=K?void 0:F(e);return fi(Q||e,function(H,k){Q&&(k=H,H=e[k]),Ut(b,k,Ge(H,r,a,k,e,y))}),b}var jc=1,Cc=4;function Wc(e){return Ge(e,jc|Cc)}var Dc=Tn(function(e,r,a){return e+(a?"_":"")+r.toLowerCase()});const Rc=Dc;class Mc extends Error{}function $c(e,r){if(!e)throw new Mc(r)}const Yn=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],Jn=["context","overrides","filters","metadata","style","hidden"],Oe=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>Oe(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:ku(h),b=a.includes(h)?e[h]:Oe(e[h],r,a);return{...s,[y]:b}},{}):e,dt=(e,r=Yn,a=Jn)=>Array.isArray(e)?e.map(s=>dt(s,r,a)):e!=null&&e.constructor===Object?Object.keys(e).reduce((s,h)=>{const y=r.includes(h)||a.includes(h)?h:Rc(h),b=a.includes(h)?e[h]:dt(e[h],r,a);return{...s,[y]:b}},{}):e;function lt(e,r=[],a=!1){return!0}class Nc extends Pt{constructor(r){super(),this.callbacks={},this.options=r??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",a=>{lt()&&(this.options.logLevel==="debug"&&console.log("message received",a),a.data.type==="PITCHER_RESPONSE"?($c(a.data.request.id,"event id is required"),this.handleCallbackMessage(a.data.request.id,a.data)):a.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?Oe(a.data.event):a.data.event))}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(r,a){this.callbacks[r]&&(this.callbacks[r].callback(a),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[r].dispatched_at} ms for the event ${this.callbacks[r].type}`),delete this.callbacks[r])}handleEventMessage(r){this.emit("event",r)}request(r,a=null){return new Promise((s,h)=>{const y=xt(),b=W=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,W),W.response.status==="ok")s(this.options.casing==="camel"?Oe(W.response.body):W.response.body);else if(W.response.status==="error")h(this.options.casing==="camel"?Oe(W.response.body):W.response.body);else throw new Error("unsupported response status")},P=Wc(dt(a));this.callbacks[y]={dispatched_at:Date.now(),type:r,payload:P??{},callback:b},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:r,id:y,body:P}},"*")})}}function Lc(e){const r=new Nc(e),a=new Pt;return r.on("event",s=>{a.emit(s.type,s.body)}),{API:r,...Io,on:(s,h)=>a.on(s,h),off:(s,h)=>a.off(s,h),quitInstance:()=>r.request("quit_instance"),getRequestTypes:()=>r.request("get_request_types"),broadcast:s=>r.request("broadcast",s),subscribe:()=>r.request("subscribe"),unsubscribe:()=>r.request("unsubscribe")}}const zc="UI_MESSAGE",Kn={UI_SELECT_CONTENT:"ui_select_content"},Uc={UI_CONTENT_SELECTED:"ui_content_selected"};async function Fc(e={}){return(await(await Promise.resolve().then(()=>ur)).send(window.parent,Kn.UI_SELECT_CONTENT,e)).data}async function qc(e,r){return(await Promise.resolve().then(()=>ur)).on(e,h=>r(h.data)).cancel}const Hc=Object.freeze(Object.defineProperty({__proto__:null,on:qc,ui_select_content:Fc},Symbol.toStringTag,{value:"Module"})),Qn="ADMIN_MESSAGE",Gc={ENV_CHANGED:"env_changed"},ht={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},kn={GET_ENV:"get_env"};function Bc(e,r,a={timeout:1e4}){return new Promise((s,h)=>{if(typeof window>"u"){h(new Error("This function cannot be run on the server side."));return}const y=xt(),b=P=>{lt()&&P.data.type===ht.ADMIN_RESPONSE&&P.data.id===y&&(window.removeEventListener("message",b),s(P.data.body))};window.addEventListener("message",b),window.parent.postMessage({type:ht.ADMIN_REQUEST,id:y,body:{type:e,data:r??{}}},"*"),a.timeout&&setTimeout(()=>{window.removeEventListener("message",b),h(new Error(`Admin did not respond in the timeframe of ${a.timeout}ms. Check the handler on the Admin side.`))},a.timeout)})}const ce={};function Vc(e,r){ce[e]||(ce[e]=[]),ce[e]?.push(r)}function Zc(e,r){ce[e]&&(ce[e]=ce[e]?.filter(a=>a!==r))}typeof window<"u"&&window.addEventListener("message",function(r){if(!lt()||r.data.type!==Qn)return;const a=ce[r.data.body.type];a&&a.forEach(s=>s(r.data.body.data))});function Yc(){return Bc(kn.GET_ENV)}const Jc=Object.freeze(Object.defineProperty({__proto__:null,get_env:Yc},Symbol.toStringTag,{value:"Module"})),Kc="PITCHER_EVENT";var Xn=(e=>(e.REQUEST="PITCHER_REQUEST",e.RESPONSE="PITCHER_RESPONSE",e))(Xn||{}),er=(e=>(e.OK="ok",e.ERROR="error",e))(er||{}),tr=(e=>(e.ENV_CHANGED="env_changed",e.PHOTOS_CAPTURED="photos_captured",e.FILE_DOWNLOADED="file_downloaded",e.FILE_UPLOAD_PROGRESS="file_upload_progress",e.UPDATE_LOCATION="update_location",e.CANVAS_UPDATED="canvas_updated",e.FILE_CLOSED="file_closed",e.APP_BACKGROUNDED="app_backgrounded",e.APP_FOREGROUNDED="app_foregrounded",e.NON_FILES_SYNC_FINISHED="non_files_sync_finished",e.NETWORK_CONNECTION_ESTABLISHED="network_connection_established",e.NETWORK_CONNECTION_LOST="network_connection_lost",e))(tr||{}),nr=(e=>(e.UI_SHOW_MODAL="ui:show-modal",e.UI_HIDE_MODAL="ui:hide-modal",e.FAVORITES_CHANGED="favorites:changed",e.FILE_DOWNLOAD="file:download",e))(nr||{}),rr=(e=>(e.OPEN_CANVAS="open_canvas",e.START_CALL="start_call",e))(rr||{});_.highLevelApi=void 0;function Qc(e){return _.highLevelApi||(_.highLevelApi=Lc(e)),_.highLevelApi}function kc(){return Hc}const Xc={...Jc,on:Vc,off:Zc};function ef(){return Xc}var tf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nf(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var or={exports:{}},ir={exports:{}};(function(e,r){(function(a,s){e.exports=s()})(typeof self<"u"?self:tf,function(){return function(a){var s={};function h(y){if(s[y])return s[y].exports;var b=s[y]={i:y,l:!1,exports:{}};return a[y].call(b.exports,b,b.exports,h),b.l=!0,b.exports}return h.m=a,h.c=s,h.d=function(y,b,P){h.o(y,b)||Object.defineProperty(y,b,{enumerable:!0,get:P})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,b){if(1&b&&(y=h(y)),8&b||4&b&&typeof y=="object"&&y&&y.__esModule)return y;var P=Object.create(null);if(h.r(P),Object.defineProperty(P,"default",{enumerable:!0,value:y}),2&b&&typeof y!="string")for(var W in y)h.d(P,W,function(U){return y[U]}.bind(null,W));return P},h.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(b,"a",b),b},h.o=function(y,b){return{}.hasOwnProperty.call(y,b)},h.p="",h(h.s=0)}([function(a,s,h){h.r(s),h.d(s,"Promise",function(){return x}),h.d(s,"TYPES",function(){return Tf}),h.d(s,"ProxyWindow",function(){return V}),h.d(s,"setup",function(){return Nr}),h.d(s,"destroy",function(){return Pf}),h.d(s,"serializeMessage",function(){return _f}),h.d(s,"deserializeMessage",function(){return Ef}),h.d(s,"createProxyWindow",function(){return Af}),h.d(s,"toProxyWindow",function(){return Sf}),h.d(s,"on",function(){return re}),h.d(s,"once",function(){return bf}),h.d(s,"send",function(){return oe}),h.d(s,"markWindowKnown",function(){return Pr}),h.d(s,"cleanUpWindow",function(){return xf}),h.d(s,"bridge",function(){});function y(t){return{}.toString.call(t)==="[object RegExp]"}var b=`Call was rejected by callee.\r
2
+ `;function P(t){return t===void 0&&(t=window),t.location.protocol}function W(t){if(t===void 0&&(t=window),t.mockDomain){var o=t.mockDomain.split("//")[0];if(o)return o}return P(t)}function U(t){return t===void 0&&(t=window),W(t)==="about:"}function K(t){if(t===void 0&&(t=window),t)try{if(t.parent&&t.parent!==t)return t.parent}catch{}}function te(t){if(t===void 0&&(t=window),t&&!K(t))try{return t.opener}catch{}}function fe(t){try{return!0}catch{}return!1}function de(t){t===void 0&&(t=window);var o=t.location;if(!o)throw new Error("Can not read window location");var n=P(t);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var i=K(t);return i&&fe()?de(i):"about://"}var u=o.host;if(!u)throw new Error("Can not read window host");return n+"//"+u}function F(t){t===void 0&&(t=window);var o=de(t);return o&&t.mockDomain&&t.mockDomain.indexOf("mock:")===0?t.mockDomain:o}function Q(t){if(!function(o){try{if(o===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(o,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(U(o)&&fe())return!0}catch{}try{if(function(i){return i===void 0&&(i=window),W(i)==="mock:"}(o)&&fe())return!0}catch{}try{if(de(o)===de(window))return!0}catch{}return!1}(t))return!1;try{if(t===window||U(t)&&fe()||F(window)===F(t))return!0}catch{}return!1}function H(t){if(!Q(t))throw new Error("Expected window to be same domain");return t}function k(t,o){if(!t||!o)return!1;var n=K(o);return n?n===t:function(i){var u=[];try{for(;i.parent!==i;)u.push(i.parent),i=i.parent}catch{}return u}(o).indexOf(t)!==-1}function sr(t){var o=[],n;try{n=t.frames}catch{n=t}var i;try{i=n.length}catch{}if(i===0)return o;if(i){for(var u=0;u<i;u++){var c=void 0;try{c=n[u]}catch{continue}o.push(c)}return o}for(var f=0;f<100;f++){var p=void 0;try{p=n[f]}catch{return o}if(!p)return o;o.push(p)}return o}var of=[],af=[];function Z(t,o){o===void 0&&(o=!0);try{if(t===window)return!1}catch{return!0}try{if(!t)return!0}catch{return!0}try{if(t.closed)return!0}catch(u){return!u||u.message!==b}if(o&&Q(t))try{if(t.mockclosed)return!0}catch{}try{if(!t.parent||!t.top)return!0}catch{}var n=function(u,c){for(var f=0;f<u.length;f++)try{if(u[f]===c)return f}catch{}return-1}(of,t);if(n!==-1){var i=af[n];if(i&&function(u){if(!u.contentWindow||!u.parentNode)return!0;var c=u.ownerDocument;if(c&&c.documentElement&&!c.documentElement.contains(u)){for(var f=u;f.parentNode&&f.parentNode!==f;)f=f.parentNode;if(!f.host||!c.documentElement.contains(f.host))return!0}return!1}(i))return!0}return!1}function cr(t){return t===void 0&&(t=window),te(t=t||window)||K(t)||void 0}function _e(t,o){if(typeof t=="string"){if(typeof o=="string")return t==="*"||o===t;if(y(o)||Array.isArray(o))return!1}return y(t)?y(o)?t.toString()===o.toString():!Array.isArray(o)&&!!o.match(t):!!Array.isArray(t)&&(Array.isArray(o)?JSON.stringify(t)===JSON.stringify(o):!y(o)&&t.some(function(n){return _e(n,o)}))}function Be(t){try{if(t===window)return!0}catch(o){if(o&&o.message===b)return!0}try{if({}.toString.call(t)==="[object Window]")return!0}catch(o){if(o&&o.message===b)return!0}try{if(window.Window&&t instanceof window.Window)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.self===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.parent===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.top===t)return!0}catch(o){if(o&&o.message===b)return!0}try{if(t&&t.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in t&&"self"in t&&"location"in t)return!0}catch{}return!1}function fr(t){if(Q(t))return H(t).frameElement;for(var o=0,n=document.querySelectorAll("iframe");o<n.length;o++){var i=n[o];if(i&&i.contentWindow&&i.contentWindow===t)return i}}function uf(t){if(function(n){return n===void 0&&(n=window),!!K(n)}(t)){var o=fr(t);if(o&&o.parentElement){o.parentElement.removeChild(o);return}}try{t.close()}catch{}}function le(t){try{if(!t)return!1;if(typeof Promise<"u"&&t instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&t instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&t instanceof window.constructor)return!1;var o={}.toString;if(o){var n=o.call(t);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof t.then=="function")return!0}catch{return!1}return!1}var dr=[],Ie=[],pt=0,je;function lr(){if(!pt&&je){var t=je;je=null,t.resolve()}}function gt(){pt+=1}function Ce(){pt-=1,lr()}var x=function(){function t(n){var i=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=[],n){var u,c,f=!1,p=!1,l=!1;gt();try{n(function(d){l?i.resolve(d):(f=!0,u=d)},function(d){l?i.reject(d):(p=!0,c=d)})}catch(d){Ce(),this.reject(d);return}Ce(),l=!0,f?this.resolve(u):p&&this.reject(c)}}var o=t.prototype;return o.resolve=function(n){if(this.resolved||this.rejected)return this;if(le(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},o.reject=function(n){var i=this;if(this.resolved||this.rejected)return this;if(le(n))throw new Error("Can not reject promise with another promise");if(!n){var u=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+u)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){i.errorHandled||function(c,f){if(dr.indexOf(c)===-1){dr.push(c),setTimeout(function(){throw c},1);for(var p=0;p<Ie.length;p++)Ie[p](c,f)}}(n,i)},1),this.dispatch(),this},o.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},o.dispatch=function(){var n=this.resolved,i=this.rejected,u=this.handlers;if(!this.dispatching&&(n||i)){this.dispatching=!0,gt();for(var c=function(m,S){return m.then(function(E){S.resolve(E)},function(E){S.reject(E)})},f=0;f<u.length;f++){var p=u[f],l=p.onSuccess,d=p.onError,w=p.promise,g=void 0;if(n)try{g=l?l(this.value):this.value}catch(m){w.reject(m);continue}else if(i){if(!d){w.reject(this.error);continue}try{g=d(this.error)}catch(m){w.reject(m);continue}}if(g instanceof t&&(g.resolved||g.rejected)){var v=g;v.resolved?w.resolve(v.value):w.reject(v.error),v.errorHandled=!0}else le(g)?g instanceof t&&(g.resolved||g.rejected)?g.resolved?w.resolve(g.value):w.reject(g.error):c(g,w):w.resolve(g)}u.length=0,this.dispatching=!1,Ce()}},o.then=function(n,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(i&&typeof i!="function"&&!i.call)throw new Error("Promise.then expected a function for error handler");var u=new t;return this.handlers.push({promise:u,onSuccess:n,onError:i}),this.errorHandled=!0,this.dispatch(),u},o.catch=function(n){return this.then(void 0,n)},o.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(i){return t.try(n).then(function(){return i})},function(i){return t.try(n).then(function(){throw i})})},o.timeout=function(n,i){var u=this;if(this.resolved||this.rejected)return this;var c=setTimeout(function(){u.resolved||u.rejected||u.reject(i||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(f){return clearTimeout(c),f})},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},t.resolve=function(n){return n instanceof t?n:le(n)?new t(function(i,u){return n.then(i,u)}):new t().resolve(n)},t.reject=function(n){return new t().reject(n)},t.asyncReject=function(n){return new t().asyncReject(n)},t.all=function(n){var i=new t,u=n.length,c=[].slice();if(!u)return i.resolve(c),i;for(var f=function(d,w,g){return w.then(function(v){c[d]=v,(u-=1)==0&&i.resolve(c)},function(v){g.reject(v)})},p=0;p<n.length;p++){var l=n[p];if(l instanceof t){if(l.resolved){c[p]=l.value,u-=1;continue}}else if(!le(l)){c[p]=l,u-=1;continue}f(p,t.resolve(l),i)}return u===0&&i.resolve(c),i},t.hash=function(n){var i={},u=[],c=function(p){if(n.hasOwnProperty(p)){var l=n[p];le(l)?u.push(l.then(function(d){i[p]=d})):i[p]=l}};for(var f in n)c(f);return t.all(u).then(function(){return i})},t.map=function(n,i){return t.all(n.map(i))},t.onPossiblyUnhandledException=function(n){return function(i){return Ie.push(i),{cancel:function(){Ie.splice(Ie.indexOf(i),1)}}}(n)},t.try=function(n,i,u){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var c;gt();try{c=n.apply(i,u||[])}catch(f){return Ce(),t.reject(f)}return Ce(),t.resolve(c)},t.delay=function(n){return new t(function(i){setTimeout(i,n)})},t.isPromise=function(n){return!!(n&&n instanceof t)||le(n)},t.flush=function(){return function(n){var i=je=je||new n;return lr(),i}(t)},t}();function Ve(t,o){for(var n=0;n<t.length;n++)try{if(t[n]===o)return n}catch{}return-1}var vt=function(){function t(){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 n=new WeakMap,i={};return Object.freeze(i),n.set(i,"__testvalue__"),n.get(i)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var o=t.prototype;return o._cleanupClosedWindows=function(){for(var n=this.weakmap,i=this.keys,u=0;u<i.length;u++){var c=i[u];if(Be(c)&&Z(c)){if(n)try{n.delete(c)}catch{}i.splice(u,1),this.values.splice(u,1),u-=1}}},o.isSafeToReadWrite=function(n){return!Be(n)},o.set=function(n,i){if(!n)throw new Error("WeakMap expected key");var u=this.weakmap;if(u)try{u.set(n,i)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var c=this.name,f=n[c];f&&f[0]===n?f[1]=i:Object.defineProperty(n,c,{value:[n,i],writable:!0});return}catch{}this._cleanupClosedWindows();var p=this.keys,l=this.values,d=Ve(p,n);d===-1?(p.push(n),l.push(i)):l[d]=i},o.get=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return i.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return u&&u[0]===n?u[1]:void 0}catch{}this._cleanupClosedWindows();var c=Ve(this.keys,n);if(c!==-1)return this.values[c]},o.delete=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];u&&u[0]===n&&(u[0]=u[1]=void 0)}catch{}this._cleanupClosedWindows();var c=this.keys,f=Ve(c,n);f!==-1&&(c.splice(f,1),this.values.splice(f,1))},o.has=function(n){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{if(i.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=n[this.name];return!(!u||u[0]!==n)}catch{}return this._cleanupClosedWindows(),Ve(this.keys,n)!==-1},o.getOrSet=function(n,i){if(this.has(n))return this.get(n);var u=i();return this.set(n,u),u},t}();function hr(t){return t.name||t.__name__||t.displayName||"anonymous"}function pr(t,o){try{delete t.name,t.name=o}catch{}return t.__name__=t.displayName=o,t}function X(){var t="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return t.charAt(Math.floor(Math.random()*t.length))})+"_"+function(o){if(typeof btoa=="function")return btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,function(n,i){return String.fromCharCode(parseInt(i,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(o,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Ze;function gr(t){try{return JSON.stringify([].slice.call(t),function(o,n){return typeof n=="function"?"memoize["+function(i){if(Ze=Ze||new vt,i==null||typeof i!="object"&&typeof i!="function")throw new Error("Invalid object");var u=Ze.get(i);return u||(u=typeof i+":"+X(),Ze.set(i,u)),u}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function sf(){return{}}var We=0,vr=0;function De(t,o){o===void 0&&(o={});var n=o.thisNamespace,i=n!==void 0&&n,u=o.time,c,f,p=We;We+=1;var l=function(){for(var d=arguments.length,w=new Array(d),g=0;g<d;g++)w[g]=arguments[g];p<vr&&(c=null,f=null,p=We,We+=1);var v;v=i?(f=f||new vt).getOrSet(this,sf):c=c||{};var m;try{m=gr(w)}catch{return t.apply(this,arguments)}var S=v[m];if(S&&u&&Date.now()-S.time<u&&(delete v[m],S=null),S)return S.value;var E=Date.now(),A=t.apply(this,arguments);return v[m]={time:E,value:A},A};return l.reset=function(){c=null,f=null},pr(l,(o.name||hr(t))+"::memoized")}De.clear=function(){vr=We};function cf(t){var o={};function n(){for(var i=arguments,u=this,c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];var l=gr(f);return o.hasOwnProperty(l)||(o[l]=x.try(function(){return t.apply(u,i)}).finally(function(){delete o[l]})),o[l]}return n.reset=function(){o={}},pr(n,hr(t)+"::promiseMemoized")}function he(){}function Re(t,o){if(o===void 0&&(o=1),o>=3)return"stringifyError stack overflow";try{if(!t)return"<unknown error: "+{}.toString.call(t)+">";if(typeof t=="string")return t;if(t instanceof Error){var n=t&&t.stack,i=t&&t.message;if(n&&i)return n.indexOf(i)!==-1?n:i+`
3
+ `+n;if(n)return n;if(i)return i}return t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}catch(u){return"Error while stringifying error: "+Re(u,o+1)}}function wr(t){return typeof t=="string"?t:t&&t.toString&&typeof t.toString=="function"?t.toString():{}.toString.call(t)}De(function(t){if(Object.values)return Object.values(t);var o=[];for(var n in t)t.hasOwnProperty(n)&&o.push(t[n]);return o});function wt(t){return{}.toString.call(t)==="[object RegExp]"}function Me(t,o,n){if(t.hasOwnProperty(o))return t[o];var i=n();return t[o]=i,i}function yr(){var t=document.body;if(!t)throw new Error("Body element not found");return t}function mr(){return!!document.body&&document.readyState==="complete"}function br(){return!!document.body&&document.readyState==="interactive"}De(function(){return new x(function(t){if(mr()||br())return t();var o=setInterval(function(){if(mr()||br())return clearInterval(o),t()},10)})});var Ye=typeof document<"u"?document.currentScript:null,ff=De(function(){if(Ye||(Ye=function(){try{var t=function(){try{throw new Error("_")}catch(f){return f.stack||""}}(),o=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(t),n=o&&o[1];if(!n)return;for(var i=0,u=[].slice.call(document.getElementsByTagName("script")).reverse();i<u.length;i++){var c=u[i];if(c.src&&c.src===n)return c}}catch{}}()))return Ye;throw new Error("Can not determine current script")}),df=X();De(function(){var t;try{t=ff()}catch{return df}var o=t.getAttribute("data-uid");if(o&&typeof o=="string"||(o=t.getAttribute("data-uid-auto"))&&typeof o=="string")return o;if(t.src){var n=function(i){for(var u="",c=0;c<i.length;c++){var f=i[c].charCodeAt(0)*c;i[c+1]&&(f+=i[c+1].charCodeAt(0)*(c-1)),u+=String.fromCharCode(97+Math.abs(f)%26)}return u}(JSON.stringify({src:t.src,dataset:t.dataset}));o="uid_"+n.slice(n.length-30)}else o=X();return t.setAttribute("data-uid-auto",o),o});function $e(t){t===void 0&&(t=window);var o="__post_robot_10_0_46__";return t!==window?t[o]:t[o]=t[o]||{}}var _r=function(){return{}};function N(t,o){return t===void 0&&(t="store"),o===void 0&&(o=_r),Me($e(),t,function(){var n=o();return{has:function(i){return n.hasOwnProperty(i)},get:function(i,u){return n.hasOwnProperty(i)?n[i]:u},set:function(i,u){return n[i]=u,u},del:function(i){delete n[i]},getOrSet:function(i,u){return Me(n,i,u)},reset:function(){n=o()},keys:function(){return Object.keys(n)}}})}var lf=function(){};function Je(){var t=$e();return t.WINDOW_WILDCARD=t.WINDOW_WILDCARD||new lf,t.WINDOW_WILDCARD}function q(t,o){return t===void 0&&(t="store"),o===void 0&&(o=_r),N("windowStore").getOrSet(t,function(){var n=new vt,i=function(u){return n.getOrSet(u,o)};return{has:function(u){return i(u).hasOwnProperty(t)},get:function(u,c){var f=i(u);return f.hasOwnProperty(t)?f[t]:c},set:function(u,c){return i(u)[t]=c,c},del:function(u){delete i(u)[t]},getOrSet:function(u,c){return Me(i(u),t,c)}}})}function Er(){return N("instance").getOrSet("instanceID",X)}function Ar(t,o){var n=o.domain,i=q("helloPromises"),u=i.get(t);u&&u.resolve({domain:n});var c=x.resolve({domain:n});return i.set(t,c),c}function yt(t,o){return(0,o.send)(t,"postrobot_hello",{instanceID:Er()},{domain:"*",timeout:-1}).then(function(n){var i=n.origin,u=n.data.instanceID;return Ar(t,{domain:i}),{win:t,domain:i,instanceID:u}})}function Sr(t,o){var n=o.send;return q("windowInstanceIDPromises").getOrSet(t,function(){return yt(t,{send:n}).then(function(i){return i.instanceID})})}function Pr(t){q("knownWindows").set(t,!0)}function mt(t){return typeof t=="object"&&t!==null&&typeof t.__type__=="string"}function Tr(t){return t===void 0?"undefined":t===null?"null":Array.isArray(t)?"array":typeof t=="function"?"function":typeof t=="object"?t instanceof Error?"error":typeof t.then=="function"?"promise":{}.toString.call(t)==="[object RegExp]"?"regex":{}.toString.call(t)==="[object Date]"?"date":"object":typeof t=="string"?"string":typeof t=="number"?"number":typeof t=="boolean"?"boolean":void 0}function pe(t,o){return{__type__:t,__val__:o}}var G,hf=((G={}).function=function(){},G.error=function(t){return pe("error",{message:t.message,stack:t.stack,code:t.code,data:t.data})},G.promise=function(){},G.regex=function(t){return pe("regex",t.source)},G.date=function(t){return pe("date",t.toJSON())},G.array=function(t){return t},G.object=function(t){return t},G.string=function(t){return t},G.number=function(t){return t},G.boolean=function(t){return t},G.null=function(t){return t},G[void 0]=function(t){return pe("undefined",t)},G),pf={},B,gf=((B={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},B.error=function(t){var o=t.stack,n=t.code,i=t.data,u=new Error(t.message);return u.code=n,i&&(u.data=i),u.stack=o+`
4
4
 
5
- `+u.stack,u},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(t){return new RegExp(t)},B.date=function(t){return new Date(t)},B.array=function(t){return t},B.object=function(t){return t},B.string=function(t){return t},B.number=function(t){return t},B.boolean=function(t){return t},B.null=function(t){return t},B[void 0]=function(){},B),vf={};new x(function(t){if(window.document&&window.document.body)return t(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),t(window.document.body)},10)});function bt(){for(var t=N("idToProxyWindow"),o=0,n=t.keys();o<n.length;o++){var i=n[o];t.get(i).shouldClean()&&t.del(i)}}function xr(t,o){var n=o.send,i=o.id,u=i===void 0?X():i,c=t.then(function(l){if(Q(l))return H(l).name}),f=t.then(function(l){if(Z(l))throw new Error("Window is closed, can not determine type");return te(l)?"popup":"iframe"});c.catch(he),f.catch(he);var g=function(){return t.then(function(l){if(!Z(l))return Q(l)?H(l).name:c})};return{id:u,getType:function(){return f},getInstanceID:cf(function(){return t.then(function(l){return Sr(l,{send:n})})}),close:function(){return t.then(uf)},getName:g,focus:function(){return t.then(function(l){l.focus()})},isClosed:function(){return t.then(function(l){return Z(l)})},setLocation:function(l,d){return d===void 0&&(d={}),t.then(function(w){var p=window.location.protocol+"//"+window.location.host,v=d.method,m=v===void 0?"get":v,S=d.body;if(l.indexOf("/")===0)l=""+p+l;else if(!l.match(/^https?:\/\//)&&l.indexOf(p)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(l));if(m==="post")return g().then(function(E){if(!E)throw new Error("Can not post to window without target name");(function(A){var I=A.url,M=A.target,D=A.body,j=A.method,L=j===void 0?"post":j,T=document.createElement("form");if(T.setAttribute("target",M),T.setAttribute("method",L),T.setAttribute("action",I),T.style.display="none",D)for(var R=0,Y=Object.keys(D);R<Y.length;R++){var $,Ne=Y[R],St=document.createElement("input");St.setAttribute("name",Ne),St.setAttribute("value",($=D[Ne])==null?void 0:$.toString()),T.appendChild(St)}yr().appendChild(T),T.submit(),yr().removeChild(T)})({url:l,target:E,method:m,body:S})});if(m!=="get")throw new Error("Unsupported method: "+m);if(Q(w))try{if(w.location&&typeof w.location.replace=="function"){w.location.replace(l);return}}catch{}w.location=l})},setName:function(l){return t.then(function(d){var w=Q(d),p=fr(d);if(!w)throw new Error("Can not set name for cross-domain window: "+l);H(d).name=l,p&&p.setAttribute("name",l),c=x.resolve(l)})}}}var V=function(){function t(n){var i=n.send,u=n.win,c=n.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=c||xr(this.actualWindowPromise,{send:i}),N("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:i})}var o=t.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(n){return n==="popup"})},o.setLocation=function(n,i){var u=this;return this.serializedWindow.setLocation(n,i).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(n){var i=this;return this.serializedWindow.setName(n).then(function(){return i})},o.close=function(){var n=this;return this.serializedWindow.close().then(function(){return n})},o.focus=function(){var n=this,i=this.isPopup(),u=this.getName(),c=x.hash({isPopup:i,name:u}).then(function(g){var l=g.name;g.isPopup&&l&&window.open("",l,"noopener")}),f=this.serializedWindow.focus();return x.all([c,f]).then(function(){return n})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(n,i){var u=i.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=xr(this.actualWindowPromise,{send:u,id:this.getID()}),q("winToProxyWindow").set(n,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(n,i){var u=this,c=i.send;return x.try(function(){return u.actualWindow?n===u.actualWindow:x.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:Sr(n,{send:c})}).then(function(f){var g=f.proxyInstanceID===f.knownWindowInstanceID;return g&&u.setWindow(n,{send:c}),g})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Z(this.actualWindow))},o.serialize=function(){return this.serializedWindow},t.unwrap=function(n){return t.isProxyWindow(n)?n.unwrap():n},t.serialize=function(n,i){var u=i.send;return bt(),t.toProxyWindow(n,{send:u}).serialize()},t.deserialize=function(n,i){var u=i.send;return bt(),N("idToProxyWindow").get(n.id)||new t({serializedWindow:n,send:u})},t.isProxyWindow=function(n){return!!(n&&!Be(n)&&n.isProxyWindow)},t.toProxyWindow=function(n,i){var u=i.send;if(bt(),t.isProxyWindow(n))return n;var c=n;return q("winToProxyWindow").get(c)||new t({win:c,send:u})},t}();function _t(t,o,n,i,u){var c=q("methodStore"),f=N("proxyWindowMethods");V.isProxyWindow(i)?f.set(t,{val:o,name:n,domain:u,source:i}):(f.del(t),c.getOrSet(i,function(){return{}})[t]={domain:u,name:n,val:o,source:i})}function Or(t,o){var n=q("methodStore"),i=N("proxyWindowMethods");return n.getOrSet(t,function(){return{}})[o]||i.get(o)}function Ir(t,o,n,i,u){f=(c={on:u.on,send:u.send}).on,g=c.send,N("builtinListeners").getOrSet("functionCalls",function(){return f("postrobot_method",{domain:"*"},function(w){var p=w.source,v=w.origin,m=w.data,S=m.id,E=m.name,A=Or(p,S);if(!A)throw new Error("Could not find method '"+E+"' with id: "+m.id+" in "+F(window));var I=A.source,M=A.domain,D=A.val;return x.try(function(){if(!_e(M,v))throw new Error("Method '"+m.name+"' domain "+JSON.stringify(wt(A.domain)?A.domain.source:A.domain)+" does not match origin "+v+" in "+F(window));if(V.isProxyWindow(I))return I.matchWindow(p,{send:g}).then(function(j){if(!j)throw new Error("Method call '"+m.name+"' failed - proxy window does not match source in "+F(window))})}).then(function(){return D.apply({source:p,origin:v},m.args)},function(j){return x.try(function(){if(D.onError)return D.onError(j)}).then(function(){throw j.stack&&(j.stack="Remote call to "+E+"("+function(L){return L===void 0&&(L=[]),(T=L,[].slice.call(T)).map(function(R){return typeof R=="string"?"'"+R+"'":R===void 0?"undefined":R===null?"null":typeof R=="boolean"?R.toString():Array.isArray(R)?"[ ... ]":typeof R=="object"?"{ ... }":typeof R=="function"?"() => { ... }":"<"+typeof R+">"}).join(", ");var T}(m.args)+`) failed
5
+ `+u.stack,u},B.promise=function(){throw new Error("Promise serialization is not implemented; nothing to deserialize")},B.regex=function(t){return new RegExp(t)},B.date=function(t){return new Date(t)},B.array=function(t){return t},B.object=function(t){return t},B.string=function(t){return t},B.number=function(t){return t},B.boolean=function(t){return t},B.null=function(t){return t},B[void 0]=function(){},B),vf={};new x(function(t){if(window.document&&window.document.body)return t(window.document.body);var o=setInterval(function(){if(window.document&&window.document.body)return clearInterval(o),t(window.document.body)},10)});function bt(){for(var t=N("idToProxyWindow"),o=0,n=t.keys();o<n.length;o++){var i=n[o];t.get(i).shouldClean()&&t.del(i)}}function xr(t,o){var n=o.send,i=o.id,u=i===void 0?X():i,c=t.then(function(l){if(Q(l))return H(l).name}),f=t.then(function(l){if(Z(l))throw new Error("Window is closed, can not determine type");return te(l)?"popup":"iframe"});c.catch(he),f.catch(he);var p=function(){return t.then(function(l){if(!Z(l))return Q(l)?H(l).name:c})};return{id:u,getType:function(){return f},getInstanceID:cf(function(){return t.then(function(l){return Sr(l,{send:n})})}),close:function(){return t.then(uf)},getName:p,focus:function(){return t.then(function(l){l.focus()})},isClosed:function(){return t.then(function(l){return Z(l)})},setLocation:function(l,d){return d===void 0&&(d={}),t.then(function(w){var g=window.location.protocol+"//"+window.location.host,v=d.method,m=v===void 0?"get":v,S=d.body;if(l.indexOf("/")===0)l=""+g+l;else if(!l.match(/^https?:\/\//)&&l.indexOf(g)!==0)throw new Error("Expected url to be http or https url, or absolute path, got "+JSON.stringify(l));if(m==="post")return p().then(function(E){if(!E)throw new Error("Can not post to window without target name");(function(A){var I=A.url,$=A.target,D=A.body,j=A.method,L=j===void 0?"post":j,T=document.createElement("form");if(T.setAttribute("target",$),T.setAttribute("method",L),T.setAttribute("action",I),T.style.display="none",D)for(var R=0,Y=Object.keys(D);R<Y.length;R++){var M,Ne=Y[R],St=document.createElement("input");St.setAttribute("name",Ne),St.setAttribute("value",(M=D[Ne])==null?void 0:M.toString()),T.appendChild(St)}yr().appendChild(T),T.submit(),yr().removeChild(T)})({url:l,target:E,method:m,body:S})});if(m!=="get")throw new Error("Unsupported method: "+m);if(Q(w))try{if(w.location&&typeof w.location.replace=="function"){w.location.replace(l);return}}catch{}w.location=l})},setName:function(l){return t.then(function(d){var w=Q(d),g=fr(d);if(!w)throw new Error("Can not set name for cross-domain window: "+l);H(d).name=l,g&&g.setAttribute("name",l),c=x.resolve(l)})}}}var V=function(){function t(n){var i=n.send,u=n.win,c=n.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=c||xr(this.actualWindowPromise,{send:i}),N("idToProxyWindow").set(this.getID(),this),u&&this.setWindow(u,{send:i})}var o=t.prototype;return o.getID=function(){return this.serializedWindow.id},o.getType=function(){return this.serializedWindow.getType()},o.isPopup=function(){return this.getType().then(function(n){return n==="popup"})},o.setLocation=function(n,i){var u=this;return this.serializedWindow.setLocation(n,i).then(function(){return u})},o.getName=function(){return this.serializedWindow.getName()},o.setName=function(n){var i=this;return this.serializedWindow.setName(n).then(function(){return i})},o.close=function(){var n=this;return this.serializedWindow.close().then(function(){return n})},o.focus=function(){var n=this,i=this.isPopup(),u=this.getName(),c=x.hash({isPopup:i,name:u}).then(function(p){var l=p.name;p.isPopup&&l&&window.open("",l,"noopener")}),f=this.serializedWindow.focus();return x.all([c,f]).then(function(){return n})},o.isClosed=function(){return this.serializedWindow.isClosed()},o.getWindow=function(){return this.actualWindow},o.setWindow=function(n,i){var u=i.send;this.actualWindow=n,this.actualWindowPromise.resolve(this.actualWindow),this.serializedWindow=xr(this.actualWindowPromise,{send:u,id:this.getID()}),q("winToProxyWindow").set(n,this)},o.awaitWindow=function(){return this.actualWindowPromise},o.matchWindow=function(n,i){var u=this,c=i.send;return x.try(function(){return u.actualWindow?n===u.actualWindow:x.hash({proxyInstanceID:u.getInstanceID(),knownWindowInstanceID:Sr(n,{send:c})}).then(function(f){var p=f.proxyInstanceID===f.knownWindowInstanceID;return p&&u.setWindow(n,{send:c}),p})})},o.unwrap=function(){return this.actualWindow||this},o.getInstanceID=function(){return this.serializedWindow.getInstanceID()},o.shouldClean=function(){return!!(this.actualWindow&&Z(this.actualWindow))},o.serialize=function(){return this.serializedWindow},t.unwrap=function(n){return t.isProxyWindow(n)?n.unwrap():n},t.serialize=function(n,i){var u=i.send;return bt(),t.toProxyWindow(n,{send:u}).serialize()},t.deserialize=function(n,i){var u=i.send;return bt(),N("idToProxyWindow").get(n.id)||new t({serializedWindow:n,send:u})},t.isProxyWindow=function(n){return!!(n&&!Be(n)&&n.isProxyWindow)},t.toProxyWindow=function(n,i){var u=i.send;if(bt(),t.isProxyWindow(n))return n;var c=n;return q("winToProxyWindow").get(c)||new t({win:c,send:u})},t}();function _t(t,o,n,i,u){var c=q("methodStore"),f=N("proxyWindowMethods");V.isProxyWindow(i)?f.set(t,{val:o,name:n,domain:u,source:i}):(f.del(t),c.getOrSet(i,function(){return{}})[t]={domain:u,name:n,val:o,source:i})}function Or(t,o){var n=q("methodStore"),i=N("proxyWindowMethods");return n.getOrSet(t,function(){return{}})[o]||i.get(o)}function Ir(t,o,n,i,u){f=(c={on:u.on,send:u.send}).on,p=c.send,N("builtinListeners").getOrSet("functionCalls",function(){return f("postrobot_method",{domain:"*"},function(w){var g=w.source,v=w.origin,m=w.data,S=m.id,E=m.name,A=Or(g,S);if(!A)throw new Error("Could not find method '"+E+"' with id: "+m.id+" in "+F(window));var I=A.source,$=A.domain,D=A.val;return x.try(function(){if(!_e($,v))throw new Error("Method '"+m.name+"' domain "+JSON.stringify(wt(A.domain)?A.domain.source:A.domain)+" does not match origin "+v+" in "+F(window));if(V.isProxyWindow(I))return I.matchWindow(g,{send:p}).then(function(j){if(!j)throw new Error("Method call '"+m.name+"' failed - proxy window does not match source in "+F(window))})}).then(function(){return D.apply({source:g,origin:v},m.args)},function(j){return x.try(function(){if(D.onError)return D.onError(j)}).then(function(){throw j.stack&&(j.stack="Remote call to "+E+"("+function(L){return L===void 0&&(L=[]),(T=L,[].slice.call(T)).map(function(R){return typeof R=="string"?"'"+R+"'":R===void 0?"undefined":R===null?"null":typeof R=="boolean"?R.toString():Array.isArray(R)?"[ ... ]":typeof R=="object"?"{ ... }":typeof R=="function"?"() => { ... }":"<"+typeof R+">"}).join(", ");var T}(m.args)+`) failed
6
6
 
7
- `+j.stack),j})}).then(function(j){return{result:j,id:S,name:E}})})});var c,f,g,l=n.__id__||X();t=V.unwrap(t);var d=n.__name__||n.name||i;return typeof d=="string"&&typeof d.indexOf=="function"&&d.indexOf("anonymous::")===0&&(d=d.replace("anonymous::",i+"::")),V.isProxyWindow(t)?(_t(l,n,d,t,o),t.awaitWindow().then(function(w){_t(l,n,d,w,o)})):_t(l,n,d,t,o),ge("cross_domain_function",{id:l,name:d})}function jr(t,o,n,i){var u,c=i.on,f=i.send;return function(g,l){l===void 0&&(l=gf);var d=JSON.stringify(g,function(w){var p=this[w];if(mt(this))return p;var v=Tr(p);if(!v)return p;var m=l[v]||hf[v];return m?m(p,w):p});return d===void 0?"undefined":d}(n,((u={}).promise=function(g,l){return function(d,w,p,v,m){return ge("cross_domain_zalgo_promise",{then:Ir(d,w,function(S,E){return p.then(S,E)},v,{on:m.on,send:m.send})})}(t,o,g,l,{on:c,send:f})},u.function=function(g,l){return Ir(t,o,g,l,{on:c,send:f})},u.object=function(g){return Be(g)||V.isProxyWindow(g)?ge("cross_domain_window",V.serialize(g,{send:f})):g},u))}function Cr(t,o,n,i){var u,c=i.send;return function(f,g){if(g===void 0&&(g=vf),f!=="undefined")return JSON.parse(f,function(l,d){if(mt(this))return d;var w,p;if(mt(d)?(w=d.__type__,p=d.__val__):(w=Tr(d),p=d),!w)return p;var v=g[w]||pf[w];return v?v(p,l):p})}(n,((u={}).cross_domain_zalgo_promise=function(f){return function(g,l,d){return new x(d.then)}(0,0,f)},u.cross_domain_function=function(f){return function(g,l,d,w){var p=d.id,v=d.name,m=w.send,S=function(A){A===void 0&&(A={});function I(){var M=arguments;return V.toProxyWindow(g,{send:m}).awaitWindow().then(function(D){var j=Or(D,p);if(j&&j.val!==I)return j.val.apply({source:window,origin:F()},M);var L=[].slice.call(M);return A.fireAndForget?m(D,"postrobot_method",{id:p,name:v,args:L},{domain:l,fireAndForget:!0}):m(D,"postrobot_method",{id:p,name:v,args:L},{domain:l,fireAndForget:!1}).then(function(T){return T.data.result})}).catch(function(D){throw D})}return I.__name__=v,I.__origin__=l,I.__source__=g,I.__id__=p,I.origin=l,I},E=S();return E.fireAndForget=S({fireAndForget:!0}),E}(t,o,f,{send:c})},u.cross_domain_window=function(f){return V.deserialize(f,{send:c})},u))}var Et={};Et.postrobot_post_message=function(t,o,n){n.indexOf("file:")===0&&(n="*"),t.postMessage(o,n)};function At(t,o,n,i){var u=i.on,c=i.send;return x.try(function(){var f=q().getOrSet(t,function(){return{}});return f.buffer=f.buffer||[],f.buffer.push(n),f.flush=f.flush||x.flush().then(function(){if(Z(t))throw new Error("Window is closed");var g=jr(t,o,((l={}).__post_robot_10_0_46__=f.buffer||[],l),{on:u,send:c}),l;delete f.buffer;for(var d=Object.keys(Et),w=[],p=0;p<d.length;p++){var v=d[p];try{Et[v](t,g,o)}catch(m){w.push(m)}}if(w.length===d.length)throw new Error(`All post-robot messaging strategies failed:
7
+ `+j.stack),j})}).then(function(j){return{result:j,id:S,name:E}})})});var c,f,p,l=n.__id__||X();t=V.unwrap(t);var d=n.__name__||n.name||i;return typeof d=="string"&&typeof d.indexOf=="function"&&d.indexOf("anonymous::")===0&&(d=d.replace("anonymous::",i+"::")),V.isProxyWindow(t)?(_t(l,n,d,t,o),t.awaitWindow().then(function(w){_t(l,n,d,w,o)})):_t(l,n,d,t,o),pe("cross_domain_function",{id:l,name:d})}function jr(t,o,n,i){var u,c=i.on,f=i.send;return function(p,l){l===void 0&&(l=pf);var d=JSON.stringify(p,function(w){var g=this[w];if(mt(this))return g;var v=Tr(g);if(!v)return g;var m=l[v]||hf[v];return m?m(g,w):g});return d===void 0?"undefined":d}(n,((u={}).promise=function(p,l){return function(d,w,g,v,m){return pe("cross_domain_zalgo_promise",{then:Ir(d,w,function(S,E){return g.then(S,E)},v,{on:m.on,send:m.send})})}(t,o,p,l,{on:c,send:f})},u.function=function(p,l){return Ir(t,o,p,l,{on:c,send:f})},u.object=function(p){return Be(p)||V.isProxyWindow(p)?pe("cross_domain_window",V.serialize(p,{send:f})):p},u))}function Cr(t,o,n,i){var u,c=i.send;return function(f,p){if(p===void 0&&(p=vf),f!=="undefined")return JSON.parse(f,function(l,d){if(mt(this))return d;var w,g;if(mt(d)?(w=d.__type__,g=d.__val__):(w=Tr(d),g=d),!w)return g;var v=p[w]||gf[w];return v?v(g,l):g})}(n,((u={}).cross_domain_zalgo_promise=function(f){return function(p,l,d){return new x(d.then)}(0,0,f)},u.cross_domain_function=function(f){return function(p,l,d,w){var g=d.id,v=d.name,m=w.send,S=function(A){A===void 0&&(A={});function I(){var $=arguments;return V.toProxyWindow(p,{send:m}).awaitWindow().then(function(D){var j=Or(D,g);if(j&&j.val!==I)return j.val.apply({source:window,origin:F()},$);var L=[].slice.call($);return A.fireAndForget?m(D,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!0}):m(D,"postrobot_method",{id:g,name:v,args:L},{domain:l,fireAndForget:!1}).then(function(T){return T.data.result})}).catch(function(D){throw D})}return I.__name__=v,I.__origin__=l,I.__source__=p,I.__id__=g,I.origin=l,I},E=S();return E.fireAndForget=S({fireAndForget:!0}),E}(t,o,f,{send:c})},u.cross_domain_window=function(f){return V.deserialize(f,{send:c})},u))}var Et={};Et.postrobot_post_message=function(t,o,n){n.indexOf("file:")===0&&(n="*"),t.postMessage(o,n)};function At(t,o,n,i){var u=i.on,c=i.send;return x.try(function(){var f=q().getOrSet(t,function(){return{}});return f.buffer=f.buffer||[],f.buffer.push(n),f.flush=f.flush||x.flush().then(function(){if(Z(t))throw new Error("Window is closed");var p=jr(t,o,((l={}).__post_robot_10_0_46__=f.buffer||[],l),{on:u,send:c}),l;delete f.buffer;for(var d=Object.keys(Et),w=[],g=0;g<d.length;g++){var v=d[g];try{Et[v](t,p,o)}catch(m){w.push(m)}}if(w.length===d.length)throw new Error(`All post-robot messaging strategies failed:
8
8
 
9
9
  `+w.map(function(m,S){return S+". "+Re(m)}).join(`
10
10
 
11
- `))}),f.flush.then(function(){delete f.flush})}).then(he)}function Wr(t){return N("responseListeners").get(t)}function Dr(t){N("responseListeners").del(t)}function Rr(t){return N("erroredResponseListeners").has(t)}function $r(t){var o=t.name,n=t.win,i=t.domain,u=q("requestListeners");if(n==="*"&&(n=null),i==="*"&&(i=null),!o)throw new Error("Name required to get request listener");for(var c=0,f=[n,Je()];c<f.length;c++){var g=f[c];if(g){var l=u.get(g);if(l){var d=l[o];if(d){if(i&&typeof i=="string"){if(d[i])return d[i];if(d.__domain_regex__)for(var w=0,p=d.__domain_regex__;w<p.length;w++){var v=p[w],m=v.listener;if(_e(v.regex,i))return m}}if(d["*"])return d["*"]}}}}}function wf(t,o,n,i){var u=i.on,c=i.send,f=$r({name:n.name,win:t,domain:o}),g=n.name==="postrobot_method"&&n.data&&typeof n.data.name=="string"?n.data.name+"()":n.name;function l(d,w,p){return x.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return At(t,o,{id:X(),origin:F(window),type:"postrobot_message_response",hash:n.hash,name:n.name,ack:d,data:w,error:p},{on:u,send:c})}catch(v){throw new Error("Send response message failed for "+g+" in "+F()+`
11
+ `))}),f.flush.then(function(){delete f.flush})}).then(he)}function Wr(t){return N("responseListeners").get(t)}function Dr(t){N("responseListeners").del(t)}function Rr(t){return N("erroredResponseListeners").has(t)}function Mr(t){var o=t.name,n=t.win,i=t.domain,u=q("requestListeners");if(n==="*"&&(n=null),i==="*"&&(i=null),!o)throw new Error("Name required to get request listener");for(var c=0,f=[n,Je()];c<f.length;c++){var p=f[c];if(p){var l=u.get(p);if(l){var d=l[o];if(d){if(i&&typeof i=="string"){if(d[i])return d[i];if(d.__domain_regex__)for(var w=0,g=d.__domain_regex__;w<g.length;w++){var v=g[w],m=v.listener;if(_e(v.regex,i))return m}}if(d["*"])return d["*"]}}}}}function wf(t,o,n,i){var u=i.on,c=i.send,f=Mr({name:n.name,win:t,domain:o}),p=n.name==="postrobot_method"&&n.data&&typeof n.data.name=="string"?n.data.name+"()":n.name;function l(d,w,g){return x.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return At(t,o,{id:X(),origin:F(window),type:"postrobot_message_response",hash:n.hash,name:n.name,ack:d,data:w,error:g},{on:u,send:c})}catch(v){throw new Error("Send response message failed for "+p+" in "+F()+`
12
12
 
13
- `+Re(v))}})}return x.all([x.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return At(t,o,{id:X(),origin:F(window),type:"postrobot_message_ack",hash:n.hash,name:n.name},{on:u,send:c})}catch(d){throw new Error("Send ack message failed for "+g+" in "+F()+`
13
+ `+Re(v))}})}return x.all([x.flush().then(function(){if(!n.fireAndForget&&!Z(t))try{return At(t,o,{id:X(),origin:F(window),type:"postrobot_message_ack",hash:n.hash,name:n.name},{on:u,send:c})}catch(d){throw new Error("Send ack message failed for "+p+" in "+F()+`
14
14
 
15
- `+Re(d))}}),x.try(function(){if(!f)throw new Error("No handler found for post message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return f.handler({source:t,origin:o,data:n.data})}).then(function(d){return l("success",d)},function(d){return l("error",null,d)})]).then(he).catch(function(d){if(f&&f.handleError)return f.handleError(d);throw d})}function yf(t,o,n){if(!Rr(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message ack for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!_e(i.domain,o))throw new Error("Ack origin "+o+" does not match domain "+i.domain.toString());if(t!==i.win)throw new Error("Ack source does not match registered window")}catch(u){i.promise.reject(u)}i.ack=!0}}function mf(t,o,n){if(!Rr(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message response for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!_e(i.domain,o))throw new Error("Response origin "+o+" does not match domain "+(u=i.domain,Array.isArray(u)?"("+u.join(" | ")+")":y(u)?"RegExp("+u.toString()+")":u.toString()));var u;if(t!==i.win)throw new Error("Response source does not match registered window");Dr(n.hash),n.ack==="error"?i.promise.reject(n.error):n.ack==="success"&&i.promise.resolve({source:t,origin:o,data:n.data})}}function Mr(t,o){var n=o.on,i=o.send,u=N("receivedMessages");try{if(!window||window.closed||!t.source)return}catch{return}var c=t.source,f=t.origin,g=function(w,p,v,m){var S=m.on,E=m.send,A;try{A=Cr(p,v,w,{on:S,send:E})}catch{return}if(A&&typeof A=="object"&&A!==null){var I=A.__post_robot_10_0_46__;if(Array.isArray(I))return I}}(t.data,c,f,{on:n,send:i});if(g){Pr(c);for(var l=0;l<g.length;l++){var d=g[l];if(u.has(d.id)||(u.set(d.id,!0),Z(c)&&!d.fireAndForget))return;d.origin.indexOf("file:")===0&&(f="file://");try{d.type==="postrobot_message_request"?wf(c,f,d,{on:n,send:i}):d.type==="postrobot_message_response"?mf(c,f,d):d.type==="postrobot_message_ack"&&yf(c,f,d)}catch(w){setTimeout(function(){throw w},0)}}}}function re(t,o,n){if(!t)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(n=o,o={}),!n)throw new Error("Expected handler");var i=function u(c,f){var g=c.name,l=c.win,d=c.domain,w=q("requestListeners");if(!g||typeof g!="string")throw new Error("Name required to add request listener");if(l&&l!=="*"&&V.isProxyWindow(l)){var p=l.awaitWindow().then(function($){return u({name:g,win:$,domain:d},f)});return{cancel:function(){p.then(function($){return $.cancel()},he)}}}var v=l;if(Array.isArray(v)){for(var m=[],S=0,E=v;S<E.length;S++)m.push(u({name:g,domain:d,win:E[S]},f));return{cancel:function(){for(var $=0;$<m.length;$++)m[$].cancel()}}}if(Array.isArray(d)){for(var A=[],I=0,M=d;I<M.length;I++)A.push(u({name:g,win:v,domain:M[I]},f));return{cancel:function(){for(var $=0;$<A.length;$++)A[$].cancel()}}}var D=$r({name:g,win:v,domain:d});v&&v!=="*"||(v=Je());var j=(d=d||"*").toString();if(D)throw v&&d?new Error("Request listener already exists for "+g+" on domain "+d.toString()+" for "+(v===Je()?"wildcard":"specified")+" window"):v?new Error("Request listener already exists for "+g+" for "+(v===Je()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+g+" on domain "+d.toString()):new Error("Request listener already exists for "+g);var L=w.getOrSet(v,function(){return{}}),T=$e(L,g,function(){return{}}),R,Y;return wt(d)?(R=$e(T,"__domain_regex__",function(){return[]})).push(Y={regex:d,listener:f}):T[j]=f,{cancel:function(){delete T[j],Y&&(R.splice(R.indexOf(Y,1)),R.length||delete T.__domain_regex__),Object.keys(T).length||delete L[g],v&&!Object.keys(L).length&&w.del(v)}}}({name:t,win:o.window,domain:o.domain||"*"},{handler:n||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){i.cancel()}}}function bf(t,o,n){typeof(o=o||{})=="function"&&(n=o,o={});var i=new x,u;return o.errorHandler=function(c){u.cancel(),i.reject(c)},u=re(t,o,function(c){if(u.cancel(),i.resolve(c),n)return n(c)}),i.cancel=u.cancel,i}var oe=function t(o,n,i,u){var c=(u=u||{}).domain||"*",f=u.timeout||-1,g=u.timeout||5e3,l=u.fireAndForget||!1;return V.toProxyWindow(o,{send:t}).awaitWindow().then(function(d){return x.try(function(){if(function(w,p,v){if(!w)throw new Error("Expected name");if(v&&typeof v!="string"&&!Array.isArray(v)&&!wt(v))throw new TypeError("Can not send "+w+". Expected domain "+JSON.stringify(v)+" to be a string, array, or regex");if(Z(p))throw new Error("Can not send "+w+". Target window is closed")}(n,d,c),function(w,p){var v=cr(p);if(v)return v===w;if(p===w||function(E){E===void 0&&(E=window);try{if(E.top)return E.top}catch{}if(K(E)===E)return E;try{if(k(window,E)&&window.top)return window.top}catch{}try{if(k(E,window)&&window.top)return window.top}catch{}for(var A=0,I=function D(j){for(var L=[],T=0,R=sr(j);T<R.length;T++){var Y=R[T];L.push(Y);for(var $=0,Ne=D(Y);$<Ne.length;$++)L.push(Ne[$])}return L}(E);A<I.length;A++){var M=I[A];try{if(M.top)return M.top}catch{}if(K(M)===M)return M}}(p)===p)return!1;for(var m=0,S=sr(w);m<S.length;m++)if(S[m]===p)return!0;return!1}(window,d))return function(w,p,v){p===void 0&&(p=5e3),v===void 0&&(v="Window");var m=function(S){return q("helloPromises").getOrSet(S,function(){return new x})}(w);return p!==-1&&(m=m.timeout(p,new Error(v+" did not load after "+p+"ms"))),m}(d,g)}).then(function(w){return function(p,v,m,S){var E=S.send;return x.try(function(){return typeof v=="string"?v:x.try(function(){return m||yt(p,{send:E}).then(function(A){return A.domain})}).then(function(A){if(!_e(v,v))throw new Error("Domain "+wr(v)+" does not match "+wr(v));return A})})}(d,c,(w===void 0?{}:w).domain,{send:t})}).then(function(w){var p=w,v=n==="postrobot_method"&&i&&typeof i.name=="string"?i.name+"()":n,m=new x,S=n+"_"+X();if(!l){var E={name:n,win:d,domain:p,promise:m};(function(T,R){N("responseListeners").set(T,R)})(S,E);var A=q("requestPromises").getOrSet(d,function(){return[]});A.push(m),m.catch(function(){(function(T){N("erroredResponseListeners").set(T,!0)})(S),Dr(S)});var I=function(T){return q("knownWindows").get(T,!1)}(d)?1e4:2e3,M=f,D=I,j=M,L=function(T,R){var Y;return function $(){Y=setTimeout(function(){(function(){if(Z(d))return m.reject(new Error("Window closed for "+n+" before "+(E.ack?"response":"ack")));if(E.cancelled)return m.reject(new Error("Response listener was cancelled for "+n));D=Math.max(D-500,0),j!==-1&&(j=Math.max(j-500,0)),E.ack||D!==0?j===0&&m.reject(new Error("No response for postMessage "+v+" in "+F()+" in "+M+"ms")):m.reject(new Error("No ack for postMessage "+v+" in "+F()+" in "+I+"ms"))})(),$()},500)}(),{cancel:function(){clearTimeout(Y)}}}();m.finally(function(){L.cancel(),A.splice(A.indexOf(m,1))}).catch(he)}return At(d,p,{id:X(),origin:F(window),type:"postrobot_message_request",hash:S,name:n,data:i,fireAndForget:l},{on:re,send:t}).then(function(){return l?m.resolve():m},function(T){throw new Error("Send request message failed for "+v+" in "+F()+`
15
+ `+Re(d))}}),x.try(function(){if(!f)throw new Error("No handler found for post message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);return f.handler({source:t,origin:o,data:n.data})}).then(function(d){return l("success",d)},function(d){return l("error",null,d)})]).then(he).catch(function(d){if(f&&f.handleError)return f.handleError(d);throw d})}function yf(t,o,n){if(!Rr(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message ack for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);try{if(!_e(i.domain,o))throw new Error("Ack origin "+o+" does not match domain "+i.domain.toString());if(t!==i.win)throw new Error("Ack source does not match registered window")}catch(u){i.promise.reject(u)}i.ack=!0}}function mf(t,o,n){if(!Rr(n.hash)){var i=Wr(n.hash);if(!i)throw new Error("No handler found for post message response for message: "+n.name+" from "+o+" in "+window.location.protocol+"//"+window.location.host+window.location.pathname);if(!_e(i.domain,o))throw new Error("Response origin "+o+" does not match domain "+(u=i.domain,Array.isArray(u)?"("+u.join(" | ")+")":y(u)?"RegExp("+u.toString()+")":u.toString()));var u;if(t!==i.win)throw new Error("Response source does not match registered window");Dr(n.hash),n.ack==="error"?i.promise.reject(n.error):n.ack==="success"&&i.promise.resolve({source:t,origin:o,data:n.data})}}function $r(t,o){var n=o.on,i=o.send,u=N("receivedMessages");try{if(!window||window.closed||!t.source)return}catch{return}var c=t.source,f=t.origin,p=function(w,g,v,m){var S=m.on,E=m.send,A;try{A=Cr(g,v,w,{on:S,send:E})}catch{return}if(A&&typeof A=="object"&&A!==null){var I=A.__post_robot_10_0_46__;if(Array.isArray(I))return I}}(t.data,c,f,{on:n,send:i});if(p){Pr(c);for(var l=0;l<p.length;l++){var d=p[l];if(u.has(d.id)||(u.set(d.id,!0),Z(c)&&!d.fireAndForget))return;d.origin.indexOf("file:")===0&&(f="file://");try{d.type==="postrobot_message_request"?wf(c,f,d,{on:n,send:i}):d.type==="postrobot_message_response"?mf(c,f,d):d.type==="postrobot_message_ack"&&yf(c,f,d)}catch(w){setTimeout(function(){throw w},0)}}}}function re(t,o,n){if(!t)throw new Error("Expected name");if(typeof(o=o||{})=="function"&&(n=o,o={}),!n)throw new Error("Expected handler");var i=function u(c,f){var p=c.name,l=c.win,d=c.domain,w=q("requestListeners");if(!p||typeof p!="string")throw new Error("Name required to add request listener");if(l&&l!=="*"&&V.isProxyWindow(l)){var g=l.awaitWindow().then(function(M){return u({name:p,win:M,domain:d},f)});return{cancel:function(){g.then(function(M){return M.cancel()},he)}}}var v=l;if(Array.isArray(v)){for(var m=[],S=0,E=v;S<E.length;S++)m.push(u({name:p,domain:d,win:E[S]},f));return{cancel:function(){for(var M=0;M<m.length;M++)m[M].cancel()}}}if(Array.isArray(d)){for(var A=[],I=0,$=d;I<$.length;I++)A.push(u({name:p,win:v,domain:$[I]},f));return{cancel:function(){for(var M=0;M<A.length;M++)A[M].cancel()}}}var D=Mr({name:p,win:v,domain:d});v&&v!=="*"||(v=Je());var j=(d=d||"*").toString();if(D)throw v&&d?new Error("Request listener already exists for "+p+" on domain "+d.toString()+" for "+(v===Je()?"wildcard":"specified")+" window"):v?new Error("Request listener already exists for "+p+" for "+(v===Je()?"wildcard":"specified")+" window"):d?new Error("Request listener already exists for "+p+" on domain "+d.toString()):new Error("Request listener already exists for "+p);var L=w.getOrSet(v,function(){return{}}),T=Me(L,p,function(){return{}}),R,Y;return wt(d)?(R=Me(T,"__domain_regex__",function(){return[]})).push(Y={regex:d,listener:f}):T[j]=f,{cancel:function(){delete T[j],Y&&(R.splice(R.indexOf(Y,1)),R.length||delete T.__domain_regex__),Object.keys(T).length||delete L[p],v&&!Object.keys(L).length&&w.del(v)}}}({name:t,win:o.window,domain:o.domain||"*"},{handler:n||o.handler,handleError:o.errorHandler||function(u){throw u}});return{cancel:function(){i.cancel()}}}function bf(t,o,n){typeof(o=o||{})=="function"&&(n=o,o={});var i=new x,u;return o.errorHandler=function(c){u.cancel(),i.reject(c)},u=re(t,o,function(c){if(u.cancel(),i.resolve(c),n)return n(c)}),i.cancel=u.cancel,i}var oe=function t(o,n,i,u){var c=(u=u||{}).domain||"*",f=u.timeout||-1,p=u.timeout||5e3,l=u.fireAndForget||!1;return V.toProxyWindow(o,{send:t}).awaitWindow().then(function(d){return x.try(function(){if(function(w,g,v){if(!w)throw new Error("Expected name");if(v&&typeof v!="string"&&!Array.isArray(v)&&!wt(v))throw new TypeError("Can not send "+w+". Expected domain "+JSON.stringify(v)+" to be a string, array, or regex");if(Z(g))throw new Error("Can not send "+w+". Target window is closed")}(n,d,c),function(w,g){var v=cr(g);if(v)return v===w;if(g===w||function(E){E===void 0&&(E=window);try{if(E.top)return E.top}catch{}if(K(E)===E)return E;try{if(k(window,E)&&window.top)return window.top}catch{}try{if(k(E,window)&&window.top)return window.top}catch{}for(var A=0,I=function D(j){for(var L=[],T=0,R=sr(j);T<R.length;T++){var Y=R[T];L.push(Y);for(var M=0,Ne=D(Y);M<Ne.length;M++)L.push(Ne[M])}return L}(E);A<I.length;A++){var $=I[A];try{if($.top)return $.top}catch{}if(K($)===$)return $}}(g)===g)return!1;for(var m=0,S=sr(w);m<S.length;m++)if(S[m]===g)return!0;return!1}(window,d))return function(w,g,v){g===void 0&&(g=5e3),v===void 0&&(v="Window");var m=function(S){return q("helloPromises").getOrSet(S,function(){return new x})}(w);return g!==-1&&(m=m.timeout(g,new Error(v+" did not load after "+g+"ms"))),m}(d,p)}).then(function(w){return function(g,v,m,S){var E=S.send;return x.try(function(){return typeof v=="string"?v:x.try(function(){return m||yt(g,{send:E}).then(function(A){return A.domain})}).then(function(A){if(!_e(v,v))throw new Error("Domain "+wr(v)+" does not match "+wr(v));return A})})}(d,c,(w===void 0?{}:w).domain,{send:t})}).then(function(w){var g=w,v=n==="postrobot_method"&&i&&typeof i.name=="string"?i.name+"()":n,m=new x,S=n+"_"+X();if(!l){var E={name:n,win:d,domain:g,promise:m};(function(T,R){N("responseListeners").set(T,R)})(S,E);var A=q("requestPromises").getOrSet(d,function(){return[]});A.push(m),m.catch(function(){(function(T){N("erroredResponseListeners").set(T,!0)})(S),Dr(S)});var I=function(T){return q("knownWindows").get(T,!1)}(d)?1e4:2e3,$=f,D=I,j=$,L=function(T,R){var Y;return function M(){Y=setTimeout(function(){(function(){if(Z(d))return m.reject(new Error("Window closed for "+n+" before "+(E.ack?"response":"ack")));if(E.cancelled)return m.reject(new Error("Response listener was cancelled for "+n));D=Math.max(D-500,0),j!==-1&&(j=Math.max(j-500,0)),E.ack||D!==0?j===0&&m.reject(new Error("No response for postMessage "+v+" in "+F()+" in "+$+"ms")):m.reject(new Error("No ack for postMessage "+v+" in "+F()+" in "+I+"ms"))})(),M()},500)}(),{cancel:function(){clearTimeout(Y)}}}();m.finally(function(){L.cancel(),A.splice(A.indexOf(m,1))}).catch(he)}return At(d,g,{id:X(),origin:F(window),type:"postrobot_message_request",hash:S,name:n,data:i,fireAndForget:l},{on:re,send:t}).then(function(){return l?m.resolve():m},function(T){throw new Error("Send request message failed for "+v+" in "+F()+`
16
16
 
17
- `+Re(T))})})})};function _f(t,o,n){return jr(t,o,n,{on:re,send:oe})}function Ef(t,o,n){return Cr(t,o,n,{on:re,send:oe})}function Af(t){return new V({send:oe,win:t})}function Sf(t){return V.toProxyWindow(t,{send:oe})}function Nr(){Me().initialized||(Me().initialized=!0,o=(t={on:re,send:oe}).on,n=t.send,(i=Me()).receiveMessage=i.receiveMessage||function(u){return Mr(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;N().getOrSet("postMessageListener",function(){return function(g,l,d){return g.addEventListener("message",d),{cancel:function(){g.removeEventListener("message",d)}}}(window,0,function(g){(function(l,d){var w=d.on,p=d.send;x.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");Mr({source:v,origin:m,data:S},{on:w,send:p})}})})(g,{on:c,send:f})})})}({on:re,send:oe}),function(u){var c=u.on,f=u.send;N("builtinListeners").getOrSet("helloListener",function(){var g=c("postrobot_hello",{domain:"*"},function(d){return Ar(d.source,{domain:d.origin}),{instanceID:Er()}}),l=cr();return l&&yt(l,{send:f}).catch(function(d){}),g})}({on:re,send:oe}));var t,o,n,i}function Pf(){(function(){for(var o=N("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=N().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Tf=!0;function xf(t){for(var o=0,n=q("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(he)}Nr()}])})})(ir);var rf=ir.exports;(function(e){e.exports=rf,e.exports.default=e.exports})(or);var ar=or.exports;const ur=Ee({__proto__:null,default:nf(ar)},[ar]);_.ADMIN_API_METHOD_TYPES=kn,_.ADMIN_API_TYPES=ht,_.ADMIN_MESSAGE=Qn,_.ADMIN_MESSAGE_TYPES=Gc,_.PITCHER_EVENT=Kc,_.PitcherBroadcastedEventName=nr,_.PitcherEventName=tr,_.PitcherExternalEventName=rr,_.PitcherMessageType=Xn,_.PitcherResponseStatus=er,_.UI_API_METHOD_TYPES=Kn,_.UI_MESSAGE=zc,_.UI_MESSAGE_TYPES=Uc,_.useAdmin=ef,_.usePitcherApi=Qc,_.useUi=kc,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
17
+ `+Re(T))})})})};function _f(t,o,n){return jr(t,o,n,{on:re,send:oe})}function Ef(t,o,n){return Cr(t,o,n,{on:re,send:oe})}function Af(t){return new V({send:oe,win:t})}function Sf(t){return V.toProxyWindow(t,{send:oe})}function Nr(){$e().initialized||($e().initialized=!0,o=(t={on:re,send:oe}).on,n=t.send,(i=$e()).receiveMessage=i.receiveMessage||function(u){return $r(u,{on:o,send:n})},function(u){var c=u.on,f=u.send;N().getOrSet("postMessageListener",function(){return function(p,l,d){return p.addEventListener("message",d),{cancel:function(){p.removeEventListener("message",d)}}}(window,0,function(p){(function(l,d){var w=d.on,g=d.send;x.try(function(){var v=l.source||l.sourceElement,m=l.origin||l.originalEvent&&l.originalEvent.origin,S=l.data;if(m==="null"&&(m="file://"),v){if(!m)throw new Error("Post message did not have origin domain");$r({source:v,origin:m,data:S},{on:w,send:g})}})})(p,{on:c,send:f})})})}({on:re,send:oe}),function(u){var c=u.on,f=u.send;N("builtinListeners").getOrSet("helloListener",function(){var p=c("postrobot_hello",{domain:"*"},function(d){return Ar(d.source,{domain:d.origin}),{instanceID:Er()}}),l=cr();return l&&yt(l,{send:f}).catch(function(d){}),p})}({on:re,send:oe}));var t,o,n,i}function Pf(){(function(){for(var o=N("responseListeners"),n=0,i=o.keys();n<i.length;n++){var u=i[n],c=o.get(u);c&&(c.cancelled=!0),o.del(u)}})(),(t=N().get("postMessageListener"))&&t.cancel();var t;delete window.__post_robot_10_0_46__}var Tf=!0;function xf(t){for(var o=0,n=q("requestPromises").get(t,[]);o<n.length;o++)n[o].reject(new Error("Window "+(Z(t)?"closed":"cleaned up")+" before response")).catch(he)}Nr()}])})})(ir);var rf=ir.exports;(function(e){e.exports=rf,e.exports.default=e.exports})(or);var ar=or.exports;const ur=Ee({__proto__:null,default:nf(ar)},[ar]);_.ADMIN_API_METHOD_TYPES=kn,_.ADMIN_API_TYPES=ht,_.ADMIN_MESSAGE=Qn,_.ADMIN_MESSAGE_TYPES=Gc,_.PITCHER_EVENT=Kc,_.PitcherBroadcastedEventName=nr,_.PitcherEventName=tr,_.PitcherExternalEventName=rr,_.PitcherMessageType=Xn,_.PitcherResponseStatus=er,_.UI_API_METHOD_TYPES=Kn,_.UI_MESSAGE=zc,_.UI_MESSAGE_TYPES=Uc,_.useAdmin=ef,_.usePitcherApi=Qc,_.useUi=kc,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})});
18
18
  //# sourceMappingURL=js-api.umd.min.js.map