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